@cryptlex/web-components 1.3.2 → 1.3.4
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/components/data-table/column-picker.es.js +78 -0
- package/dist/components/data-table/column-picker.es.js.map +1 -0
- package/dist/components/data-table/data-table.es.js +197 -0
- package/dist/components/data-table/data-table.es.js.map +1 -0
- package/dist/components/data-table/page-size.es.js +23 -0
- package/dist/components/data-table/page-size.es.js.map +1 -0
- package/dist/components/data-table/paginator.es.js +63 -0
- package/dist/components/data-table/paginator.es.js.map +1 -0
- package/dist/components/data-table/table-actions.es.js +78 -0
- package/dist/components/data-table/table-actions.es.js.map +1 -0
- package/dist/components/data-table/table-commons.es.js +52 -0
- package/dist/components/data-table/table-commons.es.js.map +1 -0
- package/dist/components/data-table/table-content.es.js +46 -0
- package/dist/components/data-table/table-content.es.js.map +1 -0
- package/dist/components/data-table/table-utils/constants.es.js +274 -0
- package/dist/components/data-table/table-utils/constants.es.js.map +1 -0
- package/dist/components/data-table/table-utils/createTableFetchFn.es.js +24 -0
- package/dist/components/data-table/table-utils/createTableFetchFn.es.js.map +1 -0
- package/dist/components/data-table/table-utils/date.es.js +12 -0
- package/dist/components/data-table/table-utils/date.es.js.map +1 -0
- package/dist/components/data-table/table-utils/link-display.es.js +21 -0
- package/dist/components/data-table/table-utils/link-display.es.js.map +1 -0
- package/dist/components/data-table/table-utils/string.es.js +19 -0
- package/dist/components/data-table/table-utils/string.es.js.map +1 -0
- package/dist/components/data-table/table-utils/types.es.js +5 -0
- package/dist/components/data-table/table-utils/types.es.js.map +1 -0
- package/dist/components/info-card/info-card.es.js +71 -0
- package/dist/components/info-card/info-card.es.js.map +1 -0
- package/dist/components/sidebar/app-layout.es.js +83 -0
- package/dist/components/sidebar/app-layout.es.js.map +1 -0
- package/dist/components/sidebar/nav-main.es.js +76 -0
- package/dist/components/sidebar/nav-main.es.js.map +1 -0
- package/dist/components/sidebar/sidebar.es.js +10 -0
- package/dist/components/sidebar/sidebar.es.js.map +1 -0
- package/dist/components/static-data-table/data-table.es.js +30 -0
- package/dist/components/static-data-table/data-table.es.js.map +1 -0
- package/dist/components/ui/avatar.es.js +12 -14
- package/dist/components/ui/avatar.es.js.map +1 -1
- package/dist/components/ui/button.es.js +12 -22
- package/dist/components/ui/button.es.js.map +1 -1
- package/dist/components/ui/chart.es.js +40 -51
- package/dist/components/ui/chart.es.js.map +1 -1
- package/dist/components/ui/collapsible.es.js +1 -0
- package/dist/components/ui/collapsible.es.js.map +1 -1
- package/dist/components/ui/dialog.es.js +23 -22
- package/dist/components/ui/dialog.es.js.map +1 -1
- package/dist/components/ui/drawer.es.js +16 -48
- package/dist/components/ui/drawer.es.js.map +1 -1
- package/dist/components/ui/form.es.js +28 -29
- package/dist/components/ui/form.es.js.map +1 -1
- package/dist/components/ui/mutli-select.es.js +195 -0
- package/dist/components/ui/mutli-select.es.js.map +1 -0
- package/dist/components/ui/password-input.es.js +9 -8
- package/dist/components/ui/password-input.es.js.map +1 -1
- package/dist/components/ui/search-input.es.js +42 -0
- package/dist/components/ui/search-input.es.js.map +1 -0
- package/dist/components/ui/select.es.js +4 -9
- package/dist/components/ui/select.es.js.map +1 -1
- package/dist/components/ui/separator.es.js +17 -18
- package/dist/components/ui/separator.es.js.map +1 -1
- package/dist/components/ui/sheet.es.js +12 -37
- package/dist/components/ui/sheet.es.js.map +1 -1
- package/dist/components/ui/sidebar.es.js +286 -264
- package/dist/components/ui/sidebar.es.js.map +1 -1
- package/dist/components/ui/sonner.es.js +3 -2
- package/dist/components/ui/sonner.es.js.map +1 -1
- package/dist/components/ui/table-page-layout.es.js +14 -0
- package/dist/components/ui/table-page-layout.es.js.map +1 -0
- package/dist/components/ui/tooltip.es.js +9 -8
- package/dist/components/ui/tooltip.es.js.map +1 -1
- package/dist/index.es.d.ts +248 -2
- package/dist/index.es.js +247 -200
- package/dist/index.es.js.map +1 -1
- package/dist/utils/index.es.js +13 -8
- package/dist/utils/index.es.js.map +1 -1
- package/package.json +13 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutli-select.es.js","sources":["../../../lib/components/ui/mutli-select.tsx"],"sourcesContent":["'use client';\nimport { Badge } from '@/components/ui/badge';\nimport { Button } from '@/components/ui/button';\nimport {\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n} from '@/components/ui/command';\nimport { Separator } from '@/index';\nimport { cn } from '@/utils';\nimport { Popover, PopoverContent, PopoverTrigger } from '@radix-ui/react-popover';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { CheckIcon, ChevronDown, Command, XIcon } from 'lucide-react';\nimport * as React from 'react';\n\nconst multiSelectVariants = cva(\n 'm-1 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300',\n {\n variants: {\n variant: {\n default: 'border-foreground/10 drop-shadow-md text-foreground bg-card hover:bg-card/80',\n secondary:\n 'border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80',\n destructive:\n 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',\n inverted: 'inverted',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\ninterface MultiSelectFormFieldProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof multiSelectVariants> {\n asChild?: boolean;\n options: {\n label: string;\n value: string;\n icon?: React.ComponentType<{ className?: string }>;\n }[];\n defaultValue?: string[];\n disabled?: boolean;\n placeholder: string;\n className?: string;\n animation?: number;\n onValueChange: (value: string[]) => void;\n}\n\nconst MultiSelectFormField = React.forwardRef<HTMLButtonElement, MultiSelectFormFieldProps>(\n (\n {\n className,\n variant,\n asChild = false,\n options,\n defaultValue,\n onValueChange,\n disabled,\n placeholder,\n animation = 0,\n ...props\n },\n ref,\n ) => {\n const [selectedValues, setSelectedValues] = React.useState<string[]>(defaultValue || []);\n const selectedValuesSet = React.useRef(new Set(selectedValues));\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n\n React.useEffect(() => {\n setSelectedValues(defaultValue || []);\n selectedValuesSet.current = new Set(defaultValue);\n }, [defaultValue]);\n\n const handleInputKeyDown = (event: any) => {\n if (event.key === 'Enter') {\n setIsPopoverOpen(true);\n } else if (event.key === 'Backspace' && !event.target.value) {\n selectedValues.pop();\n setSelectedValues([...selectedValues]);\n selectedValuesSet.current.delete(selectedValues[selectedValues.length - 1]);\n onValueChange([...selectedValues]);\n }\n };\n\n const toggleOption = (value: string) => {\n if (selectedValuesSet.current.has(value)) {\n selectedValuesSet.current.delete(value);\n setSelectedValues(selectedValues.filter((v) => v !== value));\n } else {\n selectedValuesSet.current.add(value);\n setSelectedValues([...selectedValues, value]);\n }\n onValueChange(Array.from(selectedValuesSet.current));\n };\n\n return (\n <Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen}>\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n {...props}\n onClick={() => setIsPopoverOpen(!isPopoverOpen)}\n className=\"flex w-full p-1 rounded-md border min-h-10 h-auto items-center justify-between bg-inherit hover:bg-card\"\n >\n {selectedValues.length > 0 ? (\n <div className=\"flex justify-between items-center w-full\">\n <div className=\"flex flex-wrap items-center\">\n {selectedValues.map((value) => {\n const option = options.find((o) => o.value === value);\n const IconComponent = option?.icon;\n return (\n <Badge key={value}>\n {IconComponent && <IconComponent className=\"h-6 w-6 mr-2\" />}\n {option?.label}\n </Badge>\n );\n })}\n </div>\n <div className=\"flex items-center justify-between\">\n <XIcon\n className=\"h-4 mx-2 cursor-pointer text-muted-foreground\"\n onClick={(event) => {\n setSelectedValues([]);\n selectedValuesSet.current.clear();\n onValueChange([]);\n event.stopPropagation();\n }}\n />\n <Separator orientation=\"vertical\" className=\"flex min-h-6 h-full\" />\n <ChevronDown className=\"h-4 mx-2 cursor-pointer text-muted-foreground\" />\n </div>\n </div>\n ) : (\n <div className=\"flex items-center justify-between w-full mx-auto\">\n <span className=\"text-sm text-muted-foreground mx-3\">{placeholder}</span>\n <ChevronDown className=\"h-4 cursor-pointer text-muted-foreground mx-2\" />\n </div>\n )}\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className=\"w-[200px] p-0 drop-shadow-sm\"\n align=\"start\"\n onEscapeKeyDown={() => setIsPopoverOpen(false)}\n >\n <Command>\n <CommandInput placeholder=\"Search...\" onKeyDown={handleInputKeyDown} />\n <CommandList>\n <CommandEmpty>No results found.</CommandEmpty>\n <CommandGroup>\n {options.map((option) => {\n const isSelected = selectedValuesSet.current.has(option.value);\n return (\n <CommandItem\n key={option.value}\n onSelect={() => toggleOption(option.value)}\n style={{\n pointerEvents: 'auto',\n opacity: 1,\n }}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\n 'mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary',\n isSelected\n ? 'bg-primary text-primary-foreground'\n : 'opacity-50 [&_svg]:invisible',\n )}\n >\n <CheckIcon className=\"h-4 w-4\" />\n </div>\n {option.icon && (\n <option.icon className=\"mr-2 h-4 w-4 text-muted-foreground\" />\n )}\n <span>{option.label}</span>\n </CommandItem>\n );\n })}\n </CommandGroup>\n <CommandSeparator />\n <CommandGroup>\n <div className=\"flex items-center justify-between\">\n {selectedValues.length > 0 && (\n <>\n <CommandItem\n onSelect={() => {\n setSelectedValues([]);\n selectedValuesSet.current.clear();\n onValueChange([]);\n }}\n style={{\n pointerEvents: 'auto',\n opacity: 1,\n }}\n className=\"flex-1 justify-center cursor-pointer\"\n >\n Clear\n </CommandItem>\n <Separator orientation=\"vertical\" className=\"flex min-h-6 h-full\" />\n </>\n )}\n <CommandSeparator />\n <CommandItem\n onSelect={() => setIsPopoverOpen(false)}\n style={{\n pointerEvents: 'auto',\n opacity: 1,\n }}\n className=\"flex-1 justify-center cursor-pointer\"\n >\n Close\n </CommandItem>\n </div>\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nMultiSelectFormField.displayName = 'MultiSelectFormField';\n\nexport default MultiSelectFormField;\n"],"names":["cva","MultiSelectFormField","React","className","variant","asChild","options","defaultValue","onValueChange","disabled","placeholder","animation","props","ref","selectedValues","setSelectedValues","selectedValuesSet","isPopoverOpen","setIsPopoverOpen","handleInputKeyDown","event","toggleOption","value","v","jsxs","Popover","jsx","PopoverTrigger","Button","option","o","IconComponent","Badge","XIcon","Separator","ChevronDown","PopoverContent","Command","CommandInput","CommandList","CommandEmpty","CommandGroup","isSelected","CommandItem","cn","CheckIcon","CommandSeparator","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkB4BA;AAAA,EAC1B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,WACE;AAAA,QACF,aACE;AAAA,QACF,UAAU;AAAA,MAAA;AAAA,IAEd;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AAmBA,MAAMC,IAAuBC,EAAM;AAAA,EACjC,CACE;AAAA,IACE,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,GAAGC;AAAA,KAELC,MACG;AACG,UAAA,CAACC,GAAgBC,CAAiB,IAAIb,EAAM,SAAmBK,KAAgB,EAAE,GACjFS,IAAoBd,EAAM,OAAO,IAAI,IAAIY,CAAc,CAAC,GACxD,CAACG,GAAeC,CAAgB,IAAIhB,EAAM,SAAS,EAAK;AAE9D,IAAAA,EAAM,UAAU,MAAM;AACF,MAAAa,EAAAR,KAAgB,EAAE,GAClBS,EAAA,UAAU,IAAI,IAAIT,CAAY;AAAA,IAAA,GAC/C,CAACA,CAAY,CAAC;AAEX,UAAAY,IAAqB,CAACC,MAAe;AACrC,MAAAA,EAAM,QAAQ,UAChBF,EAAiB,EAAI,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B,EAAK;AAAA,oBACtC,OAAO;AAAA,sBACL,eAAe;AAAA,sBACf,SAAS;AAAA,oBACX;AAAA,oBACA,WAAU;AAAA,oBACX,UAAA;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAED,EAAA,CACF,EACF,CAAA;AAAA,YAAA,EACF,CAAA;AAAA,UAAA,EACF,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,GACF;AAAA,EAAA;AAGN;AAEAjB,EAAqB,cAAc;"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
3
|
import * as o from "react";
|
|
3
4
|
import { EyeIcon as d, EyeOffIcon as m } from "lucide-react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
({ className:
|
|
5
|
+
import { Button as i } from "./button.es.js";
|
|
6
|
+
import { Input as u } from "./input.es.js";
|
|
7
|
+
const c = o.forwardRef(
|
|
8
|
+
({ className: l, ...r }, s) => {
|
|
8
9
|
const [t, a] = o.useState(!1);
|
|
9
10
|
return /* @__PURE__ */ n("div", { className: "flex flex-row items-center relative", children: [
|
|
10
|
-
/* @__PURE__ */ e(
|
|
11
|
+
/* @__PURE__ */ e(u, { type: t ? "text" : "password", ref: s, ...r }),
|
|
11
12
|
/* @__PURE__ */ e(
|
|
12
|
-
|
|
13
|
+
i,
|
|
13
14
|
{
|
|
14
15
|
type: "button",
|
|
15
16
|
className: "absolute right-0 top-0 rounded-md bg-transparent p-2 text-muted-foreground hover:bg-muted/5 focus:outline-none",
|
|
@@ -20,8 +21,8 @@ const u = o.forwardRef(
|
|
|
20
21
|
] });
|
|
21
22
|
}
|
|
22
23
|
);
|
|
23
|
-
|
|
24
|
+
c.displayName = "PasswordInput";
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
c as PasswordInput
|
|
26
27
|
};
|
|
27
28
|
//# sourceMappingURL=password-input.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-input.es.js","sources":["../../../lib/components/ui/password-input.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"password-input.es.js","sources":["../../../lib/components/ui/password-input.tsx"],"sourcesContent":["'use client';\nimport * as React from 'react';\n\nimport { EyeIcon, EyeOffIcon } from 'lucide-react';\nimport { Button } from './button';\nimport { Input, InputProps } from './input';\n\nconst PasswordInput = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, ...props }, ref) => {\n const [showPassword, setShowPassword] = React.useState<boolean>(false);\n return (\n <div className=\"flex flex-row items-center relative\">\n <Input type={showPassword ? 'text' : 'password'} ref={ref} {...props} />\n <Button\n type=\"button\"\n className=\"absolute right-0 top-0 rounded-md bg-transparent p-2 text-muted-foreground hover:bg-muted/5 focus:outline-none\"\n onClick={() => setShowPassword(!showPassword)}\n >\n {!showPassword ? (\n <EyeIcon className=\"h-4 w-4\" aria-hidden=\"true\" />\n ) : (\n <EyeOffIcon className=\"h-4 w-4\" aria-hidden=\"true\" />\n )}\n </Button>\n </div>\n );\n },\n);\nPasswordInput.displayName = 'PasswordInput';\n\nexport { PasswordInput };\n"],"names":["PasswordInput","React","className","props","ref","showPassword","setShowPassword","jsxs","jsx","Input","Button","EyeOffIcon","EyeIcon"],"mappings":";;;;;;AAOA,MAAMA,IAAgBC,EAAM;AAAA,EAC1B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAAQ;AAChC,UAAM,CAACC,GAAcC,CAAe,IAAIL,EAAM,SAAkB,EAAK;AAEnE,WAAA,gBAAAM,EAAC,OAAI,EAAA,WAAU,uCACb,UAAA;AAAA,MAAA,gBAAAC,EAACC,KAAM,MAAMJ,IAAe,SAAS,YAAY,KAAAD,GAAW,GAAGD,GAAO;AAAA,MACtE,gBAAAK;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACV,SAAS,MAAMJ,EAAgB,CAACD,CAAY;AAAA,UAE3C,UAACA,IAGC,gBAAAG,EAAAG,GAAA,EAAW,WAAU,WAAU,eAAY,OAAO,CAAA,IAFlD,gBAAAH,EAAAI,GAAA,EAAQ,WAAU,WAAU,eAAY,OAAO,CAAA;AAAA,QAEG;AAAA,MAAA;AAAA,IAEvD,GACF;AAAA,EAAA;AAGN;AACAZ,EAAc,cAAc;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as p, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { Search as u, X as n } from "lucide-react";
|
|
4
|
+
import { useState as f } from "react";
|
|
5
|
+
import { Input as d } from "./input.es.js";
|
|
6
|
+
const N = ({ onChange: t, ...o }) => {
|
|
7
|
+
const [a, l] = f(""), i = (e) => {
|
|
8
|
+
const c = e.target.value;
|
|
9
|
+
l(c), t == null || t(c);
|
|
10
|
+
}, s = () => {
|
|
11
|
+
l(""), t == null || t("");
|
|
12
|
+
}, m = (e) => {
|
|
13
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), s());
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ p("div", { className: "relative flex items-center", children: [
|
|
16
|
+
/* @__PURE__ */ r("div", { className: "absolute left-2 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ r(u, { className: "h-4 w-4" }) }),
|
|
17
|
+
/* @__PURE__ */ r(
|
|
18
|
+
d,
|
|
19
|
+
{
|
|
20
|
+
...o,
|
|
21
|
+
value: a,
|
|
22
|
+
onChange: i,
|
|
23
|
+
className: "w-[200px] pl-7 pr-7"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
a && /* @__PURE__ */ r(
|
|
27
|
+
n,
|
|
28
|
+
{
|
|
29
|
+
onClick: s,
|
|
30
|
+
onKeyDown: m,
|
|
31
|
+
tabIndex: 0,
|
|
32
|
+
role: "button",
|
|
33
|
+
"aria-label": "Clear search input",
|
|
34
|
+
className: "absolute right-1 top-1/2 transform -translate-y-1/2 cursor-pointer"
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
] });
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
N as SearchInput
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=search-input.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-input.es.js","sources":["../../../lib/components/ui/search-input.tsx"],"sourcesContent":["'use client';\nimport { Search, X } from 'lucide-react'; // Assuming LucideIcon is the type of your icons\nimport React, { useState } from 'react';\nimport { Input, InputProps } from './input'; // Adjust based on your Input import path\n\ninterface SearchInputProps extends Omit<InputProps, 'onChange'> {\n onChange?: (value: string) => void; // Function to handle input value changes\n}\n\nconst SearchInput: React.FC<SearchInputProps> = ({ onChange, ...props }) => {\n const [value, setValue] = useState<string>('');\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = event.target.value;\n setValue(newValue);\n onChange?.(newValue); // Call the custom onChange handler with the new value\n };\n\n const handleClearClick = () => {\n setValue('');\n onChange?.(''); // Notify the parent that the input has been cleared\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<SVGElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleClearClick(); // Trigger the clear action on Enter or Space key press\n }\n };\n\n return (\n <div className=\"relative flex items-center\">\n {/* Search Icon */}\n <div className=\"absolute left-2 top-1/2 transform -translate-y-1/2\">\n <Search className=\"h-4 w-4\" />\n </div>\n\n {/* Input Field */}\n <Input\n {...props}\n value={value}\n onChange={handleInputChange} // Use the internal handler\n className={`w-[200px] pl-7 pr-7`}\n />\n\n {/* Clear (X) Icon */}\n {value && (\n <X\n onClick={handleClearClick}\n onKeyDown={handleKeyDown}\n tabIndex={0}\n role=\"button\" // Announce it as a button for assistive technologies\n aria-label=\"Clear search input\" // Accessible label\n className=\"absolute right-1 top-1/2 transform -translate-y-1/2 cursor-pointer\"\n />\n )}\n </div>\n );\n};\n\nexport { SearchInput };\n"],"names":["SearchInput","onChange","props","value","setValue","useState","handleInputChange","event","newValue","handleClearClick","handleKeyDown","jsxs","jsx","Search","Input","X"],"mappings":";;;;;AASA,MAAMA,IAA0C,CAAC,EAAE,UAAAC,GAAU,GAAGC,QAAY;AAC1E,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAiB,EAAE,GAEvCC,IAAoB,CAACC,MAA+C;AAClE,UAAAC,IAAWD,EAAM,OAAO;AAC9B,IAAAH,EAASI,CAAQ,GACjBP,KAAA,QAAAA,EAAWO;AAAA,EACb,GAEMC,IAAmB,MAAM;AAC7B,IAAAL,EAAS,EAAE,GACXH,KAAA,QAAAA,EAAW;AAAA,EACb,GAEMS,IAAgB,CAACH,MAA2C;AAChE,KAAIA,EAAM,QAAQ,WAAWA,EAAM,QAAQ,SACzCA,EAAM,eAAe,GACJE,EAAA;AAAA,EAErB;AAGE,SAAA,gBAAAE,EAAC,OAAI,EAAA,WAAU,8BAEb,UAAA;AAAA,IAAA,gBAAAC,EAAC,SAAI,WAAU,sDACb,4BAACC,GAAO,EAAA,WAAU,WAAU,EAC9B,CAAA;AAAA,IAGA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACE,GAAGZ;AAAA,QACJ,OAAAC;AAAA,QACA,UAAUG;AAAA,QACV,WAAW;AAAA,MAAA;AAAA,IACb;AAAA,IAGCH,KACC,gBAAAS;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,SAASN;AAAA,QACT,WAAWC;AAAA,QACX,UAAU;AAAA,QACV,MAAK;AAAA,QACL,cAAW;AAAA,QACX,WAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EACZ,GAEJ;AAEJ;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import * as s from "react";
|
|
3
3
|
import { CaretSortIcon as p, ChevronUpIcon as f, ChevronDownIcon as u, CheckIcon as h } from "@radix-ui/react-icons";
|
|
4
4
|
import * as e from "@radix-ui/react-select";
|
|
5
|
+
import * as s from "react";
|
|
5
6
|
import { cn as l } from "../../utils/index.es.js";
|
|
6
7
|
const I = e.Root, R = e.Group, C = e.Value, y = s.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__ */ n(
|
|
7
8
|
e.Trigger,
|
|
@@ -23,10 +24,7 @@ const i = s.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
|
23
24
|
e.ScrollUpButton,
|
|
24
25
|
{
|
|
25
26
|
ref: a,
|
|
26
|
-
className: l(
|
|
27
|
-
"flex cursor-default items-center justify-center py-1",
|
|
28
|
-
o
|
|
29
|
-
),
|
|
27
|
+
className: l("flex cursor-default items-center justify-center py-1", o),
|
|
30
28
|
...r,
|
|
31
29
|
children: /* @__PURE__ */ t(f, {})
|
|
32
30
|
}
|
|
@@ -36,10 +34,7 @@ const c = s.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
|
36
34
|
e.ScrollDownButton,
|
|
37
35
|
{
|
|
38
36
|
ref: a,
|
|
39
|
-
className: l(
|
|
40
|
-
"flex cursor-default items-center justify-center py-1",
|
|
41
|
-
o
|
|
42
|
-
),
|
|
37
|
+
className: l("flex cursor-default items-center justify-center py-1", o),
|
|
43
38
|
...r,
|
|
44
39
|
children: /* @__PURE__ */ t(u, {})
|
|
45
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.es.js","sources":["../../../lib/components/ui/select.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"select.es.js","sources":["../../../lib/components/ui/select.tsx"],"sourcesContent":["'use client';\nimport { CaretSortIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon } from '@radix-ui/react-icons';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport * as React from 'react';\n\nimport { cn } from '@/utils';\n\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-body shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretSortIcon className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n 'relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-body font-semibold', className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-body outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-muted', className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n};\n"],"names":["Select","SelectPrimitive","SelectGroup","SelectValue","SelectTrigger","React","className","children","props","ref","jsxs","cn","jsx","CaretSortIcon","SelectScrollUpButton","ChevronUpIcon","SelectScrollDownButton","ChevronDownIcon","SelectContent","position","SelectLabel","SelectItem","CheckIcon","SelectSeparator"],"mappings":";;;;;;AAOA,MAAMA,IAASC,EAAgB,MAEzBC,IAAcD,EAAgB,OAE9BE,IAAcF,EAAgB,OAE9BG,IAAgBC,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,KAASC,MACpC,gBAAAC;AAAA,EAACT,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAQ;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAL;AAAA,IACF;AAAA,IACC,GAAGE;AAAA,IAEH,UAAA;AAAA,MAAAD;AAAA,MACD,gBAAAK,EAACX,EAAgB,MAAhB,EAAqB,SAAO,IAC3B,UAAC,gBAAAW,EAAAC,GAAA,EAAc,WAAU,qBAAqB,CAAA,EAChD,CAA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1
|
+
"use client";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
3
|
import * as o from "@radix-ui/react-separator";
|
|
4
|
+
import * as p from "react";
|
|
4
5
|
import { cn as l } from "../../utils/index.es.js";
|
|
5
|
-
const s =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
)
|
|
20
|
-
);
|
|
6
|
+
const s = p.forwardRef(({ className: a, orientation: r = "horizontal", decorative: t = !0, ...e }, m) => /* @__PURE__ */ i(
|
|
7
|
+
o.Root,
|
|
8
|
+
{
|
|
9
|
+
ref: m,
|
|
10
|
+
decorative: t,
|
|
11
|
+
orientation: r,
|
|
12
|
+
className: l(
|
|
13
|
+
"shrink-0 bg-border",
|
|
14
|
+
r === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
15
|
+
a
|
|
16
|
+
),
|
|
17
|
+
...e
|
|
18
|
+
}
|
|
19
|
+
));
|
|
21
20
|
s.displayName = o.Root.displayName;
|
|
22
21
|
export {
|
|
23
22
|
s as Separator
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.es.js","sources":["../../../lib/components/ui/separator.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"separator.es.js","sources":["../../../lib/components/ui/separator.tsx"],"sourcesContent":["'use client';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\nimport * as React from 'react';\n\nimport { cn } from '@/utils';\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'shrink-0 bg-border',\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\n className,\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n"],"names":["Separator","React","className","orientation","decorative","props","ref","jsx","SeparatorPrimitive","cn"],"mappings":";;;;;AAMA,MAAMA,IAAYC,EAAM,WAGtB,CAAC,EAAE,WAAAC,GAAW,aAAAC,IAAc,cAAc,YAAAC,IAAa,IAAM,GAAGC,KAASC,MACzE,gBAAAC;AAAA,EAACC,EAAmB;AAAA,EAAnB;AAAA,IACC,KAAAF;AAAA,IACA,YAAAF;AAAA,IACA,aAAAD;AAAA,IACA,WAAWM;AAAA,MACT;AAAA,MACAN,MAAgB,eAAe,mBAAmB;AAAA,MAClDD;AAAA,IACF;AAAA,IACC,GAAGG;AAAA,EAAA;AACN,CACD;AACDL,EAAU,cAAcQ,EAAmB,KAAK;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import * as r from "react";
|
|
3
3
|
import * as e from "@radix-ui/react-dialog";
|
|
4
4
|
import { Cross2Icon as c } from "@radix-ui/react-icons";
|
|
5
5
|
import { cva as f } from "class-variance-authority";
|
|
6
|
+
import * as r from "react";
|
|
6
7
|
import { cn as i } from "../../utils/index.es.js";
|
|
7
8
|
const C = e.Root, R = e.Trigger, T = e.Close, p = e.Portal, d = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
|
|
8
9
|
e.Overlay,
|
|
@@ -33,47 +34,21 @@ const h = f(
|
|
|
33
34
|
}
|
|
34
35
|
), g = r.forwardRef(({ side: t = "right", className: a, children: s, ...l }, m) => /* @__PURE__ */ n(p, { children: [
|
|
35
36
|
/* @__PURE__ */ o(d, {}),
|
|
36
|
-
/* @__PURE__ */ n(
|
|
37
|
-
e.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */ n(e.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", children: [
|
|
44
|
-
/* @__PURE__ */ o(c, { className: "h-4 w-4" }),
|
|
45
|
-
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
46
|
-
] }),
|
|
47
|
-
s
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
)
|
|
37
|
+
/* @__PURE__ */ n(e.Content, { ref: m, className: i(h({ side: t }), a), ...l, children: [
|
|
38
|
+
/* @__PURE__ */ n(e.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", children: [
|
|
39
|
+
/* @__PURE__ */ o(c, { className: "h-4 w-4" }),
|
|
40
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
41
|
+
] }),
|
|
42
|
+
s
|
|
43
|
+
] })
|
|
51
44
|
] }));
|
|
52
45
|
g.displayName = e.Content.displayName;
|
|
53
|
-
const u = ({
|
|
54
|
-
className: t,
|
|
55
|
-
...a
|
|
56
|
-
}) => /* @__PURE__ */ o(
|
|
57
|
-
"div",
|
|
58
|
-
{
|
|
59
|
-
className: i(
|
|
60
|
-
"flex flex-col space-y-2 text-center sm:text-left",
|
|
61
|
-
t
|
|
62
|
-
),
|
|
63
|
-
...a
|
|
64
|
-
}
|
|
65
|
-
);
|
|
46
|
+
const u = ({ className: t, ...a }) => /* @__PURE__ */ o("div", { className: i("flex flex-col space-y-2 text-center sm:text-left", t), ...a });
|
|
66
47
|
u.displayName = "SheetHeader";
|
|
67
|
-
const y = ({
|
|
68
|
-
className: t,
|
|
69
|
-
...a
|
|
70
|
-
}) => /* @__PURE__ */ o(
|
|
48
|
+
const y = ({ className: t, ...a }) => /* @__PURE__ */ o(
|
|
71
49
|
"div",
|
|
72
50
|
{
|
|
73
|
-
className: i(
|
|
74
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
75
|
-
t
|
|
76
|
-
),
|
|
51
|
+
className: i("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", t),
|
|
77
52
|
...a
|
|
78
53
|
}
|
|
79
54
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.es.js","sources":["../../../lib/components/ui/sheet.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"sheet.es.js","sources":["../../../lib/components/ui/sheet.tsx"],"sourcesContent":["'use client';\nimport * as SheetPrimitive from '@radix-ui/react-dialog';\nimport { Cross2Icon } from '@radix-ui/react-icons';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/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-black/80 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-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out',\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 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 ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>\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 <Cross2Icon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n {children}\n </SheetPrimitive.Content>\n </SheetPortal>\n));\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />\n);\nSheetHeader.displayName = 'SheetHeader';\n\nconst SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}\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-heading-3 font-semibold text-foreground', 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-body text-muted-foreground', className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetOverlay,\n SheetPortal,\n SheetTitle,\n SheetTrigger,\n};\n"],"names":["Sheet","SheetPrimitive","SheetTrigger","SheetClose","SheetPortal","SheetOverlay","React","className","props","ref","jsx","cn","sheetVariants","cva","SheetContent","side","children","jsxs","Cross2Icon","SheetHeader","SheetFooter","SheetTitle","SheetDescription"],"mappings":";;;;;;;AAQA,MAAMA,IAAQC,EAAe,MAEvBC,IAAeD,EAAe,SAE9BE,IAAaF,EAAe,OAE5BG,IAAcH,EAAe,QAE7BI,IAAeC,EAAM,WAGzB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAACT,EAAe;AAAA,EAAf;AAAA,IACC,WAAWU;AAAA,MACT;AAAA,MACAJ;AAAA,IACF;AAAA,IACC,GAAGC;AAAA,IACJ,KAAAC;AAAA,EAAA;AACF,CACD;AACDJ,EAAa,cAAcJ,EAAe,QAAQ;AAElD,MAAMW,IAAgBC;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,KAAK;AAAA,QACL,QACE;AAAA,QACF,MAAM;AAAA,QACN,OACE;AAAA,MAAA;AAAA,IAEN;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ,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