@gbmtech/aurora-ui 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/button.cjs +1 -1
- package/dist/cjs/components/button.cjs.map +1 -1
- package/dist/cjs/components/input.cjs +1 -1
- package/dist/cjs/components/input.cjs.map +1 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +1 -1
- package/dist/esm/components/input.js +1 -1
- package/dist/esm/components/input.js.map +1 -1
- package/dist/types/components/button.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{buttonVariants:()=>buttonVariants,Button:()=>Button});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),ssr_namespaceObject=require("@phosphor-icons/react/dist/ssr"),react_slot_namespaceObject=require("@radix-ui/react-slot"),utils_cjs_namespaceObject=require("../lib/utils.cjs"),buttonVariants=(0,utils_cjs_namespaceObject.tv)({base:"flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gbm-sky focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 max-lg:text-sm",variants:{variant:{primary:"bg-gbm-sky text-white hover:bg-gbm-ocean",secondary:"border border-stroke bg-white text-gbm-dark hover:bg-gray-100",tertiary:"border border-stroke bg-white text-gbm-sky hover:bg-gray-100",outline:"border border-gbm-sky bg-white text-gbm-sky hover:bg-gbm-sky hover:text-white",ghost:"text-gbm-dark hover:border-gbm-blue hover:bg-gray-100",destructive:"bg-rose-600 text-white hover:bg-rose-700",link:"text-gbm-dark underline-offset-2 hover:underline"},size:{sm:"h-10 gap-1.5 px-3 py-2",md:"h-12 gap-4 px-3 py-2",lg:"h-14 gap-6 px-3 py-4",icon:"h-10 w-10 p-2"},rounded:{true:"rounded-full",false:"rounded-md"},loading:{true:"pointer-events-none",false:""}},defaultVariants:{variant:"primary",size:"sm",rounded:!1,loading:!1}});function Button({className:e,children:t,variant:r,size:_,rounded:a,disabled:s,loading:
|
|
1
|
+
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{buttonVariants:()=>buttonVariants,Button:()=>Button});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),ssr_namespaceObject=require("@phosphor-icons/react/dist/ssr"),react_slot_namespaceObject=require("@radix-ui/react-slot"),utils_cjs_namespaceObject=require("../lib/utils.cjs"),buttonVariants=(0,utils_cjs_namespaceObject.tv)({base:"cursor-pointer flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gbm-sky focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 max-lg:text-sm",variants:{variant:{primary:"bg-gbm-sky text-white hover:bg-gbm-ocean",secondary:"border border-stroke bg-white text-gbm-dark hover:bg-gray-100",tertiary:"border border-stroke bg-white text-gbm-sky hover:bg-gray-100",outline:"border border-gbm-sky bg-white text-gbm-sky hover:bg-gbm-sky hover:text-white",ghost:"text-gbm-dark hover:border-gbm-blue hover:bg-gray-100",destructive:"bg-rose-600 text-white hover:bg-rose-700",link:"text-gbm-dark underline-offset-2 hover:underline"},size:{sm:"h-10 gap-1.5 px-3 py-2",md:"h-12 gap-4 px-3 py-2",lg:"h-14 gap-6 px-3 py-4",icon:"h-10 w-10 p-2"},rounded:{true:"rounded-full",false:"rounded-md"},loading:{true:"pointer-events-none",false:""}},defaultVariants:{variant:"primary",size:"sm",rounded:!1,loading:!1}});function Button({className:e,children:t,variant:r,size:_,rounded:a,disabled:s,loading:o,asChild:n=!1,...i}){let c=n?react_slot_namespaceObject.Slot:"button";return(0,jsx_runtime_namespaceObject.jsx)(c,{className:(0,utils_cjs_namespaceObject.cn)(buttonVariants({variant:r,size:_,rounded:a,loading:o,className:e})),"data-variant":r,disabled:s||o,type:"button",...i,children:(0,jsx_runtime_namespaceObject.jsx)(react_slot_namespaceObject.Slottable,{children:o?(0,jsx_runtime_namespaceObject.jsx)(ssr_namespaceObject.CircleNotch,{className:"animate-spin",size:16}):t})})}for(var __webpack_i__ in exports.Button=__webpack_exports__.Button,exports.buttonVariants=__webpack_exports__.buttonVariants,__webpack_exports__)-1===["Button","buttonVariants"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
|
2
2
|
//# sourceMappingURL=button.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\button.cjs","sources":["webpack://@gbmtech/aurora-ui/./src/components/button.tsx"],"sourcesContent":["import { CircleNotch } from '@phosphor-icons/react/dist/ssr'\r\nimport { Slot, Slottable } from '@radix-ui/react-slot'\r\nimport { ComponentProps } from 'react'\r\n\r\nimport type { VariantProps } from '../lib/utils'\r\n\r\nimport { cn, tv } from '../lib/utils'\r\n\r\nconst buttonVariants = tv({\r\n base: 'flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gbm-sky focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 max-lg:text-sm',\r\n variants: {\r\n variant: {\r\n primary: 'bg-gbm-sky text-white hover:bg-gbm-ocean',\r\n secondary:\r\n 'border border-stroke bg-white text-gbm-dark hover:bg-gray-100',\r\n tertiary: 'border border-stroke bg-white text-gbm-sky hover:bg-gray-100',\r\n outline:\r\n 'border border-gbm-sky bg-white text-gbm-sky hover:bg-gbm-sky hover:text-white',\r\n ghost: 'text-gbm-dark hover:border-gbm-blue hover:bg-gray-100',\r\n destructive: 'bg-rose-600 text-white hover:bg-rose-700',\r\n link: 'text-gbm-dark underline-offset-2 hover:underline',\r\n },\r\n size: {\r\n sm: 'h-10 gap-1.5 px-3 py-2',\r\n md: 'h-12 gap-4 px-3 py-2',\r\n lg: 'h-14 gap-6 px-3 py-4',\r\n icon: 'h-10 w-10 p-2',\r\n },\r\n rounded: {\r\n true: 'rounded-full',\r\n false: 'rounded-md',\r\n },\r\n loading: {\r\n true: 'pointer-events-none',\r\n false: '',\r\n },\r\n },\r\n defaultVariants: {\r\n variant: 'primary',\r\n size: 'sm',\r\n rounded: false,\r\n loading: false,\r\n },\r\n})\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: Button\r\n * -------------------------------------------------------------------------- */\r\n\r\nexport type ButtonProps = ComponentProps<'button'> &\r\n VariantProps<typeof buttonVariants> & {\r\n asChild?: boolean\r\n }\r\n\r\nfunction Button({\r\n className,\r\n children,\r\n variant,\r\n size,\r\n rounded,\r\n disabled,\r\n loading,\r\n asChild = false,\r\n ...props\r\n}: ButtonProps) {\r\n const Comp = asChild ? Slot : 'button'\r\n\r\n return (\r\n <Comp\r\n className={cn(\r\n buttonVariants({ variant, size, rounded, loading, className })\r\n )}\r\n data-variant={variant}\r\n disabled={disabled || loading}\r\n type=\"button\"\r\n {...props}\r\n >\r\n <Slottable>\r\n {loading ? (\r\n <CircleNotch className=\"animate-spin\" size={16} />\r\n ) : (\r\n children\r\n )}\r\n </Slottable>\r\n </Comp>\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Exports\r\n * -------------------------------------------------------------------------- */\r\n\r\nexport { Button, buttonVariants }\r\n"],"names":["buttonVariants","tv","Button","className","children","variant","size","rounded","disabled","loading","asChild","props","Comp","Slot","cn","Slottable","CircleNotch"],"mappings":"8iCAQMA,eAAiBC,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EAAG,CACxB,KAAM,
|
|
1
|
+
{"version":3,"file":"components\\button.cjs","sources":["webpack://@gbmtech/aurora-ui/./src/components/button.tsx"],"sourcesContent":["import { CircleNotch } from '@phosphor-icons/react/dist/ssr'\r\nimport { Slot, Slottable } from '@radix-ui/react-slot'\r\nimport { ComponentProps } from 'react'\r\n\r\nimport type { VariantProps } from '../lib/utils'\r\n\r\nimport { cn, tv } from '../lib/utils'\r\n\r\nconst buttonVariants = tv({\r\n base: 'cursor-pointer flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gbm-sky focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 max-lg:text-sm',\r\n variants: {\r\n variant: {\r\n primary: 'bg-gbm-sky text-white hover:bg-gbm-ocean',\r\n secondary:\r\n 'border border-stroke bg-white text-gbm-dark hover:bg-gray-100',\r\n tertiary: 'border border-stroke bg-white text-gbm-sky hover:bg-gray-100',\r\n outline:\r\n 'border border-gbm-sky bg-white text-gbm-sky hover:bg-gbm-sky hover:text-white',\r\n ghost: 'text-gbm-dark hover:border-gbm-blue hover:bg-gray-100',\r\n destructive: 'bg-rose-600 text-white hover:bg-rose-700',\r\n link: 'text-gbm-dark underline-offset-2 hover:underline',\r\n },\r\n size: {\r\n sm: 'h-10 gap-1.5 px-3 py-2',\r\n md: 'h-12 gap-4 px-3 py-2',\r\n lg: 'h-14 gap-6 px-3 py-4',\r\n icon: 'h-10 w-10 p-2',\r\n },\r\n rounded: {\r\n true: 'rounded-full',\r\n false: 'rounded-md',\r\n },\r\n loading: {\r\n true: 'pointer-events-none',\r\n false: '',\r\n },\r\n },\r\n defaultVariants: {\r\n variant: 'primary',\r\n size: 'sm',\r\n rounded: false,\r\n loading: false,\r\n },\r\n})\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: Button\r\n * -------------------------------------------------------------------------- */\r\n\r\nexport type ButtonProps = ComponentProps<'button'> &\r\n VariantProps<typeof buttonVariants> & {\r\n asChild?: boolean\r\n }\r\n\r\nfunction Button({\r\n className,\r\n children,\r\n variant,\r\n size,\r\n rounded,\r\n disabled,\r\n loading,\r\n asChild = false,\r\n ...props\r\n}: ButtonProps) {\r\n const Comp = asChild ? Slot : 'button'\r\n\r\n return (\r\n <Comp\r\n className={cn(\r\n buttonVariants({ variant, size, rounded, loading, className })\r\n )}\r\n data-variant={variant}\r\n disabled={disabled || loading}\r\n type=\"button\"\r\n {...props}\r\n >\r\n <Slottable>\r\n {loading ? (\r\n <CircleNotch className=\"animate-spin\" size={16} />\r\n ) : (\r\n children\r\n )}\r\n </Slottable>\r\n </Comp>\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Exports\r\n * -------------------------------------------------------------------------- */\r\n\r\nexport { Button, buttonVariants }\r\n"],"names":["buttonVariants","tv","Button","className","children","variant","size","rounded","disabled","loading","asChild","props","Comp","Slot","cn","Slottable","CircleNotch"],"mappings":"8iCAQMA,eAAiBC,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EAAG,CACxB,KAAM,gSACN,SAAU,CACR,QAAS,CACP,QAAS,2CACT,UACE,gEACF,SAAU,+DACV,QACE,gFACF,MAAO,wDACP,YAAa,2CACb,KAAM,kDACR,EACA,KAAM,CACJ,GAAI,yBACJ,GAAI,uBACJ,GAAI,uBACJ,KAAM,eACR,EACA,QAAS,CACP,KAAM,eACN,MAAO,YACT,EACA,QAAS,CACP,KAAM,sBACN,MAAO,EACT,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,KACN,QAAS,GACT,QAAS,EACX,CACF,GAWA,SAASC,OAAO,CACdC,UAAAA,CAAS,CACTC,SAAAA,CAAQ,CACRC,QAAAA,CAAO,CACPC,KAAAA,CAAI,CACJC,QAAAA,CAAO,CACPC,SAAAA,CAAQ,CACRC,QAAAA,CAAO,CACPC,QAAAA,EAAU,EAAK,CACf,GAAGC,EACS,EACZ,IAAMC,EAAOF,EAAUG,2BAAAA,IAAIA,CAAG,SAE9B,MACE,oCAACD,EAAAA,CACC,UAAWE,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EACTd,eAAe,CAAEK,QAAAA,EAASC,KAAAA,EAAMC,QAAAA,EAASE,QAAAA,EAASN,UAAAA,CAAU,IAE9D,eAAcE,EACd,SAAUG,GAAYC,EACtB,KAAK,SACJ,GAAGE,CAAK,C,SAET,oCAACI,2BAAAA,SAASA,CAAAA,C,SACPN,EACC,oCAACO,oBAAAA,WAAWA,CAAAA,CAAC,UAAU,eAAe,KAAM,E,GAE5CZ,C,IAKV,C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,_)=>{for(var r in _)__webpack_require__.o(_,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:_[r]})},__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Input:()=>Input});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),utils_cjs_namespaceObject=require("../lib/utils.cjs"),external_spinner_cjs_namespaceObject=require("./spinner.cjs");function Input({className:e,type:_,disabled:r,prefix:t,suffix:n,inputClassName:a,loading:c,loaderPosition:
|
|
2
|
+
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,_)=>{for(var r in _)__webpack_require__.o(_,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:_[r]})},__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Input:()=>Input});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),utils_cjs_namespaceObject=require("../lib/utils.cjs"),external_spinner_cjs_namespaceObject=require("./spinner.cjs");function Input({className:e,type:_,disabled:r,prefix:t,suffix:n,inputClassName:a,loading:c,loaderPosition:i="prefix",spinner:s,...p}){return(0,jsx_runtime_namespaceObject.jsxs)("div",{className:(0,utils_cjs_namespaceObject.cn)("flex h-12 w-full items-center gap-4 rounded-md border border-zinc-200 bg-background px-4 ring-offset-background placeholder:text-zinc-400 focus-within:outline-none focus-within:ring-2 focus-within:ring-gbm-sky focus-within:ring-offset-2 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",e),"data-disabled":r,children:[c&&"prefix"===i?s||(0,jsx_runtime_namespaceObject.jsx)(external_spinner_cjs_namespaceObject.Spinner,{}):t,(0,jsx_runtime_namespaceObject.jsx)("input",{className:(0,utils_cjs_namespaceObject.cn)("peer h-full w-full flex-1 overflow-hidden bg-transparent text-base outline-none placeholder:text-zinc-400",a),type:_,disabled:r,onKeyDown:e=>{"number"===_&&["e","E","+","-"].includes(e.key)&&e.preventDefault()},onFocus:e=>{"number"===_&&e.target.addEventListener("wheel",e=>{e.preventDefault()},{passive:!1})},...p}),c&&"suffix"===i?s||(0,jsx_runtime_namespaceObject.jsx)(external_spinner_cjs_namespaceObject.Spinner,{}):n]})}for(var __webpack_i__ in exports.Input=__webpack_exports__.Input,__webpack_exports__)-1===["Input"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
|
3
3
|
//# sourceMappingURL=input.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\input.cjs","sources":["webpack://@gbmtech/aurora-ui/./src/components/input.tsx"],"sourcesContent":["\r\n\r\nimport { ComponentProps, JSX, ReactNode } from 'react'\r\n\r\nimport { cn } from '../lib/utils'\r\nimport { Spinner } from './spinner'\r\n\r\nexport type InputProps = Omit<ComponentProps<'input'>, 'prefix'> & {\r\n prefix?: ReactNode\r\n suffix?: ReactNode\r\n inputClassName?: string\r\n loaderPosition?: 'prefix' | 'suffix'\r\n loading?: boolean\r\n spinner?: ReactNode\r\n}\r\n\r\nfunction Input({\r\n className,\r\n type,\r\n disabled,\r\n prefix,\r\n suffix,\r\n inputClassName,\r\n loading,\r\n loaderPosition = 'prefix',\r\n spinner,\r\n ...props\r\n}: InputProps): JSX.Element {\r\n return (\r\n <div\r\n className={cn(\r\n 'flex h-12 w-full items-center rounded-md border border-zinc-200 bg-background ring-offset-background placeholder:text-zinc-400 focus-within:outline-none focus-within:ring-2 focus-within:ring-gbm-sky focus-within:ring-offset-2 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50',\r\n className\r\n )}\r\n data-disabled={disabled}\r\n >\r\n {loading && loaderPosition === 'prefix' ?
|
|
1
|
+
{"version":3,"file":"components\\input.cjs","sources":["webpack://@gbmtech/aurora-ui/./src/components/input.tsx"],"sourcesContent":["\r\n\r\nimport { ComponentProps, JSX, ReactNode } from 'react'\r\n\r\nimport { cn } from '../lib/utils'\r\nimport { Spinner } from './spinner'\r\n\r\nexport type InputProps = Omit<ComponentProps<'input'>, 'prefix'> & {\r\n prefix?: ReactNode\r\n suffix?: ReactNode\r\n inputClassName?: string\r\n loaderPosition?: 'prefix' | 'suffix'\r\n loading?: boolean\r\n spinner?: ReactNode\r\n}\r\n\r\nfunction Input({\r\n className,\r\n type,\r\n disabled,\r\n prefix,\r\n suffix,\r\n inputClassName,\r\n loading,\r\n loaderPosition = 'prefix',\r\n spinner,\r\n ...props\r\n}: InputProps): JSX.Element {\r\n return (\r\n <div\r\n className={cn(\r\n 'flex h-12 w-full items-center gap-4 rounded-md border border-zinc-200 bg-background px-4 ring-offset-background placeholder:text-zinc-400 focus-within:outline-none focus-within:ring-2 focus-within:ring-gbm-sky focus-within:ring-offset-2 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50',\r\n className\r\n )}\r\n data-disabled={disabled}\r\n >\r\n {loading && loaderPosition === 'prefix' ? spinner || <Spinner /> : prefix}\r\n\r\n <input\r\n className={cn(\r\n 'peer h-full w-full flex-1 overflow-hidden bg-transparent text-base outline-none placeholder:text-zinc-400',\r\n inputClassName\r\n )}\r\n type={type}\r\n disabled={disabled}\r\n onKeyDown={e => {\r\n if (type === 'number' && ['e', 'E', '+', '-'].includes(e.key)) {\r\n e.preventDefault()\r\n }\r\n }}\r\n onFocus={e => {\r\n if (type === 'number') {\r\n e.target.addEventListener(\r\n 'wheel',\r\n e => {\r\n e.preventDefault()\r\n },\r\n { passive: false }\r\n )\r\n }\r\n }}\r\n {...props}\r\n />\r\n\r\n {loading && loaderPosition === 'suffix' ? spinner || <Spinner /> : suffix}\r\n </div>\r\n )\r\n}\r\n\r\nexport { Input }\r\n"],"names":["Input","className","type","disabled","prefix","suffix","inputClassName","loading","loaderPosition","spinner","props","cn","Spinner","e"],"mappings":";+8BAgBA,SAASA,MAAM,CACbC,UAAAA,CAAS,CACTC,KAAAA,CAAI,CACJC,SAAAA,CAAQ,CACRC,OAAAA,CAAM,CACNC,OAAAA,CAAM,CACNC,eAAAA,CAAc,CACdC,QAAAA,CAAO,CACPC,eAAAA,EAAiB,QAAQ,CACzBC,QAAAA,CAAO,CACP,GAAGC,EACQ,EACX,MACE,qCAAC,OACC,UAAWC,GAAAA,0BAAAA,EAAAA,EACT,uTACAV,GAEF,gBAAeE,E,UAEdI,GAAWC,WAAAA,EAA8BC,GAAW,oCAACG,qCAAAA,OAAOA,CAAAA,CAAAA,GAAMR,EAEnE,oCAAC,SACC,UAAWO,GAAAA,0BAAAA,EAAAA,EACT,4GACAL,GAEF,KAAMJ,EACN,SAAUC,EACV,UAAWU,IACLX,WAAAA,GAAqB,CAAC,IAAK,IAAK,IAAK,IAAI,CAAC,QAAQ,CAACW,EAAE,GAAG,GAC1DA,EAAE,cAAc,EAEpB,EACA,QAASA,IACHX,WAAAA,GACFW,EAAE,MAAM,CAAC,gBAAgB,CACvB,QACAA,IACEA,EAAE,cAAc,EAClB,EACA,CAAE,QAAS,EAAM,EAGvB,EACC,GAAGH,CAAK,GAGVH,GAAWC,WAAAA,EAA8BC,GAAW,oCAACG,qCAAAA,OAAOA,CAAAA,CAAAA,GAAMP,E,EAGzE,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react/jsx-runtime";import*as
|
|
1
|
+
import*as e from"react/jsx-runtime";import*as r from"@phosphor-icons/react/dist/ssr";import*as t from"@radix-ui/react-slot";import*as o from"../lib/utils.js";let i=(0,o.tv)({base:"cursor-pointer flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gbm-sky focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 max-lg:text-sm",variants:{variant:{primary:"bg-gbm-sky text-white hover:bg-gbm-ocean",secondary:"border border-stroke bg-white text-gbm-dark hover:bg-gray-100",tertiary:"border border-stroke bg-white text-gbm-sky hover:bg-gray-100",outline:"border border-gbm-sky bg-white text-gbm-sky hover:bg-gbm-sky hover:text-white",ghost:"text-gbm-dark hover:border-gbm-blue hover:bg-gray-100",destructive:"bg-rose-600 text-white hover:bg-rose-700",link:"text-gbm-dark underline-offset-2 hover:underline"},size:{sm:"h-10 gap-1.5 px-3 py-2",md:"h-12 gap-4 px-3 py-2",lg:"h-14 gap-6 px-3 py-4",icon:"h-10 w-10 p-2"},rounded:{true:"rounded-full",false:"rounded-md"},loading:{true:"pointer-events-none",false:""}},defaultVariants:{variant:"primary",size:"sm",rounded:!1,loading:!1}});function s({className:s,children:a,variant:n,size:b,rounded:d,disabled:g,loading:l,asChild:m=!1,...u}){let c=m?t.Slot:"button";return(0,e.jsx)(c,{className:(0,o.cn)(i({variant:n,size:b,rounded:d,loading:l,className:s})),"data-variant":n,disabled:g||l,type:"button",...u,children:(0,e.jsx)(t.Slottable,{children:l?(0,e.jsx)(r.CircleNotch,{className:"animate-spin",size:16}):a})})}export{s as Button,i as buttonVariants};
|
|
2
2
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\button.js","sources":["webpack://@gbmtech/aurora-ui/./src/components/button.tsx"],"sourcesContent":["import { CircleNotch } from '@phosphor-icons/react/dist/ssr'\r\nimport { Slot, Slottable } from '@radix-ui/react-slot'\r\nimport { ComponentProps } from 'react'\r\n\r\nimport type { VariantProps } from '../lib/utils'\r\n\r\nimport { cn, tv } from '../lib/utils'\r\n\r\nconst buttonVariants = tv({\r\n base: 'flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gbm-sky focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 max-lg:text-sm',\r\n variants: {\r\n variant: {\r\n primary: 'bg-gbm-sky text-white hover:bg-gbm-ocean',\r\n secondary:\r\n 'border border-stroke bg-white text-gbm-dark hover:bg-gray-100',\r\n tertiary: 'border border-stroke bg-white text-gbm-sky hover:bg-gray-100',\r\n outline:\r\n 'border border-gbm-sky bg-white text-gbm-sky hover:bg-gbm-sky hover:text-white',\r\n ghost: 'text-gbm-dark hover:border-gbm-blue hover:bg-gray-100',\r\n destructive: 'bg-rose-600 text-white hover:bg-rose-700',\r\n link: 'text-gbm-dark underline-offset-2 hover:underline',\r\n },\r\n size: {\r\n sm: 'h-10 gap-1.5 px-3 py-2',\r\n md: 'h-12 gap-4 px-3 py-2',\r\n lg: 'h-14 gap-6 px-3 py-4',\r\n icon: 'h-10 w-10 p-2',\r\n },\r\n rounded: {\r\n true: 'rounded-full',\r\n false: 'rounded-md',\r\n },\r\n loading: {\r\n true: 'pointer-events-none',\r\n false: '',\r\n },\r\n },\r\n defaultVariants: {\r\n variant: 'primary',\r\n size: 'sm',\r\n rounded: false,\r\n loading: false,\r\n },\r\n})\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: Button\r\n * -------------------------------------------------------------------------- */\r\n\r\nexport type ButtonProps = ComponentProps<'button'> &\r\n VariantProps<typeof buttonVariants> & {\r\n asChild?: boolean\r\n }\r\n\r\nfunction Button({\r\n className,\r\n children,\r\n variant,\r\n size,\r\n rounded,\r\n disabled,\r\n loading,\r\n asChild = false,\r\n ...props\r\n}: ButtonProps) {\r\n const Comp = asChild ? Slot : 'button'\r\n\r\n return (\r\n <Comp\r\n className={cn(\r\n buttonVariants({ variant, size, rounded, loading, className })\r\n )}\r\n data-variant={variant}\r\n disabled={disabled || loading}\r\n type=\"button\"\r\n {...props}\r\n >\r\n <Slottable>\r\n {loading ? (\r\n <CircleNotch className=\"animate-spin\" size={16} />\r\n ) : (\r\n children\r\n )}\r\n </Slottable>\r\n </Comp>\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Exports\r\n * -------------------------------------------------------------------------- */\r\n\r\nexport { Button, buttonVariants }\r\n"],"names":["buttonVariants","tv","Button","className","children","variant","size","rounded","disabled","loading","asChild","props","Comp","Slot","cn","Slottable","CircleNotch"],"mappings":"8JAQA,IAAMA,EAAiBC,AAAAA,GAAAA,EAAAA,EAAAA,AAAAA,EAAG,CACxB,KAAM,
|
|
1
|
+
{"version":3,"file":"components\\button.js","sources":["webpack://@gbmtech/aurora-ui/./src/components/button.tsx"],"sourcesContent":["import { CircleNotch } from '@phosphor-icons/react/dist/ssr'\r\nimport { Slot, Slottable } from '@radix-ui/react-slot'\r\nimport { ComponentProps } from 'react'\r\n\r\nimport type { VariantProps } from '../lib/utils'\r\n\r\nimport { cn, tv } from '../lib/utils'\r\n\r\nconst buttonVariants = tv({\r\n base: 'cursor-pointer flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gbm-sky focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 max-lg:text-sm',\r\n variants: {\r\n variant: {\r\n primary: 'bg-gbm-sky text-white hover:bg-gbm-ocean',\r\n secondary:\r\n 'border border-stroke bg-white text-gbm-dark hover:bg-gray-100',\r\n tertiary: 'border border-stroke bg-white text-gbm-sky hover:bg-gray-100',\r\n outline:\r\n 'border border-gbm-sky bg-white text-gbm-sky hover:bg-gbm-sky hover:text-white',\r\n ghost: 'text-gbm-dark hover:border-gbm-blue hover:bg-gray-100',\r\n destructive: 'bg-rose-600 text-white hover:bg-rose-700',\r\n link: 'text-gbm-dark underline-offset-2 hover:underline',\r\n },\r\n size: {\r\n sm: 'h-10 gap-1.5 px-3 py-2',\r\n md: 'h-12 gap-4 px-3 py-2',\r\n lg: 'h-14 gap-6 px-3 py-4',\r\n icon: 'h-10 w-10 p-2',\r\n },\r\n rounded: {\r\n true: 'rounded-full',\r\n false: 'rounded-md',\r\n },\r\n loading: {\r\n true: 'pointer-events-none',\r\n false: '',\r\n },\r\n },\r\n defaultVariants: {\r\n variant: 'primary',\r\n size: 'sm',\r\n rounded: false,\r\n loading: false,\r\n },\r\n})\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: Button\r\n * -------------------------------------------------------------------------- */\r\n\r\nexport type ButtonProps = ComponentProps<'button'> &\r\n VariantProps<typeof buttonVariants> & {\r\n asChild?: boolean\r\n }\r\n\r\nfunction Button({\r\n className,\r\n children,\r\n variant,\r\n size,\r\n rounded,\r\n disabled,\r\n loading,\r\n asChild = false,\r\n ...props\r\n}: ButtonProps) {\r\n const Comp = asChild ? Slot : 'button'\r\n\r\n return (\r\n <Comp\r\n className={cn(\r\n buttonVariants({ variant, size, rounded, loading, className })\r\n )}\r\n data-variant={variant}\r\n disabled={disabled || loading}\r\n type=\"button\"\r\n {...props}\r\n >\r\n <Slottable>\r\n {loading ? (\r\n <CircleNotch className=\"animate-spin\" size={16} />\r\n ) : (\r\n children\r\n )}\r\n </Slottable>\r\n </Comp>\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Exports\r\n * -------------------------------------------------------------------------- */\r\n\r\nexport { Button, buttonVariants }\r\n"],"names":["buttonVariants","tv","Button","className","children","variant","size","rounded","disabled","loading","asChild","props","Comp","Slot","cn","Slottable","CircleNotch"],"mappings":"8JAQA,IAAMA,EAAiBC,AAAAA,GAAAA,EAAAA,EAAAA,AAAAA,EAAG,CACxB,KAAM,gSACN,SAAU,CACR,QAAS,CACP,QAAS,2CACT,UACE,gEACF,SAAU,+DACV,QACE,gFACF,MAAO,wDACP,YAAa,2CACb,KAAM,kDACR,EACA,KAAM,CACJ,GAAI,yBACJ,GAAI,uBACJ,GAAI,uBACJ,KAAM,eACR,EACA,QAAS,CACP,KAAM,eACN,MAAO,YACT,EACA,QAAS,CACP,KAAM,sBACN,MAAO,EACT,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,KACN,QAAS,GACT,QAAS,EACX,CACF,GAWA,SAASC,EAAO,CACdC,UAAAA,CAAS,CACTC,SAAAA,CAAQ,CACRC,QAAAA,CAAO,CACPC,KAAAA,CAAI,CACJC,QAAAA,CAAO,CACPC,SAAAA,CAAQ,CACRC,QAAAA,CAAO,CACPC,QAAAA,EAAU,EAAK,CACf,GAAGC,EACS,EACZ,IAAMC,EAAOF,EAAUG,EAAAA,IAAIA,CAAG,SAE9B,MACE,UAACD,EAAAA,CACC,UAAWE,AAAAA,GAAAA,EAAAA,EAAAA,AAAAA,EACTd,EAAe,CAAEK,QAAAA,EAASC,KAAAA,EAAMC,QAAAA,EAASE,QAAAA,EAASN,UAAAA,CAAU,IAE9D,eAAcE,EACd,SAAUG,GAAYC,EACtB,KAAK,SACJ,GAAGE,CAAK,C,SAET,UAACI,EAAAA,SAASA,CAAAA,C,SACPN,EACC,UAACO,EAAAA,WAAWA,CAAAA,CAAC,UAAU,eAAe,KAAM,E,GAE5CZ,C,IAKV,Q"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import*as e from"react/jsx-runtime";import*as n from"../lib/utils.js";import*as r from"./spinner.js";function
|
|
2
|
+
import*as e from"react/jsx-runtime";import*as n from"../lib/utils.js";import*as r from"./spinner.js";function t({className:t,type:i,disabled:s,prefix:o,suffix:a,inputClassName:l,loading:d,loaderPosition:u="prefix",spinner:f,...c}){return(0,e.jsxs)("div",{className:(0,n.cn)("flex h-12 w-full items-center gap-4 rounded-md border border-zinc-200 bg-background px-4 ring-offset-background placeholder:text-zinc-400 focus-within:outline-none focus-within:ring-2 focus-within:ring-gbm-sky focus-within:ring-offset-2 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",t),"data-disabled":s,children:[d&&"prefix"===u?f||(0,e.jsx)(r.Spinner,{}):o,(0,e.jsx)("input",{className:(0,n.cn)("peer h-full w-full flex-1 overflow-hidden bg-transparent text-base outline-none placeholder:text-zinc-400",l),type:i,disabled:s,onKeyDown:e=>{"number"===i&&["e","E","+","-"].includes(e.key)&&e.preventDefault()},onFocus:e=>{"number"===i&&e.target.addEventListener("wheel",e=>{e.preventDefault()},{passive:!1})},...c}),d&&"suffix"===u?f||(0,e.jsx)(r.Spinner,{}):a]})}export{t as Input};
|
|
3
3
|
//# sourceMappingURL=input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\input.js","sources":["webpack://@gbmtech/aurora-ui/./src/components/input.tsx"],"sourcesContent":["\r\n\r\nimport { ComponentProps, JSX, ReactNode } from 'react'\r\n\r\nimport { cn } from '../lib/utils'\r\nimport { Spinner } from './spinner'\r\n\r\nexport type InputProps = Omit<ComponentProps<'input'>, 'prefix'> & {\r\n prefix?: ReactNode\r\n suffix?: ReactNode\r\n inputClassName?: string\r\n loaderPosition?: 'prefix' | 'suffix'\r\n loading?: boolean\r\n spinner?: ReactNode\r\n}\r\n\r\nfunction Input({\r\n className,\r\n type,\r\n disabled,\r\n prefix,\r\n suffix,\r\n inputClassName,\r\n loading,\r\n loaderPosition = 'prefix',\r\n spinner,\r\n ...props\r\n}: InputProps): JSX.Element {\r\n return (\r\n <div\r\n className={cn(\r\n 'flex h-12 w-full items-center rounded-md border border-zinc-200 bg-background ring-offset-background placeholder:text-zinc-400 focus-within:outline-none focus-within:ring-2 focus-within:ring-gbm-sky focus-within:ring-offset-2 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50',\r\n className\r\n )}\r\n data-disabled={disabled}\r\n >\r\n {loading && loaderPosition === 'prefix' ?
|
|
1
|
+
{"version":3,"file":"components\\input.js","sources":["webpack://@gbmtech/aurora-ui/./src/components/input.tsx"],"sourcesContent":["\r\n\r\nimport { ComponentProps, JSX, ReactNode } from 'react'\r\n\r\nimport { cn } from '../lib/utils'\r\nimport { Spinner } from './spinner'\r\n\r\nexport type InputProps = Omit<ComponentProps<'input'>, 'prefix'> & {\r\n prefix?: ReactNode\r\n suffix?: ReactNode\r\n inputClassName?: string\r\n loaderPosition?: 'prefix' | 'suffix'\r\n loading?: boolean\r\n spinner?: ReactNode\r\n}\r\n\r\nfunction Input({\r\n className,\r\n type,\r\n disabled,\r\n prefix,\r\n suffix,\r\n inputClassName,\r\n loading,\r\n loaderPosition = 'prefix',\r\n spinner,\r\n ...props\r\n}: InputProps): JSX.Element {\r\n return (\r\n <div\r\n className={cn(\r\n 'flex h-12 w-full items-center gap-4 rounded-md border border-zinc-200 bg-background px-4 ring-offset-background placeholder:text-zinc-400 focus-within:outline-none focus-within:ring-2 focus-within:ring-gbm-sky focus-within:ring-offset-2 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50',\r\n className\r\n )}\r\n data-disabled={disabled}\r\n >\r\n {loading && loaderPosition === 'prefix' ? spinner || <Spinner /> : prefix}\r\n\r\n <input\r\n className={cn(\r\n 'peer h-full w-full flex-1 overflow-hidden bg-transparent text-base outline-none placeholder:text-zinc-400',\r\n inputClassName\r\n )}\r\n type={type}\r\n disabled={disabled}\r\n onKeyDown={e => {\r\n if (type === 'number' && ['e', 'E', '+', '-'].includes(e.key)) {\r\n e.preventDefault()\r\n }\r\n }}\r\n onFocus={e => {\r\n if (type === 'number') {\r\n e.target.addEventListener(\r\n 'wheel',\r\n e => {\r\n e.preventDefault()\r\n },\r\n { passive: false }\r\n )\r\n }\r\n }}\r\n {...props}\r\n />\r\n\r\n {loading && loaderPosition === 'suffix' ? spinner || <Spinner /> : suffix}\r\n </div>\r\n )\r\n}\r\n\r\nexport { Input }\r\n"],"names":["Input","className","type","disabled","prefix","suffix","inputClassName","loading","loaderPosition","spinner","props","cn","Spinner","e"],"mappings":";qGAgBA,SAASA,EAAM,CACbC,UAAAA,CAAS,CACTC,KAAAA,CAAI,CACJC,SAAAA,CAAQ,CACRC,OAAAA,CAAM,CACNC,OAAAA,CAAM,CACNC,eAAAA,CAAc,CACdC,QAAAA,CAAO,CACPC,eAAAA,EAAiB,QAAQ,CACzBC,QAAAA,CAAO,CACP,GAAGC,EACQ,EACX,MACE,WAAC,OACC,UAAWC,GAAAA,EAAAA,EAAAA,EACT,uTACAV,GAEF,gBAAeE,E,UAEdI,GAAWC,WAAAA,EAA8BC,GAAW,UAACG,EAAAA,OAAOA,CAAAA,CAAAA,GAAMR,EAEnE,UAAC,SACC,UAAWO,GAAAA,EAAAA,EAAAA,EACT,4GACAL,GAEF,KAAMJ,EACN,SAAUC,EACV,UAAWU,IACLX,WAAAA,GAAqB,CAAC,IAAK,IAAK,IAAK,IAAI,CAAC,QAAQ,CAACW,EAAE,GAAG,GAC1DA,EAAE,cAAc,EAEpB,EACA,QAASA,IACHX,WAAAA,GACFW,EAAE,MAAM,CAAC,gBAAgB,CACvB,QACAA,IACEA,EAAE,cAAc,EAClB,EACA,CAAE,QAAS,EAAM,EAGvB,EACC,GAAGH,CAAK,GAGVH,GAAWC,WAAAA,EAA8BC,GAAW,UAACG,EAAAA,OAAOA,CAAAA,CAAAA,GAAMP,E,EAGzE,Q"}
|
|
@@ -24,7 +24,7 @@ declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
24
24
|
true: string;
|
|
25
25
|
false: string;
|
|
26
26
|
};
|
|
27
|
-
}, undefined, "flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gbm-sky focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 max-lg:text-sm", {
|
|
27
|
+
}, undefined, "cursor-pointer flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gbm-sky focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 max-lg:text-sm", {
|
|
28
28
|
variant: {
|
|
29
29
|
primary: string;
|
|
30
30
|
secondary: string;
|
|
@@ -72,7 +72,7 @@ declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
72
72
|
true: string;
|
|
73
73
|
false: string;
|
|
74
74
|
};
|
|
75
|
-
}, undefined, "flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gbm-sky focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 max-lg:text-sm", unknown, unknown, undefined>>;
|
|
75
|
+
}, undefined, "cursor-pointer flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gbm-sky focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 max-lg:text-sm", unknown, unknown, undefined>>;
|
|
76
76
|
export type ButtonProps = ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
77
77
|
asChild?: boolean;
|
|
78
78
|
};
|