@lssm/lib.ui-kit-web 1.7.3 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -0
- package/dist/node_modules/sonner/dist/index.js +1 -2
- package/dist/node_modules/sonner/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/accordion.d.ts +5 -5
- package/dist/ui/accordion.js +3 -4
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/alert-dialog.js +8 -9
- package/dist/ui/alert-dialog.js.map +1 -1
- package/dist/ui/alert.d.ts +6 -6
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +3 -3
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/aspect-ratio.d.ts +2 -2
- package/dist/ui/aspect-ratio.js +0 -1
- package/dist/ui/aspect-ratio.js.map +1 -1
- package/dist/ui/avatar.d.ts +4 -4
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +3 -4
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge.d.ts +3 -3
- package/dist/ui/badge.js +1 -1
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/breadcrumb.d.ts +8 -8
- package/dist/ui/breadcrumb.d.ts.map +1 -1
- package/dist/ui/breadcrumb.js +6 -6
- package/dist/ui/breadcrumb.js.map +1 -1
- package/dist/ui/button.d.ts +6 -6
- package/dist/ui/button.js +1 -1
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/calendar.d.ts +3 -3
- package/dist/ui/calendar.js +5 -6
- package/dist/ui/calendar.js.map +1 -1
- package/dist/ui/card.d.ts +8 -8
- package/dist/ui/card.js +7 -7
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/carousel.d.ts +6 -6
- package/dist/ui/carousel.js +5 -6
- package/dist/ui/carousel.js.map +1 -1
- package/dist/ui/checkbox.d.ts +2 -2
- package/dist/ui/checkbox.js +1 -2
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/collapsible.d.ts +4 -4
- package/dist/ui/collapsible.js +0 -1
- package/dist/ui/collapsible.js.map +1 -1
- package/dist/ui/command.d.ts +10 -10
- package/dist/ui/command.js +8 -9
- package/dist/ui/command.js.map +1 -1
- package/dist/ui/confirm-dialog.d.ts +2 -2
- package/dist/ui/context-menu.d.ts +2 -2
- package/dist/ui/context-menu.d.ts.map +1 -1
- package/dist/ui/context-menu.js +9 -10
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/cta.d.ts +1 -1
- package/dist/ui/cta.js +1 -1
- package/dist/ui/cta.js.map +1 -1
- package/dist/ui/date-picker.d.ts +2 -2
- package/dist/ui/date-picker.js +0 -1
- package/dist/ui/date-picker.js.map +1 -1
- package/dist/ui/date-range-picker.d.ts +2 -2
- package/dist/ui/date-range-picker.js +0 -1
- package/dist/ui/date-range-picker.js.map +1 -1
- package/dist/ui/datetime-picker.d.ts +2 -2
- package/dist/ui/datetime-picker.d.ts.map +1 -1
- package/dist/ui/datetime-picker.js +0 -1
- package/dist/ui/datetime-picker.js.map +1 -1
- package/dist/ui/dialog.d.ts +11 -11
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +6 -7
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/drawer.d.ts +11 -11
- package/dist/ui/drawer.js +6 -7
- package/dist/ui/drawer.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts +16 -16
- package/dist/ui/dropdown-menu.js +9 -10
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/empty-state.d.ts +4 -4
- package/dist/ui/empty.d.ts +9 -9
- package/dist/ui/empty.js +6 -6
- package/dist/ui/empty.js.map +1 -1
- package/dist/ui/field.d.ts +11 -11
- package/dist/ui/field.js +10 -11
- package/dist/ui/field.js.map +1 -1
- package/dist/ui/form.d.ts +7 -7
- package/dist/ui/form.js +4 -5
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/hover-card.d.ts +4 -4
- package/dist/ui/hover-card.js +1 -2
- package/dist/ui/hover-card.js.map +1 -1
- package/dist/ui/input-group.d.ts +11 -11
- package/dist/ui/input-group.js +6 -7
- package/dist/ui/input-group.js.map +1 -1
- package/dist/ui/input-otp.d.ts +2 -2
- package/dist/ui/input-otp.js +3 -4
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/input.d.ts +2 -2
- package/dist/ui/input.js +1 -1
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/label.d.ts +2 -2
- package/dist/ui/label.js +1 -2
- package/dist/ui/label.js.map +1 -1
- package/dist/ui/link.d.ts +3 -3
- package/dist/ui/link.js +1 -1
- package/dist/ui/link.js.map +1 -1
- package/dist/ui/live-region.d.ts +2 -2
- package/dist/ui/live-region.js +0 -1
- package/dist/ui/live-region.js.map +1 -1
- package/dist/ui/loading-button.d.ts +2 -2
- package/dist/ui/loading-button.js +1 -1
- package/dist/ui/loading-button.js.map +1 -1
- package/dist/ui/map/MapBase.d.ts +2 -2
- package/dist/ui/map/MapBase.js +0 -1
- package/dist/ui/map/MapBase.js.map +1 -1
- package/dist/ui/map/MapGeoJsonOverlay.d.ts +2 -2
- package/dist/ui/map/MapGeoJsonOverlay.js +0 -1
- package/dist/ui/map/MapGeoJsonOverlay.js.map +1 -1
- package/dist/ui/map/MapHeatmapH3.d.ts +2 -2
- package/dist/ui/map/MapHeatmapH3.js +0 -1
- package/dist/ui/map/MapHeatmapH3.js.map +1 -1
- package/dist/ui/map/MapMarkers.d.ts +2 -2
- package/dist/ui/map/MapMarkers.js +0 -1
- package/dist/ui/map/MapMarkers.js.map +1 -1
- package/dist/ui/marketing/FeatureGrid.d.ts +2 -2
- package/dist/ui/marketing/Hero.d.ts +2 -2
- package/dist/ui/marketing/PricingTable.d.ts +2 -2
- package/dist/ui/menubar.d.ts +17 -17
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +11 -12
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/molecules/Autocomplete/index.d.ts +2 -2
- package/dist/ui/molecules/Autocomplete/index.js +0 -1
- package/dist/ui/molecules/Autocomplete/index.js.map +1 -1
- package/dist/ui/molecules/SearchAndFilter/types.d.ts.map +1 -1
- package/dist/ui/molecules/SkeletonList.d.ts +2 -2
- package/dist/ui/nav-layout.d.ts +9 -9
- package/dist/ui/nav-layout.d.ts.map +1 -1
- package/dist/ui/nav-layout.js +1 -1
- package/dist/ui/nav-layout.js.map +1 -1
- package/dist/ui/navigation-menu.d.ts +11 -11
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +8 -8
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.d.ts +2 -2
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.js +0 -1
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/dist/ui/organisms/ListPage/ListPage.d.ts +2 -2
- package/dist/ui/page-header.d.ts +5 -5
- package/dist/ui/pagination.d.ts +6 -6
- package/dist/ui/pagination.js +7 -7
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/popover.d.ts +5 -5
- package/dist/ui/popover.js +1 -2
- package/dist/ui/popover.js.map +1 -1
- package/dist/ui/progress.js +1 -2
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio-group.d.ts +3 -3
- package/dist/ui/radio-group.js +2 -3
- package/dist/ui/radio-group.js.map +1 -1
- package/dist/ui/resizable.d.ts +7 -7
- package/dist/ui/resizable.d.ts.map +1 -1
- package/dist/ui/resizable.js +2 -3
- package/dist/ui/resizable.js.map +1 -1
- package/dist/ui/route-announcer.d.ts +2 -2
- package/dist/ui/route-announcer.js +0 -1
- package/dist/ui/route-announcer.js.map +1 -1
- package/dist/ui/scroll-area.d.ts +3 -3
- package/dist/ui/scroll-area.js +2 -3
- package/dist/ui/scroll-area.js.map +1 -1
- package/dist/ui/section.d.ts +7 -7
- package/dist/ui/section.d.ts.map +1 -1
- package/dist/ui/section.js +1 -1
- package/dist/ui/section.js.map +1 -1
- package/dist/ui/select.d.ts +11 -11
- package/dist/ui/select.js +7 -8
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/separator.d.ts +2 -2
- package/dist/ui/separator.js +1 -2
- package/dist/ui/separator.js.map +1 -1
- package/dist/ui/sheet.d.ts +9 -9
- package/dist/ui/sheet.js +6 -7
- package/dist/ui/sheet.js.map +1 -1
- package/dist/ui/sidebar.d.ts +28 -28
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +23 -24
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/skeleton.d.ts +2 -2
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/skeleton.js.map +1 -1
- package/dist/ui/skip-link.d.ts +2 -2
- package/dist/ui/skip-link.js +1 -1
- package/dist/ui/skip-link.js.map +1 -1
- package/dist/ui/slider.d.ts +2 -2
- package/dist/ui/slider.js +1 -2
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/sonner.d.ts +2 -2
- package/dist/ui/sonner.js +0 -1
- package/dist/ui/sonner.js.map +1 -1
- package/dist/ui/stack.d.ts +13 -13
- package/dist/ui/stack.d.ts.map +1 -1
- package/dist/ui/stack.js +3 -3
- package/dist/ui/stack.js.map +1 -1
- package/dist/ui/stat-card-group.d.ts +2 -2
- package/dist/ui/stepper.d.ts +2 -2
- package/dist/ui/switch.d.ts +2 -2
- package/dist/ui/switch.js +1 -2
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/table.d.ts +9 -9
- package/dist/ui/table.js +8 -9
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/tabs.d.ts +5 -5
- package/dist/ui/tabs.js +4 -5
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/text.d.ts +2 -2
- package/dist/ui/text.js +1 -1
- package/dist/ui/text.js.map +1 -1
- package/dist/ui/textarea.d.ts +2 -2
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/textarea.js.map +1 -1
- package/dist/ui/time-picker.d.ts +2 -2
- package/dist/ui/time-picker.js +0 -1
- package/dist/ui/time-picker.js.map +1 -1
- package/dist/ui/toast.d.ts +2 -2
- package/dist/ui/toast.js +6 -7
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/toaster.d.ts +2 -2
- package/dist/ui/toaster.js +1 -2
- package/dist/ui/toaster.js.map +1 -1
- package/dist/ui/toggle-group.d.ts +3 -3
- package/dist/ui/toggle-group.js +2 -3
- package/dist/ui/toggle-group.js.map +1 -1
- package/dist/ui/toggle.d.ts +4 -4
- package/dist/ui/toggle.js +1 -2
- package/dist/ui/toggle.js.map +1 -1
- package/dist/ui/tooltip.d.ts +5 -5
- package/dist/ui/tooltip.js +2 -3
- package/dist/ui/tooltip.js.map +1 -1
- package/dist/ui/typography.d.ts +12 -12
- package/dist/ui/typography.js +11 -11
- package/dist/ui/typography.js.map +1 -1
- package/dist/ui/use-toast.js +0 -1
- package/dist/ui/use-toast.js.map +1 -1
- package/dist/ui/usecases/UseCaseCard.d.ts +2 -2
- package/dist/ui/usecases/UserStoryCard.d.ts +2 -2
- package/dist/ui/visually-hidden.js +1 -1
- package/dist/ui/visually-hidden.js.map +1 -1
- package/package.json +9 -10
- package/dist/ui/sidebar-right.d.ts +0 -165
- package/dist/ui/sidebar-right.d.ts.map +0 -1
- package/dist/ui/sidebar-right.js +0 -380
- package/dist/ui/sidebar-right.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-picker.js","names":["React"],"sources":["../../ui/time-picker.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Popover, PopoverContent, PopoverTrigger } from './popover';\nimport { Button } from './button';\nimport { cn } from './utils';\n\nexport interface TimePickerProps {\n value: Date | null;\n onChange: (date: Date | null) => void;\n disabled?: boolean;\n placeholder?: string;\n is24Hour?: boolean;\n className?: string;\n}\n\nfunction formatTime(d: Date | null, is24Hour?: boolean) {\n if (!d) return '';\n return d.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: !is24Hour,\n });\n}\n\nexport function TimePicker({\n value,\n onChange,\n disabled,\n placeholder = 'Select time',\n is24Hour = true,\n className,\n}: TimePickerProps) {\n const [open, setOpen] = React.useState(false);\n const [hours, setHours] = React.useState<string>(() =>\n value ? String(value.getHours()).padStart(2, '0') : ''\n );\n const [minutes, setMinutes] = React.useState<string>(() =>\n value ? String(value.getMinutes()).padStart(2, '0') : ''\n );\n\n const commit = (h: number, m: number) => {\n const base = value ?? new Date();\n const next = new Date(base);\n next.setHours(h, m, 0, 0);\n onChange(next);\n setOpen(false);\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={disabled}\n className={cn(\n 'w-full justify-start text-left font-normal',\n className\n )}\n >\n {value ? (\n formatTime(value, is24Hour)\n ) : (\n <span className=\"opacity-50\">{placeholder}</span>\n )}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-56\" align=\"start\">\n <div className=\"flex items-center gap-2\">\n <input\n type=\"number\"\n min={0}\n max={is24Hour ? 23 : 12}\n value={hours}\n onChange={(e) => setHours(e.target.value)}\n className=\"border-input bg-background w-16 rounded-md border px-2 py-1 text-center\"\n />\n <span>:</span>\n <input\n type=\"number\"\n min={0}\n max={59}\n value={minutes}\n onChange={(e) => setMinutes(e.target.value)}\n className=\"border-input bg-background w-16 rounded-md border px-2 py-1 text-center\"\n />\n <Button\n type=\"button\"\n onClick={() => commit(Number(hours || 0), Number(minutes || 0))}\n className=\"ml-auto\"\n >\n Set\n </Button>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"time-picker.js","names":["React"],"sources":["../../ui/time-picker.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Popover, PopoverContent, PopoverTrigger } from './popover';\nimport { Button } from './button';\nimport { cn } from './utils';\n\nexport interface TimePickerProps {\n value: Date | null;\n onChange: (date: Date | null) => void;\n disabled?: boolean;\n placeholder?: string;\n is24Hour?: boolean;\n className?: string;\n}\n\nfunction formatTime(d: Date | null, is24Hour?: boolean) {\n if (!d) return '';\n return d.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: !is24Hour,\n });\n}\n\nexport function TimePicker({\n value,\n onChange,\n disabled,\n placeholder = 'Select time',\n is24Hour = true,\n className,\n}: TimePickerProps) {\n const [open, setOpen] = React.useState(false);\n const [hours, setHours] = React.useState<string>(() =>\n value ? String(value.getHours()).padStart(2, '0') : ''\n );\n const [minutes, setMinutes] = React.useState<string>(() =>\n value ? String(value.getMinutes()).padStart(2, '0') : ''\n );\n\n const commit = (h: number, m: number) => {\n const base = value ?? new Date();\n const next = new Date(base);\n next.setHours(h, m, 0, 0);\n onChange(next);\n setOpen(false);\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={disabled}\n className={cn(\n 'w-full justify-start text-left font-normal',\n className\n )}\n >\n {value ? (\n formatTime(value, is24Hour)\n ) : (\n <span className=\"opacity-50\">{placeholder}</span>\n )}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-56\" align=\"start\">\n <div className=\"flex items-center gap-2\">\n <input\n type=\"number\"\n min={0}\n max={is24Hour ? 23 : 12}\n value={hours}\n onChange={(e) => setHours(e.target.value)}\n className=\"border-input bg-background w-16 rounded-md border px-2 py-1 text-center\"\n />\n <span>:</span>\n <input\n type=\"number\"\n min={0}\n max={59}\n value={minutes}\n onChange={(e) => setMinutes(e.target.value)}\n className=\"border-input bg-background w-16 rounded-md border px-2 py-1 text-center\"\n />\n <Button\n type=\"button\"\n onClick={() => commit(Number(hours || 0), Number(minutes || 0))}\n className=\"ml-auto\"\n >\n Set\n </Button>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;AAgBA,SAAS,WAAW,GAAgB,UAAoB;AACtD,KAAI,CAAC,EAAG,QAAO;AACf,QAAO,EAAE,mBAAmB,EAAE,EAAE;EAC9B,MAAM;EACN,QAAQ;EACR,QAAQ,CAAC;EACV,CAAC;;AAGJ,SAAgB,WAAW,EACzB,OACA,UACA,UACA,cAAc,eACd,WAAW,MACX,aACkB;CAClB,MAAM,CAAC,MAAM,WAAWA,QAAM,SAAS,MAAM;CAC7C,MAAM,CAAC,OAAO,YAAYA,QAAM,eAC9B,QAAQ,OAAO,MAAM,UAAU,CAAC,CAAC,SAAS,GAAG,IAAI,GAAG,GACrD;CACD,MAAM,CAAC,SAAS,cAAcA,QAAM,eAClC,QAAQ,OAAO,MAAM,YAAY,CAAC,CAAC,SAAS,GAAG,IAAI,GAAG,GACvD;CAED,MAAM,UAAU,GAAW,MAAc;EACvC,MAAM,OAAO,yBAAS,IAAI,MAAM;EAChC,MAAM,OAAO,IAAI,KAAK,KAAK;AAC3B,OAAK,SAAS,GAAG,GAAG,GAAG,EAAE;AACzB,WAAS,KAAK;AACd,UAAQ,MAAM;;AAGhB,QACE,qBAAC;EAAc;EAAM,cAAc;aACjC,oBAAC;GAAe;aACd,oBAAC;IACC,MAAK;IACL,SAAQ;IACE;IACV,WAAW,GACT,8CACA,UACD;cAEA,QACC,WAAW,OAAO,SAAS,GAE3B,oBAAC;KAAK,WAAU;eAAc;MAAmB;KAE5C;IACM,EACjB,oBAAC;GAAe,WAAU;GAAO,OAAM;aACrC,qBAAC;IAAI,WAAU;;KACb,oBAAC;MACC,MAAK;MACL,KAAK;MACL,KAAK,WAAW,KAAK;MACrB,OAAO;MACP,WAAW,MAAM,SAAS,EAAE,OAAO,MAAM;MACzC,WAAU;OACV;KACF,oBAAC,oBAAK,MAAQ;KACd,oBAAC;MACC,MAAK;MACL,KAAK;MACL,KAAK;MACL,OAAO;MACP,WAAW,MAAM,WAAW,EAAE,OAAO,MAAM;MAC3C,WAAU;OACV;KACF,oBAAC;MACC,MAAK;MACL,eAAe,OAAO,OAAO,SAAS,EAAE,EAAE,OAAO,WAAW,EAAE,CAAC;MAC/D,WAAU;gBACX;OAEQ;;KACL;IACS;GACT"}
|
package/dist/ui/toast.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
4
|
-
import * as
|
|
4
|
+
import * as class_variance_authority_types21 from "class-variance-authority/types";
|
|
5
5
|
|
|
6
6
|
//#region ui/toast.d.ts
|
|
7
7
|
declare const ToastProvider: React$1.FC<ToastPrimitives.ToastProviderProps>;
|
|
8
8
|
declare const ToastViewport: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React$1.RefAttributes<HTMLOListElement>, "ref"> & React$1.RefAttributes<HTMLOListElement>>;
|
|
9
9
|
declare const Toast: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React$1.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
|
|
10
10
|
variant?: "default" | "destructive" | null | undefined;
|
|
11
|
-
} &
|
|
11
|
+
} & class_variance_authority_types21.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLLIElement>>;
|
|
12
12
|
declare const ToastAction: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
13
13
|
declare const ToastClose: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
14
14
|
declare const ToastTitle: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
package/dist/ui/toast.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
import { cn } from "./utils.js";
|
|
5
4
|
import * as React$1 from "react";
|
|
6
5
|
import { X } from "lucide-react";
|
|
@@ -10,7 +9,7 @@ import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
|
10
9
|
|
|
11
10
|
//#region ui/toast.tsx
|
|
12
11
|
const ToastProvider = ToastPrimitives.Provider;
|
|
13
|
-
const ToastViewport = React$1.forwardRef(({ className
|
|
12
|
+
const ToastViewport = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ToastPrimitives.Viewport, {
|
|
14
13
|
ref,
|
|
15
14
|
className: cn("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]", className),
|
|
16
15
|
...props
|
|
@@ -23,7 +22,7 @@ const toastVariants = cva("group pointer-events-auto relative flex w-full items-
|
|
|
23
22
|
} },
|
|
24
23
|
defaultVariants: { variant: "default" }
|
|
25
24
|
});
|
|
26
|
-
const Toast = React$1.forwardRef(({ className, variant
|
|
25
|
+
const Toast = React$1.forwardRef(({ className, variant, ...props }, ref) => {
|
|
27
26
|
return /* @__PURE__ */ jsx(ToastPrimitives.Root, {
|
|
28
27
|
ref,
|
|
29
28
|
className: cn(toastVariants({ variant }), className),
|
|
@@ -31,13 +30,13 @@ const Toast = React$1.forwardRef(({ className, variant,...props }, ref) => {
|
|
|
31
30
|
});
|
|
32
31
|
});
|
|
33
32
|
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
34
|
-
const ToastAction = React$1.forwardRef(({ className
|
|
33
|
+
const ToastAction = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ToastPrimitives.Action, {
|
|
35
34
|
ref,
|
|
36
35
|
className: cn("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-base font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none disabled:opacity-50", className),
|
|
37
36
|
...props
|
|
38
37
|
}));
|
|
39
38
|
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
40
|
-
const ToastClose = React$1.forwardRef(({ className
|
|
39
|
+
const ToastClose = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ToastPrimitives.Close, {
|
|
41
40
|
ref,
|
|
42
41
|
className: cn("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-hidden group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600", className),
|
|
43
42
|
"toast-close": "",
|
|
@@ -45,13 +44,13 @@ const ToastClose = React$1.forwardRef(({ className,...props }, ref) => /* @__PUR
|
|
|
45
44
|
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
46
45
|
}));
|
|
47
46
|
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
48
|
-
const ToastTitle = React$1.forwardRef(({ className
|
|
47
|
+
const ToastTitle = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ToastPrimitives.Title, {
|
|
49
48
|
ref,
|
|
50
49
|
className: cn("text-base font-semibold", className),
|
|
51
50
|
...props
|
|
52
51
|
}));
|
|
53
52
|
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
54
|
-
const ToastDescription = React$1.forwardRef(({ className
|
|
53
|
+
const ToastDescription = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ToastPrimitives.Description, {
|
|
55
54
|
ref,
|
|
56
55
|
className: cn("text-base opacity-90", className),
|
|
57
56
|
...props
|
package/dist/ui/toast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.js","names":["React"],"sources":["../../ui/toast.tsx"],"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 './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:top-auto sm:right-0 sm:bottom-0 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-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-(--radix-toast-swipe-end-x) data-[swipe=move]:translate-x-(--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 sm:data-[state=open]: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 '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-base font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-hidden 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 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-hidden 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-base font-semibold', 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-base 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"],"mappings":"
|
|
1
|
+
{"version":3,"file":"toast.js","names":["React"],"sources":["../../ui/toast.tsx"],"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 './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:top-auto sm:right-0 sm:bottom-0 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-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-(--radix-toast-swipe-end-x) data-[swipe=move]:translate-x-(--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 sm:data-[state=open]: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 '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-base font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-hidden 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 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-hidden 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-base font-semibold', 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-base 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"],"mappings":";;;;;;;;;;AASA,MAAM,gBAAgB,gBAAgB;AAEtC,MAAM,gBAAgBA,QAAM,YAGzB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB;CACV;CACL,WAAW,GACT,mIACA,UACD;CACD,GAAI;EACJ,CACF;AACF,cAAc,cAAc,gBAAgB,SAAS;AAErD,MAAM,gBAAgB,IACpB,mlBACA;CACE,UAAU,EACR,SAAS;EACP,SAAS;EACT,aACE;EACH,EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACF,CACF;AAED,MAAM,QAAQA,QAAM,YAIjB,EAAE,WAAW,SAAS,GAAG,SAAS,QAAQ;AAC3C,QACE,oBAAC,gBAAgB;EACV;EACL,WAAW,GAAG,cAAc,EAAE,SAAS,CAAC,EAAE,UAAU;EACpD,GAAI;GACJ;EAEJ;AACF,MAAM,cAAc,gBAAgB,KAAK;AAEzC,MAAM,cAAcA,QAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB;CACV;CACL,WAAW,GACT,0gBACA,UACD;CACD,GAAI;EACJ,CACF;AACF,YAAY,cAAc,gBAAgB,OAAO;AAEjD,MAAM,aAAaA,QAAM,YAGtB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB;CACV;CACL,WAAW,GACT,2VACA,UACD;CACD,eAAY;CACZ,GAAI;WAEJ,oBAAC,KAAE,WAAU,YAAY;EACH,CACxB;AACF,WAAW,cAAc,gBAAgB,MAAM;AAE/C,MAAM,aAAaA,QAAM,YAGtB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB;CACV;CACL,WAAW,GAAG,2BAA2B,UAAU;CACnD,GAAI;EACJ,CACF;AACF,WAAW,cAAc,gBAAgB,MAAM;AAE/C,MAAM,mBAAmBA,QAAM,YAG5B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB;CACV;CACL,WAAW,GAAG,wBAAwB,UAAU;CAChD,GAAI;EACJ,CACF;AACF,iBAAiB,cAAc,gBAAgB,YAAY"}
|
package/dist/ui/toaster.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime155 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region ui/toaster.d.ts
|
|
4
|
-
declare function Toaster():
|
|
4
|
+
declare function Toaster(): react_jsx_runtime155.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { Toaster };
|
|
7
7
|
//# sourceMappingURL=toaster.d.ts.map
|
package/dist/ui/toaster.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport } from "./toast.js";
|
|
5
4
|
import { useToast } from "./use-toast.js";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -8,7 +7,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
8
7
|
//#region ui/toaster.tsx
|
|
9
8
|
function Toaster() {
|
|
10
9
|
const { toasts } = useToast();
|
|
11
|
-
return /* @__PURE__ */ jsxs(ToastProvider, { children: [toasts.map(function({ id, title, description, action
|
|
10
|
+
return /* @__PURE__ */ jsxs(ToastProvider, { children: [toasts.map(function({ id, title, description, action, ...props }) {
|
|
12
11
|
return /* @__PURE__ */ jsxs(Toast, {
|
|
13
12
|
...props,
|
|
14
13
|
children: [
|
package/dist/ui/toaster.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toaster.js","names":[],"sources":["../../ui/toaster.tsx"],"sourcesContent":["'use client';\n\nimport { useToast } from './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"],"mappings":"
|
|
1
|
+
{"version":3,"file":"toaster.js","names":[],"sources":["../../ui/toaster.tsx"],"sourcesContent":["'use client';\n\nimport { useToast } from './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"],"mappings":";;;;;;;AAYA,SAAgB,UAAU;CACxB,MAAM,EAAE,WAAW,UAAU;AAE7B,QACE,qBAAC,4BACE,OAAO,IAAI,SAAU,EAAE,IAAI,OAAO,aAAa,QAAQ,GAAG,SAAS;AAClE,SACE,qBAAC;GAAe,GAAI;;IAClB,qBAAC;KAAI,WAAU;gBACZ,SAAS,oBAAC,wBAAY,QAAmB,EACzC,eACC,oBAAC,8BAAkB,cAA+B;MAEhD;IACL;IACD,oBAAC,eAAa;;KARJ,GASJ;GAEV,EACF,oBAAC,kBAAgB,IACH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toggleVariants } from "./toggle.js";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime157 from "react/jsx-runtime";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
5
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
6
6
|
|
|
@@ -11,14 +11,14 @@ declare function ToggleGroup({
|
|
|
11
11
|
size,
|
|
12
12
|
children,
|
|
13
13
|
...props
|
|
14
|
-
}: React$1.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>):
|
|
14
|
+
}: React$1.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime157.JSX.Element;
|
|
15
15
|
declare function ToggleGroupItem({
|
|
16
16
|
className,
|
|
17
17
|
children,
|
|
18
18
|
variant,
|
|
19
19
|
size,
|
|
20
20
|
...props
|
|
21
|
-
}: React$1.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>):
|
|
21
|
+
}: React$1.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>): react_jsx_runtime157.JSX.Element;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { ToggleGroup, ToggleGroupItem };
|
|
24
24
|
//# sourceMappingURL=toggle-group.d.ts.map
|
package/dist/ui/toggle-group.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
import { cn } from "./utils.js";
|
|
5
4
|
import { toggleVariants } from "./toggle.js";
|
|
6
5
|
import * as React$1 from "react";
|
|
@@ -13,7 +12,7 @@ const ToggleGroupContext = React$1.createContext({
|
|
|
13
12
|
size: "default",
|
|
14
13
|
variant: "default"
|
|
15
14
|
});
|
|
16
|
-
function ToggleGroup({ className, variant, size, children
|
|
15
|
+
function ToggleGroup({ className, variant, size, children, ...props }) {
|
|
17
16
|
return /* @__PURE__ */ jsx(ToggleGroupPrimitive.Root, {
|
|
18
17
|
"data-slot": "toggle-group",
|
|
19
18
|
"data-variant": variant,
|
|
@@ -29,7 +28,7 @@ function ToggleGroup({ className, variant, size, children,...props }) {
|
|
|
29
28
|
})
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
|
-
function ToggleGroupItem({ className, children, variant, size
|
|
31
|
+
function ToggleGroupItem({ className, children, variant, size, ...props }) {
|
|
33
32
|
const context = React$1.useContext(ToggleGroupContext);
|
|
34
33
|
return /* @__PURE__ */ jsx(ToggleGroupPrimitive.Item, {
|
|
35
34
|
"data-slot": "toggle-group-item",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-group.js","names":["React"],"sources":["../../ui/toggle-group.tsx"],"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 './utils';\nimport { toggleVariants } from './toggle';\n\nconst ToggleGroupContext = React.createContext<\n VariantProps<typeof toggleVariants>\n>({\n size: 'default',\n variant: 'default',\n});\n\nfunction ToggleGroup({\n className,\n variant,\n size,\n children,\n ...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &\n VariantProps<typeof toggleVariants>) {\n return (\n <ToggleGroupPrimitive.Root\n data-slot=\"toggle-group\"\n data-variant={variant}\n data-size={size}\n className={cn(\n 'group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-2xs',\n className\n )}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size }}>\n {children}\n </ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n );\n}\n\nfunction ToggleGroupItem({\n className,\n children,\n variant,\n size,\n ...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &\n VariantProps<typeof toggleVariants>) {\n const context = React.useContext(ToggleGroupContext);\n\n return (\n <ToggleGroupPrimitive.Item\n data-slot=\"toggle-group-item\"\n data-variant={context.variant || variant}\n data-size={context.size || size}\n className={cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n 'min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l',\n className\n )}\n {...props}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n}\n\nexport { ToggleGroup, ToggleGroupItem };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"toggle-group.js","names":["React"],"sources":["../../ui/toggle-group.tsx"],"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 './utils';\nimport { toggleVariants } from './toggle';\n\nconst ToggleGroupContext = React.createContext<\n VariantProps<typeof toggleVariants>\n>({\n size: 'default',\n variant: 'default',\n});\n\nfunction ToggleGroup({\n className,\n variant,\n size,\n children,\n ...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &\n VariantProps<typeof toggleVariants>) {\n return (\n <ToggleGroupPrimitive.Root\n data-slot=\"toggle-group\"\n data-variant={variant}\n data-size={size}\n className={cn(\n 'group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-2xs',\n className\n )}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size }}>\n {children}\n </ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n );\n}\n\nfunction ToggleGroupItem({\n className,\n children,\n variant,\n size,\n ...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &\n VariantProps<typeof toggleVariants>) {\n const context = React.useContext(ToggleGroupContext);\n\n return (\n <ToggleGroupPrimitive.Item\n data-slot=\"toggle-group-item\"\n data-variant={context.variant || variant}\n data-size={context.size || size}\n className={cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n 'min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l',\n className\n )}\n {...props}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n}\n\nexport { ToggleGroup, ToggleGroupItem };\n"],"mappings":";;;;;;;;;;AASA,MAAM,qBAAqBA,QAAM,cAE/B;CACA,MAAM;CACN,SAAS;CACV,CAAC;AAEF,SAAS,YAAY,EACnB,WACA,SACA,MACA,UACA,GAAG,SAEkC;AACrC,QACE,oBAAC,qBAAqB;EACpB,aAAU;EACV,gBAAc;EACd,aAAW;EACX,WAAW,GACT,2FACA,UACD;EACD,GAAI;YAEJ,oBAAC,mBAAmB;GAAS,OAAO;IAAE;IAAS;IAAM;GAClD;IAC2B;GACJ;;AAIhC,SAAS,gBAAgB,EACvB,WACA,UACA,SACA,MACA,GAAG,SAEkC;CACrC,MAAM,UAAUA,QAAM,WAAW,mBAAmB;AAEpD,QACE,oBAAC,qBAAqB;EACpB,aAAU;EACV,gBAAc,QAAQ,WAAW;EACjC,aAAW,QAAQ,QAAQ;EAC3B,WAAW,GACT,eAAe;GACb,SAAS,QAAQ,WAAW;GAC5B,MAAM,QAAQ,QAAQ;GACvB,CAAC,EACF,+LACA,UACD;EACD,GAAI;EAEH;GACyB"}
|
package/dist/ui/toggle.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime191 from "react/jsx-runtime";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
5
|
-
import * as
|
|
5
|
+
import * as class_variance_authority_types19 from "class-variance-authority/types";
|
|
6
6
|
|
|
7
7
|
//#region ui/toggle.d.ts
|
|
8
8
|
declare const toggleVariants: (props?: ({
|
|
9
9
|
variant?: "default" | "outline" | null | undefined;
|
|
10
10
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
11
|
-
} &
|
|
11
|
+
} & class_variance_authority_types19.ClassProp) | undefined) => string;
|
|
12
12
|
declare function Toggle({
|
|
13
13
|
className,
|
|
14
14
|
variant,
|
|
15
15
|
size,
|
|
16
16
|
...props
|
|
17
|
-
}: React$1.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>):
|
|
17
|
+
}: React$1.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime191.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { Toggle, toggleVariants };
|
|
20
20
|
//# sourceMappingURL=toggle.d.ts.map
|
package/dist/ui/toggle.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
import { cn } from "./utils.js";
|
|
5
4
|
import "react";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -25,7 +24,7 @@ const toggleVariants = cva("inline-flex items-center justify-center gap-2 rounde
|
|
|
25
24
|
size: "default"
|
|
26
25
|
}
|
|
27
26
|
});
|
|
28
|
-
function Toggle({ className, variant, size
|
|
27
|
+
function Toggle({ className, variant, size, ...props }) {
|
|
29
28
|
return /* @__PURE__ */ jsx(TogglePrimitive.Root, {
|
|
30
29
|
"data-slot": "toggle",
|
|
31
30
|
className: cn(toggleVariants({
|
package/dist/ui/toggle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.js","names":[],"sources":["../../ui/toggle.tsx"],"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 './utils';\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-hidden transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap\",\n {\n variants: {\n variant: {\n default: 'bg-transparent',\n outline:\n 'border border-input bg-transparent shadow-2xs 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\nfunction Toggle({\n className,\n variant,\n size,\n ...props\n}: React.ComponentProps<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>) {\n return (\n <TogglePrimitive.Root\n data-slot=\"toggle\"\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Toggle, toggleVariants };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"toggle.js","names":[],"sources":["../../ui/toggle.tsx"],"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 './utils';\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-hidden transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap\",\n {\n variants: {\n variant: {\n default: 'bg-transparent',\n outline:\n 'border border-input bg-transparent shadow-2xs 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\nfunction Toggle({\n className,\n variant,\n size,\n ...props\n}: React.ComponentProps<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>) {\n return (\n <TogglePrimitive.Root\n data-slot=\"toggle\"\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Toggle, toggleVariants };\n"],"mappings":";;;;;;;;;AAQA,MAAM,iBAAiB,IACrB,mjBACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,SACE;GACH;EACD,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACL;EACF;CACD,iBAAiB;EACf,SAAS;EACT,MAAM;EACP;CACF,CACF;AAED,SAAS,OAAO,EACd,WACA,SACA,MACA,GAAG,SAEkC;AACrC,QACE,oBAAC,gBAAgB;EACf,aAAU;EACV,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM;GAAW,CAAC,CAAC;EAC3D,GAAI;GACJ"}
|
package/dist/ui/tooltip.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime192 from "react/jsx-runtime";
|
|
3
3
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4
4
|
|
|
5
5
|
//#region ui/tooltip.d.ts
|
|
6
6
|
declare function TooltipProvider({
|
|
7
7
|
delayDuration,
|
|
8
8
|
...props
|
|
9
|
-
}: React$1.ComponentProps<typeof TooltipPrimitive.Provider>):
|
|
9
|
+
}: React$1.ComponentProps<typeof TooltipPrimitive.Provider>): react_jsx_runtime192.JSX.Element;
|
|
10
10
|
declare function Tooltip({
|
|
11
11
|
...props
|
|
12
|
-
}: React$1.ComponentProps<typeof TooltipPrimitive.Root>):
|
|
12
|
+
}: React$1.ComponentProps<typeof TooltipPrimitive.Root>): react_jsx_runtime192.JSX.Element;
|
|
13
13
|
declare function TooltipTrigger({
|
|
14
14
|
...props
|
|
15
|
-
}: React$1.ComponentProps<typeof TooltipPrimitive.Trigger>):
|
|
15
|
+
}: React$1.ComponentProps<typeof TooltipPrimitive.Trigger>): react_jsx_runtime192.JSX.Element;
|
|
16
16
|
declare function TooltipContent({
|
|
17
17
|
className,
|
|
18
18
|
sideOffset,
|
|
19
19
|
children,
|
|
20
20
|
...props
|
|
21
|
-
}: React$1.ComponentProps<typeof TooltipPrimitive.Content>):
|
|
21
|
+
}: React$1.ComponentProps<typeof TooltipPrimitive.Content>): react_jsx_runtime192.JSX.Element;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
24
24
|
//# sourceMappingURL=tooltip.d.ts.map
|
package/dist/ui/tooltip.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
import { cn } from "./utils.js";
|
|
5
4
|
import "react";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
8
7
|
|
|
9
8
|
//#region ui/tooltip.tsx
|
|
10
|
-
function TooltipProvider({ delayDuration = 0
|
|
9
|
+
function TooltipProvider({ delayDuration = 0, ...props }) {
|
|
11
10
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, {
|
|
12
11
|
"data-slot": "tooltip-provider",
|
|
13
12
|
delayDuration,
|
|
@@ -26,7 +25,7 @@ function TooltipTrigger({ ...props }) {
|
|
|
26
25
|
...props
|
|
27
26
|
});
|
|
28
27
|
}
|
|
29
|
-
function TooltipContent({ className, sideOffset = 0, children
|
|
28
|
+
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
30
29
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(TooltipPrimitive.Content, {
|
|
31
30
|
"data-slot": "tooltip-content",
|
|
32
31
|
sideOffset,
|
package/dist/ui/tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","names":[],"sources":["../../ui/tooltip.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\n\nimport { cn } from './utils';\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n 'bg-foreground text-background 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 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance',\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":[],"sources":["../../ui/tooltip.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\n\nimport { cn } from './utils';\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n 'bg-foreground text-background 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 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance',\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"],"mappings":";;;;;;;;AAOA,SAAS,gBAAgB,EACvB,gBAAgB,GAChB,GAAG,SACsD;AACzD,QACE,oBAAC,iBAAiB;EAChB,aAAU;EACK;EACf,GAAI;GACJ;;AAIN,SAAS,QAAQ,EACf,GAAG,SACkD;AACrD,QACE,oBAAC,6BACC,oBAAC,iBAAiB;EAAK,aAAU;EAAU,GAAI;GAAS,GACxC;;AAItB,SAAS,eAAe,EACtB,GAAG,SACqD;AACxD,QAAO,oBAAC,iBAAiB;EAAQ,aAAU;EAAkB,GAAI;GAAS;;AAG5E,SAAS,eAAe,EACtB,WACA,aAAa,GACb,UACA,GAAG,SACqD;AACxD,QACE,oBAAC,iBAAiB,oBAChB,qBAAC,iBAAiB;EAChB,aAAU;EACE;EACZ,WAAW,GACT,qaACA,UACD;EACD,GAAI;aAEH,UACD,oBAAC,iBAAiB,SAAM,WAAU,qGAAqG;GAC9G,GACH"}
|
package/dist/ui/typography.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TextProps } from "./text.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime197 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region ui/typography.d.ts
|
|
5
5
|
type TypographyProps = TextProps & {
|
|
@@ -9,57 +9,57 @@ declare function H1({
|
|
|
9
9
|
className,
|
|
10
10
|
asChild,
|
|
11
11
|
...props
|
|
12
|
-
}: TypographyProps):
|
|
12
|
+
}: TypographyProps): react_jsx_runtime197.JSX.Element;
|
|
13
13
|
declare function H2({
|
|
14
14
|
className,
|
|
15
15
|
asChild,
|
|
16
16
|
...props
|
|
17
|
-
}: TypographyProps):
|
|
17
|
+
}: TypographyProps): react_jsx_runtime197.JSX.Element;
|
|
18
18
|
declare function H3({
|
|
19
19
|
className,
|
|
20
20
|
asChild,
|
|
21
21
|
...props
|
|
22
|
-
}: TypographyProps):
|
|
22
|
+
}: TypographyProps): react_jsx_runtime197.JSX.Element;
|
|
23
23
|
declare function H4({
|
|
24
24
|
className,
|
|
25
25
|
asChild,
|
|
26
26
|
...props
|
|
27
|
-
}: TypographyProps):
|
|
27
|
+
}: TypographyProps): react_jsx_runtime197.JSX.Element;
|
|
28
28
|
declare function P({
|
|
29
29
|
className,
|
|
30
30
|
asChild,
|
|
31
31
|
...props
|
|
32
|
-
}: TypographyProps):
|
|
32
|
+
}: TypographyProps): react_jsx_runtime197.JSX.Element;
|
|
33
33
|
declare function BlockQuote({
|
|
34
34
|
className,
|
|
35
35
|
asChild,
|
|
36
36
|
...props
|
|
37
|
-
}: TypographyProps):
|
|
37
|
+
}: TypographyProps): react_jsx_runtime197.JSX.Element;
|
|
38
38
|
declare function Code({
|
|
39
39
|
className,
|
|
40
40
|
asChild,
|
|
41
41
|
...props
|
|
42
|
-
}: TypographyProps):
|
|
42
|
+
}: TypographyProps): react_jsx_runtime197.JSX.Element;
|
|
43
43
|
declare function Lead({
|
|
44
44
|
className,
|
|
45
45
|
asChild,
|
|
46
46
|
...props
|
|
47
|
-
}: TypographyProps):
|
|
47
|
+
}: TypographyProps): react_jsx_runtime197.JSX.Element;
|
|
48
48
|
declare function Large({
|
|
49
49
|
className,
|
|
50
50
|
asChild,
|
|
51
51
|
...props
|
|
52
|
-
}: TypographyProps):
|
|
52
|
+
}: TypographyProps): react_jsx_runtime197.JSX.Element;
|
|
53
53
|
declare function Small({
|
|
54
54
|
className,
|
|
55
55
|
asChild,
|
|
56
56
|
...props
|
|
57
|
-
}: TypographyProps):
|
|
57
|
+
}: TypographyProps): react_jsx_runtime197.JSX.Element;
|
|
58
58
|
declare function Muted({
|
|
59
59
|
className,
|
|
60
60
|
asChild,
|
|
61
61
|
...props
|
|
62
|
-
}: TypographyProps):
|
|
62
|
+
}: TypographyProps): react_jsx_runtime197.JSX.Element;
|
|
63
63
|
//#endregion
|
|
64
64
|
export { BlockQuote, Code, H1, H2, H3, H4, Large, Lead, Muted, P, Small };
|
|
65
65
|
//# sourceMappingURL=typography.d.ts.map
|
package/dist/ui/typography.js
CHANGED
|
@@ -5,7 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import { Slot } from "@radix-ui/react-slot";
|
|
6
6
|
|
|
7
7
|
//#region ui/typography.tsx
|
|
8
|
-
function H1({ className, asChild = false
|
|
8
|
+
function H1({ className, asChild = false, ...props }) {
|
|
9
9
|
return /* @__PURE__ */ jsx(asChild ? Slot : "h1", {
|
|
10
10
|
role: "heading",
|
|
11
11
|
"aria-level": 1,
|
|
@@ -13,7 +13,7 @@ function H1({ className, asChild = false,...props }) {
|
|
|
13
13
|
...props
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
function H2({ className, asChild = false
|
|
16
|
+
function H2({ className, asChild = false, ...props }) {
|
|
17
17
|
return /* @__PURE__ */ jsx(asChild ? Slot : "h2", {
|
|
18
18
|
role: "heading",
|
|
19
19
|
"aria-level": 2,
|
|
@@ -21,7 +21,7 @@ function H2({ className, asChild = false,...props }) {
|
|
|
21
21
|
...props
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
function H3({ className, asChild = false
|
|
24
|
+
function H3({ className, asChild = false, ...props }) {
|
|
25
25
|
return /* @__PURE__ */ jsx(asChild ? Slot : "h3", {
|
|
26
26
|
role: "heading",
|
|
27
27
|
"aria-level": 3,
|
|
@@ -29,7 +29,7 @@ function H3({ className, asChild = false,...props }) {
|
|
|
29
29
|
...props
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
function H4({ className, asChild = false
|
|
32
|
+
function H4({ className, asChild = false, ...props }) {
|
|
33
33
|
return /* @__PURE__ */ jsx(asChild ? Slot : "h4", {
|
|
34
34
|
role: "heading",
|
|
35
35
|
"aria-level": 4,
|
|
@@ -37,45 +37,45 @@ function H4({ className, asChild = false,...props }) {
|
|
|
37
37
|
...props
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
function P({ className, asChild = false
|
|
40
|
+
function P({ className, asChild = false, ...props }) {
|
|
41
41
|
return /* @__PURE__ */ jsx(asChild ? Slot : Text, {
|
|
42
42
|
className: cn("text-foreground web:select-text text-base", className),
|
|
43
43
|
...props
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
function BlockQuote({ className, asChild = false
|
|
46
|
+
function BlockQuote({ className, asChild = false, ...props }) {
|
|
47
47
|
return /* @__PURE__ */ jsx(asChild ? Slot : Text, {
|
|
48
48
|
role: "blockquote",
|
|
49
49
|
className: cn("native:mt-4 native:pl-3 border-border text-foreground web:select-text mt-6 border-l-2 pl-6 text-base italic", className),
|
|
50
50
|
...props
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
function Code({ className, asChild = false
|
|
53
|
+
function Code({ className, asChild = false, ...props }) {
|
|
54
54
|
return /* @__PURE__ */ jsx(asChild ? Slot : Text, {
|
|
55
55
|
role: "code",
|
|
56
56
|
className: cn("bg-muted text-foreground web:select-text relative rounded-md px-[0.3rem] py-[0.2rem] text-sm font-semibold", className),
|
|
57
57
|
...props
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
function Lead({ className, asChild = false
|
|
60
|
+
function Lead({ className, asChild = false, ...props }) {
|
|
61
61
|
return /* @__PURE__ */ jsx(asChild ? Slot : Text, {
|
|
62
62
|
className: cn("text-muted-foreground web:select-text text-xl", className),
|
|
63
63
|
...props
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
function Large({ className, asChild = false
|
|
66
|
+
function Large({ className, asChild = false, ...props }) {
|
|
67
67
|
return /* @__PURE__ */ jsx(asChild ? Slot : Text, {
|
|
68
68
|
className: cn("text-foreground web:select-text text-xl font-semibold", className),
|
|
69
69
|
...props
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
function Small({ className, asChild = false
|
|
72
|
+
function Small({ className, asChild = false, ...props }) {
|
|
73
73
|
return /* @__PURE__ */ jsx(asChild ? Slot : Text, {
|
|
74
74
|
className: cn("text-foreground web:select-text text-sm leading-none font-medium", className),
|
|
75
75
|
...props
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
function Muted({ className, asChild = false
|
|
78
|
+
function Muted({ className, asChild = false, ...props }) {
|
|
79
79
|
return /* @__PURE__ */ jsx(asChild ? Slot : Text, {
|
|
80
80
|
className: cn("text-muted-foreground web:select-text text-sm", className),
|
|
81
81
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.js","names":[],"sources":["../../ui/typography.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport * as React from 'react';\nimport { Text, type TextProps } from './text';\nimport { cn } from './utils';\n\ntype TypographyProps = TextProps & {\n asChild?: boolean;\n};\n\nfunction H1({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : 'h1';\n return (\n <Component\n role=\"heading\"\n aria-level={1}\n className={cn(\n 'text-foreground web:select-text web:scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction H2({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : 'h2';\n return (\n <Component\n role=\"heading\"\n aria-level={2}\n className={cn(\n 'border-border text-foreground web:select-text web:scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction H3({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : 'h3';\n return (\n <Component\n role=\"heading\"\n aria-level={3}\n className={cn(\n 'text-foreground web:select-text web:scroll-m-20 text-2xl font-semibold tracking-tight',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction H4({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : 'h4';\n return (\n <Component\n role=\"heading\"\n aria-level={4}\n className={cn(\n 'text-foreground web:select-text web:scroll-m-20 text-xl font-semibold tracking-tight',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction P({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n className={cn('text-foreground web:select-text text-base', className)}\n {...props}\n />\n );\n}\n\nfunction BlockQuote({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n role=\"blockquote\"\n className={cn(\n 'native:mt-4 native:pl-3 border-border text-foreground web:select-text mt-6 border-l-2 pl-6 text-base italic',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction Code({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n role=\"code\"\n className={cn(\n 'bg-muted text-foreground web:select-text relative rounded-md px-[0.3rem] py-[0.2rem] text-sm font-semibold',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction Lead({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n className={cn('text-muted-foreground web:select-text text-xl', className)}\n {...props}\n />\n );\n}\n\nfunction Large({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n className={cn(\n 'text-foreground web:select-text text-xl font-semibold',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction Small({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n className={cn(\n 'text-foreground web:select-text text-sm leading-none font-medium',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction Muted({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n className={cn('text-muted-foreground web:select-text text-sm', className)}\n {...props}\n />\n );\n}\n\nexport { BlockQuote, Code, H1, H2, H3, H4, Large, Lead, Muted, P, Small };\n"],"mappings":";;;;;;;AASA,SAAS,GAAG,EAAE,WAAW,UAAU,
|
|
1
|
+
{"version":3,"file":"typography.js","names":[],"sources":["../../ui/typography.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport * as React from 'react';\nimport { Text, type TextProps } from './text';\nimport { cn } from './utils';\n\ntype TypographyProps = TextProps & {\n asChild?: boolean;\n};\n\nfunction H1({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : 'h1';\n return (\n <Component\n role=\"heading\"\n aria-level={1}\n className={cn(\n 'text-foreground web:select-text web:scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction H2({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : 'h2';\n return (\n <Component\n role=\"heading\"\n aria-level={2}\n className={cn(\n 'border-border text-foreground web:select-text web:scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction H3({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : 'h3';\n return (\n <Component\n role=\"heading\"\n aria-level={3}\n className={cn(\n 'text-foreground web:select-text web:scroll-m-20 text-2xl font-semibold tracking-tight',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction H4({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : 'h4';\n return (\n <Component\n role=\"heading\"\n aria-level={4}\n className={cn(\n 'text-foreground web:select-text web:scroll-m-20 text-xl font-semibold tracking-tight',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction P({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n className={cn('text-foreground web:select-text text-base', className)}\n {...props}\n />\n );\n}\n\nfunction BlockQuote({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n role=\"blockquote\"\n className={cn(\n 'native:mt-4 native:pl-3 border-border text-foreground web:select-text mt-6 border-l-2 pl-6 text-base italic',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction Code({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n role=\"code\"\n className={cn(\n 'bg-muted text-foreground web:select-text relative rounded-md px-[0.3rem] py-[0.2rem] text-sm font-semibold',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction Lead({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n className={cn('text-muted-foreground web:select-text text-xl', className)}\n {...props}\n />\n );\n}\n\nfunction Large({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n className={cn(\n 'text-foreground web:select-text text-xl font-semibold',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction Small({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n className={cn(\n 'text-foreground web:select-text text-sm leading-none font-medium',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction Muted({ className, asChild = false, ...props }: TypographyProps) {\n const Component = asChild ? Slot : Text;\n return (\n <Component\n className={cn('text-muted-foreground web:select-text text-sm', className)}\n {...props}\n />\n );\n}\n\nexport { BlockQuote, Code, H1, H2, H3, H4, Large, Lead, Muted, P, Small };\n"],"mappings":";;;;;;;AASA,SAAS,GAAG,EAAE,WAAW,UAAU,OAAO,GAAG,SAA0B;AAErE,QACE,oBAFgB,UAAU,OAAO;EAG/B,MAAK;EACL,cAAY;EACZ,WAAW,GACT,sGACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,GAAG,EAAE,WAAW,UAAU,OAAO,GAAG,SAA0B;AAErE,QACE,oBAFgB,UAAU,OAAO;EAG/B,MAAK;EACL,cAAY;EACZ,WAAW,GACT,gIACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,GAAG,EAAE,WAAW,UAAU,OAAO,GAAG,SAA0B;AAErE,QACE,oBAFgB,UAAU,OAAO;EAG/B,MAAK;EACL,cAAY;EACZ,WAAW,GACT,yFACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,GAAG,EAAE,WAAW,UAAU,OAAO,GAAG,SAA0B;AAErE,QACE,oBAFgB,UAAU,OAAO;EAG/B,MAAK;EACL,cAAY;EACZ,WAAW,GACT,wFACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,EAAE,EAAE,WAAW,UAAU,OAAO,GAAG,SAA0B;AAEpE,QACE,oBAFgB,UAAU,OAAO;EAG/B,WAAW,GAAG,6CAA6C,UAAU;EACrE,GAAI;GACJ;;AAIN,SAAS,WAAW,EAAE,WAAW,UAAU,OAAO,GAAG,SAA0B;AAE7E,QACE,oBAFgB,UAAU,OAAO;EAG/B,MAAK;EACL,WAAW,GACT,+GACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,KAAK,EAAE,WAAW,UAAU,OAAO,GAAG,SAA0B;AAEvE,QACE,oBAFgB,UAAU,OAAO;EAG/B,MAAK;EACL,WAAW,GACT,8GACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,KAAK,EAAE,WAAW,UAAU,OAAO,GAAG,SAA0B;AAEvE,QACE,oBAFgB,UAAU,OAAO;EAG/B,WAAW,GAAG,iDAAiD,UAAU;EACzE,GAAI;GACJ;;AAIN,SAAS,MAAM,EAAE,WAAW,UAAU,OAAO,GAAG,SAA0B;AAExE,QACE,oBAFgB,UAAU,OAAO;EAG/B,WAAW,GACT,yDACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,MAAM,EAAE,WAAW,UAAU,OAAO,GAAG,SAA0B;AAExE,QACE,oBAFgB,UAAU,OAAO;EAG/B,WAAW,GACT,oEACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,MAAM,EAAE,WAAW,UAAU,OAAO,GAAG,SAA0B;AAExE,QACE,oBAFgB,UAAU,OAAO;EAG/B,WAAW,GAAG,iDAAiD,UAAU;EACzE,GAAI;GACJ"}
|
package/dist/ui/use-toast.js
CHANGED
package/dist/ui/use-toast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-toast.js","names":["toast","listeners: ((state: State) => void)[]","memoryState: State","props","React"],"sources":["../../ui/use-toast.ts"],"sourcesContent":["'use client';\n\n// Inspired by react-hot-toast library\nimport * as React from 'react';\n\nimport type { ToastActionElement, ToastProps } from './toast';\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 1000000;\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: ToastActionElement;\n};\n\nconst actionTypes = {\n ADD_TOAST: 'ADD_TOAST',\n UPDATE_TOAST: 'UPDATE_TOAST',\n DISMISS_TOAST: 'DISMISS_TOAST',\n REMOVE_TOAST: 'REMOVE_TOAST',\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType['ADD_TOAST'];\n toast: ToasterToast;\n }\n | {\n type: ActionType['UPDATE_TOAST'];\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionType['DISMISS_TOAST'];\n toastId?: ToasterToast['id'];\n }\n | {\n type: ActionType['REMOVE_TOAST'];\n toastId?: ToasterToast['id'];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: 'REMOVE_TOAST',\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case 'ADD_TOAST':\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case 'UPDATE_TOAST':\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n };\n\n case 'DISMISS_TOAST': {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n };\n }\n case 'REMOVE_TOAST':\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: ((state: State) => void)[] = [];\n\nlet memoryState: State = { toasts: [] };\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n}\n\ntype Toast = Omit<ToasterToast, 'id'>;\n\nfunction toast({ ...props }: Toast) {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: 'UPDATE_TOAST',\n toast: { ...props, id },\n });\n const dismiss = () => dispatch({ type: 'DISMISS_TOAST', toastId: id });\n\n dispatch({\n type: 'ADD_TOAST',\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n}\n\nfunction useToast() {\n const [state, setState] = React.useState<State>(memoryState);\n\n React.useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: 'DISMISS_TOAST', toastId }),\n };\n}\n\nexport { useToast, toast };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-toast.js","names":["toast","listeners: ((state: State) => void)[]","memoryState: State","props","React"],"sources":["../../ui/use-toast.ts"],"sourcesContent":["'use client';\n\n// Inspired by react-hot-toast library\nimport * as React from 'react';\n\nimport type { ToastActionElement, ToastProps } from './toast';\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 1000000;\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: ToastActionElement;\n};\n\nconst actionTypes = {\n ADD_TOAST: 'ADD_TOAST',\n UPDATE_TOAST: 'UPDATE_TOAST',\n DISMISS_TOAST: 'DISMISS_TOAST',\n REMOVE_TOAST: 'REMOVE_TOAST',\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType['ADD_TOAST'];\n toast: ToasterToast;\n }\n | {\n type: ActionType['UPDATE_TOAST'];\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionType['DISMISS_TOAST'];\n toastId?: ToasterToast['id'];\n }\n | {\n type: ActionType['REMOVE_TOAST'];\n toastId?: ToasterToast['id'];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: 'REMOVE_TOAST',\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case 'ADD_TOAST':\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case 'UPDATE_TOAST':\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n };\n\n case 'DISMISS_TOAST': {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n };\n }\n case 'REMOVE_TOAST':\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: ((state: State) => void)[] = [];\n\nlet memoryState: State = { toasts: [] };\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n}\n\ntype Toast = Omit<ToasterToast, 'id'>;\n\nfunction toast({ ...props }: Toast) {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: 'UPDATE_TOAST',\n toast: { ...props, id },\n });\n const dismiss = () => dispatch({ type: 'DISMISS_TOAST', toastId: id });\n\n dispatch({\n type: 'ADD_TOAST',\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n}\n\nfunction useToast() {\n const [state, setState] = React.useState<State>(memoryState);\n\n React.useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: 'DISMISS_TOAST', toastId }),\n };\n}\n\nexport { useToast, toast };\n"],"mappings":";;;;;AAOA,MAAM,cAAc;AACpB,MAAM,qBAAqB;AAgB3B,IAAI,QAAQ;AAEZ,SAAS,QAAQ;AACf,UAAS,QAAQ,KAAK,OAAO;AAC7B,QAAO,MAAM,UAAU;;AA2BzB,MAAM,gCAAgB,IAAI,KAA4C;AAEtE,MAAM,oBAAoB,YAAoB;AAC5C,KAAI,cAAc,IAAI,QAAQ,CAC5B;CAGF,MAAM,UAAU,iBAAiB;AAC/B,gBAAc,OAAO,QAAQ;AAC7B,WAAS;GACP,MAAM;GACG;GACV,CAAC;IACD,mBAAmB;AAEtB,eAAc,IAAI,SAAS,QAAQ;;AAGrC,MAAa,WAAW,OAAc,WAA0B;AAC9D,SAAQ,OAAO,MAAf;EACE,KAAK,YACH,QAAO;GACL,GAAG;GACH,QAAQ,CAAC,OAAO,OAAO,GAAG,MAAM,OAAO,CAAC,MAAM,GAAG,YAAY;GAC9D;EAEH,KAAK,eACH,QAAO;GACL,GAAG;GACH,QAAQ,MAAM,OAAO,KAAK,MACxB,EAAE,OAAO,OAAO,MAAM,KAAK;IAAE,GAAG;IAAG,GAAG,OAAO;IAAO,GAAG,EACxD;GACF;EAEH,KAAK,iBAAiB;GACpB,MAAM,EAAE,YAAY;AAIpB,OAAI,QACF,kBAAiB,QAAQ;OAEzB,OAAM,OAAO,SAAS,YAAU;AAC9B,qBAAiBA,QAAM,GAAG;KAC1B;AAGJ,UAAO;IACL,GAAG;IACH,QAAQ,MAAM,OAAO,KAAK,MACxB,EAAE,OAAO,WAAW,YAAY,SAC5B;KACE,GAAG;KACH,MAAM;KACP,GACD,EACL;IACF;;EAEH,KAAK;AACH,OAAI,OAAO,YAAY,OACrB,QAAO;IACL,GAAG;IACH,QAAQ,EAAE;IACX;AAEH,UAAO;IACL,GAAG;IACH,QAAQ,MAAM,OAAO,QAAQ,MAAM,EAAE,OAAO,OAAO,QAAQ;IAC5D;;;AAIP,MAAMC,YAAwC,EAAE;AAEhD,IAAIC,cAAqB,EAAE,QAAQ,EAAE,EAAE;AAEvC,SAAS,SAAS,QAAgB;AAChC,eAAc,QAAQ,aAAa,OAAO;AAC1C,WAAU,SAAS,aAAa;AAC9B,WAAS,YAAY;GACrB;;AAKJ,SAAS,MAAM,EAAE,GAAG,SAAgB;CAClC,MAAM,KAAK,OAAO;CAElB,MAAM,UAAU,YACd,SAAS;EACP,MAAM;EACN,OAAO;GAAE,GAAGC;GAAO;GAAI;EACxB,CAAC;CACJ,MAAM,gBAAgB,SAAS;EAAE,MAAM;EAAiB,SAAS;EAAI,CAAC;AAEtE,UAAS;EACP,MAAM;EACN,OAAO;GACL,GAAG;GACH;GACA,MAAM;GACN,eAAe,SAAS;AACtB,QAAI,CAAC,KAAM,UAAS;;GAEvB;EACF,CAAC;AAEF,QAAO;EACD;EACJ;EACA;EACD;;AAGH,SAAS,WAAW;CAClB,MAAM,CAAC,OAAO,YAAYC,QAAM,SAAgB,YAAY;AAE5D,SAAM,gBAAgB;AACpB,YAAU,KAAK,SAAS;AACxB,eAAa;GACX,MAAM,QAAQ,UAAU,QAAQ,SAAS;AACzC,OAAI,QAAQ,GACV,WAAU,OAAO,OAAO,EAAE;;IAG7B,CAAC,MAAM,CAAC;AAEX,QAAO;EACL,GAAG;EACH;EACA,UAAU,YAAqB,SAAS;GAAE,MAAM;GAAiB;GAAS,CAAC;EAC5E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime249 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region ui/usecases/UseCaseCard.d.ts
|
|
4
4
|
declare function UseCaseCard({
|
|
@@ -13,7 +13,7 @@ declare function UseCaseCard({
|
|
|
13
13
|
ctaHref?: string;
|
|
14
14
|
ctaLabel?: string;
|
|
15
15
|
onCtaClick?: () => void;
|
|
16
|
-
}):
|
|
16
|
+
}): react_jsx_runtime249.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { UseCaseCard };
|
|
19
19
|
//# sourceMappingURL=UseCaseCard.d.ts.map
|