ivt 0.2.2 → 0.2.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/accordion/index.mjs +1 -1
- package/dist/alert/index.mjs +1 -1
- package/dist/alert-dialog/index.mjs +1 -1
- package/dist/avatar/index.mjs +1 -1
- package/dist/badge/index.mjs +1 -1
- package/dist/base/index.mjs +1 -1
- package/dist/base/index.mjs.map +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/calendar/index.mjs +1 -1
- package/dist/card/index.mjs +1 -1
- package/dist/checkbox/index.mjs +1 -1
- package/dist/chunks/{accordion-CRu13Dha.mjs → accordion-DxayPBXZ.mjs} +2 -2
- package/dist/chunks/{accordion-CRu13Dha.mjs.map → accordion-DxayPBXZ.mjs.map} +1 -1
- package/dist/chunks/{badge-Y1dDJQqr.mjs → badge-BIhNGnoC.mjs} +2 -2
- package/dist/chunks/{badge-Y1dDJQqr.mjs.map → badge-BIhNGnoC.mjs.map} +1 -1
- package/dist/chunks/{bundle-mjs-5yKezECc.mjs → bundle-mjs-BPxOXzif.mjs} +1 -1
- package/dist/chunks/{bundle-mjs-5yKezECc.mjs.map → bundle-mjs-BPxOXzif.mjs.map} +1 -1
- package/dist/chunks/{button-DoZYnN_T.mjs → button-kxm0Lckx.mjs} +2 -2
- package/dist/chunks/{button-DoZYnN_T.mjs.map → button-kxm0Lckx.mjs.map} +1 -1
- package/dist/chunks/{calendar-Biojbgqw.mjs → calendar-CBJ49e3M.mjs} +2 -2
- package/dist/chunks/{calendar-Biojbgqw.mjs.map → calendar-CBJ49e3M.mjs.map} +1 -1
- package/dist/chunks/check-DlWKp3dT.mjs +2 -0
- package/dist/chunks/{check-CiuxfB_G.mjs.map → check-DlWKp3dT.mjs.map} +1 -1
- package/dist/chunks/chevron-down-CWUqY12V.mjs +2 -0
- package/dist/chunks/{chevron-down-D2iiAjQd.mjs.map → chevron-down-CWUqY12V.mjs.map} +1 -1
- package/dist/chunks/chevron-left-CJfbOy3n.mjs +2 -0
- package/dist/chunks/{chevron-left-DZD565Pc.mjs.map → chevron-left-CJfbOy3n.mjs.map} +1 -1
- package/dist/chunks/chevron-right-CepU0QYJ.mjs +2 -0
- package/dist/chunks/{chevron-right-B9yX7Te0.mjs.map → chevron-right-CepU0QYJ.mjs.map} +1 -1
- package/dist/chunks/{command-DZ0p-kkm.mjs → command-DYCg8FQm.mjs} +2 -2
- package/dist/chunks/{command-DZ0p-kkm.mjs.map → command-DYCg8FQm.mjs.map} +1 -1
- package/dist/chunks/{createLucideIcon-D9esjvN9.mjs → createLucideIcon-Okp8w8Ue.mjs} +1 -1
- package/dist/chunks/{createLucideIcon-D9esjvN9.mjs.map → createLucideIcon-Okp8w8Ue.mjs.map} +1 -1
- package/dist/chunks/{dialog-B27SKKwf.mjs → dialog-DTcjPj46.mjs} +2 -2
- package/dist/chunks/{dialog-B27SKKwf.mjs.map → dialog-DTcjPj46.mjs.map} +1 -1
- package/dist/chunks/{hover-card-CYdF4tka.mjs → hover-card-T6QvJZH3.mjs} +2 -2
- package/dist/chunks/{hover-card-CYdF4tka.mjs.map → hover-card-T6QvJZH3.mjs.map} +1 -1
- package/dist/chunks/{index-CZZyG4d-.mjs → index-BEptPvC9.mjs} +1 -1
- package/dist/chunks/{index-CZZyG4d-.mjs.map → index-BEptPvC9.mjs.map} +1 -1
- package/dist/chunks/{index-D4QaIJIC.mjs → index-Bmfh-9vj.mjs} +2 -2
- package/dist/chunks/{index-D4QaIJIC.mjs.map → index-Bmfh-9vj.mjs.map} +1 -1
- package/dist/chunks/{index-gINpS7bU.mjs → index-BqVtEtRQ.mjs} +1 -1
- package/dist/chunks/{index-gINpS7bU.mjs.map → index-BqVtEtRQ.mjs.map} +1 -1
- package/dist/chunks/{index-BcouYq7P.mjs → index-BsSBJ3PL.mjs} +2 -2
- package/dist/chunks/{index-BcouYq7P.mjs.map → index-BsSBJ3PL.mjs.map} +1 -1
- package/dist/chunks/{index-ojKRapLJ.mjs → index-C-gmRzgE.mjs} +1 -1
- package/dist/chunks/{index-ojKRapLJ.mjs.map → index-C-gmRzgE.mjs.map} +1 -1
- package/dist/chunks/{index-BD0ct0kD.mjs → index-Cy8Nz9EO.mjs} +1 -1
- package/dist/chunks/{index-BD0ct0kD.mjs.map → index-Cy8Nz9EO.mjs.map} +1 -1
- package/dist/chunks/{index-Bn7EFHMT.mjs → index-DUhfpjqn.mjs} +2 -2
- package/dist/chunks/{index-Bn7EFHMT.mjs.map → index-DUhfpjqn.mjs.map} +1 -1
- package/dist/chunks/{index-DS-C90jw.mjs → index-Di_4GEUt.mjs} +2 -2
- package/dist/chunks/{index-DS-C90jw.mjs.map → index-Di_4GEUt.mjs.map} +1 -1
- package/dist/chunks/{index-DhSQFvS9.mjs → index-DzvdVz0F.mjs} +2 -2
- package/dist/chunks/{index-DhSQFvS9.mjs.map → index-DzvdVz0F.mjs.map} +1 -1
- package/dist/chunks/{index-D9Zwkp9P.mjs → index-Gmu-glAo.mjs} +2 -2
- package/dist/chunks/{index-D9Zwkp9P.mjs.map → index-Gmu-glAo.mjs.map} +1 -1
- package/dist/chunks/{index-BoVEch5q.mjs → index-g796WVS-.mjs} +1 -1
- package/dist/chunks/{index-BoVEch5q.mjs.map → index-g796WVS-.mjs.map} +1 -1
- package/dist/chunks/{index-M45g_qo0.mjs → index-j5UZGMap.mjs} +2 -2
- package/dist/chunks/{index-M45g_qo0.mjs.map → index-j5UZGMap.mjs.map} +1 -1
- package/dist/chunks/{index-BR3_LOr1.mjs → index-jhOC7m1Z.mjs} +2 -2
- package/dist/chunks/{index-BR3_LOr1.mjs.map → index-jhOC7m1Z.mjs.map} +1 -1
- package/dist/chunks/{index-BikeYhoq.mjs → index-pz7_bV3J.mjs} +2 -2
- package/dist/chunks/{index-BikeYhoq.mjs.map → index-pz7_bV3J.mjs.map} +1 -1
- package/dist/chunks/{index-Osi0LLLf.mjs → index-sxa3-G-E.mjs} +2 -2
- package/dist/chunks/{index-Osi0LLLf.mjs.map → index-sxa3-G-E.mjs.map} +1 -1
- package/dist/chunks/{input-U8L0qifT.mjs → input-DyBbEcZb.mjs} +2 -2
- package/dist/chunks/{input-U8L0qifT.mjs.map → input-DyBbEcZb.mjs.map} +1 -1
- package/dist/chunks/{label-L_RZKGdi.mjs → label-7xIUYreG.mjs} +2 -2
- package/dist/chunks/{label-L_RZKGdi.mjs.map → label-7xIUYreG.mjs.map} +1 -1
- package/dist/chunks/{pagination-DWGOl1YM.mjs → pagination-BQCy5ruZ.mjs} +2 -2
- package/dist/chunks/{pagination-DWGOl1YM.mjs.map → pagination-BQCy5ruZ.mjs.map} +1 -1
- package/dist/chunks/{popover-DgBEAa61.mjs → popover-BaOty87a.mjs} +2 -2
- package/dist/chunks/{popover-DgBEAa61.mjs.map → popover-BaOty87a.mjs.map} +1 -1
- package/dist/chunks/{progress-DNp9ADEo.mjs → progress-B01RWEwW.mjs} +2 -2
- package/dist/chunks/{progress-DNp9ADEo.mjs.map → progress-B01RWEwW.mjs.map} +1 -1
- package/dist/chunks/{scroll-area-BTs5WSxO.mjs → scroll-area-DBEmK194.mjs} +2 -2
- package/dist/chunks/{scroll-area-BTs5WSxO.mjs.map → scroll-area-DBEmK194.mjs.map} +1 -1
- package/dist/chunks/{select-DEkouf8i.mjs → select-DluWFNkM.mjs} +2 -2
- package/dist/chunks/{select-DEkouf8i.mjs.map → select-DluWFNkM.mjs.map} +1 -1
- package/dist/chunks/separator-Bj88WMYr.mjs +2 -0
- package/dist/chunks/separator-Bj88WMYr.mjs.map +1 -0
- package/dist/chunks/{skeleton-DxMv3ZHu.mjs → skeleton-BL6dx9Bm.mjs} +2 -2
- package/dist/chunks/{skeleton-DxMv3ZHu.mjs.map → skeleton-BL6dx9Bm.mjs.map} +1 -1
- package/dist/chunks/{sortable-C3LyClHG.mjs → sortable-DrKB22S8.mjs} +2 -2
- package/dist/chunks/{sortable-C3LyClHG.mjs.map → sortable-DrKB22S8.mjs.map} +1 -1
- package/dist/chunks/{table-BPHebMeE.mjs → table-BvtQHwsd.mjs} +2 -2
- package/dist/chunks/{table-BPHebMeE.mjs.map → table-BvtQHwsd.mjs.map} +1 -1
- package/dist/chunks/{tslib.es6-Dcib4Fm8.mjs → tslib.es6-1P1xnW5u.mjs} +1 -1
- package/dist/chunks/{tslib.es6-Dcib4Fm8.mjs.map → tslib.es6-1P1xnW5u.mjs.map} +1 -1
- package/dist/chunks/{utils-Uj0fSFoG.mjs → utils-BNmnOQuQ.mjs} +2 -2
- package/dist/chunks/{utils-Uj0fSFoG.mjs.map → utils-BNmnOQuQ.mjs.map} +1 -1
- package/dist/chunks/x-Dnrlrmes.mjs +2 -0
- package/dist/chunks/{x-HCYpfOZx.mjs.map → x-Dnrlrmes.mjs.map} +1 -1
- package/dist/command/index.mjs +1 -1
- package/dist/data-table/index.mjs +1 -1
- package/dist/dialog/index.mjs +1 -1
- package/dist/dropdown-menu/index.mjs +1 -1
- package/dist/dropzone/index.mjs +1 -1
- package/dist/form/index.mjs +1 -1
- package/dist/hover-card/index.mjs +1 -1
- package/dist/icon/index.mjs +1 -1
- package/dist/icon.svg +7 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.css +1 -1
- package/dist/index.es.js +1 -0
- package/dist/input/index.mjs +1 -1
- package/dist/ivt.css +1 -0
- package/dist/ivt.png +0 -0
- package/dist/label/index.mjs +1 -1
- package/dist/multi-select/index.d.ts +71 -0
- package/dist/multi-select/index.mjs +2 -0
- package/dist/multi-select/index.mjs.map +1 -0
- package/dist/pagination/index.mjs +1 -1
- package/dist/popover/index.mjs +1 -1
- package/dist/progress/index.mjs +1 -1
- package/dist/scroll-area/index.mjs +1 -1
- package/dist/select/index.mjs +1 -1
- package/dist/separator/index.mjs +1 -1
- package/dist/separator/index.mjs.map +1 -1
- package/dist/sheet/index.mjs +1 -1
- package/dist/skeleton/index.mjs +1 -1
- package/dist/sortable/index.mjs +1 -1
- package/dist/table/index.mjs +1 -1
- package/dist/tabs/index.mjs +1 -1
- package/dist/toast/index.mjs +1 -1
- package/dist/tooltip/index.mjs +1 -1
- package/package.json +7 -2
- package/dist/chunks/check-CiuxfB_G.mjs +0 -2
- package/dist/chunks/chevron-down-D2iiAjQd.mjs +0 -2
- package/dist/chunks/chevron-left-DZD565Pc.mjs +0 -2
- package/dist/chunks/chevron-right-B9yX7Te0.mjs +0 -2
- package/dist/chunks/x-HCYpfOZx.mjs +0 -2
@@ -0,0 +1,71 @@
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
3
|
+
import * as React from 'react';
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Variants for the multi-select component to handle different styles.
|
7
|
+
* Uses class-variance-authority (cva) to define different styles based on "variant" prop.
|
8
|
+
*/
|
9
|
+
declare const multiSelectVariants: (props?: ({
|
10
|
+
variant?: "default" | "secondary" | "destructive" | "inverted" | null | undefined;
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
12
|
+
/**
|
13
|
+
* Props for MultiSelect component
|
14
|
+
*/
|
15
|
+
interface MultiSelectProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof multiSelectVariants> {
|
16
|
+
/**
|
17
|
+
* An array of option objects to be displayed in the multi-select component.
|
18
|
+
* Each option object has a label, value, and an optional icon.
|
19
|
+
*/
|
20
|
+
options: {
|
21
|
+
/** The text to display for the option. */
|
22
|
+
label: string;
|
23
|
+
/** The unique value associated with the option. */
|
24
|
+
value: string;
|
25
|
+
/** Optional icon component to display alongside the option. */
|
26
|
+
icon?: React.ComponentType<{
|
27
|
+
className?: string;
|
28
|
+
}>;
|
29
|
+
}[];
|
30
|
+
/**
|
31
|
+
* Callback function triggered when the selected values change.
|
32
|
+
* Receives an array of the new selected values.
|
33
|
+
*/
|
34
|
+
onValueChange: (value: string[]) => void;
|
35
|
+
/** The default selected values when the component mounts. */
|
36
|
+
defaultValue?: string[];
|
37
|
+
/**
|
38
|
+
* Placeholder text to be displayed when no values are selected.
|
39
|
+
* Optional, defaults to "Select options".
|
40
|
+
*/
|
41
|
+
placeholder?: string;
|
42
|
+
/**
|
43
|
+
* Animation duration in seconds for the visual effects (e.g., bouncing badges).
|
44
|
+
* Optional, defaults to 0 (no animation).
|
45
|
+
*/
|
46
|
+
animation?: number;
|
47
|
+
/**
|
48
|
+
* Maximum number of items to display. Extra selected items will be summarized.
|
49
|
+
* Optional, defaults to 3.
|
50
|
+
*/
|
51
|
+
maxCount?: number;
|
52
|
+
/**
|
53
|
+
* The modality of the popover. When set to true, interaction with outside elements
|
54
|
+
* will be disabled and only popover content will be visible to screen readers.
|
55
|
+
* Optional, defaults to false.
|
56
|
+
*/
|
57
|
+
modalPopover?: boolean;
|
58
|
+
/**
|
59
|
+
* If true, renders the multi-select component as a child of another component.
|
60
|
+
* Optional, defaults to false.
|
61
|
+
*/
|
62
|
+
asChild?: boolean;
|
63
|
+
/**
|
64
|
+
* Additional class names to apply custom styles to the multi-select component.
|
65
|
+
* Optional, can be used to add custom styles.
|
66
|
+
*/
|
67
|
+
className?: string;
|
68
|
+
}
|
69
|
+
declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps & React.RefAttributes<HTMLButtonElement>>;
|
70
|
+
|
71
|
+
export { MultiSelect };
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{cva as e}from"class-variance-authority";import*as t from"react";import{c as r}from"../chunks/utils-BNmnOQuQ.mjs";import{c as a}from"../chunks/createLucideIcon-Okp8w8Ue.mjs";import{X as n}from"../chunks/x-Dnrlrmes.mjs";import{S as s}from"../chunks/separator-Bj88WMYr.mjs";import{C as o}from"../chunks/chevron-down-CWUqY12V.mjs";import{C as m}from"../chunks/check-DlWKp3dT.mjs";import{C as l,b as c,c as i,d as u,e as d,f as p,h}from"../chunks/command-DYCg8FQm.mjs";import{P as f,a as g,b as x}from"../chunks/popover-BaOty87a.mjs";import{B as k}from"../chunks/button-kxm0Lckx.mjs";import{B as v}from"../chunks/badge-BIhNGnoC.mjs";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"../chunks/index-g796WVS-.mjs";import"react-dom";import"@radix-ui/react-slot";import"react/jsx-runtime";import"../chunks/index-DzvdVz0F.mjs";import"../chunks/index-pz7_bV3J.mjs";import"../chunks/index-C-gmRzgE.mjs";import"../chunks/index-Cy8Nz9EO.mjs";import"../chunks/index-sxa3-G-E.mjs";import"../chunks/index-Di_4GEUt.mjs";import"../chunks/index-j5UZGMap.mjs";import"../chunks/index-BqVtEtRQ.mjs";import"../chunks/index-BsSBJ3PL.mjs";import"../chunks/tslib.es6-1P1xnW5u.mjs";import"../chunks/dialog-DTcjPj46.mjs";import"../chunks/index-Gmu-glAo.mjs";import"../chunks/index-jhOC7m1Z.mjs";const y=a("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),b=a("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]),E=e("m-1 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),j=t.forwardRef(({options:e,onValueChange:a,variant:j,defaultValue:N=[],placeholder:w="Select options",animation:C=0,maxCount:S=3,modalPopover:M=!1,asChild:P=!1,className:z,...D},B)=>{const[L,V]=t.useState(N),[$,_]=t.useState(!1),[q,A]=t.useState(!1),H=e=>{const t=L.includes(e)?L.filter(t=>t!==e):[...L,e];V(t),a(t)},K=()=>{V([]),a([])};return t.createElement(f,{open:$,onOpenChange:_,modal:M},t.createElement(g,{asChild:!0},t.createElement(k,{ref:B,...D,onClick:()=>{_(e=>!e)},className:r("flex h-auto min-h-10 w-full items-center justify-between rounded-md border bg-inherit p-1 hover:bg-inherit [&_svg]:pointer-events-auto",z)},L.length>0?t.createElement("div",{className:"flex w-full items-center justify-between"},t.createElement("div",{className:"flex flex-wrap items-center"},L.slice(0,S).map(a=>{const n=e.find(e=>e.value===a),s=n?.icon;return t.createElement(v,{key:a,className:r(q?"animate-bounce":"",E({variant:j})),style:{animationDuration:`${C}s`}},s&&t.createElement(s,{className:"mr-2 h-4 w-4"}),n?.label,t.createElement(y,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),H(a)}}))}),L.length>S&&t.createElement(v,{className:r("text-foreground border-foreground/1 bg-transparent hover:bg-transparent",q?"animate-bounce":"",E({variant:j})),style:{animationDuration:`${C}s`}},`+ ${L.length-S} more`,t.createElement(y,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),(()=>{const e=L.slice(0,S);V(e),a(e)})()}}))),t.createElement("div",{className:"flex items-center justify-between"},t.createElement(n,{className:"text-muted-foreground mx-2 h-4 cursor-pointer",onClick:e=>{e.stopPropagation(),K()}}),t.createElement(s,{orientation:"vertical",className:"flex h-full min-h-6"}),t.createElement(o,{className:"text-muted-foreground mx-2 h-4 cursor-pointer"}))):t.createElement("div",{className:"mx-auto flex w-full items-center justify-between"},t.createElement("span",{className:"text-muted-foreground mx-3 text-sm"},w),t.createElement(o,{className:"text-muted-foreground mx-2 h-4 cursor-pointer"})))),t.createElement(x,{className:"w-auto p-0",align:"start",onEscapeKeyDown:()=>_(!1)},t.createElement(l,null,t.createElement(c,{placeholder:"Search...",onKeyDown:e=>{if("Enter"===e.key)_(!0);else if("Backspace"===e.key&&!e.currentTarget.value){const e=[...L];e.pop(),V(e),a(e)}}}),t.createElement(i,null,t.createElement(u,null,"No results found."),t.createElement(d,null,t.createElement(p,{key:"all",onSelect:()=>{if(L.length===e.length)K();else{const t=e.map(e=>e.value);V(t),a(t)}},className:"cursor-pointer"},t.createElement("div",{className:r("border-primary mr-2 flex h-4 w-4 items-center justify-center rounded-sm border",L.length===e.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible")},t.createElement(m,{className:"h-4 w-4 text-white"})),t.createElement("span",null,"(Select All)")),e.map(e=>{const a=L.includes(e.value);return t.createElement(p,{key:e.value,onSelect:()=>H(e.value),className:"cursor-pointer"},t.createElement("div",{className:r("border-primary mr-2 flex h-4 w-4 items-center justify-center rounded-sm border",a?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible")},t.createElement(m,{className:"h-4 w-4 text-white"})),e.icon&&t.createElement(e.icon,{className:"text-muted-foreground mr-2 h-4 w-4"}),t.createElement("span",null,e.label))})),t.createElement(h,null),t.createElement(d,null,t.createElement("div",{className:"flex items-center justify-between"},L.length>0&&t.createElement(t.Fragment,null,t.createElement(p,{onSelect:K,className:"flex-1 cursor-pointer justify-center"},"Clear"),t.createElement(s,{orientation:"vertical",className:"flex h-full min-h-6"})),t.createElement(p,{onSelect:()=>_(!1),className:"max-w-full flex-1 cursor-pointer justify-center"},"Close")))))),C>0&&L.length>0&&t.createElement(b,{className:r("text-foreground bg-background my-2 h-3 w-3 cursor-pointer",q?"":"text-muted-foreground"),onClick:()=>A(!q)}))});j.displayName="MultiSelect";export{j as MultiSelect};
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../node_modules/lucide-react/dist/esm/icons/circle-x.js","../../node_modules/lucide-react/dist/esm/icons/wand-sparkles.js","../../src/components/ui/multi-select/multi-select.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.479.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"m15 9-6 6\", key: \"1uzhvr\" }],\n [\"path\", { d: \"m9 9 6 6\", key: \"z0biqf\" }]\n];\nconst CircleX = createLucideIcon(\"CircleX\", __iconNode);\n\nexport { __iconNode, CircleX as default };\n//# sourceMappingURL=circle-x.js.map\n","/**\n * @license lucide-react v0.479.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72\",\n key: \"ul74o6\"\n }\n ],\n [\"path\", { d: \"m14 7 3 3\", key: \"1r5n42\" }],\n [\"path\", { d: \"M5 6v4\", key: \"ilb8ba\" }],\n [\"path\", { d: \"M19 14v4\", key: \"blhpug\" }],\n [\"path\", { d: \"M10 2v2\", key: \"7u0qdc\" }],\n [\"path\", { d: \"M7 8H3\", key: \"zfb6yr\" }],\n [\"path\", { d: \"M21 16h-4\", key: \"1cnmox\" }],\n [\"path\", { d: \"M11 3H9\", key: \"1obp7u\" }]\n];\nconst WandSparkles = createLucideIcon(\"WandSparkles\", __iconNode);\n\nexport { __iconNode, WandSparkles as default };\n//# sourceMappingURL=wand-sparkles.js.map\n","import { type VariantProps, cva } from \"class-variance-authority\";\nimport { CheckIcon, ChevronDown, WandSparkles, XCircle, XIcon } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tCommand,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandInput,\n\tCommandItem,\n\tCommandList,\n\tCommandSeparator,\n} from \"@/components/ui/command\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { Separator } from \"@/components/ui/separator\";\nimport { cn } from \"@/lib/utils\";\n\n/**\n * Variants for the multi-select component to handle different styles.\n * Uses class-variance-authority (cva) to define different styles based on \"variant\" prop.\n */\nconst multiSelectVariants = cva(\n\t\"m-1 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"border-foreground/10 text-foreground bg-card hover:bg-card/80\",\n\t\t\t\tsecondary:\n\t\t\t\t\t\"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n\t\t\t\tdestructive:\n\t\t\t\t\t\"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80\",\n\t\t\t\tinverted: \"inverted\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t},\n\t},\n);\n\n/**\n * Props for MultiSelect component\n */\ninterface MultiSelectProps\n\textends React.ButtonHTMLAttributes<HTMLButtonElement>,\n\t\tVariantProps<typeof multiSelectVariants> {\n\t/**\n\t * An array of option objects to be displayed in the multi-select component.\n\t * Each option object has a label, value, and an optional icon.\n\t */\n\toptions: {\n\t\t/** The text to display for the option. */\n\t\tlabel: string;\n\t\t/** The unique value associated with the option. */\n\t\tvalue: string;\n\t\t/** Optional icon component to display alongside the option. */\n\t\ticon?: React.ComponentType<{ className?: string }>;\n\t}[];\n\n\t/**\n\t * Callback function triggered when the selected values change.\n\t * Receives an array of the new selected values.\n\t */\n\tonValueChange: (value: string[]) => void;\n\n\t/** The default selected values when the component mounts. */\n\tdefaultValue?: string[];\n\n\t/**\n\t * Placeholder text to be displayed when no values are selected.\n\t * Optional, defaults to \"Select options\".\n\t */\n\tplaceholder?: string;\n\n\t/**\n\t * Animation duration in seconds for the visual effects (e.g., bouncing badges).\n\t * Optional, defaults to 0 (no animation).\n\t */\n\tanimation?: number;\n\n\t/**\n\t * Maximum number of items to display. Extra selected items will be summarized.\n\t * Optional, defaults to 3.\n\t */\n\tmaxCount?: number;\n\n\t/**\n\t * The modality of the popover. When set to true, interaction with outside elements\n\t * will be disabled and only popover content will be visible to screen readers.\n\t * Optional, defaults to false.\n\t */\n\tmodalPopover?: boolean;\n\n\t/**\n\t * If true, renders the multi-select component as a child of another component.\n\t * Optional, defaults to false.\n\t */\n\tasChild?: boolean;\n\n\t/**\n\t * Additional class names to apply custom styles to the multi-select component.\n\t * Optional, can be used to add custom styles.\n\t */\n\tclassName?: string;\n}\n\nexport const MultiSelect = React.forwardRef<HTMLButtonElement, MultiSelectProps>(\n\t(\n\t\t{\n\t\t\toptions,\n\t\t\tonValueChange,\n\t\t\tvariant,\n\t\t\tdefaultValue = [],\n\t\t\tplaceholder = \"Select options\",\n\t\t\tanimation = 0,\n\t\t\tmaxCount = 3,\n\t\t\tmodalPopover = false,\n\t\t\tasChild = false,\n\t\t\tclassName,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst [selectedValues, setSelectedValues] = React.useState<string[]>(defaultValue);\n\t\tconst [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n\t\tconst [isAnimating, setIsAnimating] = React.useState(false);\n\n\t\tconst handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n\t\t\tif (event.key === \"Enter\") {\n\t\t\t\tsetIsPopoverOpen(true);\n\t\t\t} else if (event.key === \"Backspace\" && !event.currentTarget.value) {\n\t\t\t\tconst newSelectedValues = [...selectedValues];\n\t\t\t\tnewSelectedValues.pop();\n\t\t\t\tsetSelectedValues(newSelectedValues);\n\t\t\t\tonValueChange(newSelectedValues);\n\t\t\t}\n\t\t};\n\n\t\tconst toggleOption = (option: string) => {\n\t\t\tconst newSelectedValues = selectedValues.includes(option)\n\t\t\t\t? selectedValues.filter((value) => value !== option)\n\t\t\t\t: [...selectedValues, option];\n\t\t\tsetSelectedValues(newSelectedValues);\n\t\t\tonValueChange(newSelectedValues);\n\t\t};\n\n\t\tconst handleClear = () => {\n\t\t\tsetSelectedValues([]);\n\t\t\tonValueChange([]);\n\t\t};\n\n\t\tconst handleTogglePopover = () => {\n\t\t\tsetIsPopoverOpen((prev) => !prev);\n\t\t};\n\n\t\tconst clearExtraOptions = () => {\n\t\t\tconst newSelectedValues = selectedValues.slice(0, maxCount);\n\t\t\tsetSelectedValues(newSelectedValues);\n\t\t\tonValueChange(newSelectedValues);\n\t\t};\n\n\t\tconst toggleAll = () => {\n\t\t\tif (selectedValues.length === options.length) {\n\t\t\t\thandleClear();\n\t\t\t} else {\n\t\t\t\tconst allValues = options.map((option) => option.value);\n\t\t\t\tsetSelectedValues(allValues);\n\t\t\t\tonValueChange(allValues);\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen} modal={modalPopover}>\n\t\t\t\t<PopoverTrigger asChild>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t\tonClick={handleTogglePopover}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\"flex h-auto min-h-10 w-full items-center justify-between rounded-md border bg-inherit p-1 hover:bg-inherit [&_svg]:pointer-events-auto\",\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{selectedValues.length > 0 ? (\n\t\t\t\t\t\t\t<div className=\"flex w-full items-center justify-between\">\n\t\t\t\t\t\t\t\t<div className=\"flex flex-wrap items-center\">\n\t\t\t\t\t\t\t\t\t{selectedValues.slice(0, maxCount).map((value) => {\n\t\t\t\t\t\t\t\t\t\tconst option = options.find((o) => o.value === value);\n\t\t\t\t\t\t\t\t\t\tconst IconComponent = option?.icon;\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<Badge\n\t\t\t\t\t\t\t\t\t\t\t\tkey={value}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\tisAnimating ? \"animate-bounce\" : \"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tmultiSelectVariants({ variant }),\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ animationDuration: `${animation}s` }}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{IconComponent && <IconComponent className=\"mr-2 h-4 w-4\" />}\n\t\t\t\t\t\t\t\t\t\t\t\t{option?.label}\n\t\t\t\t\t\t\t\t\t\t\t\t<XCircle\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"ml-2 h-4 w-4 cursor-pointer\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttoggleOption(value);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t{selectedValues.length > maxCount && (\n\t\t\t\t\t\t\t\t\t\t<Badge\n\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\"text-foreground border-foreground/1 bg-transparent hover:bg-transparent\",\n\t\t\t\t\t\t\t\t\t\t\t\tisAnimating ? \"animate-bounce\" : \"\",\n\t\t\t\t\t\t\t\t\t\t\t\tmultiSelectVariants({ variant }),\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\tstyle={{ animationDuration: `${animation}s` }}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{`+ ${selectedValues.length - maxCount} more`}\n\t\t\t\t\t\t\t\t\t\t\t<XCircle\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"ml-2 h-4 w-4 cursor-pointer\"\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\t\t\tclearExtraOptions();\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t\t\t\t\t\t<XIcon\n\t\t\t\t\t\t\t\t\t\tclassName=\"text-muted-foreground mx-2 h-4 cursor-pointer\"\n\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\thandleClear();\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<Separator orientation=\"vertical\" className=\"flex h-full min-h-6\" />\n\t\t\t\t\t\t\t\t\t<ChevronDown className=\"text-muted-foreground mx-2 h-4 cursor-pointer\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className=\"mx-auto flex w-full items-center justify-between\">\n\t\t\t\t\t\t\t\t<span className=\"text-muted-foreground mx-3 text-sm\">{placeholder}</span>\n\t\t\t\t\t\t\t\t<ChevronDown className=\"text-muted-foreground mx-2 h-4 cursor-pointer\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Button>\n\t\t\t\t</PopoverTrigger>\n\t\t\t\t<PopoverContent\n\t\t\t\t\tclassName=\"w-auto p-0\"\n\t\t\t\t\talign=\"start\"\n\t\t\t\t\tonEscapeKeyDown={() => setIsPopoverOpen(false)}\n\t\t\t\t>\n\t\t\t\t\t<Command>\n\t\t\t\t\t\t<CommandInput placeholder=\"Search...\" onKeyDown={handleInputKeyDown} />\n\t\t\t\t\t\t<CommandList>\n\t\t\t\t\t\t\t<CommandEmpty>No results found.</CommandEmpty>\n\t\t\t\t\t\t\t<CommandGroup>\n\t\t\t\t\t\t\t\t<CommandItem key=\"all\" onSelect={toggleAll} className=\"cursor-pointer\">\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\"border-primary mr-2 flex h-4 w-4 items-center justify-center rounded-sm border\",\n\t\t\t\t\t\t\t\t\t\t\tselectedValues.length === options.length\n\t\t\t\t\t\t\t\t\t\t\t\t? \"bg-primary text-primary-foreground\"\n\t\t\t\t\t\t\t\t\t\t\t\t: \"opacity-50 [&_svg]:invisible\",\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<CheckIcon className=\"h-4 w-4 text-white\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span>(Select All)</span>\n\t\t\t\t\t\t\t\t</CommandItem>\n\t\t\t\t\t\t\t\t{options.map((option) => {\n\t\t\t\t\t\t\t\t\tconst isSelected = selectedValues.includes(option.value);\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<CommandItem\n\t\t\t\t\t\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\t\t\t\t\t\tonSelect={() => toggleOption(option.value)}\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"cursor-pointer\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"border-primary mr-2 flex h-4 w-4 items-center justify-center rounded-sm border\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tisSelected\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? \"bg-primary text-primary-foreground\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: \"opacity-50 [&_svg]:invisible\",\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<CheckIcon className=\"h-4 w-4 text-white\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t{option.icon && (\n\t\t\t\t\t\t\t\t\t\t\t\t<option.icon className=\"text-muted-foreground mr-2 h-4 w-4\" />\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t<span>{option.label}</span>\n\t\t\t\t\t\t\t\t\t\t</CommandItem>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t</CommandGroup>\n\t\t\t\t\t\t\t<CommandSeparator />\n\t\t\t\t\t\t\t<CommandGroup>\n\t\t\t\t\t\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t\t\t\t\t\t{selectedValues.length > 0 && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<CommandItem\n\t\t\t\t\t\t\t\t\t\t\t\tonSelect={handleClear}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"flex-1 cursor-pointer justify-center\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tClear\n\t\t\t\t\t\t\t\t\t\t\t</CommandItem>\n\t\t\t\t\t\t\t\t\t\t\t<Separator orientation=\"vertical\" className=\"flex h-full min-h-6\" />\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<CommandItem\n\t\t\t\t\t\t\t\t\t\tonSelect={() => setIsPopoverOpen(false)}\n\t\t\t\t\t\t\t\t\t\tclassName=\"max-w-full flex-1 cursor-pointer justify-center\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tClose\n\t\t\t\t\t\t\t\t\t</CommandItem>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</CommandGroup>\n\t\t\t\t\t\t</CommandList>\n\t\t\t\t\t</Command>\n\t\t\t\t</PopoverContent>\n\t\t\t\t{animation > 0 && selectedValues.length > 0 && (\n\t\t\t\t\t<WandSparkles\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\"text-foreground bg-background my-2 h-3 w-3 cursor-pointer\",\n\t\t\t\t\t\t\tisAnimating ? \"\" : \"text-muted-foreground\",\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonClick={() => setIsAnimating(!isAnimating)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Popover>\n\t\t);\n\t},\n);\n\nMultiSelect.displayName = \"MultiSelect\";\n"],"names":["CircleX","createLucideIcon","cx","cy","r","key","d","WandSparkles","multiSelectVariants","cva","variants","variant","default","secondary","destructive","inverted","defaultVariants","MultiSelect","React","forwardRef","options","onValueChange","defaultValue","placeholder","animation","maxCount","modalPopover","asChild","className","props","ref","selectedValues","setSelectedValues","useState","isPopoverOpen","setIsPopoverOpen","isAnimating","setIsAnimating","toggleOption","option","newSelectedValues","includes","filter","value","handleClear","createElement","Popover","open","onOpenChange","modal","PopoverTrigger","Button","onClick","prev","cn","length","div","slice","map","find","o","IconComponent","icon","Badge","style","animationDuration","label","XCircle","event","stopPropagation","clearExtraOptions","XIcon","Separator","orientation","ChevronDown","span","PopoverContent","align","onEscapeKeyDown","Command","CommandInput","onKeyDown","currentTarget","pop","CommandList","CommandEmpty","CommandGroup","CommandItem","onSelect","allValues","CheckIcon","isSelected","CommandSeparator","Fragment","displayName"],"mappings":"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","x_google_ignoreList":[0,1]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export{P as Pagination,a as PaginationContent,f as PaginationEllipsis,c as PaginationItem,b as PaginationLink,e as PaginationNext,d as PaginationPrevious}from"../chunks/pagination-
|
1
|
+
export{P as Pagination,a as PaginationContent,f as PaginationEllipsis,c as PaginationItem,b as PaginationLink,e as PaginationNext,d as PaginationPrevious}from"../chunks/pagination-BQCy5ruZ.mjs";import"../chunks/utils-BNmnOQuQ.mjs";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"react";import"../chunks/chevron-left-CJfbOy3n.mjs";import"../chunks/createLucideIcon-Okp8w8Ue.mjs";import"../chunks/chevron-right-CepU0QYJ.mjs";import"../chunks/button-kxm0Lckx.mjs";import"@radix-ui/react-slot";import"class-variance-authority";
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/popover/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export{P as Popover,c as PopoverAnchor,b as PopoverContent,a as PopoverTrigger}from"../chunks/popover-
|
1
|
+
export{P as Popover,c as PopoverAnchor,b as PopoverContent,a as PopoverTrigger}from"../chunks/popover-BaOty87a.mjs";import"../chunks/utils-BNmnOQuQ.mjs";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"react";import"../chunks/index-pz7_bV3J.mjs";import"../chunks/index-C-gmRzgE.mjs";import"../chunks/index-Cy8Nz9EO.mjs";import"react/jsx-runtime";import"../chunks/index-j5UZGMap.mjs";import"../chunks/index-g796WVS-.mjs";import"react-dom";import"@radix-ui/react-slot";import"../chunks/index-BqVtEtRQ.mjs";import"../chunks/index-BsSBJ3PL.mjs";import"../chunks/tslib.es6-1P1xnW5u.mjs";import"../chunks/index-sxa3-G-E.mjs";import"../chunks/index-Gmu-glAo.mjs";import"../chunks/index-jhOC7m1Z.mjs";import"../chunks/index-Di_4GEUt.mjs";
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/progress/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export{P as Progress}from"../chunks/progress-
|
1
|
+
export{P as Progress}from"../chunks/progress-B01RWEwW.mjs";import"../chunks/utils-BNmnOQuQ.mjs";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"react";import"../chunks/index-Cy8Nz9EO.mjs";import"react/jsx-runtime";import"../chunks/index-g796WVS-.mjs";import"react-dom";import"@radix-ui/react-slot";
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export{S as ScrollArea,a as ScrollBar}from"../chunks/scroll-area-
|
1
|
+
export{S as ScrollArea,a as ScrollBar}from"../chunks/scroll-area-DBEmK194.mjs";import"../chunks/utils-BNmnOQuQ.mjs";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"react";import"../chunks/index-g796WVS-.mjs";import"react-dom";import"@radix-ui/react-slot";import"react/jsx-runtime";import"../chunks/index-pz7_bV3J.mjs";import"../chunks/index-C-gmRzgE.mjs";import"../chunks/index-Cy8Nz9EO.mjs";import"../chunks/index-BqVtEtRQ.mjs";import"../chunks/index-BEptPvC9.mjs";
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/select/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export{S as Select,a as SelectContent,b as SelectGroup,c as SelectItem,d as SelectLabel,e as SelectScrollDownButton,f as SelectScrollUpButton,g as SelectSeparator,h as SelectTrigger,i as SelectValue}from"../chunks/select-
|
1
|
+
export{S as Select,a as SelectContent,b as SelectGroup,c as SelectItem,d as SelectLabel,e as SelectScrollDownButton,f as SelectScrollUpButton,g as SelectSeparator,h as SelectTrigger,i as SelectValue}from"../chunks/select-DluWFNkM.mjs";import"../chunks/utils-BNmnOQuQ.mjs";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"@radix-ui/react-select";import"react";import"../chunks/check-DlWKp3dT.mjs";import"../chunks/createLucideIcon-Okp8w8Ue.mjs";import"../chunks/chevron-down-CWUqY12V.mjs";
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/separator/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
export{S as Separator}from"../chunks/separator-Bj88WMYr.mjs";import"../chunks/utils-BNmnOQuQ.mjs";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"react";import"../chunks/index-g796WVS-.mjs";import"react-dom";import"@radix-ui/react-slot";import"react/jsx-runtime";
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/sheet/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{c as t}from"../chunks/utils-
|
1
|
+
import{c as t}from"../chunks/utils-BNmnOQuQ.mjs";import{R as e,b as s,C as a,a as o,T as n,D as r,P as i,O as m}from"../chunks/index-DzvdVz0F.mjs";import l from"react";import{X as c}from"../chunks/x-Dnrlrmes.mjs";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"../chunks/index-pz7_bV3J.mjs";import"../chunks/index-C-gmRzgE.mjs";import"../chunks/index-Cy8Nz9EO.mjs";import"react/jsx-runtime";import"../chunks/index-sxa3-G-E.mjs";import"../chunks/index-Di_4GEUt.mjs";import"../chunks/index-j5UZGMap.mjs";import"../chunks/index-g796WVS-.mjs";import"react-dom";import"@radix-ui/react-slot";import"../chunks/index-BqVtEtRQ.mjs";import"../chunks/index-BsSBJ3PL.mjs";import"../chunks/tslib.es6-1P1xnW5u.mjs";import"../chunks/createLucideIcon-Okp8w8Ue.mjs";function d({...t}){return l.createElement(e,{"data-slot":"sheet",...t})}function u({...t}){return l.createElement(s,{"data-slot":"sheet-trigger",...t})}function p({...t}){return l.createElement(a,{"data-slot":"sheet-close",...t})}function f({...t}){return l.createElement(i,{"data-slot":"sheet-portal",...t})}function h({className:e,...s}){return l.createElement(m,{"data-slot":"sheet-overlay",className:t("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...s})}function x({className:e,children:s,side:n="right",...r}){return l.createElement(f,null,l.createElement(h,null),l.createElement(o,{"data-slot":"sheet-content",className:t("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 gap-4 p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500","right"===n&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm","left"===n&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm","top"===n&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 border-b","bottom"===n&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 border-t",e),...r},s,l.createElement(a,{className:"border-border-grid-container bg-card ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 cursor-pointer rounded-sm border p-1.5 opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none"},l.createElement(c,{className:"size-4"}),l.createElement("span",{className:"sr-only"},"Close"))))}function b({className:e,...s}){return l.createElement("div",{"data-slot":"sheet-header",className:t("flex flex-col space-y-2 text-center sm:text-left",e),...s})}function g({className:e,...s}){return l.createElement("div",{"data-slot":"sheet-footer",className:t("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...s})}function j({className:e,...s}){return l.createElement(n,{"data-slot":"sheet-title",className:t("text-foreground text-lg font-semibold",e),...s})}function k({className:e,...s}){return l.createElement(r,{"data-slot":"sheet-description",className:t("text-muted-foreground text-sm",e),...s})}export{d as Sheet,p as SheetClose,x as SheetContent,k as SheetDescription,g as SheetFooter,b as SheetHeader,j as SheetTitle,u as SheetTrigger};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/skeleton/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export{S as Skeleton}from"../chunks/skeleton-
|
1
|
+
export{S as Skeleton}from"../chunks/skeleton-BL6dx9Bm.mjs";import"../chunks/utils-BNmnOQuQ.mjs";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"react";
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/sortable/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export{S as Sortable,a as SortableDragHandle,b as SortableItem,c as SortableOverlay}from"../chunks/sortable-
|
1
|
+
export{S as Sortable,a as SortableDragHandle,b as SortableItem,c as SortableOverlay}from"../chunks/sortable-DrKB22S8.mjs";import"react";import"react-dom";import"@radix-ui/react-slot";import"../chunks/utils-BNmnOQuQ.mjs";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"../chunks/button-kxm0Lckx.mjs";import"class-variance-authority";
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/table/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export{T as Table,b as TableBody,g as TableCaption,f as TableCell,c as TableFooter,d as TableHead,a as TableHeader,e as TableRow}from"../chunks/table-
|
1
|
+
export{T as Table,b as TableBody,g as TableCaption,f as TableCell,c as TableFooter,d as TableHead,a as TableHeader,e as TableRow}from"../chunks/table-BvtQHwsd.mjs";import"../chunks/utils-BNmnOQuQ.mjs";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"react";
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/tabs/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{c as e}from"../chunks/utils-
|
1
|
+
import{c as e}from"../chunks/utils-BNmnOQuQ.mjs";import*as t from"react";import a from"react";import{c as n,P as r}from"../chunks/index-pz7_bV3J.mjs";import{c as o}from"../chunks/index-Cy8Nz9EO.mjs";import{c as i,R as s,I as c}from"../chunks/index-Bmfh-9vj.mjs";import{P as d}from"../chunks/index-g796WVS-.mjs";import{u as l}from"../chunks/index-BEptPvC9.mjs";import{u}from"../chunks/index-Di_4GEUt.mjs";import{u as m}from"../chunks/index-sxa3-G-E.mjs";import{jsx as f}from"react/jsx-runtime";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"../chunks/index-C-gmRzgE.mjs";import"@radix-ui/react-collection";import"../chunks/index-BqVtEtRQ.mjs";import"react-dom";import"@radix-ui/react-slot";var p="Tabs",[b,v]=o(p,[i]),h=i(),[g,x]=b(p),k=t.forwardRef((e,t)=>{const{__scopeTabs:a,value:n,onValueChange:r,defaultValue:o,orientation:i="horizontal",dir:s,activationMode:c="automatic",...b}=e,v=l(s),[h,x]=u({prop:n,onChange:r,defaultProp:o??"",caller:p});return f(g,{scope:a,baseId:m(),value:h,onValueChange:x,orientation:i,dir:v,activationMode:c,children:f(d.div,{dir:v,"data-orientation":i,...b,ref:t})})});k.displayName=p;var y="TabsList",j=t.forwardRef((e,t)=>{const{__scopeTabs:a,loop:n=!0,...r}=e,o=x(y,a),i=h(a);return f(s,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:n,children:f(d.div,{role:"tablist","aria-orientation":o.orientation,...r,ref:t})})});j.displayName=y;var w="TabsTrigger",N=t.forwardRef((e,t)=>{const{__scopeTabs:a,value:r,disabled:o=!1,...i}=e,s=x(w,a),l=h(a),u=T(s.baseId,r),m=I(s.baseId,r),p=r===s.value;return f(c,{asChild:!0,...l,focusable:!o,active:p,children:f(d.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":m,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...i,ref:t,onMouseDown:n(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():s.onValueChange(r)}),onKeyDown:n(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&s.onValueChange(r)}),onFocus:n(e.onFocus,()=>{const e="manual"!==s.activationMode;p||o||!e||s.onValueChange(r)})})})});N.displayName=w;var _="TabsContent",C=t.forwardRef((e,a)=>{const{__scopeTabs:n,value:o,forceMount:i,children:s,...c}=e,l=x(_,n),u=T(l.baseId,o),m=I(l.baseId,o),p=o===l.value,b=t.useRef(p);return t.useEffect(()=>{const e=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(e)},[]),f(r,{present:i||p,children:({present:t})=>f(d.div,{"data-state":p?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!t,id:m,tabIndex:0,...c,ref:a,style:{...e.style,animationDuration:b.current?"0s":void 0},children:t&&s})})});function T(e,t){return`${e}-trigger-${t}`}function I(e,t){return`${e}-content-${t}`}C.displayName=_;var D=k,E=j,M=N,R=C;function V({className:t,...n}){return a.createElement(D,{"data-slot":"tabs",className:e("flex flex-col gap-2",t),...n})}function F({className:t,...n}){return a.createElement(E,{"data-slot":"tabs-list",className:e("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",t),...n})}function $({className:t,...n}){return a.createElement(M,{"data-slot":"tabs-trigger",className:e("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/50 inline-flex h-[calc(100%-1px)] flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n})}function z({className:t,...n}){return a.createElement(R,{"data-slot":"tabs-content",className:e("flex-1 outline-none",t),...n})}export{V as Tabs,z as TabsContent,F as TabsList,$ as TabsTrigger};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/toast/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{c as e}from"../chunks/utils-Uj0fSFoG.mjs";import*as t from"react";import r from"react";import*as o from"react-dom";import{u as n,P as s,c as a}from"../chunks/index-BikeYhoq.mjs";import{createCollection as i}from"@radix-ui/react-collection";import{c}from"../chunks/index-BD0ct0kD.mjs";import{B as d,R as u,P as l}from"../chunks/index-M45g_qo0.mjs";import{P as p,d as m}from"../chunks/index-BoVEch5q.mjs";import{u as f}from"../chunks/index-gINpS7bU.mjs";import{u as v}from"../chunks/index-DS-C90jw.mjs";import{u as w}from"../chunks/index-ojKRapLJ.mjs";import{V as h}from"../chunks/index-Bn7EFHMT.mjs";import{jsx as x,jsxs as y,Fragment as g}from"react/jsx-runtime";import{cva as E}from"class-variance-authority";import{X as T}from"../chunks/x-HCYpfOZx.mjs";import"../chunks/bundle-mjs-5yKezECc.mjs";import"@radix-ui/react-slot";import"../chunks/createLucideIcon-D9esjvN9.mjs";var b="ToastProvider",[C,P,R]=i("Toast"),[N,k]=c("Toast",[R]),[D,L]=N(b),S=e=>{const{__scopeToast:r,label:o="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:a=50,children:i}=e,[c,d]=t.useState(null),[u,l]=t.useState(0),p=t.useRef(!1),m=t.useRef(!1);return o.trim(),x(C.Provider,{scope:r,children:x(D,{scope:r,label:o,duration:n,swipeDirection:s,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:d,onToastAdd:t.useCallback(()=>l(e=>e+1),[]),onToastRemove:t.useCallback(()=>l(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,children:i})})};S.displayName=b;var _="ToastViewport",F=["F8"],j="toast.viewportPause",A="toast.viewportResume",I=t.forwardRef((e,r)=>{const{__scopeToast:o,hotkey:s=F,label:a="Notifications ({hotkey})",...i}=e,c=L(_,o),u=P(o),l=t.useRef(null),m=t.useRef(null),f=t.useRef(null),v=t.useRef(null),w=n(r,v,c.onViewportChange),h=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=c.toastCount>0;t.useEffect(()=>{const e=e=>{0!==s.length&&s.every(t=>e[t]||e.code===t)&&v.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]),t.useEffect(()=>{const e=l.current,t=v.current;if(g&&e&&t){const r=()=>{if(!c.isClosePausedRef.current){const e=new CustomEvent(j);t.dispatchEvent(e),c.isClosePausedRef.current=!0}},o=()=>{if(c.isClosePausedRef.current){const e=new CustomEvent(A);t.dispatchEvent(e),c.isClosePausedRef.current=!1}},n=t=>{!e.contains(t.relatedTarget)&&o()},s=()=>{e.contains(document.activeElement)||o()};return e.addEventListener("focusin",r),e.addEventListener("focusout",n),e.addEventListener("pointermove",r),e.addEventListener("pointerleave",s),window.addEventListener("blur",r),window.addEventListener("focus",o),()=>{e.removeEventListener("focusin",r),e.removeEventListener("focusout",n),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",s),window.removeEventListener("blur",r),window.removeEventListener("focus",o)}}},[g,c.isClosePausedRef]);const E=t.useCallback(({tabbingDirection:e})=>{const t=u().map(t=>{const r=t.ref.current,o=[r,...ee(r)];return"forwards"===e?o:o.reverse()});return("forwards"===e?t.reverse():t).flat()},[u]);return t.useEffect(()=>{const e=v.current;if(e){const t=t=>{const r=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!r){const r=document.activeElement,o=t.shiftKey;if(t.target===e&&o)return void m.current?.focus();const n=E({tabbingDirection:o?"backwards":"forwards"}),s=n.findIndex(e=>e===r);te(n.slice(s+1))?t.preventDefault():o?m.current?.focus():f.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}},[u,E]),y(d,{ref:l,role:"region","aria-label":a.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&x(K,{ref:m,onFocusFromOutsideViewport:()=>{te(E({tabbingDirection:"forwards"}))}}),x(C.Slot,{scope:o,children:x(p.ol,{tabIndex:-1,...i,ref:w})}),g&&x(K,{ref:f,onFocusFromOutsideViewport:()=>{te(E({tabbingDirection:"backwards"}))}})]})});I.displayName=_;var M="ToastFocusProxy",K=t.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:o,...n}=e,s=L(M,r);return x(h,{"aria-hidden":!0,tabIndex:0,...n,ref:t,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!s.viewport?.contains(t)&&o()}})});K.displayName=M;var O="Toast",V=t.forwardRef((e,t)=>{const{forceMount:r,open:o,defaultOpen:n,onOpenChange:i,...c}=e,[d,u]=v({prop:o,defaultProp:n??!0,onChange:i,caller:O});return x(s,{present:r||d,children:x(X,{open:d,...c,ref:t,onClose:()=>u(!1),onPause:f(e.onPause),onResume:f(e.onResume),onSwipeStart:a(e.onSwipeStart,e=>{e.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:a(e.onSwipeMove,e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${r}px`)}),onSwipeCancel:a(e.onSwipeCancel,e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:a(e.onSwipeEnd,e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${r}px`),u(!1)})})})});V.displayName=O;var[$,U]=N(O,{onClose(){}}),X=t.forwardRef((e,r)=>{const{__scopeToast:s,type:i="foreground",duration:c,open:d,onClose:l,onEscapeKeyDown:m,onPause:v,onResume:w,onSwipeStart:h,onSwipeMove:E,onSwipeCancel:T,onSwipeEnd:b,...P}=e,R=L(O,s),[N,k]=t.useState(null),D=n(r,e=>k(e)),S=t.useRef(null),_=t.useRef(null),F=c||R.duration,I=t.useRef(0),M=t.useRef(F),K=t.useRef(0),{onToastAdd:V,onToastRemove:U}=R,X=f(()=>{const e=N?.contains(document.activeElement);e&&R.viewport?.focus(),l()}),B=t.useCallback(e=>{e&&e!==1/0&&(window.clearTimeout(K.current),I.current=(new Date).getTime(),K.current=window.setTimeout(X,e))},[X]);t.useEffect(()=>{const e=R.viewport;if(e){const t=()=>{B(M.current),w?.()},r=()=>{const e=(new Date).getTime()-I.current;M.current=M.current-e,window.clearTimeout(K.current),v?.()};return e.addEventListener(j,r),e.addEventListener(A,t),()=>{e.removeEventListener(j,r),e.removeEventListener(A,t)}}},[R.viewport,F,v,w,B]),t.useEffect(()=>{d&&!R.isClosePausedRef.current&&B(F)},[d,F,R.isClosePausedRef,B]),t.useEffect(()=>(V(),()=>U()),[V,U]);const H=t.useMemo(()=>N?J(N):null,[N]);return R.viewport?y(g,{children:[H&&x(q,{__scopeToast:s,role:"status","aria-live":"foreground"===i?"assertive":"polite","aria-atomic":!0,children:H}),x($,{scope:s,onClose:X,children:o.createPortal(x(C.ItemSlot,{scope:s,children:x(u,{asChild:!0,onEscapeKeyDown:a(m,()=>{R.isFocusedToastEscapeKeyDownRef.current||X(),R.isFocusedToastEscapeKeyDownRef.current=!1}),children:x(p.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":d?"open":"closed","data-swipe-direction":R.swipeDirection,...P,ref:D,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:a(e.onKeyDown,e=>{"Escape"===e.key&&(m?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(R.isFocusedToastEscapeKeyDownRef.current=!0,X()))}),onPointerDown:a(e.onPointerDown,e=>{0===e.button&&(S.current={x:e.clientX,y:e.clientY})}),onPointerMove:a(e.onPointerMove,e=>{if(!S.current)return;const t=e.clientX-S.current.x,r=e.clientY-S.current.y,o=Boolean(_.current),n=["left","right"].includes(R.swipeDirection),s=["left","up"].includes(R.swipeDirection)?Math.min:Math.max,a=n?s(0,t):0,i=n?0:s(0,r),c="touch"===e.pointerType?10:2,d={x:a,y:i},u={originalEvent:e,delta:d};o?(_.current=d,Q("toast.swipeMove",E,u,{discrete:!1})):Z(d,R.swipeDirection,c)?(_.current=d,Q("toast.swipeStart",h,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(r)>c)&&(S.current=null)}),onPointerUp:a(e.onPointerUp,e=>{const t=_.current,r=e.target;if(r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId),_.current=null,S.current=null,t){const r=e.currentTarget,o={originalEvent:e,delta:t};Z(t,R.swipeDirection,R.swipeThreshold)?Q("toast.swipeEnd",b,o,{discrete:!0}):Q("toast.swipeCancel",T,o,{discrete:!0}),r.addEventListener("click",e=>e.preventDefault(),{once:!0})}})})})}),R.viewport)})]}):null}),q=e=>{const{__scopeToast:r,children:o,...n}=e,s=L(O,r),[a,i]=t.useState(!1),[c,d]=t.useState(!1);return function(e=()=>{}){const t=f(e);w(()=>{let e=0,r=0;return e=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(r)}},[t])}(()=>i(!0)),t.useEffect(()=>{const e=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(e)},[]),c?null:x(l,{asChild:!0,children:x(h,{...n,children:a&&y(g,{children:[s.label," ",o]})})})},B=t.forwardRef((e,t)=>{const{__scopeToast:r,...o}=e;return x(p.div,{...o,ref:t})});B.displayName="ToastTitle";var H=t.forwardRef((e,t)=>{const{__scopeToast:r,...o}=e;return x(p.div,{...o,ref:t})});H.displayName="ToastDescription";var W=t.forwardRef((e,t)=>{const{altText:r,...o}=e;return r.trim()?x(G,{altText:r,asChild:!0,children:x(z,{...o,ref:t})}):null});W.displayName="ToastAction";var Y="ToastClose",z=t.forwardRef((e,t)=>{const{__scopeToast:r,...o}=e,n=U(Y,r);return x(G,{asChild:!0,children:x(p.button,{type:"button",...o,ref:t,onClick:a(e.onClick,n.onClose)})})});z.displayName=Y;var G=t.forwardRef((e,t)=>{const{__scopeToast:r,altText:o,...n}=e;return x(p.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...n,ref:t})});function J(e){const t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){const r=e.ariaHidden||e.hidden||"none"===e.style.display,o=""===e.dataset.radixToastAnnounceExclude;if(!r)if(o){const r=e.dataset.radixToastAnnounceAlt;r&&t.push(r)}else t.push(...J(e))}}),t}function Q(e,t,r,{discrete:o}){const n=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?m(n,s):n.dispatchEvent(s)}var Z=(e,t,r=0)=>{const o=Math.abs(e.x),n=Math.abs(e.y),s=o>n;return"left"===t||"right"===t?s&&o>r:!s&&n>r};function ee(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function te(e){const t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}var re=I,oe=V,ne=B,se=H,ae=W,ie=z;const ce=S,de=({className:t,...o})=>r.createElement(re,{"data-slot":"toast-viewport",className:e("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]",t),...o}),ue=E("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive-foreground bg-destructive-foreground text-destructive border-destructive"}},defaultVariants:{variant:"default"}}),le=({className:t,variant:o,...n})=>r.createElement(oe,{"data-slot":"toast-root",className:e(ue({variant:o}),t),...n}),pe=({className:t,...o})=>r.createElement(ae,{"data-slot":"toast-action",className:e("ring-offset-background hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none disabled:opacity-50",t),...o}),me=({className:t,...o})=>r.createElement(ie,{"data-slot":"toast-close",className:e("text-foreground/50 hover:text-foreground absolute top-2 right-2 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:ring-2 focus:outline-none group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...o},r.createElement(T,{className:"h-4 w-4"})),fe=({className:t,...o})=>r.createElement(ne,{"data-slot":"toast-title",className:e("text-sm font-semibold",t),...o}),ve=({className:t,...o})=>r.createElement(se,{"data-slot":"toast-description",className:e("text-sm opacity-90",t),...o});export{le as Toast,pe as ToastAction,me as ToastClose,ve as ToastDescription,ce as ToastProvider,fe as ToastTitle,de as ToastViewport};
|
1
|
+
import{c as e}from"../chunks/utils-BNmnOQuQ.mjs";import*as t from"react";import r from"react";import*as o from"react-dom";import{u as n,P as s,c as a}from"../chunks/index-pz7_bV3J.mjs";import{createCollection as i}from"@radix-ui/react-collection";import{c}from"../chunks/index-Cy8Nz9EO.mjs";import{B as d,R as u,P as l}from"../chunks/index-j5UZGMap.mjs";import{P as p,d as m}from"../chunks/index-g796WVS-.mjs";import{u as f}from"../chunks/index-BqVtEtRQ.mjs";import{u as v}from"../chunks/index-Di_4GEUt.mjs";import{u as w}from"../chunks/index-C-gmRzgE.mjs";import{V as h}from"../chunks/index-DUhfpjqn.mjs";import{jsx as x,jsxs as y,Fragment as g}from"react/jsx-runtime";import{cva as E}from"class-variance-authority";import{X as T}from"../chunks/x-Dnrlrmes.mjs";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"@radix-ui/react-slot";import"../chunks/createLucideIcon-Okp8w8Ue.mjs";var b="ToastProvider",[C,P,R]=i("Toast"),[N,k]=c("Toast",[R]),[D,L]=N(b),S=e=>{const{__scopeToast:r,label:o="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:a=50,children:i}=e,[c,d]=t.useState(null),[u,l]=t.useState(0),p=t.useRef(!1),m=t.useRef(!1);return o.trim(),x(C.Provider,{scope:r,children:x(D,{scope:r,label:o,duration:n,swipeDirection:s,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:d,onToastAdd:t.useCallback(()=>l(e=>e+1),[]),onToastRemove:t.useCallback(()=>l(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,children:i})})};S.displayName=b;var _="ToastViewport",F=["F8"],j="toast.viewportPause",A="toast.viewportResume",I=t.forwardRef((e,r)=>{const{__scopeToast:o,hotkey:s=F,label:a="Notifications ({hotkey})",...i}=e,c=L(_,o),u=P(o),l=t.useRef(null),m=t.useRef(null),f=t.useRef(null),v=t.useRef(null),w=n(r,v,c.onViewportChange),h=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=c.toastCount>0;t.useEffect(()=>{const e=e=>{0!==s.length&&s.every(t=>e[t]||e.code===t)&&v.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]),t.useEffect(()=>{const e=l.current,t=v.current;if(g&&e&&t){const r=()=>{if(!c.isClosePausedRef.current){const e=new CustomEvent(j);t.dispatchEvent(e),c.isClosePausedRef.current=!0}},o=()=>{if(c.isClosePausedRef.current){const e=new CustomEvent(A);t.dispatchEvent(e),c.isClosePausedRef.current=!1}},n=t=>{!e.contains(t.relatedTarget)&&o()},s=()=>{e.contains(document.activeElement)||o()};return e.addEventListener("focusin",r),e.addEventListener("focusout",n),e.addEventListener("pointermove",r),e.addEventListener("pointerleave",s),window.addEventListener("blur",r),window.addEventListener("focus",o),()=>{e.removeEventListener("focusin",r),e.removeEventListener("focusout",n),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",s),window.removeEventListener("blur",r),window.removeEventListener("focus",o)}}},[g,c.isClosePausedRef]);const E=t.useCallback(({tabbingDirection:e})=>{const t=u().map(t=>{const r=t.ref.current,o=[r,...ee(r)];return"forwards"===e?o:o.reverse()});return("forwards"===e?t.reverse():t).flat()},[u]);return t.useEffect(()=>{const e=v.current;if(e){const t=t=>{const r=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!r){const r=document.activeElement,o=t.shiftKey;if(t.target===e&&o)return void m.current?.focus();const n=E({tabbingDirection:o?"backwards":"forwards"}),s=n.findIndex(e=>e===r);te(n.slice(s+1))?t.preventDefault():o?m.current?.focus():f.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}},[u,E]),y(d,{ref:l,role:"region","aria-label":a.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&x(K,{ref:m,onFocusFromOutsideViewport:()=>{te(E({tabbingDirection:"forwards"}))}}),x(C.Slot,{scope:o,children:x(p.ol,{tabIndex:-1,...i,ref:w})}),g&&x(K,{ref:f,onFocusFromOutsideViewport:()=>{te(E({tabbingDirection:"backwards"}))}})]})});I.displayName=_;var M="ToastFocusProxy",K=t.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:o,...n}=e,s=L(M,r);return x(h,{"aria-hidden":!0,tabIndex:0,...n,ref:t,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!s.viewport?.contains(t)&&o()}})});K.displayName=M;var O="Toast",V=t.forwardRef((e,t)=>{const{forceMount:r,open:o,defaultOpen:n,onOpenChange:i,...c}=e,[d,u]=v({prop:o,defaultProp:n??!0,onChange:i,caller:O});return x(s,{present:r||d,children:x(X,{open:d,...c,ref:t,onClose:()=>u(!1),onPause:f(e.onPause),onResume:f(e.onResume),onSwipeStart:a(e.onSwipeStart,e=>{e.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:a(e.onSwipeMove,e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${r}px`)}),onSwipeCancel:a(e.onSwipeCancel,e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:a(e.onSwipeEnd,e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${r}px`),u(!1)})})})});V.displayName=O;var[$,U]=N(O,{onClose(){}}),X=t.forwardRef((e,r)=>{const{__scopeToast:s,type:i="foreground",duration:c,open:d,onClose:l,onEscapeKeyDown:m,onPause:v,onResume:w,onSwipeStart:h,onSwipeMove:E,onSwipeCancel:T,onSwipeEnd:b,...P}=e,R=L(O,s),[N,k]=t.useState(null),D=n(r,e=>k(e)),S=t.useRef(null),_=t.useRef(null),F=c||R.duration,I=t.useRef(0),M=t.useRef(F),K=t.useRef(0),{onToastAdd:V,onToastRemove:U}=R,X=f(()=>{const e=N?.contains(document.activeElement);e&&R.viewport?.focus(),l()}),B=t.useCallback(e=>{e&&e!==1/0&&(window.clearTimeout(K.current),I.current=(new Date).getTime(),K.current=window.setTimeout(X,e))},[X]);t.useEffect(()=>{const e=R.viewport;if(e){const t=()=>{B(M.current),w?.()},r=()=>{const e=(new Date).getTime()-I.current;M.current=M.current-e,window.clearTimeout(K.current),v?.()};return e.addEventListener(j,r),e.addEventListener(A,t),()=>{e.removeEventListener(j,r),e.removeEventListener(A,t)}}},[R.viewport,F,v,w,B]),t.useEffect(()=>{d&&!R.isClosePausedRef.current&&B(F)},[d,F,R.isClosePausedRef,B]),t.useEffect(()=>(V(),()=>U()),[V,U]);const H=t.useMemo(()=>N?J(N):null,[N]);return R.viewport?y(g,{children:[H&&x(q,{__scopeToast:s,role:"status","aria-live":"foreground"===i?"assertive":"polite","aria-atomic":!0,children:H}),x($,{scope:s,onClose:X,children:o.createPortal(x(C.ItemSlot,{scope:s,children:x(u,{asChild:!0,onEscapeKeyDown:a(m,()=>{R.isFocusedToastEscapeKeyDownRef.current||X(),R.isFocusedToastEscapeKeyDownRef.current=!1}),children:x(p.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":d?"open":"closed","data-swipe-direction":R.swipeDirection,...P,ref:D,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:a(e.onKeyDown,e=>{"Escape"===e.key&&(m?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(R.isFocusedToastEscapeKeyDownRef.current=!0,X()))}),onPointerDown:a(e.onPointerDown,e=>{0===e.button&&(S.current={x:e.clientX,y:e.clientY})}),onPointerMove:a(e.onPointerMove,e=>{if(!S.current)return;const t=e.clientX-S.current.x,r=e.clientY-S.current.y,o=Boolean(_.current),n=["left","right"].includes(R.swipeDirection),s=["left","up"].includes(R.swipeDirection)?Math.min:Math.max,a=n?s(0,t):0,i=n?0:s(0,r),c="touch"===e.pointerType?10:2,d={x:a,y:i},u={originalEvent:e,delta:d};o?(_.current=d,Q("toast.swipeMove",E,u,{discrete:!1})):Z(d,R.swipeDirection,c)?(_.current=d,Q("toast.swipeStart",h,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(r)>c)&&(S.current=null)}),onPointerUp:a(e.onPointerUp,e=>{const t=_.current,r=e.target;if(r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId),_.current=null,S.current=null,t){const r=e.currentTarget,o={originalEvent:e,delta:t};Z(t,R.swipeDirection,R.swipeThreshold)?Q("toast.swipeEnd",b,o,{discrete:!0}):Q("toast.swipeCancel",T,o,{discrete:!0}),r.addEventListener("click",e=>e.preventDefault(),{once:!0})}})})})}),R.viewport)})]}):null}),q=e=>{const{__scopeToast:r,children:o,...n}=e,s=L(O,r),[a,i]=t.useState(!1),[c,d]=t.useState(!1);return function(e=()=>{}){const t=f(e);w(()=>{let e=0,r=0;return e=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(r)}},[t])}(()=>i(!0)),t.useEffect(()=>{const e=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(e)},[]),c?null:x(l,{asChild:!0,children:x(h,{...n,children:a&&y(g,{children:[s.label," ",o]})})})},B=t.forwardRef((e,t)=>{const{__scopeToast:r,...o}=e;return x(p.div,{...o,ref:t})});B.displayName="ToastTitle";var H=t.forwardRef((e,t)=>{const{__scopeToast:r,...o}=e;return x(p.div,{...o,ref:t})});H.displayName="ToastDescription";var W=t.forwardRef((e,t)=>{const{altText:r,...o}=e;return r.trim()?x(G,{altText:r,asChild:!0,children:x(z,{...o,ref:t})}):null});W.displayName="ToastAction";var Y="ToastClose",z=t.forwardRef((e,t)=>{const{__scopeToast:r,...o}=e,n=U(Y,r);return x(G,{asChild:!0,children:x(p.button,{type:"button",...o,ref:t,onClick:a(e.onClick,n.onClose)})})});z.displayName=Y;var G=t.forwardRef((e,t)=>{const{__scopeToast:r,altText:o,...n}=e;return x(p.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...n,ref:t})});function J(e){const t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){const r=e.ariaHidden||e.hidden||"none"===e.style.display,o=""===e.dataset.radixToastAnnounceExclude;if(!r)if(o){const r=e.dataset.radixToastAnnounceAlt;r&&t.push(r)}else t.push(...J(e))}}),t}function Q(e,t,r,{discrete:o}){const n=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?m(n,s):n.dispatchEvent(s)}var Z=(e,t,r=0)=>{const o=Math.abs(e.x),n=Math.abs(e.y),s=o>n;return"left"===t||"right"===t?s&&o>r:!s&&n>r};function ee(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function te(e){const t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}var re=I,oe=V,ne=B,se=H,ae=W,ie=z;const ce=S,de=({className:t,...o})=>r.createElement(re,{"data-slot":"toast-viewport",className:e("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]",t),...o}),ue=E("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive-foreground bg-destructive-foreground text-destructive border-destructive"}},defaultVariants:{variant:"default"}}),le=({className:t,variant:o,...n})=>r.createElement(oe,{"data-slot":"toast-root",className:e(ue({variant:o}),t),...n}),pe=({className:t,...o})=>r.createElement(ae,{"data-slot":"toast-action",className:e("ring-offset-background hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none disabled:opacity-50",t),...o}),me=({className:t,...o})=>r.createElement(ie,{"data-slot":"toast-close",className:e("text-foreground/50 hover:text-foreground absolute top-2 right-2 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:ring-2 focus:outline-none group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...o},r.createElement(T,{className:"h-4 w-4"})),fe=({className:t,...o})=>r.createElement(ne,{"data-slot":"toast-title",className:e("text-sm font-semibold",t),...o}),ve=({className:t,...o})=>r.createElement(se,{"data-slot":"toast-description",className:e("text-sm opacity-90",t),...o});export{le as Toast,pe as ToastAction,me as ToastClose,ve as ToastDescription,ce as ToastProvider,fe as ToastTitle,de as ToastViewport};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/tooltip/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{c as e}from"../chunks/utils-
|
1
|
+
import{c as e}from"../chunks/utils-BNmnOQuQ.mjs";import*as t from"react";import n from"react";import{u as o,c as r,P as i}from"../chunks/index-pz7_bV3J.mjs";import{c as a}from"../chunks/index-Cy8Nz9EO.mjs";import{P as s,D as c}from"../chunks/index-j5UZGMap.mjs";import{u as l}from"../chunks/index-sxa3-G-E.mjs";import{c as u,R as d,A as p,C as f,a as m}from"../chunks/index-Gmu-glAo.mjs";import{P as h}from"../chunks/index-g796WVS-.mjs";import{createSlottable as g}from"@radix-ui/react-slot";import{u as x}from"../chunks/index-Di_4GEUt.mjs";import{R as y}from"../chunks/index-DUhfpjqn.mjs";import{jsx as v,jsxs as b}from"react/jsx-runtime";import"../chunks/bundle-mjs-BPxOXzif.mjs";import"../chunks/index-C-gmRzgE.mjs";import"../chunks/index-BqVtEtRQ.mjs";import"react-dom";import"../chunks/index-jhOC7m1Z.mjs";var[w,C]=a("Tooltip",[u]),T=u(),E="TooltipProvider",k=700,R="tooltip.open",[_,D]=w(E),P=e=>{const{__scopeTooltip:n,delayDuration:o=k,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,s=t.useRef(!0),c=t.useRef(!1),l=t.useRef(0);return t.useEffect(()=>{const e=l.current;return()=>window.clearTimeout(e)},[]),v(_,{scope:n,isOpenDelayedRef:s,delayDuration:o,onOpen:t.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:t.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:t.useCallback(e=>{c.current=e},[]),disableHoverableContent:i,children:a})};P.displayName=E;var L="Tooltip",[j,O]=w(L),M=e=>{const{__scopeTooltip:n,children:o,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:s,delayDuration:c}=e,u=D(L,e.__scopeTooltip),p=T(n),[f,m]=t.useState(null),h=l(),g=t.useRef(0),y=s??u.disableHoverableContent,b=c??u.delayDuration,w=t.useRef(!1),[C,E]=x({prop:r,defaultProp:i??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(R))):u.onClose(),a?.(e)},caller:L}),k=t.useMemo(()=>C?w.current?"delayed-open":"instant-open":"closed",[C]),_=t.useCallback(()=>{window.clearTimeout(g.current),g.current=0,w.current=!1,E(!0)},[E]),P=t.useCallback(()=>{window.clearTimeout(g.current),g.current=0,E(!1)},[E]),O=t.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{w.current=!0,E(!0),g.current=0},b)},[b,E]);return t.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),v(d,{...p,children:v(j,{scope:n,contentId:h,open:C,stateAttribute:k,trigger:f,onTriggerChange:m,onTriggerEnter:t.useCallback(()=>{u.isOpenDelayedRef.current?O():_()},[u.isOpenDelayedRef,O,_]),onTriggerLeave:t.useCallback(()=>{y?P():(window.clearTimeout(g.current),g.current=0)},[P,y]),onOpen:_,onClose:P,disableHoverableContent:y,children:o})})};M.displayName=L;var I="TooltipTrigger",N=t.forwardRef((e,n)=>{const{__scopeTooltip:i,...a}=e,s=O(I,i),c=D(I,i),l=T(i),u=t.useRef(null),d=o(n,u,s.onTriggerChange),f=t.useRef(!1),m=t.useRef(!1),g=t.useCallback(()=>f.current=!1,[]);return t.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),v(p,{asChild:!0,...l,children:v(h.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...a,ref:d,onPointerMove:r(e.onPointerMove,e=>{"touch"!==e.pointerType&&(m.current||c.isPointerInTransitRef.current||(s.onTriggerEnter(),m.current=!0))}),onPointerLeave:r(e.onPointerLeave,()=>{s.onTriggerLeave(),m.current=!1}),onPointerDown:r(e.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:r(e.onFocus,()=>{f.current||s.onOpen()}),onBlur:r(e.onBlur,s.onClose),onClick:r(e.onClick,s.onClose)})})});N.displayName=I;var H="TooltipPortal",[A,B]=w(H,{forceMount:void 0}),z=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,a=O(H,t);return v(A,{scope:t,forceMount:n,children:v(i,{present:n||a.open,children:v(s,{asChild:!0,container:r,children:o})})})};z.displayName=H;var F="TooltipContent",K=t.forwardRef((e,t)=>{const n=B(F,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...a}=e,s=O(F,e.__scopeTooltip);return v(i,{present:o||s.open,children:s.disableHoverableContent?v(q,{side:r,...a,ref:t}):v(S,{side:r,...a,ref:t})})}),S=t.forwardRef((e,n)=>{const r=O(F,e.__scopeTooltip),i=D(F,e.__scopeTooltip),a=t.useRef(null),s=o(n,a),[c,l]=t.useState(null),{trigger:u,onClose:d}=r,p=a.current,{onPointerInTransitChange:f}=i,m=t.useCallback(()=>{l(null),f(!1)},[f]),h=t.useCallback((e,t)=>{const n=e.currentTarget,o={x:e.clientX,y:e.clientY},r=function(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return o}(o,function(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}(o,n.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(o.y-n.y)>=(e.y-n.y)*(o.x-n.x)))break;t.pop()}t.push(o)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const o=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(o.y-t.y)>=(e.y-t.y)*(o.x-t.x)))break;n.pop()}n.push(o)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}(t.getBoundingClientRect())]);l(i),f(!0)},[f]);return t.useEffect(()=>()=>m(),[m]),t.useEffect(()=>{if(u&&p){const e=e=>h(e,p),t=e=>h(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[u,p,h,m]),t.useEffect(()=>{if(c){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},o=u?.contains(t)||p?.contains(t),r=!function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e],s=t[i],c=a.x,l=a.y,u=s.x,d=s.y;l>o!=d>o&&n<(u-c)*(o-l)/(d-l)+c&&(r=!r)}return r}(n,c);o?m():r&&(m(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[u,p,c,d,m]),v(q,{...e,ref:s})}),[X,Y]=w(L,{isInside:!1}),G=g("TooltipContent"),q=t.forwardRef((e,n)=>{const{__scopeTooltip:o,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=e,u=O(F,o),d=T(o),{onClose:p}=u;return t.useEffect(()=>(document.addEventListener(R,p),()=>document.removeEventListener(R,p)),[p]),t.useEffect(()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,p]),v(c,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:b(f,{"data-state":u.stateAttribute,...d,...l,ref:n,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v(G,{children:r}),v(X,{scope:o,isInside:!0,children:v(y,{id:u.contentId,role:"tooltip",children:i||r})})]})})});K.displayName=F;var J="TooltipArrow";t.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=T(n);return Y(J,n).isInside?null:v(m,{...r,...o,ref:t})}).displayName=J;var Q=P,U=M,V=N,W=z,Z=K;function $({delayDuration:e=700,...t}){return n.createElement(Q,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function ee({...e}){return n.createElement($,null,n.createElement(U,{"data-slot":"tooltip",...e}))}function te({...e}){return n.createElement(V,{"data-slot":"tooltip-trigger",...e})}function ne({className:t,sideOffset:o=0,children:r,...i}){return n.createElement(W,null,n.createElement(Z,{"data-slot":"tooltip-content",sideOffset:o,className:e("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md px-3 py-1.5 text-sm shadow-md drop-shadow",t),...i},r))}export{ee as Tooltip,ne as TooltipContent,$ as TooltipProvider,te as TooltipTrigger};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"author": "Investtools",
|
3
3
|
"name": "ivt",
|
4
|
-
"version": "0.2.
|
4
|
+
"version": "0.2.4",
|
5
5
|
"description": "Ivt Components Library",
|
6
6
|
"keywords": [
|
7
7
|
"ivt",
|
@@ -123,6 +123,10 @@
|
|
123
123
|
"import": "./dist/input/index.mjs",
|
124
124
|
"types": "./dist/input/index.d.ts"
|
125
125
|
},
|
126
|
+
"./multi-select": {
|
127
|
+
"import": "./dist/multi-select/index.mjs",
|
128
|
+
"types": "./dist/multi-select/index.d.ts"
|
129
|
+
},
|
126
130
|
"./label": {
|
127
131
|
"import": "./dist/label/index.mjs",
|
128
132
|
"types": "./dist/label/index.d.ts"
|
@@ -226,6 +230,7 @@
|
|
226
230
|
"@radix-ui/react-tooltip": "^1.1.8",
|
227
231
|
"class-variance-authority": "^0.7.1",
|
228
232
|
"cmdk": "^1.0.0",
|
233
|
+
"recharts": "^3.1.0",
|
229
234
|
"sonner": "^2.0.2"
|
230
235
|
},
|
231
236
|
"devDependencies": {
|
@@ -304,4 +309,4 @@
|
|
304
309
|
"plugin:storybook/recommended"
|
305
310
|
]
|
306
311
|
}
|
307
|
-
}
|
312
|
+
}
|