@alkimi.org/ui-kit 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-36JKB3PI.mjs +3 -0
- package/dist/chunk-36JKB3PI.mjs.map +1 -0
- package/dist/chunk-372VUZFE.js.map +1 -1
- package/dist/chunk-3BVMHDYA.js.map +1 -1
- package/dist/chunk-3PEPOFYU.js.map +1 -1
- package/dist/chunk-3TLCOZ5R.js.map +1 -1
- package/dist/chunk-5L5DM2X5.js.map +1 -1
- package/dist/chunk-5X26XR44.js.map +1 -1
- package/dist/chunk-5ZAJ6LSM.js +3 -0
- package/dist/chunk-5ZAJ6LSM.js.map +1 -0
- package/dist/chunk-7J2ETVGK.js.map +1 -1
- package/dist/chunk-7SOZ6MOV.js.map +1 -1
- package/dist/chunk-BV7RXRSL.js.map +1 -1
- package/dist/chunk-CT2CRYC2.js.map +1 -1
- package/dist/chunk-DHHZMQ72.js.map +1 -1
- package/dist/chunk-EIM5R7AJ.js.map +1 -1
- package/dist/chunk-EJTY2ABY.js.map +1 -1
- package/dist/{chunk-DIKQRVZO.js → chunk-EKCAULFP.js} +2 -2
- package/dist/chunk-EKCAULFP.js.map +1 -0
- package/dist/chunk-EWRKHBIV.js.map +1 -1
- package/dist/chunk-FUYXCJOQ.js.map +1 -1
- package/dist/chunk-GRXC46JC.js.map +1 -1
- package/dist/chunk-I5INE4KG.js.map +1 -1
- package/dist/chunk-K4GMCVHO.js.map +1 -1
- package/dist/chunk-LQMOWEA7.js.map +1 -1
- package/dist/{chunk-7Y3KH5OM.mjs → chunk-NEY5JU5Z.mjs} +2 -2
- package/dist/{chunk-7Y3KH5OM.mjs.map → chunk-NEY5JU5Z.mjs.map} +1 -1
- package/dist/chunk-RJMIOBXZ.js.map +1 -1
- package/dist/chunk-RKRTEMMZ.js.map +1 -1
- package/dist/chunk-RRAIGAHU.js.map +1 -1
- package/dist/chunk-TDMRUCR6.js.map +1 -1
- package/dist/chunk-UJZP6L4S.js.map +1 -1
- package/dist/chunk-ULIOO55I.js.map +1 -1
- package/dist/chunk-UNR6ATUH.js.map +1 -1
- package/dist/chunk-USPGZYMV.js.map +1 -1
- package/dist/chunk-VBPIXXIA.js.map +1 -1
- package/dist/chunk-WFD523CV.js.map +1 -1
- package/dist/chunk-WYRD4UAK.js.map +1 -1
- package/dist/chunk-XQILGD5B.js.map +1 -1
- package/dist/chunk-XYO4VLMF.js.map +1 -1
- package/dist/chunk-YKXP3INY.js.map +1 -1
- package/dist/chunk-Z5V4P3EC.js.map +1 -1
- package/dist/components/GeometricFluidGrid.js.map +1 -1
- package/dist/components/GlitchLink.js.map +1 -1
- package/dist/components/PixelLoad.js.map +1 -1
- package/dist/components/TextDecoder.js.map +1 -1
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.js.map +1 -1
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/date-range-picker.js.map +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/file-upload.js.map +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/label.js.map +1 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.d.mts +2 -0
- package/dist/components/sidebar.d.ts +2 -0
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/sidebar.mjs +1 -1
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.js.map +1 -1
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toast.mjs +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/tree-select.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-6NUWFUK6.js +0 -3
- package/dist/chunk-6NUWFUK6.js.map +0 -1
- package/dist/chunk-DIKQRVZO.js.map +0 -1
- package/dist/chunk-IGOHUEKI.mjs +0 -3
- package/dist/chunk-IGOHUEKI.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-LQMOWEA7.js","../src/components/tree-select.tsx"],"names":["getAllDescendantValues","node","values","child","getCheckState","selectedSet","descendants","selectedCount","v","filterTree","nodes","searchTerm","term","result","labelMatches","filteredChildren","getValuesOfMatchingNodes","walk","nodeList","hasMatch","childHasMatch","findNodeByValue","value","found","collectAllBranchValues","renderHighlightedLabel","label","index","jsxs","Fragment","jsx","TreeNodeItem","depth","multiple","expandedValues","focusedValue","onToggleExpand","onSelect","onFocus","hasChildren","isExpanded","checkState","indentPx","cn"],"mappings":"AAAA,+8BAAY;AACZ,sDAAuC,sDAAsD,sDAAwC,uECC9G,2CACqC,+CAgKxD,SA3HKA,CAAAA,CAAuBC,CAAAA,CAAgC,CAC9D,IAAMC,CAAAA,CAAmB,CAACD,CAAAA,CAAK,KAAK,CAAA,CACpC,EAAA,CAAIA,CAAAA,CAAK,QAAA,CACP,GAAA,CAAA,IAAWE,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/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-LQMOWEA7.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { Check, ChevronDown, ChevronRight, Search, X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Checkbox } from \"@/components/checkbox\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\"\n\n// --- Public types ---\n\nexport interface TreeSelectNode {\n value: string\n label: string\n children?: TreeSelectNode[]\n}\n\nexport interface TreeSelectProps {\n nodes: TreeSelectNode[]\n value?: string\n onValueChange?: (value: string) => void\n multiple?: boolean\n values?: string[]\n onValuesChange?: (values: string[]) => void\n placeholder?: string\n searchPlaceholder?: string\n emptyMessage?: string\n disabled?: boolean\n className?: string\n error?: boolean\n defaultExpandedValues?: string[]\n expandAll?: boolean\n}\n\n// --- Internal types ---\n\ntype CheckState = \"checked\" | \"indeterminate\" | \"unchecked\"\n\n// --- Utility functions ---\n\nfunction getAllDescendantValues(node: TreeSelectNode): string[] {\n const values: string[] = [node.value]\n if (node.children) {\n for (const child of node.children) {\n values.push(...getAllDescendantValues(child))\n }\n }\n return values\n}\n\nfunction getCheckState(\n node: TreeSelectNode,\n selectedSet: Set<string>\n): CheckState {\n if (!node.children || node.children.length === 0) {\n return selectedSet.has(node.value) ? \"checked\" : \"unchecked\"\n }\n\n const descendants = getAllDescendantValues(node)\n const selectedCount = descendants.filter((v) => selectedSet.has(v)).length\n\n if (selectedCount === 0) return \"unchecked\"\n if (selectedCount === descendants.length) return \"checked\"\n return \"indeterminate\"\n}\n\nfunction filterTree(\n nodes: TreeSelectNode[],\n searchTerm: string\n): TreeSelectNode[] | null {\n const term = searchTerm.toLowerCase().trim()\n if (!term) return nodes\n\n const result: TreeSelectNode[] = []\n\n for (const node of nodes) {\n const labelMatches = node.label.toLowerCase().includes(term)\n\n if (node.children && node.children.length > 0) {\n const filteredChildren = filterTree(node.children, searchTerm)\n\n if (labelMatches) {\n result.push(node)\n } else if (filteredChildren && filteredChildren.length > 0) {\n result.push({ ...node, children: filteredChildren })\n }\n } else if (labelMatches) {\n result.push(node)\n }\n }\n\n return result.length > 0 ? result : null\n}\n\nfunction getValuesOfMatchingNodes(\n nodes: TreeSelectNode[],\n searchTerm: string\n): Set<string> {\n const term = searchTerm.toLowerCase().trim()\n const result = new Set<string>()\n\n function walk(nodeList: TreeSelectNode[]): boolean {\n let hasMatch = false\n for (const node of nodeList) {\n const labelMatches = node.label.toLowerCase().includes(term)\n let childHasMatch = false\n\n if (node.children) {\n childHasMatch = walk(node.children)\n }\n\n if (labelMatches || childHasMatch) {\n result.add(node.value)\n hasMatch = true\n }\n }\n return hasMatch\n }\n\n walk(nodes)\n return result\n}\n\nfunction findNodeByValue(\n nodes: TreeSelectNode[],\n value: string\n): TreeSelectNode | undefined {\n for (const node of nodes) {\n if (node.value === value) return node\n if (node.children) {\n const found = findNodeByValue(node.children, value)\n if (found) return found\n }\n }\n return undefined\n}\n\nfunction collectAllBranchValues(nodes: TreeSelectNode[]): Set<string> {\n const result = new Set<string>()\n for (const node of nodes) {\n if (node.children && node.children.length > 0) {\n result.add(node.value)\n for (const v of collectAllBranchValues(node.children)) {\n result.add(v)\n }\n }\n }\n return result\n}\n\nfunction renderHighlightedLabel(\n label: string,\n searchTerm: string\n): React.ReactNode {\n if (!searchTerm) return label\n\n const term = searchTerm.toLowerCase().trim()\n if (!term) return label\n\n const index = label.toLowerCase().indexOf(term)\n if (index === -1) return label\n\n return (\n <>\n {label.slice(0, index)}\n <span className=\"font-semibold underline\">\n {label.slice(index, index + term.length)}\n </span>\n {label.slice(index + term.length)}\n </>\n )\n}\n\n// --- TreeNodeItem (internal) ---\n\ninterface TreeNodeItemProps {\n node: TreeSelectNode\n depth: number\n multiple: boolean\n selectedSet: Set<string>\n expandedValues: Set<string>\n focusedValue: string | null\n onToggleExpand: (value: string) => void\n onSelect: (node: TreeSelectNode) => void\n onFocus: (value: string) => void\n searchTerm: string\n}\n\nfunction TreeNodeItem({\n node,\n depth,\n multiple,\n selectedSet,\n expandedValues,\n focusedValue,\n onToggleExpand,\n onSelect,\n onFocus,\n searchTerm,\n}: TreeNodeItemProps) {\n const hasChildren = node.children && node.children.length > 0\n const isExpanded = expandedValues.has(node.value)\n const checkState = multiple\n ? getCheckState(node, selectedSet)\n : selectedSet.has(node.value)\n ? \"checked\"\n : \"unchecked\"\n\n const indentPx = depth * 20\n\n return (\n <div\n role=\"treeitem\"\n aria-expanded={hasChildren ? isExpanded : undefined}\n aria-selected={checkState === \"checked\"}\n >\n <div\n className={cn(\n \"relative flex items-center gap-2 rounded-sm px-2 py-1.5 my-0.5 text-sm cursor-pointer select-none outline-none active:opacity-50\",\n \"hover:bg-muted\",\n checkState === \"checked\" && !multiple && \"bg-muted\"\n // This adds a focus ring when the node is focused, but it's not needed for the tree-select component.\n // focusedValue === node.value && \"z-10 ring-2 ring-ring\"\n )}\n style={{ paddingLeft: `${8 + indentPx}px` }}\n onClick={() => onSelect(node)}\n onFocus={() => onFocus(node.value)}\n data-tree-value={node.value}\n tabIndex={focusedValue === node.value ? 0 : -1}\n >\n {hasChildren ? (\n <button\n type=\"button\"\n className=\"h-4 w-4 shrink-0 flex items-center justify-center rounded-sm hover:bg-secondary active:opacity-50\"\n onClick={(e) => {\n e.stopPropagation()\n onToggleExpand(node.value)\n }}\n aria-label={\n isExpanded ? `Collapse ${node.label}` : `Expand ${node.label}`\n }\n tabIndex={-1}\n >\n {isExpanded ? (\n <ChevronDown className=\"h-3.5 w-3.5\" />\n ) : (\n <ChevronRight className=\"h-3.5 w-3.5\" />\n )}\n </button>\n ) : (\n <span className=\"h-4 w-4 shrink-0\" />\n )}\n\n {multiple ? (\n <Checkbox\n checked={\n checkState === \"checked\"\n ? true\n : checkState === \"indeterminate\"\n ? \"indeterminate\"\n : false\n }\n onCheckedChange={() => onSelect(node)}\n onClick={(e) => e.stopPropagation()}\n className=\"shrink-0\"\n aria-label={node.label}\n />\n ) : (\n <Check\n className={cn(\n \"h-4 w-4 shrink-0\",\n checkState === \"checked\" ? \"opacity-100\" : \"opacity-0\"\n )}\n />\n )}\n\n <span className=\"truncate\">\n {renderHighlightedLabel(node.label, searchTerm)}\n </span>\n </div>\n\n {hasChildren && isExpanded && (\n <div role=\"group\">\n {node.children!.map((child) => (\n <TreeNodeItem\n key={child.value}\n node={child}\n depth={depth + 1}\n multiple={multiple}\n selectedSet={selectedSet}\n expandedValues={expandedValues}\n focusedValue={focusedValue}\n onToggleExpand={onToggleExpand}\n onSelect={onSelect}\n onFocus={onFocus}\n searchTerm={searchTerm}\n />\n ))}\n </div>\n )}\n </div>\n )\n}\n\n// --- TreeSelect (main component) ---\n\nexport function TreeSelect({\n nodes,\n value,\n onValueChange,\n multiple = false,\n values = [],\n onValuesChange,\n placeholder = \"Select...\",\n searchPlaceholder = \"Search...\",\n emptyMessage = \"No results found.\",\n disabled = false,\n className,\n error = false,\n defaultExpandedValues,\n expandAll = false,\n}: TreeSelectProps) {\n const [open, setOpen] = React.useState(false)\n const [searchTerm, setSearchTerm] = React.useState(\"\")\n const [focusedValue, setFocusedValue] = React.useState<string | null>(null)\n const [expandedValues, setExpandedValues] = React.useState<Set<string>>(\n () => {\n if (expandAll) return collectAllBranchValues(nodes)\n if (defaultExpandedValues) return new Set(defaultExpandedValues)\n return new Set<string>()\n }\n )\n\n const preSearchExpandedRef = React.useRef<Set<string> | null>(null)\n const treeRef = React.useRef<HTMLDivElement>(null)\n\n const selectedSet = React.useMemo(\n () => new Set(multiple ? values : value ? [value] : []),\n [multiple, values, value]\n )\n\n const filteredNodes = React.useMemo(\n () => (searchTerm ? filterTree(nodes, searchTerm) : nodes),\n [nodes, searchTerm]\n )\n\n // Auto-expand matching ancestors during search\n React.useEffect(() => {\n if (searchTerm) {\n if (!preSearchExpandedRef.current) {\n preSearchExpandedRef.current = new Set(expandedValues)\n }\n const matchingAncestors = getValuesOfMatchingNodes(nodes, searchTerm)\n setExpandedValues(matchingAncestors)\n } else if (preSearchExpandedRef.current) {\n setExpandedValues(preSearchExpandedRef.current)\n preSearchExpandedRef.current = null\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [searchTerm, nodes])\n\n const handleOpenChange = React.useCallback((isOpen: boolean) => {\n setOpen(isOpen)\n if (!isOpen) {\n setSearchTerm(\"\")\n setFocusedValue(null)\n }\n }, [])\n\n const handleToggleExpand = React.useCallback((nodeValue: string) => {\n setExpandedValues((prev) => {\n const next = new Set(prev)\n if (next.has(nodeValue)) {\n next.delete(nodeValue)\n } else {\n next.add(nodeValue)\n }\n return next\n })\n }, [])\n\n const handleSelect = React.useCallback(\n (node: TreeSelectNode) => {\n if (multiple) {\n const allDescendants = getAllDescendantValues(node)\n const currentState = getCheckState(node, selectedSet)\n\n let newValues: string[]\n if (currentState === \"checked\") {\n const toRemove = new Set(allDescendants)\n newValues = values.filter((v) => !toRemove.has(v))\n } else {\n const toAdd = allDescendants.filter((v) => !selectedSet.has(v))\n newValues = [...values, ...toAdd]\n }\n onValuesChange?.(newValues)\n } else {\n // Single-select: clicking a parent toggles expand instead of selecting\n const hasChildren = node.children && node.children.length > 0\n if (hasChildren) {\n handleToggleExpand(node.value)\n return\n }\n const newValue = node.value === value ? \"\" : node.value\n onValueChange?.(newValue)\n setOpen(false)\n }\n },\n [\n multiple,\n values,\n value,\n selectedSet,\n onValuesChange,\n onValueChange,\n handleToggleExpand,\n ]\n )\n\n const handleRemoveChip = React.useCallback(\n (chipValue: string, e: React.MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n const node = findNodeByValue(nodes, chipValue)\n if (node) {\n const toRemove = new Set(getAllDescendantValues(node))\n const newValues = values.filter((v) => !toRemove.has(v))\n onValuesChange?.(newValues)\n }\n },\n [nodes, values, onValuesChange]\n )\n\n // Smart chips: minimal set representing the selection\n const chipValues = React.useMemo(() => {\n if (!multiple) return []\n\n const chips: string[] = []\n\n function walk(nodeList: TreeSelectNode[]) {\n for (const node of nodeList) {\n const state = getCheckState(node, selectedSet)\n if (state === \"checked\") {\n chips.push(node.value)\n } else if (state === \"indeterminate\" && node.children) {\n walk(node.children)\n }\n }\n }\n\n walk(nodes)\n return chips\n }, [nodes, selectedSet, multiple])\n\n // Keyboard navigation\n const getVisibleNodes = React.useCallback((): HTMLElement[] => {\n if (!treeRef.current) return []\n return Array.from(treeRef.current.querySelectorAll(\"[data-tree-value]\"))\n }, [])\n\n const handleTreeKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n const visibleNodes = getVisibleNodes()\n const currentIndex = visibleNodes.findIndex(\n (el) => el.dataset.treeValue === focusedValue\n )\n\n switch (e.key) {\n case \"ArrowDown\": {\n e.preventDefault()\n const nextIndex = Math.min(currentIndex + 1, visibleNodes.length - 1)\n const nextValue = visibleNodes[nextIndex]?.dataset.treeValue\n if (nextValue) {\n setFocusedValue(nextValue)\n visibleNodes[nextIndex]?.focus()\n }\n break\n }\n case \"ArrowUp\": {\n e.preventDefault()\n const prevIndex = Math.max(currentIndex - 1, 0)\n const prevValue = visibleNodes[prevIndex]?.dataset.treeValue\n if (prevValue) {\n setFocusedValue(prevValue)\n visibleNodes[prevIndex]?.focus()\n }\n break\n }\n case \"ArrowRight\": {\n e.preventDefault()\n if (focusedValue) {\n const node = findNodeByValue(nodes, focusedValue)\n if (node?.children?.length) {\n if (!expandedValues.has(focusedValue)) {\n handleToggleExpand(focusedValue)\n } else {\n const firstChildValue = node.children[0].value\n setFocusedValue(firstChildValue)\n requestAnimationFrame(() => {\n const els = getVisibleNodes()\n const el = els.find(\n (n) => n.dataset.treeValue === firstChildValue\n )\n el?.focus()\n })\n }\n }\n }\n break\n }\n case \"ArrowLeft\": {\n e.preventDefault()\n if (focusedValue && expandedValues.has(focusedValue)) {\n handleToggleExpand(focusedValue)\n }\n break\n }\n case \"Enter\":\n case \" \": {\n e.preventDefault()\n if (focusedValue) {\n const node = findNodeByValue(nodes, focusedValue)\n if (node) handleSelect(node)\n }\n break\n }\n case \"Home\": {\n e.preventDefault()\n const firstValue = visibleNodes[0]?.dataset.treeValue\n if (firstValue) {\n setFocusedValue(firstValue)\n visibleNodes[0]?.focus()\n }\n break\n }\n case \"End\": {\n e.preventDefault()\n const lastValue =\n visibleNodes[visibleNodes.length - 1]?.dataset.treeValue\n if (lastValue) {\n setFocusedValue(lastValue)\n visibleNodes[visibleNodes.length - 1]?.focus()\n }\n break\n }\n }\n },\n [\n focusedValue,\n nodes,\n expandedValues,\n getVisibleNodes,\n handleToggleExpand,\n handleSelect,\n ]\n )\n\n const getDisplayText = () => {\n if (multiple) {\n if (values.length === 0) return placeholder\n if (values.length === 1) {\n const node = findNodeByValue(nodes, values[0])\n return node?.label ?? values[0]\n }\n return `${values.length} selected`\n }\n if (value) {\n const node = findNodeByValue(nodes, value)\n return node?.label ?? value\n }\n return placeholder\n }\n\n const renderSelectedChips = () => {\n if (!multiple || chipValues.length === 0) return null\n\n const chipNodes = chipValues\n .map((v) => findNodeByValue(nodes, v))\n .filter(Boolean) as TreeSelectNode[]\n\n return (\n <div className=\"max-h-[100px] overflow-y-auto px-2 py-1.5 border-b border-border\">\n <div className=\"flex flex-wrap gap-1\">\n {chipNodes.map((node) => (\n <div\n key={node.value}\n className=\"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs\"\n >\n <span className=\"truncate max-w-[120px]\">{node.label}</span>\n <X\n className=\"h-3 w-3 cursor-pointer shrink-0\"\n onClick={(e) => handleRemoveChip(node.value, e)}\n aria-label={`Remove ${node.label}`}\n />\n </div>\n ))}\n </div>\n </div>\n )\n }\n\n return (\n <Popover open={open} onOpenChange={handleOpenChange}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"tree\"\n disabled={disabled}\n className={cn(\n \"cursor-pointer flex my-2 h-9 w-full items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50\",\n !value && !values.length && \"text-secondary-text\",\n error &&\n \"border-destructive-foreground focus-visible:ring-destructive-foreground\",\n className\n )}\n >\n <span className=\"truncate\">{getDisplayText()}</span>\n <ChevronDown className=\"ml-2 h-4 w-4 shrink-0 opacity-50\" />\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"p-0\"\n align=\"start\"\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n >\n <div className=\"flex items-center border-b px-3\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <input\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n placeholder={searchPlaceholder}\n className=\"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\"\n aria-label=\"Search tree\"\n />\n </div>\n\n {renderSelectedChips()}\n\n <div className=\"max-h-[300px] overflow-y-auto\">\n {filteredNodes && filteredNodes.length > 0 ? (\n <div\n ref={treeRef}\n role=\"tree\"\n aria-label=\"Options\"\n className=\"p-1\"\n onKeyDown={handleTreeKeyDown}\n >\n {filteredNodes.map((node) => (\n <TreeNodeItem\n key={node.value}\n node={node}\n depth={0}\n multiple={multiple}\n selectedSet={selectedSet}\n expandedValues={expandedValues}\n focusedValue={focusedValue}\n onToggleExpand={handleToggleExpand}\n onSelect={handleSelect}\n onFocus={setFocusedValue}\n searchTerm={searchTerm}\n />\n ))}\n </div>\n ) : (\n <div className=\"py-6 text-center text-sm text-muted-foreground\">\n {emptyMessage}\n </div>\n )}\n </div>\n </PopoverContent>\n </Popover>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-LQMOWEA7.js","../src/components/tree-select.tsx"],"names":["getAllDescendantValues","node","values","child","getCheckState","selectedSet","descendants","selectedCount","v","filterTree","nodes","searchTerm","term","result","labelMatches","filteredChildren","getValuesOfMatchingNodes","walk","nodeList","hasMatch","childHasMatch","findNodeByValue","value","found","collectAllBranchValues","renderHighlightedLabel","label","index","jsxs","Fragment","jsx","TreeNodeItem","depth","multiple","expandedValues","focusedValue","onToggleExpand","onSelect","onFocus","hasChildren","isExpanded","checkState","indentPx","cn"],"mappings":"AAAA,+8BAAY;AACZ,sDAAuC,sDAAsD,sDAAwC,uECC9G,2CACqC,+CAgKxD,SA3HKA,CAAAA,CAAuBC,CAAAA,CAAgC,CAC9D,IAAMC,CAAAA,CAAmB,CAACD,CAAAA,CAAK,KAAK,CAAA,CACpC,EAAA,CAAIA,CAAAA,CAAK,QAAA,CACP,GAAA,CAAA,IAAWE,EAAAA,GAASF,CAAAA,CAAK,QAAA,CACvBC,CAAAA,CAAO,IAAA,CAAK,GAAGF,CAAAA,CAAuBG,CAAK,CAAC,CAAA,CAGhD,OAAOD,CACT,CAEA,SAASE,CAAAA,CACPH,CAAAA,CACAI,CAAAA,CACY,CACZ,EAAA,CAAI,CAACJ,CAAAA,CAAK,QAAA,EAAYA,CAAAA,CAAK,QAAA,CAAS,MAAA,GAAW,CAAA,CAC7C,OAAOI,CAAAA,CAAY,GAAA,CAAIJ,CAAAA,CAAK,KAAK,CAAA,CAAI,SAAA,CAAY,WAAA,CAGnD,IAAMK,CAAAA,CAAcN,CAAAA,CAAuBC,CAAI,CAAA,CACzCM,CAAAA,CAAgBD,CAAAA,CAAY,MAAA,CAAQE,CAAAA,EAAMH,CAAAA,CAAY,GAAA,CAAIG,CAAC,CAAC,CAAA,CAAE,MAAA,CAEpE,OAAID,CAAAA,GAAkB,CAAA,CAAU,WAAA,CAC5BA,CAAAA,GAAkBD,CAAAA,CAAY,MAAA,CAAe,SAAA,CAC1C,eACT,CAEA,SAASG,CAAAA,CACPC,CAAAA,CACAC,CAAAA,CACyB,CACzB,IAAMC,CAAAA,CAAOD,CAAAA,CAAW,WAAA,CAAY,CAAA,CAAE,IAAA,CAAK,CAAA,CAC3C,EAAA,CAAI,CAACC,CAAAA,CAAM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CAAAA,CAAWV,CAAAA,CAAQ,EAAA,CAEzB,OACEJ,8BAAAA,KAAC,CAAA,CACC,IAAA,CAAK,UAAA,CACL,eAAA,CAAeW,CAAAA,CAAcC,CAAAA,CAAa,KAAA,CAAA,CAC1C,eAAA,CAAeC,CAAAA,GAAe,SAAA,CAE9B,QAAA,CAAA,CAAAb,8BAAAA,KAAC,CAAA,CACC,SAAA,CAAWe,gCAAAA,kIACT,CACA,gBAAA,CACAF,CAAAA,GAAe,SAAA,EAAa,CAACR,CAAAA,EAAY,UAG3C,CAAA,CACA,KAAA,CAAO,CAAE,WAAA,CAAa,CAAA,EAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-LQMOWEA7.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { Check, ChevronDown, ChevronRight, Search, X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Checkbox } from \"@/components/checkbox\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\"\n\n// --- Public types ---\n\nexport interface TreeSelectNode {\n value: string\n label: string\n children?: TreeSelectNode[]\n}\n\nexport interface TreeSelectProps {\n nodes: TreeSelectNode[]\n value?: string\n onValueChange?: (value: string) => void\n multiple?: boolean\n values?: string[]\n onValuesChange?: (values: string[]) => void\n placeholder?: string\n searchPlaceholder?: string\n emptyMessage?: string\n disabled?: boolean\n className?: string\n error?: boolean\n defaultExpandedValues?: string[]\n expandAll?: boolean\n}\n\n// --- Internal types ---\n\ntype CheckState = \"checked\" | \"indeterminate\" | \"unchecked\"\n\n// --- Utility functions ---\n\nfunction getAllDescendantValues(node: TreeSelectNode): string[] {\n const values: string[] = [node.value]\n if (node.children) {\n for (const child of node.children) {\n values.push(...getAllDescendantValues(child))\n }\n }\n return values\n}\n\nfunction getCheckState(\n node: TreeSelectNode,\n selectedSet: Set<string>\n): CheckState {\n if (!node.children || node.children.length === 0) {\n return selectedSet.has(node.value) ? \"checked\" : \"unchecked\"\n }\n\n const descendants = getAllDescendantValues(node)\n const selectedCount = descendants.filter((v) => selectedSet.has(v)).length\n\n if (selectedCount === 0) return \"unchecked\"\n if (selectedCount === descendants.length) return \"checked\"\n return \"indeterminate\"\n}\n\nfunction filterTree(\n nodes: TreeSelectNode[],\n searchTerm: string\n): TreeSelectNode[] | null {\n const term = searchTerm.toLowerCase().trim()\n if (!term) return nodes\n\n const result: TreeSelectNode[] = []\n\n for (const node of nodes) {\n const labelMatches = node.label.toLowerCase().includes(term)\n\n if (node.children && node.children.length > 0) {\n const filteredChildren = filterTree(node.children, searchTerm)\n\n if (labelMatches) {\n result.push(node)\n } else if (filteredChildren && filteredChildren.length > 0) {\n result.push({ ...node, children: filteredChildren })\n }\n } else if (labelMatches) {\n result.push(node)\n }\n }\n\n return result.length > 0 ? result : null\n}\n\nfunction getValuesOfMatchingNodes(\n nodes: TreeSelectNode[],\n searchTerm: string\n): Set<string> {\n const term = searchTerm.toLowerCase().trim()\n const result = new Set<string>()\n\n function walk(nodeList: TreeSelectNode[]): boolean {\n let hasMatch = false\n for (const node of nodeList) {\n const labelMatches = node.label.toLowerCase().includes(term)\n let childHasMatch = false\n\n if (node.children) {\n childHasMatch = walk(node.children)\n }\n\n if (labelMatches || childHasMatch) {\n result.add(node.value)\n hasMatch = true\n }\n }\n return hasMatch\n }\n\n walk(nodes)\n return result\n}\n\nfunction findNodeByValue(\n nodes: TreeSelectNode[],\n value: string\n): TreeSelectNode | undefined {\n for (const node of nodes) {\n if (node.value === value) return node\n if (node.children) {\n const found = findNodeByValue(node.children, value)\n if (found) return found\n }\n }\n return undefined\n}\n\nfunction collectAllBranchValues(nodes: TreeSelectNode[]): Set<string> {\n const result = new Set<string>()\n for (const node of nodes) {\n if (node.children && node.children.length > 0) {\n result.add(node.value)\n for (const v of collectAllBranchValues(node.children)) {\n result.add(v)\n }\n }\n }\n return result\n}\n\nfunction renderHighlightedLabel(\n label: string,\n searchTerm: string\n): React.ReactNode {\n if (!searchTerm) return label\n\n const term = searchTerm.toLowerCase().trim()\n if (!term) return label\n\n const index = label.toLowerCase().indexOf(term)\n if (index === -1) return label\n\n return (\n <>\n {label.slice(0, index)}\n <span className=\"font-semibold underline\">\n {label.slice(index, index + term.length)}\n </span>\n {label.slice(index + term.length)}\n </>\n )\n}\n\n// --- TreeNodeItem (internal) ---\n\ninterface TreeNodeItemProps {\n node: TreeSelectNode\n depth: number\n multiple: boolean\n selectedSet: Set<string>\n expandedValues: Set<string>\n focusedValue: string | null\n onToggleExpand: (value: string) => void\n onSelect: (node: TreeSelectNode) => void\n onFocus: (value: string) => void\n searchTerm: string\n}\n\nfunction TreeNodeItem({\n node,\n depth,\n multiple,\n selectedSet,\n expandedValues,\n focusedValue,\n onToggleExpand,\n onSelect,\n onFocus,\n searchTerm,\n}: TreeNodeItemProps) {\n const hasChildren = node.children && node.children.length > 0\n const isExpanded = expandedValues.has(node.value)\n const checkState = multiple\n ? getCheckState(node, selectedSet)\n : selectedSet.has(node.value)\n ? \"checked\"\n : \"unchecked\"\n\n const indentPx = depth * 20\n\n return (\n <div\n role=\"treeitem\"\n aria-expanded={hasChildren ? isExpanded : undefined}\n aria-selected={checkState === \"checked\"}\n >\n <div\n className={cn(\n \"relative flex items-center gap-2 rounded-sm px-2 py-1.5 my-0.5 text-sm cursor-pointer select-none outline-none active:opacity-50\",\n \"hover:bg-muted\",\n checkState === \"checked\" && !multiple && \"bg-muted\"\n // This adds a focus ring when the node is focused, but it's not needed for the tree-select component.\n // focusedValue === node.value && \"z-10 ring-2 ring-ring\"\n )}\n style={{ paddingLeft: `${8 + indentPx}px` }}\n onClick={() => onSelect(node)}\n onFocus={() => onFocus(node.value)}\n data-tree-value={node.value}\n tabIndex={focusedValue === node.value ? 0 : -1}\n >\n {hasChildren ? (\n <button\n type=\"button\"\n className=\"h-4 w-4 shrink-0 flex items-center justify-center rounded-sm hover:bg-secondary active:opacity-50\"\n onClick={(e) => {\n e.stopPropagation()\n onToggleExpand(node.value)\n }}\n aria-label={\n isExpanded ? `Collapse ${node.label}` : `Expand ${node.label}`\n }\n tabIndex={-1}\n >\n {isExpanded ? (\n <ChevronDown className=\"h-3.5 w-3.5\" />\n ) : (\n <ChevronRight className=\"h-3.5 w-3.5\" />\n )}\n </button>\n ) : (\n <span className=\"h-4 w-4 shrink-0\" />\n )}\n\n {multiple ? (\n <Checkbox\n checked={\n checkState === \"checked\"\n ? true\n : checkState === \"indeterminate\"\n ? \"indeterminate\"\n : false\n }\n onCheckedChange={() => onSelect(node)}\n onClick={(e) => e.stopPropagation()}\n className=\"shrink-0\"\n aria-label={node.label}\n />\n ) : (\n <Check\n className={cn(\n \"h-4 w-4 shrink-0\",\n checkState === \"checked\" ? \"opacity-100\" : \"opacity-0\"\n )}\n />\n )}\n\n <span className=\"truncate\">\n {renderHighlightedLabel(node.label, searchTerm)}\n </span>\n </div>\n\n {hasChildren && isExpanded && (\n <div role=\"group\">\n {node.children!.map((child) => (\n <TreeNodeItem\n key={child.value}\n node={child}\n depth={depth + 1}\n multiple={multiple}\n selectedSet={selectedSet}\n expandedValues={expandedValues}\n focusedValue={focusedValue}\n onToggleExpand={onToggleExpand}\n onSelect={onSelect}\n onFocus={onFocus}\n searchTerm={searchTerm}\n />\n ))}\n </div>\n )}\n </div>\n )\n}\n\n// --- TreeSelect (main component) ---\n\nexport function TreeSelect({\n nodes,\n value,\n onValueChange,\n multiple = false,\n values = [],\n onValuesChange,\n placeholder = \"Select...\",\n searchPlaceholder = \"Search...\",\n emptyMessage = \"No results found.\",\n disabled = false,\n className,\n error = false,\n defaultExpandedValues,\n expandAll = false,\n}: TreeSelectProps) {\n const [open, setOpen] = React.useState(false)\n const [searchTerm, setSearchTerm] = React.useState(\"\")\n const [focusedValue, setFocusedValue] = React.useState<string | null>(null)\n const [expandedValues, setExpandedValues] = React.useState<Set<string>>(\n () => {\n if (expandAll) return collectAllBranchValues(nodes)\n if (defaultExpandedValues) return new Set(defaultExpandedValues)\n return new Set<string>()\n }\n )\n\n const preSearchExpandedRef = React.useRef<Set<string> | null>(null)\n const treeRef = React.useRef<HTMLDivElement>(null)\n\n const selectedSet = React.useMemo(\n () => new Set(multiple ? values : value ? [value] : []),\n [multiple, values, value]\n )\n\n const filteredNodes = React.useMemo(\n () => (searchTerm ? filterTree(nodes, searchTerm) : nodes),\n [nodes, searchTerm]\n )\n\n // Auto-expand matching ancestors during search\n React.useEffect(() => {\n if (searchTerm) {\n if (!preSearchExpandedRef.current) {\n preSearchExpandedRef.current = new Set(expandedValues)\n }\n const matchingAncestors = getValuesOfMatchingNodes(nodes, searchTerm)\n setExpandedValues(matchingAncestors)\n } else if (preSearchExpandedRef.current) {\n setExpandedValues(preSearchExpandedRef.current)\n preSearchExpandedRef.current = null\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [searchTerm, nodes])\n\n const handleOpenChange = React.useCallback((isOpen: boolean) => {\n setOpen(isOpen)\n if (!isOpen) {\n setSearchTerm(\"\")\n setFocusedValue(null)\n }\n }, [])\n\n const handleToggleExpand = React.useCallback((nodeValue: string) => {\n setExpandedValues((prev) => {\n const next = new Set(prev)\n if (next.has(nodeValue)) {\n next.delete(nodeValue)\n } else {\n next.add(nodeValue)\n }\n return next\n })\n }, [])\n\n const handleSelect = React.useCallback(\n (node: TreeSelectNode) => {\n if (multiple) {\n const allDescendants = getAllDescendantValues(node)\n const currentState = getCheckState(node, selectedSet)\n\n let newValues: string[]\n if (currentState === \"checked\") {\n const toRemove = new Set(allDescendants)\n newValues = values.filter((v) => !toRemove.has(v))\n } else {\n const toAdd = allDescendants.filter((v) => !selectedSet.has(v))\n newValues = [...values, ...toAdd]\n }\n onValuesChange?.(newValues)\n } else {\n // Single-select: clicking a parent toggles expand instead of selecting\n const hasChildren = node.children && node.children.length > 0\n if (hasChildren) {\n handleToggleExpand(node.value)\n return\n }\n const newValue = node.value === value ? \"\" : node.value\n onValueChange?.(newValue)\n setOpen(false)\n }\n },\n [\n multiple,\n values,\n value,\n selectedSet,\n onValuesChange,\n onValueChange,\n handleToggleExpand,\n ]\n )\n\n const handleRemoveChip = React.useCallback(\n (chipValue: string, e: React.MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n const node = findNodeByValue(nodes, chipValue)\n if (node) {\n const toRemove = new Set(getAllDescendantValues(node))\n const newValues = values.filter((v) => !toRemove.has(v))\n onValuesChange?.(newValues)\n }\n },\n [nodes, values, onValuesChange]\n )\n\n // Smart chips: minimal set representing the selection\n const chipValues = React.useMemo(() => {\n if (!multiple) return []\n\n const chips: string[] = []\n\n function walk(nodeList: TreeSelectNode[]) {\n for (const node of nodeList) {\n const state = getCheckState(node, selectedSet)\n if (state === \"checked\") {\n chips.push(node.value)\n } else if (state === \"indeterminate\" && node.children) {\n walk(node.children)\n }\n }\n }\n\n walk(nodes)\n return chips\n }, [nodes, selectedSet, multiple])\n\n // Keyboard navigation\n const getVisibleNodes = React.useCallback((): HTMLElement[] => {\n if (!treeRef.current) return []\n return Array.from(treeRef.current.querySelectorAll(\"[data-tree-value]\"))\n }, [])\n\n const handleTreeKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n const visibleNodes = getVisibleNodes()\n const currentIndex = visibleNodes.findIndex(\n (el) => el.dataset.treeValue === focusedValue\n )\n\n switch (e.key) {\n case \"ArrowDown\": {\n e.preventDefault()\n const nextIndex = Math.min(currentIndex + 1, visibleNodes.length - 1)\n const nextValue = visibleNodes[nextIndex]?.dataset.treeValue\n if (nextValue) {\n setFocusedValue(nextValue)\n visibleNodes[nextIndex]?.focus()\n }\n break\n }\n case \"ArrowUp\": {\n e.preventDefault()\n const prevIndex = Math.max(currentIndex - 1, 0)\n const prevValue = visibleNodes[prevIndex]?.dataset.treeValue\n if (prevValue) {\n setFocusedValue(prevValue)\n visibleNodes[prevIndex]?.focus()\n }\n break\n }\n case \"ArrowRight\": {\n e.preventDefault()\n if (focusedValue) {\n const node = findNodeByValue(nodes, focusedValue)\n if (node?.children?.length) {\n if (!expandedValues.has(focusedValue)) {\n handleToggleExpand(focusedValue)\n } else {\n const firstChildValue = node.children[0].value\n setFocusedValue(firstChildValue)\n requestAnimationFrame(() => {\n const els = getVisibleNodes()\n const el = els.find(\n (n) => n.dataset.treeValue === firstChildValue\n )\n el?.focus()\n })\n }\n }\n }\n break\n }\n case \"ArrowLeft\": {\n e.preventDefault()\n if (focusedValue && expandedValues.has(focusedValue)) {\n handleToggleExpand(focusedValue)\n }\n break\n }\n case \"Enter\":\n case \" \": {\n e.preventDefault()\n if (focusedValue) {\n const node = findNodeByValue(nodes, focusedValue)\n if (node) handleSelect(node)\n }\n break\n }\n case \"Home\": {\n e.preventDefault()\n const firstValue = visibleNodes[0]?.dataset.treeValue\n if (firstValue) {\n setFocusedValue(firstValue)\n visibleNodes[0]?.focus()\n }\n break\n }\n case \"End\": {\n e.preventDefault()\n const lastValue =\n visibleNodes[visibleNodes.length - 1]?.dataset.treeValue\n if (lastValue) {\n setFocusedValue(lastValue)\n visibleNodes[visibleNodes.length - 1]?.focus()\n }\n break\n }\n }\n },\n [\n focusedValue,\n nodes,\n expandedValues,\n getVisibleNodes,\n handleToggleExpand,\n handleSelect,\n ]\n )\n\n const getDisplayText = () => {\n if (multiple) {\n if (values.length === 0) return placeholder\n if (values.length === 1) {\n const node = findNodeByValue(nodes, values[0])\n return node?.label ?? values[0]\n }\n return `${values.length} selected`\n }\n if (value) {\n const node = findNodeByValue(nodes, value)\n return node?.label ?? value\n }\n return placeholder\n }\n\n const renderSelectedChips = () => {\n if (!multiple || chipValues.length === 0) return null\n\n const chipNodes = chipValues\n .map((v) => findNodeByValue(nodes, v))\n .filter(Boolean) as TreeSelectNode[]\n\n return (\n <div className=\"max-h-[100px] overflow-y-auto px-2 py-1.5 border-b border-border\">\n <div className=\"flex flex-wrap gap-1\">\n {chipNodes.map((node) => (\n <div\n key={node.value}\n className=\"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs\"\n >\n <span className=\"truncate max-w-[120px]\">{node.label}</span>\n <X\n className=\"h-3 w-3 cursor-pointer shrink-0\"\n onClick={(e) => handleRemoveChip(node.value, e)}\n aria-label={`Remove ${node.label}`}\n />\n </div>\n ))}\n </div>\n </div>\n )\n }\n\n return (\n <Popover open={open} onOpenChange={handleOpenChange}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"tree\"\n disabled={disabled}\n className={cn(\n \"cursor-pointer flex my-2 h-9 w-full items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50\",\n !value && !values.length && \"text-secondary-text\",\n error &&\n \"border-destructive-foreground focus-visible:ring-destructive-foreground\",\n className\n )}\n >\n <span className=\"truncate\">{getDisplayText()}</span>\n <ChevronDown className=\"ml-2 h-4 w-4 shrink-0 opacity-50\" />\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"p-0\"\n align=\"start\"\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n >\n <div className=\"flex items-center border-b px-3\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <input\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n placeholder={searchPlaceholder}\n className=\"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\"\n aria-label=\"Search tree\"\n />\n </div>\n\n {renderSelectedChips()}\n\n <div className=\"max-h-[300px] overflow-y-auto\">\n {filteredNodes && filteredNodes.length > 0 ? (\n <div\n ref={treeRef}\n role=\"tree\"\n aria-label=\"Options\"\n className=\"p-1\"\n onKeyDown={handleTreeKeyDown}\n >\n {filteredNodes.map((node) => (\n <TreeNodeItem\n key={node.value}\n node={node}\n depth={0}\n multiple={multiple}\n selectedSet={selectedSet}\n expandedValues={expandedValues}\n focusedValue={focusedValue}\n onToggleExpand={handleToggleExpand}\n onSelect={handleSelect}\n onFocus={setFocusedValue}\n searchTerm={searchTerm}\n />\n ))}\n </div>\n ) : (\n <div className=\"py-6 text-center text-sm text-muted-foreground\">\n {emptyMessage}\n </div>\n )}\n </div>\n </PopoverContent>\n </Popover>\n )\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{sileo as s,Toaster as o}from"sileo";import{jsx as e}from"react/jsx-runtime";function a({...t}){return e(o,{options:{fill:"var(--toast-bg, #
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{sileo as s,Toaster as o}from"sileo";import{jsx as e}from"react/jsx-runtime";function a({...t}){return e(o,{options:{fill:"var(--toast-bg, #171717)",styles:{title:"text-primary-accent!",description:"text-secondary-text!",badge:"bg-white/20!",button:"bg-white/10!"}},...t})}export{s as a,a as b};
|
|
3
|
+
//# sourceMappingURL=chunk-NEY5JU5Z.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/toast.tsx"],"sourcesContent":["\"use client\"\n\nimport { sileo, Toaster as SileoToaster } from \"sileo\"\nimport type { ComponentProps } from \"react\"\n\ntype ToasterProps = ComponentProps<typeof SileoToaster>\n\nfunction Toaster({ ...props }: ToasterProps) {\n return (\n <SileoToaster\n options={{\n fill: \"var(--toast-bg, #
|
|
1
|
+
{"version":3,"sources":["../src/components/toast.tsx"],"sourcesContent":["\"use client\"\n\nimport { sileo, Toaster as SileoToaster } from \"sileo\"\nimport type { ComponentProps } from \"react\"\n\ntype ToasterProps = ComponentProps<typeof SileoToaster>\n\nfunction Toaster({ ...props }: ToasterProps) {\n return (\n <SileoToaster\n options={{\n fill: \"var(--toast-bg, #171717)\",\n styles: {\n title: \"text-primary-accent!\",\n description: \"text-secondary-text!\",\n badge: \"bg-white/20!\",\n button: \"bg-white/10!\",\n },\n }}\n {...props}\n />\n )\n}\n\nexport { Toaster, sileo as toast }\n"],"mappings":";AAEA,OAAS,SAAAA,EAAO,WAAWC,MAAoB,QAO3C,cAAAC,MAAA,oBAFJ,SAASC,EAAQ,CAAE,GAAGC,CAAM,EAAiB,CAC3C,OACEF,EAACD,EAAA,CACC,QAAS,CACP,KAAM,2BACN,OAAQ,CACN,MAAO,uBACP,YAAa,uBACb,MAAO,eACP,OAAQ,cACV,CACF,EACC,GAAGG,EACN,CAEJ","names":["sileo","SileoToaster","jsx","Toaster","props"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-RJMIOBXZ.js","../src/components/scroll-area.tsx"],"names":["ScrollArea","className","children","props","ref","jsxs","cn","jsx","ScrollBar","orientation"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECChB,iHACc,+CAQnC,IAJIA,CAAAA,CAAmB,CAAA,CAAA,UAAA,CAGvB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,QAAA,CAAAC,CAAAA,CAAU,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACpCC,8BAAAA,CAAqB,CAAA,IAAA,CAApB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,gCAAAA,0BAAG,CAA4BL,CAAS,CAAA,CAClD,GAAGE,CAAAA,CAEJ,QAAA,CAAA,CAAAI,6BAAAA,CAAqB,CAAA,QAAA,CAApB,CAA6B,SAAA,CAAU,iCAAA,CACrC,QAAA,CAAAL,CAAAA,CACH,CAAA,CACAK,6BAAAA,CAACC,CAAA,CAAA,CAAU,CAAA,CACXD,6BAAAA,CAAqB,CAAA,MAAA,CAApB,CAAA,CAA2B,CAAA,CAAA,CAC9B,CACD,CAAA,CACDP,CAAAA,CAAW,WAAA,CAAkC,CAAA,CAAA,IAAA,CAAK,WAAA,CAElD,IAAMQ,CAAAA,CAAkB,CAAA,CAAA,UAAA,CAGtB,CAAC,CAAE,SAAA,CAAAP,CAAAA,CAAW,WAAA,CAAAQ,CAAAA,CAAc,UAAA,CAAY,GAAGN,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACpDG,6BAAAA,CAAqB,CAAA,mBAAA,CAApB,CACC,GAAA,CAAKH,CAAAA,CACL,WAAA,CAAaK,CAAAA,CACb,SAAA,CAAWH,gCAAAA,+CACT,CACAG,CAAAA,GAAgB,UAAA,EACd,oDAAA,CACFA,CAAAA,GAAgB,YAAA,EACd,sDAAA,CACFR,CACF,CAAA,CACC,GAAGE,CAAAA,CAEJ,QAAA,CAAAI,6BAAAA,CAAqB,CAAA,eAAA,CAApB,CAAoC,SAAA,CAAU,0CAAA,CAA2C,CAAA,CAC5F,CACD,CAAA,CACDC,CAAAA,CAAU,WAAA,CAAkC,CAAA,CAAA,mBAAA,CAAoB,WAAA,CAAA,6BAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-RJMIOBXZ.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst ScrollArea = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn(\"relative overflow-hidden\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n))\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName\n\nconst ScrollBar = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" &&\n \"h-full w-2.5 border-l border-l-transparent p-[1px]\",\n orientation === \"horizontal\" &&\n \"h-2.5 flex-col border-t border-t-transparent p-[1px]\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-muted/40\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n))\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName\n\nexport { ScrollArea, ScrollBar }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-RKRTEMMZ.js","../src/components/drawer.tsx"],"names":["DRAWER_WIDTH","DrawerContext","useDrawer","context","Drawer","isOpen","onClose","width","children","props","ref","drawerRef","isDesktop","useMediaQuery","contextValue","jsxs","jsx","DrawerPrimitive","open","cn","DrawerHeader","className","showCloseButton","Button","X","DrawerTitle","DrawerBody","ScrollArea","DrawerFooter"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,sDAAwC,sDAAwC,sDAAwC,uECCxI,2CACL,4BACwB,+CA2D9B,IApDNA,CAAAA,CAAe,OAAA,CASfC,CAAAA,CAAsB,CAAA,CAAA,aAAA,CAAyC,IAAI,CAAA,CAEzE,SAASC,CAAAA,CAAAA,CAAY,CACnB,IAAMC,CAAAA,CAAgB,CAAA,CAAA,UAAA,CAAWF,CAAa,CAAA,CAC9C,EAAA,CAAI,CAACE,CAAAA,CACH,MAAM,IAAI,KAAA,CAAM,mDAAmD,CAAA,CAErE,OAAOA,CACT,CAGA,IAAMC,CAAAA,CAAe,CAAA,CAAA,UAAA,CAOnB,CAAC,CAAE,MAAA,CAAAC,CAAAA,CAAQ,OAAA,CAAAC,CAAAA,CAAS,KAAA,CAAAC,CAAAA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CACH,CAAA,CACF,CAEH,CAAA,CACDkB,CAAAA,CAAW,WAAA,CAAc,YAAA,CAGzB,IAAME,CAAAA,CAAqB,CAAA,CAAA,UAAA,CAGzB,CAAC,CAAE,SAAA,CAAAP,CAAAA,CAAW,GAAGZ,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAExBM,6BAAAA,KAAC,CAAA,CACC,GAAA,CAAKN,CAAAA,CACL,aAAA,CAAY,QAAA,CACZ,SAAA,CAAWS,gCAAAA,wDACT,CACAE,CACF,CAAA,CACC,GAAGZ,CAAAA,CACN,CAEH,CAAA,CACDmB,CAAAA,CAAa,WAAA,CAAc,cAAA,CAAA,yFAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-RKRTEMMZ.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { X } from \"lucide-react\"\nimport { Drawer as DrawerPrimitive } from \"vaul\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/button\"\nimport { ScrollArea } from \"@/components/scroll-area\"\nimport { useMediaQuery } from \"@/lib/use-media-query\"\n\nconst DRAWER_WIDTH = \"24rem\"\n\n// Drawer Context\ntype DrawerContextProps = {\n isOpen: boolean\n onClose: () => void\n width?: string\n}\n\nconst DrawerContext = React.createContext<DrawerContextProps | null>(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer component.\")\n }\n return context\n}\n\n// Main Unified Drawer Component (Responsive)\nconst Drawer = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n isOpen: boolean\n onClose: () => void\n width?: string\n }\n>(({ isOpen, onClose, width = DRAWER_WIDTH, children, ...props }, ref) => {\n const drawerRef = React.useRef<HTMLDivElement>(null)\n const isDesktop = useMediaQuery(\"lg\")\n\n const contextValue = React.useMemo<DrawerContextProps>(\n () => ({\n isOpen,\n onClose,\n width,\n }),\n [isOpen, onClose, width]\n )\n\n return (\n <DrawerContext.Provider value={contextValue}>\n {/* Mobile Drawer: visible < md breakpoint */}\n {!isDesktop && (\n <DrawerPrimitive.Root\n open={isOpen}\n onOpenChange={(open) => {\n if (!open) onClose()\n }}\n direction=\"left\"\n >\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm\" />\n <DrawerPrimitive.Content\n className=\"fixed inset-y-0 left-0 z-50 flex h-full w-[85vw] max-w-md flex-col bg-sidebar border-r border-sidebar-border text-primary-accent shadow-lg outline-none\"\n aria-describedby={undefined}\n >\n <DrawerPrimitive.Title className=\"sr-only\">\n Drawer\n </DrawerPrimitive.Title>\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n </DrawerPrimitive.Root>\n )}\n\n {/* Desktop Drawer: visible >= md breakpoint */}\n {isDesktop && (\n <div\n ref={ref}\n className=\"group/drawer peer\"\n data-state={isOpen ? \"open\" : \"closed\"}\n {...props}\n >\n {/* Spacer to push content */}\n <div\n className={cn(\n \"relative bg-sidebar transition-[width] duration-200 ease-linear\",\n isOpen ? \"\" : \"w-0\"\n )}\n style={\n {\n width: isOpen ? width : \"0\",\n } as React.CSSProperties\n }\n />\n\n {/* Fixed drawer panel */}\n <div\n ref={drawerRef}\n className={cn(\n \"fixed right-0 z-40 transition-[right,width,top,height] duration-200 ease-linear flex\",\n \"top-(--sidebar-top,0px) h-[calc(100svh-var(--sidebar-top,0px))]\",\n isOpen ? \"right-0\" : \"right-[calc(var(--drawer-width)*-1)]\"\n )}\n style={\n {\n \"--drawer-width\": width,\n width: width,\n } as React.CSSProperties\n }\n >\n <div data-drawer=\"drawer\" className=\"flex h-full w-full flex-col\">\n <div className=\"flex flex-col my-2.5 mr-2.5 rounded-2xl border bg-sidebar border-sidebar-border h-[calc(100%-1.25rem)] shadow\">\n {children}\n </div>\n </div>\n </div>\n </div>\n )}\n </DrawerContext.Provider>\n )\n})\nDrawer.displayName = \"Drawer\"\n\n// Drawer Header\nconst DrawerHeader = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n showCloseButton?: boolean\n }\n>(({ className, showCloseButton = true, children, ...props }, ref) => {\n const { onClose } = useDrawer()\n\n return (\n <div\n ref={ref}\n data-drawer=\"header\"\n className={cn(\n \"flex w-full items-start justify-between gap-2 p-4 border-b border-sidebar-border\",\n className\n )}\n {...props}\n >\n <div className=\"flex-1\">{children}</div>\n {showCloseButton && (\n <Button\n variant=\"secondary\"\n size=\"icon\"\n onClick={onClose}\n className=\"h-8 w-8 shrink-0 rounded-full\"\n >\n <X size={16} />\n <span className=\"sr-only\">Close drawer</span>\n </Button>\n )}\n </div>\n )\n})\nDrawerHeader.displayName = \"DrawerHeader\"\n\n// Drawer Title\nconst DrawerTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentProps<\"h2\">\n>(({ className, ...props }, ref) => {\n return (\n <h2\n ref={ref}\n className={cn(\"text-lg font-semibold text-primary-accent\", className)}\n {...props}\n />\n )\n})\nDrawerTitle.displayName = \"DrawerTitle\"\n\n// Drawer Body/Content\nconst DrawerBody = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, children, ...props }, ref) => {\n return (\n <ScrollArea className=\"flex-1\" ref={ref}>\n <div\n data-drawer=\"body\"\n className={cn(\"p-4\", className)}\n {...props}\n >\n {children}\n </div>\n </ScrollArea>\n )\n})\nDrawerBody.displayName = \"DrawerBody\"\n\n// Drawer Footer\nconst DrawerFooter = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-drawer=\"footer\"\n className={cn(\n \"flex flex-col gap-2 p-4 border-t border-sidebar-border\",\n className\n )}\n {...props}\n />\n )\n})\nDrawerFooter.displayName = \"DrawerFooter\"\n\nexport {\n Drawer,\n DrawerHeader,\n DrawerTitle,\n DrawerBody,\n DrawerFooter,\n useDrawer,\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-RKRTEMMZ.js","../src/components/drawer.tsx"],"names":["DRAWER_WIDTH","DrawerContext","useDrawer","context","Drawer","isOpen","onClose","width","children","props","ref","drawerRef","isDesktop","useMediaQuery","contextValue","jsxs","jsx","DrawerPrimitive","open","cn","DrawerHeader","className","showCloseButton","Button","X","DrawerTitle","DrawerBody","ScrollArea","DrawerFooter"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,sDAAwC,sDAAwC,sDAAwC,uECCxI,2CACL,4BACwB,+CA2D9B,IApDNA,CAAAA,CAAe,OAAA,CASfC,CAAAA,CAAsB,CAAA,CAAA,aAAA,CAAyC,IAAI,CAAA,CAEzE,SAASC,CAAAA,CAAAA,CAAY,CACnB,IAAMC,CAAAA,CAAgB,CAAA,CAAA,UAAA,CAAWF,CAAa,CAAA,CAC9C,EAAA,CAAI,CAACE,CAAAA,CACH,MAAM,IAAI,KAAA,CAAM,mDAAmD,CAAA,CAErE,OAAOA,CACT,CAGA,IAAMC,CAAAA,CAAe,CAAA,CAAA,UAAA,CAOnB,CAAC,CAAE,MAAA,CAAAC,CAAAA,CAAQ,OAAA,CAAAC,CAAAA,CAAS,KAAA,CAAAC,CAAAA,CAAQP,CAAAA,CAAc,QAAA,CAAAQ,CAAAA,CAAU,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAAQ,CACxE,IAAMC,CAAAA,CAAkB,CAAA,CAAA,MAAA,CAAuB,IAAI,CAAA,CAC7CC,CAAAA,CAAYC,gCAAAA,IAAkB,CAAA,CAE9BC,CAAAA,CAAqB,CAAA,CAAA,OAAA,CACzB,CAAA,CAAA,EAAA,CAAO,CACL,MAAA,CAAAT,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CACF,CAAA,CAAA,CACA,CAACF,CAAAA,CAAQC,CAAAA,CAASC,CAAK,CACzB,CAAA,CAEA,OACEQ,8BAAAA,CAACd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-ui-kit/dist/chunk-RKRTEMMZ.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { X } from \"lucide-react\"\nimport { Drawer as DrawerPrimitive } from \"vaul\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/button\"\nimport { ScrollArea } from \"@/components/scroll-area\"\nimport { useMediaQuery } from \"@/lib/use-media-query\"\n\nconst DRAWER_WIDTH = \"24rem\"\n\n// Drawer Context\ntype DrawerContextProps = {\n isOpen: boolean\n onClose: () => void\n width?: string\n}\n\nconst DrawerContext = React.createContext<DrawerContextProps | null>(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer component.\")\n }\n return context\n}\n\n// Main Unified Drawer Component (Responsive)\nconst Drawer = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n isOpen: boolean\n onClose: () => void\n width?: string\n }\n>(({ isOpen, onClose, width = DRAWER_WIDTH, children, ...props }, ref) => {\n const drawerRef = React.useRef<HTMLDivElement>(null)\n const isDesktop = useMediaQuery(\"lg\")\n\n const contextValue = React.useMemo<DrawerContextProps>(\n () => ({\n isOpen,\n onClose,\n width,\n }),\n [isOpen, onClose, width]\n )\n\n return (\n <DrawerContext.Provider value={contextValue}>\n {/* Mobile Drawer: visible < md breakpoint */}\n {!isDesktop && (\n <DrawerPrimitive.Root\n open={isOpen}\n onOpenChange={(open) => {\n if (!open) onClose()\n }}\n direction=\"left\"\n >\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm\" />\n <DrawerPrimitive.Content\n className=\"fixed inset-y-0 left-0 z-50 flex h-full w-[85vw] max-w-md flex-col bg-sidebar border-r border-sidebar-border text-primary-accent shadow-lg outline-none\"\n aria-describedby={undefined}\n >\n <DrawerPrimitive.Title className=\"sr-only\">\n Drawer\n </DrawerPrimitive.Title>\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n </DrawerPrimitive.Root>\n )}\n\n {/* Desktop Drawer: visible >= md breakpoint */}\n {isDesktop && (\n <div\n ref={ref}\n className=\"group/drawer peer\"\n data-state={isOpen ? \"open\" : \"closed\"}\n {...props}\n >\n {/* Spacer to push content */}\n <div\n className={cn(\n \"relative bg-sidebar transition-[width] duration-200 ease-linear\",\n isOpen ? \"\" : \"w-0\"\n )}\n style={\n {\n width: isOpen ? width : \"0\",\n } as React.CSSProperties\n }\n />\n\n {/* Fixed drawer panel */}\n <div\n ref={drawerRef}\n className={cn(\n \"fixed right-0 z-40 transition-[right,width,top,height] duration-200 ease-linear flex\",\n \"top-(--sidebar-top,0px) h-[calc(100svh-var(--sidebar-top,0px))]\",\n isOpen ? \"right-0\" : \"right-[calc(var(--drawer-width)*-1)]\"\n )}\n style={\n {\n \"--drawer-width\": width,\n width: width,\n } as React.CSSProperties\n }\n >\n <div data-drawer=\"drawer\" className=\"flex h-full w-full flex-col\">\n <div className=\"flex flex-col my-2.5 mr-2.5 rounded-2xl border bg-sidebar border-sidebar-border h-[calc(100%-1.25rem)] shadow\">\n {children}\n </div>\n </div>\n </div>\n </div>\n )}\n </DrawerContext.Provider>\n )\n})\nDrawer.displayName = \"Drawer\"\n\n// Drawer Header\nconst DrawerHeader = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n showCloseButton?: boolean\n }\n>(({ className, showCloseButton = true, children, ...props }, ref) => {\n const { onClose } = useDrawer()\n\n return (\n <div\n ref={ref}\n data-drawer=\"header\"\n className={cn(\n \"flex w-full items-start justify-between gap-2 p-4 border-b border-sidebar-border\",\n className\n )}\n {...props}\n >\n <div className=\"flex-1\">{children}</div>\n {showCloseButton && (\n <Button\n variant=\"secondary\"\n size=\"icon\"\n onClick={onClose}\n className=\"h-8 w-8 shrink-0 rounded-full\"\n >\n <X size={16} />\n <span className=\"sr-only\">Close drawer</span>\n </Button>\n )}\n </div>\n )\n})\nDrawerHeader.displayName = \"DrawerHeader\"\n\n// Drawer Title\nconst DrawerTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentProps<\"h2\">\n>(({ className, ...props }, ref) => {\n return (\n <h2\n ref={ref}\n className={cn(\"text-lg font-semibold text-primary-accent\", className)}\n {...props}\n />\n )\n})\nDrawerTitle.displayName = \"DrawerTitle\"\n\n// Drawer Body/Content\nconst DrawerBody = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, children, ...props }, ref) => {\n return (\n <ScrollArea className=\"flex-1\" ref={ref}>\n <div\n data-drawer=\"body\"\n className={cn(\"p-4\", className)}\n {...props}\n >\n {children}\n </div>\n </ScrollArea>\n )\n})\nDrawerBody.displayName = \"DrawerBody\"\n\n// Drawer Footer\nconst DrawerFooter = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-drawer=\"footer\"\n className={cn(\n \"flex flex-col gap-2 p-4 border-t border-sidebar-border\",\n className\n )}\n {...props}\n />\n )\n})\nDrawerFooter.displayName = \"DrawerFooter\"\n\nexport {\n Drawer,\n DrawerHeader,\n DrawerTitle,\n DrawerBody,\n DrawerFooter,\n useDrawer,\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-RRAIGAHU.js","../src/components/tooltip.tsx"],"names":["TooltipProvider","Tooltip","TooltipTrigger","TooltipContent","className","sideOffset","asChild","props","ref","jsx","cn"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECChB,uGACW,+CAmB1B,IAfFA,CAAAA,CAAmC,CAAA,CAAA,QAAA,CAEnCC,CAAAA,aAA2B,CAAA,CAAA,IAAA,CAE3BC,CAAAA,aAAkC,CAAA,CAAA,OAAA,CAElCC,CAAAA,aAAuB,CAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,UAAA,CAAAC,CAAAA,CAAa,CAAA,CAAG,OAAA,CAAAC,CAAAA,CAAS,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAG/CF,CAAAA,CAEAG,6BAAAA,CAAkB,CAAA,MAAA,CAAjB,CACC,QAAA,CAAAA,6BAAAA,CAAkB,CAAA,OAAA,CAAjB,CACC,GAAA,CAAKD,CAAAA,CACL,UAAA,CAAYH,CAAAA,CACZ,OAAA,CAASC,CAAAA,CACT,SAAA,CAAWF,CAAAA,CACV,GAAGG,CAAAA,CACN,CAAA,CACF,CAAA,CAMFE,6BAAAA,CAAkB,CAAA,MAAA,CAAjB,CACC,QAAA,CAAAA,6BAAAA,CAAkB,CAAA,OAAA,CAAjB,CACC,GAAA,CAAKD,CAAAA,CACL,UAAA,CAAYH,CAAAA,CACZ,SAAA,CAAWK,gCAAAA,4YACT,CACAN,CACF,CAAA,CACC,GAAGG,CAAAA,CACN,CAAA,CACF,CAEH,CAAA,CACDJ,CAAAA,CAAe,WAAA,CAA+B,CAAA,CAAA,OAAA,CAAQ,WAAA,CAAA,2DAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-RRAIGAHU.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, asChild, ...props }, ref) => {\n // When asChild is used, pass props through without default styling\n // The child component (e.g., Button) will receive the tooltip props directly\n if (asChild) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n asChild={asChild}\n className={className}\n {...props}\n />\n </TooltipPrimitive.Portal>\n )\n }\n\n // Default tooltip styling when not using asChild\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 overflow-hidden rounded-xl border border-border bg-tooltip px-4 py-2 text-sm text-primary-accent shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n )\n})\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-TDMRUCR6.js","../src/components/textarea.tsx"],"names":["Textarea","className","error","props","ref","jsx","cn"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECDhB,+CAWjB,IAHAA,CAAAA,CAAiB,CAAA,CAAA,UAAA,CACrB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,KAAA,CAAAC,CAAAA,CAAO,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAE7BC,6BAAAA,UAAC,CAAA,CACC,SAAA,CAAWC,gCAAAA,oUACT,CACAJ,CAAAA,CACI,yEAAA,CACA,eAAA,CACJD,CACF,CAAA,CACA,GAAA,CAAKG,CAAAA,CACJ,GAAGD,CAAAA,CACN,CAGN,CAAA,CACAH,CAAAA,CAAS,WAAA,CAAc,UAAA,CAAA,cAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-TDMRUCR6.js","sourcesContent":[null,"import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n error?: boolean\n}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, error, ...props }, ref) => {\n return (\n <textarea\n className={cn(\n \"flex my-2 min-h-[74px] w-full rounded-3xl border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background placeholder:text-secondary-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n error\n ? \"border-destructive-foreground focus-visible:ring-destructive-foreground\"\n : \"border-border\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nTextarea.displayName = \"Textarea\"\n\nexport { Textarea }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-UJZP6L4S.js","../src/components/accordion.tsx"],"names":["accordionItemVariants","cva","Accordion","className","props","ref","jsx","cn","AccordionItem","variant","AccordionTrigger","children","aside","jsxs","ChevronRight","AccordionContent","description","Fragment"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECChB,6GACa,2CACP,kEAEU,+CAoBrC,IAhBIA,CAAAA,CAAwBC,yCAAAA,aAAI,CAAe,CAC/C,QAAA,CAAU,CACR,OAAA,CAAS,CACP,OAAA,CAAS,oCAAA,CACT,KAAA,CAAO,EACT,CACF,CAAA,CACA,eAAA,CAAiB,CACf,OAAA,CAAS,SACX,CACF,CAAC,CAAA,CAEKC,CAAAA,aAAkB,CAAA,CAAA,UAAA,CAGtB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC1BC,6BAAAA,CAAoB,CAAA,IAAA,CAAnB,CACC,GAAA,CAAKD,CAAAA,CACL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,CACF,CACD,CAAA,CACDF,CAAAA,CAAiB,WAAA,CAAiC,CAAA,CAAA,OAAA,CAAQ,WAAA,CAE1D,IAAMK,CAAAA,CAAyB,CAAA,CAAA,UAAA,CAK7B,CAAC,CAAE,SAAA,CAAAZ,CAAAA,CAAW,QAAA,CAAAQ,CAAAA,CAAU,WAAA,CAAAK,CAAAA,CAAa,GAAGZ,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACjDQ,8BAAAA,CAAoB,CAAA,OAAA,CAAnB,CACC,GAAA,CAAKR,CAAAA,CACL,SAAA,CAAU,2GAAA,CACT,GAAGD,CAAAA,CAEH,QAAA,CAAA,CAAAY,CAAAA,EACCH,8BAAAA,oBAAAI,CAAA,CACE,QAAA,CAAA,CAAAX,6BAAAA,KAAC,CAAA,CAAI,SAAA,CAAU,iDAAA,CACZ,QAAA,CAAAU,CAAAA,CACH,CAAA,CACAV,6BAAAA,KAAC,CAAA,CAAI,SAAA,CAAU,wBAAA,CAAyB,CAAA,CAAA,CAC1C,CAAA,CAGFA,6BAAAA,KAAC,CAAA,CAAI,SAAA,CAAWC,gCAAAA,kBAAG,CAAoBJ,CAAS,CAAA,CAAI,QAAA,CAAAQ,CAAAA,CAAS,CAAA,CAAA,CAC/D,CACD,CAAA,CACDI,CAAAA,CAAiB,WAAA,CAAiC,CAAA,CAAA,OAAA,CAAQ,WAAA,CAAA,2DAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-UJZP6L4S.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\"\nimport { ChevronRight } from \"lucide-react\"\n\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst accordionItemVariants = cva(\"rounded-3xl\", {\n variants: {\n variant: {\n default: \"border border-border bg-background\",\n ghost: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n})\n\nconst Accordion = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Root\n ref={ref}\n className={cn(\"flex flex-col gap-4\", className)}\n {...props}\n />\n))\nAccordion.displayName = \"Accordion\"\n\nconst AccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> &\n VariantProps<typeof accordionItemVariants>\n>(({ className, variant, ...props }, ref) => (\n <AccordionPrimitive.Item\n ref={ref}\n className={cn(accordionItemVariants({ variant }), className)}\n {...props}\n />\n))\nAccordionItem.displayName = \"AccordionItem\"\n\nconst AccordionTrigger = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger> & {\n aside?: React.ReactNode\n }\n>(({ className, children, aside, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 cursor-pointer items-center gap-4 px-4.5 py-3.5 text-sm transition-all text-left [&[data-state=open]>svg]:rotate-90 active:opacity-50 data-disabled:cursor-not-allowed\",\n className\n )}\n {...props}\n >\n <ChevronRight className=\"h-4 w-4 shrink-0 transition-transform duration-200 in-data-disabled:opacity-40\" />\n <span className=\"in-data-disabled:opacity-40\">{children}</span>\n {aside && <span className=\"ml-auto\">{aside}</span>}\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n))\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName\n\nconst AccordionContent = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content> & {\n description?: React.ReactNode\n }\n>(({ className, children, description, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n {...props}\n >\n {description && (\n <>\n <div className=\"pl-12.5 pr-4.5 pb-3 text-sm text-secondary-text\">\n {description}\n </div>\n <div className=\"border-t border-border\" />\n </>\n )}\n\n <div className={cn(\"px-4.5 pb-4 pt-3\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n))\nAccordionContent.displayName = AccordionPrimitive.Content.displayName\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-ULIOO55I.js","../src/components/popover.tsx"],"names":["Popover","PopoverTrigger","PopoverContent","className","align","sideOffset","props","ref","jsx","cn"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECDhB,uGACW,+CAa9B,IATEA,CAAAA,CAA2B,CAAA,CAAA,IAAA,CAE3BC,CAAAA,aAAkC,CAAA,CAAA,OAAA,CAElCC,CAAAA,aAAuB,CAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,KAAA,CAAAC,CAAAA,CAAQ,QAAA,CAAU,UAAA,CAAAC,CAAAA,CAAa,CAAA,CAAG,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC5DC,6BAAAA,CAAkB,CAAA,MAAA,CAAjB,CACC,QAAA,CAAAA,6BAAAA,CAAkB,CAAA,OAAA,CAAjB,CACC,GAAA,CAAKD,CAAAA,CACL,KAAA,CAAOH,CAAAA,CACP,UAAA,CAAYC,CAAAA,CACZ,SAAA,CAAWI,gCAAAA,8dACT,CACAN,CACF,CAAA,CACC,GAAGG,CAAAA,CACN,CAAA,CACF,CACD,CAAA,CACDJ,CAAAA,CAAe,WAAA,CAA+B,CAAA,CAAA,OAAA,CAAQ,WAAA,CAAA,4CAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-ULIOO55I.js","sourcesContent":[null,"import * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverContent }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-UNR6ATUH.js","../src/components/sheet.tsx"],"names":["Sheet","SheetTrigger","SheetClose","SheetPortal","SheetOverlay","className","props","ref","jsx","cn","sheetVariants","cva","SheetContent","side","children","jsxs","X","SheetHeader","SheetFooter","SheetTitle","SheetDescription"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECChB,oGACS,kEACO,2CACrB,+CAgBhB,IAZIA,CAAAA,CAAuB,CAAA,CAAA,IAAA,CAEvBC,CAAAA,aAA8B,CAAA,CAAA,OAAA,CAE9BC,CAAAA,aAA4B,CAAA,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1BC,6BAAAA,CAAgB,CAAA,WAAA,CAAf,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,gCAAAA,+BAAG,CAAiCJ,CAAS,CAAA,CACvD,GAAGC,CAAAA,CACN,CACD,CAAA,CACDc,CAAAA,CAAiB,WAAA,CAA6B,CAAA,CAAA,WAAA,CAAY,WAAA,CAAA,qJAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-UNR6ATUH.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Sheet = SheetPrimitive.Root\n\nconst SheetTrigger = SheetPrimitive.Trigger\n\nconst SheetClose = SheetPrimitive.Close\n\nconst SheetPortal = SheetPrimitive.Portal\n\nconst SheetOverlay = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n ref={ref}\n />\n))\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName\n\nconst sheetVariants = cva(\n \"fixed z-50 gap-4 bg-sheet p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:duration-500\",\n {\n variants: {\n side: {\n top: \"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n bottom:\n \"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n left: \"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm\",\n right:\n \"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm\",\n },\n },\n defaultVariants: {\n side: \"right\",\n },\n }\n)\n\ninterface SheetContentProps\n extends\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {}\n\nconst SheetContent = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(({ side = \"right\", className, children, ...props }, ref) => (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n ref={ref}\n className={cn(sheetVariants({ side }), className)}\n {...props}\n >\n {children}\n <SheetPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n))\nSheetContent.displayName = SheetPrimitive.Content.displayName\n\nconst SheetHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-2 text-center sm:text-left\",\n className\n )}\n {...props}\n />\n)\nSheetHeader.displayName = \"SheetHeader\"\n\nconst SheetFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n )}\n {...props}\n />\n)\nSheetFooter.displayName = \"SheetFooter\"\n\nconst SheetTitle = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold text-primary-accent\", className)}\n {...props}\n />\n))\nSheetTitle.displayName = SheetPrimitive.Title.displayName\n\nconst SheetDescription = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n))\nSheetDescription.displayName = SheetPrimitive.Description.displayName\n\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-USPGZYMV.js","../src/components/file-upload.tsx"],"names":["FileUpload","accept","maxSize","multiple","onFilesChange","error","disabled","className","description","ref","isDragging","setIsDragging","files","setFiles","inputRef","handleDragEnter","handleDragLeave","handleDragOver","validateFile","file","handleFiles","newFiles","validFiles","updatedFiles","handleDrop","handleClick","handleInputChange","removeFile","index","_","i","formatFileSize","bytes"],"mappings":"AAAA,22BAAY;AACZ,sDAAuC,sDAAwC,uECDxD,2CACS,+CA0JpB,IAhINA,CAAAA,CAAmB,CAAA,CAAA,UAAA,CACvB,CACE,CACE,MAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CAAW,CAAA,CAAA,CACX,aAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CACF,CAAA,CACAC,CAAAA,CAAAA,EACG,CACH,GAAM,CAACC,CAAAA,CAAYC,CAAa,CAAA,CAAU,CAAA,CAAA,QAAA,CAAS,CAAA,CAAK,CAAA,CAClD,CAACC,CAAAA,CAAO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,CAAAA,EACJc,CAAAA,CAAY,CAAA,CAAE,YAAA,CAAa,KAAK,CAClC,CAAA,CAEMK,CAAAA,CAAc,CAAA,CAAA,EAAM,CACnBnB,CAAAA,kBAAUQ,CAAAA,qBAAS,OAAA,6BAAS,KAAA,mBAAM,GACzC,CAAA,CAEMY,CAAAA,CAAqB,CAAA,EAA2C,CACpEN,CAAAA,CAAY,CAAA,CAAE,MAAA,CAAO,KAAK,CAAA,CACtBN,CAAAA,CAAS,OAAA,EAAA,CAASA,CAAAA,CAAS,OAAA,CAAQ,KAAA,CAAQ,EAAA,CACjD,CAAA,CAEMa,CAAAA,CAAcC,CAAAA,EAAkB,CACpC,IAAML,CAAAA,CAAeX,CAAAA,CAAM,MAAA,CAAO,CAACiB,CAAAA,CAAGC,CAAAA,CAAAA,EAAMA,CAAAA,GAAMF,CAAK,CAAA,CACvDf,CAAAA,CAASU,CAAY,CAAA,iBACrBnB,CAAAA,0BAAAA,CAAgBmB,CAAY,GAC9B,CAAA,CAEMQ,CAAAA,CAAkBC,CAAAA,EAClBA,CAAAA,CAAQ,IAAA,CAAa,CAAA,EAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-USPGZYMV.js","sourcesContent":[null,"import * as React from \"react\"\nimport { Upload, X, File } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants } from \"./button\"\n\nexport interface FileUploadProps {\n /** Accepted file formats (e.g., \".png,.jpg,.pdf\" or \"image/*\") */\n accept?: string\n /** Maximum file size in bytes */\n maxSize?: number\n /** Allow multiple files */\n multiple?: boolean\n /** Callback when files are selected */\n onFilesChange?: (files: File[]) => void\n /** Error state */\n error?: boolean\n /** Disabled state */\n disabled?: boolean\n /** Custom class name */\n className?: string\n /** Placeholder text */\n placeholder?: string\n /** Description text (e.g., \"PNG, JPG up to 10MB\") */\n description?: string\n}\n\nconst FileUpload = React.forwardRef<HTMLDivElement, FileUploadProps>(\n (\n {\n accept,\n maxSize,\n multiple = false,\n onFilesChange,\n error,\n disabled,\n className,\n description,\n },\n ref\n ) => {\n const [isDragging, setIsDragging] = React.useState(false)\n const [files, setFiles] = React.useState<File[]>([])\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n const handleDragEnter = (e: React.DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n if (!disabled) setIsDragging(true)\n }\n\n const handleDragLeave = (e: React.DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragging(false)\n }\n\n const handleDragOver = (e: React.DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n }\n\n const validateFile = (file: File): boolean => {\n if (maxSize && file.size > maxSize) {\n return false\n }\n return true\n }\n\n const handleFiles = (newFiles: FileList | null) => {\n if (!newFiles) return\n\n const validFiles = Array.from(newFiles).filter(validateFile)\n const updatedFiles = multiple\n ? [...files, ...validFiles]\n : validFiles.slice(0, 1)\n\n setFiles(updatedFiles)\n onFilesChange?.(updatedFiles)\n }\n\n const handleDrop = (e: React.DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragging(false)\n\n if (disabled) return\n handleFiles(e.dataTransfer.files)\n }\n\n const handleClick = () => {\n if (!disabled) inputRef.current?.click()\n }\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n handleFiles(e.target.files)\n if (inputRef.current) inputRef.current.value = \"\"\n }\n\n const removeFile = (index: number) => {\n const updatedFiles = files.filter((_, i) => i !== index)\n setFiles(updatedFiles)\n onFilesChange?.(updatedFiles)\n }\n\n const formatFileSize = (bytes: number): string => {\n if (bytes < 1024) return `${bytes} B`\n if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`\n return `${Math.round(bytes / (1024 * 1024))} MB`\n }\n\n const formatAcceptedTypes = (acceptStr: string): string[] => {\n return acceptStr\n .split(\",\")\n .map((type) => type.trim())\n .map((type) => {\n // Handle wildcards like \"image/*\"\n if (type.includes(\"/*\")) {\n return type.replace(\"/*\", \"\").toUpperCase()\n }\n // Handle extensions like \".png\"\n if (type.startsWith(\".\")) {\n return type.slice(1).toUpperCase()\n }\n // Handle MIME types like \"image/png\"\n if (type.includes(\"/\")) {\n return type.split(\"/\")[1].toUpperCase()\n }\n return type.toUpperCase()\n })\n }\n\n return (\n <div ref={ref} className={cn(\"w-full\", className)}>\n <div\n onClick={handleClick}\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n className={cn(\n \"flex my-2 flex-col items-center justify-center gap-3 rounded-lg border border-border bg-background px-6 py-4 text-center transition-all cursor-pointer active:opacity-50\",\n isDragging && \"bg-secondary\",\n error\n ? \"border-destructive-foreground\"\n : \"border-border hover:bg-secondary\",\n disabled && \"cursor-not-allowed opacity-50\"\n )}\n >\n <span\n className={buttonVariants({\n variant: \"outline\",\n size: \"icon\",\n })}\n >\n <Upload size={16} className={cn(\"text-primary-accent\")} />\n </span>\n\n <div className=\"flex flex-col gap-1\">\n <p className=\"text-sm text-secondary-text\">\n <span className=\"text-primary-accent\">Click to upload</span> or\n drag and drop\n </p>\n {(accept || maxSize) && (\n <p className=\"text-xs text-secondary-text\">\n {accept && formatAcceptedTypes(accept).join(\", \")}\n {accept && maxSize && \" \"}\n {maxSize && `up to ${formatFileSize(maxSize)}`}\n </p>\n )}\n {description && (\n <p className=\"text-xs text-secondary-text\">{description}</p>\n )}\n </div>\n </div>\n\n <input\n ref={inputRef}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n onChange={handleInputChange}\n disabled={disabled}\n className=\"hidden\"\n />\n\n {files.length > 0 && (\n <div className=\"mt-3 space-y-2\">\n {files.map((file, index) => (\n <div\n key={`${file.name}-${index}`}\n className=\"flex items-center justify-between rounded-2xl border border-border bg-background px-4 py-2\"\n >\n <div className=\"flex items-center gap-3\">\n <File className=\"h-5 w-5 text-secondary-text\" />\n <div className=\"flex flex-col\">\n <span className=\"text-sm text-primary-accent truncate max-w-[200px]\">\n {file.name}\n </span>\n <span className=\"text-xs text-secondary-text\">\n {formatFileSize(file.size)}\n </span>\n </div>\n </div>\n <button\n type=\"button\"\n onClick={() => removeFile(index)}\n className=\"rounded-full p-1 hover:bg-secondary active:opacity-50 transition-colors\"\n >\n <X className=\"h-4 w-4 text-secondary-text\" />\n </button>\n </div>\n ))}\n </div>\n )}\n </div>\n )\n }\n)\nFileUpload.displayName = \"FileUpload\"\n\nexport { FileUpload }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-VBPIXXIA.js","../src/components/tabs.tsx"],"names":["Tabs","TabsList","forwardRef","className","props","ref","indicatorStyle","setIndicatorStyle","useState","listRef","useRef","useEffect","updateIndicator","activeTab","listRect","tabRect","observer","combinedRef","useCallback","node","jsxs","cn","jsx"],"mappings":"AAAA,uWAAY;AACZ,sDAAkC,8FCDH,8BAGsC,+CAsEjE,IApEEA,CAAAA,CAAqB,CAAA,CAAA,IAAA,CAErBC,CAAAA,aAAWC,+BAAAA,CAGd,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAAQ,CAClC,GAAM,CAACC,CAAAA,CAAgBC,CAAiB,CAAA,CAAIC,6BAAAA,CAC1C,IAAA,CAAM,CAAA,CACN,KAAA,CAAO,CACT,CAAC,CAAA,CACKC,CAAAA,CAAUC,2BAAAA,IAA2B,CAAA,CAE3CC,8BAAAA,CAAU,CAAA,EAAM,CACd,IAAMC,CAAAA,CAAkB,CAAA,CAAA,EAAM,CAC5B,EAAA,CAAI,CAACH,CAAAA,CAAQ,OAAA,CAAS,MAAA,CAEtB,IAAMI,CAAAA,CAAYJ,CAAAA,CAAQ,OAAA,CAAQ,aAAA,CAChC,uBACF,CAAA,CAEA,EAAA,CAAII,CAAAA,CAAW,CACb,IAAMC,CAAAA,CAAWL,CAAAA,CAAQ,OAAA,CAAQ,qBAAA,CA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M,CAAA,EAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-VBPIXXIA.js","sourcesContent":[null,"import * as TabsPrimitive from \"@radix-ui/react-tabs\"\n\nimport { cn } from \"@/lib/utils\"\nimport { forwardRef, useCallback, useEffect, useRef, useState } from \"react\"\n\nconst Tabs = TabsPrimitive.Root\n\nconst TabsList = forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const [indicatorStyle, setIndicatorStyle] = useState({\n left: 0,\n width: 0,\n })\n const listRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n const updateIndicator = () => {\n if (!listRef.current) return\n\n const activeTab = listRef.current.querySelector(\n '[data-state=\"active\"]'\n ) as HTMLElement\n\n if (activeTab) {\n const listRect = listRef.current.getBoundingClientRect()\n const tabRect = activeTab.getBoundingClientRect()\n\n setIndicatorStyle({\n left: tabRect.left - listRect.left,\n width: tabRect.width,\n })\n }\n }\n\n updateIndicator()\n\n // Use MutationObserver to detect when data-state changes\n const observer = new MutationObserver(updateIndicator)\n\n if (listRef.current) {\n observer.observe(listRef.current, {\n attributes: true,\n attributeFilter: [\"data-state\"],\n subtree: true,\n })\n }\n\n // Also update on window resize\n window.addEventListener(\"resize\", updateIndicator)\n\n return () => {\n observer.disconnect()\n window.removeEventListener(\"resize\", updateIndicator)\n }\n }, [])\n\n // Combine refs\n const combinedRef = useCallback(\n (node: HTMLDivElement | null) => {\n ;(listRef as React.MutableRefObject<HTMLDivElement | null>).current = node\n\n if (typeof ref === \"function\") {\n ref(node)\n } else if (ref) {\n ;(ref as React.MutableRefObject<HTMLDivElement | null>).current = node\n }\n },\n [ref]\n )\n\n return (\n <TabsPrimitive.List\n ref={combinedRef}\n className={cn(\n \"relative inline-flex items-center justify-center rounded-4xl bg-muted p-1 gap-1 text-muted-foreground\",\n className\n )}\n {...props}\n >\n {/* Animated indicator */}\n <span\n className=\"absolute h-[calc(100%-0.5rem)] rounded-4xl bg-background shadow-sm transition-all duration-200 ease-out\"\n style={{\n left: `${indicatorStyle.left}px`,\n width: `${indicatorStyle.width}px`,\n }}\n />\n {props.children}\n </TabsPrimitive.List>\n )\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"cursor-pointer relative inline-flex items-center justify-center whitespace-nowrap data-[state=inactive]:not-disabled:hover:bg-secondary rounded-4xl px-3 py-1 text-sm font-medium ring-offset-background transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=active]:text-foreground z-10\",\n className\n )}\n {...props}\n />\n))\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n className\n )}\n {...props}\n />\n))\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-WFD523CV.js","../src/components/PixelLoad.tsx"],"names":["isStaticImageData","src","getImageSrc","PixelLoad","alt","duration","steps","className","onAnimationComplete","objectFit","containerRef","useRef","canvasRef","status","setStatus","useState","dimensions","setDimensions","imageSrc","drawFull","useCallback","ctx","img","w","h","imgRatio","containerRatio","drawW","drawH","drawX","drawY","drawPixelated","pixelSize","sw","sh","runAnimation","minPixelSize","intervalMs","currentStep","animate","progress","useEffect","container","updateDimensions","width","height","resizeObserver","canvas","jsxs"],"mappings":"AAAA,ylBAAY;ACGZ,8BAA8D,+CAyM1D,SAzLKA,CAAAA,CAAkBC,CAAAA,CAAuC,CAChE,OAAO,OAAOA,CAAAA,EAAQ,QAAA,EAAY,KAAA,GAASA,CAC7C,CAEA,SAASC,CAAAA,CAAYD,CAAAA,CAAuB,CAC1C,OAAOD,CAAAA,CAAkBC,CAAG,CAAA,CAAIA,CAAAA,CAAI,GAAA,CAAMA,CAC5C,CAEO,SAASE,CAAAA,CAAU,CACxB,GAAA,CAAAF,CAAAA,CACA,GAAA,CAAAG,CAAAA,CACA,QAAA,CAAAC,CAAAA,CAAW,GAAA,CACX,KAAA,CAAAC,CAAAA,CAAQ,EAAA,CACR,SAAA,CAAAC,CAAAA,CACA,mBAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,OACd,CAAA,CAAgC,CAC9B,IAAMC,CAAAA,CAAeC,2BAAAA,IAA2B,CAAA,CAC1CC,CAAAA,CAAYD,2BAAAA,IAA8B,CAAA,CAC1C,CAACE,CAAAA,CAAQC,CAAS,CAAA,CAAIC,6BAAAA,SAAmC,CAAA,CACzD,CAACC,CAAAA,CAAYC,CAAa,CAAA,CAAIF,6BAAAA,IAGtB,CAAA,CAERG,CAAAA,CAAWhB,CAAAA,CAAYD,CAAG,CAAA,CAE1BkB,CAAAA,CAAWC,gCAAAA,CAEbC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CAAAA,EACS,CACTH,CAAAA,CAAI,qBAAA,CAAwB,CAAA,CAAA,CAC5BA,CAAAA,CAAI,SAAA,CAAU,CAAA,CAAG,CAAA,CAAGE,CAAAA,CAAGC,CAAC,CAAA,CAExB,IAAMC,CAAAA,CAAWH,CAAAA,CAAI,YAAA,CAAeA,CAAAA,CAA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BAAA,EAA0BH,CAAAA,EAAa,EAAE,CAAA,CAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-WFD523CV.js","sourcesContent":[null,"\"use client\"\n\nimport { type StaticImageData } from \"next/image\"\nimport { JSX, useCallback, useEffect, useRef, useState } from \"react\"\n\ntype PixelLoadStatus = \"loading\" | \"animating\" | \"complete\"\n\ntype ImageSrc = string | StaticImageData\n\nexport interface PixelLoadProps {\n src: ImageSrc\n alt: string\n duration?: number\n steps?: number\n className?: string\n onAnimationComplete?: () => void\n objectFit?: \"contain\" | \"cover\" | \"fill\" | \"none\" | \"scale-down\"\n}\n\nfunction isStaticImageData(src: ImageSrc): src is StaticImageData {\n return typeof src === \"object\" && \"src\" in src\n}\n\nfunction getImageSrc(src: ImageSrc): string {\n return isStaticImageData(src) ? src.src : src\n}\n\nexport function PixelLoad({\n src,\n alt,\n duration = 600,\n steps = 15,\n className,\n onAnimationComplete,\n objectFit = \"cover\",\n}: PixelLoadProps): JSX.Element {\n const containerRef = useRef<HTMLDivElement>(null)\n const canvasRef = useRef<HTMLCanvasElement>(null)\n const [status, setStatus] = useState<PixelLoadStatus>(\"loading\")\n const [dimensions, setDimensions] = useState<{\n width: number\n height: number\n } | null>(null)\n\n const imageSrc = getImageSrc(src)\n\n const drawFull = useCallback(\n (\n ctx: CanvasRenderingContext2D,\n img: HTMLImageElement,\n w: number,\n h: number\n ): void => {\n ctx.imageSmoothingEnabled = true\n ctx.clearRect(0, 0, w, h)\n\n const imgRatio = img.naturalWidth / img.naturalHeight\n const containerRatio = w / h\n\n let drawW: number\n let drawH: number\n let drawX: number\n let drawY: number\n\n if (objectFit === \"contain\") {\n if (imgRatio > containerRatio) {\n drawW = w\n drawH = w / imgRatio\n } else {\n drawH = h\n drawW = h * imgRatio\n }\n drawX = (w - drawW) / 2\n drawY = (h - drawH) / 2\n } else {\n if (imgRatio > containerRatio) {\n drawH = h\n drawW = h * imgRatio\n } else {\n drawW = w\n drawH = w / imgRatio\n }\n drawX = (w - drawW) / 2\n drawY = (h - drawH) / 2\n }\n\n ctx.drawImage(img, drawX, drawY, drawW, drawH)\n },\n [objectFit]\n )\n\n const drawPixelated = useCallback(\n (\n ctx: CanvasRenderingContext2D,\n img: HTMLImageElement,\n pixelSize: number,\n w: number,\n h: number\n ): void => {\n ctx.imageSmoothingEnabled = false\n\n const sw = Math.max(1, Math.floor(w / pixelSize))\n const sh = Math.max(1, Math.floor(h / pixelSize))\n\n ctx.clearRect(0, 0, w, h)\n ctx.drawImage(img, 0, 0, sw, sh)\n ctx.drawImage(canvasRef.current!, 0, 0, sw, sh, 0, 0, w, h)\n },\n []\n )\n\n const runAnimation = useCallback(\n (\n ctx: CanvasRenderingContext2D,\n img: HTMLImageElement,\n w: number,\n h: number\n ): void => {\n const minPixelSize = Math.max(w, h) / 4\n const intervalMs = duration / steps\n let currentStep = 0\n\n setStatus(\"animating\")\n\n const animate = (): void => {\n const progress = currentStep / steps\n const pixelSize = Math.max(1, Math.floor(minPixelSize * (1 - progress)))\n\n if (pixelSize <= 1) {\n drawFull(ctx, img, w, h)\n } else {\n drawPixelated(ctx, img, pixelSize, w, h)\n }\n\n currentStep++\n\n if (currentStep <= steps) {\n window.setTimeout(animate, intervalMs)\n } else {\n drawFull(ctx, img, w, h)\n setStatus(\"complete\")\n onAnimationComplete?.()\n }\n }\n\n animate()\n },\n [duration, steps, drawPixelated, drawFull, onAnimationComplete]\n )\n\n useEffect(() => {\n const container = containerRef.current\n if (!container) return\n\n const updateDimensions = (): void => {\n const { width, height } = container.getBoundingClientRect()\n setDimensions({ width: Math.floor(width), height: Math.floor(height) })\n }\n\n const resizeObserver = new ResizeObserver(updateDimensions)\n resizeObserver.observe(container)\n updateDimensions()\n\n return (): void => {\n resizeObserver.disconnect()\n }\n }, [])\n\n useEffect(() => {\n if (!dimensions) return\n\n if (dimensions.width <= 0 || dimensions.height <= 0) return\n\n const canvas = canvasRef.current\n if (!canvas) return\n\n const ctx = canvas.getContext(\"2d\")\n if (!ctx) return\n\n canvas.width = dimensions.width\n canvas.height = dimensions.height\n\n const img = new window.Image()\n img.crossOrigin = \"anonymous\"\n\n img.onload = (): void => {\n const minPixelSize = Math.max(dimensions.width, dimensions.height) / 4\n drawPixelated(ctx, img, minPixelSize, dimensions.width, dimensions.height)\n runAnimation(ctx, img, dimensions.width, dimensions.height)\n }\n\n img.onerror = (): void => {\n console.error(\"PixelLoad: Failed to load image\")\n }\n\n img.src = imageSrc\n\n return (): void => {\n img.onload = null\n img.onerror = null\n }\n }, [imageSrc, dimensions, runAnimation, drawPixelated])\n\n return (\n <div\n ref={containerRef}\n className={`relative w-full h-full ${className || \"\"}`}\n >\n <canvas\n ref={canvasRef}\n className=\"absolute top-0 left-0 w-full h-full\"\n style={{ objectFit }}\n role=\"img\"\n aria-label={alt}\n />\n {status === \"complete\" && (\n <img\n src={imageSrc}\n alt={alt}\n className=\"sr-only\"\n aria-hidden\n />\n )}\n </div>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-WFD523CV.js","../src/components/PixelLoad.tsx"],"names":["isStaticImageData","src","getImageSrc","PixelLoad","alt","duration","steps","className","onAnimationComplete","objectFit","containerRef","useRef","canvasRef","status","setStatus","useState","dimensions","setDimensions","imageSrc","drawFull","useCallback","ctx","img","w","h","imgRatio","containerRatio","drawW","drawH","drawX","drawY","drawPixelated","pixelSize","sw","sh","runAnimation","minPixelSize","intervalMs","currentStep","animate","progress","useEffect","container","updateDimensions","width","height","resizeObserver","canvas","jsxs"],"mappings":"AAAA,ylBAAY;ACGZ,8BAA8D,+CAyM1D,SAzLKA,CAAAA,CAAkBC,CAAAA,CAAuC,CAChE,OAAO,OAAOA,CAAAA,EAAQ,QAAA,EAAY,KAAA,GAASA,CAC7C,CAEA,SAASC,CAAAA,CAAYD,CAAAA,CAAuB,CAC1C,OAAOD,CAAAA,CAAkBC,CAAG,CAAA,CAAIA,CAAA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AAA,CACvB,OAAAA,CAAAA,CAAI,WAAA,CAAc,WAAA,CAElBA,CAAAA,CAAI,MAAA,CAAS,CAAA,CAAA,EAAY,CACvB,IAAMc,CAAAA,CAAe,IAAA,CAAK,GAAA,CAAIpB,CAAAA,CAAW,KAAA,CAAOA,CAAAA,CAAW,MAAM,CAAA,CAAI,CAAA,CACrEe,CAAAA,CAAcV,CAAAA,CAAKC,CAAAA,CAAKc,CAAAA,CAAcpB,CAAAA,CAAW,KAAA,CAAOA,CAAAA,CAAW,MAAM,CAAA,CACzEmB,CAAAA,CAAad,CAAAA,CAAKC,CAAAA,CAAKN,CAAAA,CAAW,KAAA,CAAOA,CAAAA,CAAW,MAAM,CAC5D,CAAA,CAEAM,CAAAA,CAAI,OAAA,CAAU,CAAA,CAAA,EAAY,CACxB,OAAA,CAAQ,KAAA,CAAM,iCAAiC,CACjD,CAAA,CAEAA,CAAAA,CAAI,GAAA,CAAMJ,CAAAA,CAEH,CAAA,CAAA,EAAY,CACjBI,CAAAA,CAAI,MAAA,CAAS,IAAA,CACbA,CAAAA,CAAI,OAAA,CAAU,IAChB,CACF,CAAA,CAAG,CAACJ,CAAAA,CAAUF,CAAAA,CAAYmB,CAAAA,CAAcJ,CAAa,CAAC,CAAA,CAGpDiB,8BAAAA,KAAC,CAAA,CACC,GAAA,CAAKtC,CAAAA,CACL,SAAA,CAAW,CAAA,uBAAA,EAA0BH,CAAAA,EAAa,EAAE,CAAA,CAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-WFD523CV.js","sourcesContent":[null,"\"use client\"\n\nimport { type StaticImageData } from \"next/image\"\nimport { JSX, useCallback, useEffect, useRef, useState } from \"react\"\n\ntype PixelLoadStatus = \"loading\" | \"animating\" | \"complete\"\n\ntype ImageSrc = string | StaticImageData\n\nexport interface PixelLoadProps {\n src: ImageSrc\n alt: string\n duration?: number\n steps?: number\n className?: string\n onAnimationComplete?: () => void\n objectFit?: \"contain\" | \"cover\" | \"fill\" | \"none\" | \"scale-down\"\n}\n\nfunction isStaticImageData(src: ImageSrc): src is StaticImageData {\n return typeof src === \"object\" && \"src\" in src\n}\n\nfunction getImageSrc(src: ImageSrc): string {\n return isStaticImageData(src) ? src.src : src\n}\n\nexport function PixelLoad({\n src,\n alt,\n duration = 600,\n steps = 15,\n className,\n onAnimationComplete,\n objectFit = \"cover\",\n}: PixelLoadProps): JSX.Element {\n const containerRef = useRef<HTMLDivElement>(null)\n const canvasRef = useRef<HTMLCanvasElement>(null)\n const [status, setStatus] = useState<PixelLoadStatus>(\"loading\")\n const [dimensions, setDimensions] = useState<{\n width: number\n height: number\n } | null>(null)\n\n const imageSrc = getImageSrc(src)\n\n const drawFull = useCallback(\n (\n ctx: CanvasRenderingContext2D,\n img: HTMLImageElement,\n w: number,\n h: number\n ): void => {\n ctx.imageSmoothingEnabled = true\n ctx.clearRect(0, 0, w, h)\n\n const imgRatio = img.naturalWidth / img.naturalHeight\n const containerRatio = w / h\n\n let drawW: number\n let drawH: number\n let drawX: number\n let drawY: number\n\n if (objectFit === \"contain\") {\n if (imgRatio > containerRatio) {\n drawW = w\n drawH = w / imgRatio\n } else {\n drawH = h\n drawW = h * imgRatio\n }\n drawX = (w - drawW) / 2\n drawY = (h - drawH) / 2\n } else {\n if (imgRatio > containerRatio) {\n drawH = h\n drawW = h * imgRatio\n } else {\n drawW = w\n drawH = w / imgRatio\n }\n drawX = (w - drawW) / 2\n drawY = (h - drawH) / 2\n }\n\n ctx.drawImage(img, drawX, drawY, drawW, drawH)\n },\n [objectFit]\n )\n\n const drawPixelated = useCallback(\n (\n ctx: CanvasRenderingContext2D,\n img: HTMLImageElement,\n pixelSize: number,\n w: number,\n h: number\n ): void => {\n ctx.imageSmoothingEnabled = false\n\n const sw = Math.max(1, Math.floor(w / pixelSize))\n const sh = Math.max(1, Math.floor(h / pixelSize))\n\n ctx.clearRect(0, 0, w, h)\n ctx.drawImage(img, 0, 0, sw, sh)\n ctx.drawImage(canvasRef.current!, 0, 0, sw, sh, 0, 0, w, h)\n },\n []\n )\n\n const runAnimation = useCallback(\n (\n ctx: CanvasRenderingContext2D,\n img: HTMLImageElement,\n w: number,\n h: number\n ): void => {\n const minPixelSize = Math.max(w, h) / 4\n const intervalMs = duration / steps\n let currentStep = 0\n\n setStatus(\"animating\")\n\n const animate = (): void => {\n const progress = currentStep / steps\n const pixelSize = Math.max(1, Math.floor(minPixelSize * (1 - progress)))\n\n if (pixelSize <= 1) {\n drawFull(ctx, img, w, h)\n } else {\n drawPixelated(ctx, img, pixelSize, w, h)\n }\n\n currentStep++\n\n if (currentStep <= steps) {\n window.setTimeout(animate, intervalMs)\n } else {\n drawFull(ctx, img, w, h)\n setStatus(\"complete\")\n onAnimationComplete?.()\n }\n }\n\n animate()\n },\n [duration, steps, drawPixelated, drawFull, onAnimationComplete]\n )\n\n useEffect(() => {\n const container = containerRef.current\n if (!container) return\n\n const updateDimensions = (): void => {\n const { width, height } = container.getBoundingClientRect()\n setDimensions({ width: Math.floor(width), height: Math.floor(height) })\n }\n\n const resizeObserver = new ResizeObserver(updateDimensions)\n resizeObserver.observe(container)\n updateDimensions()\n\n return (): void => {\n resizeObserver.disconnect()\n }\n }, [])\n\n useEffect(() => {\n if (!dimensions) return\n\n if (dimensions.width <= 0 || dimensions.height <= 0) return\n\n const canvas = canvasRef.current\n if (!canvas) return\n\n const ctx = canvas.getContext(\"2d\")\n if (!ctx) return\n\n canvas.width = dimensions.width\n canvas.height = dimensions.height\n\n const img = new window.Image()\n img.crossOrigin = \"anonymous\"\n\n img.onload = (): void => {\n const minPixelSize = Math.max(dimensions.width, dimensions.height) / 4\n drawPixelated(ctx, img, minPixelSize, dimensions.width, dimensions.height)\n runAnimation(ctx, img, dimensions.width, dimensions.height)\n }\n\n img.onerror = (): void => {\n console.error(\"PixelLoad: Failed to load image\")\n }\n\n img.src = imageSrc\n\n return (): void => {\n img.onload = null\n img.onerror = null\n }\n }, [imageSrc, dimensions, runAnimation, drawPixelated])\n\n return (\n <div\n ref={containerRef}\n className={`relative w-full h-full ${className || \"\"}`}\n >\n <canvas\n ref={canvasRef}\n className=\"absolute top-0 left-0 w-full h-full\"\n style={{ objectFit }}\n role=\"img\"\n aria-label={alt}\n />\n {status === \"complete\" && (\n <img\n src={imageSrc}\n alt={alt}\n className=\"sr-only\"\n aria-hidden\n />\n )}\n </div>\n )\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-WYRD4UAK.js","../src/components/checkbox.tsx"],"names":["Checkbox","className","props","ref","jsx","cn","jsxs","Check","Minus"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECChB,0GACY,2CACN,+CAgBzB,IAZEA,CAAAA,CAAiB,CAAA,CAAA,UAAA,CAGrB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC1BC,6BAAAA,CAAmB,CAAA,IAAA,CAAlB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,gCAAAA,8fACT,CACAJ,CACF,CAAA,CACC,GAAGC,CAAAA,CAEJ,QAAA,CAAAI,8BAAAA,CAAmB,CAAA,SAAA,CAAlB,CACC,SAAA,CAAWD,gCAAAA,+CAAkD,CAAA,CAE7D,QAAA,CAAA,CAAAD,6BAAAA,kBAACG,CAAA,CAAM,SAAA,CAAU,iDAAA,CAAkD,CAAA,CACnEH,6BAAAA,kBAACI,CAAA,CAAM,SAAA,CAAU,uDAAA,CAAwD,CAAA,CAAA,CAC3E,CAAA,CACF,CACD,CAAA,CACDR,CAAAA,CAAS,WAAA,CAAgC,CAAA,CAAA,IAAA,CAAK,WAAA,CAAA,cAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-WYRD4UAK.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\"\nimport { Check, Minus } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Checkbox = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"group peer h-4 w-4 bg-background shrink-0 rounded-xs border border-accent-muted ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent data-[state=checked]:border-accent data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-accent data-[state=indeterminate]:border-accent data-[state=indeterminate]:text-primary-foreground\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\"flex items-center justify-center text-current\")}\n >\n <Check className=\"h-4 w-4 group-data-[state=indeterminate]:hidden\" />\n <Minus className=\"h-4 w-4 hidden group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\nCheckbox.displayName = CheckboxPrimitive.Root.displayName\n\nexport { Checkbox }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-XQILGD5B.js","../src/components/button.tsx"],"names":["buttonVariants","cva","Button","className","variant","size","asChild","loading","icon","props","ref","jsxs","Slot","cn","jsx"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECDhB,iDACF,kEACkB,+CAwDjC,IApDAA,CAAAA,CAAiBC,yCAAAA,+SACrB,CACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,OAAA,CACE,+DAAA,CACF,WAAA,CAAa,wCAAA,CACb,OAAA,CAAS,8DAAA,CACT,SAAA,CAAW,gDAAA,CACX,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sourcesContent":[null,"import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center cursor-pointer justify-center whitespace-nowrap rounded-4xl font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary-accent text-primary-foreground hover:bg-primary/90\",\n destructive: \"bg-destructive hover:bg-destructive/90\",\n outline: \"border border-input hover:bg-base-accent text-primary-accent\",\n secondary: \"bg-muted text-primary-accent hover:bg-muted/20\",\n ghost: \"hover:bg-base-accent text-primary-accent\",\n link: \"text-primary-accent underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 text-sm\",\n sm: \"h-8 text-xs px-3 py-2\",\n lg: \"h-10 px-8 py-2 text-sm\",\n icon: \"h-9 w-9\",\n none: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n loading?: boolean\n icon?: React.ReactNode\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n loading = false,\n icon,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={loading || props.disabled}\n {...props}\n >\n {loading && (\n <div className=\"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent\" />\n )}\n {!loading && icon && <span className=\"mr-2\">{icon}</span>}\n {props.children}\n </Comp>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-XYO4VLMF.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-XYO4VLMF.js"}
|