@starwind-ui/core 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.
Files changed (134) hide show
  1. package/dist/index.js +41 -23
  2. package/dist/index.js.map +1 -1
  3. package/dist/src/components/accordion/Accordion.astro +8 -2
  4. package/dist/src/components/accordion/AccordionContent.astro +2 -1
  5. package/dist/src/components/accordion/AccordionItem.astro +8 -2
  6. package/dist/src/components/accordion/AccordionTrigger.astro +2 -1
  7. package/dist/src/components/accordion/index.ts +7 -5
  8. package/dist/src/components/alert/Alert.astro +5 -2
  9. package/dist/src/components/alert/AlertDescription.astro +4 -4
  10. package/dist/src/components/alert/AlertTitle.astro +3 -3
  11. package/dist/src/components/alert/index.ts +6 -4
  12. package/dist/src/components/alert-dialog/AlertDialog.astro +273 -0
  13. package/dist/src/components/alert-dialog/AlertDialogAction.astro +44 -0
  14. package/dist/src/components/alert-dialog/AlertDialogCancel.astro +45 -0
  15. package/dist/src/components/alert-dialog/AlertDialogContent.astro +50 -0
  16. package/dist/src/components/alert-dialog/AlertDialogDescription.astro +18 -0
  17. package/dist/src/components/alert-dialog/AlertDialogFooter.astro +16 -0
  18. package/dist/src/components/alert-dialog/AlertDialogHeader.astro +14 -0
  19. package/dist/src/components/alert-dialog/AlertDialogTitle.astro +20 -0
  20. package/dist/src/components/alert-dialog/AlertDialogTrigger.astro +47 -0
  21. package/dist/src/components/alert-dialog/index.ts +46 -0
  22. package/dist/src/components/avatar/Avatar.astro +2 -2
  23. package/dist/src/components/avatar/AvatarFallback.astro +2 -2
  24. package/dist/src/components/avatar/AvatarImage.astro +13 -2
  25. package/dist/src/components/avatar/index.ts +6 -4
  26. package/dist/src/components/badge/Badge.astro +2 -2
  27. package/dist/src/components/badge/index.ts +4 -2
  28. package/dist/src/components/breadcrumb/Breadcrumb.astro +1 -1
  29. package/dist/src/components/breadcrumb/BreadcrumbEllipsis.astro +4 -1
  30. package/dist/src/components/breadcrumb/BreadcrumbItem.astro +2 -2
  31. package/dist/src/components/breadcrumb/BreadcrumbLink.astro +2 -2
  32. package/dist/src/components/breadcrumb/BreadcrumbList.astro +2 -2
  33. package/dist/src/components/breadcrumb/BreadcrumbPage.astro +2 -1
  34. package/dist/src/components/breadcrumb/BreadcrumbSeparator.astro +2 -1
  35. package/dist/src/components/breadcrumb/index.ts +16 -6
  36. package/dist/src/components/button/Button.astro +2 -2
  37. package/dist/src/components/button/index.ts +4 -2
  38. package/dist/src/components/card/Card.astro +2 -2
  39. package/dist/src/components/card/CardContent.astro +2 -2
  40. package/dist/src/components/card/CardDescription.astro +2 -2
  41. package/dist/src/components/card/CardFooter.astro +2 -2
  42. package/dist/src/components/card/CardHeader.astro +2 -2
  43. package/dist/src/components/card/CardTitle.astro +2 -2
  44. package/dist/src/components/card/index.ts +16 -7
  45. package/dist/src/components/carousel/Carousel.astro +55 -0
  46. package/dist/src/components/carousel/CarouselContent.astro +26 -0
  47. package/dist/src/components/carousel/CarouselItem.astro +26 -0
  48. package/dist/src/components/carousel/CarouselNext.astro +33 -0
  49. package/dist/src/components/carousel/CarouselPrevious.astro +33 -0
  50. package/dist/src/components/carousel/carousel-script.ts +191 -0
  51. package/dist/src/components/carousel/index.ts +32 -0
  52. package/dist/src/components/checkbox/Checkbox.astro +10 -3
  53. package/dist/src/components/checkbox/index.ts +4 -2
  54. package/dist/src/components/dialog/Dialog.astro +24 -11
  55. package/dist/src/components/dialog/DialogClose.astro +7 -2
  56. package/dist/src/components/dialog/DialogContent.astro +6 -3
  57. package/dist/src/components/dialog/DialogDescription.astro +2 -2
  58. package/dist/src/components/dialog/DialogFooter.astro +2 -2
  59. package/dist/src/components/dialog/DialogHeader.astro +2 -2
  60. package/dist/src/components/dialog/DialogTitle.astro +2 -2
  61. package/dist/src/components/dialog/DialogTrigger.astro +7 -1
  62. package/dist/src/components/dialog/index.ts +20 -5
  63. package/dist/src/components/dropdown/Dropdown.astro +1 -0
  64. package/dist/src/components/dropdown/DropdownContent.astro +2 -1
  65. package/dist/src/components/dropdown/DropdownItem.astro +2 -1
  66. package/dist/src/components/dropdown/DropdownLabel.astro +2 -2
  67. package/dist/src/components/dropdown/DropdownSeparator.astro +2 -1
  68. package/dist/src/components/dropdown/DropdownTrigger.astro +7 -2
  69. package/dist/src/components/dropdown/index.ts +14 -5
  70. package/dist/src/components/dropzone/Dropzone.astro +3 -2
  71. package/dist/src/components/dropzone/DropzoneFilesList.astro +3 -2
  72. package/dist/src/components/dropzone/DropzoneLoadingIndicator.astro +1 -1
  73. package/dist/src/components/dropzone/DropzoneUploadIndicator.astro +1 -1
  74. package/dist/src/components/dropzone/index.ts +14 -3
  75. package/dist/src/components/input/Input.astro +2 -2
  76. package/dist/src/components/input/index.ts +4 -2
  77. package/dist/src/components/label/Label.astro +2 -2
  78. package/dist/src/components/label/index.ts +4 -2
  79. package/dist/src/components/pagination/Pagination.astro +8 -2
  80. package/dist/src/components/pagination/PaginationContent.astro +2 -2
  81. package/dist/src/components/pagination/PaginationEllipsis.astro +7 -2
  82. package/dist/src/components/pagination/PaginationItem.astro +2 -2
  83. package/dist/src/components/pagination/PaginationLink.astro +2 -1
  84. package/dist/src/components/pagination/PaginationNext.astro +2 -1
  85. package/dist/src/components/pagination/PaginationPrevious.astro +2 -1
  86. package/dist/src/components/pagination/index.ts +18 -7
  87. package/dist/src/components/progress/Progress.astro +5 -2
  88. package/dist/src/components/progress/index.ts +7 -2
  89. package/dist/src/components/radio-group/RadioGroup.astro +2 -1
  90. package/dist/src/components/radio-group/RadioGroupItem.astro +7 -6
  91. package/dist/src/components/radio-group/index.ts +16 -3
  92. package/dist/src/components/select/Select.astro +1 -0
  93. package/dist/src/components/select/SelectContent.astro +3 -2
  94. package/dist/src/components/select/SelectGroup.astro +1 -1
  95. package/dist/src/components/select/SelectItem.astro +3 -2
  96. package/dist/src/components/select/SelectLabel.astro +2 -2
  97. package/dist/src/components/select/SelectSeparator.astro +2 -2
  98. package/dist/src/components/select/SelectTrigger.astro +2 -1
  99. package/dist/src/components/select/SelectValue.astro +2 -2
  100. package/dist/src/components/select/index.ts +18 -6
  101. package/dist/src/components/sheet/Sheet.astro +13 -0
  102. package/dist/src/components/sheet/SheetClose.astro +13 -0
  103. package/dist/src/components/sheet/SheetContent.astro +90 -0
  104. package/dist/src/components/sheet/SheetDescription.astro +16 -0
  105. package/dist/src/components/sheet/SheetFooter.astro +16 -0
  106. package/dist/src/components/sheet/SheetHeader.astro +16 -0
  107. package/dist/src/components/sheet/SheetTitle.astro +16 -0
  108. package/dist/src/components/sheet/SheetTrigger.astro +13 -0
  109. package/dist/src/components/sheet/index.ts +41 -0
  110. package/dist/src/components/skeleton/Skeleton.astro +2 -2
  111. package/dist/src/components/skeleton/index.ts +6 -2
  112. package/dist/src/components/switch/Switch.astro +6 -4
  113. package/dist/src/components/switch/index.ts +8 -2
  114. package/dist/src/components/table/Table.astro +3 -3
  115. package/dist/src/components/table/TableBody.astro +2 -2
  116. package/dist/src/components/table/TableCaption.astro +2 -2
  117. package/dist/src/components/table/TableCell.astro +2 -2
  118. package/dist/src/components/table/TableFoot.astro +2 -2
  119. package/dist/src/components/table/TableHead.astro +2 -2
  120. package/dist/src/components/table/TableHeader.astro +2 -2
  121. package/dist/src/components/table/TableRow.astro +2 -2
  122. package/dist/src/components/table/index.ts +30 -9
  123. package/dist/src/components/tabs/Tabs.astro +2 -1
  124. package/dist/src/components/tabs/TabsContent.astro +4 -1
  125. package/dist/src/components/tabs/TabsList.astro +8 -2
  126. package/dist/src/components/tabs/TabsTrigger.astro +2 -1
  127. package/dist/src/components/tabs/index.ts +12 -5
  128. package/dist/src/components/textarea/Textarea.astro +2 -2
  129. package/dist/src/components/textarea/index.ts +6 -2
  130. package/dist/src/components/tooltip/Tooltip.astro +2 -1
  131. package/dist/src/components/tooltip/TooltipContent.astro +2 -1
  132. package/dist/src/components/tooltip/TooltipTrigger.astro +1 -1
  133. package/dist/src/components/tooltip/index.ts +8 -3
  134. package/package.json +1 -1
@@ -1,13 +1,34 @@
1
- import Table from "./Table.astro";
2
- import TableBody from "./TableBody.astro";
3
- import TableCaption from "./TableCaption.astro";
4
- import TableCell from "./TableCell.astro";
5
- import TableFoot from "./TableFoot.astro";
6
- import TableHead from "./TableHead.astro";
7
- import TableHeader from "./TableHeader.astro";
8
- import TableRow from "./TableRow.astro";
1
+ import Table, { table } from "./Table.astro";
2
+ import TableBody, { tableBody } from "./TableBody.astro";
3
+ import TableCaption, { tableCaption } from "./TableCaption.astro";
4
+ import TableCell, { tableCell } from "./TableCell.astro";
5
+ import TableFoot, { tableFoot } from "./TableFoot.astro";
6
+ import TableHead, { tableHead } from "./TableHead.astro";
7
+ import TableHeader, { tableHeader } from "./TableHeader.astro";
8
+ import TableRow, { tableRow } from "./TableRow.astro";
9
9
 
10
- export { Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeader, TableRow };
10
+ const TableVariants = {
11
+ table,
12
+ tableBody,
13
+ tableCaption,
14
+ tableCell,
15
+ tableFoot,
16
+ tableHead,
17
+ tableHeader,
18
+ tableRow,
19
+ };
20
+
21
+ export {
22
+ Table,
23
+ TableBody,
24
+ TableCaption,
25
+ TableCell,
26
+ TableFoot,
27
+ TableHead,
28
+ TableHeader,
29
+ TableRow,
30
+ TableVariants,
31
+ };
11
32
 
12
33
  export default {
13
34
  Root: Table,
@@ -7,7 +7,7 @@ interface Props extends HTMLAttributes<"div"> {
7
7
  syncKey?: string;
8
8
  }
9
9
 
10
- const tabs = tv({ base: "starwind-tabs" });
10
+ export const tabs = tv({ base: "starwind-tabs" });
11
11
 
12
12
  const { defaultValue, syncKey, class: className, ...rest } = Astro.props;
13
13
  ---
@@ -16,6 +16,7 @@ const { defaultValue, syncKey, class: className, ...rest } = Astro.props;
16
16
  class={tabs({ class: className })}
17
17
  data-default-value={defaultValue}
18
18
  data-sync-key={syncKey}
19
+ data-slot="tabs"
19
20
  {...rest}
20
21
  >
21
22
  <slot />
@@ -6,13 +6,16 @@ interface Props extends Omit<HTMLAttributes<"div">, "id" | "role" | "tabindex" |
6
6
  value: string;
7
7
  }
8
8
 
9
- const tabsContent = tv({ base: "mt-2 focus-visible:outline-2 focus-visible:outline-offset-2" });
9
+ export const tabsContent = tv({
10
+ base: "mt-2 focus-visible:outline-2 focus-visible:outline-offset-2",
11
+ });
10
12
 
11
13
  const { value, class: className, ...rest } = Astro.props;
12
14
  ---
13
15
 
14
16
  <div
15
17
  class={tabsContent({ class: className })}
18
+ data-slot="tabs-content"
16
19
  data-tabs-content
17
20
  data-value={value}
18
21
  data-state="inactive"
@@ -4,13 +4,19 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = Omit<HTMLAttributes<"div">, "role">;
6
6
 
7
- const tabsList = tv({
7
+ export const tabsList = tv({
8
8
  base: "bg-muted text-muted-foreground inline-flex w-full items-center justify-center rounded-md p-1",
9
9
  });
10
10
 
11
11
  const { class: className, ...rest } = Astro.props;
12
12
  ---
13
13
 
14
- <div class={tabsList({ class: className })} data-tabs-list role="tablist" {...rest}>
14
+ <div
15
+ class={tabsList({ class: className })}
16
+ data-slot="tabs-list"
17
+ data-tabs-list
18
+ role="tablist"
19
+ {...rest}
20
+ >
15
21
  <slot />
16
22
  </div>
@@ -6,7 +6,7 @@ interface Props extends Omit<HTMLAttributes<"button">, "type" | "id" | "role"> {
6
6
  value: string;
7
7
  }
8
8
 
9
- const tabsTrigger = tv({
9
+ export const tabsTrigger = tv({
10
10
  base: [
11
11
  "starwind-transition-colors inline-flex grow items-center justify-center rounded-sm px-3 py-1.5 font-medium whitespace-nowrap",
12
12
  "data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
@@ -20,6 +20,7 @@ const { value, class: className, ...rest } = Astro.props;
20
20
 
21
21
  <button
22
22
  class={tabsTrigger({ class: className })}
23
+ data-slot="tabs-trigger"
23
24
  data-tabs-trigger
24
25
  data-value={value}
25
26
  data-state="inactive"
@@ -1,9 +1,16 @@
1
- import Tabs from "./Tabs.astro";
2
- import TabsContent from "./TabsContent.astro";
3
- import TabsList from "./TabsList.astro";
4
- import TabsTrigger from "./TabsTrigger.astro";
1
+ import Tabs, { tabs } from "./Tabs.astro";
2
+ import TabsContent, { tabsContent } from "./TabsContent.astro";
3
+ import TabsList, { tabsList } from "./TabsList.astro";
4
+ import TabsTrigger, { tabsTrigger } from "./TabsTrigger.astro";
5
5
 
6
- export { Tabs, TabsContent, TabsList, TabsTrigger };
6
+ const TabsVariants = {
7
+ tabs,
8
+ tabsContent,
9
+ tabsList,
10
+ tabsTrigger,
11
+ };
12
+
13
+ export { Tabs, TabsContent, TabsList, TabsTrigger, TabsVariants };
7
14
 
8
15
  export default {
9
16
  Root: Tabs,
@@ -4,7 +4,7 @@ import { tv, type VariantProps } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"textarea"> & VariantProps<typeof textarea>;
6
6
 
7
- const textarea = tv({
7
+ export const textarea = tv({
8
8
  base: [
9
9
  "border-input bg-background text-foreground ring-offset-background min-h-10 w-full rounded-md border",
10
10
  "focus:outline-outline focus:ring-0 focus:outline-2 focus:outline-offset-2",
@@ -25,4 +25,4 @@ const textarea = tv({
25
25
  const { size, class: className, ...rest } = Astro.props;
26
26
  ---
27
27
 
28
- <textarea class={textarea({ size, class: className })} {...rest}></textarea>
28
+ <textarea class={textarea({ size, class: className })} data-slot="textarea" {...rest}></textarea>
@@ -1,5 +1,9 @@
1
- import Textarea from "./Textarea.astro";
1
+ import Textarea, { textarea } from "./Textarea.astro";
2
2
 
3
- export { Textarea };
3
+ const TextareaVariants = {
4
+ textarea,
5
+ };
6
+
7
+ export { Textarea, TextareaVariants };
4
8
 
5
9
  export default Textarea;
@@ -17,7 +17,7 @@ type Props = HTMLAttributes<"div"> & {
17
17
  disableHoverableContent?: boolean;
18
18
  };
19
19
 
20
- const tooltip = tv({ base: "starwind-tooltip relative inline-block" });
20
+ export const tooltip = tv({ base: "starwind-tooltip relative inline-block" });
21
21
 
22
22
  const {
23
23
  openDelay = 200,
@@ -29,6 +29,7 @@ const {
29
29
 
30
30
  <div
31
31
  class={tooltip({ class: className })}
32
+ data-slot="tooltip"
32
33
  data-state="closed"
33
34
  data-open-delay={openDelay}
34
35
  data-close-delay={closeDelay}
@@ -30,7 +30,7 @@ type Props = HTMLAttributes<"div"> & {
30
30
  animationDuration?: number;
31
31
  };
32
32
 
33
- const tooltipContent = tv({
33
+ export const tooltipContent = tv({
34
34
  base: [
35
35
  "starwind-tooltip-content",
36
36
  "absolute z-50 hidden px-3 py-1.5 whitespace-nowrap shadow-sm will-change-transform",
@@ -84,6 +84,7 @@ const {
84
84
 
85
85
  <div
86
86
  class={tooltipContent({ side, align, class: className })}
87
+ data-slot="tooltip-content"
87
88
  data-state="closed"
88
89
  data-side={side}
89
90
  data-align={align}
@@ -3,7 +3,7 @@
3
3
  * This component is used to trigger the tooltip
4
4
  * All it does is require a slot
5
5
  */
6
- // eslint-disable-next-line
6
+
7
7
  type Props = { children: any };
8
8
  ---
9
9
 
@@ -1,8 +1,13 @@
1
- import Tooltip from "./Tooltip.astro";
2
- import TooltipContent from "./TooltipContent.astro";
1
+ import Tooltip, { tooltip } from "./Tooltip.astro";
2
+ import TooltipContent, { tooltipContent } from "./TooltipContent.astro";
3
3
  import TooltipTrigger from "./TooltipTrigger.astro";
4
4
 
5
- export { Tooltip, TooltipContent, TooltipTrigger };
5
+ const TooltipVariants = {
6
+ tooltip,
7
+ tooltipContent,
8
+ };
9
+
10
+ export { Tooltip, TooltipContent, TooltipTrigger, TooltipVariants };
6
11
 
7
12
  export default {
8
13
  Root: Tooltip,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starwind-ui/core",
3
- "version": "1.7.3",
3
+ "version": "1.9.0",
4
4
  "description": "Starwind UI core components and registry",
5
5
  "license": "MIT",
6
6
  "author": {