@codefast/ui 0.0.71 → 0.0.72
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-NU6SK3FC.cjs → chunk-4XRBMJ5Q.cjs} +1 -1
- package/dist/chunk-4XRBMJ5Q.cjs.map +1 -0
- package/dist/chunk-76TT2QSB.cjs +2 -0
- package/dist/chunk-76TT2QSB.cjs.map +1 -0
- package/dist/{chunk-7A3KHJJC.cjs → chunk-AFEVR6CJ.cjs} +2 -2
- package/dist/{chunk-7A3KHJJC.cjs.map → chunk-AFEVR6CJ.cjs.map} +1 -1
- package/dist/{chunk-AZBLH63J.cjs → chunk-BASRQOAA.cjs} +2 -2
- package/dist/{chunk-AZBLH63J.cjs.map → chunk-BASRQOAA.cjs.map} +1 -1
- package/dist/chunk-CAK5VDBY.js +2 -0
- package/dist/chunk-CAK5VDBY.js.map +1 -0
- package/dist/chunk-DH7SJ5IC.cjs +2 -0
- package/dist/chunk-DH7SJ5IC.cjs.map +1 -0
- package/dist/chunk-JK5GPYFN.js +2 -0
- package/dist/chunk-JK5GPYFN.js.map +1 -0
- package/dist/chunk-JVSVYDS3.js +2 -0
- package/dist/chunk-JVSVYDS3.js.map +1 -0
- package/dist/{chunk-S5JZF45Z.js → chunk-MXS6YFVO.js} +2 -2
- package/dist/chunk-OJI2FD2T.cjs +2 -0
- package/dist/chunk-OJI2FD2T.cjs.map +1 -0
- package/dist/chunk-QCHBG2C4.js +2 -0
- package/dist/chunk-QCHBG2C4.js.map +1 -0
- package/dist/chunk-QI2XU7BP.js +2 -0
- package/dist/chunk-QI2XU7BP.js.map +1 -0
- package/dist/{chunk-HHCUGAQW.cjs → chunk-REVF5ERB.cjs} +2 -2
- package/dist/{chunk-HHCUGAQW.cjs.map → chunk-REVF5ERB.cjs.map} +1 -1
- package/dist/{chunk-MH6I6OV5.js → chunk-U62JBFEF.js} +2 -2
- package/dist/chunk-VJSYNP4O.cjs +2 -0
- package/dist/chunk-VJSYNP4O.cjs.map +1 -0
- package/dist/{chunk-5UXVZTFG.js → chunk-VRBUDJBH.js} +1 -1
- package/dist/chunk-VRBUDJBH.js.map +1 -0
- package/dist/{chunk-FXS5BSTC.cjs → chunk-VYHH6LAG.cjs} +2 -2
- package/dist/{chunk-FXS5BSTC.cjs.map → chunk-VYHH6LAG.cjs.map} +1 -1
- package/dist/{chunk-UIYLYEVW.js → chunk-WKA7T7JG.js} +2 -2
- package/dist/{chunk-EAV2D4D7.js → chunk-YQWJBH4E.js} +2 -2
- package/dist/{chunk-WSAUKCX6.js → chunk-Z6T6ART3.js} +2 -2
- package/dist/chunk-ZJPXJFFQ.cjs +2 -0
- package/dist/chunk-ZJPXJFFQ.cjs.map +1 -0
- package/dist/{chunk-Z35GXHKF.cjs → chunk-ZNI5WE4X.cjs} +2 -2
- package/dist/{chunk-Z35GXHKF.cjs.map → chunk-ZNI5WE4X.cjs.map} +1 -1
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.cts +3 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.js +1 -1
- package/dist/react/accordion.cjs +1 -1
- package/dist/react/accordion.js +1 -1
- package/dist/react/alert-dialog.cjs +1 -1
- package/dist/react/alert-dialog.js +1 -1
- package/dist/react/alert.cjs +1 -1
- package/dist/react/alert.js +1 -1
- package/dist/react/avatar.cjs +1 -1
- package/dist/react/avatar.js +1 -1
- package/dist/react/breadcrumb.cjs +1 -1
- package/dist/react/breadcrumb.js +1 -1
- package/dist/react/button.cjs +1 -1
- package/dist/react/button.js +1 -1
- package/dist/react/calendar.cjs +1 -1
- package/dist/react/calendar.cjs.map +1 -1
- package/dist/react/calendar.d.cts +1 -1
- package/dist/react/calendar.d.ts +1 -1
- package/dist/react/calendar.js +1 -1
- package/dist/react/calendar.js.map +1 -1
- package/dist/react/card.cjs +1 -1
- package/dist/react/card.js +1 -1
- package/dist/react/carousel.cjs +1 -1
- package/dist/react/carousel.cjs.map +1 -1
- package/dist/react/carousel.d.cts +3 -1
- package/dist/react/carousel.d.ts +3 -1
- package/dist/react/carousel.js +1 -1
- package/dist/react/carousel.js.map +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 +3 -3
- package/dist/react/checkbox-cards.d.ts +3 -3
- 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 +3 -3
- package/dist/react/checkbox-group.d.ts +3 -3
- package/dist/react/checkbox-group.js +1 -1
- package/dist/react/checkbox-group.js.map +1 -1
- package/dist/react/checkbox.cjs +1 -1
- package/dist/react/checkbox.js +1 -1
- package/dist/react/collapsible.cjs +1 -1
- package/dist/react/collapsible.js +1 -1
- package/dist/react/command.cjs +1 -1
- package/dist/react/command.js +1 -1
- package/dist/react/container.cjs +1 -1
- package/dist/react/container.js +1 -1
- package/dist/react/context-menu.cjs +1 -1
- package/dist/react/context-menu.js +1 -1
- package/dist/react/data-table.cjs +1 -1
- package/dist/react/data-table.js +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/dropdown-menu.cjs +1 -1
- package/dist/react/dropdown-menu.js +1 -1
- package/dist/react/form.cjs +1 -1
- package/dist/react/form.cjs.map +1 -1
- package/dist/react/form.d.cts +5 -15
- package/dist/react/form.d.ts +5 -15
- package/dist/react/form.js +1 -1
- package/dist/react/form.js.map +1 -1
- package/dist/react/hover-card.cjs +1 -1
- package/dist/react/hover-card.js +1 -1
- package/dist/react/input-otp.cjs +1 -1
- package/dist/react/input-otp.js +1 -1
- package/dist/react/kbd.cjs +1 -1
- package/dist/react/kbd.js +1 -1
- package/dist/react/label.cjs +1 -1
- package/dist/react/label.js +1 -1
- package/dist/react/menubar.cjs +1 -1
- package/dist/react/menubar.js +1 -1
- package/dist/react/navigation-menu.cjs +1 -1
- package/dist/react/navigation-menu.js +1 -1
- package/dist/react/number-input.cjs +2 -0
- package/dist/react/number-input.cjs.map +1 -0
- package/dist/react/number-input.d.cts +15 -0
- package/dist/react/number-input.d.ts +15 -0
- package/dist/react/number-input.js +2 -0
- package/dist/react/number-input.js.map +1 -0
- package/dist/react/pagination.cjs +1 -1
- package/dist/react/pagination.js +1 -1
- package/dist/react/popover.cjs +1 -1
- package/dist/react/popover.js +1 -1
- package/dist/react/primitive/checkbox-group.cjs +2 -0
- package/dist/react/primitive/checkbox-group.cjs.map +1 -0
- package/dist/react/{checkbox-group.primitive.d.cts → primitive/checkbox-group.d.cts} +1 -4
- package/dist/react/{checkbox-group.primitive.d.ts → primitive/checkbox-group.d.ts} +1 -4
- package/dist/react/primitive/checkbox-group.js +2 -0
- package/dist/react/primitive/input.cjs +2 -0
- package/dist/react/primitive/input.cjs.map +1 -0
- package/dist/react/primitive/input.d.cts +20 -0
- package/dist/react/primitive/input.d.ts +20 -0
- package/dist/react/primitive/input.js +2 -0
- package/dist/react/primitive/number-input.cjs +2 -0
- package/dist/react/primitive/number-input.cjs.map +1 -0
- package/dist/react/primitive/number-input.d.cts +36 -0
- package/dist/react/primitive/number-input.d.ts +36 -0
- package/dist/react/primitive/number-input.js +2 -0
- package/dist/react/primitive/number-input.js.map +1 -0
- package/dist/react/progress.cjs +1 -1
- package/dist/react/progress.js +1 -1
- package/dist/react/radio-cards.cjs +1 -1
- package/dist/react/radio-cards.js +1 -1
- package/dist/react/radio-group.cjs +1 -1
- package/dist/react/radio-group.js +1 -1
- package/dist/react/radio.cjs +1 -1
- package/dist/react/radio.js +1 -1
- package/dist/react/resizable.cjs +1 -1
- package/dist/react/resizable.js +1 -1
- package/dist/react/scroll-area.cjs +1 -1
- package/dist/react/scroll-area.js +1 -1
- package/dist/react/select.cjs +1 -1
- package/dist/react/select.js +1 -1
- package/dist/react/separator.cjs +1 -1
- package/dist/react/separator.js +1 -1
- package/dist/react/sheet.cjs +1 -1
- package/dist/react/sheet.js +1 -1
- package/dist/react/skeleton.cjs +1 -1
- package/dist/react/skeleton.js +1 -1
- package/dist/react/slider.cjs +1 -1
- package/dist/react/slider.js +1 -1
- package/dist/react/spinner.cjs +1 -1
- package/dist/react/spinner.d.cts +3 -2
- package/dist/react/spinner.d.ts +3 -2
- package/dist/react/spinner.js +1 -1
- package/dist/react/style/input.cjs +2 -0
- package/dist/react/style/input.cjs.map +1 -0
- package/dist/react/{input.d.cts → style/input.d.cts} +43 -21
- package/dist/react/{input.d.ts → style/input.d.ts} +43 -21
- package/dist/react/style/input.js +2 -0
- package/dist/react/style/input.js.map +1 -0
- package/dist/react/switch.cjs +1 -1
- package/dist/react/switch.js +1 -1
- package/dist/react/table.cjs +1 -1
- package/dist/react/table.js +1 -1
- package/dist/react/tabs.cjs +1 -1
- package/dist/react/tabs.js +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 +9 -2
- package/dist/react/text-input.d.ts +9 -2
- package/dist/react/text-input.js +1 -1
- package/dist/react/text-input.js.map +1 -1
- package/dist/react/textarea.cjs +1 -1
- package/dist/react/textarea.js +1 -1
- package/dist/react/toggle-group.cjs +1 -1
- package/dist/react/toggle-group.js +1 -1
- package/dist/react/tooltip.cjs +1 -1
- package/dist/react/tooltip.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +73 -68
- package/dist/chunk-26W5NJTU.js +0 -2
- package/dist/chunk-26W5NJTU.js.map +0 -1
- package/dist/chunk-4OVSEUWU.cjs +0 -2
- package/dist/chunk-4OVSEUWU.cjs.map +0 -1
- package/dist/chunk-5RJANBDJ.cjs +0 -2
- package/dist/chunk-5RJANBDJ.cjs.map +0 -1
- package/dist/chunk-5UXVZTFG.js.map +0 -1
- package/dist/chunk-E3N5D7SZ.js +0 -2
- package/dist/chunk-E3N5D7SZ.js.map +0 -1
- package/dist/chunk-EIQS2H2C.cjs +0 -2
- package/dist/chunk-EIQS2H2C.cjs.map +0 -1
- package/dist/chunk-LGVR62JW.js +0 -2
- package/dist/chunk-LGVR62JW.js.map +0 -1
- package/dist/chunk-NU6SK3FC.cjs.map +0 -1
- package/dist/react/checkbox-group.primitive.cjs +0 -2
- package/dist/react/checkbox-group.primitive.cjs.map +0 -1
- package/dist/react/checkbox-group.primitive.js +0 -2
- package/dist/react/input.cjs +0 -2
- package/dist/react/input.cjs.map +0 -1
- package/dist/react/input.js +0 -2
- /package/dist/{chunk-S5JZF45Z.js.map → chunk-MXS6YFVO.js.map} +0 -0
- /package/dist/{chunk-MH6I6OV5.js.map → chunk-U62JBFEF.js.map} +0 -0
- /package/dist/{chunk-UIYLYEVW.js.map → chunk-WKA7T7JG.js.map} +0 -0
- /package/dist/{chunk-EAV2D4D7.js.map → chunk-YQWJBH4E.js.map} +0 -0
- /package/dist/{chunk-WSAUKCX6.js.map → chunk-Z6T6ART3.js.map} +0 -0
- /package/dist/react/{checkbox-group.primitive.js.map → primitive/checkbox-group.js.map} +0 -0
- /package/dist/react/{input.js.map → primitive/input.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _tailwindmerge = require('tailwind-merge');var _clsx = require('clsx');function l(...r){return _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, r))}exports.a = l;
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-4XRBMJ5Q.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts"],"names":["cn","inputs","twMerge","clsx"],"mappings":"AAAA,wHAAwB,4BACc,SAKtBA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,oCAAAA,wBAAQC,CAAW,CAAC,CAC7B,CAAA,cAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-4XRBMJ5Q.cjs","sourcesContent":["import { twMerge } from 'tailwind-merge';\nimport { type ClassValue, clsx } from 'clsx';\n\n/**\n * Returns the combined class names from the given inputs.\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,YAAA,CAAAC,CAAAA,CAAc,GAAGC,CAAM,CAAA,CAAIF,CAAAA,CAC7BG,CAAAA,CAAiB,CAAA,CAAA,MAAA,CAAyB,IAAI,CAAA,CAE9CC,CAAAA,CAAgEC,CAAAA,EAAU,CAG9E,EAAA,CAFeA,CAAAA,CAAM,MAAA,CAEV,OAAA,CAAQ,kBAAkB,CAAA,CACnC,MAAA,CAGF,IAAMC,CAAAA,CAAeH,CAAAA,CAAS,OAAA,CAEzBG,CAAAA,EAIL,qBAAA,CAAsB,CAAA,CAAA,EAAM,CAE1B,EAAA,CAAIA,CAAAA,CAAa,IAAA,GAAS,MAAA,CAAQ,CAChCA,CAAAA,CAAa,KAAA,CAAM,CAAA,CAEnB,MACF,CAEAA,CAAAA,CAAa,KAAA,CAAM,CACrB,CAAC,CACH,CAAA,CAEA,OACEC,6BAAAA,CAACV,CAAA,CAAc,QAAA,CAAUM,CAAAA,CAAU,KAAA,CAAOF,CAAAA,CACxC,QAAA,CAAAM,6BAAAA,yBAACC,CAAU,GAAA,CAAV,CAAc,IAAA,CAAK,cAAA,CAAe,aAAA,CAAeJ,CAAAA,CAAoB,GAAGF,CAAAA,CAAO,CAAA,CAClF,CAEJ,CAEAH,CAAAA,CAAM,WAAA,CAAcN,CAAAA,CAMpB,IAAMgB,CAAAA,CAAkB,WAAA,CAKlBC,CAAAA,aAAkB,CAAA,CAAA,UAAA,CACtB,CAAC,CAAE,YAAA,CAAAT,CAAAA,CAAc,GAAGC,CAAM,CAAA,CAAgCS,CAAAA,CAAAA,EAAiB,CACzE,GAAM,CAAE,QAAA,CAAAR,CAAS,CAAA,CAAIL,CAAAA,CAAgBW,CAAAA,CAAiBR,CAAY,CAAA,CAC5DW,CAAAA,CAAmBC,+CAAAA,CAAgBF,CAAcR,CAAQ,CAAA,CAE/D,OAAOI,6BAAAA,yBAACC,CAAU,KAAA,CAAV,CAAgB,GAAA,CAAKI,CAAAA,CAAkB,IAAA,CAAK,MAAA,CAAQ,GAAGV,CAAAA,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"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
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
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
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 _chunk4XRBMJ5Qcjs = require('./chunk-4XRBMJ5Q.cjs');var _react = require('react'); var o = _interopRequireWildcard(_react);var _reactlabel = require('@radix-ui/react-label'); var e = _interopRequireWildcard(_reactlabel);var _jsxruntime = require('react/jsx-runtime');var m=o.forwardRef(({className:a,...i},l)=>_jsxruntime.jsx.call(void 0, e.Root,{ref:l,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "text-sm font-medium leading-none peer-disabled:pointer-events-none peer-disabled:opacity-70",a),...i}));m.displayName=e.Root.displayName;exports.a = m;
|
|
2
|
+
//# sourceMappingURL=chunk-AFEVR6CJ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-AFEVR6CJ.cjs","../src/react/label.tsx"],"names":["Label","className","props","forwardedRef","jsx","cn"],"mappings":"AAAA,mZAAwC,uECEjB,iGACS,+CAW9B,IADIA,CAAAA,CAAc,CAAA,CAAA,UAAA,CAAqC,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACjFC,6BAAAA,CAAgB,CAAA,IAAA,CAAf,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,iCAAAA,6FACT,CACAJ,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CACD,CAAA,CAEDF,CAAAA,CAAM,WAAA,CAA6B,CAAA,CAAA,IAAA,CAAK,WAAA,CAAA,cAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-AFEVR6CJ.cjs","sourcesContent":[null,"'use client';\n\nimport * as React from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Label\n * -------------------------------------------------------------------------- */\n\ntype LabelElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst Label = React.forwardRef<LabelElement, LabelProps>(({ className, ...props }, forwardedRef) => (\n <LabelPrimitive.Root\n ref={forwardedRef}\n className={cn(\n 'text-sm font-medium leading-none peer-disabled:pointer-events-none peer-disabled:opacity-70',\n className,\n )}\n {...props}\n />\n));\n\nLabel.displayName = LabelPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Label, type LabelProps };\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
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
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
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 _chunkVJSYNP4Ocjs = require('./chunk-VJSYNP4O.cjs');var _react = require('react'); var e = _interopRequireWildcard(_react);var _reactslot = require('@radix-ui/react-slot');var _reactvisuallyhidden = require('@radix-ui/react-visually-hidden');var _tailwindvariants = require('tailwind-variants');var _jsxruntime = require('react/jsx-runtime');var v=_tailwindvariants.tv.call(void 0, {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= exports.b =e.forwardRef(({children:n,className:i,variant:u,size:d,loading:o=!1,asChild:r=!1,...s},p)=>{let l=r?_reactslot.Slot:"button",c=r?"span":e.Fragment,f=o||s.disabled;return _jsxruntime.jsx.call(void 0, l,{ref:p,className:v({variant:u,size:d,loading:o,className:i}),type:r?void 0:"button",...s,disabled:f,children:o?_jsxruntime.jsxs.call(void 0, c,{children:[_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":!0,className:"invisible contents",children:n}),_jsxruntime.jsx.call(void 0, _reactvisuallyhidden.VisuallyHidden,{children:n}),_jsxruntime.jsx.call(void 0, "span",{className:"absolute inset-0 flex items-center justify-center",children:_jsxruntime.jsx.call(void 0, _chunkVJSYNP4Ocjs.a,{})})]}):n})});y.displayName="Button";exports.a = v; exports.b = y;
|
|
2
|
+
//# sourceMappingURL=chunk-BASRQOAA.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-
|
|
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,OA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A,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"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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 C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ckboxScope","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"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
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 _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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 _chunk76TT2QSBcjs = require('./chunk-76TT2QSB.cjs');var _react = require('react'); var t = _interopRequireWildcard(_react);var _reactcontext = require('@radix-ui/react-context');var _reactcomposerefs = require('@radix-ui/react-compose-refs');var _primitive = require('@radix-ui/primitive');var _reactprimitive = require('@radix-ui/react-primitive');var _reactusecontrollablestate = require('@radix-ui/react-use-controllable-state');var _jsxruntime = require('react/jsx-runtime');var O="NumberInput",[q,Ne]=_reactcontext.createContextScope.call(void 0, O,[_chunk76TT2QSBcjs.a]),A=_chunk76TT2QSBcjs.a.call(void 0, ),[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]=_reactusecontrollablestate.useControllableState.call(void 0, {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=>_nullishCoalesce(m, () => (o+u)))},[e,m,u]),X=t.useCallback(()=>{e(o=>_nullishCoalesce(s, () => (o-u)))},[e,s,u]);return _jsxruntime.jsx.call(void 0, 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:_jsxruntime.jsx.call(void 0, _chunk76TT2QSBcjs.b,{...b,...v})})}Q.displayName=O;var J="NumberInputItem",Z= exports.c =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=_reactcomposerefs.useComposedRefs.call(void 0, 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 _optionalChain([c, 'optionalAccess', _2 => _2.addEventListener, 'call', _3 => _3("wheel",e)]),()=>{_optionalChain([c, 'optionalAccess', _4 => _4.removeEventListener, 'call', _5 => _5("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 _optionalChain([i, 'optionalAccess', _6 => _6.addEventListener, 'call', _7 => _7("reset",c)]),()=>{_optionalChain([i, 'optionalAccess', _8 => _8.removeEventListener, 'call', _9 => _9("reset",c)])}},[a,I]),_jsxruntime.jsx.call(void 0, _chunk76TT2QSBcjs.c,{ref:w,...f,...r,defaultValue:l(d),disabled:N,id:R,max:C,min:E,readOnly:m,step:s,onBlur:_primitive.composeEventHandlers.call(void 0, r.onBlur,S),onKeyDown:_primitive.composeEventHandlers.call(void 0, 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 _jsxruntime.jsx.call(void 0, _reactprimitive.Primitive.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= exports.d =t.forwardRef((n,r)=>_jsxruntime.jsx.call(void 0, _,{operation:"increment",...n,ref:r}));te.displayName=ee;var ne="NumberInputDecrementButton",re= exports.e =t.forwardRef((n,r)=>_jsxruntime.jsx.call(void 0, _,{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)}exports.a = Ne; exports.b = Q; exports.c = Z; exports.d = te; exports.e = re;
|
|
2
|
+
//# sourceMappingURL=chunk-DH7SJ5IC.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-DH7SJ5IC.cjs","../src/react/primitive/number-input.tsx"],"names":["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","jsx","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"],"mappings":"AAAA,2/BAAsD,uECE/B,uDACwB,gEACf,gDACK,2DACX,mFACW,+CAkL/B,IA1KAA,CAAAA,CAAoB,aAAA,CAKpB,CAACC,CAAAA,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AAA,CACX,CAAC6E,CAAAA,CAAkBC,CAAAA,CAAAA,EAAAA,CACbA,CAAAA,CAAK,IAAA,GAAS,OAAA,EAAA,CAChBD,CAAAA,CAAiB,iBAAA,CAAoBC,CAAAA,CAAK,KAAA,CAAA,CAGxCA,CAAAA,CAAK,IAAA,GAAS,SAAA,EAAA,CAChBD,CAAAA,CAAiB,gBAAA,CAAmBC,CAAAA,CAAK,KAAA,CAAA,CAGpCD,CAAAA,CAAAA,CAET,CAAE,iBAAA,CAAmB,EAAA,CAAI,gBAAA,CAAkB,EAAG,CAChD,CACF,CAEA,SAASvD,EAAAA,CAAoBZ,CAAAA,CAAeG,CAAAA,CAA2BC,CAAAA,CAAkC,CACvG,OAAOJ,CAAAA,CACJ,OAAA,CAAQ,IAAI,MAAA,CAAO,CAAA,EAAA,EAAKG,CAAiB,CAAA,CAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-DH7SJ5IC.cjs","sourcesContent":[null,"'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 case 'PageUp':\n onIncrementToMax();\n event.preventDefault();\n break;\n case 'ArrowDown':\n onDecrement();\n event.preventDefault();\n break;\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 case 'ArrowDown':\n case 'ArrowLeft':\n case 'ArrowRight':\n case 'PageUp':\n case 'PageDown':\n case 'Tab':\n case 'Escape':\n case 'Enter':\n case 'Backspace':\n case 'Delete':\n case 'Home':\n case 'End':\n case '.':\n case ',':\n case '-':\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"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as o}from"./chunk-VRBUDJBH.js";import*as s from"react";import{VisuallyHidden as u}from"@radix-ui/react-visually-hidden";import{Primitive as e}from"@radix-ui/react-primitive";import{jsx as r,jsxs as c}from"react/jsx-runtime";var n=8,d=s.forwardRef(({children:t,className:p,loading:f=!0,...m},l)=>{if(!f)return t;let a=r(e.span,{ref:l,className:o("relative flex size-4 items-center justify-center opacity-60",p),...m,children:Array.from({length:n},(b,i)=>r(e.span,{className:"before:fade-out-25 before:animate-out before:animate-repeat-infinite before:animate-delay-[var(--spinner-delay)] before:animate-duration-[var(--spinner-duration)] absolute h-full rotate-[var(--spinner-rotate)] before:block before:h-1/3 before:w-full before:rounded-full before:bg-current",style:{width:`${(100/n).toString()}%`,"--spinner-delay":`-${((n-i)*100).toString()}ms`,"--spinner-rotate":`${(360/n*i).toString()}deg`,"--spinner-duration":`${(n*100).toString()}ms`}},i))});return t===void 0?a:c(e.span,{className:"relative",children:[r(e.span,{"aria-hidden":!0,className:"invisible contents",children:t}),r(u,{children:t}),r(e.span,{className:"absolute inset-0 flex items-center justify-center",children:a})]})});d.displayName="Spinner";export{d as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JK5GPYFN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/spinner.tsx"],"sourcesContent":["import * as React from 'react';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Spinner\n * -------------------------------------------------------------------------- */\n\nconst spinnerCount = 8;\n\ntype SpinnerElement = HTMLSpanElement;\n\ninterface SpinnerProps extends React.ComponentProps<typeof Primitive.span> {\n loading?: boolean;\n}\n\nconst Spinner = React.forwardRef<SpinnerElement, SpinnerProps>(\n ({ children, className, loading = true, ...props }, forwardedRef) => {\n if (!loading) {\n return children;\n }\n\n const spinner = (\n <Primitive.span\n ref={forwardedRef}\n className={cn('relative flex size-4 items-center justify-center opacity-60', className)}\n {...props}\n >\n {Array.from({ length: spinnerCount }, (_, i) => (\n <Primitive.span\n key={i}\n className=\"before:fade-out-25 before:animate-out before:animate-repeat-infinite before:animate-delay-[var(--spinner-delay)] before:animate-duration-[var(--spinner-duration)] absolute h-full rotate-[var(--spinner-rotate)] before:block before:h-1/3 before:w-full before:rounded-full before:bg-current\"\n style={\n {\n width: `${(100 / spinnerCount).toString()}%`,\n '--spinner-delay': `-${((spinnerCount - i) * 100).toString()}ms`,\n '--spinner-rotate': `${((360 / spinnerCount) * i).toString()}deg`,\n '--spinner-duration': `${(spinnerCount * 100).toString()}ms`,\n } as React.CSSProperties\n }\n />\n ))}\n </Primitive.span>\n );\n\n if (children === undefined) {\n return spinner;\n }\n\n return (\n <Primitive.span className=\"relative\">\n <Primitive.span aria-hidden className=\"invisible contents\">\n {children}\n </Primitive.span>\n <VisuallyHidden>{children}</VisuallyHidden>\n <Primitive.span className=\"absolute inset-0 flex items-center justify-center\">{spinner}</Primitive.span>\n </Primitive.span>\n );\n },\n);\n\nSpinner.displayName = 'Spinner';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Spinner, type SpinnerProps };\n"],"mappings":"wCAAA,UAAYA,MAAW,QACvB,OAAS,kBAAAC,MAAsB,kCAC/B,OAAS,aAAAC,MAAiB,4BA4BhB,cAAAC,EAqBJ,QAAAC,MArBI,oBArBV,IAAMC,EAAe,EAQfC,EAAgB,aACpB,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,QAAAC,EAAU,GAAM,GAAGC,CAAM,EAAGC,IAAiB,CACnE,GAAI,CAACF,EACH,OAAOF,EAGT,IAAMK,EACJT,EAACU,EAAU,KAAV,CACC,IAAKF,EACL,UAAWG,EAAG,8DAA+DN,CAAS,EACrF,GAAGE,EAEH,eAAM,KAAK,CAAE,OAAQL,CAAa,EAAG,CAACU,EAAG,IACxCZ,EAACU,EAAU,KAAV,CAEC,UAAU,kSACV,MACE,CACE,MAAO,IAAI,IAAMR,GAAc,SAAS,CAAC,IACzC,kBAAmB,MAAMA,EAAe,GAAK,KAAK,SAAS,CAAC,KAC5D,mBAAoB,IAAK,IAAMA,EAAgB,GAAG,SAAS,CAAC,MAC5D,qBAAsB,IAAIA,EAAe,KAAK,SAAS,CAAC,IAC1D,GARG,CAUP,CACD,EACH,EAGF,OAAIE,IAAa,OACRK,EAIPR,EAACS,EAAU,KAAV,CAAe,UAAU,WACxB,UAAAV,EAACU,EAAU,KAAV,CAAe,cAAW,GAAC,UAAU,qBACnC,SAAAN,EACH,EACAJ,EAACa,EAAA,CAAgB,SAAAT,EAAS,EAC1BJ,EAACU,EAAU,KAAV,CAAe,UAAU,oDAAqD,SAAAD,EAAQ,GACzF,CAEJ,CACF,EAEAN,EAAQ,YAAc","names":["React","VisuallyHidden","Primitive","jsx","jsxs","spinnerCount","Spinner","children","className","loading","props","forwardedRef","spinner","Primitive","cn","_","VisuallyHidden"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
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-JVSVYDS3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 case 'PageUp':\n onIncrementToMax();\n event.preventDefault();\n break;\n case 'ArrowDown':\n onDecrement();\n event.preventDefault();\n break;\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 case 'ArrowDown':\n case 'ArrowLeft':\n case 'ArrowRight':\n case 'PageUp':\n case 'PageDown':\n case 'Tab':\n case 'Escape':\n case 'Enter':\n case 'Backspace':\n case 'Delete':\n case 'Home':\n case 'End':\n case '.':\n case ',':\n case '-':\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,MAA4B,sBACrC,OAAS,aAAAC,MAAiB,4BAC1B,OAAS,wBAAAC,MAA4B,yCAkL/B,cAAAC,MAAA,oBA1KN,IAAMC,EAAoB,cAKpB,CAACC,EAA0BC,EAAsB,EAAIC,EAAmBH,EAAmB,CAACI,CAAgB,CAAC,EAC7GC,EAAgBD,EAAiB,EAuBjC,CAACE,EAAqBC,CAAqB,EAC/CN,EAAkDD,CAAiB,EAkBrE,SAASQ,EAAYC,EAAuD,CAC1E,GAAM,CACJ,mBAAAC,EACA,mBAAAC,EACA,mBAAAC,EACA,aAAAC,EACA,SAAAC,EACA,cAAAC,EAAgB,CAAE,MAAO,UAAW,sBAAuB,CAAE,EAC7D,GAAAC,EACA,OAAAC,EAAS,UAAU,SACnB,IAAAC,EACA,IAAAC,EACA,SAAAC,EACA,SAAAC,EACA,KAAAC,EAAO,EACP,MAAOC,EACP,GAAGC,CACL,EAAIf,EACEgB,EAAapB,EAAcK,CAAkB,EAC7CgB,EAAiB,SAAyB,IAAI,EAE9C,CAACC,EAAOC,CAAQ,EAAIC,EAAqB,CAC7C,KAAMN,EACN,YAAaV,EACb,SAAAO,CACF,CAAC,EAEK,CAAE,kBAAAU,EAAmB,iBAAAC,CAAiB,EAAU,UAAQ,IAAMC,GAA0Bf,CAAM,EAAG,CAACA,CAAM,CAAC,EAEzGgB,EAAoB,cACvBC,GACKA,IAAe,QAAa,MAAMA,CAAU,EACvC,GAGF,IAAI,KAAK,aAAajB,EAAQF,CAAa,EAAE,OAAOmB,CAAU,EAEvE,CAACnB,EAAeE,CAAM,CACxB,EAEMkB,EAAmB,cACtBD,GAAwE,CACvE,GAAI,OAAOA,GAAe,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D,EAAiB,iBAAmBC,EAAK,OAGpCD,GAET,CAAE,kBAAmB,GAAI,iBAAkB,EAAG,CAChD,CACF,CAEA,SAAStD,GAAoBZ,EAAeG,EAA2BC,EAAkC,CACvG,OAAOJ,EACJ,QAAQ,IAAI,OAAO,KAAKG,CAAiB,GAAI,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 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-VRBUDJBH.js";import*as r from"react";import*as e from"@radix-ui/react-dialog";import{Cross2Icon as p}from"@radix-ui/react-icons";import{jsx as i,jsxs as s}from"react/jsx-runtime";var f=e.Root,P=e.Trigger,y=e.Close,m=r.forwardRef(({children:t,className:o,...l},n)=>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:s(e.Content,{ref:n,className:a("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),...l,children:[t,s(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(p,{className:"size-4"}),i("span",{className:"sr-only",children:"Close"})]})]})})}));m.displayName=e.Content.displayName;function u({className:t,...o}){return i("header",{className:a("flex shrink-0 flex-col gap-1.5 px-6 pb-4 pt-6 text-center sm:text-left",t),...o})}function v({className:t,...o}){return i("main",{className:a("overflow-auto px-6 py-2",t),...o})}function R({className:t,...o}){return i("footer",{className:a("flex shrink-0 flex-col-reverse gap-2 px-6 pb-6 pt-4 sm:flex-row sm:justify-end",t),...o})}var g=r.forwardRef(({className:t,...o},l)=>i(e.Title,{ref:l,className:a("text-lg font-semibold leading-none tracking-tight",t),...o}));g.displayName=e.Title.displayName;var D=r.forwardRef(({className:t,...o},l)=>i(e.Description,{ref:l,className:a("text-muted-foreground text-sm",t),...o}));D.displayName=e.Description.displayName;export{f as a,P as b,y as c,m as d,u as e,v as f,R as g,g as h,D as i};
|
|
2
|
+
//# sourceMappingURL=chunk-MXS6YFVO.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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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CAAAA,CACH,GAAGnB,CAAAA,CACJ,eAAA,CAAkBqB,CAAAA,EAAiB,CAC7BA,CAAAA,CACFJ,CAAAA,CAAQ,WAAA,CAAYjB,CAAAA,CAAM,KAAK,CAAA,CAE/BiB,CAAAA,CAAQ,aAAA,CAAcjB,CAAAA,CAAM,KAAK,CAErC,CAAA,CACF,CAAA,CACF,CAEJ,CACF,CAAA,CAEAgB,CAAAA,CAAkB,WAAA,CAAcD,CAAAA,CAMhC,IAAMO,CAAAA,CAAiB,wBAAA,CAKjBC,CAAAA,aAA+B,CAAA,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"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
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-0 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-QI2XU7BP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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-0 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"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
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
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
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 _chunk4XRBMJ5Qcjs = require('./chunk-4XRBMJ5Q.cjs');var _react = require('react'); var a = _interopRequireWildcard(_react);var _reactdropdownmenu = require('@radix-ui/react-dropdown-menu'); var e = _interopRequireWildcard(_reactdropdownmenu);var _reacticons = require('@radix-ui/react-icons');var _jsxruntime = require('react/jsx-runtime');var g=e.Root,C= exports.b =e.Trigger,I= exports.c =e.Group,h= exports.d =e.Sub,S= exports.e =e.RadioGroup,l= exports.f =a.forwardRef(({children:o,className:t,inset:n,...i},d)=>_jsxruntime.jsxs.call(void 0, e.SubTrigger,{ref:d,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "focus:bg-accent data-[state=open]:bg-accent flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none",n&&"pl-8",t),...i,children:[o,_jsxruntime.jsx.call(void 0, _reacticons.ChevronRightIcon,{className:"ml-auto size-4"})]}));l.displayName=e.SubTrigger.displayName;var w=a.forwardRef(({className:o,...t},n)=>_jsxruntime.jsx.call(void 0, e.Portal,{children:_jsxruntime.jsx.call(void 0, e.SubContent,{ref:n,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md",o),...t})}));w.displayName=e.SubContent.displayName;var M=a.forwardRef(({className:o,sideOffset:t=6,...n},i)=>_jsxruntime.jsx.call(void 0, e.Portal,{children:_jsxruntime.jsx.call(void 0, e.Content,{ref:i,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md",o),sideOffset:t,...n})}));M.displayName=e.Content.displayName;var f=a.forwardRef(({className:o,inset:t,...n},i)=>_jsxruntime.jsx.call(void 0, e.Item,{ref:i,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",t&&"pl-8",o),...n}));f.displayName=e.Item.displayName;var D=a.forwardRef(({children:o,className:t,checked:n,...i},d)=>_jsxruntime.jsxs.call(void 0, e.CheckboxItem,{ref:d,checked:n,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",t),...i,children:[_jsxruntime.jsx.call(void 0, "span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:_jsxruntime.jsx.call(void 0, e.ItemIndicator,{children:_jsxruntime.jsx.call(void 0, _reacticons.CheckIcon,{className:"size-4"})})}),o]}));D.displayName=e.CheckboxItem.displayName;var P=a.forwardRef(({children:o,className:t,...n},i)=>_jsxruntime.jsxs.call(void 0, e.RadioItem,{ref:i,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",t),...n,children:[_jsxruntime.jsx.call(void 0, "span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:_jsxruntime.jsx.call(void 0, e.ItemIndicator,{children:_jsxruntime.jsx.call(void 0, _reacticons.DotFilledIcon,{className:"size-4 fill-current"})})}),o]}));P.displayName=e.RadioItem.displayName;var y=a.forwardRef(({className:o,inset:t,...n},i)=>_jsxruntime.jsx.call(void 0, e.Label,{ref:i,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "px-2 py-1.5 text-sm font-semibold",t&&"pl-8",o),...n}));y.displayName=e.Label.displayName;var R=a.forwardRef(({className:o,...t},n)=>_jsxruntime.jsx.call(void 0, e.Separator,{ref:n,className:_chunk4XRBMJ5Qcjs.a.call(void 0, "bg-muted -mx-1 my-1 h-px",o),...t}));R.displayName=e.Separator.displayName;function x({className:o,...t}){return _jsxruntime.jsx.call(void 0, "span",{className:_chunk4XRBMJ5Qcjs.a.call(void 0, "ml-auto text-xs tracking-widest opacity-60",o),...t})}exports.a = g; exports.b = C; exports.c = I; exports.d = h; exports.e = S; exports.f = l; exports.g = w; exports.h = M; exports.i = f; exports.j = D; exports.k = P; exports.l = y; exports.m = R; exports.n = x;
|
|
2
|
+
//# sourceMappingURL=chunk-REVF5ERB.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-HHCUGAQW.cjs","../src/react/dropdown-menu.tsx"],"names":["DropdownMenu","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","children","className","inset","props","forwardedRef","jsxs","cn","jsx","ChevronRightIcon","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","CheckIcon","DropdownMenuRadioItem","DotFilledIcon","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":"AAAA,mZAAwC,uECEjB,uHACgB,mDACoB,+CAkDvD,IA1CEA,CAAAA,CAAqC,CAAA,CAAA,IAAA,CAOrCC,CAAAA,aAA4C,CAAA,CAAA,OAAA,CAO5CC,CAAAA,aAA0C,CAAA,CAAA,KAAA,CAO1CC,CAAAA,aAAwC,CAAA,CAAA,GAAA,CAOxCC,CAAAA,aAA+C,CAAA,CAAA,UAAA,CAY/CC,CAAAA,aAA+B,CAAA,CAAA,UAAA,CACnC,CAAC,CAAE,QAAA,CAAAC,CAAAA,CAAU,SAAA,CAAAC,CAAAA,CAAW,KAAA,CAAAC,CAAAA,CAAO,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACzCC,8BAAAA,CAAuB,CAAA,UAAA,CAAtB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,iCAAAA,4IACT,CACAJ,CAAAA,EAAS,MAAA,CACTD,CACF,CAAA,CACC,GAAGE,CAAAA,CAEH,QAAA,CAAA,CAAAH,CAAAA,CACDO,6BAAAA,4BAACC,CAAA,CAAiB,SAAA,CAAU,gBAAA,CAAiB,CAAA,CAAA,CAC/C,CAEJ,CAAA,CAEAT,CAAAA,CAAuB,WAAA,CAAoC,CAAA,CAAA,UAAA,CAAW,WAAA,CAQtE,IAAMU,CAAAA,C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,CACF,CAAA,CACCjB,CAAAA,CAAAA,CACH,CAEJ,CAAA,CAEAgB,CAAAA,CAAsB,WAAA,CAAoC,CAAA,CAAA,SAAA,CAAU,WAAA,CAYpE,IAAME,CAAAA,CAA0B,CAAA,CAAA,UAAA,CAC9B,CAAC,CAAE,SAAA,CAAAjB,CAAAA,CAAW,KAAA,CAAAC,CAAAA,CAAO,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC/BG,6BAAAA,CAAuB,CAAA,KAAA,CAAtB,CACC,GAAA,CAAKH,CAAAA,CACL,SAAA,CAAWE,iCAAAA,mCAAG,CAAqCJ,CAAAA,EAAS,MAAA,CAAQD,CAAS,CAAA,CAC5E,GAAGE,CAAAA,CACN,CAEJ,CAAA,CAEAe,CAAAA,CAAkB,WAAA,CAAoC,CAAA,CAAA,KAAA,CAAM,WAAA,CAS5D,IAAMC,CAAAA,CAA8B,CAAA,CAAA,UAAA,CAClC,CAAC,CAAE,SAAA,CAAAlB,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxBG,6BAAAA,CAAuB,CAAA,SAAA,CAAtB,CACC,GAAA,CAAKH,CAAAA,CACL,SAAA,CAAWE,iCAAAA,0BAAG,CAA4BL,CAAS,CAAA,CAClD,GAAGE,CAAAA,CACN,CAEJ,CAAA,CAEAgB,CAAAA,CAAsB,WAAA,CAAoC,CAAA,CAAA,SAAA,CAAU,WAAA,CAQpE,SAASC,CAAAA,CAAqB,CAAE,SAAA,CAAAnB,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAiD,CACnG,OAAOI,6BAAAA,MAAC,CAAA,CAAK,SAAA,CAAWD,iCAAAA,4CAAG,CAA8CL,CAAS,CAAA,CAAI,GAAGE,CAAAA,CAAO,CAClG,CAAA,iNAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-HHCUGAQW.cjs","sourcesContent":[null,"'use client';\n\nimport * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { CheckIcon, ChevronRightIcon, DotFilledIcon } from '@radix-ui/react-icons';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenu\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>;\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuGroup\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuGroupProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSub\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Sub>;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioGroupProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup>;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>;\n\ninterface DropdownMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> {\n inset?: boolean;\n}\n\nconst DropdownMenuSubTrigger = React.forwardRef<DropdownMenuSubTriggerElement, DropdownMenuSubTriggerProps>(\n ({ children, className, inset, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={forwardedRef}\n className={cn(\n 'focus:bg-accent data-[state=open]:bg-accent flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n ),\n);\n\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubContentProps = DropdownMenuPrimitive.DropdownMenuSubContentProps;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n DropdownMenuSubContentProps\n>(({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={forwardedRef}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuContentElement = React.ElementRef<typeof DropdownMenuPrimitive.Content>;\ntype DropdownMenuContentProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>;\n\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n ({ className, sideOffset = 6, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={forwardedRef}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n sideOffset={sideOffset}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n ),\n);\n\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuItemElement = React.ElementRef<typeof DropdownMenuPrimitive.Item>;\n\ninterface DropdownMenuItemProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {\n inset?: boolean;\n}\n\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n ({ className, inset, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Item\n ref={forwardedRef}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n ),\n);\n\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>;\ntype DropdownMenuCheckboxItemProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<DropdownMenuCheckboxItemElement, DropdownMenuCheckboxItemProps>(\n ({ children, className, checked, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={forwardedRef}\n checked={checked}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n ),\n);\n\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuRadioItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioItemElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>;\ntype DropdownMenuRadioItemProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>;\n\nconst DropdownMenuRadioItem = React.forwardRef<DropdownMenuRadioItemElement, DropdownMenuRadioItemProps>(\n ({ children, className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.RadioItem\n ref={forwardedRef}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n ),\n);\n\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuLabel\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuLabelElement = React.ElementRef<typeof DropdownMenuPrimitive.Label>;\n\ninterface DropdownMenuLabelProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {\n inset?: boolean;\n}\n\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n ({ className, inset, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Label\n ref={forwardedRef}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n ),\n);\n\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSeparator\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSeparatorElement = React.ElementRef<typeof DropdownMenuPrimitive.Separator>;\ntype DropdownMenuSeparatorProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>;\n\nconst DropdownMenuSeparator = React.forwardRef<DropdownMenuSeparatorElement, DropdownMenuSeparatorProps>(\n ({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Separator\n ref={forwardedRef}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n ),\n);\n\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuShortcut\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): React.JSX.Element {\n return <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n type DropdownMenuProps,\n type DropdownMenuTriggerProps,\n type DropdownMenuContentProps,\n type DropdownMenuItemProps,\n type DropdownMenuCheckboxItemProps,\n type DropdownMenuRadioItemProps,\n type DropdownMenuLabelProps,\n type DropdownMenuSeparatorProps,\n type DropdownMenuShortcutProps,\n type DropdownMenuGroupProps,\n type DropdownMenuSubProps,\n type DropdownMenuSubContentProps,\n type DropdownMenuSubTriggerProps,\n type DropdownMenuRadioGroupProps,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-REVF5ERB.cjs","../src/react/dropdown-menu.tsx"],"names":["DropdownMenu","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","children","className","inset","props","forwardedRef","jsxs","cn","jsx","ChevronRightIcon","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","CheckIcon","DropdownMenuRadioItem","DotFilledIcon","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":"AAAA,mZAAwC,uECEjB,uHAC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ACN,CAEJ,CAAA,CAEAe,CAAAA,CAAkB,WAAA,CAAoC,CAAA,CAAA,KAAA,CAAM,WAAA,CAS5D,IAAMC,CAAAA,CAA8B,CAAA,CAAA,UAAA,CAClC,CAAC,CAAE,SAAA,CAAAlB,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxBG,6BAAAA,CAAuB,CAAA,SAAA,CAAtB,CACC,GAAA,CAAKH,CAAAA,CACL,SAAA,CAAWE,iCAAAA,0BAAG,CAA4BL,CAAS,CAAA,CAClD,GAAGE,CAAAA,CACN,CAEJ,CAAA,CAEAgB,CAAAA,CAAsB,WAAA,CAAoC,CAAA,CAAA,SAAA,CAAU,WAAA,CAQpE,SAASC,CAAAA,CAAqB,CAAE,SAAA,CAAAnB,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAiD,CACnG,OAAOI,6BAAAA,MAAC,CAAA,CAAK,SAAA,CAAWD,iCAAAA,4CAAG,CAA8CL,CAAS,CAAA,CAAI,GAAGE,CAAAA,CAAO,CAClG,CAAA,iNAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-REVF5ERB.cjs","sourcesContent":[null,"'use client';\n\nimport * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { CheckIcon, ChevronRightIcon, DotFilledIcon } from '@radix-ui/react-icons';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenu\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>;\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuGroup\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuGroupProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSub\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Sub>;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioGroupProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup>;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>;\n\ninterface DropdownMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> {\n inset?: boolean;\n}\n\nconst DropdownMenuSubTrigger = React.forwardRef<DropdownMenuSubTriggerElement, DropdownMenuSubTriggerProps>(\n ({ children, className, inset, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={forwardedRef}\n className={cn(\n 'focus:bg-accent data-[state=open]:bg-accent flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n ),\n);\n\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubContentProps = DropdownMenuPrimitive.DropdownMenuSubContentProps;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n DropdownMenuSubContentProps\n>(({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={forwardedRef}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuContentElement = React.ElementRef<typeof DropdownMenuPrimitive.Content>;\ntype DropdownMenuContentProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>;\n\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n ({ className, sideOffset = 6, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={forwardedRef}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n sideOffset={sideOffset}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n ),\n);\n\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuItemElement = React.ElementRef<typeof DropdownMenuPrimitive.Item>;\n\ninterface DropdownMenuItemProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {\n inset?: boolean;\n}\n\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n ({ className, inset, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Item\n ref={forwardedRef}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n ),\n);\n\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>;\ntype DropdownMenuCheckboxItemProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<DropdownMenuCheckboxItemElement, DropdownMenuCheckboxItemProps>(\n ({ children, className, checked, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={forwardedRef}\n checked={checked}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n ),\n);\n\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuRadioItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioItemElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>;\ntype DropdownMenuRadioItemProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>;\n\nconst DropdownMenuRadioItem = React.forwardRef<DropdownMenuRadioItemElement, DropdownMenuRadioItemProps>(\n ({ children, className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.RadioItem\n ref={forwardedRef}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n ),\n);\n\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuLabel\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuLabelElement = React.ElementRef<typeof DropdownMenuPrimitive.Label>;\n\ninterface DropdownMenuLabelProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {\n inset?: boolean;\n}\n\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n ({ className, inset, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Label\n ref={forwardedRef}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n ),\n);\n\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSeparator\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSeparatorElement = React.ElementRef<typeof DropdownMenuPrimitive.Separator>;\ntype DropdownMenuSeparatorProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>;\n\nconst DropdownMenuSeparator = React.forwardRef<DropdownMenuSeparatorElement, DropdownMenuSeparatorProps>(\n ({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Separator\n ref={forwardedRef}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n ),\n);\n\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuShortcut\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): React.JSX.Element {\n return <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n type DropdownMenuProps,\n type DropdownMenuTriggerProps,\n type DropdownMenuContentProps,\n type DropdownMenuItemProps,\n type DropdownMenuCheckboxItemProps,\n type DropdownMenuRadioItemProps,\n type DropdownMenuLabelProps,\n type DropdownMenuSeparatorProps,\n type DropdownMenuShortcutProps,\n type DropdownMenuGroupProps,\n type DropdownMenuSubProps,\n type DropdownMenuSubContentProps,\n type DropdownMenuSubTriggerProps,\n type DropdownMenuRadioGroupProps,\n};\n"]}
|