@sqlrooms/ui 0.9.3 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +1 -0
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/aspect-ratio.d.ts +4 -0
- package/dist/components/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio.js +5 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +1 -0
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.d.ts +9 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +38 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts.map +1 -1
- package/dist/components/card.js +1 -0
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox.js +1 -0
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.d.ts +2 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +4 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js +1 -0
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +1 -0
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/editable-text.d.ts.map +1 -1
- package/dist/components/editable-text.js +1 -0
- package/dist/components/editable-text.js.map +1 -1
- package/dist/components/form.d.ts.map +1 -1
- package/dist/components/form.js +1 -0
- package/dist/components/form.js.map +1 -1
- package/dist/components/label.d.ts.map +1 -1
- package/dist/components/label.js +1 -0
- package/dist/components/label.js.map +1 -1
- package/dist/components/popover.d.ts.map +1 -1
- package/dist/components/popover.js +1 -0
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress-modal.d.ts.map +1 -1
- package/dist/components/progress-modal.js +1 -0
- package/dist/components/progress-modal.js.map +1 -1
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js +1 -0
- package/dist/components/progress.js.map +1 -1
- package/dist/components/resizable.d.ts.map +1 -1
- package/dist/components/resizable.js +1 -0
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/select.d.ts.map +1 -1
- package/dist/components/select.js +1 -0
- package/dist/components/select.js.map +1 -1
- package/dist/components/skeleton-pane.d.ts.map +1 -1
- package/dist/components/skeleton-pane.js +1 -0
- package/dist/components/skeleton-pane.js.map +1 -1
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +1 -0
- package/dist/components/slider.js.map +1 -1
- package/dist/components/spinner-pane.d.ts.map +1 -1
- package/dist/components/spinner-pane.js +1 -0
- package/dist/components/spinner-pane.js.map +1 -1
- package/dist/components/switch.d.ts.map +1 -1
- package/dist/components/switch.js +1 -0
- package/dist/components/switch.js.map +1 -1
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +1 -0
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/theme-switch.d.ts.map +1 -1
- package/dist/components/theme-switch.js +1 -0
- package/dist/components/theme-switch.js.map +1 -1
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +1 -0
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toaster.d.ts.map +1 -1
- package/dist/components/toaster.js +1 -0
- package/dist/components/toaster.js.map +1 -1
- package/dist/components/toggle-group.d.ts +13 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +22 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +13 -0
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +27 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +1 -0
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/tree.d.ts +24 -0
- package/dist/components/tree.d.ts.map +1 -0
- package/dist/components/tree.js +36 -0
- package/dist/components/tree.js.map +1 -0
- package/dist/index.d.ts +12 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/package.json +12 -29
- /package/{dist/tailwind-preset.css → tailwind-preset.css} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../src/components/resizable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../src/components/resizable.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,kBAAkB,MAAM,wBAAwB,CAAC;AAI7D,QAAA,MAAM,mBAAmB,GAAI,yBAG1B,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,UAAU,CAAC,4CAQ5D,CAAC;AAEF,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;sBAyBmmE,OAAO;4EAzB/kE,CAAC;AAEhD,QAAA,MAAM,eAAe,GAAI,qCAItB,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,iBAAiB,CAAC,GAAG;IACrE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,4CAcA,CAAC;AAEF,OAAO,EAAC,mBAAmB,EAAE,cAAc,EAAE,eAAe,EAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable.js","sourceRoot":"","sources":["../../src/components/resizable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resizable.js","sourceRoot":"","sources":["../../src/components/resizable.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,kBAAkB,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAEhC,MAAM,mBAAmB,GAAG,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACmD,EAAE,EAAE,CAAC,CAChE,KAAC,kBAAkB,CAAC,UAAU,IAC5B,SAAS,EAAE,EAAE,CACX,mEAAmE,EACnE,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AAEF,MAAM,cAAc,GAAG,kBAAkB,CAAC,KAAK,CAAC;AAEhD,MAAM,eAAe,GAAG,CAAC,EACvB,UAAU,EACV,SAAS,EACT,GAAG,KAAK,EAGT,EAAE,EAAE,CAAC,CACJ,KAAC,kBAAkB,CAAC,iBAAiB,IACnC,SAAS,EAAE,EAAE,CACX,yoBAAyoB,EACzoB,SAAS,CACV,KACG,KAAK,YAER,UAAU,IAAI,CACb,cAAK,SAAS,EAAC,2EAA2E,YACxF,KAAC,YAAY,IAAC,SAAS,EAAC,aAAa,GAAG,GACpC,CACP,GACoC,CACxC,CAAC;AAEF,OAAO,EAAC,mBAAmB,EAAE,cAAc,EAAE,eAAe,EAAC,CAAC","sourcesContent":["'use client';\n\nimport {GripVertical} from 'lucide-react';\nimport * as ResizablePrimitive from 'react-resizable-panels';\n\nimport {cn} from '../lib/utils';\n\nconst ResizablePanelGroup = ({\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (\n <ResizablePrimitive.PanelGroup\n className={cn(\n 'flex h-full w-full data-[panel-group-direction=vertical]:flex-col',\n className,\n )}\n {...props}\n />\n);\n\nconst ResizablePanel = ResizablePrimitive.Panel;\n\nconst ResizableHandle = ({\n withHandle,\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {\n withHandle?: boolean;\n}) => (\n <ResizablePrimitive.PanelResizeHandle\n className={cn(\n 'bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90',\n className,\n )}\n {...props}\n >\n {withHandle && (\n <div className=\"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-sm border\">\n <GripVertical className=\"h-2.5 w-2.5\" />\n </div>\n )}\n </ResizablePrimitive.PanelResizeHandle>\n);\n\nexport {ResizablePanelGroup, ResizablePanel, ResizableHandle};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAK1D,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,WAAW,yGAAwB,CAAC;AAE1C,QAAA,MAAM,WAAW,0GAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa,oKAiBjB,CAAC;AAGH,QAAA,MAAM,oBAAoB,qKAcxB,CAAC;AAGH,QAAA,MAAM,sBAAsB,uKAc1B,CAAC;AAIH,QAAA,MAAM,aAAa,8JA6BjB,CAAC;AAGH,QAAA,MAAM,WAAW,4JASf,CAAC;AAGH,QAAA,MAAM,UAAU,2JAmBd,CAAC;AAGH,QAAA,MAAM,eAAe,gKASnB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"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","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport {Check, ChevronDown, ChevronUp} from 'lucide-react';\n\nimport {cn} from '../lib/utils';\n\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({className, children, ...props}, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm focus:outline-none focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({className, ...props}, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({className, ...props}, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({className, children, position = 'popper', ...props}, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground 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 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({className, ...props}, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({className, children, ...props}, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({className, ...props}, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton-pane.d.ts","sourceRoot":"","sources":["../../src/components/skeleton-pane.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skeleton-pane.d.ts","sourceRoot":"","sources":["../../src/components/skeleton-pane.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAC3B,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CA0BA,CAAC;AAEF,OAAO,EAAC,YAAY,EAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton-pane.js","sourceRoot":"","sources":["../../src/components/skeleton-pane.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skeleton-pane.js","sourceRoot":"","sources":["../../src/components/skeleton-pane.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAChC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,YAAY,GAKb,CAAC,EAAC,CAAC,GAAG,CAAC,EAAE,eAAe,GAAG,GAAG,EAAE,SAAS,GAAG,MAAM,EAAE,SAAS,EAAC,EAAE,EAAE;IACrE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE5C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,KAAK,IAAI,CAAC;YAAE,OAAO;QAEvB,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QACtB,CAAC,EAAE,eAAe,CAAC,CAAC;QAEpB,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC;IAEhC,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,qCAAqC,EAAE,SAAS,CAAC,YAClE,cAAK,SAAS,EAAC,qBAAqB,YACjC,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,CAAC,EAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACpC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CACV,KAAC,QAAQ,IAAS,SAAS,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,SAAS,EAAC,IAAhD,CAAC,CAAmD,CACpE,CAAC,CAAC,CAAC,CACF,cAAa,KAAK,EAAE,EAAC,MAAM,EAAE,SAAS,EAAC,IAA7B,CAAC,CAAgC,CAC5C,CACF,GACG,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAC,YAAY,EAAC,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {cn} from '../lib/utils';\nimport {Skeleton} from './skeleton';\n\nconst SkeletonPane: React.FC<{\n n?: number;\n staggeringDelay?: number;\n rowHeight?: number | string;\n className?: string;\n}> = ({n = 3, staggeringDelay = 200, rowHeight = '20px', className}) => {\n const [count, setCount] = React.useState(0);\n\n React.useEffect(() => {\n if (count >= n) return;\n\n const timer = setTimeout(() => {\n setCount(count + 1);\n }, staggeringDelay);\n\n return () => clearTimeout(timer);\n }, [count, n, staggeringDelay]);\n\n return (\n <div className={cn('flex w-full flex-col justify-center', className)}>\n <div className=\"flex flex-col gap-2\">\n {Array.from({length: n}).map((_, i) =>\n i < count ? (\n <Skeleton key={i} className=\"w-full\" style={{height: rowHeight}} />\n ) : (\n <div key={i} style={{height: rowHeight}} />\n ),\n )}\n </div>\n </div>\n );\n};\n\nexport {SkeletonPane};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../src/components/slider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../src/components/slider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAG1D,QAAA,MAAM,MAAM,yJAiBV,CAAC;AAGH,OAAO,EAAC,MAAM,EAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.js","sourceRoot":"","sources":["../../src/components/slider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slider.js","sourceRoot":"","sources":["../../src/components/slider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAEhC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAG7B,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,MAAC,eAAe,CAAC,IAAI,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,0DAA0D,EAC1D,SAAS,CACV,KACG,KAAK,aAET,KAAC,eAAe,CAAC,KAAK,IAAC,SAAS,EAAC,uEAAuE,YACtG,KAAC,eAAe,CAAC,KAAK,IAAC,SAAS,EAAC,4BAA4B,GAAG,GAC1C,EACxB,KAAC,eAAe,CAAC,KAAK,IAAC,SAAS,EAAC,qNAAqN,GAAG,IACpO,CACxB,CAAC,CAAC;AACH,MAAM,CAAC,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC;AAEtD,OAAO,EAAC,MAAM,EAAC,CAAC","sourcesContent":["'use client';\nimport * as React from 'react';\nimport * as SliderPrimitive from '@radix-ui/react-slider';\nimport {cn} from '../lib/utils';\n\nconst Slider = React.forwardRef<\n React.ElementRef<typeof SliderPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>\n>(({className, ...props}, ref) => (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n 'relative flex w-full touch-none select-none items-center',\n className,\n )}\n {...props}\n >\n <SliderPrimitive.Track className=\"bg-primary/20 relative h-1.5 w-full grow overflow-hidden rounded-full\">\n <SliderPrimitive.Range className=\"bg-primary absolute h-full\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb className=\"border-primary/50 bg-background focus-visible:ring-ring block h-4 w-4 rounded-full border shadow transition-colors focus-visible:outline-none focus-visible:ring-1 disabled:pointer-events-none disabled:opacity-50\" />\n </SliderPrimitive.Root>\n));\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport {Slider};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner-pane.d.ts","sourceRoot":"","sources":["../../src/components/spinner-pane.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spinner-pane.d.ts","sourceRoot":"","sources":["../../src/components/spinner-pane.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;IAC1B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CA4BA,CAAC;AAEF,OAAO,EAAC,WAAW,EAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner-pane.js","sourceRoot":"","sources":["../../src/components/spinner-pane.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spinner-pane.js","sourceRoot":"","sources":["../../src/components/spinner-pane.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAChC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,KAAK,GAAG,GAAG,CAAC;AAElB,MAAM,WAAW,GAKZ,CAAC,KAAK,EAAE,EAAE;IACb,MAAM,EAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAC,GAAG,KAAK,CAAC;IACzD,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;IAEzD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,SAAS,IAAI,OAAO,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;YACxD,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IAEzB,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,0DAA0D,EAC1D,SAAS,CACV,EACD,KAAK,EAAE,EAAC,SAAS,EAAE,CAAC,EAAC,KACjB,IAAI,YAEP,SAAS,CAAC,CAAC,CAAC,CACX,eAAK,SAAS,EAAC,kCAAkC,aAC9C,QAAQ,EACT,KAAC,OAAO,IAAC,SAAS,EAAC,uBAAuB,GAAG,IACzC,CACP,CAAC,CAAC,CAAC,IAAI,GACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAC,WAAW,EAAC,CAAC","sourcesContent":["'use client';\n\nimport React from 'react';\nimport {cn} from '../lib/utils';\nimport {Spinner} from './spinner';\n\nconst DELAY = 500;\n\nconst SpinnerPane: React.FC<{\n h?: number | string;\n delayed?: boolean;\n className?: string;\n children?: React.ReactNode;\n}> = (props) => {\n const {h, delayed, children, className, ...rest} = props;\n const [isPlaying, setPlaying] = React.useState(!delayed);\n\n React.useEffect(() => {\n if (!isPlaying && delayed) {\n const timer = setTimeout(() => setPlaying(true), DELAY);\n return () => clearTimeout(timer);\n }\n }, [isPlaying, delayed]);\n\n return (\n <div\n className={cn(\n 'mx-auto flex min-h-[inherit] items-center justify-center',\n className,\n )}\n style={{minHeight: h}}\n {...rest}\n >\n {isPlaying ? (\n <div className=\"flex flex-col items-center gap-2\">\n {children}\n <Spinner className=\"text-muted-foreground\" />\n </div>\n ) : null}\n </div>\n );\n};\n\nexport {SpinnerPane};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAI3D,QAAA,MAAM,MAAM,8JAkBV,CAAC;AAGH,OAAO,EAAC,MAAM,EAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAEhC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAG7B,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,KAAC,gBAAgB,CAAC,IAAI,IACpB,SAAS,EAAE,EAAE,CACX,6XAA6X,EAC7X,SAAS,CACV,KACG,KAAK,EACT,GAAG,EAAE,GAAG,YAER,KAAC,gBAAgB,CAAC,KAAK,IACrB,SAAS,EAAE,EAAE,CACX,4KAA4K,CAC7K,GACD,GACoB,CACzB,CAAC,CAAC;AACH,MAAM,CAAC,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC;AAEvD,OAAO,EAAC,MAAM,EAAC,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as SwitchPrimitives from '@radix-ui/react-switch';\n\nimport {cn} from '../lib/utils';\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>\n>(({className, ...props}, ref) => (\n <SwitchPrimitives.Root\n className={cn(\n 'focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-primary data-[state=unchecked]:bg-input peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n 'bg-background pointer-events-none block h-4 w-4 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0',\n )}\n />\n </SwitchPrimitives.Root>\n));\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\nexport {Switch};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AAItD,QAAA,MAAM,IAAI,gGAAqB,CAAC;AAEhC,QAAA,MAAM,QAAQ,uJAYZ,CAAC;AAGH,QAAA,MAAM,WAAW,gKAYf,CAAC;AAGH,QAAA,MAAM,WAAW,0JAYf,CAAC;AAGH,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAC,CAAC"}
|
package/dist/components/tabs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAEhC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC;AAEhC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAG/B,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,KAAC,aAAa,CAAC,IAAI,IACjB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,2FAA2F,EAC3F,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC,CAAC;AACH,QAAQ,CAAC,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;AAEtD,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAGlC,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,KAAC,aAAa,CAAC,OAAO,IACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,gYAAgY,EAChY,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC,CAAC;AACH,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC;AAE5D,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAGlC,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,KAAC,aAAa,CAAC,OAAO,IACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,iIAAiI,EACjI,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC,CAAC;AACH,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC;AAE5D,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAC,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\n\nimport {cn} from '../lib/utils';\n\nconst Tabs = TabsPrimitive.Root;\n\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({className, ...props}, ref) => (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n 'bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1',\n className,\n )}\n {...props}\n />\n));\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({className, ...props}, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow',\n className,\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({className, ...props}, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n 'ring-offset-background focus-visible:ring-ring mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2',\n className,\n )}\n {...props}\n />\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\nexport {Tabs, TabsList, TabsTrigger, TabsContent};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-switch.d.ts","sourceRoot":"","sources":["../../src/components/theme-switch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme-switch.d.ts","sourceRoot":"","sources":["../../src/components/theme-switch.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC;IAC3B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAwBA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-switch.js","sourceRoot":"","sources":["../../src/components/theme-switch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme-switch.js","sourceRoot":"","sources":["../../src/components/theme-switch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAGhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,MAAM,WAAW,GAGnB,CAAC,EAAC,SAAS,EAAC,EAAE,EAAE;IACnB,MAAM,EAAC,KAAK,EAAE,QAAQ,EAAC,GAAG,QAAQ,EAAE,CAAC;IAErC,OAAO,CACL,KAAC,gBAAgB,CAAC,IAAI,IACpB,SAAS,EAAE,EAAE,CACX,gYAAgY,EAChY,SAAS,CACV,EACD,OAAO,EAAE,KAAK,KAAK,MAAM,EACzB,eAAe,EAAE,CAAC,OAAO,EAAE,EAAE;YAC3B,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,YAED,MAAC,gBAAgB,CAAC,KAAK,IACrB,SAAS,EAAE,EAAE,CACX,wNAAwN,CACzN,aAED,KAAC,OAAO,IAAC,SAAS,EAAC,8FAA8F,GAAG,EACpH,KAAC,QAAQ,IAAC,SAAS,EAAC,sGAAsG,GAAG,IACtG,GACH,CACzB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {useTheme} from '../theme/theme-provider';\nimport * as SwitchPrimitives from '@radix-ui/react-switch';\nimport {SunIcon, MoonIcon} from 'lucide-react';\nimport {cn} from '../lib/utils';\nimport {FC} from 'react';\n\n/**\n * A theme toggle switch component that allows users to switch between light and dark themes.\n *\n * This component provides a visually appealing switch with sun/moon icons that animate smoothly\n * during theme transitions. It integrates with the theme context to manage theme state.\n *\n * Features:\n * - Smooth icon animations\n * - Accessible keyboard navigation\n * - Focus and hover states\n * - Customizable via className prop\n *\n * @component\n * @example\n * ```tsx\n * // Basic usage\n * <ThemeSwitch />\n *\n * // With custom styling\n * <ThemeSwitch className=\"my-custom-class\" />\n *\n * // Within a theme provider\n * import { ThemeProvider } from '../theme/theme-provider';\n *\n * function App() {\n * return (\n * <ThemeProvider>\n * <ThemeSwitch />\n * </ThemeProvider>\n * );\n * }\n * ```\n */\nexport const ThemeSwitch: FC<{\n /** Optional CSS class name for styling the switch container */\n className?: string;\n}> = ({className}) => {\n const {theme, setTheme} = useTheme();\n\n return (\n <SwitchPrimitives.Root\n className={cn(\n 'focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-primary/20 data-[state=unchecked]:bg-input peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n checked={theme === 'dark'}\n onCheckedChange={(checked) => {\n setTheme(checked ? 'dark' : 'light');\n }}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n 'bg-background pointer-events-none flex h-4 w-4 items-center justify-center rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0 dark:bg-zinc-900',\n )}\n >\n <SunIcon className=\"dark:text-primary h-2.5 w-2.5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0\" />\n <MoonIcon className=\"dark:text-primary absolute h-2.5 w-2.5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100\" />\n </SwitchPrimitives.Thumb>\n </SwitchPrimitives.Root>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../src/components/toast.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../src/components/toast.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAM,KAAK,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAKhE,QAAA,MAAM,aAAa,8CAA2B,CAAC;AAE/C,QAAA,MAAM,aAAa,kKAYjB,CAAC;AAmBH,QAAA,MAAM,KAAK;;qHAYT,CAAC;AAGH,QAAA,MAAM,WAAW,kKAYf,CAAC;AAGH,QAAA,MAAM,UAAU,iKAed,CAAC;AAGH,QAAA,MAAM,UAAU,2JASd,CAAC;AAGH,QAAA,MAAM,gBAAgB,iKASpB,CAAC;AAGH,KAAK,UAAU,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,KAAK,CAAC,CAAC;AAE/D,KAAK,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;AAEjE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,aAAa,EACb,aAAa,EACb,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,WAAW,GACZ,CAAC"}
|
package/dist/components/toast.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../src/components/toast.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../src/components/toast.tsx"],"names":[],"mappings":"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","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as ToastPrimitives from '@radix-ui/react-toast';\nimport {cva, type VariantProps} from 'class-variance-authority';\nimport {X} from 'lucide-react';\n\nimport {cn} from '../lib/utils';\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({className, ...props}, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n 'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',\n className,\n )}\n {...props}\n />\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst toastVariants = cva(\n 'group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 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',\n {\n variants: {\n variant: {\n default: 'border bg-background text-foreground',\n destructive:\n 'destructive group border-destructive bg-destructive text-destructive-foreground',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nconst Toast = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants>\n>(({className, variant, ...props}, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(toastVariants({variant}), className)}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Action>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({className, ...props}, ref) => (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n '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:outline-none focus:ring-1 disabled:pointer-events-none disabled:opacity-50',\n className,\n )}\n {...props}\n />\n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({className, ...props}, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n 'text-foreground/50 hover:text-foreground absolute right-1 top-1 rounded-md p-1 opacity-0 transition-opacity focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600',\n className,\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"h-4 w-4\" />\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>\n>(({className, ...props}, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn('text-sm font-semibold [&+div]:text-xs', className)}\n {...props}\n />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>\n>(({className, ...props}, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn('text-sm opacity-90', className)}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["../../src/components/toaster.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["../../src/components/toaster.tsx"],"names":[],"mappings":"AAYA,wBAAgB,OAAO,4CAsBtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toaster.js","sourceRoot":"","sources":["../../src/components/toaster.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toaster.js","sourceRoot":"","sources":["../../src/components/toaster.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAC,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,MAAM,UAAU,OAAO;IACrB,MAAM,EAAC,MAAM,EAAC,GAAG,QAAQ,EAAE,CAAC;IAE5B,OAAO,CACL,MAAC,aAAa,eACX,MAAM,CAAC,GAAG,CAAC,UAAU,EAAC,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,KAAK,EAAC;gBAC9D,OAAO,CACL,MAAC,KAAK,OAAc,KAAK,aACvB,eAAK,SAAS,EAAC,YAAY,aACxB,KAAK,IAAI,KAAC,UAAU,cAAE,KAAK,GAAc,EACzC,WAAW,IAAI,CACd,KAAC,gBAAgB,cAAE,WAAW,GAAoB,CACnD,IACG,EACL,MAAM,EACP,KAAC,UAAU,KAAG,KARJ,EAAE,CASN,CACT,CAAC;YACJ,CAAC,CAAC,EACF,KAAC,aAAa,KAAG,IACH,CACjB,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport {useToast} from '../hooks/use-toast';\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n} from './toast';\n\nexport function Toaster() {\n const {toasts} = useToast();\n\n return (\n <ToastProvider>\n {toasts.map(function ({id, title, description, action, ...props}) {\n return (\n <Toast key={id} {...props}>\n <div className=\"grid gap-1\">\n {title && <ToastTitle>{title}</ToastTitle>}\n {description && (\n <ToastDescription>{description}</ToastDescription>\n )}\n </div>\n {action}\n <ToastClose />\n </Toast>\n );\n })}\n <ToastViewport />\n </ToastProvider>\n );\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
|
|
5
|
+
variant?: "default" | "outline" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string>) & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupPrimitive.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
9
|
+
variant?: "default" | "outline" | null | undefined;
|
|
10
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
13
|
+
//# sourceMappingURL=toggle-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../src/components/toggle-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAC,KAAK,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAY3D,QAAA,MAAM,WAAW;;;uHAcf,CAAC;AAIH,QAAA,MAAM,eAAe;;;yHAsBnB,CAAC;AAIH,OAAO,EAAC,WAAW,EAAE,eAAe,EAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
5
|
+
import { cn } from '../lib/utils';
|
|
6
|
+
import { toggleVariants } from './toggle';
|
|
7
|
+
const ToggleGroupContext = React.createContext({
|
|
8
|
+
size: 'default',
|
|
9
|
+
variant: 'default',
|
|
10
|
+
});
|
|
11
|
+
const ToggleGroup = React.forwardRef(({ className, variant, size, children, ...props }, ref) => (_jsx(ToggleGroupPrimitive.Root, { ref: ref, className: cn('flex items-center justify-center gap-1', className), ...props, children: _jsx(ToggleGroupContext.Provider, { value: { variant, size }, children: children }) })));
|
|
12
|
+
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
13
|
+
const ToggleGroupItem = React.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
14
|
+
const context = React.useContext(ToggleGroupContext);
|
|
15
|
+
return (_jsx(ToggleGroupPrimitive.Item, { ref: ref, className: cn(toggleVariants({
|
|
16
|
+
variant: context.variant || variant,
|
|
17
|
+
size: context.size || size,
|
|
18
|
+
}), className), ...props, children: children }));
|
|
19
|
+
});
|
|
20
|
+
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
21
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
22
|
+
//# sourceMappingURL=toggle-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.js","sourceRoot":"","sources":["../../src/components/toggle-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAGrE,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAChC,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AAExC,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAE5C;IACA,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,SAAS;CACnB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAIlC,CAAC,EAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CACzD,KAAC,oBAAoB,CAAC,IAAI,IACxB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,wCAAwC,EAAE,SAAS,CAAC,KAC9D,KAAK,YAET,KAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,YAChD,QAAQ,GACmB,GACJ,CAC7B,CAAC,CAAC;AAEH,WAAW,CAAC,WAAW,GAAG,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC;AAEhE,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAItC,CAAC,EAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE;IACxD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAErD,OAAO,CACL,KAAC,oBAAoB,CAAC,IAAI,IACxB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,cAAc,CAAC;YACb,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,OAAO;YACnC,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,IAAI;SAC3B,CAAC,EACF,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACiB,CAC7B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,WAAW,GAAG,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC;AAEpE,OAAO,EAAC,WAAW,EAAE,eAAe,EAAC,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport {type VariantProps} from 'class-variance-authority';\n\nimport {cn} from '../lib/utils';\nimport {toggleVariants} from './toggle';\n\nconst ToggleGroupContext = React.createContext<\n VariantProps<typeof toggleVariants>\n>({\n size: 'default',\n variant: 'default',\n});\n\nconst ToggleGroup = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({className, variant, size, children, ...props}, ref) => (\n <ToggleGroupPrimitive.Root\n ref={ref}\n className={cn('flex items-center justify-center gap-1', className)}\n {...props}\n >\n <ToggleGroupContext.Provider value={{variant, size}}>\n {children}\n </ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n));\n\nToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;\n\nconst ToggleGroupItem = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &\n VariantProps<typeof toggleVariants>\n>(({className, children, variant, size, ...props}, ref) => {\n const context = React.useContext(ToggleGroupContext);\n\n return (\n <ToggleGroupPrimitive.Item\n ref={ref}\n className={cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n className,\n )}\n {...props}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n});\n\nToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;\n\nexport {ToggleGroup, ToggleGroupItem};\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
declare const toggleVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "outline" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
9
|
+
variant?: "default" | "outline" | null | undefined;
|
|
10
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export { Toggle, toggleVariants };
|
|
13
|
+
//# sourceMappingURL=toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../src/components/toggle.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAM,KAAK,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAIhE,QAAA,MAAM,cAAc;;;8EAoBnB,CAAC;AAEF,QAAA,MAAM,MAAM;;;yHAUV,CAAC;AAIH,OAAO,EAAC,MAAM,EAAE,cAAc,EAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { cn } from '../lib/utils';
|
|
7
|
+
const toggleVariants = cva('inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: 'bg-transparent',
|
|
11
|
+
outline: 'border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground',
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
default: 'h-9 px-2 min-w-9',
|
|
15
|
+
sm: 'h-8 px-1.5 min-w-8',
|
|
16
|
+
lg: 'h-10 px-2.5 min-w-10',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: 'default',
|
|
21
|
+
size: 'default',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
const Toggle = React.forwardRef(({ className, variant, size, ...props }, ref) => (_jsx(TogglePrimitive.Root, { ref: ref, className: cn(toggleVariants({ variant, size, className })), ...props })));
|
|
25
|
+
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
26
|
+
export { Toggle, toggleVariants };
|
|
27
|
+
//# sourceMappingURL=toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.js","sourceRoot":"","sources":["../../src/components/toggle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAC,GAAG,EAAoB,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAEhC,MAAM,cAAc,GAAG,GAAG,CACxB,iYAAiY,EACjY;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,gBAAgB;YACzB,OAAO,EACL,2FAA2F;SAC9F;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,kBAAkB;YAC3B,EAAE,EAAE,oBAAoB;YACxB,EAAE,EAAE,sBAAsB;SAC3B;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;KAChB;CACF,CACF,CAAC;AAEF,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAI7B,CAAC,EAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAC/C,KAAC,eAAe,CAAC,IAAI,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC,CAAC,KACrD,KAAK,GACT,CACH,CAAC,CAAC;AAEH,MAAM,CAAC,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC;AAEtD,OAAO,EAAC,MAAM,EAAE,cAAc,EAAC,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport {cva, type VariantProps} from 'class-variance-authority';\n\nimport {cn} from '../lib/utils';\n\nconst toggleVariants = cva(\n 'inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n default: 'bg-transparent',\n outline:\n 'border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground',\n },\n size: {\n default: 'h-9 px-2 min-w-9',\n sm: 'h-8 px-1.5 min-w-8',\n lg: 'h-10 px-2.5 min-w-10',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nconst Toggle = React.forwardRef<\n React.ElementRef<typeof TogglePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({className, variant, size, ...props}, ref) => (\n <TogglePrimitive.Root\n ref={ref}\n className={cn(toggleVariants({variant, size, className}))}\n {...props}\n />\n));\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport {Toggle, toggleVariants};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAG5D,QAAA,MAAM,eAAe,iDAA4B,CAAC;AAElD,QAAA,MAAM,OAAO,yCAAwB,CAAC;AAEtC,QAAA,MAAM,cAAc,gHAA2B,CAAC;AAEhD,QAAA,MAAM,cAAc,gKAelB,CAAC;AAGH,OAAO,EAAC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAEhC,MAAM,eAAe,GAAG,gBAAgB,CAAC,QAAQ,CAAC;AAElD,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,CAAC;AAEtC,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,CAAC;AAEhD,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAGrC,CAAC,EAAC,SAAS,EAAE,UAAU,GAAG,CAAC,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAChD,KAAC,gBAAgB,CAAC,MAAM,cACtB,KAAC,gBAAgB,CAAC,OAAO,IACvB,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,EAAE,CACX,mXAAmX,EACnX,SAAS,CACV,KACG,KAAK,GACT,GACsB,CAC3B,CAAC,CAAC;AACH,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,WAAW,CAAC;AAElE,OAAO,EAAC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAC,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport {cn} from '../lib/utils';\n\nconst TooltipProvider = TooltipPrimitive.Provider;\n\nconst Tooltip = TooltipPrimitive.Root;\n\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({className, sideOffset = 4, ...props}, ref) => (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'bg-primary text-primary-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-xs',\n className,\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport {Tooltip, TooltipTrigger, TooltipContent, TooltipProvider};\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type TreeNodeData<T> = {
|
|
3
|
+
key: string;
|
|
4
|
+
object: T;
|
|
5
|
+
children?: TreeNodeData<T>[];
|
|
6
|
+
isOpen?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type TreeProps<T> = {
|
|
9
|
+
className?: string;
|
|
10
|
+
treeData: TreeNodeData<T>;
|
|
11
|
+
renderNode: TreeNodeProps<T>['renderNode'];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Component that renders a generic tree.
|
|
15
|
+
* @param treeData - The tree data.
|
|
16
|
+
* @param renderNode - A function that renders a tree node.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Tree<T>(props: TreeProps<T>): React.ReactElement;
|
|
19
|
+
type TreeNodeProps<T> = {
|
|
20
|
+
treeData: TreeNodeData<T>;
|
|
21
|
+
renderNode: (node: TreeNodeData<T>, isOpen: boolean) => React.ReactNode;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/components/tree.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAMjD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,CAAC,CAAC;IACV,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,SAAS,CAAC,CAAC,IAAI;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC1B,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAO/D;AAED,KAAK,aAAa,CAAC,CAAC,IAAI;IACtB,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC1B,UAAU,EAAE,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC;CACzE,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Collapsible, CollapsibleContent } from '@radix-ui/react-collapsible';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { CollapsibleTrigger } from './collapsible';
|
|
6
|
+
import { cn } from '../lib/utils';
|
|
7
|
+
import { ChevronRightIcon } from 'lucide-react';
|
|
8
|
+
/**
|
|
9
|
+
* Component that renders a generic tree.
|
|
10
|
+
* @param treeData - The tree data.
|
|
11
|
+
* @param renderNode - A function that renders a tree node.
|
|
12
|
+
*/
|
|
13
|
+
export function Tree(props) {
|
|
14
|
+
const { className, treeData, renderNode } = props;
|
|
15
|
+
return (_jsx("div", { className: cn('flex flex-col', className), children: _jsx(TreeNode, { treeData: treeData, renderNode: renderNode }) }));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Component that renders a tree node.
|
|
19
|
+
*/
|
|
20
|
+
function TreeNode(props) {
|
|
21
|
+
const { treeData, renderNode } = props;
|
|
22
|
+
const { children } = treeData;
|
|
23
|
+
const [isOpen, setIsOpen] = useState(Boolean(treeData.isOpen));
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
setIsOpen(Boolean(treeData.isOpen));
|
|
26
|
+
}, [treeData.isOpen]);
|
|
27
|
+
if (!children) {
|
|
28
|
+
return _jsx(_Fragment, { children: renderNode(treeData, isOpen) });
|
|
29
|
+
}
|
|
30
|
+
return (_jsxs(Collapsible, { open: isOpen, onOpenChange: setIsOpen, children: [_jsx(CollapsibleTrigger, { className: "w-full", asChild: true, children: _jsxs("div", { className: "flex w-full cursor-pointer items-center space-x-1", children: [_jsx(ChevronRightIcon, { className: cn('flex-shrink-0 text-gray-500', {
|
|
31
|
+
'rotate-90 transform': isOpen,
|
|
32
|
+
}), size: "18px" }), renderNode(treeData, isOpen)] }) }), _jsx(CollapsibleContent, { className: "pl-4", children: isOpen
|
|
33
|
+
? children.map((child) => (_jsx(TreeNode, { treeData: child, renderNode: renderNode }, child.key)))
|
|
34
|
+
: null })] }));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/components/tree.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAC5E,OAAc,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAChC,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAe9C;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAI,KAAmB;IACzC,MAAM,EAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAC,GAAG,KAAK,CAAC;IAChD,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,YAC5C,KAAC,QAAQ,IAAI,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,GAAI,GACvD,CACP,CAAC;AACJ,CAAC;AAOD;;GAEG;AACH,SAAS,QAAQ,CAAI,KAAuB;IAC1C,MAAM,EAAC,QAAQ,EAAE,UAAU,EAAC,GAAG,KAAK,CAAC;IACrC,MAAM,EAAC,QAAQ,EAAC,GAAG,QAAQ,CAAC;IAC5B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/D,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACtC,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACtB,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,4BAAG,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAI,CAAC;IAC7C,CAAC;IACD,OAAO,CACL,MAAC,WAAW,IAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,aAChD,KAAC,kBAAkB,IAAC,SAAS,EAAC,QAAQ,EAAC,OAAO,kBAC5C,eAAK,SAAS,EAAC,mDAAmD,aAChE,KAAC,gBAAgB,IACf,SAAS,EAAE,EAAE,CAAC,6BAA6B,EAAE;gCAC3C,qBAAqB,EAAE,MAAM;6BAC9B,CAAC,EACF,IAAI,EAAC,MAAM,GACX,EACD,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,IACzB,GACa,EACrB,KAAC,kBAAkB,IAAC,SAAS,EAAC,MAAM,YACjC,MAAM;oBACL,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACtB,KAAC,QAAQ,IAEP,QAAQ,EAAE,KAAK,EACf,UAAU,EAAE,UAAU,IAFjB,KAAK,CAAC,GAAG,CAGd,CACH,CAAC;oBACJ,CAAC,CAAC,IAAI,GACW,IACT,CACf,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport {Collapsible, CollapsibleContent} from '@radix-ui/react-collapsible';\nimport React, {useEffect, useState} from 'react';\n\nimport {CollapsibleTrigger} from './collapsible';\nimport {cn} from '../lib/utils';\nimport {ChevronRightIcon} from 'lucide-react';\n\nexport type TreeNodeData<T> = {\n key: string;\n object: T;\n children?: TreeNodeData<T>[];\n isOpen?: boolean;\n};\n\ntype TreeProps<T> = {\n className?: string;\n treeData: TreeNodeData<T>;\n renderNode: TreeNodeProps<T>['renderNode'];\n};\n\n/**\n * Component that renders a generic tree.\n * @param treeData - The tree data.\n * @param renderNode - A function that renders a tree node.\n */\nexport function Tree<T>(props: TreeProps<T>): React.ReactElement {\n const {className, treeData, renderNode} = props;\n return (\n <div className={cn('flex flex-col', className)}>\n <TreeNode<T> treeData={treeData} renderNode={renderNode} />\n </div>\n );\n}\n\ntype TreeNodeProps<T> = {\n treeData: TreeNodeData<T>;\n renderNode: (node: TreeNodeData<T>, isOpen: boolean) => React.ReactNode;\n};\n\n/**\n * Component that renders a tree node.\n */\nfunction TreeNode<T>(props: TreeNodeProps<T>): React.ReactElement | null {\n const {treeData, renderNode} = props;\n const {children} = treeData;\n const [isOpen, setIsOpen] = useState(Boolean(treeData.isOpen));\n useEffect(() => {\n setIsOpen(Boolean(treeData.isOpen));\n }, [treeData.isOpen]);\n if (!children) {\n return <>{renderNode(treeData, isOpen)}</>;\n }\n return (\n <Collapsible open={isOpen} onOpenChange={setIsOpen}>\n <CollapsibleTrigger className=\"w-full\" asChild>\n <div className=\"flex w-full cursor-pointer items-center space-x-1\">\n <ChevronRightIcon\n className={cn('flex-shrink-0 text-gray-500', {\n 'rotate-90 transform': isOpen,\n })}\n size=\"18px\"\n />\n {renderNode(treeData, isOpen)}\n </div>\n </CollapsibleTrigger>\n <CollapsibleContent className=\"pl-4\">\n {isOpen\n ? children.map((child) => (\n <TreeNode<T>\n key={child.key}\n treeData={child}\n renderNode={renderNode}\n />\n ))\n : null}\n </CollapsibleContent>\n </Collapsible>\n );\n}\n"]}
|