@mayor_grd/centry-ui 0.1.0
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/README.md +100 -0
- package/dist/components/ui/accordion.cjs +2 -0
- package/dist/components/ui/accordion.cjs.map +1 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +47 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.cjs +2 -0
- package/dist/components/ui/alert-dialog.cjs.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +21 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +108 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.cjs +2 -0
- package/dist/components/ui/alert.cjs.map +1 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +55 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/aspect-ratio.cjs +2 -0
- package/dist/components/ui/aspect-ratio.cjs.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +6 -0
- package/dist/components/ui/aspect-ratio.js.map +1 -0
- package/dist/components/ui/avatar.cjs +2 -0
- package/dist/components/ui/avatar.cjs.map +1 -0
- package/dist/components/ui/avatar.d.ts +13 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +57 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.cjs +2 -0
- package/dist/components/ui/badge.cjs.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +38 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.cjs +2 -0
- package/dist/components/ui/breadcrumb.cjs.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +23 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +97 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button.cjs +2 -0
- package/dist/components/ui/button.cjs.map +1 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.figma.d.ts +2 -0
- package/dist/components/ui/button.figma.d.ts.map +1 -0
- package/dist/components/ui/button.js +73 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.cjs +2 -0
- package/dist/components/ui/calendar.cjs.map +1 -0
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +56 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.cjs +2 -0
- package/dist/components/ui/card.cjs.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +51 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/carousel.cjs +2 -0
- package/dist/components/ui/carousel.cjs.map +1 -0
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +156 -0
- package/dist/components/ui/carousel.js.map +1 -0
- package/dist/components/ui/checkbox.cjs +2 -0
- package/dist/components/ui/checkbox.cjs.map +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +53 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.cjs +2 -0
- package/dist/components/ui/collapsible.cjs.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +8 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/combobox.cjs +2 -0
- package/dist/components/ui/combobox.cjs.map +1 -0
- package/dist/components/ui/combobox.d.ts +22 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +70 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/command.cjs +2 -0
- package/dist/components/ui/command.cjs.map +1 -0
- package/dist/components/ui/command.d.ts +82 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +107 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/data-table.cjs +2 -0
- package/dist/components/ui/data-table.cjs.map +1 -0
- package/dist/components/ui/data-table.d.ts +11 -0
- package/dist/components/ui/data-table.d.ts.map +1 -0
- package/dist/components/ui/data-table.js +26 -0
- package/dist/components/ui/data-table.js.map +1 -0
- package/dist/components/ui/date-picker.cjs +2 -0
- package/dist/components/ui/date-picker.cjs.map +1 -0
- package/dist/components/ui/date-picker.d.ts +15 -0
- package/dist/components/ui/date-picker.d.ts.map +1 -0
- package/dist/components/ui/date-picker.js +49 -0
- package/dist/components/ui/date-picker.js.map +1 -0
- package/dist/components/ui/dialog.cjs +2 -0
- package/dist/components/ui/dialog.cjs.map +1 -0
- package/dist/components/ui/dialog.d.ts +20 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +96 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/drawer.cjs +2 -0
- package/dist/components/ui/drawer.cjs.map +1 -0
- package/dist/components/ui/drawer.d.ts +23 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +84 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/dropdown-menu.cjs +2 -0
- package/dist/components/ui/dropdown-menu.cjs.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +34 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +153 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/form.cjs +2 -0
- package/dist/components/ui/form.cjs.map +1 -0
- package/dist/components/ui/form.d.ts +23 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/form.js +93 -0
- package/dist/components/ui/form.js.map +1 -0
- package/dist/components/ui/hover-card.cjs +2 -0
- package/dist/components/ui/hover-card.cjs.map +1 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +24 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/index.d.ts +45 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/input-otp.cjs +2 -0
- package/dist/components/ui/input-otp.cjs.map +1 -0
- package/dist/components/ui/input-otp.d.ts +36 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp.js +55 -0
- package/dist/components/ui/input-otp.js.map +1 -0
- package/dist/components/ui/input.cjs +2 -0
- package/dist/components/ui/input.cjs.map +1 -0
- package/dist/components/ui/input.d.ts +10 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +32 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/label.cjs +2 -0
- package/dist/components/ui/label.cjs.map +1 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +13 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/navigation-menu.cjs +2 -0
- package/dist/components/ui/navigation-menu.cjs.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +100 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/pagination.cjs +2 -0
- package/dist/components/ui/pagination.cjs.map +1 -0
- package/dist/components/ui/pagination.d.ts +29 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +100 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/popover.cjs +2 -0
- package/dist/components/ui/popover.cjs.map +1 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +25 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.cjs +2 -0
- package/dist/components/ui/progress.cjs.map +1 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +24 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/radio-group.cjs +2 -0
- package/dist/components/ui/radio-group.cjs.map +1 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +31 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/select.cjs +2 -0
- package/dist/components/ui/select.cjs.map +1 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +116 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.cjs +2 -0
- package/dist/components/ui/separator.cjs.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +23 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.cjs +2 -0
- package/dist/components/ui/sheet.cjs.map +1 -0
- package/dist/components/ui/sheet.d.ts +26 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +87 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.cjs +2 -0
- package/dist/components/ui/sidebar.cjs.map +1 -0
- package/dist/components/ui/sidebar.d.ts +70 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +541 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.cjs +2 -0
- package/dist/components/ui/skeleton.cjs.map +1 -0
- package/dist/components/ui/skeleton.d.ts +4 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +18 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.cjs +2 -0
- package/dist/components/ui/slider.cjs.map +1 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +21 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/sonner.cjs +2 -0
- package/dist/components/ui/sonner.cjs.map +1 -0
- package/dist/components/ui/sonner.d.ts +6 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/sonner.js +27 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/switch.cjs +2 -0
- package/dist/components/ui/switch.cjs.map +1 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +28 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.cjs +2 -0
- package/dist/components/ui/table.cjs.map +1 -0
- package/dist/components/ui/table.d.ts +17 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +86 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tag.cjs +2 -0
- package/dist/components/ui/tag.cjs.map +1 -0
- package/dist/components/ui/tag.d.ts +11 -0
- package/dist/components/ui/tag.d.ts.map +1 -0
- package/dist/components/ui/tag.js +50 -0
- package/dist/components/ui/tag.js.map +1 -0
- package/dist/components/ui/textarea.cjs +2 -0
- package/dist/components/ui/textarea.cjs.map +1 -0
- package/dist/components/ui/textarea.d.ts +10 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +31 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toggle-group.cjs +2 -0
- package/dist/components/ui/toggle-group.cjs.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +17 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +57 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.cjs +2 -0
- package/dist/components/ui/toggle.cjs.map +1 -0
- package/dist/components/ui/toggle.d.ts +13 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +35 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.cjs +2 -0
- package/dist/components/ui/tooltip.cjs.map +1 -0
- package/dist/components/ui/tooltip.d.ts +14 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +34 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +264 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.cjs +2 -0
- package/dist/lib/utils.cjs.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +9 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles/library.css +174 -0
- package/dist/tokens/generated/primitives.css +541 -0
- package/dist/tokens/generated/tailwind-theme.cjs +2 -0
- package/dist/tokens/generated/tailwind-theme.cjs.map +1 -0
- package/dist/tokens/generated/tailwind-theme.d.ts +870 -0
- package/dist/tokens/generated/tailwind-theme.d.ts.map +1 -0
- package/dist/tokens/generated/tailwind-theme.js +872 -0
- package/dist/tokens/generated/tailwind-theme.js.map +1 -0
- package/dist/tokens/generated/tokens.cjs +2 -0
- package/dist/tokens/generated/tokens.cjs.map +1 -0
- package/dist/tokens/generated/tokens.d.ts +891 -0
- package/dist/tokens/generated/tokens.d.ts.map +1 -0
- package/dist/tokens/generated/tokens.js +1596 -0
- package/dist/tokens/generated/tokens.js.map +1 -0
- package/dist/tokens/generated/variables.css +919 -0
- package/dist/tokens/index.cjs +2 -0
- package/dist/tokens/index.cjs.map +1 -0
- package/dist/tokens/index.d.ts +3 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +15 -0
- package/dist/tokens/index.js.map +1 -0
- package/package.json +140 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),N=require("react"),h=require("@radix-ui/react-dropdown-menu"),i=require("iconsax-react"),j=require("class-variance-authority"),s=require("../../lib/utils.cjs");function u(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const d=u(N),e=u(h),p=j.cva("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{variant:{default:"focus:bg-bg-accent focus:text-text-primary",error:"text-status-error-text focus:bg-status-error-bg focus:text-status-error-text [&_svg]:text-status-error-icon"}},defaultVariants:{variant:"default"}}),v=e.Root,S=e.Trigger,R=e.Group,l=e.Portal,I=e.Sub,C=e.RadioGroup,m=d.forwardRef(({className:t,inset:o,children:n,...a},c)=>r.jsxs(e.SubTrigger,{ref:c,className:s.cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-text-primary outline-none focus:bg-bg-accent data-[state=open]:bg-bg-accent",o&&"pl-8",t),...a,children:[n,r.jsx(i.ArrowRight2,{size:14,color:"currentColor",className:"ml-auto text-icon-muted"})]}));m.displayName=e.SubTrigger.displayName;const x=d.forwardRef(({className:t,...o},n)=>r.jsx(e.SubContent,{ref:n,className:s.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-default bg-bg-popover p-1 text-text-popover shadow-popover data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...o}));x.displayName=e.SubContent.displayName;const f=d.forwardRef(({className:t,sideOffset:o=4,...n},a)=>r.jsx(l,{children:r.jsx(e.Content,{ref:a,sideOffset:o,className:s.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-default bg-bg-popover p-1 text-text-popover shadow-popover data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n})}));f.displayName=e.Content.displayName;const b=d.forwardRef(({className:t,inset:o,variant:n,...a},c)=>r.jsx(e.Item,{ref:c,className:s.cn(p({variant:n}),o&&"pl-8",t),...a}));b.displayName=e.Item.displayName;const w=d.forwardRef(({className:t,children:o,checked:n,...a},c)=>r.jsxs(e.CheckboxItem,{ref:c,className:s.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-bg-accent focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...a,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(e.ItemIndicator,{children:r.jsx(i.TickCircle,{size:14,color:"currentColor",variant:"Bold"})})}),o]}));w.displayName=e.CheckboxItem.displayName;const g=d.forwardRef(({className:t,children:o,...n},a)=>r.jsxs(e.RadioItem,{ref:a,className:s.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-bg-accent focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(e.ItemIndicator,{children:r.jsx("span",{className:"h-2 w-2 rounded-full bg-action-primary-bg"})})}),o]}));g.displayName=e.RadioItem.displayName;const y=d.forwardRef(({className:t,inset:o,...n},a)=>r.jsx(e.Label,{ref:a,className:s.cn("px-2 py-1.5 text-xs font-medium text-text-muted",o&&"pl-8",t),...n}));y.displayName=e.Label.displayName;const M=d.forwardRef(({className:t,...o},n)=>r.jsx(e.Separator,{ref:n,className:s.cn("-mx-1 my-1 h-px bg-border-muted",t),...o}));M.displayName=e.Separator.displayName;const D=({className:t,...o})=>r.jsx("span",{className:s.cn("ml-auto text-xs tracking-widest text-text-muted",t),...o});D.displayName="DropdownMenuShortcut";exports.DropdownMenu=v;exports.DropdownMenuCheckboxItem=w;exports.DropdownMenuContent=f;exports.DropdownMenuGroup=R;exports.DropdownMenuItem=b;exports.DropdownMenuLabel=y;exports.DropdownMenuPortal=l;exports.DropdownMenuRadioGroup=C;exports.DropdownMenuRadioItem=g;exports.DropdownMenuSeparator=M;exports.DropdownMenuShortcut=D;exports.DropdownMenuSub=I;exports.DropdownMenuSubContent=x;exports.DropdownMenuSubTrigger=m;exports.DropdownMenuTrigger=S;exports.dropdownMenuItemVariants=p;
|
|
2
|
+
//# sourceMappingURL=dropdown-menu.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.cjs","sources":["../../../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { ArrowRight2, TickCircle } from 'iconsax-react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '@/lib/utils';\n\nconst dropdownMenuItemVariants = cva(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n {\n variants: {\n variant: {\n default: 'focus:bg-bg-accent focus:text-text-primary',\n error:\n 'text-status-error-text focus:bg-status-error-bg focus:text-status-error-text [&_svg]:text-status-error-icon',\n },\n },\n defaultVariants: { variant: 'default' },\n }\n);\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-text-primary outline-none focus:bg-bg-accent data-[state=open]:bg-bg-accent',\n inset && 'pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ArrowRight2 size={14} color=\"currentColor\" className=\"ml-auto text-icon-muted\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-default bg-bg-popover p-1 text-text-popover shadow-popover 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 />\n));\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPortal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-default bg-bg-popover p-1 text-text-popover shadow-popover 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 />\n </DropdownMenuPortal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n } & VariantProps<typeof dropdownMenuItemVariants>\n>(({ className, inset, variant, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n dropdownMenuItemVariants({ variant }),\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-bg-accent focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <TickCircle size={14} color=\"currentColor\" variant=\"Bold\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-bg-accent focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <span className=\"h-2 w-2 rounded-full bg-action-primary-bg\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-xs font-medium text-text-muted', inset && 'pl-8', className)}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-border-muted', className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn('ml-auto text-xs tracking-widest text-text-muted', className)}\n {...props}\n />\n);\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n dropdownMenuItemVariants,\n};\n"],"names":["dropdownMenuItemVariants","cva","DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","React","className","inset","children","props","ref","jsxs","cn","ArrowRight2","DropdownMenuSubContent","jsx","DropdownMenuContent","sideOffset","DropdownMenuItem","variant","DropdownMenuCheckboxItem","checked","TickCircle","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":"sjBAMMA,EAA2BC,EAAAA,IAC/B,2LACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,6CACT,MACE,6GAAA,CACJ,EAEF,gBAAiB,CAAE,QAAS,SAAA,CAAU,CAE1C,EAEMC,EAAeC,EAAsB,KACrCC,EAAsBD,EAAsB,QAC5CE,EAAoBF,EAAsB,MAC1CG,EAAqBH,EAAsB,OAC3CI,EAAkBJ,EAAsB,IACxCK,EAAyBL,EAAsB,WAE/CM,EAAyBC,EAAM,WAKnC,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAO,SAAAC,EAAU,GAAGC,GAASC,IAC3CC,EAA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,CACL,IACEM,EAAAA,IAAC,OAAA,CACC,UAAWH,EAAAA,GAAG,kDAAmDN,CAAS,EACzE,GAAGG,CAAA,CACN,EAEFiB,EAAqB,YAAc"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
4
|
+
declare const dropdownMenuItemVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "error" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
8
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
11
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
12
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
14
|
+
inset?: boolean;
|
|
15
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
19
|
+
inset?: boolean;
|
|
20
|
+
} & VariantProps<(props?: ({
|
|
21
|
+
variant?: "default" | "error" | null | undefined;
|
|
22
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
declare const DropdownMenuShortcut: {
|
|
30
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, dropdownMenuItemVariants, };
|
|
34
|
+
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,wBAAwB;;8EAY7B,CAAC;AAEF,QAAA,MAAM,YAAY,mDAA6B,CAAC;AAChD,QAAA,MAAM,mBAAmB,0HAAgC,CAAC;AAC1D,QAAA,MAAM,iBAAiB,qHAA8B,CAAC;AACtD,QAAA,MAAM,kBAAkB,yDAA+B,CAAC;AACxD,QAAA,MAAM,eAAe,sDAA4B,CAAC;AAClD,QAAA,MAAM,sBAAsB,0HAAmC,CAAC;AAEhE,QAAA,MAAM,sBAAsB;YAGhB,OAAO;wCAejB,CAAC;AAGH,QAAA,MAAM,sBAAsB,6KAY1B,CAAC;AAGH,QAAA,MAAM,mBAAmB,0KAevB,CAAC;AAGH,QAAA,MAAM,gBAAgB;YAGV,OAAO;;;sHAYjB,CAAC;AAGH,QAAA,MAAM,wBAAwB,+KAoB5B,CAAC;AAGH,QAAA,MAAM,qBAAqB,4KAmBzB,CAAC;AAGH,QAAA,MAAM,iBAAiB;YAE0D,OAAO;wCAOtF,CAAC;AAGH,QAAA,MAAM,qBAAqB,4KASzB,CAAC;AAGH,QAAA,MAAM,oBAAoB;8BAGvB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;;CAKvC,CAAC;AAGF,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,GACzB,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import * as e from "@radix-ui/react-dropdown-menu";
|
|
4
|
+
import { TickCircle as c, ArrowRight2 as p } from "iconsax-react";
|
|
5
|
+
import { cva as m } from "class-variance-authority";
|
|
6
|
+
import { cn as s } from "../../lib/utils.js";
|
|
7
|
+
const u = m(
|
|
8
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "focus:bg-bg-accent focus:text-text-primary",
|
|
13
|
+
error: "text-status-error-text focus:bg-status-error-bg focus:text-status-error-text [&_svg]:text-status-error-icon"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: { variant: "default" }
|
|
17
|
+
}
|
|
18
|
+
), C = e.Root, T = e.Trigger, k = e.Group, f = e.Portal, j = e.Sub, z = e.RadioGroup, b = d.forwardRef(({ className: t, inset: o, children: a, ...n }, i) => /* @__PURE__ */ l(
|
|
19
|
+
e.SubTrigger,
|
|
20
|
+
{
|
|
21
|
+
ref: i,
|
|
22
|
+
className: s(
|
|
23
|
+
"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-text-primary outline-none focus:bg-bg-accent data-[state=open]:bg-bg-accent",
|
|
24
|
+
o && "pl-8",
|
|
25
|
+
t
|
|
26
|
+
),
|
|
27
|
+
...n,
|
|
28
|
+
children: [
|
|
29
|
+
a,
|
|
30
|
+
/* @__PURE__ */ r(p, { size: 14, color: "currentColor", className: "ml-auto text-icon-muted" })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
));
|
|
34
|
+
b.displayName = e.SubTrigger.displayName;
|
|
35
|
+
const x = d.forwardRef(({ className: t, ...o }, a) => /* @__PURE__ */ r(
|
|
36
|
+
e.SubContent,
|
|
37
|
+
{
|
|
38
|
+
ref: a,
|
|
39
|
+
className: s(
|
|
40
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-default bg-bg-popover p-1 text-text-popover shadow-popover data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
41
|
+
t
|
|
42
|
+
),
|
|
43
|
+
...o
|
|
44
|
+
}
|
|
45
|
+
));
|
|
46
|
+
x.displayName = e.SubContent.displayName;
|
|
47
|
+
const w = d.forwardRef(({ className: t, sideOffset: o = 4, ...a }, n) => /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(
|
|
48
|
+
e.Content,
|
|
49
|
+
{
|
|
50
|
+
ref: n,
|
|
51
|
+
sideOffset: o,
|
|
52
|
+
className: s(
|
|
53
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-default bg-bg-popover p-1 text-text-popover shadow-popover data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
54
|
+
t
|
|
55
|
+
),
|
|
56
|
+
...a
|
|
57
|
+
}
|
|
58
|
+
) }));
|
|
59
|
+
w.displayName = e.Content.displayName;
|
|
60
|
+
const g = d.forwardRef(({ className: t, inset: o, variant: a, ...n }, i) => /* @__PURE__ */ r(
|
|
61
|
+
e.Item,
|
|
62
|
+
{
|
|
63
|
+
ref: i,
|
|
64
|
+
className: s(
|
|
65
|
+
u({ variant: a }),
|
|
66
|
+
o && "pl-8",
|
|
67
|
+
t
|
|
68
|
+
),
|
|
69
|
+
...n
|
|
70
|
+
}
|
|
71
|
+
));
|
|
72
|
+
g.displayName = e.Item.displayName;
|
|
73
|
+
const y = d.forwardRef(({ className: t, children: o, checked: a, ...n }, i) => /* @__PURE__ */ l(
|
|
74
|
+
e.CheckboxItem,
|
|
75
|
+
{
|
|
76
|
+
ref: i,
|
|
77
|
+
className: s(
|
|
78
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-bg-accent focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
79
|
+
t
|
|
80
|
+
),
|
|
81
|
+
checked: a,
|
|
82
|
+
...n,
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ r("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ r(e.ItemIndicator, { children: /* @__PURE__ */ r(c, { size: 14, color: "currentColor", variant: "Bold" }) }) }),
|
|
85
|
+
o
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
));
|
|
89
|
+
y.displayName = e.CheckboxItem.displayName;
|
|
90
|
+
const N = d.forwardRef(({ className: t, children: o, ...a }, n) => /* @__PURE__ */ l(
|
|
91
|
+
e.RadioItem,
|
|
92
|
+
{
|
|
93
|
+
ref: n,
|
|
94
|
+
className: s(
|
|
95
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-bg-accent focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
96
|
+
t
|
|
97
|
+
),
|
|
98
|
+
...a,
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ r("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ r(e.ItemIndicator, { children: /* @__PURE__ */ r("span", { className: "h-2 w-2 rounded-full bg-action-primary-bg" }) }) }),
|
|
101
|
+
o
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
));
|
|
105
|
+
N.displayName = e.RadioItem.displayName;
|
|
106
|
+
const h = d.forwardRef(({ className: t, inset: o, ...a }, n) => /* @__PURE__ */ r(
|
|
107
|
+
e.Label,
|
|
108
|
+
{
|
|
109
|
+
ref: n,
|
|
110
|
+
className: s("px-2 py-1.5 text-xs font-medium text-text-muted", o && "pl-8", t),
|
|
111
|
+
...a
|
|
112
|
+
}
|
|
113
|
+
));
|
|
114
|
+
h.displayName = e.Label.displayName;
|
|
115
|
+
const v = d.forwardRef(({ className: t, ...o }, a) => /* @__PURE__ */ r(
|
|
116
|
+
e.Separator,
|
|
117
|
+
{
|
|
118
|
+
ref: a,
|
|
119
|
+
className: s("-mx-1 my-1 h-px bg-border-muted", t),
|
|
120
|
+
...o
|
|
121
|
+
}
|
|
122
|
+
));
|
|
123
|
+
v.displayName = e.Separator.displayName;
|
|
124
|
+
const M = ({
|
|
125
|
+
className: t,
|
|
126
|
+
...o
|
|
127
|
+
}) => /* @__PURE__ */ r(
|
|
128
|
+
"span",
|
|
129
|
+
{
|
|
130
|
+
className: s("ml-auto text-xs tracking-widest text-text-muted", t),
|
|
131
|
+
...o
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
M.displayName = "DropdownMenuShortcut";
|
|
135
|
+
export {
|
|
136
|
+
C as DropdownMenu,
|
|
137
|
+
y as DropdownMenuCheckboxItem,
|
|
138
|
+
w as DropdownMenuContent,
|
|
139
|
+
k as DropdownMenuGroup,
|
|
140
|
+
g as DropdownMenuItem,
|
|
141
|
+
h as DropdownMenuLabel,
|
|
142
|
+
f as DropdownMenuPortal,
|
|
143
|
+
z as DropdownMenuRadioGroup,
|
|
144
|
+
N as DropdownMenuRadioItem,
|
|
145
|
+
v as DropdownMenuSeparator,
|
|
146
|
+
M as DropdownMenuShortcut,
|
|
147
|
+
j as DropdownMenuSub,
|
|
148
|
+
x as DropdownMenuSubContent,
|
|
149
|
+
b as DropdownMenuSubTrigger,
|
|
150
|
+
T as DropdownMenuTrigger,
|
|
151
|
+
u as dropdownMenuItemVariants
|
|
152
|
+
};
|
|
153
|
+
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","sources":["../../../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { ArrowRight2, TickCircle } from 'iconsax-react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '@/lib/utils';\n\nconst dropdownMenuItemVariants = cva(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n {\n variants: {\n variant: {\n default: 'focus:bg-bg-accent focus:text-text-primary',\n error:\n 'text-status-error-text focus:bg-status-error-bg focus:text-status-error-text [&_svg]:text-status-error-icon',\n },\n },\n defaultVariants: { variant: 'default' },\n }\n);\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-text-primary outline-none focus:bg-bg-accent data-[state=open]:bg-bg-accent',\n inset && 'pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ArrowRight2 size={14} color=\"currentColor\" className=\"ml-auto text-icon-muted\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-default bg-bg-popover p-1 text-text-popover shadow-popover 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 />\n));\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPortal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-border-default bg-bg-popover p-1 text-text-popover shadow-popover 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 />\n </DropdownMenuPortal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n } & VariantProps<typeof dropdownMenuItemVariants>\n>(({ className, inset, variant, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n dropdownMenuItemVariants({ variant }),\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-bg-accent focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <TickCircle size={14} color=\"currentColor\" variant=\"Bold\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-bg-accent focus:text-text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <span className=\"h-2 w-2 rounded-full bg-action-primary-bg\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-xs font-medium text-text-muted', inset && 'pl-8', className)}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-border-muted', className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn('ml-auto text-xs tracking-widest text-text-muted', className)}\n {...props}\n />\n);\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n dropdownMenuItemVariants,\n};\n"],"names":["dropdownMenuItemVariants","cva","DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","React","className","inset","children","props","ref","jsxs","cn","ArrowRight2","DropdownMenuSubContent","jsx","DropdownMenuContent","sideOffset","DropdownMenuItem","variant","DropdownMenuCheckboxItem","checked","TickCirc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AAA,IACC,KAAAY;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAN;AAAA,IAAA;AAAA,IAED,GAAGG;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAM,EAAC,QAAA,EAAK,WAAU,gEACd,UAAA,gBAAAA,EAACjB,EAAsB,eAAtB,EACC,UAAA,gBAAAiB,EAAC,QAAA,EAAK,WAAU,4CAAA,CAA4C,EAAA,CAC9D,GACF;AAAA,MACCP;AAAA,IAAA;AAAA,EAAA;AACH,CACD;AACDe,EAAsB,cAAczB,EAAsB,UAAU;AAEpE,MAAM0B,IAAoBnB,EAAM,WAG9B,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,GAAGE,KAASC,MACjC,gBAAAK;AAAA,EAACjB,EAAsB;AAAA,EAAtB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE,EAAG,mDAAmDL,KAAS,QAAQD,CAAS;AAAA,IAC1F,GAAGG;AAAA,EAAA;AACN,CACD;AACDe,EAAkB,cAAc1B,EAAsB,MAAM;AAE5D,MAAM2B,IAAwBpB,EAAM,WAGlC,CAAC,EAAE,WAAAC,GAAW,GAAGG,EAAA,GAASC,MAC1B,gBAAAK;AAAA,EAACjB,EAAsB;AAAA,EAAtB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE,EAAG,mCAAmCN,CAAS;AAAA,IACzD,GAAGG;AAAA,EAAA;AACN,CACD;AACDgB,EAAsB,cAAc3B,EAAsB,UAAU;AAEpE,MAAM4B,IAAuB,CAAC;AAAA,EAC5B,WAAApB;AAAA,EACA,GAAGG;AACL,MACE,gBAAAM;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWH,EAAG,mDAAmDN,CAAS;AAAA,IACzE,GAAGG;AAAA,EAAA;AACN;AAEFiB,EAAqB,cAAc;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),I=require("react"),j=require("@radix-ui/react-slot"),d=require("react-hook-form"),c=require("../../lib/utils.cjs"),y=require("./label.cjs");function C(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const s=C(I),N=d.FormProvider,f=s.createContext({}),S=({...e})=>i.jsx(f.Provider,{value:{name:e.name},children:i.jsx(d.Controller,{...e})}),a=()=>{const e=s.useContext(f),t=s.useContext(u),{getFieldState:r,formState:o}=d.useFormContext(),n=r(e.name,o);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:m}=t;return{id:m,name:e.name,formItemId:`${m}-form-item`,formDescriptionId:`${m}-form-item-description`,formMessageId:`${m}-form-item-message`,...n}},u=s.createContext({}),F=s.forwardRef(({className:e,...t},r)=>{const o=s.useId();return i.jsx(u.Provider,{value:{id:o},children:i.jsx("div",{ref:r,className:c.cn("space-y-2",e),...t})})});F.displayName="FormItem";const x=s.forwardRef(({className:e,...t},r)=>{const{error:o,formItemId:n}=a();return i.jsx(y.Label,{ref:r,className:c.cn(o&&"text-field-errortext",e),htmlFor:n,...t})});x.displayName="FormLabel";const p=s.forwardRef(({...e},t)=>{const{error:r,formItemId:o,formDescriptionId:n,formMessageId:m}=a();return i.jsx(j.Slot,{ref:t,id:o,"aria-describedby":r?`${n} ${m}`:n,"aria-invalid":!!r,...e})});p.displayName="FormControl";const b=s.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:o}=a();return i.jsx("p",{ref:r,id:o,className:c.cn("text-sm text-field-helptext",e),...t})});b.displayName="FormDescription";const g=s.forwardRef(({className:e,children:t,...r},o)=>{const{error:n,formMessageId:m}=a(),l=n?String(n.message??""):t;return l?i.jsx("p",{ref:o,id:m,className:c.cn("text-sm font-medium text-field-errortext",e),...r,children:l}):null});g.displayName="FormMessage";exports.Form=N;exports.FormControl=p;exports.FormDescription=b;exports.FormField=S;exports.FormItem=F;exports.FormLabel=x;exports.FormMessage=g;exports.useFormField=a;
|
|
2
|
+
//# sourceMappingURL=form.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.cjs","sources":["../../../src/components/ui/form.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n} from 'react-hook-form';\nimport { cn } from '@/lib/utils';\nimport { Label } from './label';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n);\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const { id } = itemContext;\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = { id: string };\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId();\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('space-y-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n }\n);\nFormItem.displayName = 'FormItem';\n\nconst FormLabel = React.forwardRef<\n React.ComponentRef<typeof Label>,\n React.ComponentPropsWithoutRef<typeof Label>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n return (\n <Label\n ref={ref}\n className={cn(error && 'text-field-errortext', className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\nFormLabel.displayName = 'FormLabel';\n\nconst FormControl = React.forwardRef<\n React.ComponentRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n});\nFormControl.displayName = 'FormControl';\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn('text-sm text-field-helptext', className)}\n {...props}\n />\n );\n});\nFormDescription.displayName = 'FormDescription';\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error.message ?? '') : children;\n if (!body) return null;\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn('text-sm font-medium text-field-errortext', className)}\n {...props}\n >\n {body}\n </p>\n );\n});\nFormMessage.displayName = 'FormMessage';\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n};\n"],"names":["Form","FormProvider","FormFieldContext","React","FormField","props","jsx","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body"],"mappings":"2hBAaMA,EAAOC,EAAAA,aASPC,EAAmBC,EAAM,cAAqC,EAA2B,EAEzFC,EAAY,CAGhB,CACA,GAAGC,CACL,IACEC,EAAAA,IAACJ,EAAiB,SAAjB,CAA0B,MAAO,CAAE,KAAMG,EAAM,IAAA,EAC9C,SAAAC,EAAAA,IAACC,EAAAA,WAAA,CAAY,GAAGF,EAAO,CAAA,CACzB,EAGIG,EAAe,IAAM,CACzB,MAAMC,EAAeN,EAAM,WAAWD,CAAgB,EAChDQ,EAAcP,EAAM,WAAWQ,CAAe,EAC9C,CAAE,cAAAC,EAAe,UAAAC,CAAA,EAAcC,iBAAA,EAC/BC,EAAaH,EAAcH,EAAa,KAAMI,CAAS,EAE7D,GAAI,CAACJ,EACH,MAAM,IAAI,MAAM,gDAAgD,EAGlE,KAAM,CAAE,GAAAO,GAAON,EACf,MAAO,CACL,GAAAM,EACA,KAAMP,EAAa,KACnB,WAAY,GAAGO,CAAE,aACjB,kBAAmB,GAAGA,CAAE,yBACxB,cAAe,GAAGA,CAAE,qBACpB,GAAGD,CAAA,CAEP,EAIMJ,EAAkBR,EAAM,cAAoC,EAA0B,EAEtFc,EAAWd,EAAM,WACrB,CAAC,CAAE,UAAAe,EAAW,GAAGb,CAAA,EAASc,IAAQ,CAChC,MAAMH,EAAKb,EAAM,MAAA,EACjB,aACGQ,EAAgB,SAAhB,CAAyB,MAAO,CAAE,GAAAK,GACjC,SAAAV,EAAAA,IAAC,MAAA,CAAI,IAAAa,EAAU,UAAWC,KAAG,YAAaF,CAAS,EAAI,GAAGb,EAAO,EACnE,CAEJ,CACF,EACAY,EAAS,YAAc,WAEvB,MAAMI,EAAYlB,EAAM,WAGtB,CAAC,CAAE,UAAAe,EAAW,GAAGb,CAAA,EAASc,IAAQ,CAClC,KAAM,CAAE,MAAAG,EAAO,WAAAC,CAAA,EAAef,EAAA,EAC9B,OACEF,EAAAA,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1,23 @@
|
|
|
1
|
+
import { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import('react-hook-form').FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
4
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const useFormField: () => {
|
|
6
|
+
invalid: boolean;
|
|
7
|
+
isDirty: boolean;
|
|
8
|
+
isTouched: boolean;
|
|
9
|
+
isValidating: boolean;
|
|
10
|
+
error?: import('react-hook-form').FieldError;
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
formItemId: string;
|
|
14
|
+
formDescriptionId: string;
|
|
15
|
+
formMessageId: string;
|
|
16
|
+
};
|
|
17
|
+
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const FormLabel: React.ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-label').LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & import('class-variance-authority').VariantProps<(props?: import('class-variance-authority/types').ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
19
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<import('@radix-ui/react-slot').SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
20
|
+
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
21
|
+
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
22
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
|
23
|
+
//# sourceMappingURL=form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/components/ui/form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EAGjB,MAAM,iBAAiB,CAAC;AAIzB,QAAA,MAAM,IAAI,4MAAe,CAAC;AAW1B,QAAA,MAAM,SAAS,GACb,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,cAEC,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAItC,CAAC;AAEF,QAAA,MAAM,YAAY;;;;;;;;;;;CAmBjB,CAAC;AAMF,QAAA,MAAM,QAAQ,6GASb,CAAC;AAGF,QAAA,MAAM,SAAS,qWAab,CAAC;AAGH,QAAA,MAAM,WAAW,8JAcf,CAAC;AAGH,QAAA,MAAM,eAAe,yHAanB,CAAC;AAGH,QAAA,MAAM,WAAW,yHAiBf,CAAC;AAGH,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,GACV,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { Slot as F } from "@radix-ui/react-slot";
|
|
4
|
+
import { FormProvider as p, Controller as u, useFormContext as x } from "react-hook-form";
|
|
5
|
+
import { cn as a } from "../../lib/utils.js";
|
|
6
|
+
import { Label as I } from "./label.js";
|
|
7
|
+
const M = p, l = m.createContext({}), S = ({
|
|
8
|
+
...e
|
|
9
|
+
}) => /* @__PURE__ */ n(l.Provider, { value: { name: e.name }, children: /* @__PURE__ */ n(u, { ...e }) }), d = () => {
|
|
10
|
+
const e = m.useContext(l), o = m.useContext(f), { getFieldState: r, formState: t } = x(), s = r(e.name, t);
|
|
11
|
+
if (!e)
|
|
12
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
13
|
+
const { id: i } = o;
|
|
14
|
+
return {
|
|
15
|
+
id: i,
|
|
16
|
+
name: e.name,
|
|
17
|
+
formItemId: `${i}-form-item`,
|
|
18
|
+
formDescriptionId: `${i}-form-item-description`,
|
|
19
|
+
formMessageId: `${i}-form-item-message`,
|
|
20
|
+
...s
|
|
21
|
+
};
|
|
22
|
+
}, f = m.createContext({}), C = m.forwardRef(
|
|
23
|
+
({ className: e, ...o }, r) => {
|
|
24
|
+
const t = m.useId();
|
|
25
|
+
return /* @__PURE__ */ n(f.Provider, { value: { id: t }, children: /* @__PURE__ */ n("div", { ref: r, className: a("space-y-2", e), ...o }) });
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
C.displayName = "FormItem";
|
|
29
|
+
const g = m.forwardRef(({ className: e, ...o }, r) => {
|
|
30
|
+
const { error: t, formItemId: s } = d();
|
|
31
|
+
return /* @__PURE__ */ n(
|
|
32
|
+
I,
|
|
33
|
+
{
|
|
34
|
+
ref: r,
|
|
35
|
+
className: a(t && "text-field-errortext", e),
|
|
36
|
+
htmlFor: s,
|
|
37
|
+
...o
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
g.displayName = "FormLabel";
|
|
42
|
+
const N = m.forwardRef(({ ...e }, o) => {
|
|
43
|
+
const { error: r, formItemId: t, formDescriptionId: s, formMessageId: i } = d();
|
|
44
|
+
return /* @__PURE__ */ n(
|
|
45
|
+
F,
|
|
46
|
+
{
|
|
47
|
+
ref: o,
|
|
48
|
+
id: t,
|
|
49
|
+
"aria-describedby": r ? `${s} ${i}` : s,
|
|
50
|
+
"aria-invalid": !!r,
|
|
51
|
+
...e
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
N.displayName = "FormControl";
|
|
56
|
+
const h = m.forwardRef(({ className: e, ...o }, r) => {
|
|
57
|
+
const { formDescriptionId: t } = d();
|
|
58
|
+
return /* @__PURE__ */ n(
|
|
59
|
+
"p",
|
|
60
|
+
{
|
|
61
|
+
ref: r,
|
|
62
|
+
id: t,
|
|
63
|
+
className: a("text-sm text-field-helptext", e),
|
|
64
|
+
...o
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
h.displayName = "FormDescription";
|
|
69
|
+
const w = m.forwardRef(({ className: e, children: o, ...r }, t) => {
|
|
70
|
+
const { error: s, formMessageId: i } = d(), c = s ? String(s.message ?? "") : o;
|
|
71
|
+
return c ? /* @__PURE__ */ n(
|
|
72
|
+
"p",
|
|
73
|
+
{
|
|
74
|
+
ref: t,
|
|
75
|
+
id: i,
|
|
76
|
+
className: a("text-sm font-medium text-field-errortext", e),
|
|
77
|
+
...r,
|
|
78
|
+
children: c
|
|
79
|
+
}
|
|
80
|
+
) : null;
|
|
81
|
+
});
|
|
82
|
+
w.displayName = "FormMessage";
|
|
83
|
+
export {
|
|
84
|
+
M as Form,
|
|
85
|
+
N as FormControl,
|
|
86
|
+
h as FormDescription,
|
|
87
|
+
S as FormField,
|
|
88
|
+
C as FormItem,
|
|
89
|
+
g as FormLabel,
|
|
90
|
+
w as FormMessage,
|
|
91
|
+
d as useFormField
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.js","sources":["../../../src/components/ui/form.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n} from 'react-hook-form';\nimport { cn } from '@/lib/utils';\nimport { Label } from './label';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n);\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const { id } = itemContext;\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = { id: string };\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId();\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('space-y-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n }\n);\nFormItem.displayName = 'FormItem';\n\nconst FormLabel = React.forwardRef<\n React.ComponentRef<typeof Label>,\n React.ComponentPropsWithoutRef<typeof Label>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n return (\n <Label\n ref={ref}\n className={cn(error && 'text-field-errortext', className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\nFormLabel.displayName = 'FormLabel';\n\nconst FormControl = React.forwardRef<\n React.ComponentRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n});\nFormControl.displayName = 'FormControl';\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn('text-sm text-field-helptext', className)}\n {...props}\n />\n );\n});\nFormDescription.displayName = 'FormDescription';\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error.message ?? '') : children;\n if (!body) return null;\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn('text-sm font-medium text-field-errortext', className)}\n {...props}\n >\n {body}\n </p>\n );\n});\nFormMessage.displayName = 'FormMessage';\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n};\n"],"names":["Form","FormProvider","FormFieldContext","React","FormField","props","jsx","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body"],"mappings":";;;;;;AAaA,MAAMA,IAAOC,GASPC,IAAmBC,EAAM,cAAqC,EAA2B,GAEzFC,IAAY,CAGhB;AAAA,EACA,GAAGC;AACL,MACE,gBAAAC,EAACJ,EAAiB,UAAjB,EAA0B,OAAO,EAAE,MAAMG,EAAM,KAAA,GAC9C,UAAA,gBAAAC,EAACC,GAAA,EAAY,GAAGF,GAAO,EAAA,CACzB,GAGIG,IAAe,MAAM;AACzB,QAAM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,YAAAC,GAAY,mBAAAG,GAAmB,eAAAC,EAAA,IAAkBnB,EAAA;AAChE,SACE,gBAAAF;AAAA,IAACsB;AAAA,IAAA;AAAA,MACC,KAAAT;AAAA,MACA,IAAII;AAAA,MACJ,oBAAmBD,IAA4B,GAAGI,CAAiB,IAAIC,CAAa,KAAzDD;AAAA,MAC3B,gBAAc,CAAC,CAACJ;AAAA,MACf,GAAGjB;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDoB,EAAY,cAAc;AAE1B,MAAMI,IAAkB1B,EAAM,WAG5B,CAAC,EAAE,WAAAe,GAAW,GAAGb,EAAA,GAASc,MAAQ;AAClC,QAAM,EAAE,mBAAAO,EAAA,IAAsBlB,EAAA;AAC9B,SACE,gBAAAF;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAa;AAAA,MACA,IAAIO;AAAA,MACJ,WAAWN,EAAG,+BAA+BF,CAAS;AAAA,MACrD,GAAGb;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDwB,EAAgB,cAAc;AAE9B,MAAMC,IAAc3B,EAAM,WAGxB,CAAC,EAAE,WAAAe,GAAW,UAAAa,GAAU,GAAG1B,EAAA,GAASc,MAAQ;AAC5C,QAAM,EAAE,OAAAG,GAAO,eAAAK,EAAA,IAAkBnB,EAAA,GAC3BwB,IAAOV,IAAQ,OAAOA,EAAM,WAAW,EAAE,IAAIS;AACnD,SAAKC,IAEH,gBAAA1B;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAa;AAAA,MACA,IAAIQ;AAAA,MACJ,WAAWP,EAAG,4CAA4CF,CAAS;AAAA,MAClE,GAAGb;AAAA,MAEH,UAAA2B;AAAA,IAAA;AAAA,EAAA,IARa;AAWpB,CAAC;AACDF,EAAY,cAAc;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),c=require("react"),l=require("@radix-ui/react-hover-card"),u=require("../../lib/utils.cjs");function n(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const m=n(c),a=n(l),p=a.Root,f=a.Trigger,d=m.forwardRef(({className:e,align:o="center",sideOffset:t=4,...r},i)=>s.jsx(a.Content,{ref:i,align:o,sideOffset:t,className:u.cn("z-50 w-64 rounded-md border border-border-default bg-bg-popover p-4 text-text-popover shadow-popover 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",e),...r}));d.displayName=a.Content.displayName;exports.HoverCard=p;exports.HoverCardContent=d;exports.HoverCardTrigger=f;
|
|
2
|
+
//# sourceMappingURL=hover-card.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover-card.cjs","sources":["../../../src/components/ui/hover-card.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as HoverCardPrimitive from '@radix-ui/react-hover-card';\nimport { cn } from '@/lib/utils';\n\nconst HoverCard = HoverCardPrimitive.Root;\nconst HoverCardTrigger = HoverCardPrimitive.Trigger;\n\nconst HoverCardContent = React.forwardRef<\n React.ComponentRef<typeof HoverCardPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <HoverCardPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 w-64 rounded-md border border-border-default bg-bg-popover p-4 text-text-popover shadow-popover 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',\n className\n )}\n {...props}\n />\n));\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName;\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent };\n"],"names":["HoverCard","HoverCardPrimitive","HoverCardTrigger","HoverCardContent","React","className","align","sideOffset","props","ref","jsx","cn"],"mappings":"kfAIMA,EAAYC,EAAmB,KAC/BC,EAAmBD,EAAmB,QAEtCE,EAAmBC,EAAM,WAG7B,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAQ,SAAU,WAAAC,EAAa,EAAG,GAAGC,CAAA,EAASC,IAC5DC,EAAAA,IAACT,EAAmB,QAAnB,CACC,IAAAQ,EACA,MAAAH,EACA,WAAAC,EACA,UAAWI,EAAAA,GACT,qcACAN,CAAA,EAED,GAAGG,CAAA,CACN,CACD,EACDL,EAAiB,YAAcF,EAAmB,QAAQ"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
3
|
+
declare const HoverCard: React.FC<HoverCardPrimitive.HoverCardProps>;
|
|
4
|
+
declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
5
|
+
declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
7
|
+
//# sourceMappingURL=hover-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/hover-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AAGjE,QAAA,MAAM,SAAS,6CAA0B,CAAC;AAC1C,QAAA,MAAM,gBAAgB,oHAA6B,CAAC;AAEpD,QAAA,MAAM,gBAAgB,oKAcpB,CAAC;AAGH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import * as t from "@radix-ui/react-hover-card";
|
|
4
|
+
import { cn as n } from "../../lib/utils.js";
|
|
5
|
+
const l = t.Root, c = t.Trigger, m = s.forwardRef(({ className: o, align: e = "center", sideOffset: a = 4, ...r }, d) => /* @__PURE__ */ i(
|
|
6
|
+
t.Content,
|
|
7
|
+
{
|
|
8
|
+
ref: d,
|
|
9
|
+
align: e,
|
|
10
|
+
sideOffset: a,
|
|
11
|
+
className: n(
|
|
12
|
+
"z-50 w-64 rounded-md border border-border-default bg-bg-popover p-4 text-text-popover shadow-popover 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",
|
|
13
|
+
o
|
|
14
|
+
),
|
|
15
|
+
...r
|
|
16
|
+
}
|
|
17
|
+
));
|
|
18
|
+
m.displayName = t.Content.displayName;
|
|
19
|
+
export {
|
|
20
|
+
l as HoverCard,
|
|
21
|
+
m as HoverCardContent,
|
|
22
|
+
c as HoverCardTrigger
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=hover-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover-card.js","sources":["../../../src/components/ui/hover-card.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as HoverCardPrimitive from '@radix-ui/react-hover-card';\nimport { cn } from '@/lib/utils';\n\nconst HoverCard = HoverCardPrimitive.Root;\nconst HoverCardTrigger = HoverCardPrimitive.Trigger;\n\nconst HoverCardContent = React.forwardRef<\n React.ComponentRef<typeof HoverCardPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <HoverCardPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 w-64 rounded-md border border-border-default bg-bg-popover p-4 text-text-popover shadow-popover 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',\n className\n )}\n {...props}\n />\n));\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName;\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent };\n"],"names":["HoverCard","HoverCardPrimitive","HoverCardTrigger","HoverCardContent","React","className","align","sideOffset","props","ref","jsx","cn"],"mappings":";;;;AAIA,MAAMA,IAAYC,EAAmB,MAC/BC,IAAmBD,EAAmB,SAEtCE,IAAmBC,EAAM,WAG7B,CAAC,EAAE,WAAAC,GAAW,OAAAC,IAAQ,UAAU,YAAAC,IAAa,GAAG,GAAGC,EAAA,GAASC,MAC5D,gBAAAC;AAAA,EAACT,EAAmB;AAAA,EAAnB;AAAA,IACC,KAAAQ;AAAA,IACA,OAAAH;AAAA,IACA,YAAAC;AAAA,IACA,WAAWI;AAAA,MACT;AAAA,MACAN;AAAA,IAAA;AAAA,IAED,GAAGG;AAAA,EAAA;AACN,CACD;AACDL,EAAiB,cAAcF,EAAmB,QAAQ;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent, } from './accordion';
|
|
2
|
+
export { Alert, AlertTitle, AlertDescription, alertVariants } from './alert';
|
|
3
|
+
export { AspectRatio } from './aspect-ratio';
|
|
4
|
+
export { Avatar, AvatarImage, AvatarFallback, avatarVariants, type AvatarProps, } from './avatar';
|
|
5
|
+
export { Badge, badgeVariants, type BadgeProps } from './badge';
|
|
6
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, } from './dialog';
|
|
7
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, } from './drawer';
|
|
8
|
+
export { HoverCard, HoverCardTrigger, HoverCardContent } from './hover-card';
|
|
9
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from './popover';
|
|
10
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, } from './alert-dialog';
|
|
11
|
+
export { Button, buttonVariants, type ButtonProps } from './button';
|
|
12
|
+
export { Input, inputVariants, type InputProps } from './input';
|
|
13
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, } from './card';
|
|
14
|
+
export { Separator } from './separator';
|
|
15
|
+
export { Skeleton } from './skeleton';
|
|
16
|
+
export { Tag, tagVariants, type TagProps } from './tag';
|
|
17
|
+
export { Toaster, toast } from './sonner';
|
|
18
|
+
export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, } from './sheet';
|
|
19
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, sidebarMenuButtonVariants, } from './sidebar';
|
|
20
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, tooltipContentVariants, } from './tooltip';
|
|
21
|
+
export { Label } from './label';
|
|
22
|
+
export { Checkbox } from './checkbox';
|
|
23
|
+
export { RadioGroup, RadioGroupItem } from './radio-group';
|
|
24
|
+
export { Switch } from './switch';
|
|
25
|
+
export { Toggle, toggleVariants } from './toggle';
|
|
26
|
+
export { ToggleGroup, ToggleGroupItem, toggleGroupVariants } from './toggle-group';
|
|
27
|
+
export { Slider } from './slider';
|
|
28
|
+
export { Textarea, textareaVariants, type TextareaProps } from './textarea';
|
|
29
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, } from './select';
|
|
30
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, dropdownMenuItemVariants, } from './dropdown-menu';
|
|
31
|
+
export { navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, } from './navigation-menu';
|
|
32
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, } from './breadcrumb';
|
|
33
|
+
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, } from './pagination';
|
|
34
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent } from './collapsible';
|
|
35
|
+
export { Progress } from './progress';
|
|
36
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, } from './command';
|
|
37
|
+
export { Combobox, type ComboboxProps, type ComboboxOption } from './combobox';
|
|
38
|
+
export { Calendar, type CalendarProps } from './calendar';
|
|
39
|
+
export { DatePicker, type DatePickerProps } from './date-picker';
|
|
40
|
+
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator } from './input-otp';
|
|
41
|
+
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, } from './carousel';
|
|
42
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, tableVariants, type TableProps, } from './table';
|
|
43
|
+
export { DataTable, type DataTableProps } from './data-table';
|
|
44
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, } from './form';
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,MAAM,EACN,WAAW,EACX,cAAc,EACd,cAAc,EACd,KAAK,WAAW,GACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,EAAE,aA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QAAQ,EACR,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,aAAa,EACb,KAAK,UAAU,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,GACV,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),O=require("react"),i=require("input-otp"),b=require("iconsax-react"),a=require("../../lib/utils.cjs");function P(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const o=P(O),c=o.forwardRef(({className:e,containerClassName:t,...r},s)=>n.jsx(i.OTPInput,{ref:s,containerClassName:a.cn("flex items-center gap-2 has-[:disabled]:opacity-50",t),className:a.cn("disabled:cursor-not-allowed",e),...r}));c.displayName="InputOTP";const u=o.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:a.cn("flex items-center",e),...t}));u.displayName="InputOTPGroup";const l=o.forwardRef(({index:e,className:t,...r},s)=>{const p=o.useContext(i.OTPInputContext),{char:f,hasFakeCaret:m,isActive:x}=p.slots[e];return n.jsxs("div",{ref:s,className:a.cn("relative flex h-10 w-10 items-center justify-center border-y border-r border-field-border text-sm text-field-text transition-all first:rounded-l-md first:border-l last:rounded-r-md",x&&"z-10 ring-2 ring-focus-ring ring-offset-focus-offset",t),...r,children:[f,m&&n.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:n.jsx("div",{className:"h-4 w-px animate-caret-blink bg-text-primary duration-1000"})})]})});l.displayName="InputOTPSlot";const d=o.forwardRef(({...e},t)=>n.jsx("div",{ref:t,role:"separator",...e,children:n.jsx(b.Minus,{size:16,color:"currentColor",className:"text-icon-muted"})}));d.displayName="InputOTPSeparator";exports.InputOTP=c;exports.InputOTPGroup=u;exports.InputOTPSeparator=d;exports.InputOTPSlot=l;
|
|
2
|
+
//# sourceMappingURL=input-otp.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-otp.cjs","sources":["../../../src/components/ui/input-otp.tsx"],"sourcesContent":["import * as React from 'react';\nimport { OTPInput, OTPInputContext } from 'input-otp';\nimport { Minus } from 'iconsax-react';\nimport { cn } from '@/lib/utils';\n\nconst InputOTP = React.forwardRef<\n React.ComponentRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n 'flex items-center gap-2 has-[:disabled]:opacity-50',\n containerClassName\n )}\n className={cn('disabled:cursor-not-allowed', className)}\n {...props}\n />\n));\nInputOTP.displayName = 'InputOTP';\n\nconst InputOTPGroup = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('flex items-center', className)} {...props} />\n )\n);\nInputOTPGroup.displayName = 'InputOTPGroup';\n\ninterface InputOTPSlotProps extends React.ComponentPropsWithoutRef<'div'> {\n index: number;\n}\n\nconst InputOTPSlot = React.forwardRef<HTMLDivElement, InputOTPSlotProps>(\n ({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext);\n const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];\n return (\n <div\n ref={ref}\n className={cn(\n 'relative flex h-10 w-10 items-center justify-center border-y border-r border-field-border text-sm text-field-text transition-all first:rounded-l-md first:border-l last:rounded-r-md',\n isActive && 'z-10 ring-2 ring-focus-ring ring-offset-focus-offset',\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-4 w-px animate-caret-blink bg-text-primary duration-1000\" />\n </div>\n )}\n </div>\n );\n }\n);\nInputOTPSlot.displayName = 'InputOTPSlot';\n\nconst InputOTPSeparator = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(\n ({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <Minus size={16} color=\"currentColor\" className=\"text-icon-muted\" />\n </div>\n )\n);\nInputOTPSeparator.displayName = 'InputOTPSeparator';\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };\n"],"names":["InputOTP","React","className","containerClassName","props","ref","jsx","OTPInput","cn","InputOTPGroup","InputOTPSlot","index","inputOTPContext","OTPInputContext","char","hasFakeCaret","isActive","jsxs","InputOTPSeparator","Minus"],"mappings":"qfAKMA,EAAWC,EAAM,WAGrB,CAAC,CAAE,UAAAC,EAAW,mBAAAC,EAAoB,GAAGC,GAASC,IAC9CC,EAAAA,IAACC,EAAAA,SAAA,CACC,IAAAF,EACA,mBAAoBG,EAAAA,GAClB,qDACAL,CAAA,EAEF,UAAWK,EAAAA,GAAG,8BAA+BN,CAAS,EACrD,GAAGE,CAAA,CACN,CACD,EACDJ,EAAS,YAAc,WAEvB,MAAMS,EAAgBR,EAAM,WAC1B,CAAC,CAAE,UAAAC,EAAW,GAAGE,CAAA,EAASC,IACxBC,EAAAA,IAAC,MAAA,CAAI,IAAAD,EAAU,UAAWG,EAAAA,GAAG,oBAAqBN,CAAS,EAAI,GAAGE,CAAA,CAAO,CAE7E,EACAK,EAAc,YAAc,gBAM5B,MAAMC,EAAeT,EAAM,WACzB,CAAC,CAAE,MAAAU,EAAO,UAAAT,EAAW,GAAGE,CAAA,EAASC,IAAQ,CACvC,MAAMO,EAAkBX,EAAM,WAAWY,iBAAe,EAClD,CAAE,KAAAC,EAAM,aAAAC,EAAc,SAAAC,GAAaJ,EAAgB,MAAMD,CAAK,EACpE,OACEM,EAAAA,KAAC,MAAA,CACC,IAAAZ,EACA,UAAWG,EAAAA,GACT,uLACAQ,GAAY,uDACZd,CAAA,EAED,GAAGE,EAEH,SAAA,CAAAU,EACAC,SACE,MAAA,CAAI,UAAU,wEACb,SAAAT,EAAAA,IAAC,MAAA,CAAI,UAAU,4DAAA,CAA6D,CAAA,CAC9E,CAAA,CAAA,CAAA,CAIR,CACF,EACAI,EAAa,YAAc,eAE3B,MAAMQ,EAAoBjB,EAAM,WAC9B,CAAC,CAAE,GAAGG,CAAA,EAASC,IACbC,EAAAA,IAAC,OAAI,IAAAD,EAAU,KAAK,YAAa,GAAGD,EAClC,eAACe,QAAA,CAAM,KAAM,GAAI,MAAM,eAAe,UAAU,iBAAA,CAAkB,CAAA,CACpE,CAEJ,EACAD,EAAkB,YAAc"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
3
|
+
value?: string;
|
|
4
|
+
onChange?: (newValue: string) => unknown;
|
|
5
|
+
maxLength: number;
|
|
6
|
+
textAlign?: "left" | "center" | "right";
|
|
7
|
+
onComplete?: (...args: any[]) => unknown;
|
|
8
|
+
pushPasswordManagerStrategy?: "increase-width" | "none";
|
|
9
|
+
pasteTransformer?: (pasted: string) => string;
|
|
10
|
+
containerClassName?: string;
|
|
11
|
+
noScriptCSSFallback?: string | null;
|
|
12
|
+
} & {
|
|
13
|
+
render: (props: import('input-otp').RenderProps) => React.ReactNode;
|
|
14
|
+
children?: never;
|
|
15
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
16
|
+
value?: string;
|
|
17
|
+
onChange?: (newValue: string) => unknown;
|
|
18
|
+
maxLength: number;
|
|
19
|
+
textAlign?: "left" | "center" | "right";
|
|
20
|
+
onComplete?: (...args: any[]) => unknown;
|
|
21
|
+
pushPasswordManagerStrategy?: "increase-width" | "none";
|
|
22
|
+
pasteTransformer?: (pasted: string) => string;
|
|
23
|
+
containerClassName?: string;
|
|
24
|
+
noScriptCSSFallback?: string | null;
|
|
25
|
+
} & {
|
|
26
|
+
render?: never;
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
} & React.RefAttributes<HTMLInputElement>, "ref">) & React.RefAttributes<HTMLInputElement>>;
|
|
29
|
+
declare const InputOTPGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
interface InputOTPSlotProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
31
|
+
index: number;
|
|
32
|
+
}
|
|
33
|
+
declare const InputOTPSlot: React.ForwardRefExoticComponent<InputOTPSlotProps & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
declare const InputOTPSeparator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
|
|
36
|
+
//# sourceMappingURL=input-otp.d.ts.map
|