@codefast/ui 0.1.9 → 0.1.11
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/chunk-CE6DSAWA.cjs +2 -0
- package/dist/chunk-CE6DSAWA.cjs.map +1 -0
- package/dist/chunk-DULXJDFQ.js +2 -0
- package/dist/chunk-DULXJDFQ.js.map +1 -0
- package/dist/chunk-VEXIU3VB.js +2 -0
- package/dist/chunk-VEXIU3VB.js.map +1 -0
- package/dist/chunk-WQGHLC2A.js +2 -0
- package/dist/chunk-WQGHLC2A.js.map +1 -0
- package/dist/{chunk-BASRQOAA.cjs → chunk-YIBPK6E7.cjs} +2 -2
- package/dist/chunk-YIBPK6E7.cjs.map +1 -0
- package/dist/chunk-YOJAJOXD.cjs +2 -0
- package/dist/chunk-YOJAJOXD.cjs.map +1 -0
- package/dist/react/alert-dialog.cjs +1 -1
- package/dist/react/alert-dialog.js +1 -1
- package/dist/react/button.cjs +1 -1
- package/dist/react/button.d.cts +21 -7
- package/dist/react/button.d.ts +21 -7
- package/dist/react/button.js +1 -1
- package/dist/react/calendar.cjs +1 -1
- package/dist/react/calendar.js +1 -1
- package/dist/react/carousel.cjs +1 -1
- package/dist/react/carousel.js +1 -1
- package/dist/react/checkbox-cards.cjs +1 -1
- package/dist/react/checkbox-cards.cjs.map +1 -1
- package/dist/react/checkbox-cards.d.cts +4 -8
- package/dist/react/checkbox-cards.d.ts +4 -8
- package/dist/react/checkbox-cards.js +1 -1
- package/dist/react/checkbox-cards.js.map +1 -1
- package/dist/react/checkbox-group.cjs +1 -1
- package/dist/react/checkbox-group.cjs.map +1 -1
- package/dist/react/checkbox-group.d.cts +5 -9
- package/dist/react/checkbox-group.d.ts +5 -9
- package/dist/react/checkbox-group.js +1 -1
- package/dist/react/checkbox-group.js.map +1 -1
- package/dist/react/command.cjs +1 -1
- package/dist/react/command.js +1 -1
- package/dist/react/data-table.cjs +1 -1
- package/dist/react/data-table.cjs.map +1 -1
- package/dist/react/data-table.js +1 -1
- package/dist/react/data-table.js.map +1 -1
- package/dist/react/dialog.cjs +1 -1
- package/dist/react/dialog.js +1 -1
- package/dist/react/drawer.cjs +1 -1
- package/dist/react/drawer.js +1 -1
- package/dist/react/number-input.cjs +1 -1
- package/dist/react/number-input.cjs.map +1 -1
- package/dist/react/number-input.d.cts +4 -7
- package/dist/react/number-input.d.ts +4 -7
- package/dist/react/number-input.js +1 -1
- package/dist/react/number-input.js.map +1 -1
- package/dist/react/pagination.cjs +1 -1
- package/dist/react/pagination.cjs.map +1 -1
- package/dist/react/pagination.d.cts +2 -2
- package/dist/react/pagination.d.ts +2 -2
- package/dist/react/pagination.js +1 -1
- package/dist/react/pagination.js.map +1 -1
- package/dist/react/sheet.cjs +1 -1
- package/dist/react/sheet.cjs.map +1 -1
- package/dist/react/sheet.js +1 -1
- package/dist/react/sheet.js.map +1 -1
- package/dist/react/text-input.cjs +1 -1
- package/dist/react/text-input.cjs.map +1 -1
- package/dist/react/text-input.d.cts +150 -9
- package/dist/react/text-input.d.ts +150 -9
- package/dist/react/text-input.js +1 -1
- package/dist/react/text-input.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +10 -11
- package/dist/chunk-3Z6QUP75.cjs +0 -2
- package/dist/chunk-3Z6QUP75.cjs.map +0 -1
- package/dist/chunk-76TT2QSB.cjs +0 -2
- package/dist/chunk-76TT2QSB.cjs.map +0 -1
- package/dist/chunk-7NEJ7IQ3.cjs +0 -2
- package/dist/chunk-7NEJ7IQ3.cjs.map +0 -1
- package/dist/chunk-BASRQOAA.cjs.map +0 -1
- package/dist/chunk-CAK5VDBY.js +0 -2
- package/dist/chunk-CAK5VDBY.js.map +0 -1
- package/dist/chunk-EYL4UQ5E.js +0 -2
- package/dist/chunk-EYL4UQ5E.js.map +0 -1
- package/dist/chunk-OJI2FD2T.cjs +0 -2
- package/dist/chunk-OJI2FD2T.cjs.map +0 -1
- package/dist/chunk-QCHBG2C4.js +0 -2
- package/dist/chunk-QCHBG2C4.js.map +0 -1
- package/dist/chunk-U62JBFEF.js +0 -2
- package/dist/chunk-U62JBFEF.js.map +0 -1
- package/dist/chunk-UYD4MGAB.cjs +0 -2
- package/dist/chunk-UYD4MGAB.cjs.map +0 -1
- package/dist/chunk-VOYJX4JS.js +0 -2
- package/dist/chunk-VOYJX4JS.js.map +0 -1
- package/dist/chunk-W5RHRZIO.js +0 -2
- package/dist/chunk-W5RHRZIO.js.map +0 -1
- package/dist/react/primitive/checkbox-group.cjs +0 -2
- package/dist/react/primitive/checkbox-group.cjs.map +0 -1
- package/dist/react/primitive/checkbox-group.d.cts +0 -35
- package/dist/react/primitive/checkbox-group.d.ts +0 -35
- package/dist/react/primitive/checkbox-group.js +0 -2
- package/dist/react/primitive/checkbox-group.js.map +0 -1
- package/dist/react/primitive/input.cjs +0 -2
- package/dist/react/primitive/input.cjs.map +0 -1
- package/dist/react/primitive/input.d.cts +0 -20
- package/dist/react/primitive/input.d.ts +0 -20
- package/dist/react/primitive/input.js +0 -2
- package/dist/react/primitive/input.js.map +0 -1
- package/dist/react/primitive/number-input.cjs +0 -2
- package/dist/react/primitive/number-input.cjs.map +0 -1
- package/dist/react/primitive/number-input.d.cts +0 -36
- package/dist/react/primitive/number-input.d.ts +0 -36
- package/dist/react/primitive/number-input.js +0 -2
- package/dist/react/primitive/number-input.js.map +0 -1
- package/dist/react/style/input.cjs +0 -2
- package/dist/react/style/input.cjs.map +0 -1
- package/dist/react/style/input.d.cts +0 -161
- package/dist/react/style/input.d.ts +0 -161
- package/dist/react/style/input.js +0 -2
- package/dist/react/style/input.js.map +0 -1
package/dist/chunk-76TT2QSB.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _react = require('react'); var n = _interopRequireWildcard(_react);var _reactcontext = require('@radix-ui/react-context');var _reactcomposerefs = require('@radix-ui/react-compose-refs');var _reactprimitive = require('@radix-ui/react-primitive');var _jsxruntime = require('react/jsx-runtime');var i="Input",[P,M]=_reactcontext.createContextScope.call(void 0, i),[l,R]=P(i);function d(p){let{__scopeInput:o,...r}=p,t=n.useRef(null),u=m=>{if(m.target.closest("input, a, button"))return;let e=t.current;e&&requestAnimationFrame(()=>{if(e.type==="file"){e.click();return}e.focus()})};return _jsxruntime.jsx.call(void 0, l,{inputRef:t,scope:o,children:_jsxruntime.jsx.call(void 0, _reactprimitive.Primitive.div,{role:"presentation",onPointerDown:u,...r})})}d.displayName=i;var I="InputItem",y= exports.c =n.forwardRef(({__scopeInput:p,...o},r)=>{let{inputRef:t}=R(I,p),u=_reactcomposerefs.useComposedRefs.call(void 0, r,t);return _jsxruntime.jsx.call(void 0, _reactprimitive.Primitive.input,{ref:u,type:"text",...o})});y.displayName=I;exports.a = M; exports.b = d; exports.c = y;
|
|
2
|
-
//# sourceMappingURL=chunk-76TT2QSB.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/primitive/input.tsx"],"names":["INPUT_NAME","createInputContext","createInputScope","createContextScope","InputProvider","useInputContext","Input","inputProps","__scopeInput","props","inputRef","handlePointerDown","event","inputElement","jsx","Primitive","INPUT_ITEM_NAME","InputItem","forwardedRef","composedInputRef","useComposedRefs"],"mappings":"AAEA,kaAAuB,uDACwB,gEACf,2DACN,+CAoDpB,IA9CAA,CAAAA,CAAa,OAAA,CAGb,CAACC,CAAAA,CAAoBC,CAAgB,CAAA,CAAIC,8CAAAA,CAA6B,CAAA,CAMtE,CAACC,CAAAA,CAAeC,CAAe,CAAA,CAAIJ,CAAAA,CAAsCD,CAAU,CAAA,CAMzF,SAASM,CAAAA,CAAMC,CAAAA,CAA2C,CACxD,GAAM,CAAE,YA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,CAAO,CACxE,CACF,CAAA,CAEAQ,CAAAA,CAAU,WAAA,CAAcD,CAAAA,CAAAA,4CAAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-76TT2QSB.cjs","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -----------------------------------------------------------------------------\n * Component: Input\n * -------------------------------------------------------------------------- */\n\nconst INPUT_NAME = 'Input';\n\ntype ScopedProps<P> = P & { __scopeInput?: Scope };\nconst [createInputContext, createInputScope] = createContextScope(INPUT_NAME);\n\ninterface InputContextValue {\n inputRef: React.RefObject<HTMLInputElement>;\n}\n\nconst [InputProvider, useInputContext] = createInputContext<InputContextValue>(INPUT_NAME);\n\ntype InputProps = React.PropsWithChildren<{\n className?: string;\n}>;\n\nfunction Input(inputProps: InputProps): React.JSX.Element {\n const { __scopeInput, ...props } = inputProps as ScopedProps<InputProps>;\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n const handlePointerDown: React.PointerEventHandler<HTMLDivElement> = (event) => {\n const target = event.target as HTMLElement;\n\n if (target.closest('input, a, button')) {\n return;\n }\n\n const inputElement = inputRef.current;\n\n if (!inputElement) {\n return;\n }\n\n requestAnimationFrame(() => {\n // if the input is a file input, we need to trigger a click event\n if (inputElement.type === 'file') {\n inputElement.click();\n\n return;\n }\n\n inputElement.focus();\n });\n };\n\n return (\n <InputProvider inputRef={inputRef} scope={__scopeInput}>\n <Primitive.div role=\"presentation\" onPointerDown={handlePointerDown} {...props} />\n </InputProvider>\n );\n}\n\nInput.displayName = INPUT_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: InputItem\n * -------------------------------------------------------------------------- */\n\nconst INPUT_ITEM_NAME = 'InputItem';\n\ntype InputItemElement = React.ElementRef<typeof Primitive.input>;\ntype InputItemProps = React.ComponentPropsWithoutRef<typeof Primitive.input>;\n\nconst InputItem = React.forwardRef<InputItemElement, InputItemProps>(\n ({ __scopeInput, ...props }: ScopedProps<InputItemProps>, forwardedRef) => {\n const { inputRef } = useInputContext(INPUT_ITEM_NAME, __scopeInput);\n const composedInputRef = useComposedRefs(forwardedRef, inputRef);\n\n return <Primitive.input ref={composedInputRef} type=\"text\" {...props} />;\n },\n);\n\nInputItem.displayName = INPUT_ITEM_NAME;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { createInputScope, Input, Input as Root, InputItem, InputItem as Item, type InputProps, type InputItemProps };\n"]}
|
package/dist/chunk-7NEJ7IQ3.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _tailwindvariants = require('tailwind-variants');var e=_tailwindvariants.tv.call(void 0, {slots:{root:"border-input inline-flex w-full cursor-text items-center gap-3 rounded-md border bg-transparent px-3 shadow-sm transition focus-within:outline focus-within:outline-2 focus-within:outline-offset-2 has-[[disabled]]:cursor-default has-[[type=file]]:cursor-pointer has-[[disabled]]:opacity-50 [&_svg]:size-4",input:"placeholder:text-muted-foreground peer size-full flex-1 bg-transparent text-sm outline-none file:cursor-pointer file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-default"},variants:{inputSize:{default:{root:"h-10",input:"file:py-2.25"},xs:{root:"h-8",input:"file:py-1.25"},sm:{root:"h-9",input:"file:py-1.75"},lg:{root:"h-11",input:"file:py-2.75"}}},defaultVariants:{inputSize:"default"}}),{root:r,input:o}=e();exports.a = e; exports.b = r; exports.c = o;
|
|
2
|
-
//# sourceMappingURL=chunk-7NEJ7IQ3.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/style/input.ts"],"names":["inputVariants","tv","root","input"],"mappings":"AAAA,8HAAsC,IAMhCA,CAAAA,CAAgBC,kCAAAA,CACpB,KAAA,CAAO,CACL,IAAA,CAAM,iTAAA,CACN,KAAA,CACE,yMACJ,CAAA,CACA,QAAA,CAAU,CACR,SAAA,CAAW,CACT,OAAA,CAAS,CACP,IAAA,CAAM,MAAA,CACN,KAAA,CAAO,cACT,CAAA,CACA,EAAA,CAAI,CACF,IAAA,CAAM,KAAA,CACN,KAAA,CAAO,cACT,CAAA,CACA,EAAA,CAAI,CACF,IAAA,CAAM,KAAA,CACN,KAAA,CAAO,cACT,CAAA,CACA,EAAA,CAAI,CACF,IAAA,CAAM,MAAA,CACN,KAAA,CAAO,cACT,CACF,CACF,CAAA,CACA,eAAA,CAAiB,CACf,SAAA,CAAW,SACb,CACF,CAAC,CAAA,CAIK,CAAE,IAAA,CAAAC,CAAAA,CAAM,KAAA,CAAAC,CAAM,CAAA,CAAIH,CAAAA,CAAc,CAAA,CAAA,4CAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-7NEJ7IQ3.cjs","sourcesContent":["import { tv, type VariantProps } from 'tailwind-variants';\n\n/* -----------------------------------------------------------------------------\n * Variant: Input\n * -------------------------------------------------------------------------- */\n\nconst inputVariants = tv({\n slots: {\n root: 'border-input inline-flex w-full cursor-text items-center gap-3 rounded-md border bg-transparent px-3 shadow-sm transition focus-within:outline focus-within:outline-2 focus-within:outline-offset-2 has-[[disabled]]:cursor-default has-[[type=file]]:cursor-pointer has-[[disabled]]:opacity-50 [&_svg]:size-4',\n input:\n 'placeholder:text-muted-foreground peer size-full flex-1 bg-transparent text-sm outline-none file:cursor-pointer file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-default',\n },\n variants: {\n inputSize: {\n default: {\n root: 'h-10',\n input: 'file:py-2.25',\n },\n xs: {\n root: 'h-8',\n input: 'file:py-1.25',\n },\n sm: {\n root: 'h-9',\n input: 'file:py-1.75',\n },\n lg: {\n root: 'h-11',\n input: 'file:py-2.75',\n },\n },\n },\n defaultVariants: {\n inputSize: 'default',\n },\n});\n\ntype InputVariantsProps = VariantProps<typeof inputVariants>;\n\nconst { root, input } = inputVariants();\n\nexport { root, input, inputVariants, type InputVariantsProps };\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-BASRQOAA.cjs","../src/react/button.tsx"],"names":["buttonVariants","tv","Button","children","className","variant","size","loading","asChild","props","forwardedRef","Component","Slot","ComponentLoading","disabled","jsx","jsxs","VisuallyHidden","Spinner"],"mappings":"AAAA,mZAAmC,uECAZ,iDACF,sEACU,qDACO,+CAmE5B,IA5DJA,CAAAA,CAAiBC,kCAAAA,CACrB,IAAA,CAAM,+OAAA,CACN,QAAA,CAAU,CACR,OAAA,CAAS,CACP,OAAA,CAAS,+DAAA,CACT,WAAA,CAAa,8EAAA,CACb,KAAA,CAAO,8DAAA,CACP,IAAA,CAAM,iDAAA,CACN,OAAA,CACE,0GAAA,CACF,SAAA,CAAW,wEACb,CAAA,CACA,IAAA,CAAM,CACJ,OAAA,CAAS,iBAAA,CACT,EAAA,CAAI,gBAAA,CACJ,EAAA,CAAI,gBAAA,CACJ,EAAA,CAAI,iBAAA,CACJ,IAAA,CAAM,SAAA,CACN,SAAA,CAAW,QAAA,CACX,SAAA,CAAW,QAAA,CACX,SAAA,CAAW,SACb,CAAA,CACA,OAAA,CAAS,CACP,IAAA,CAAM,UACR,CACF,CAAA,CACA,eAAA,CAAiB,CACf,IAAA,CAAM,SAAA,CACN,OAAA,CAAS,SAAA,CACT,OAAA,CAAS,CAAA,CACX,CACF,CAAC,CAAA,CAcKC,CAAAA,aAAe,CAAA,CAAA,UAAA,CACnB,CAAC,CAAE,QAAA,CAAAC,CAAAA,CAAU,SAAA,CAAAC,CAAAA,CAAW,OAAA,CAAAC,CAAAA,CAAS,IAAA,CAAAC,CAAAA,CAAM,OAAA,CAAAC,CAAAA,CAAU,CAAA,CAAA,CAAO,OAAA,CAAAC,CAAAA,CAAU,CAAA,CAAA,CAAO,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAAiB,CACpG,IAAMC,CAAAA,CAAYH,CAAAA,CAAUI,eAAAA,CAAO,QAAA,CAC7BC,CAAAA,CAAmBL,CAAAA,CAAU,MAAA,CAAe,CAAA,CAAA,QAAA,CAC5CM,CAAAA,CAAWP,CAAAA,EAAWE,CAAAA,CAAM,QAAA,CAElC,OACEM,6BAAAA,CAACJ,CAAA,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWV,CAAAA,CAAe,CAAE,OAAA,CAAAK,CAAAA,CAAS,IAAA,CAAAC,CAAAA,CAAM,OAAA,CAAAC,CAAAA,CAAS,SAAA,CAAAH,CAAU,CAAC,CAAA,CAC/D,IAAA,CAAMI,CAAAA,CAAU,KAAA,CAAA,CAAY,QAAA,CAC3B,GAAGC,CAAAA,CACJ,QAAA,CAAUK,CAAAA,CAET,QAAA,CAAAP,CAAAA,CACCS,8BAAAA,CAACH,CAAA,CACC,QAAA,CAAA,CAAAE,6BAAAA,MAAC,CAAA,CAAK,aAAA,CAAW,CAAA,CAAA,CAAC,SAAA,CAAU,oBAAA,CACzB,QAAA,CAAAZ,CAAAA,CACH,CAAA,CACAY,6BAAAA,mCAACE,CAAA,CAAgB,QAAA,CAAAd,CAAAA,CAAS,CAAA,CAC1BY,6BAAAA,MAAC,CAAA,CAAK,SAAA,CAAU,mDAAA,CACd,QAAA,CAAAA,6BAAAA,mBAACG,CAAA,CAAA,CAAQ,CAAA,CACX,CAAA,CAAA,CACF,CAAA,CAEAf,CAAAA,CAEJ,CAEJ,CACF,CAAA,CAEAD,CAAAA,CAAO,WAAA,CAAc,QAAA,CAAA,6BAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-BASRQOAA.cjs","sourcesContent":[null,"import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport { tv, type VariantProps } from 'tailwind-variants';\nimport { Spinner } from '@/react/spinner';\n\n/* -----------------------------------------------------------------------------\n * Variant: Button\n * -------------------------------------------------------------------------- */\n\nconst buttonVariants = tv({\n base: 'inline-flex select-none items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow',\n destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm',\n ghost: 'text-foreground hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n outline:\n 'border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground border shadow-sm',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm',\n },\n size: {\n default: 'h-10 gap-2 px-4',\n xs: 'h-8 gap-1 px-2',\n sm: 'h-9 gap-2 px-3',\n lg: 'h-11 gap-2 px-8',\n icon: 'size-10',\n 'icon-xs': 'size-8',\n 'icon-sm': 'size-9',\n 'icon-lg': 'size-11',\n },\n loading: {\n true: 'relative',\n },\n },\n defaultVariants: {\n size: 'default',\n variant: 'default',\n loading: false,\n },\n});\n\ntype ButtonVariantsProps = VariantProps<typeof buttonVariants>;\n\n/* -----------------------------------------------------------------------------\n * Component: Button\n * -------------------------------------------------------------------------- */\n\ntype ButtonElement = HTMLButtonElement;\n\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ButtonVariantsProps {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<ButtonElement, ButtonProps>(\n ({ children, className, variant, size, loading = false, asChild = false, ...props }, forwardedRef) => {\n const Component = asChild ? Slot : 'button';\n const ComponentLoading = asChild ? 'span' : React.Fragment;\n const disabled = loading || props.disabled;\n\n return (\n <Component\n ref={forwardedRef}\n className={buttonVariants({ variant, size, loading, className })}\n type={asChild ? undefined : 'button'}\n {...props}\n disabled={disabled}\n >\n {loading ? (\n <ComponentLoading>\n <span aria-hidden className=\"invisible contents\">\n {children}\n </span>\n <VisuallyHidden>{children}</VisuallyHidden>\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <Spinner />\n </span>\n </ComponentLoading>\n ) : (\n children\n )}\n </Component>\n );\n },\n);\n\nButton.displayName = 'Button';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Button, buttonVariants, type ButtonProps, type ButtonVariantsProps };\n"]}
|
package/dist/chunk-CAK5VDBY.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import*as r from"react";import*as s from"@radix-ui/react-checkbox";import{createCheckboxScope as v}from"@radix-ui/react-checkbox";import{createContextScope as V}from"@radix-ui/react-context";import*as d from"@radix-ui/react-roving-focus";import{createRovingFocusGroupScope as R}from"@radix-ui/react-roving-focus";import{useControllableState as q}from"@radix-ui/react-use-controllable-state";import{useDirection as U}from"@radix-ui/react-direction";import{Primitive as W}from"@radix-ui/react-primitive";import{jsx as c}from"react/jsx-runtime";var b="CheckboxGroup",[A,Q]=V(b,[R,v]),G=R(),f=v(),[M,O]=A(b),w=r.forwardRef(({__scopeCheckboxGroup:e,name:i,defaultValue:o,value:n,required:t=!1,disabled:p=!1,orientation:m,dir:C,loop:a=!0,onValueChange:h,...I},g)=>{let y=G(e),x=U(C),[S=[],u]=q({prop:n,defaultProp:o,onChange:h}),F=r.useCallback(l=>{u((k=[])=>[...k,l])},[u]),E=r.useCallback(l=>{u((k=[])=>k.filter(N=>N!==l))},[u]);return c(M,{disabled:p,name:i,required:t,scope:e,value:S,onItemCheck:F,onItemUncheck:E,children:c(d.Root,{asChild:!0,...y,dir:x,loop:a,orientation:m,children:c(W.div,{ref:g,"data-disabled":p?"":void 0,dir:x,role:"group",...I})})})});w.displayName=b;var P="CheckboxGroupItem",D=r.forwardRef(({__scopeCheckboxGroup:e,disabled:i,...o},n)=>{let t=O(P,e),p=t.disabled||i,m=G(e),C=f(e),a=t.value?.includes(o.value);return c(d.Item,{asChild:!0,...m,active:a,focusable:!p,children:c(s.Root,{ref:n,checked:a,disabled:p,name:t.name,required:t.required,...C,...o,onCheckedChange:h=>{h?t.onItemCheck(o.value):t.onItemUncheck(o.value)}})})});D.displayName=P;var T="CheckboxGroupIndicator",B=r.forwardRef(({__scopeCheckboxGroup:e,...i},o)=>{let n=f(e);return c(s.Indicator,{ref:o,...n,...i})});B.displayName=T;export{Q as a,w as b,D as c,B as d};
|
|
2
|
-
//# sourceMappingURL=chunk-CAK5VDBY.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/primitive/checkbox-group.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { createCheckboxScope } from '@radix-ui/react-checkbox';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_GROUP_NAME = 'CheckboxGroup';\n\ntype ScopedProps<P> = P & { __scopeCheckboxGroup?: Scope };\n\nconst [createCheckboxGroupContext, createCheckboxGroupScope] = createContextScope(CHECKBOX_GROUP_NAME, [\n createRovingFocusGroupScope,\n createCheckboxScope,\n]);\n\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useCheckboxScope = createCheckboxScope();\n\ninterface CheckboxGroupContextValue {\n disabled: boolean;\n onItemCheck: (value: string) => void;\n onItemUncheck: (value: string) => void;\n required: boolean;\n name?: string;\n value?: string[];\n}\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] =\n createCheckboxGroupContext<CheckboxGroupContextValue>(CHECKBOX_GROUP_NAME);\n\ntype CheckboxGroupElement = React.ElementRef<typeof Primitive.div>;\n\ninterface CheckboxGroupProps extends React.ComponentPropsWithoutRef<typeof Primitive.div> {\n defaultValue?: string[];\n dir?: RovingFocusGroup.RovingFocusGroupProps['dir'];\n disabled?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['disabled'];\n loop?: RovingFocusGroup.RovingFocusGroupProps['loop'];\n name?: CheckboxGroupContextValue['name'];\n onValueChange?: (value: string[]) => void;\n orientation?: RovingFocusGroup.RovingFocusGroupProps['orientation'];\n required?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['required'];\n value?: CheckboxGroupContextValue['value'];\n}\n\nconst CheckboxGroup = React.forwardRef<CheckboxGroupElement, CheckboxGroupProps>(\n (\n {\n __scopeCheckboxGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...props\n }: ScopedProps<CheckboxGroupProps>,\n forwardedRef,\n ) => {\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeCheckboxGroup);\n const direction = useDirection(dir);\n const [value = [], setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const handleItemCheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) => [...prevValue, itemValue]);\n },\n [setValue],\n );\n\n const handleItemUncheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) => prevValue.filter((val) => val !== itemValue));\n },\n [setValue],\n );\n\n return (\n <CheckboxGroupProvider\n disabled={disabled}\n name={name}\n required={required}\n scope={__scopeCheckboxGroup}\n value={value}\n onItemCheck={handleItemCheck}\n onItemUncheck={handleItemUncheck}\n >\n <RovingFocusGroup.Root asChild {...rovingFocusGroupScope} dir={direction} loop={loop} orientation={orientation}>\n {}\n <Primitive.div\n ref={forwardedRef}\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n role=\"group\"\n {...props}\n />\n </RovingFocusGroup.Root>\n </CheckboxGroupProvider>\n );\n },\n);\n\nCheckboxGroup.displayName = CHECKBOX_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'CheckboxGroupItem';\n\ntype CheckboxGroupItemElement = React.ElementRef<typeof CheckboxPrimitive.Root>;\n\ninterface CheckboxGroupItemProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n 'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'\n > {\n value: string;\n}\n\nconst CheckboxGroupItem = React.forwardRef<CheckboxGroupItemElement, CheckboxGroupItemProps>(\n ({ __scopeCheckboxGroup, disabled, ...props }: ScopedProps<CheckboxGroupItemProps>, forwardedRef) => {\n const context = useCheckboxGroupContext(ITEM_NAME, __scopeCheckboxGroup);\n const isDisabled = context.disabled || disabled;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeCheckboxGroup);\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n const checked = context.value?.includes(props.value);\n\n return (\n <RovingFocusGroup.Item asChild {...rovingFocusGroupScope} active={checked} focusable={!isDisabled}>\n <CheckboxPrimitive.Root\n ref={forwardedRef}\n checked={checked}\n disabled={isDisabled}\n name={context.name}\n required={context.required}\n {...checkboxScope}\n {...props}\n onCheckedChange={(checkedState) => {\n if (checkedState) {\n context.onItemCheck(props.value);\n } else {\n context.onItemUncheck(props.value);\n }\n }}\n />\n </RovingFocusGroup.Item>\n );\n },\n);\n\nCheckboxGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'CheckboxGroupIndicator';\n\ntype CheckboxGroupIndicatorElement = React.ElementRef<typeof CheckboxPrimitive.Indicator>;\ntype CheckboxGroupIndicatorProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Indicator>;\n\nconst CheckboxGroupIndicator = React.forwardRef<CheckboxGroupIndicatorElement, CheckboxGroupIndicatorProps>(\n ({ __scopeCheckboxGroup, ...props }: ScopedProps<CheckboxGroupIndicatorProps>, forwardedRef) => {\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n\n return <CheckboxPrimitive.Indicator ref={forwardedRef} {...checkboxScope} {...props} />;\n },\n);\n\nCheckboxGroupIndicator.displayName = INDICATOR_NAME;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n createCheckboxGroupScope,\n CheckboxGroup,\n CheckboxGroup as Root,\n CheckboxGroupItem,\n CheckboxGroupItem as Item,\n CheckboxGroupIndicator,\n CheckboxGroupIndicator as Indicator,\n type CheckboxGroupProps,\n type CheckboxGroupItemProps,\n type CheckboxGroupIndicatorProps,\n};\n"],"mappings":"AAEA,UAAYA,MAAW,QACvB,UAAYC,MAAuB,2BACnC,OAAS,uBAAAC,MAA2B,2BACpC,OAAS,sBAAAC,MAAsC,0BAC/C,UAAYC,MAAsB,+BAClC,OAAS,+BAAAC,MAAmC,+BAC5C,OAAS,wBAAAC,MAA4B,yCACrC,OAAS,gBAAAC,MAAoB,4BAC7B,OAAS,aAAAC,MAAiB,4BA+FhB,cAAAC,MAAA,oBAzFV,IAAMC,EAAsB,gBAItB,CAACC,EAA4BC,CAAwB,EAAIT,EAAmBO,EAAqB,CACrGL,EACAH,CACF,CAAC,EAEKW,EAA2BR,EAA4B,EACvDS,EAAmBZ,EAAoB,EAWvC,CAACa,EAAuBC,CAAuB,EACnDL,EAAsDD,CAAmB,EAgBrEO,EAAsB,aAC1B,CACE,CACE,qBAAAC,EACA,KAAAC,EACA,aAAAC,EACA,MAAOC,EACP,SAAAC,EAAW,GACX,SAAAC,EAAW,GACX,YAAAC,EACA,IAAAC,EACA,KAAAC,EAAO,GACP,cAAAC,EACA,GAAGC,CACL,EACAC,IACG,CACH,IAAMC,EAAwBjB,EAAyBK,CAAoB,EACrEa,EAAYxB,EAAakB,CAAG,EAC5B,CAACO,EAAQ,CAAC,EAAGC,CAAQ,EA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BiB,GAAiB,CAC7BA,EACFJ,EAAQ,YAAYb,EAAM,KAAK,EAE/Ba,EAAQ,cAAcb,EAAM,KAAK,CAErC,EACF,EACF,CAEJ,CACF,EAEAY,EAAkB,YAAcD,EAMhC,IAAMO,EAAiB,yBAKjBC,EAA+B,aACnC,CAAC,CAAE,qBAAA7B,EAAsB,GAAGU,CAAM,EAA6CC,IAAiB,CAC9F,IAAMc,EAAgB7B,EAAiBI,CAAoB,EAE3D,OAAOT,EAAmB,YAAlB,CAA4B,IAAKoB,EAAe,GAAGc,EAAgB,GAAGf,EAAO,CACvF,CACF,EAEAmB,EAAuB,YAAcD","names":["React","CheckboxPrimitive","createCheckboxScope","createContextScope","RovingFocusGroup","createRovingFocusGroupScope","useControllableState","useDirection","Primitive","jsx","CHECKBOX_GROUP_NAME","createCheckboxGroupContext","createCheckboxGroupScope","useRovingFocusGroupScope","useCheckboxScope","CheckboxGroupProvider","useCheckboxGroupContext","CheckboxGroup","__scopeCheckboxGroup","name","defaultValue","valueProp","required","disabled","orientation","dir","loop","onValueChange","props","forwardedRef","rovingFocusGroupScope","direction","value","setValue","handleItemCheck","itemValue","prevValue","handleItemUncheck","val","ITEM_NAME","CheckboxGroupItem","context","isDisabled","checkboxScope","checked","checkedState","INDICATOR_NAME","CheckboxGroupIndicator"]}
|
package/dist/chunk-EYL4UQ5E.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{tv as t}from"tailwind-variants";var e=t({slots:{root:"border-input inline-flex w-full cursor-text items-center gap-3 rounded-md border bg-transparent px-3 shadow-sm transition focus-within:outline focus-within:outline-2 focus-within:outline-offset-2 has-[[disabled]]:cursor-default has-[[type=file]]:cursor-pointer has-[[disabled]]:opacity-50 [&_svg]:size-4",input:"placeholder:text-muted-foreground peer size-full flex-1 bg-transparent text-sm outline-none file:cursor-pointer file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-default"},variants:{inputSize:{default:{root:"h-10",input:"file:py-2.25"},xs:{root:"h-8",input:"file:py-1.25"},sm:{root:"h-9",input:"file:py-1.75"},lg:{root:"h-11",input:"file:py-2.75"}}},defaultVariants:{inputSize:"default"}}),{root:r,input:o}=e();export{e as a,r as b,o as c};
|
|
2
|
-
//# sourceMappingURL=chunk-EYL4UQ5E.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/style/input.ts"],"sourcesContent":["import { tv, type VariantProps } from 'tailwind-variants';\n\n/* -----------------------------------------------------------------------------\n * Variant: Input\n * -------------------------------------------------------------------------- */\n\nconst inputVariants = tv({\n slots: {\n root: 'border-input inline-flex w-full cursor-text items-center gap-3 rounded-md border bg-transparent px-3 shadow-sm transition focus-within:outline focus-within:outline-2 focus-within:outline-offset-2 has-[[disabled]]:cursor-default has-[[type=file]]:cursor-pointer has-[[disabled]]:opacity-50 [&_svg]:size-4',\n input:\n 'placeholder:text-muted-foreground peer size-full flex-1 bg-transparent text-sm outline-none file:cursor-pointer file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-default',\n },\n variants: {\n inputSize: {\n default: {\n root: 'h-10',\n input: 'file:py-2.25',\n },\n xs: {\n root: 'h-8',\n input: 'file:py-1.25',\n },\n sm: {\n root: 'h-9',\n input: 'file:py-1.75',\n },\n lg: {\n root: 'h-11',\n input: 'file:py-2.75',\n },\n },\n },\n defaultVariants: {\n inputSize: 'default',\n },\n});\n\ntype InputVariantsProps = VariantProps<typeof inputVariants>;\n\nconst { root, input } = inputVariants();\n\nexport { root, input, inputVariants, type InputVariantsProps };\n"],"mappings":"AAAA,OAAS,MAAAA,MAA6B,oBAMtC,IAAMC,EAAgBD,EAAG,CACvB,MAAO,CACL,KAAM,kTACN,MACE,yMACJ,EACA,SAAU,CACR,UAAW,CACT,QAAS,CACP,KAAM,OACN,MAAO,cACT,EACA,GAAI,CACF,KAAM,MACN,MAAO,cACT,EACA,GAAI,CACF,KAAM,MACN,MAAO,cACT,EACA,GAAI,CACF,KAAM,OACN,MAAO,cACT,CACF,CACF,EACA,gBAAiB,CACf,UAAW,SACb,CACF,CAAC,EAIK,CAAE,KAAAE,EAAM,MAAAC,CAAM,EAAIF,EAAc","names":["tv","inputVariants","root","input"]}
|
package/dist/chunk-OJI2FD2T.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _react = require('react'); var r = _interopRequireWildcard(_react);var _reactcheckbox = require('@radix-ui/react-checkbox'); var s = _interopRequireWildcard(_reactcheckbox);var _reactcontext = require('@radix-ui/react-context');var _reactrovingfocus = require('@radix-ui/react-roving-focus'); var d = _interopRequireWildcard(_reactrovingfocus);var _reactusecontrollablestate = require('@radix-ui/react-use-controllable-state');var _reactdirection = require('@radix-ui/react-direction');var _reactprimitive = require('@radix-ui/react-primitive');var _jsxruntime = require('react/jsx-runtime');var b="CheckboxGroup",[A,Q]=_reactcontext.createContextScope.call(void 0, b,[_reactrovingfocus.createRovingFocusGroupScope,_reactcheckbox.createCheckboxScope]),G=_reactrovingfocus.createRovingFocusGroupScope.call(void 0, ),f=_reactcheckbox.createCheckboxScope.call(void 0, ),[M,O]=A(b),w= exports.b =r.forwardRef(({__scopeCheckboxGroup:e,name:i,defaultValue:o,value:n,required:t=!1,disabled:p=!1,orientation:m,dir:C,loop:a=!0,onValueChange:h,...I},g)=>{let y=G(e),x=_reactdirection.useDirection.call(void 0, C),[S=[],u]=_reactusecontrollablestate.useControllableState.call(void 0, {prop:n,defaultProp:o,onChange:h}),F=r.useCallback(l=>{u((k=[])=>[...k,l])},[u]),E=r.useCallback(l=>{u((k=[])=>k.filter(N=>N!==l))},[u]);return _jsxruntime.jsx.call(void 0, M,{disabled:p,name:i,required:t,scope:e,value:S,onItemCheck:F,onItemUncheck:E,children:_jsxruntime.jsx.call(void 0, d.Root,{asChild:!0,...y,dir:x,loop:a,orientation:m,children:_jsxruntime.jsx.call(void 0, _reactprimitive.Primitive.div,{ref:g,"data-disabled":p?"":void 0,dir:x,role:"group",...I})})})});w.displayName=b;var P="CheckboxGroupItem",D= exports.c =r.forwardRef(({__scopeCheckboxGroup:e,disabled:i,...o},n)=>{let t=O(P,e),p=t.disabled||i,m=G(e),C=f(e),a=_optionalChain([t, 'access', _ => _.value, 'optionalAccess', _2 => _2.includes, 'call', _3 => _3(o.value)]);return _jsxruntime.jsx.call(void 0, d.Item,{asChild:!0,...m,active:a,focusable:!p,children:_jsxruntime.jsx.call(void 0, s.Root,{ref:n,checked:a,disabled:p,name:t.name,required:t.required,...C,...o,onCheckedChange:h=>{h?t.onItemCheck(o.value):t.onItemUncheck(o.value)}})})});D.displayName=P;var T="CheckboxGroupIndicator",B= exports.d =r.forwardRef(({__scopeCheckboxGroup:e,...i},o)=>{let n=f(e);return _jsxruntime.jsx.call(void 0, s.Indicator,{ref:o,...n,...i})});B.displayName=T;exports.a = Q; exports.b = w; exports.c = D; exports.d = B;
|
|
2
|
-
//# sourceMappingURL=chunk-OJI2FD2T.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/primitive/checkbox-group.tsx"],"names":["CHECKBOX_GROUP_NAME","createCheckboxGroupContext","createCheckboxGroupScope","createContextScope","createRovingFocusGroupScope","createCheckboxScope","useRovingFocusGroupScope","useCheckboxScope","CheckboxGroupProvider","useCheckboxGroupContext","CheckboxGroup","__scopeCheckboxGroup","name","defaultValue","valueProp","required","disabled","orientation","dir","loop","onValueChange","props","forwardedRef","rovingFocusGroupScope","direction","useDirection","value","setValue","useControllableState","handleItemCheck","itemValue","prevValue","handleItemUncheck","val","jsx","Primitive","ITEM_NAME","CheckboxGroupItem","context","isDisabled","checkboxScope","checked","checkedState","INDICATOR_NAME","CheckboxGroupIndicator"],"mappings":"AAEA,s6BAAuB,0GACY,uDAEY,oHACb,mFAEG,2DACR,2DACH,+CA+FhB,IAzFJA,CAAAA,CAAsB,eAAA,CAItB,CAACC,CAAAA,CAA4BC,CAAwB,CAAA,CAAIC,8CAAAA,CAAmBH,CAAqB,CACrGI,6CAAAA,CACAC,kCACF,CAAC,CAAA,CAEKC,CAAAA,CAA2BF,2DAAAA,CAA4B,CACvDG,CAAAA,CAAmBF,gDAAAA,CAAoB,CAWvC,CAACG,CAAAA,CAAuBC,CAAuB,CAAA,CACnDR,CAAAA,CAAsDD,CAAmB,CAAA,CAgBrEU,CAAAA,aAAsB,CAAA,CAAA,UAAA,CAC1B,CACE,CACE,oBAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,KAAA,CAAOC,CAAAA,CACP,QAAA,CAAAC,CAAAA,CAAW,CAAA,CAAA,CACX,QAAA,CAAAC,CAAAA,CAAW,CAAA,CAAA,CACX,WAAA,CAAAC,CAAAA,CACA,GAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CAAO,CAAA,CAAA,CACP,aAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CACAC,CAAAA,CAAAA,EACG,CACH,IAAMC,CAAAA,CAAwBjB,CAAAA,CAAyBK,CAAoB,CAAA,CACrEa,CAAAA,CAAYC,0CAAAA,CAAgB,CAAA,CAC5B,CAACC,CAAAA,CAAQ,CAAC,CAAA,CAAGC,CAAQ,CAAA,CAAIC,6DAAAA,CAC7B,IAAA,CAAMd,CAAAA,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AAA,CAAA,UAAA,CACnC,CAAC,CAAE,oBAAA,CAAAjC,CAAAA,CAAsB,GAAGU,CAAM,CAAA,CAA6CC,CAAAA,CAAAA,EAAiB,CAC9F,IAAMkB,CAAAA,CAAgBjC,CAAAA,CAAiBI,CAAoB,CAAA,CAE3D,OAAOuB,6BAAAA,CAAmB,CAAA,SAAA,CAAlB,CAA4B,GAAA,CAAKZ,CAAAA,CAAe,GAAGkB,CAAAA,CAAgB,GAAGnB,CAAAA,CAAO,CACvF,CACF,CAAA,CAEAuB,CAAAA,CAAuB,WAAA,CAAcD,CAAAA,CAAAA,2DAAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-OJI2FD2T.cjs","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { createCheckboxScope } from '@radix-ui/react-checkbox';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_GROUP_NAME = 'CheckboxGroup';\n\ntype ScopedProps<P> = P & { __scopeCheckboxGroup?: Scope };\n\nconst [createCheckboxGroupContext, createCheckboxGroupScope] = createContextScope(CHECKBOX_GROUP_NAME, [\n createRovingFocusGroupScope,\n createCheckboxScope,\n]);\n\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useCheckboxScope = createCheckboxScope();\n\ninterface CheckboxGroupContextValue {\n disabled: boolean;\n onItemCheck: (value: string) => void;\n onItemUncheck: (value: string) => void;\n required: boolean;\n name?: string;\n value?: string[];\n}\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] =\n createCheckboxGroupContext<CheckboxGroupContextValue>(CHECKBOX_GROUP_NAME);\n\ntype CheckboxGroupElement = React.ElementRef<typeof Primitive.div>;\n\ninterface CheckboxGroupProps extends React.ComponentPropsWithoutRef<typeof Primitive.div> {\n defaultValue?: string[];\n dir?: RovingFocusGroup.RovingFocusGroupProps['dir'];\n disabled?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['disabled'];\n loop?: RovingFocusGroup.RovingFocusGroupProps['loop'];\n name?: CheckboxGroupContextValue['name'];\n onValueChange?: (value: string[]) => void;\n orientation?: RovingFocusGroup.RovingFocusGroupProps['orientation'];\n required?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['required'];\n value?: CheckboxGroupContextValue['value'];\n}\n\nconst CheckboxGroup = React.forwardRef<CheckboxGroupElement, CheckboxGroupProps>(\n (\n {\n __scopeCheckboxGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...props\n }: ScopedProps<CheckboxGroupProps>,\n forwardedRef,\n ) => {\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeCheckboxGroup);\n const direction = useDirection(dir);\n const [value = [], setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const handleItemCheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) => [...prevValue, itemValue]);\n },\n [setValue],\n );\n\n const handleItemUncheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) => prevValue.filter((val) => val !== itemValue));\n },\n [setValue],\n );\n\n return (\n <CheckboxGroupProvider\n disabled={disabled}\n name={name}\n required={required}\n scope={__scopeCheckboxGroup}\n value={value}\n onItemCheck={handleItemCheck}\n onItemUncheck={handleItemUncheck}\n >\n <RovingFocusGroup.Root asChild {...rovingFocusGroupScope} dir={direction} loop={loop} orientation={orientation}>\n {}\n <Primitive.div\n ref={forwardedRef}\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n role=\"group\"\n {...props}\n />\n </RovingFocusGroup.Root>\n </CheckboxGroupProvider>\n );\n },\n);\n\nCheckboxGroup.displayName = CHECKBOX_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'CheckboxGroupItem';\n\ntype CheckboxGroupItemElement = React.ElementRef<typeof CheckboxPrimitive.Root>;\n\ninterface CheckboxGroupItemProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n 'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'\n > {\n value: string;\n}\n\nconst CheckboxGroupItem = React.forwardRef<CheckboxGroupItemElement, CheckboxGroupItemProps>(\n ({ __scopeCheckboxGroup, disabled, ...props }: ScopedProps<CheckboxGroupItemProps>, forwardedRef) => {\n const context = useCheckboxGroupContext(ITEM_NAME, __scopeCheckboxGroup);\n const isDisabled = context.disabled || disabled;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeCheckboxGroup);\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n const checked = context.value?.includes(props.value);\n\n return (\n <RovingFocusGroup.Item asChild {...rovingFocusGroupScope} active={checked} focusable={!isDisabled}>\n <CheckboxPrimitive.Root\n ref={forwardedRef}\n checked={checked}\n disabled={isDisabled}\n name={context.name}\n required={context.required}\n {...checkboxScope}\n {...props}\n onCheckedChange={(checkedState) => {\n if (checkedState) {\n context.onItemCheck(props.value);\n } else {\n context.onItemUncheck(props.value);\n }\n }}\n />\n </RovingFocusGroup.Item>\n );\n },\n);\n\nCheckboxGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'CheckboxGroupIndicator';\n\ntype CheckboxGroupIndicatorElement = React.ElementRef<typeof CheckboxPrimitive.Indicator>;\ntype CheckboxGroupIndicatorProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Indicator>;\n\nconst CheckboxGroupIndicator = React.forwardRef<CheckboxGroupIndicatorElement, CheckboxGroupIndicatorProps>(\n ({ __scopeCheckboxGroup, ...props }: ScopedProps<CheckboxGroupIndicatorProps>, forwardedRef) => {\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n\n return <CheckboxPrimitive.Indicator ref={forwardedRef} {...checkboxScope} {...props} />;\n },\n);\n\nCheckboxGroupIndicator.displayName = INDICATOR_NAME;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n createCheckboxGroupScope,\n CheckboxGroup,\n CheckboxGroup as Root,\n CheckboxGroupItem,\n CheckboxGroupItem as Item,\n CheckboxGroupIndicator,\n CheckboxGroupIndicator as Indicator,\n type CheckboxGroupProps,\n type CheckboxGroupItemProps,\n type CheckboxGroupIndicatorProps,\n};\n"]}
|
package/dist/chunk-QCHBG2C4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import*as n from"react";import{createContextScope as a}from"@radix-ui/react-context";import{useComposedRefs as f}from"@radix-ui/react-compose-refs";import{Primitive as c}from"@radix-ui/react-primitive";import{jsx as s}from"react/jsx-runtime";var i="Input",[P,M]=a(i),[l,R]=P(i);function d(p){let{__scopeInput:o,...r}=p,t=n.useRef(null),u=m=>{if(m.target.closest("input, a, button"))return;let e=t.current;e&&requestAnimationFrame(()=>{if(e.type==="file"){e.click();return}e.focus()})};return s(l,{inputRef:t,scope:o,children:s(c.div,{role:"presentation",onPointerDown:u,...r})})}d.displayName=i;var I="InputItem",y=n.forwardRef(({__scopeInput:p,...o},r)=>{let{inputRef:t}=R(I,p),u=f(r,t);return s(c.input,{ref:u,type:"text",...o})});y.displayName=I;export{M as a,d as b,y as c};
|
|
2
|
-
//# sourceMappingURL=chunk-QCHBG2C4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/primitive/input.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -----------------------------------------------------------------------------\n * Component: Input\n * -------------------------------------------------------------------------- */\n\nconst INPUT_NAME = 'Input';\n\ntype ScopedProps<P> = P & { __scopeInput?: Scope };\nconst [createInputContext, createInputScope] = createContextScope(INPUT_NAME);\n\ninterface InputContextValue {\n inputRef: React.RefObject<HTMLInputElement>;\n}\n\nconst [InputProvider, useInputContext] = createInputContext<InputContextValue>(INPUT_NAME);\n\ntype InputProps = React.PropsWithChildren<{\n className?: string;\n}>;\n\nfunction Input(inputProps: InputProps): React.JSX.Element {\n const { __scopeInput, ...props } = inputProps as ScopedProps<InputProps>;\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n const handlePointerDown: React.PointerEventHandler<HTMLDivElement> = (event) => {\n const target = event.target as HTMLElement;\n\n if (target.closest('input, a, button')) {\n return;\n }\n\n const inputElement = inputRef.current;\n\n if (!inputElement) {\n return;\n }\n\n requestAnimationFrame(() => {\n // if the input is a file input, we need to trigger a click event\n if (inputElement.type === 'file') {\n inputElement.click();\n\n return;\n }\n\n inputElement.focus();\n });\n };\n\n return (\n <InputProvider inputRef={inputRef} scope={__scopeInput}>\n <Primitive.div role=\"presentation\" onPointerDown={handlePointerDown} {...props} />\n </InputProvider>\n );\n}\n\nInput.displayName = INPUT_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: InputItem\n * -------------------------------------------------------------------------- */\n\nconst INPUT_ITEM_NAME = 'InputItem';\n\ntype InputItemElement = React.ElementRef<typeof Primitive.input>;\ntype InputItemProps = React.ComponentPropsWithoutRef<typeof Primitive.input>;\n\nconst InputItem = React.forwardRef<InputItemElement, InputItemProps>(\n ({ __scopeInput, ...props }: ScopedProps<InputItemProps>, forwardedRef) => {\n const { inputRef } = useInputContext(INPUT_ITEM_NAME, __scopeInput);\n const composedInputRef = useComposedRefs(forwardedRef, inputRef);\n\n return <Primitive.input ref={composedInputRef} type=\"text\" {...props} />;\n },\n);\n\nInputItem.displayName = INPUT_ITEM_NAME;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { createInputScope, Input, Input as Root, InputItem, InputItem as Item, type InputProps, type InputItemProps };\n"],"mappings":"AAEA,UAAYA,MAAW,QACvB,OAAS,sBAAAC,MAAsC,0BAC/C,OAAS,mBAAAC,MAAuB,+BAChC,OAAS,aAAAC,MAAiB,4BAoDpB,cAAAC,MAAA,oBA9CN,IAAMC,EAAa,QAGb,CAACC,EAAoBC,CAAgB,EAAIN,EAAmBI,CAAU,EAMtE,CAACG,EAAeC,CAAe,EAAIH,EAAsCD,CAAU,EAMzF,SAASK,EAAMC,EAA2C,CACxD,GAAM,CAAE,aAAAC,EAAc,GAAGC,CAAM,EAAIF,EAC7BG,EAAiB,SAAyB,IAAI,EAE9CC,EAAgEC,GAAU,CAG9E,GAFeA,EAAM,OAEV,QAAQ,kBAAkB,EACnC,OAGF,IAAMC,EAAeH,EAAS,QAEzBG,GAIL,sBAAsB,IAAM,CAE1B,GAAIA,EAAa,OAAS,OAAQ,CAChCA,EAAa,MAAM,EAEnB,MACF,CAEAA,EAAa,MAAM,CACrB,CAAC,CACH,EAEA,OACEb,EAACI,EAAA,CAAc,SAAUM,EAAU,MAAOF,EACxC,SAAAR,EAACD,EAAU,IAAV,CAAc,KAAK,eAAe,cAAeY,EAAoB,GAAGF,EAAO,EAClF,CAEJ,CAEAH,EAAM,YAAcL,EAMpB,IAAMa,EAAkB,YAKlBC,EAAkB,aACtB,CAAC,CAAE,aAAAP,EAAc,GAAGC,CAAM,EAAgCO,IAAiB,CACzE,GAAM,CAAE,SAAAN,CAAS,EAAIL,EAAgBS,EAAiBN,CAAY,EAC5DS,EAAmBnB,EAAgBkB,EAAcN,CAAQ,EAE/D,OAAOV,EAACD,EAAU,MAAV,CAAgB,IAAKkB,EAAkB,KAAK,OAAQ,GAAGR,EAAO,CACxE,CACF,EAEAM,EAAU,YAAcD","names":["React","createContextScope","useComposedRefs","Primitive","jsx","INPUT_NAME","createInputContext","createInputScope","InputProvider","useInputContext","Input","inputProps","__scopeInput","props","inputRef","handlePointerDown","event","inputElement","INPUT_ITEM_NAME","InputItem","forwardedRef","composedInputRef"]}
|
package/dist/chunk-U62JBFEF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-JK5GPYFN.js";import*as e from"react";import{Slot as m}from"@radix-ui/react-slot";import{VisuallyHidden as b}from"@radix-ui/react-visually-hidden";import{tv as g}from"tailwind-variants";import{jsx as t,jsxs as x}from"react/jsx-runtime";var v=g({base:"inline-flex select-none items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50",variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 shadow",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm",ghost:"text-foreground hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",outline:"border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground border shadow-sm",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm"},size:{default:"h-10 gap-2 px-4",xs:"h-8 gap-1 px-2",sm:"h-9 gap-2 px-3",lg:"h-11 gap-2 px-8",icon:"size-10","icon-xs":"size-8","icon-sm":"size-9","icon-lg":"size-11"},loading:{true:"relative"}},defaultVariants:{size:"default",variant:"default",loading:!1}}),y=e.forwardRef(({children:n,className:i,variant:u,size:d,loading:o=!1,asChild:r=!1,...s},p)=>{let l=r?m:"button",c=r?"span":e.Fragment,f=o||s.disabled;return t(l,{ref:p,className:v({variant:u,size:d,loading:o,className:i}),type:r?void 0:"button",...s,disabled:f,children:o?x(c,{children:[t("span",{"aria-hidden":!0,className:"invisible contents",children:n}),t(b,{children:n}),t("span",{className:"absolute inset-0 flex items-center justify-center",children:t(a,{})})]}):n})});y.displayName="Button";export{v as a,y as b};
|
|
2
|
-
//# sourceMappingURL=chunk-U62JBFEF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/button.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport { tv, type VariantProps } from 'tailwind-variants';\nimport { Spinner } from '@/react/spinner';\n\n/* -----------------------------------------------------------------------------\n * Variant: Button\n * -------------------------------------------------------------------------- */\n\nconst buttonVariants = tv({\n base: 'inline-flex select-none items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow',\n destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm',\n ghost: 'text-foreground hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n outline:\n 'border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground border shadow-sm',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm',\n },\n size: {\n default: 'h-10 gap-2 px-4',\n xs: 'h-8 gap-1 px-2',\n sm: 'h-9 gap-2 px-3',\n lg: 'h-11 gap-2 px-8',\n icon: 'size-10',\n 'icon-xs': 'size-8',\n 'icon-sm': 'size-9',\n 'icon-lg': 'size-11',\n },\n loading: {\n true: 'relative',\n },\n },\n defaultVariants: {\n size: 'default',\n variant: 'default',\n loading: false,\n },\n});\n\ntype ButtonVariantsProps = VariantProps<typeof buttonVariants>;\n\n/* -----------------------------------------------------------------------------\n * Component: Button\n * -------------------------------------------------------------------------- */\n\ntype ButtonElement = HTMLButtonElement;\n\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ButtonVariantsProps {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<ButtonElement, ButtonProps>(\n ({ children, className, variant, size, loading = false, asChild = false, ...props }, forwardedRef) => {\n const Component = asChild ? Slot : 'button';\n const ComponentLoading = asChild ? 'span' : React.Fragment;\n const disabled = loading || props.disabled;\n\n return (\n <Component\n ref={forwardedRef}\n className={buttonVariants({ variant, size, loading, className })}\n type={asChild ? undefined : 'button'}\n {...props}\n disabled={disabled}\n >\n {loading ? (\n <ComponentLoading>\n <span aria-hidden className=\"invisible contents\">\n {children}\n </span>\n <VisuallyHidden>{children}</VisuallyHidden>\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <Spinner />\n </span>\n </ComponentLoading>\n ) : (\n children\n )}\n </Component>\n );\n },\n);\n\nButton.displayName = 'Button';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Button, buttonVariants, type ButtonProps, type ButtonVariantsProps };\n"],"mappings":"mCAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OAAS,kBAAAC,MAAsB,kCAC/B,OAAS,MAAAC,MAA6B,oBAmE5B,OACE,OAAAC,EADF,QAAAC,MAAA,oBA5DV,IAAMC,EAAiBC,EAAG,CACxB,KAAM,gPACN,SAAU,CACR,QAAS,CACP,QAAS,gEACT,YAAa,+EACb,MAAO,+DACP,KAAM,kDACN,QACE,2GACF,UAAW,wEACb,EACA,KAAM,CACJ,QAAS,kBACT,GAAI,iBACJ,GAAI,iBACJ,GAAI,kBACJ,KAAM,UACN,UAAW,SACX,UAAW,SACX,UAAW,SACb,EACA,QAAS,CACP,KAAM,UACR,CACF,EACA,gBAAiB,CACf,KAAM,UACN,QAAS,UACT,QAAS,EACX,CACF,CAAC,EAcKC,EAAe,aACnB,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,QAAAC,EAAS,KAAAC,EAAM,QAAAC,EAAU,GAAO,QAAAC,EAAU,GAAO,GAAGC,CAAM,EAAGC,IAAiB,CACpG,IAAMC,EAAYH,EAAUI,EAAO,SAC7BC,EAAmBL,EAAU,OAAe,WAC5CM,EAAWP,GAAWE,EAAM,SAElC,OACEX,EAACa,EAAA,CACC,IAAKD,EACL,UAAWV,EAAe,CAAE,QAAAK,EAAS,KAAAC,EAAM,QAAAC,EAAS,UAAAH,CAAU,CAAC,EAC/D,KAAMI,EAAU,OAAY,SAC3B,GAAGC,EACJ,SAAUK,EAET,SAAAP,EACCR,EAACc,EAAA,CACC,UAAAf,EAAC,QAAK,cAAW,GAAC,UAAU,qBACzB,SAAAK,EACH,EACAL,EAACiB,EAAA,CAAgB,SAAAZ,EAAS,EAC1BL,EAAC,QAAK,UAAU,oDACd,SAAAA,EAACkB,EAAA,EAAQ,EACX,GACF,EAEAb,EAEJ,CAEJ,CACF,EAEAD,EAAO,YAAc","names":["React","Slot","VisuallyHidden","tv","jsx","jsxs","buttonVariants","tv","Button","children","className","variant","size","loading","asChild","props","forwardedRef","Component","Slot","ComponentLoading","disabled","VisuallyHidden","Spinner"]}
|
package/dist/chunk-UYD4MGAB.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkBASRQOAAcjs = require('./chunk-BASRQOAA.cjs');var _chunk4XRBMJ5Qcjs = require('./chunk-4XRBMJ5Q.cjs');var _react = require('react'); var r = _interopRequireWildcard(_react);var _reactdialog = require('@radix-ui/react-dialog'); var e = _interopRequireWildcard(_reactdialog);var _reacticons = require('@radix-ui/react-icons');var _jsxruntime = require('react/jsx-runtime');var v=e.Root,R= exports.b =e.Trigger,D= exports.c =r.forwardRef(({children:t,className:o,...a},s)=>_jsxruntime.jsx.call(void 0, e.Portal,{children:_jsxruntime.jsx.call(void 0, e.Overlay,{className:"data-[state=open]:animate-duration-200 data-[state=closed]:animate-duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out fixed inset-0 z-50 grid place-items-center overflow-auto bg-black/80 p-4 sm:pb-12 sm:pt-8",children:_jsxruntime.jsxs.call(void 0, e.Content,{ref:s,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "bg-background data-[state=open]:animate-in data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95 data-[state=open]:animate-duration-200 data-[state=closed]:animate-duration-200 data-[state=open]:fade-in data-[state=closed]:animate-out data-[state=closed]:fade-out relative z-50 flex w-full max-w-lg flex-col rounded-lg border shadow-lg",o),...a,children:[t,_jsxruntime.jsxs.call(void 0, e.Close,{className:"data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm p-1 opacity-70 transition hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none",children:[_jsxruntime.jsx.call(void 0, _reacticons.Cross2Icon,{className:"size-4"}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Close"})]})]})})}));D.displayName=e.Content.displayName;function C({className:t,...o}){return _jsxruntime.jsx.call(void 0, "header",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "flex shrink-0 flex-col gap-1.5 px-6 pb-4 pt-6 text-center sm:text-left",t),...o})}function T({className:t,...o}){return _jsxruntime.jsx.call(void 0, "main",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "overflow-auto px-6 py-2",t),...o})}function b({className:t,...o}){return _jsxruntime.jsx.call(void 0, "footer",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "flex shrink-0 flex-col-reverse gap-2 px-6 pb-6 pt-4 sm:flex-row sm:justify-end",t),...o})}var c=r.forwardRef(({className:t,...o},a)=>_jsxruntime.jsx.call(void 0, e.Title,{ref:a,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "text-lg font-semibold leading-none tracking-tight",t),...o}));c.displayName=e.Title.displayName;var d=r.forwardRef(({className:t,...o},a)=>_jsxruntime.jsx.call(void 0, e.Description,{ref:a,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "text-muted-foreground text-sm",t),...o}));d.displayName=e.Description.displayName;var f=r.forwardRef(({className:t,size:o,variant:a="outline",...s},m)=>_jsxruntime.jsx.call(void 0, e.Close,{ref:m,className:_chunkBASRQOAAcjs.a.call(void 0, {className:t,size:o,variant:a}),...s}));f.displayName=e.Close.displayName;exports.a = v; exports.b = R; exports.c = D; exports.d = C; exports.e = T; exports.f = b; exports.g = c; exports.h = d; exports.i = f;
|
|
2
|
-
//# sourceMappingURL=chunk-UYD4MGAB.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-UYD4MGAB.cjs","../src/react/dialog.tsx"],"names":["Dialog","DialogTrigger","DialogContent","children","className","props","forwardedRef","jsx","jsxs","cn","Cross2Icon","DialogHeader","DialogBody","DialogFooter","DialogTitle","DialogDescription","DialogClose","size","variant","buttonVariants"],"mappings":"AAAA,mZAAwC,wDAAyC,uECE1D,oGACU,mDACN,+CAsCjB,IA7BJA,CAAAA,CAAyB,CAAA,CAAA,IAAA,CAOzBC,CAAAA,aAAgC,CAAA,CAAA,OAAA,CAShCC,CAAAA,aAAsB,CAAA,CAAA,UAAA,CAC1B,CAAC,CAAE,QAAA,CAAAC,CAAAA,CAAU,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAClCC,6BAAAA,CAAiB,CAAA,MAAA,CAAhB,CACC,QAAA,CAAAA,6BAAAA,CAAiB,CAAA,OAAA,CAAhB,CAAwB,SAAA,CAAU,kPAAA,CACjC,QAAA,CAAAC,8BAAAA,CAAiB,CAAA,OAAA,CAAhB,CACC,GAAA,CAAKF,CAAAA,CACL,SAAA,CAAWG,iCAAAA,wVACT,CACAL,CACF,CAA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CAAAA,CACL,SAAA,CAAWG,iCAAAA,mDAAG,CAAqDL,CAAS,CAAA,CAC3E,GAAGC,CAAAA,CACN,CACD,CAAA,CAEDS,CAAAA,CAAY,WAAA,CAA8B,CAAA,CAAA,KAAA,CAAM,WAAA,CAShD,IAAMC,CAAAA,CAA0B,CAAA,CAAA,UAAA,CAC9B,CAAC,CAAE,SAAA,CAAAX,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxBC,6BAAAA,CAAiB,CAAA,WAAA,CAAhB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWG,iCAAAA,+BAAG,CAAiCL,CAAS,CAAA,CACvD,GAAGC,CAAAA,CACN,CAEJ,CAAA,CAEAU,CAAAA,CAAkB,WAAA,CAA8B,CAAA,CAAA,WAAA,CAAY,WAAA,CAa5D,IAAMC,CAAAA,CAAoB,CAAA,CAAA,UAAA,CACxB,CAAC,CAAE,SAAA,CAAAZ,CAAAA,CAAW,IAAA,CAAAa,CAAAA,CAAM,OAAA,CAAAC,CAAAA,CAAU,SAAA,CAAW,GAAGb,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACnDC,6BAAAA,CAAiB,CAAA,KAAA,CAAhB,CAAsB,GAAA,CAAKD,CAAAA,CAAc,SAAA,CAAWa,iCAAAA,CAAiB,SAAA,CAAAf,CAAAA,CAAW,IAAA,CAAAa,CAAAA,CAAM,OAAA,CAAAC,CAAQ,CAAC,CAAA,CAAI,GAAGb,CAAAA,CAAO,CAElH,CAAA,CAEAW,CAAAA,CAAY,WAAA,CAA8B,CAAA,CAAA,KAAA,CAAM,WAAA,CAAA,sIAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-UYD4MGAB.cjs","sourcesContent":[null,"'use client';\n\nimport * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Cross2Icon } from '@radix-ui/react-icons';\nimport { cn } from '@/lib/utils';\nimport { buttonVariants, type ButtonVariantsProps } from '@/react/button';\n\n/* -----------------------------------------------------------------------------\n * Component: Dialog\n * -------------------------------------------------------------------------- */\n\ntype DialogProps = React.ComponentProps<typeof DialogPrimitive.Root>;\nconst Dialog = DialogPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogTrigger\n * -------------------------------------------------------------------------- */\n\ntype DialogTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;\nconst DialogTrigger = DialogPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogContent\n * -------------------------------------------------------------------------- */\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ntype DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;\n\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n ({ children, className, ...props }, forwardedRef) => (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className=\"data-[state=open]:animate-duration-200 data-[state=closed]:animate-duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out fixed inset-0 z-50 grid place-items-center overflow-auto bg-black/80 p-4 sm:pb-12 sm:pt-8\">\n <DialogPrimitive.Content\n ref={forwardedRef}\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95 data-[state=open]:animate-duration-200 data-[state=closed]:animate-duration-200 data-[state=open]:fade-in data-[state=closed]:animate-out data-[state=closed]:fade-out relative z-50 flex w-full max-w-lg flex-col rounded-lg border shadow-lg',\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm p-1 opacity-70 transition hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none\">\n <Cross2Icon className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPrimitive.Overlay>\n </DialogPrimitive.Portal>\n ),\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogHeader\n * -------------------------------------------------------------------------- */\n\ntype DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogHeader({ className, ...props }: DialogHeaderProps): React.JSX.Element {\n return (\n <header\n className={cn('flex shrink-0 flex-col gap-1.5 px-6 pb-4 pt-6 text-center sm:text-left', className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogBody\n * -------------------------------------------------------------------------- */\n\ntype DialogBodyProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogBody({ className, ...props }: DialogBodyProps): React.JSX.Element {\n return <main className={cn('overflow-auto px-6 py-2', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogFooter\n * -------------------------------------------------------------------------- */\n\ntype DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogFooter({ className, ...props }: DialogFooterProps): React.JSX.Element {\n return (\n <footer\n className={cn('flex shrink-0 flex-col-reverse gap-2 px-6 pb-6 pt-4 sm:flex-row sm:justify-end', className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogTitle\n * -------------------------------------------------------------------------- */\n\ntype DialogTitleElement = React.ElementRef<typeof DialogPrimitive.Title>;\ntype DialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;\n\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(({ className, ...props }, forwardedRef) => (\n <DialogPrimitive.Title\n ref={forwardedRef}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n));\n\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogDescription\n * -------------------------------------------------------------------------- */\n\ntype DialogDescriptionElement = React.ElementRef<typeof DialogPrimitive.Description>;\ntype DialogDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;\n\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n ({ className, ...props }, forwardedRef) => (\n <DialogPrimitive.Description\n ref={forwardedRef}\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n ),\n);\n\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogClose\n * -------------------------------------------------------------------------- */\n\ntype DialogCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\n\ninterface DialogCloseProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close> {\n size?: ButtonVariantsProps['size'];\n variant?: ButtonVariantsProps['variant'];\n}\n\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n ({ className, size, variant = 'outline', ...props }, forwardedRef) => (\n <DialogPrimitive.Close ref={forwardedRef} className={buttonVariants({ className, size, variant })} {...props} />\n ),\n);\n\nDialogClose.displayName = DialogPrimitive.Close.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Dialog,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogBody,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n type DialogProps,\n type DialogTriggerProps,\n type DialogCloseProps,\n type DialogContentProps,\n type DialogHeaderProps,\n type DialogBodyProps,\n type DialogFooterProps,\n type DialogTitleProps,\n type DialogDescriptionProps,\n};\n"]}
|
package/dist/chunk-VOYJX4JS.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk-U62JBFEF.js";import{a as l}from"./chunk-VRBUDJBH.js";import*as r from"react";import*as e from"@radix-ui/react-dialog";import{Cross2Icon as g}from"@radix-ui/react-icons";import{jsx as i,jsxs as p}from"react/jsx-runtime";var v=e.Root,R=e.Trigger,D=r.forwardRef(({children:t,className:o,...a},s)=>i(e.Portal,{children:i(e.Overlay,{className:"data-[state=open]:animate-duration-200 data-[state=closed]:animate-duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out fixed inset-0 z-50 grid place-items-center overflow-auto bg-black/80 p-4 sm:pb-12 sm:pt-8",children:p(e.Content,{ref:s,className:l("bg-background data-[state=open]:animate-in data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95 data-[state=open]:animate-duration-200 data-[state=closed]:animate-duration-200 data-[state=open]:fade-in data-[state=closed]:animate-out data-[state=closed]:fade-out relative z-50 flex w-full max-w-lg flex-col rounded-lg border shadow-lg",o),...a,children:[t,p(e.Close,{className:"data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm p-1 opacity-70 transition hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none",children:[i(g,{className:"size-4"}),i("span",{className:"sr-only",children:"Close"})]})]})})}));D.displayName=e.Content.displayName;function C({className:t,...o}){return i("header",{className:l("flex shrink-0 flex-col gap-1.5 px-6 pb-4 pt-6 text-center sm:text-left",t),...o})}function T({className:t,...o}){return i("main",{className:l("overflow-auto px-6 py-2",t),...o})}function b({className:t,...o}){return i("footer",{className:l("flex shrink-0 flex-col-reverse gap-2 px-6 pb-6 pt-4 sm:flex-row sm:justify-end",t),...o})}var c=r.forwardRef(({className:t,...o},a)=>i(e.Title,{ref:a,className:l("text-lg font-semibold leading-none tracking-tight",t),...o}));c.displayName=e.Title.displayName;var d=r.forwardRef(({className:t,...o},a)=>i(e.Description,{ref:a,className:l("text-muted-foreground text-sm",t),...o}));d.displayName=e.Description.displayName;var f=r.forwardRef(({className:t,size:o,variant:a="outline",...s},m)=>i(e.Close,{ref:m,className:n({className:t,size:o,variant:a}),...s}));f.displayName=e.Close.displayName;export{v as a,R as b,D as c,C as d,T as e,b as f,c as g,d as h,f as i};
|
|
2
|
-
//# sourceMappingURL=chunk-VOYJX4JS.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Cross2Icon } from '@radix-ui/react-icons';\nimport { cn } from '@/lib/utils';\nimport { buttonVariants, type ButtonVariantsProps } from '@/react/button';\n\n/* -----------------------------------------------------------------------------\n * Component: Dialog\n * -------------------------------------------------------------------------- */\n\ntype DialogProps = React.ComponentProps<typeof DialogPrimitive.Root>;\nconst Dialog = DialogPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogTrigger\n * -------------------------------------------------------------------------- */\n\ntype DialogTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;\nconst DialogTrigger = DialogPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogContent\n * -------------------------------------------------------------------------- */\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ntype DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;\n\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n ({ children, className, ...props }, forwardedRef) => (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className=\"data-[state=open]:animate-duration-200 data-[state=closed]:animate-duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out fixed inset-0 z-50 grid place-items-center overflow-auto bg-black/80 p-4 sm:pb-12 sm:pt-8\">\n <DialogPrimitive.Content\n ref={forwardedRef}\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95 data-[state=open]:animate-duration-200 data-[state=closed]:animate-duration-200 data-[state=open]:fade-in data-[state=closed]:animate-out data-[state=closed]:fade-out relative z-50 flex w-full max-w-lg flex-col rounded-lg border shadow-lg',\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm p-1 opacity-70 transition hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none\">\n <Cross2Icon className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPrimitive.Overlay>\n </DialogPrimitive.Portal>\n ),\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogHeader\n * -------------------------------------------------------------------------- */\n\ntype DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogHeader({ className, ...props }: DialogHeaderProps): React.JSX.Element {\n return (\n <header\n className={cn('flex shrink-0 flex-col gap-1.5 px-6 pb-4 pt-6 text-center sm:text-left', className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogBody\n * -------------------------------------------------------------------------- */\n\ntype DialogBodyProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogBody({ className, ...props }: DialogBodyProps): React.JSX.Element {\n return <main className={cn('overflow-auto px-6 py-2', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogFooter\n * -------------------------------------------------------------------------- */\n\ntype DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogFooter({ className, ...props }: DialogFooterProps): React.JSX.Element {\n return (\n <footer\n className={cn('flex shrink-0 flex-col-reverse gap-2 px-6 pb-6 pt-4 sm:flex-row sm:justify-end', className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogTitle\n * -------------------------------------------------------------------------- */\n\ntype DialogTitleElement = React.ElementRef<typeof DialogPrimitive.Title>;\ntype DialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;\n\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(({ className, ...props }, forwardedRef) => (\n <DialogPrimitive.Title\n ref={forwardedRef}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n));\n\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogDescription\n * -------------------------------------------------------------------------- */\n\ntype DialogDescriptionElement = React.ElementRef<typeof DialogPrimitive.Description>;\ntype DialogDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;\n\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n ({ className, ...props }, forwardedRef) => (\n <DialogPrimitive.Description\n ref={forwardedRef}\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n ),\n);\n\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogClose\n * -------------------------------------------------------------------------- */\n\ntype DialogCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\n\ninterface DialogCloseProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close> {\n size?: ButtonVariantsProps['size'];\n variant?: ButtonVariantsProps['variant'];\n}\n\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n ({ className, size, variant = 'outline', ...props }, forwardedRef) => (\n <DialogPrimitive.Close ref={forwardedRef} className={buttonVariants({ className, size, variant })} {...props} />\n ),\n);\n\nDialogClose.displayName = DialogPrimitive.Close.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Dialog,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogBody,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n type DialogProps,\n type DialogTriggerProps,\n type DialogCloseProps,\n type DialogContentProps,\n type DialogHeaderProps,\n type DialogBodyProps,\n type DialogFooterProps,\n type DialogTitleProps,\n type DialogDescriptionProps,\n};\n"],"mappings":"gFAEA,UAAYA,MAAW,QACvB,UAAYC,MAAqB,yBACjC,OAAS,cAAAC,MAAkB,wBAsCjB,OACE,OAAAC,EADF,QAAAC,MAAA,oBA7BV,IAAMC,EAAyB,OAOzBC,EAAgC,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aACxB,CAAC,CAAE,UAAAV,EAAW,KAAAW,EAAM,QAAAC,EAAU,UAAW,GAAGX,CAAM,EAAGC,IACnDR,EAAiB,QAAhB,CAAsB,IAAKQ,EAAc,UAAWW,EAAe,CAAE,UAAAb,EAAW,KAAAW,EAAM,QAAAC,CAAQ,CAAC,EAAI,GAAGX,EAAO,CAElH,EAEAS,EAAY,YAA8B,QAAM","names":["React","DialogPrimitive","Cross2Icon","jsx","jsxs","Dialog","DialogTrigger","DialogContent","children","className","props","forwardedRef","cn","Cross2Icon","DialogHeader","DialogBody","DialogFooter","DialogTitle","DialogDescription","DialogClose","size","variant","buttonVariants"]}
|
package/dist/chunk-W5RHRZIO.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as L,b as U,c as H}from"./chunk-QCHBG2C4.js";import*as t from"react";import{createContextScope as z}from"@radix-ui/react-context";import{useComposedRefs as $}from"@radix-ui/react-compose-refs";import{composeEventHandlers as K}from"@radix-ui/primitive";import{Primitive as Y}from"@radix-ui/react-primitive";import{useControllableState as j}from"@radix-ui/react-use-controllable-state";import{jsx as h}from"react/jsx-runtime";var O="NumberInput",[q,Ne]=z(O,[L]),A=L(),[G,F]=q(O);function Q(n){let{__scopeNumberInput:r,ariaDecrementLabel:p,ariaIncrementLabel:f,defaultValue:a,disabled:N,formatOptions:R={style:"decimal",minimumFractionDigits:0},id:C,locale:E=navigator.language,max:m,min:s,onChange:d,readOnly:l,step:u=1,value:I,...v}=n,b=A(r),g=t.useRef(null),[y,w]=j({prop:I,defaultProp:a,onChange:d}),{thousandSeparator:S,decimalSeparator:x}=t.useMemo(()=>oe(E),[E]),D=t.useCallback(o=>o===void 0||isNaN(o)?"":new Intl.NumberFormat(E,R).format(o),[R,E]),B=t.useCallback(o=>{if(typeof o=="number")return V(o,s,m);if(typeof o!="string")return NaN;let T=o.trim().replace(/[^\d.,\-()]/g,"");if(T==="")return NaN;let k=ue(T,S,x),M=parseFloat(k);return R.style==="percent"&&(M/=100),isNaN(M)?0:V(M,s,m)},[x,R.style,m,s,S]),e=t.useCallback(o=>{let T=g.current;if(!T||N||l)return;let k=B(T.value)||0,M=V(o(k),s,m);T.value=D(M),w(M)},[N,D,m,s,B,l,w]),c=t.useCallback(()=>{e(o=>o+u)},[e,u]),i=t.useCallback(()=>{e(o=>o-u)},[e,u]),P=t.useCallback(()=>{e(o=>m??o+u)},[e,m,u]),X=t.useCallback(()=>{e(o=>s??o-u)},[e,s,u]);return h(G,{ariaDecrementLabel:p,ariaIncrementLabel:f,disabled:N,formatOptions:R,formatValue:D,id:C,inputRef:g,max:m,min:s,parseValue:B,readOnly:l,scope:r,value:y,onChange:w,onDecrement:i,onDecrementToMin:X,onIncrement:c,onIncrementToMax:P,children:h(U,{...b,...v})})}Q.displayName=O;var J="NumberInputItem",Z=t.forwardRef(({__scopeNumberInput:n,...r},p)=>{let f=A(n),{inputRef:a,disabled:N,id:R,max:C,min:E,readOnly:m,step:s,value:d,formatValue:l,parseValue:u,onChange:I,onIncrement:v,onDecrement:b,onIncrementToMax:g,onDecrementToMin:y}=F(J,n),w=$(p,a),S=t.useCallback(e=>{let c=u(e.target.value),i=l(c);i!==e.target.value&&(e.target.value=i),I(c)},[l,I,u]),x=t.useCallback(e=>{switch(e.key){case"ArrowUp":v(),e.preventDefault();break;case"PageUp":g(),e.preventDefault();break;case"ArrowDown":b(),e.preventDefault();break;case"PageDown":y(),e.preventDefault();break;default:break}},[v,g,b,y]),D=t.useCallback(e=>{switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"PageUp":case"PageDown":case"Tab":case"Escape":case"Enter":case"Backspace":case"Delete":case"Home":case"End":case".":case",":case"-":case"%":return;default:if(le(e.key)||me(e)||ce(e.key))return;e.preventDefault()}},[]),B=t.useCallback(e=>{let c=a.current;if(e.key!=="Enter"||!c)return;let i=u(c.value),P=l(i);P!==c.value&&(c.value=P),I(i)},[l,a,I,u]);return t.useEffect(()=>{let e=i=>{let P=a.current;!P||N||m||document.activeElement!==P||(i.preventDefault(),i.deltaY>0?v():b())},c=a.current;return c?.addEventListener("wheel",e),()=>{c?.removeEventListener("wheel",e)}},[v,b,a,N,m]),t.useEffect(()=>{let e=a.current;e&&e!==document.activeElement&&(e.value=l(d))},[l,a,d]),t.useEffect(()=>{let e=a.current;if(!e)return;let c=()=>{I()},i=e.form;return i?.addEventListener("reset",c),()=>{i?.removeEventListener("reset",c)}},[a,I]),h(H,{ref:w,...f,...r,defaultValue:l(d),disabled:N,id:R,max:C,min:E,readOnly:m,step:s,onBlur:K(r.onBlur,S),onKeyDown:K(r.onKeyDown,t.useMemo(()=>ae(D,x,B),[x,B,D]))})});Z.displayName=J;var W="NumberInputImplButton",_=t.forwardRef(({__scopeNumberInput:n,operation:r,...p},f)=>{let{ariaIncrementLabel:a,ariaDecrementLabel:N,disabled:R,readOnly:C,id:E,onIncrement:m,onDecrement:s}=F(W,n),d=t.useRef(null),l=t.useCallback(b=>{let y=()=>{b(),d.current=setTimeout(y,100)};b(),d.current=setTimeout(y,100*2)},[]),u=t.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null)},[]),I=t.useCallback(()=>{l(r==="increment"?m:s)},[s,m,r,l]),v=t.useCallback(b=>{b.preventDefault()},[]);return h(Y.button,{ref:f,"aria-controls":E,"aria-label":r==="increment"?a:N,"aria-live":"polite",disabled:R||C,tabIndex:-1,type:"button",onContextMenu:v,onPointerCancel:u,onPointerDown:I,onPointerLeave:u,onPointerUp:u,...p})});_.displayName=W;var ee="NumberInputIncrementButton",te=t.forwardRef((n,r)=>h(_,{operation:"increment",...n,ref:r}));te.displayName=ee;var ne="NumberInputDecrementButton",re=t.forwardRef((n,r)=>h(_,{operation:"decrement",...n,ref:r}));re.displayName=ne;function ae(...n){return(...r)=>{for(let p of n)p(...r)}}function oe(n){return new Intl.NumberFormat(n).formatToParts(12345.6).reduce((f,a)=>(a.type==="group"&&(f.thousandSeparator=a.value),a.type==="decimal"&&(f.decimalSeparator=a.value),f),{thousandSeparator:"",decimalSeparator:""})}function ue(n,r,p){return n.replace(new RegExp(`\\${r}`,"g"),"").replace(new RegExp(`\\${p}`),".").replace(/[()]/g,"-")}function me(n){return n.ctrlKey||n.altKey||n.metaKey||n.shiftKey}function ce(n){return n.startsWith("F")&&n.length>1}function le(n){return!isNaN(Number(n))}function V(n,r=-1/0,p=1/0){return Math.min(Math.max(n,r),p)}export{Ne as a,Q as b,Z as c,te as d,re as e};
|
|
2
|
-
//# sourceMappingURL=chunk-W5RHRZIO.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/primitive/number-input.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport * as InputPrimitive from '@/react/primitive/input';\nimport { createInputScope } from '@/react/primitive/input';\n\n/* -----------------------------------------------------------------------------\n * Component: NumberInput\n * -------------------------------------------------------------------------- */\n\nconst NUMBER_INPUT_NAME = 'NumberInput';\n\ntype ScopedProps<P> = P & {\n __scopeNumberInput?: Scope;\n};\nconst [createNumberInputContext, createNumberInputScope] = createContextScope(NUMBER_INPUT_NAME, [createInputScope]);\nconst useInputScope = createInputScope();\n\ninterface NumberInputContextValue {\n formatOptions: Intl.NumberFormatOptions;\n formatValue: (value?: number) => string;\n inputRef: React.RefObject<HTMLInputElement>;\n onChange: (value?: number) => void;\n onDecrement: () => void;\n onDecrementToMin: () => void;\n onIncrement: () => void;\n onIncrementToMax: () => void;\n parseValue: (value: string | number | readonly string[] | undefined) => number;\n ariaDecrementLabel?: string;\n ariaIncrementLabel?: string;\n disabled?: boolean;\n id?: string;\n max?: number;\n min?: number;\n readOnly?: boolean;\n step?: number;\n value?: number;\n}\n\nconst [NumberInputProvider, useNumberInputContext] =\n createNumberInputContext<NumberInputContextValue>(NUMBER_INPUT_NAME);\n\ninterface NumberInputProps extends Omit<InputPrimitive.InputProps, 'prefix' | 'suffix' | 'loading' | 'loaderPosition'> {\n ariaDecrementLabel?: string;\n ariaIncrementLabel?: string;\n defaultValue?: number;\n disabled?: boolean;\n formatOptions?: Intl.NumberFormatOptions;\n id?: string;\n locale?: string;\n max?: number;\n min?: number;\n onChange?: (value: number) => void;\n readOnly?: boolean;\n step?: number;\n value?: number;\n}\n\nfunction NumberInput(numberInputProps: NumberInputProps): React.JSX.Element {\n const {\n __scopeNumberInput,\n ariaDecrementLabel,\n ariaIncrementLabel,\n defaultValue,\n disabled,\n formatOptions = { style: 'decimal', minimumFractionDigits: 0 },\n id,\n locale = navigator.language,\n max,\n min,\n onChange,\n readOnly,\n step = 1,\n value: valueProp,\n ...props\n } = numberInputProps as ScopedProps<NumberInputProps>;\n const inputScope = useInputScope(__scopeNumberInput);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange,\n });\n\n const { thousandSeparator, decimalSeparator } = React.useMemo(() => getNumberFormatSeparators(locale), [locale]);\n\n const formatValue = React.useCallback(\n (inputValue?: number): string => {\n if (inputValue === undefined || isNaN(inputValue)) {\n return '';\n }\n\n return new Intl.NumberFormat(locale, formatOptions).format(inputValue);\n },\n [formatOptions, locale],\n );\n\n const parseValue = React.useCallback(\n (inputValue: string | number | readonly string[] | undefined): number => {\n if (typeof inputValue === 'number') {\n return clamp(inputValue, min, max);\n }\n\n if (typeof inputValue !== 'string') {\n return NaN;\n }\n\n const cleanedValue = inputValue.trim().replace(/[^\\d.,\\-()]/g, '');\n\n if (cleanedValue === '') {\n return NaN;\n }\n\n const normalizedValue = normalizeInputValue(cleanedValue, thousandSeparator, decimalSeparator);\n let parsedValue = parseFloat(normalizedValue);\n\n if (formatOptions.style === 'percent') {\n parsedValue /= 100;\n }\n\n return isNaN(parsedValue) ? 0 : clamp(parsedValue, min, max);\n },\n [decimalSeparator, formatOptions.style, max, min, thousandSeparator],\n );\n\n const changeNumberValue = React.useCallback(\n (operation: (number: number) => number) => {\n const inputElement = inputRef.current;\n\n if (!inputElement || disabled || readOnly) {\n return;\n }\n\n const currentValue = parseValue(inputElement.value) || 0;\n const newValue = clamp(operation(currentValue), min, max);\n\n inputElement.value = formatValue(newValue);\n setValue(newValue);\n },\n [disabled, formatValue, max, min, parseValue, readOnly, setValue],\n );\n\n const handleIncrement = React.useCallback(() => {\n changeNumberValue((number) => number + step);\n }, [changeNumberValue, step]);\n\n const handleDecrement = React.useCallback(() => {\n changeNumberValue((number) => number - step);\n }, [changeNumberValue, step]);\n\n const handleIncrementToMax = React.useCallback(() => {\n changeNumberValue((number) => max ?? number + step);\n }, [changeNumberValue, max, step]);\n\n const handleDecrementToMin = React.useCallback(() => {\n changeNumberValue((number) => min ?? number - step);\n }, [changeNumberValue, min, step]);\n\n return (\n <NumberInputProvider\n ariaDecrementLabel={ariaDecrementLabel}\n ariaIncrementLabel={ariaIncrementLabel}\n disabled={disabled}\n formatOptions={formatOptions}\n formatValue={formatValue}\n id={id}\n inputRef={inputRef}\n max={max}\n min={min}\n parseValue={parseValue}\n readOnly={readOnly}\n scope={__scopeNumberInput}\n value={value}\n onChange={setValue}\n onDecrement={handleDecrement}\n onDecrementToMin={handleDecrementToMin}\n onIncrement={handleIncrement}\n onIncrementToMax={handleIncrementToMax}\n >\n <InputPrimitive.Root {...inputScope} {...props} />\n </NumberInputProvider>\n );\n}\n\nNumberInput.displayName = NUMBER_INPUT_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: NumberInputItem\n * -------------------------------------------------------------------------- */\n\nconst NUMBER_INPUT_ITEM_NAME = 'NumberInputItem';\n\ntype NumberInputItemElement = React.ElementRef<typeof InputPrimitive.Item>;\ntype NumberInputItemProps = Omit<\n React.ComponentPropsWithoutRef<typeof InputPrimitive.Item>,\n 'min' | 'max' | 'value' | 'step' | 'onChange' | 'defaultValue' | 'disabled' | 'readOnly' | 'prefix' | 'id'\n>;\n\nconst NumberInputItem = React.forwardRef<NumberInputItemElement, NumberInputItemProps>(\n ({ __scopeNumberInput, ...props }: ScopedProps<NumberInputItemProps>, forwardedRef): React.JSX.Element => {\n const inputScope = useInputScope(__scopeNumberInput);\n const {\n inputRef,\n disabled,\n id,\n max,\n min,\n readOnly,\n step,\n value,\n formatValue,\n parseValue,\n onChange,\n onIncrement,\n onDecrement,\n onIncrementToMax,\n onDecrementToMin,\n } = useNumberInputContext(NUMBER_INPUT_ITEM_NAME, __scopeNumberInput);\n const composedNumberInputRef = useComposedRefs(forwardedRef, inputRef);\n\n // Handle blur event to format the value\n const handleBlur = React.useCallback<React.FocusEventHandler<HTMLInputElement>>(\n (event) => {\n const numericValue = parseValue(event.target.value);\n const formattedValue = formatValue(numericValue);\n\n if (formattedValue !== event.target.value) {\n event.target.value = formattedValue;\n }\n\n onChange(numericValue);\n },\n [formatValue, onChange, parseValue],\n );\n\n // Handle keyboard events to increment/decrement the value\n const handleKeyDown = React.useCallback<React.KeyboardEventHandler<HTMLInputElement>>(\n (event) => {\n switch (event.key) {\n case 'ArrowUp':\n onIncrement();\n event.preventDefault();\n break;\n\n case 'PageUp':\n onIncrementToMax();\n event.preventDefault();\n break;\n\n case 'ArrowDown':\n onDecrement();\n event.preventDefault();\n break;\n\n case 'PageDown':\n onDecrementToMin();\n event.preventDefault();\n break;\n\n default:\n break;\n }\n },\n [onIncrement, onIncrementToMax, onDecrement, onDecrementToMin],\n );\n\n // Prevent non-numeric input\n const handleKeyDownPrevent = React.useCallback<React.KeyboardEventHandler<HTMLInputElement>>((event) => {\n switch (event.key) {\n case 'ArrowUp':\n\n case 'ArrowDown':\n\n case 'ArrowLeft':\n\n case 'ArrowRight':\n\n case 'PageUp':\n\n case 'PageDown':\n\n case 'Tab':\n\n case 'Escape':\n\n case 'Enter':\n\n case 'Backspace':\n\n case 'Delete':\n\n case 'Home':\n\n case 'End':\n\n case '.':\n\n case ',':\n\n case '-':\n\n case '%':\n return;\n\n default:\n if (isNumberKey(event.key) || isModifierKey(event) || isFunctionKey(event.key)) {\n return;\n }\n\n event.preventDefault();\n }\n }, []);\n\n // Handle Enter key to format the value\n const handleKeyDownEnter = React.useCallback<React.KeyboardEventHandler<HTMLInputElement>>(\n (event) => {\n const inputElement = inputRef.current;\n\n if (event.key !== 'Enter' || !inputElement) {\n return;\n }\n\n const numericValue = parseValue(inputElement.value);\n const formattedValue = formatValue(numericValue);\n\n if (formattedValue !== inputElement.value) {\n inputElement.value = formattedValue;\n }\n\n onChange(numericValue);\n },\n [formatValue, inputRef, onChange, parseValue],\n );\n\n // Handle wheel event to increment/decrement the value\n React.useEffect(() => {\n const handleWheel = (event: WheelEvent): void => {\n const inputElement = inputRef.current;\n\n if (!inputElement || disabled || readOnly || document.activeElement !== inputElement) {\n return;\n }\n\n event.preventDefault();\n event.deltaY > 0 ? onIncrement() : onDecrement();\n };\n\n const inputElement = inputRef.current;\n\n inputElement?.addEventListener('wheel', handleWheel);\n\n return () => {\n inputElement?.removeEventListener('wheel', handleWheel);\n };\n }, [onIncrement, onDecrement, inputRef, disabled, readOnly]);\n\n // Format the value when the value changes\n React.useEffect(() => {\n const inputElement = inputRef.current;\n\n if (inputElement && inputElement !== document.activeElement) {\n inputElement.value = formatValue(value);\n }\n }, [formatValue, inputRef, value]);\n\n // Handle form reset\n React.useEffect(() => {\n const inputElement = inputRef.current;\n\n if (!inputElement) {\n return;\n }\n\n const handleReset = (): void => {\n onChange();\n };\n\n const form = inputElement.form;\n\n form?.addEventListener('reset', handleReset);\n\n return () => {\n form?.removeEventListener('reset', handleReset);\n };\n }, [inputRef, onChange]);\n\n return (\n <InputPrimitive.Item\n ref={composedNumberInputRef}\n {...inputScope}\n {...props}\n defaultValue={formatValue(value)}\n disabled={disabled}\n id={id}\n max={max}\n min={min}\n readOnly={readOnly}\n step={step}\n onBlur={composeEventHandlers(props.onBlur, handleBlur)}\n onKeyDown={composeEventHandlers(\n props.onKeyDown,\n React.useMemo(\n () => chain(handleKeyDownPrevent, handleKeyDown, handleKeyDownEnter),\n [handleKeyDown, handleKeyDownEnter, handleKeyDownPrevent],\n ),\n )}\n />\n );\n },\n);\n\nNumberInputItem.displayName = NUMBER_INPUT_ITEM_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: NumberInputImplButton\n * -------------------------------------------------------------------------- */\n\nconst NUMBER_INPUT_BUTTON_IMPL_NAME = 'NumberInputImplButton';\n\ntype NumberInputButtonImplElement = React.ElementRef<typeof Primitive.button>;\ninterface NumberInputButtonImplProps extends React.ComponentPropsWithoutRef<typeof Primitive.button> {\n operation: 'increment' | 'decrement';\n}\n\nconst NumberInputButtonImpl = React.forwardRef<NumberInputButtonImplElement, NumberInputButtonImplProps>(\n (\n { __scopeNumberInput, operation, ...props }: ScopedProps<NumberInputButtonImplProps>,\n forwardedRef,\n ): React.JSX.Element => {\n const { ariaIncrementLabel, ariaDecrementLabel, disabled, readOnly, id, onIncrement, onDecrement } =\n useNumberInputContext(NUMBER_INPUT_BUTTON_IMPL_NAME, __scopeNumberInput);\n const timeoutIdRef = React.useRef<NodeJS.Timeout | null>(null);\n\n const startActionInterval = React.useCallback((callback: () => void) => {\n const interval = 100;\n\n const repeatAction = (): void => {\n callback();\n timeoutIdRef.current = setTimeout(repeatAction, interval);\n };\n\n callback();\n timeoutIdRef.current = setTimeout(repeatAction, interval * 2);\n }, []);\n\n const clearActionInterval = React.useCallback(() => {\n if (timeoutIdRef.current) {\n clearTimeout(timeoutIdRef.current);\n timeoutIdRef.current = null;\n }\n }, []);\n\n const handlePointerDown = React.useCallback<React.PointerEventHandler<HTMLButtonElement>>(() => {\n const action = operation === 'increment' ? onIncrement : onDecrement;\n\n startActionInterval(action);\n }, [onDecrement, onIncrement, operation, startActionInterval]);\n\n const handleContextMenu = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>((event) => {\n event.preventDefault();\n }, []);\n\n return (\n <Primitive.button\n ref={forwardedRef}\n aria-controls={id}\n aria-label={operation === 'increment' ? ariaIncrementLabel : ariaDecrementLabel}\n aria-live=\"polite\"\n disabled={disabled || readOnly}\n tabIndex={-1}\n type=\"button\"\n onContextMenu={handleContextMenu}\n onPointerCancel={clearActionInterval}\n onPointerDown={handlePointerDown}\n onPointerLeave={clearActionInterval}\n onPointerUp={clearActionInterval}\n {...props}\n />\n );\n },\n);\n\nNumberInputButtonImpl.displayName = NUMBER_INPUT_BUTTON_IMPL_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: NumberInputIncrementButton\n * -------------------------------------------------------------------------- */\n\nconst NUMBER_INPUT_INCREMENT_BUTTON_NAME = 'NumberInputIncrementButton';\n\ntype NumberInputIncrementButtonElement = NumberInputButtonImplElement;\ntype NumberInputIncrementButtonProps = Omit<NumberInputButtonImplProps, 'operation'>;\n\nconst NumberInputIncrementButton = React.forwardRef<NumberInputIncrementButtonElement, NumberInputIncrementButtonProps>(\n (props: NumberInputIncrementButtonProps, forwardedRef): React.JSX.Element => (\n <NumberInputButtonImpl operation=\"increment\" {...props} ref={forwardedRef} />\n ),\n);\n\nNumberInputIncrementButton.displayName = NUMBER_INPUT_INCREMENT_BUTTON_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: NumberInputDecrementButton\n * -------------------------------------------------------------------------- */\n\nconst NUMBER_INPUT_DECREMENT_BUTTON_NAME = 'NumberInputDecrementButton';\n\ntype NumberInputDecrementButtonElement = NumberInputButtonImplElement;\ntype NumberInputDecrementButtonProps = Omit<NumberInputButtonImplProps, 'operation'>;\n\nconst NumberInputDecrementButton = React.forwardRef<NumberInputDecrementButtonElement, NumberInputDecrementButtonProps>(\n (props: NumberInputDecrementButtonProps, forwardedRef): React.JSX.Element => (\n <NumberInputButtonImpl operation=\"decrement\" {...props} ref={forwardedRef} />\n ),\n);\n\nNumberInputDecrementButton.displayName = NUMBER_INPUT_DECREMENT_BUTTON_NAME;\n\n/* -----------------------------------------------------------------------------\n * Utility Functions\n * -------------------------------------------------------------------------- */\n\nfunction chain<T extends unknown[]>(...callbacks: ((...args: T) => void)[]): (...args: T) => void {\n return (...args: T) => {\n for (const callback of callbacks) {\n callback(...args);\n }\n };\n}\n\nfunction getNumberFormatSeparators(locale: string): { decimalSeparator: string; thousandSeparator: string } {\n const numberFormat = new Intl.NumberFormat(locale);\n const parts = numberFormat.formatToParts(12345.6);\n\n return parts.reduce(\n (separatorOptions, part) => {\n if (part.type === 'group') {\n separatorOptions.thousandSeparator = part.value;\n }\n\n if (part.type === 'decimal') {\n separatorOptions.decimalSeparator = part.value;\n }\n\n return separatorOptions;\n },\n { thousandSeparator: '', decimalSeparator: '' },\n );\n}\n\nfunction normalizeInputValue(value: string, thousandSeparator: string, decimalSeparator: string): string {\n return value\n .replace(new RegExp(`\\\\${thousandSeparator}`, 'g'), '')\n .replace(new RegExp(`\\\\${decimalSeparator}`), '.')\n .replace(/[()]/g, '-');\n}\n\nfunction isModifierKey(event: React.KeyboardEvent<HTMLInputElement>): boolean {\n return event.ctrlKey || event.altKey || event.metaKey || event.shiftKey;\n}\n\nfunction isFunctionKey(key: string): boolean {\n return key.startsWith('F') && key.length > 1;\n}\n\nfunction isNumberKey(key: string): boolean {\n return !isNaN(Number(key));\n}\n\nfunction clamp(value: number, min = -Infinity, max = Infinity): number {\n return Math.min(Math.max(value, min), max);\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n createNumberInputScope,\n NumberInput,\n NumberInput as Root,\n NumberInputItem,\n NumberInputItem as Item,\n NumberInputIncrementButton,\n NumberInputIncrementButton as IncrementButton,\n NumberInputDecrementButton,\n NumberInputDecrementButton as DecrementButton,\n type NumberInputProps,\n type NumberInputItemProps,\n type NumberInputIncrementButtonProps,\n type NumberInputDecrementButtonProps,\n};\n"],"mappings":"sDAEA,UAAYA,MAAW,QACvB,OAAS,sBAAAC,MAAsC,0BAC/C,OAAS,mBAAAC,MAAuB,+BAChC,OAAS,wBAAAC,MA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AI,GAAG,EAAG,EAAE,EACrD,QAAQ,IAAI,OAAO,KAAKC,CAAgB,EAAE,EAAG,GAAG,EAChD,QAAQ,QAAS,GAAG,CACzB,CAEA,SAASqC,GAAcN,EAAuD,CAC5E,OAAOA,EAAM,SAAWA,EAAM,QAAUA,EAAM,SAAWA,EAAM,QACjE,CAEA,SAASO,GAAc0B,EAAsB,CAC3C,OAAOA,EAAI,WAAW,GAAG,GAAKA,EAAI,OAAS,CAC7C,CAEA,SAAS5B,GAAY4B,EAAsB,CACzC,MAAO,CAAC,MAAM,OAAOA,CAAG,CAAC,CAC3B,CAEA,SAAS3D,EAAMT,EAAeR,EAAM,KAAWD,EAAM,IAAkB,CACrE,OAAO,KAAK,IAAI,KAAK,IAAIS,EAAOR,CAAG,EAAGD,CAAG,CAC3C","names":["React","createContextScope","useComposedRefs","composeEventHandlers","Primitive","useControllableState","jsx","NUMBER_INPUT_NAME","createNumberInputContext","createNumberInputScope","createContextScope","createInputScope","useInputScope","NumberInputProvider","useNumberInputContext","NumberInput","numberInputProps","__scopeNumberInput","ariaDecrementLabel","ariaIncrementLabel","defaultValue","disabled","formatOptions","id","locale","max","min","onChange","readOnly","step","valueProp","props","inputScope","inputRef","value","setValue","useControllableState","thousandSeparator","decimalSeparator","getNumberFormatSeparators","formatValue","inputValue","parseValue","clamp","cleanedValue","normalizedValue","normalizeInputValue","parsedValue","changeNumberValue","operation","inputElement","currentValue","newValue","handleIncrement","number","handleDecrement","handleIncrementToMax","handleDecrementToMin","Input","NUMBER_INPUT_ITEM_NAME","NumberInputItem","forwardedRef","onIncrement","onDecrement","onIncrementToMax","onDecrementToMin","composedNumberInputRef","useComposedRefs","handleBlur","event","numericValue","formattedValue","handleKeyDown","handleKeyDownPrevent","isNumberKey","isModifierKey","isFunctionKey","handleKeyDownEnter","handleWheel","handleReset","form","InputItem","composeEventHandlers","chain","NUMBER_INPUT_BUTTON_IMPL_NAME","NumberInputButtonImpl","timeoutIdRef","startActionInterval","callback","repeatAction","clearActionInterval","handlePointerDown","handleContextMenu","Primitive","NUMBER_INPUT_INCREMENT_BUTTON_NAME","NumberInputIncrementButton","NUMBER_INPUT_DECREMENT_BUTTON_NAME","NumberInputDecrementButton","callbacks","args","separatorOptions","part","key"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkOJI2FD2Tcjs = require('../../chunk-OJI2FD2T.cjs');exports.CheckboxGroup = _chunkOJI2FD2Tcjs.b; exports.CheckboxGroupIndicator = _chunkOJI2FD2Tcjs.d; exports.CheckboxGroupItem = _chunkOJI2FD2Tcjs.c; exports.Indicator = _chunkOJI2FD2Tcjs.d; exports.Item = _chunkOJI2FD2Tcjs.c; exports.Root = _chunkOJI2FD2Tcjs.b; exports.createCheckboxGroupScope = _chunkOJI2FD2Tcjs.a;
|
|
2
|
-
//# sourceMappingURL=checkbox-group.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/react/primitive/checkbox-group.cjs"],"names":[],"mappings":"AAAA,qFAAY,CAAC,4DAA6C,4TAA+I","file":"/home/runner/work/codefast/codefast/packages/ui/dist/react/primitive/checkbox-group.cjs"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
4
|
-
import * as RovingFocusGroup from '@radix-ui/react-roving-focus';
|
|
5
|
-
import { Primitive } from '@radix-ui/react-primitive';
|
|
6
|
-
|
|
7
|
-
declare const createCheckboxGroupScope: _radix_ui_react_context.CreateScope;
|
|
8
|
-
interface CheckboxGroupContextValue {
|
|
9
|
-
disabled: boolean;
|
|
10
|
-
onItemCheck: (value: string) => void;
|
|
11
|
-
onItemUncheck: (value: string) => void;
|
|
12
|
-
required: boolean;
|
|
13
|
-
name?: string;
|
|
14
|
-
value?: string[];
|
|
15
|
-
}
|
|
16
|
-
interface CheckboxGroupProps extends React.ComponentPropsWithoutRef<typeof Primitive.div> {
|
|
17
|
-
defaultValue?: string[];
|
|
18
|
-
dir?: RovingFocusGroup.RovingFocusGroupProps['dir'];
|
|
19
|
-
disabled?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['disabled'];
|
|
20
|
-
loop?: RovingFocusGroup.RovingFocusGroupProps['loop'];
|
|
21
|
-
name?: CheckboxGroupContextValue['name'];
|
|
22
|
-
onValueChange?: (value: string[]) => void;
|
|
23
|
-
orientation?: RovingFocusGroup.RovingFocusGroupProps['orientation'];
|
|
24
|
-
required?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['required'];
|
|
25
|
-
value?: CheckboxGroupContextValue['value'];
|
|
26
|
-
}
|
|
27
|
-
declare const CheckboxGroup: React.ForwardRefExoticComponent<CheckboxGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
-
interface CheckboxGroupItemProps extends Omit<React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'> {
|
|
29
|
-
value: string;
|
|
30
|
-
}
|
|
31
|
-
declare const CheckboxGroupItem: React.ForwardRefExoticComponent<CheckboxGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
32
|
-
type CheckboxGroupIndicatorProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Indicator>;
|
|
33
|
-
declare const CheckboxGroupIndicator: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxIndicatorProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
34
|
-
|
|
35
|
-
export { CheckboxGroup, CheckboxGroupIndicator, type CheckboxGroupIndicatorProps, CheckboxGroupItem, type CheckboxGroupItemProps, type CheckboxGroupProps, CheckboxGroupIndicator as Indicator, CheckboxGroupItem as Item, CheckboxGroup as Root, createCheckboxGroupScope };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
4
|
-
import * as RovingFocusGroup from '@radix-ui/react-roving-focus';
|
|
5
|
-
import { Primitive } from '@radix-ui/react-primitive';
|
|
6
|
-
|
|
7
|
-
declare const createCheckboxGroupScope: _radix_ui_react_context.CreateScope;
|
|
8
|
-
interface CheckboxGroupContextValue {
|
|
9
|
-
disabled: boolean;
|
|
10
|
-
onItemCheck: (value: string) => void;
|
|
11
|
-
onItemUncheck: (value: string) => void;
|
|
12
|
-
required: boolean;
|
|
13
|
-
name?: string;
|
|
14
|
-
value?: string[];
|
|
15
|
-
}
|
|
16
|
-
interface CheckboxGroupProps extends React.ComponentPropsWithoutRef<typeof Primitive.div> {
|
|
17
|
-
defaultValue?: string[];
|
|
18
|
-
dir?: RovingFocusGroup.RovingFocusGroupProps['dir'];
|
|
19
|
-
disabled?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['disabled'];
|
|
20
|
-
loop?: RovingFocusGroup.RovingFocusGroupProps['loop'];
|
|
21
|
-
name?: CheckboxGroupContextValue['name'];
|
|
22
|
-
onValueChange?: (value: string[]) => void;
|
|
23
|
-
orientation?: RovingFocusGroup.RovingFocusGroupProps['orientation'];
|
|
24
|
-
required?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['required'];
|
|
25
|
-
value?: CheckboxGroupContextValue['value'];
|
|
26
|
-
}
|
|
27
|
-
declare const CheckboxGroup: React.ForwardRefExoticComponent<CheckboxGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
-
interface CheckboxGroupItemProps extends Omit<React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'> {
|
|
29
|
-
value: string;
|
|
30
|
-
}
|
|
31
|
-
declare const CheckboxGroupItem: React.ForwardRefExoticComponent<CheckboxGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
32
|
-
type CheckboxGroupIndicatorProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Indicator>;
|
|
33
|
-
declare const CheckboxGroupIndicator: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxIndicatorProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
34
|
-
|
|
35
|
-
export { CheckboxGroup, CheckboxGroupIndicator, type CheckboxGroupIndicatorProps, CheckboxGroupItem, type CheckboxGroupItemProps, type CheckboxGroupProps, CheckboxGroupIndicator as Indicator, CheckboxGroupItem as Item, CheckboxGroup as Root, createCheckboxGroupScope };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunk76TT2QSBcjs = require('../../chunk-76TT2QSB.cjs');exports.Input = _chunk76TT2QSBcjs.b; exports.InputItem = _chunk76TT2QSBcjs.c; exports.Item = _chunk76TT2QSBcjs.c; exports.Root = _chunk76TT2QSBcjs.b; exports.createInputScope = _chunk76TT2QSBcjs.a;
|
|
2
|
-
//# sourceMappingURL=input.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/react/primitive/input.cjs"],"names":[],"mappings":"AAAA,qFAAY,CAAC,4DAA2C,qMAA4E","file":"/home/runner/work/codefast/codefast/packages/ui/dist/react/primitive/input.cjs"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { Primitive } from '@radix-ui/react-primitive';
|
|
4
|
-
|
|
5
|
-
declare const createInputScope: _radix_ui_react_context.CreateScope;
|
|
6
|
-
type InputProps = React.PropsWithChildren<{
|
|
7
|
-
className?: string;
|
|
8
|
-
}>;
|
|
9
|
-
declare function Input(inputProps: InputProps): React.JSX.Element;
|
|
10
|
-
declare namespace Input {
|
|
11
|
-
var displayName: string;
|
|
12
|
-
}
|
|
13
|
-
type InputItemProps = React.ComponentPropsWithoutRef<typeof Primitive.input>;
|
|
14
|
-
declare const InputItem: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
15
|
-
ref?: ((instance: HTMLInputElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLInputElement> | null | undefined;
|
|
16
|
-
} & {
|
|
17
|
-
asChild?: boolean;
|
|
18
|
-
}, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
19
|
-
|
|
20
|
-
export { Input, InputItem, type InputItemProps, type InputProps, InputItem as Item, Input as Root, createInputScope };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { Primitive } from '@radix-ui/react-primitive';
|
|
4
|
-
|
|
5
|
-
declare const createInputScope: _radix_ui_react_context.CreateScope;
|
|
6
|
-
type InputProps = React.PropsWithChildren<{
|
|
7
|
-
className?: string;
|
|
8
|
-
}>;
|
|
9
|
-
declare function Input(inputProps: InputProps): React.JSX.Element;
|
|
10
|
-
declare namespace Input {
|
|
11
|
-
var displayName: string;
|
|
12
|
-
}
|
|
13
|
-
type InputItemProps = React.ComponentPropsWithoutRef<typeof Primitive.input>;
|
|
14
|
-
declare const InputItem: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
15
|
-
ref?: ((instance: HTMLInputElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLInputElement> | null | undefined;
|
|
16
|
-
} & {
|
|
17
|
-
asChild?: boolean;
|
|
18
|
-
}, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
19
|
-
|
|
20
|
-
export { Input, InputItem, type InputItemProps, type InputProps, InputItem as Item, Input as Root, createInputScope };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunk3Z6QUP75cjs = require('../../chunk-3Z6QUP75.cjs');require('../../chunk-76TT2QSB.cjs');exports.DecrementButton = _chunk3Z6QUP75cjs.e; exports.IncrementButton = _chunk3Z6QUP75cjs.d; exports.Item = _chunk3Z6QUP75cjs.c; exports.NumberInput = _chunk3Z6QUP75cjs.b; exports.NumberInputDecrementButton = _chunk3Z6QUP75cjs.e; exports.NumberInputIncrementButton = _chunk3Z6QUP75cjs.d; exports.NumberInputItem = _chunk3Z6QUP75cjs.c; exports.Root = _chunk3Z6QUP75cjs.b; exports.createNumberInputScope = _chunk3Z6QUP75cjs.a;
|
|
2
|
-
//# sourceMappingURL=number-input.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/react/primitive/number-input.cjs"],"names":[],"mappings":"AAAA,qFAAY,CAAC,4DAA+C,oCAAiC,yaAAwM","file":"/home/runner/work/codefast/codefast/packages/ui/dist/react/primitive/number-input.cjs"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { Primitive } from '@radix-ui/react-primitive';
|
|
4
|
-
import { InputProps, InputItem } from './input.cjs';
|
|
5
|
-
|
|
6
|
-
declare const createNumberInputScope: _radix_ui_react_context.CreateScope;
|
|
7
|
-
interface NumberInputProps extends Omit<InputProps, 'prefix' | 'suffix' | 'loading' | 'loaderPosition'> {
|
|
8
|
-
ariaDecrementLabel?: string;
|
|
9
|
-
ariaIncrementLabel?: string;
|
|
10
|
-
defaultValue?: number;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
formatOptions?: Intl.NumberFormatOptions;
|
|
13
|
-
id?: string;
|
|
14
|
-
locale?: string;
|
|
15
|
-
max?: number;
|
|
16
|
-
min?: number;
|
|
17
|
-
onChange?: (value: number) => void;
|
|
18
|
-
readOnly?: boolean;
|
|
19
|
-
step?: number;
|
|
20
|
-
value?: number;
|
|
21
|
-
}
|
|
22
|
-
declare function NumberInput(numberInputProps: NumberInputProps): React.JSX.Element;
|
|
23
|
-
declare namespace NumberInput {
|
|
24
|
-
var displayName: string;
|
|
25
|
-
}
|
|
26
|
-
type NumberInputItemProps = Omit<React.ComponentPropsWithoutRef<typeof InputItem>, 'min' | 'max' | 'value' | 'step' | 'onChange' | 'defaultValue' | 'disabled' | 'readOnly' | 'prefix' | 'id'>;
|
|
27
|
-
declare const NumberInputItem: React.ForwardRefExoticComponent<NumberInputItemProps & React.RefAttributes<HTMLInputElement>>;
|
|
28
|
-
interface NumberInputButtonImplProps extends React.ComponentPropsWithoutRef<typeof Primitive.button> {
|
|
29
|
-
operation: 'increment' | 'decrement';
|
|
30
|
-
}
|
|
31
|
-
type NumberInputIncrementButtonProps = Omit<NumberInputButtonImplProps, 'operation'>;
|
|
32
|
-
declare const NumberInputIncrementButton: React.ForwardRefExoticComponent<NumberInputIncrementButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
33
|
-
type NumberInputDecrementButtonProps = Omit<NumberInputButtonImplProps, 'operation'>;
|
|
34
|
-
declare const NumberInputDecrementButton: React.ForwardRefExoticComponent<NumberInputDecrementButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
35
|
-
|
|
36
|
-
export { NumberInputDecrementButton as DecrementButton, NumberInputIncrementButton as IncrementButton, NumberInputItem as Item, NumberInput, NumberInputDecrementButton, type NumberInputDecrementButtonProps, NumberInputIncrementButton, type NumberInputIncrementButtonProps, NumberInputItem, type NumberInputItemProps, type NumberInputProps, NumberInput as Root, createNumberInputScope };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { Primitive } from '@radix-ui/react-primitive';
|
|
4
|
-
import { InputProps, InputItem } from './input.js';
|
|
5
|
-
|
|
6
|
-
declare const createNumberInputScope: _radix_ui_react_context.CreateScope;
|
|
7
|
-
interface NumberInputProps extends Omit<InputProps, 'prefix' | 'suffix' | 'loading' | 'loaderPosition'> {
|
|
8
|
-
ariaDecrementLabel?: string;
|
|
9
|
-
ariaIncrementLabel?: string;
|
|
10
|
-
defaultValue?: number;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
formatOptions?: Intl.NumberFormatOptions;
|
|
13
|
-
id?: string;
|
|
14
|
-
locale?: string;
|
|
15
|
-
max?: number;
|
|
16
|
-
min?: number;
|
|
17
|
-
onChange?: (value: number) => void;
|
|
18
|
-
readOnly?: boolean;
|
|
19
|
-
step?: number;
|
|
20
|
-
value?: number;
|
|
21
|
-
}
|
|
22
|
-
declare function NumberInput(numberInputProps: NumberInputProps): React.JSX.Element;
|
|
23
|
-
declare namespace NumberInput {
|
|
24
|
-
var displayName: string;
|
|
25
|
-
}
|
|
26
|
-
type NumberInputItemProps = Omit<React.ComponentPropsWithoutRef<typeof InputItem>, 'min' | 'max' | 'value' | 'step' | 'onChange' | 'defaultValue' | 'disabled' | 'readOnly' | 'prefix' | 'id'>;
|
|
27
|
-
declare const NumberInputItem: React.ForwardRefExoticComponent<NumberInputItemProps & React.RefAttributes<HTMLInputElement>>;
|
|
28
|
-
interface NumberInputButtonImplProps extends React.ComponentPropsWithoutRef<typeof Primitive.button> {
|
|
29
|
-
operation: 'increment' | 'decrement';
|
|
30
|
-
}
|
|
31
|
-
type NumberInputIncrementButtonProps = Omit<NumberInputButtonImplProps, 'operation'>;
|
|
32
|
-
declare const NumberInputIncrementButton: React.ForwardRefExoticComponent<NumberInputIncrementButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
33
|
-
type NumberInputDecrementButtonProps = Omit<NumberInputButtonImplProps, 'operation'>;
|
|
34
|
-
declare const NumberInputDecrementButton: React.ForwardRefExoticComponent<NumberInputDecrementButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
35
|
-
|
|
36
|
-
export { NumberInputDecrementButton as DecrementButton, NumberInputIncrementButton as IncrementButton, NumberInputItem as Item, NumberInput, NumberInputDecrementButton, type NumberInputDecrementButtonProps, NumberInputIncrementButton, type NumberInputIncrementButtonProps, NumberInputItem, type NumberInputItemProps, type NumberInputProps, NumberInput as Root, createNumberInputScope };
|