@gbmtech/aurora-ui 0.2.42 → 0.2.44
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/autocomplete.cjs +1 -1
- package/dist/cjs/components/autocomplete.cjs.map +1 -1
- package/dist/cjs/components/command.cjs +1 -1
- package/dist/cjs/components/command.cjs.map +1 -1
- package/dist/esm/components/autocomplete.d.ts.map +1 -1
- package/dist/esm/components/autocomplete.js +1 -1
- package/dist/esm/components/autocomplete.js.map +1 -1
- package/dist/esm/components/command.js +1 -1
- package/dist/esm/components/command.js.map +1 -1
- package/dist/esm/components/data-table/index.js +1 -1
- 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,a)=>{for(var
|
|
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,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__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__,{AutoComplete:()=>AutoComplete});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),index_cjs_namespaceObject=require("../lib/index.cjs"),react_namespaceObject=require("@phosphor-icons/react"),external_cmdk_namespaceObject=require("cmdk"),external_react_namespaceObject=require("react"),external_command_cjs_namespaceObject=require("./command.cjs"),external_skeleton_cjs_namespaceObject=require("./skeleton.cjs");function AutoComplete({options:e,placeholder:a,emptyMessage:t,value:c,onValueChange:_,onSearchChange:n,disabled:r,isLoading:s=!1}){let l=(0,external_react_namespaceObject.useRef)(null),[m,p]=(0,external_react_namespaceObject.useState)(!1),[o,u]=(0,external_react_namespaceObject.useState)(c),[i,b]=(0,external_react_namespaceObject.useState)(c?.label||""),j=(0,external_react_namespaceObject.useCallback)(a=>{let t=l.current;if(t){if(m||p(!0),"Enter"===a.key&&""!==t.value){let a=e.find(e=>e.label===t.value);a&&(u(a),_?.(a))}"Escape"===a.key&&t.blur()}},[m,e,_]),x=(0,external_react_namespaceObject.useCallback)(()=>{p(!1),b(o?.label??"")},[o]),d=(0,external_react_namespaceObject.useCallback)(e=>{b(e),n?.(e)},[n]),O=(0,external_react_namespaceObject.useCallback)(e=>{b(e.label),u(e),_?.(e),setTimeout(()=>{l?.current?.blur()},0)},[_]);return(0,external_react_namespaceObject.useEffect)(()=>{c?.label===""&&o&&(b(""),u(void 0))},[c,o]),(0,jsx_runtime_namespaceObject.jsxs)(external_cmdk_namespaceObject.Command,{onKeyDown:j,children:[(0,jsx_runtime_namespaceObject.jsx)("div",{children:(0,jsx_runtime_namespaceObject.jsx)(external_command_cjs_namespaceObject.CommandInput,{ref:l,value:i,onValueChange:d,onBlur:x,onFocus:()=>p(!0),placeholder:a,disabled:r,className:"text-base"})}),(0,jsx_runtime_namespaceObject.jsx)("div",{className:"relative mt-1",children:(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,index_cjs_namespaceObject.cn)("absolute top-0 z-10 w-full bg-white outline-none",m?"block":"hidden"),children:(0,jsx_runtime_namespaceObject.jsxs)(external_command_cjs_namespaceObject.CommandList,{className:"rounded-lg ring-1 ring-slate-200",children:[s&&(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Loading,{children:(0,jsx_runtime_namespaceObject.jsx)("div",{className:"p-1",children:(0,jsx_runtime_namespaceObject.jsx)(external_skeleton_cjs_namespaceObject.Skeleton,{className:"h-8 w-full"})})}),e.length>0&&!s&&(0,jsx_runtime_namespaceObject.jsx)(external_command_cjs_namespaceObject.CommandGroup,{children:e.map(e=>{let a=o?.value===e.value;return(0,jsx_runtime_namespaceObject.jsxs)(external_command_cjs_namespaceObject.CommandItem,{value:e.label,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onSelect:()=>O(e),className:(0,index_cjs_namespaceObject.cn)("flex w-full items-center gap-2",!a&&"pl-8"),children:[a&&(0,jsx_runtime_namespaceObject.jsx)(react_namespaceObject.Check,{className:"size-4"}),e.label]},e.value)})}),!s&&(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Empty,{className:"select-none rounded-sm px-2 py-3 text-center text-sm",children:t})]})})})]})}for(var __webpack_i__ in exports.AutoComplete=__webpack_exports__.AutoComplete,__webpack_exports__)-1===["AutoComplete"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
|
2
2
|
//# sourceMappingURL=autocomplete.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\autocomplete.cjs","sources":["webpack://@gbmtech/aurora-ui/./src/components/autocomplete.tsx"],"sourcesContent":["import { Check } from '@phosphor-icons/react'\nimport { Command as CommandPrimitive } from 'cmdk'\nimport {\n type KeyboardEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react'\n\nimport {
|
|
1
|
+
{"version":3,"file":"components\\autocomplete.cjs","sources":["webpack://@gbmtech/aurora-ui/./src/components/autocomplete.tsx"],"sourcesContent":["import { cn } from '@/lib'\nimport { Check } from '@phosphor-icons/react'\nimport { Command as CommandPrimitive } from 'cmdk'\nimport {\n type KeyboardEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react'\n\nimport { CommandGroup, CommandInput, CommandItem, CommandList } from './command'\nimport { Skeleton } from './skeleton'\n\ntype Option = Record<'value' | 'label', string> & Record<string, string>\n\ntype AutoCompleteProps = {\n options: Option[]\n emptyMessage: string\n value?: Option\n onValueChange?: (value: Option) => void\n onSearchChange?: (value: string) => void\n isLoading?: boolean\n disabled?: boolean\n placeholder?: string\n}\n\nfunction AutoComplete({\n options,\n placeholder,\n emptyMessage,\n value,\n onValueChange,\n onSearchChange,\n disabled,\n isLoading = false,\n}: AutoCompleteProps) {\n const inputRef = useRef<HTMLInputElement>(null)\n\n const [isOpen, setIsOpen] = useState(false)\n const [selected, setSelected] = useState<Option | undefined>(value)\n const [inputValue, setInputValue] = useState<string>(value?.label || '')\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n const input = inputRef.current\n if (!input) {\n return\n }\n\n // Keep the options displayed when the user is typing\n if (!isOpen) {\n setIsOpen(true)\n }\n\n // This is not a default behaviour of the <input /> field\n if (event.key === 'Enter' && input.value !== '') {\n const optionToSelect = options.find(\n option => option.label === input.value\n )\n if (optionToSelect) {\n setSelected(optionToSelect)\n onValueChange?.(optionToSelect)\n }\n }\n\n if (event.key === 'Escape') {\n input.blur()\n }\n },\n [isOpen, options, onValueChange]\n )\n\n const handleBlur = useCallback(() => {\n setIsOpen(false)\n setInputValue(selected?.label ?? '')\n }, [selected])\n\n const handleSearchChange = useCallback(\n (value: string) => {\n setInputValue(value)\n onSearchChange?.(value)\n },\n [onSearchChange]\n )\n\n const handleSelectOption = useCallback(\n (selectedOption: Option) => {\n setInputValue(selectedOption.label)\n\n setSelected(selectedOption)\n onValueChange?.(selectedOption)\n\n // This is a hack to prevent the input from being focused after the user selects an option\n // We can call this hack: \"The next tick\"\n setTimeout(() => {\n inputRef?.current?.blur()\n }, 0)\n },\n [onValueChange]\n )\n\n useEffect(() => {\n if (value?.label === '' && selected) {\n setInputValue('')\n setSelected(undefined)\n }\n }, [value, selected])\n\n return (\n <CommandPrimitive onKeyDown={handleKeyDown}>\n <div>\n <CommandInput\n ref={inputRef}\n value={inputValue}\n onValueChange={handleSearchChange}\n onBlur={handleBlur}\n onFocus={() => setIsOpen(true)}\n placeholder={placeholder}\n disabled={disabled}\n className=\"text-base\"\n />\n </div>\n <div className=\"relative mt-1\">\n <div\n className={cn(\n 'absolute top-0 z-10 w-full bg-white outline-none',\n isOpen ? 'block' : 'hidden'\n )}\n >\n <CommandList className=\"rounded-lg ring-1 ring-slate-200\">\n {isLoading && (\n <CommandPrimitive.Loading>\n <div className=\"p-1\">\n <Skeleton className=\"h-8 w-full\" />\n </div>\n </CommandPrimitive.Loading>\n )}\n {options.length > 0 && !isLoading && (\n <CommandGroup>\n {options.map(option => {\n const isSelected = selected?.value === option.value\n return (\n <CommandItem\n key={option.value}\n value={option.label}\n onMouseDown={event => {\n event.preventDefault()\n event.stopPropagation()\n }}\n onSelect={() => handleSelectOption(option)}\n className={cn(\n 'flex w-full items-center gap-2',\n !isSelected && 'pl-8'\n )}\n >\n {isSelected && <Check className=\"size-4\" />}\n {option.label}\n </CommandItem>\n )\n })}\n </CommandGroup>\n )}\n {!isLoading && (\n <CommandPrimitive.Empty className=\"select-none rounded-sm px-2 py-3 text-center text-sm\">\n {emptyMessage}\n </CommandPrimitive.Empty>\n )}\n </CommandList>\n </div>\n </div>\n </CommandPrimitive>\n )\n}\n\nexport { AutoComplete, type Option as AutoCompleteOption }\n"],"names":["AutoComplete","options","placeholder","emptyMessage","value","onValueChange","onSearchChange","disabled","isLoading","inputRef","useRef","isOpen","setIsOpen","useState","selected","setSelected","inputValue","setInputValue","handleKeyDown","useCallback","event","input","optionToSelect","option","handleBlur","handleSearchChange","handleSelectOption","selectedOption","setTimeout","useEffect","undefined","CommandPrimitive","CommandInput","cn","CommandList","Skeleton","CommandGroup","isSelected","CommandItem","Check"],"mappings":"krCA2BA,SAASA,aAAa,CACpBC,QAAAA,CAAO,CACPC,YAAAA,CAAW,CACXC,aAAAA,CAAY,CACZC,MAAAA,CAAK,CACLC,cAAAA,CAAa,CACbC,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B,8BAAAA,OAAAA,CAAAA,KAAsB,EAAC,UAAU,uD,SAC/B5B,C,YAQjB,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,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__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__,{CommandDialog:()=>CommandDialog,Command:()=>Command,CommandInput:()=>CommandInput,CommandItem:()=>CommandItem,CommandList:()=>CommandList,CommandShortcut:()=>CommandShortcut,CommandSeparator:()=>CommandSeparator,CommandLoading:()=>CommandLoading,CommandEmpty:()=>CommandEmpty,CommandGroup:()=>CommandGroup});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),react_namespaceObject=require("@phosphor-icons/react"),react_visually_hidden_namespaceObject=require("@radix-ui/react-visually-hidden"),external_cmdk_namespaceObject=require("cmdk"),external_dialog_cjs_namespaceObject=require("./dialog.cjs"),utils_cjs_namespaceObject=require("../lib/utils.cjs");function Command({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command,{className:(0,utils_cjs_namespaceObject.cn)("flex flex-col overflow-hidden rounded-[inherit] bg-white text-gbm-dark outline-hidden",e),"data-slot":"command",...a})}function CommandDialog({children:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_dialog_cjs_namespaceObject.Dialog,{"data-slot":"command-dialog",...a,children:(0,jsx_runtime_namespaceObject.jsxs)(external_dialog_cjs_namespaceObject.DialogContent,{className:"rounded-t-lg sm:rounded-lg","data-slot":"command-dialog-content",children:[(0,jsx_runtime_namespaceObject.jsxs)(react_visually_hidden_namespaceObject.VisuallyHidden,{children:[(0,jsx_runtime_namespaceObject.jsx)(external_dialog_cjs_namespaceObject.DialogTitle,{children:"Search command"}),(0,jsx_runtime_namespaceObject.jsx)(external_dialog_cjs_namespaceObject.DialogDescription,{children:"Use the search bar to find and select the desired command."})]}),(0,jsx_runtime_namespaceObject.jsx)(Command,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input]]:h-12",children:e})]})})}function CommandInput({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsxs)("div",{className:"relative","cmdk-input-wrapper":"","data-slot":"command-input-wrapper",children:[(0,jsx_runtime_namespaceObject.jsx)(react_namespaceObject.MagnifyingGlass,{className:"-translate-1/2 absolute top-1/2 left-6 size-4 shrink-0 opacity-50"}),(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Input,{className:(0,utils_cjs_namespaceObject.cn)("flex h-12 w-full rounded-md border px-3 pl-10 text-base outline-hidden placeholder:text-gray-500 disabled:opacity-50
|
|
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,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__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__,{CommandDialog:()=>CommandDialog,Command:()=>Command,CommandInput:()=>CommandInput,CommandItem:()=>CommandItem,CommandList:()=>CommandList,CommandShortcut:()=>CommandShortcut,CommandSeparator:()=>CommandSeparator,CommandLoading:()=>CommandLoading,CommandEmpty:()=>CommandEmpty,CommandGroup:()=>CommandGroup});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),react_namespaceObject=require("@phosphor-icons/react"),react_visually_hidden_namespaceObject=require("@radix-ui/react-visually-hidden"),external_cmdk_namespaceObject=require("cmdk"),external_dialog_cjs_namespaceObject=require("./dialog.cjs"),utils_cjs_namespaceObject=require("../lib/utils.cjs");function Command({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command,{className:(0,utils_cjs_namespaceObject.cn)("flex flex-col overflow-hidden rounded-[inherit] bg-white text-gbm-dark outline-hidden",e),"data-slot":"command",...a})}function CommandDialog({children:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_dialog_cjs_namespaceObject.Dialog,{"data-slot":"command-dialog",...a,children:(0,jsx_runtime_namespaceObject.jsxs)(external_dialog_cjs_namespaceObject.DialogContent,{className:"rounded-t-lg sm:rounded-lg","data-slot":"command-dialog-content",children:[(0,jsx_runtime_namespaceObject.jsxs)(react_visually_hidden_namespaceObject.VisuallyHidden,{children:[(0,jsx_runtime_namespaceObject.jsx)(external_dialog_cjs_namespaceObject.DialogTitle,{children:"Search command"}),(0,jsx_runtime_namespaceObject.jsx)(external_dialog_cjs_namespaceObject.DialogDescription,{children:"Use the search bar to find and select the desired command."})]}),(0,jsx_runtime_namespaceObject.jsx)(Command,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input]]:h-12",children:e})]})})}function CommandInput({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsxs)("div",{className:"relative","cmdk-input-wrapper":"","data-slot":"command-input-wrapper",children:[(0,jsx_runtime_namespaceObject.jsx)(react_namespaceObject.MagnifyingGlass,{className:"-translate-1/2 absolute top-1/2 left-6 size-4 shrink-0 opacity-50"}),(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Input,{className:(0,utils_cjs_namespaceObject.cn)("flex h-12 w-full rounded-md border px-3 pl-10 text-base outline-hidden placeholder:text-gray-500 disabled:opacity-50",e),"data-slot":"command-input",...a})]})}function CommandList({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.List,{className:(0,utils_cjs_namespaceObject.cn)("max-h-75 overflow-y-auto overflow-x-hidden",e),"data-slot":"command-list",...a})}function CommandEmpty({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Empty,{className:(0,utils_cjs_namespaceObject.cn)("py-6 text-center text-sm",e),"data-slot":"command-empty",...a})}function CommandGroup({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Group,{className:(0,utils_cjs_namespaceObject.cn)("overflow-hidden p-1 text-gbm-dark [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group-heading]]:text-xs",e),"data-slot":"command-group",...a})}function CommandSeparator({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Separator,{className:(0,utils_cjs_namespaceObject.cn)("-mx-1 h-px bg-stroke",e),"data-slot":"command-separator",...a})}function CommandItem({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Item,{className:(0,utils_cjs_namespaceObject.cn)("group/command-item relative flex cursor-default select-none items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden aria-disabled:opacity-50 aria-selected:bg-gray-100 aria-selected:text-gbm-dark [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-gray-500 [&_svg]:shrink-0",e),"data-slot":"command-item",...a})}function CommandLoading({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Loading,{className:(0,utils_cjs_namespaceObject.cn)("flex justify-center p-2",e),"data-slot":"command-loading",...a})}function CommandShortcut({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)("span",{className:(0,utils_cjs_namespaceObject.cn)("ml-auto text-gray-500 text-xs tracking-widest",e),"data-slot":"command-shortcut",...a})}for(var __webpack_i__ in exports.Command=__webpack_exports__.Command,exports.CommandDialog=__webpack_exports__.CommandDialog,exports.CommandEmpty=__webpack_exports__.CommandEmpty,exports.CommandGroup=__webpack_exports__.CommandGroup,exports.CommandInput=__webpack_exports__.CommandInput,exports.CommandItem=__webpack_exports__.CommandItem,exports.CommandList=__webpack_exports__.CommandList,exports.CommandLoading=__webpack_exports__.CommandLoading,exports.CommandSeparator=__webpack_exports__.CommandSeparator,exports.CommandShortcut=__webpack_exports__.CommandShortcut,__webpack_exports__)-1===["Command","CommandDialog","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","CommandLoading","CommandSeparator","CommandShortcut"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
|
3
3
|
//# sourceMappingURL=command.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\command.cjs","sources":["webpack://@gbmtech/aurora-ui/./src/components/command.tsx"],"sourcesContent":["\r\n\r\nimport { MagnifyingGlass } from '@phosphor-icons/react'\r\nimport type { ComponentProps, JSX } from 'react'\r\n\r\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden'\r\nimport { Command as CommandPrimitive } from 'cmdk'\r\n\r\nimport {\r\n Dialog,\r\n DialogContent,\r\n DialogDescription,\r\n DialogTitle,\r\n} from '@/components/dialog'\r\nimport { cn } from '@/lib/utils'\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: Command\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction Command({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive>): JSX.Element {\r\n return (\r\n <CommandPrimitive\r\n className={cn(\r\n 'flex flex-col overflow-hidden rounded-[inherit] bg-white text-gbm-dark outline-hidden',\r\n className\r\n )}\r\n data-slot=\"command\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandDialog\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandDialog({\r\n children,\r\n ...props\r\n}: ComponentProps<typeof Dialog>): JSX.Element {\r\n return (\r\n <Dialog data-slot=\"command-dialog\" {...props}>\r\n <DialogContent\r\n className=\"rounded-t-lg sm:rounded-lg\"\r\n data-slot=\"command-dialog-content\"\r\n >\r\n <VisuallyHidden>\r\n <DialogTitle>Search command</DialogTitle>\r\n <DialogDescription>\r\n Use the search bar to find and select the desired command.\r\n </DialogDescription>\r\n </VisuallyHidden>\r\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input]]:h-12\">\r\n {children}\r\n </Command>\r\n </DialogContent>\r\n </Dialog>\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandInput\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandInput({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Input>): JSX.Element {\r\n return (\r\n <div\r\n className=\"relative\"\r\n cmdk-input-wrapper=\"\"\r\n data-slot=\"command-input-wrapper\"\r\n >\r\n <MagnifyingGlass className=\"-translate-1/2 absolute top-1/2 left-6 size-4 shrink-0 opacity-50\" />\r\n <CommandPrimitive.Input\r\n className={cn(\r\n 'flex h-12 w-full rounded-md border px-3 pl-10 text-base outline-hidden placeholder:text-gray-500 disabled:opacity-50
|
|
1
|
+
{"version":3,"file":"components\\command.cjs","sources":["webpack://@gbmtech/aurora-ui/./src/components/command.tsx"],"sourcesContent":["\r\n\r\nimport { MagnifyingGlass } from '@phosphor-icons/react'\r\nimport type { ComponentProps, JSX } from 'react'\r\n\r\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden'\r\nimport { Command as CommandPrimitive } from 'cmdk'\r\n\r\nimport {\r\n Dialog,\r\n DialogContent,\r\n DialogDescription,\r\n DialogTitle,\r\n} from '@/components/dialog'\r\nimport { cn } from '@/lib/utils'\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: Command\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction Command({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive>): JSX.Element {\r\n return (\r\n <CommandPrimitive\r\n className={cn(\r\n 'flex flex-col overflow-hidden rounded-[inherit] bg-white text-gbm-dark outline-hidden',\r\n className\r\n )}\r\n data-slot=\"command\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandDialog\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandDialog({\r\n children,\r\n ...props\r\n}: ComponentProps<typeof Dialog>): JSX.Element {\r\n return (\r\n <Dialog data-slot=\"command-dialog\" {...props}>\r\n <DialogContent\r\n className=\"rounded-t-lg sm:rounded-lg\"\r\n data-slot=\"command-dialog-content\"\r\n >\r\n <VisuallyHidden>\r\n <DialogTitle>Search command</DialogTitle>\r\n <DialogDescription>\r\n Use the search bar to find and select the desired command.\r\n </DialogDescription>\r\n </VisuallyHidden>\r\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input]]:h-12\">\r\n {children}\r\n </Command>\r\n </DialogContent>\r\n </Dialog>\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandInput\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandInput({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Input>): JSX.Element {\r\n return (\r\n <div\r\n className=\"relative\"\r\n cmdk-input-wrapper=\"\"\r\n data-slot=\"command-input-wrapper\"\r\n >\r\n <MagnifyingGlass className=\"-translate-1/2 absolute top-1/2 left-6 size-4 shrink-0 opacity-50\" />\r\n <CommandPrimitive.Input\r\n className={cn(\r\n 'flex h-12 w-full rounded-md border px-3 pl-10 text-base outline-hidden placeholder:text-gray-500 disabled:opacity-50',\r\n className\r\n )}\r\n data-slot=\"command-input\"\r\n {...props}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandList\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandList({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.List>): JSX.Element {\r\n return (\r\n <CommandPrimitive.List\r\n className={cn('max-h-75 overflow-y-auto overflow-x-hidden', className)}\r\n data-slot=\"command-list\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandEmpty\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandEmpty({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Empty>): JSX.Element {\r\n return (\r\n <CommandPrimitive.Empty\r\n className={cn('py-6 text-center text-sm', className)}\r\n data-slot=\"command-empty\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandGroup\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandGroup({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Group>): JSX.Element {\r\n return (\r\n <CommandPrimitive.Group\r\n className={cn(\r\n 'overflow-hidden p-1 text-gbm-dark [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group-heading]]:text-xs',\r\n className\r\n )}\r\n data-slot=\"command-group\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandSeparator\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandSeparator({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Separator>): JSX.Element {\r\n return (\r\n <CommandPrimitive.Separator\r\n className={cn('-mx-1 h-px bg-stroke', className)}\r\n data-slot=\"command-separator\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandItem\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandItem({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Item>): JSX.Element {\r\n return (\r\n <CommandPrimitive.Item\r\n className={cn(\r\n \"group/command-item relative flex cursor-default select-none items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden aria-disabled:opacity-50 aria-selected:bg-gray-100 aria-selected:text-gbm-dark [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-gray-500 [&_svg]:shrink-0\",\r\n className\r\n )}\r\n data-slot=\"command-item\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandLoading\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandLoading({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Loading>): JSX.Element {\r\n return (\r\n <CommandPrimitive.Loading\r\n className={cn('flex justify-center p-2', className)}\r\n data-slot=\"command-loading\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandShortcut\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandShortcut({\r\n className,\r\n ...props\r\n}: ComponentProps<'span'>): JSX.Element {\r\n return (\r\n <span\r\n className={cn('ml-auto text-gray-500 text-xs tracking-widest', className)}\r\n data-slot=\"command-shortcut\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Exports\r\n * -------------------------------------------------------------------------- */\r\n\r\nexport {\r\n Command,\r\n CommandDialog,\r\n CommandEmpty,\r\n CommandGroup,\r\n CommandInput,\r\n CommandItem,\r\n CommandList,\r\n CommandLoading,\r\n CommandSeparator,\r\n CommandShortcut,\r\n}\r\n"],"names":["Command","className","props","CommandPrimitive","cn","CommandDialog","children","Dialog","DialogContent","VisuallyHidden","DialogTitle","DialogDescription","CommandInput","MagnifyingGlass","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandLoading","CommandShortcut"],"mappings":";q6CAoBA,SAASA,QAAQ,CACfC,UAAAA,CAAS,CACT,GAAGC,EACqC,EACxC,MACE,oCAACC,8BAAAA,OAAgBA,CAAAA,CACf,UAAWC,GAAAA,0BAAAA,EAAAA,EACT,wFACAH,GAEF,YAAU,UACT,GAAGC,CAAK,EAGf,CAMA,SAASG,cAAc,CACrBC,SAAAA,CAAQ,CACR,GAAGJ,EAC2B,EAC9B,MACE,oCAACK,oCAAAA,MAAMA,CAAAA,CAAC,YAAU,iBAAkB,GAAGL,CAAK,C,SAC1C,qCAACM,oCAAAA,aAAaA,CAAAA,CACZ,UAAU,6BACV,YAAU,yB,UAEV,qCAACC,sCAAAA,cAAcA,CAAAA,C,UACb,oCAACC,oCAAAA,WAAWA,CAAAA,C,SAAC,gB,GACb,oCAACC,oCAAAA,iBAAiBA,CAAAA,C,SAAC,4D,MAIrB,oCAACX,QAAAA,CAAQ,UAAU,oL,SAChBM,C,OAKX,CAMA,SAASM,aAAa,CACpBX,UAAAA,CAAS,CACT,GAAGC,EAC2C,EAC9C,MAC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tBlB,UAAAA,CAAS,CACT,GAAGC,EAC6C,EAChD,MACE,oCAACC,8BAAAA,OAAAA,CAAAA,OAAwB,EACvB,UAAWC,GAAAA,0BAAAA,EAAAA,EAAG,0BAA2BH,GACzC,YAAU,kBACT,GAAGC,CAAK,EAGf,CAMA,SAASkB,gBAAgB,CACvBnB,UAAAA,CAAS,CACT,GAAGC,EACoB,EACvB,MACE,oCAAC,QACC,UAAWE,GAAAA,0BAAAA,EAAAA,EAAG,gDAAiDH,GAC/D,YAAU,mBACT,GAAGC,CAAK,EAGf,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete.tsx"],"names":[],"mappings":"AAcA,KAAK,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG,OAAO,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAExE,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,iBAAS,YAAY,CAAC,EACpB,OAAO,EACP,WAAW,EACX,YAAY,EACZ,KAAK,EACL,aAAa,EACb,cAAc,EACd,QAAQ,EACR,SAAiB,GAClB,EAAE,iBAAiB,2CAyInB;AAED,OAAO,EAAE,YAAY,EAAE,KAAK,MAAM,IAAI,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react/jsx-runtime";import*as
|
|
1
|
+
import*as e from"react/jsx-runtime";import*as l from"../lib/index.js";import*as a from"@phosphor-icons/react";import*as s from"cmdk";import*as t from"react";import*as n from"./command.js";import*as o from"./skeleton.js";function r({options:r,placeholder:m,emptyMessage:c,value:i,onValueChange:u,onSearchChange:d,disabled:p,isLoading:x=!1}){let f=(0,t.useRef)(null),[b,h]=(0,t.useState)(!1),[j,v]=(0,t.useState)(i),[C,k]=(0,t.useState)(i?.label||""),g=(0,t.useCallback)(e=>{let l=f.current;if(l){if(b||h(!0),"Enter"===e.key&&""!==l.value){let e=r.find(e=>e.label===l.value);e&&(v(e),u?.(e))}"Escape"===e.key&&l.blur()}},[b,r,u]),N=(0,t.useCallback)(()=>{h(!1),k(j?.label??"")},[j]),w=(0,t.useCallback)(e=>{k(e),d?.(e)},[d]),y=(0,t.useCallback)(e=>{k(e.label),v(e),u?.(e),setTimeout(()=>{f?.current?.blur()},0)},[u]);return(0,t.useEffect)(()=>{i?.label===""&&j&&(k(""),v(void 0))},[i,j]),(0,e.jsxs)(s.Command,{onKeyDown:g,children:[(0,e.jsx)("div",{children:(0,e.jsx)(n.CommandInput,{ref:f,value:C,onValueChange:w,onBlur:N,onFocus:()=>h(!0),placeholder:m,disabled:p,className:"text-base"})}),(0,e.jsx)("div",{className:"relative mt-1",children:(0,e.jsx)("div",{className:(0,l.cn)("absolute top-0 z-10 w-full bg-white outline-none",b?"block":"hidden"),children:(0,e.jsxs)(n.CommandList,{className:"rounded-lg ring-1 ring-slate-200",children:[x&&(0,e.jsx)(s.Command.Loading,{children:(0,e.jsx)("div",{className:"p-1",children:(0,e.jsx)(o.Skeleton,{className:"h-8 w-full"})})}),r.length>0&&!x&&(0,e.jsx)(n.CommandGroup,{children:r.map(s=>{let t=j?.value===s.value;return(0,e.jsxs)(n.CommandItem,{value:s.label,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onSelect:()=>y(s),className:(0,l.cn)("flex w-full items-center gap-2",!t&&"pl-8"),children:[t&&(0,e.jsx)(a.Check,{className:"size-4"}),s.label]},s.value)})}),!x&&(0,e.jsx)(s.Command.Empty,{className:"select-none rounded-sm px-2 py-3 text-center text-sm",children:c})]})})})]})}export{r as AutoComplete};
|
|
2
2
|
//# sourceMappingURL=autocomplete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\autocomplete.js","sources":["webpack://@gbmtech/aurora-ui/./src/components/autocomplete.tsx"],"sourcesContent":["import { Check } from '@phosphor-icons/react'\nimport { Command as CommandPrimitive } from 'cmdk'\nimport {\n type KeyboardEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react'\n\nimport {
|
|
1
|
+
{"version":3,"file":"components\\autocomplete.js","sources":["webpack://@gbmtech/aurora-ui/./src/components/autocomplete.tsx"],"sourcesContent":["import { cn } from '@/lib'\nimport { Check } from '@phosphor-icons/react'\nimport { Command as CommandPrimitive } from 'cmdk'\nimport {\n type KeyboardEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react'\n\nimport { CommandGroup, CommandInput, CommandItem, CommandList } from './command'\nimport { Skeleton } from './skeleton'\n\ntype Option = Record<'value' | 'label', string> & Record<string, string>\n\ntype AutoCompleteProps = {\n options: Option[]\n emptyMessage: string\n value?: Option\n onValueChange?: (value: Option) => void\n onSearchChange?: (value: string) => void\n isLoading?: boolean\n disabled?: boolean\n placeholder?: string\n}\n\nfunction AutoComplete({\n options,\n placeholder,\n emptyMessage,\n value,\n onValueChange,\n onSearchChange,\n disabled,\n isLoading = false,\n}: AutoCompleteProps) {\n const inputRef = useRef<HTMLInputElement>(null)\n\n const [isOpen, setIsOpen] = useState(false)\n const [selected, setSelected] = useState<Option | undefined>(value)\n const [inputValue, setInputValue] = useState<string>(value?.label || '')\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n const input = inputRef.current\n if (!input) {\n return\n }\n\n // Keep the options displayed when the user is typing\n if (!isOpen) {\n setIsOpen(true)\n }\n\n // This is not a default behaviour of the <input /> field\n if (event.key === 'Enter' && input.value !== '') {\n const optionToSelect = options.find(\n option => option.label === input.value\n )\n if (optionToSelect) {\n setSelected(optionToSelect)\n onValueChange?.(optionToSelect)\n }\n }\n\n if (event.key === 'Escape') {\n input.blur()\n }\n },\n [isOpen, options, onValueChange]\n )\n\n const handleBlur = useCallback(() => {\n setIsOpen(false)\n setInputValue(selected?.label ?? '')\n }, [selected])\n\n const handleSearchChange = useCallback(\n (value: string) => {\n setInputValue(value)\n onSearchChange?.(value)\n },\n [onSearchChange]\n )\n\n const handleSelectOption = useCallback(\n (selectedOption: Option) => {\n setInputValue(selectedOption.label)\n\n setSelected(selectedOption)\n onValueChange?.(selectedOption)\n\n // This is a hack to prevent the input from being focused after the user selects an option\n // We can call this hack: \"The next tick\"\n setTimeout(() => {\n inputRef?.current?.blur()\n }, 0)\n },\n [onValueChange]\n )\n\n useEffect(() => {\n if (value?.label === '' && selected) {\n setInputValue('')\n setSelected(undefined)\n }\n }, [value, selected])\n\n return (\n <CommandPrimitive onKeyDown={handleKeyDown}>\n <div>\n <CommandInput\n ref={inputRef}\n value={inputValue}\n onValueChange={handleSearchChange}\n onBlur={handleBlur}\n onFocus={() => setIsOpen(true)}\n placeholder={placeholder}\n disabled={disabled}\n className=\"text-base\"\n />\n </div>\n <div className=\"relative mt-1\">\n <div\n className={cn(\n 'absolute top-0 z-10 w-full bg-white outline-none',\n isOpen ? 'block' : 'hidden'\n )}\n >\n <CommandList className=\"rounded-lg ring-1 ring-slate-200\">\n {isLoading && (\n <CommandPrimitive.Loading>\n <div className=\"p-1\">\n <Skeleton className=\"h-8 w-full\" />\n </div>\n </CommandPrimitive.Loading>\n )}\n {options.length > 0 && !isLoading && (\n <CommandGroup>\n {options.map(option => {\n const isSelected = selected?.value === option.value\n return (\n <CommandItem\n key={option.value}\n value={option.label}\n onMouseDown={event => {\n event.preventDefault()\n event.stopPropagation()\n }}\n onSelect={() => handleSelectOption(option)}\n className={cn(\n 'flex w-full items-center gap-2',\n !isSelected && 'pl-8'\n )}\n >\n {isSelected && <Check className=\"size-4\" />}\n {option.label}\n </CommandItem>\n )\n })}\n </CommandGroup>\n )}\n {!isLoading && (\n <CommandPrimitive.Empty className=\"select-none rounded-sm px-2 py-3 text-center text-sm\">\n {emptyMessage}\n </CommandPrimitive.Empty>\n )}\n </CommandList>\n </div>\n </div>\n </CommandPrimitive>\n )\n}\n\nexport { AutoComplete, type Option as AutoCompleteOption }\n"],"names":["AutoComplete","options","placeholder","emptyMessage","value","onValueChange","onSearchChange","disabled","isLoading","inputRef","useRef","isOpen","setIsOpen","useState","selected","setSelected","inputValue","setInputValue","handleKeyDown","useCallback","event","input","optionToSelect","option","handleBlur","handleSearchChange","handleSelectOption","selectedOption","setTimeout","useEffect","undefined","CommandPrimitive","CommandInput","cn","CommandList","Skeleton","CommandGroup","isSelected","CommandItem","Check"],"mappings":"4NA2BA,SAASA,EAAa,CACpBC,QAAAA,CAAO,CACPC,YAAAA,CAAW,CACXC,aAAAA,CAAY,CACZC,MAAAA,CAAK,CACLC,cAAAA,CAAa,CACbC,eAAAA,CAAc,CACdC,SAAAA,CAAQ,CACRC,UAAAA,EAAY,EAAK,CACC,EAClB,IAAMC,EAAWC,AAAAA,GAAAA,EAAAA,MAAAA,AAAAA,EAAyB,MAEpC,CAACC,EAAQC,EAAU,CAAGC,AAAAA,GAAAA,EAAAA,QAAAA,AAAAA,EAAS,IAC/B,CAACC,EAAUC,EAAY,CAAGF,AAAAA,GAAAA,EAAAA,QAAAA,AAAAA,EAA6BT,GACvD,CAACY,EAAYC,EAAc,CAAGJ,AAAAA,GAAAA,EAAAA,QAAAA,AAAAA,EAAiBT,GAAO,OAAS,IAE/Dc,EAAgBC,AAAAA,GAAAA,EAAAA,WAAAA,AAAAA,EACpB,AAACC,IACC,IAAMC,EAAQZ,EAAS,OAA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T,mDACAtB,EAAS,QAAU,U,SAGrB,WAACuB,EAAAA,WAAWA,CAAAA,CAAC,UAAU,mC,UACpB1B,GACC,UAACuB,EAAAA,OAAAA,CAAAA,OAAwB,E,SACvB,UAAC,OAAI,UAAU,M,SACb,UAACI,EAAAA,QAAQA,CAAAA,CAAC,UAAU,Y,OAIzBlC,EAAQ,MAAM,CAAG,GAAK,CAACO,GACtB,UAAC4B,EAAAA,YAAYA,CAAAA,C,SACVnC,EAAQ,GAAG,CAACsB,AAAAA,IACX,IAAMc,EAAavB,GAAU,QAAUS,EAAO,KAAK,CACnD,MACE,WAACe,EAAAA,WAAWA,CAAAA,CAEV,MAAOf,EAAO,KAAK,CACnB,YAAaH,AAAAA,IACXA,EAAM,cAAc,GACpBA,EAAM,eAAe,EACvB,EACA,SAAU,IAAMM,EAAmBH,GACnC,UAAWU,AAAAA,GAAAA,EAAAA,EAAAA,AAAAA,EACT,iCACA,CAACI,GAAc,Q,UAGhBA,GAAc,UAACE,EAAAA,KAAKA,CAAAA,CAAC,UAAU,Q,GAC/BhB,EAAO,KAAK,C,EAbRA,EAAO,KAAK,CAgBvB,E,GAGH,CAACf,GACA,UAACuB,EAAAA,OAAAA,CAAAA,KAAsB,EAAC,UAAU,uD,SAC/B5B,C,YAQjB,Q"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import*as a from"react/jsx-runtime";import*as t from"@phosphor-icons/react";import*as e from"@radix-ui/react-visually-hidden";import*as n from"cmdk";import*as o from"./dialog.js";import*as d from"../lib/utils.js";function m({className:t,...e}){return(0,a.jsx)(n.Command,{className:(0,d.cn)("flex flex-col overflow-hidden rounded-[inherit] bg-white text-gbm-dark outline-hidden",t),"data-slot":"command",...e})}function s({children:t,...n}){return(0,a.jsx)(o.Dialog,{"data-slot":"command-dialog",...n,children:(0,a.jsxs)(o.DialogContent,{className:"rounded-t-lg sm:rounded-lg","data-slot":"command-dialog-content",children:[(0,a.jsxs)(e.VisuallyHidden,{children:[(0,a.jsx)(o.DialogTitle,{children:"Search command"}),(0,a.jsx)(o.DialogDescription,{children:"Use the search bar to find and select the desired command."})]}),(0,a.jsx)(m,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input]]:h-12",children:t})]})})}function r({className:e,...o}){return(0,a.jsxs)("div",{className:"relative","cmdk-input-wrapper":"","data-slot":"command-input-wrapper",children:[(0,a.jsx)(t.MagnifyingGlass,{className:"-translate-1/2 absolute top-1/2 left-6 size-4 shrink-0 opacity-50"}),(0,a.jsx)(n.Command.Input,{className:(0,d.cn)("flex h-12 w-full rounded-md border px-3 pl-10 text-base outline-hidden placeholder:text-gray-500 disabled:opacity-50
|
|
2
|
+
import*as a from"react/jsx-runtime";import*as t from"@phosphor-icons/react";import*as e from"@radix-ui/react-visually-hidden";import*as n from"cmdk";import*as o from"./dialog.js";import*as d from"../lib/utils.js";function m({className:t,...e}){return(0,a.jsx)(n.Command,{className:(0,d.cn)("flex flex-col overflow-hidden rounded-[inherit] bg-white text-gbm-dark outline-hidden",t),"data-slot":"command",...e})}function s({children:t,...n}){return(0,a.jsx)(o.Dialog,{"data-slot":"command-dialog",...n,children:(0,a.jsxs)(o.DialogContent,{className:"rounded-t-lg sm:rounded-lg","data-slot":"command-dialog-content",children:[(0,a.jsxs)(e.VisuallyHidden,{children:[(0,a.jsx)(o.DialogTitle,{children:"Search command"}),(0,a.jsx)(o.DialogDescription,{children:"Use the search bar to find and select the desired command."})]}),(0,a.jsx)(m,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input]]:h-12",children:t})]})})}function r({className:e,...o}){return(0,a.jsxs)("div",{className:"relative","cmdk-input-wrapper":"","data-slot":"command-input-wrapper",children:[(0,a.jsx)(t.MagnifyingGlass,{className:"-translate-1/2 absolute top-1/2 left-6 size-4 shrink-0 opacity-50"}),(0,a.jsx)(n.Command.Input,{className:(0,d.cn)("flex h-12 w-full rounded-md border px-3 pl-10 text-base outline-hidden placeholder:text-gray-500 disabled:opacity-50",e),"data-slot":"command-input",...o})]})}function i({className:t,...e}){return(0,a.jsx)(n.Command.List,{className:(0,d.cn)("max-h-75 overflow-y-auto overflow-x-hidden",t),"data-slot":"command-list",...e})}function c({className:t,...e}){return(0,a.jsx)(n.Command.Empty,{className:(0,d.cn)("py-6 text-center text-sm",t),"data-slot":"command-empty",...e})}function l({className:t,...e}){return(0,a.jsx)(n.Command.Group,{className:(0,d.cn)("overflow-hidden p-1 text-gbm-dark [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group-heading]]:text-xs",t),"data-slot":"command-group",...e})}function u({className:t,...e}){return(0,a.jsx)(n.Command.Separator,{className:(0,d.cn)("-mx-1 h-px bg-stroke",t),"data-slot":"command-separator",...e})}function p({className:t,...e}){return(0,a.jsx)(n.Command.Item,{className:(0,d.cn)("group/command-item relative flex cursor-default select-none items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden aria-disabled:opacity-50 aria-selected:bg-gray-100 aria-selected:text-gbm-dark [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-gray-500 [&_svg]:shrink-0",t),"data-slot":"command-item",...e})}function g({className:t,...e}){return(0,a.jsx)(n.Command.Loading,{className:(0,d.cn)("flex justify-center p-2",t),"data-slot":"command-loading",...e})}function x({className:t,...e}){return(0,a.jsx)("span",{className:(0,d.cn)("ml-auto text-gray-500 text-xs tracking-widest",t),"data-slot":"command-shortcut",...e})}export{m as Command,s as CommandDialog,c as CommandEmpty,l as CommandGroup,r as CommandInput,p as CommandItem,i as CommandList,g as CommandLoading,u as CommandSeparator,x as CommandShortcut};
|
|
3
3
|
//# sourceMappingURL=command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\command.js","sources":["webpack://@gbmtech/aurora-ui/./src/components/command.tsx"],"sourcesContent":["\r\n\r\nimport { MagnifyingGlass } from '@phosphor-icons/react'\r\nimport type { ComponentProps, JSX } from 'react'\r\n\r\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden'\r\nimport { Command as CommandPrimitive } from 'cmdk'\r\n\r\nimport {\r\n Dialog,\r\n DialogContent,\r\n DialogDescription,\r\n DialogTitle,\r\n} from '@/components/dialog'\r\nimport { cn } from '@/lib/utils'\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: Command\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction Command({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive>): JSX.Element {\r\n return (\r\n <CommandPrimitive\r\n className={cn(\r\n 'flex flex-col overflow-hidden rounded-[inherit] bg-white text-gbm-dark outline-hidden',\r\n className\r\n )}\r\n data-slot=\"command\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandDialog\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandDialog({\r\n children,\r\n ...props\r\n}: ComponentProps<typeof Dialog>): JSX.Element {\r\n return (\r\n <Dialog data-slot=\"command-dialog\" {...props}>\r\n <DialogContent\r\n className=\"rounded-t-lg sm:rounded-lg\"\r\n data-slot=\"command-dialog-content\"\r\n >\r\n <VisuallyHidden>\r\n <DialogTitle>Search command</DialogTitle>\r\n <DialogDescription>\r\n Use the search bar to find and select the desired command.\r\n </DialogDescription>\r\n </VisuallyHidden>\r\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input]]:h-12\">\r\n {children}\r\n </Command>\r\n </DialogContent>\r\n </Dialog>\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandInput\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandInput({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Input>): JSX.Element {\r\n return (\r\n <div\r\n className=\"relative\"\r\n cmdk-input-wrapper=\"\"\r\n data-slot=\"command-input-wrapper\"\r\n >\r\n <MagnifyingGlass className=\"-translate-1/2 absolute top-1/2 left-6 size-4 shrink-0 opacity-50\" />\r\n <CommandPrimitive.Input\r\n className={cn(\r\n 'flex h-12 w-full rounded-md border px-3 pl-10 text-base outline-hidden placeholder:text-gray-500 disabled:opacity-50
|
|
1
|
+
{"version":3,"file":"components\\command.js","sources":["webpack://@gbmtech/aurora-ui/./src/components/command.tsx"],"sourcesContent":["\r\n\r\nimport { MagnifyingGlass } from '@phosphor-icons/react'\r\nimport type { ComponentProps, JSX } from 'react'\r\n\r\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden'\r\nimport { Command as CommandPrimitive } from 'cmdk'\r\n\r\nimport {\r\n Dialog,\r\n DialogContent,\r\n DialogDescription,\r\n DialogTitle,\r\n} from '@/components/dialog'\r\nimport { cn } from '@/lib/utils'\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: Command\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction Command({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive>): JSX.Element {\r\n return (\r\n <CommandPrimitive\r\n className={cn(\r\n 'flex flex-col overflow-hidden rounded-[inherit] bg-white text-gbm-dark outline-hidden',\r\n className\r\n )}\r\n data-slot=\"command\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandDialog\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandDialog({\r\n children,\r\n ...props\r\n}: ComponentProps<typeof Dialog>): JSX.Element {\r\n return (\r\n <Dialog data-slot=\"command-dialog\" {...props}>\r\n <DialogContent\r\n className=\"rounded-t-lg sm:rounded-lg\"\r\n data-slot=\"command-dialog-content\"\r\n >\r\n <VisuallyHidden>\r\n <DialogTitle>Search command</DialogTitle>\r\n <DialogDescription>\r\n Use the search bar to find and select the desired command.\r\n </DialogDescription>\r\n </VisuallyHidden>\r\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input]]:h-12\">\r\n {children}\r\n </Command>\r\n </DialogContent>\r\n </Dialog>\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandInput\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandInput({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Input>): JSX.Element {\r\n return (\r\n <div\r\n className=\"relative\"\r\n cmdk-input-wrapper=\"\"\r\n data-slot=\"command-input-wrapper\"\r\n >\r\n <MagnifyingGlass className=\"-translate-1/2 absolute top-1/2 left-6 size-4 shrink-0 opacity-50\" />\r\n <CommandPrimitive.Input\r\n className={cn(\r\n 'flex h-12 w-full rounded-md border px-3 pl-10 text-base outline-hidden placeholder:text-gray-500 disabled:opacity-50',\r\n className\r\n )}\r\n data-slot=\"command-input\"\r\n {...props}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandList\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandList({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.List>): JSX.Element {\r\n return (\r\n <CommandPrimitive.List\r\n className={cn('max-h-75 overflow-y-auto overflow-x-hidden', className)}\r\n data-slot=\"command-list\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandEmpty\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandEmpty({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Empty>): JSX.Element {\r\n return (\r\n <CommandPrimitive.Empty\r\n className={cn('py-6 text-center text-sm', className)}\r\n data-slot=\"command-empty\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandGroup\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandGroup({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Group>): JSX.Element {\r\n return (\r\n <CommandPrimitive.Group\r\n className={cn(\r\n 'overflow-hidden p-1 text-gbm-dark [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group-heading]]:text-xs',\r\n className\r\n )}\r\n data-slot=\"command-group\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandSeparator\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandSeparator({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Separator>): JSX.Element {\r\n return (\r\n <CommandPrimitive.Separator\r\n className={cn('-mx-1 h-px bg-stroke', className)}\r\n data-slot=\"command-separator\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandItem\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandItem({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Item>): JSX.Element {\r\n return (\r\n <CommandPrimitive.Item\r\n className={cn(\r\n \"group/command-item relative flex cursor-default select-none items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden aria-disabled:opacity-50 aria-selected:bg-gray-100 aria-selected:text-gbm-dark [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-gray-500 [&_svg]:shrink-0\",\r\n className\r\n )}\r\n data-slot=\"command-item\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandLoading\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandLoading({\r\n className,\r\n ...props\r\n}: ComponentProps<typeof CommandPrimitive.Loading>): JSX.Element {\r\n return (\r\n <CommandPrimitive.Loading\r\n className={cn('flex justify-center p-2', className)}\r\n data-slot=\"command-loading\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Component: CommandShortcut\r\n * -------------------------------------------------------------------------- */\r\n\r\nfunction CommandShortcut({\r\n className,\r\n ...props\r\n}: ComponentProps<'span'>): JSX.Element {\r\n return (\r\n <span\r\n className={cn('ml-auto text-gray-500 text-xs tracking-widest', className)}\r\n data-slot=\"command-shortcut\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\n/* -----------------------------------------------------------------------------\r\n * Exports\r\n * -------------------------------------------------------------------------- */\r\n\r\nexport {\r\n Command,\r\n CommandDialog,\r\n CommandEmpty,\r\n CommandGroup,\r\n CommandInput,\r\n CommandItem,\r\n CommandList,\r\n CommandLoading,\r\n CommandSeparator,\r\n CommandShortcut,\r\n}\r\n"],"names":["Command","className","props","CommandPrimitive","cn","CommandDialog","children","Dialog","DialogContent","VisuallyHidden","DialogTitle","DialogDescription","CommandInput","MagnifyingGlass","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandLoading","CommandShortcut"],"mappings":";qNAoBA,SAASA,EAAQ,CACfC,UAAAA,CAAS,CACT,GAAGC,EACqC,EACxC,MACE,UAACC,EAAAA,OAAgBA,CAAAA,CACf,UAAWC,GAAAA,EAAAA,EAAAA,EACT,wFACAH,GAEF,YAAU,UACT,GAAGC,CAAK,EAGf,CAMA,SAASG,EAAc,CACrBC,SAAAA,CAAQ,CACR,GAAGJ,EAC2B,EAC9B,MACE,UAACK,EAAAA,MAAMA,CAAAA,CAAC,YAAU,iB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AA0B,EACzB,UAAWC,GAAAA,EAAAA,EAAAA,EAAG,uBAAwBH,GACtC,YAAU,oBACT,GAAGC,CAAK,EAGf,CAMA,SAASgB,EAAY,CACnBjB,UAAAA,CAAS,CACT,GAAGC,EAC0C,EAC7C,MACE,UAACC,EAAAA,OAAAA,CAAAA,IAAqB,EACpB,UAAWC,GAAAA,EAAAA,EAAAA,EACT,kTACAH,GAEF,YAAU,eACT,GAAGC,CAAK,EAGf,CAMA,SAASiB,EAAe,CACtBlB,UAAAA,CAAS,CACT,GAAGC,EAC6C,EAChD,MACE,UAACC,EAAAA,OAAAA,CAAAA,OAAwB,EACvB,UAAWC,GAAAA,EAAAA,EAAAA,EAAG,0BAA2BH,GACzC,YAAU,kBACT,GAAGC,CAAK,EAGf,CAMA,SAASkB,EAAgB,CACvBnB,UAAAA,CAAS,CACT,GAAGC,EACoB,EACvB,MACE,UAAC,QACC,UAAWE,GAAAA,EAAAA,EAAAA,EAAG,gDAAiDH,GAC/D,YAAU,mBACT,GAAGC,CAAK,EAGf,Q"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export*from"./data-table-action-bar.js";export*from"./data-table-advanced-toolbar.js";export*from"./data-table-column-header.js";export*from"./data-table-date-filter.js";export*from"./data-table-faceted-filter.js";export*from"./data-table-filter-list.js";export*from"./data-table-filter-menu.js";export*from"./data-table-pagination.js";export*from"./data-table-range-filter.js";export*from"./data-table-skeleton.js";export*from"./data-table-slider-filter.js";export*from"./data-table-sort-list.js";export*from"./data-table-toolbar.js";export*from"./data-table-view-options.js";export*from"./data-table.js";
|