@hai3/uikit 0.1.0-alpha.10 → 0.1.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -8,7 +8,6 @@ var AspectRatioPrimitive = require('@radix-ui/react-aspect-ratio');
8
8
  var React26 = require('react');
9
9
  var AvatarPrimitive = require('@radix-ui/react-avatar');
10
10
  var reactSlot = require('@radix-ui/react-slot');
11
- var uikitContracts = require('@hai3/uikit-contracts');
12
11
  var SeparatorPrimitive = require('@radix-ui/react-separator');
13
12
  var reactDayPicker = require('react-day-picker');
14
13
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
@@ -286,28 +285,84 @@ var AvatarFallback = React26__namespace.forwardRef(({ className, ...props }, ref
286
285
  }
287
286
  ));
288
287
  AvatarFallback.displayName = AvatarPrimitive__namespace.Fallback.displayName;
288
+
289
+ // src/types.ts
290
+ var ButtonVariant = /* @__PURE__ */ ((ButtonVariant2) => {
291
+ ButtonVariant2["Default"] = "default";
292
+ ButtonVariant2["Destructive"] = "destructive";
293
+ ButtonVariant2["Outline"] = "outline";
294
+ ButtonVariant2["Secondary"] = "secondary";
295
+ ButtonVariant2["Ghost"] = "ghost";
296
+ ButtonVariant2["Link"] = "link";
297
+ return ButtonVariant2;
298
+ })(ButtonVariant || {});
299
+ var ButtonSize = /* @__PURE__ */ ((ButtonSize2) => {
300
+ ButtonSize2["Default"] = "default";
301
+ ButtonSize2["Sm"] = "sm";
302
+ ButtonSize2["Lg"] = "lg";
303
+ ButtonSize2["Icon"] = "icon";
304
+ return ButtonSize2;
305
+ })(ButtonSize || {});
306
+ var IconButtonSize = /* @__PURE__ */ ((IconButtonSize2) => {
307
+ IconButtonSize2["Default"] = "default";
308
+ IconButtonSize2["Small"] = "sm";
309
+ IconButtonSize2["Large"] = "lg";
310
+ return IconButtonSize2;
311
+ })(IconButtonSize || {});
312
+ var UiKitComponent = /* @__PURE__ */ ((UiKitComponent2) => {
313
+ UiKitComponent2["Button"] = "Button";
314
+ UiKitComponent2["IconButton"] = "IconButton";
315
+ UiKitComponent2["DropdownButton"] = "DropdownButton";
316
+ UiKitComponent2["Switch"] = "Switch";
317
+ UiKitComponent2["Skeleton"] = "Skeleton";
318
+ UiKitComponent2["Spinner"] = "Spinner";
319
+ UiKitComponent2["Header"] = "Header";
320
+ UiKitComponent2["Sidebar"] = "Sidebar";
321
+ UiKitComponent2["SidebarContent"] = "SidebarContent";
322
+ UiKitComponent2["SidebarHeader"] = "SidebarHeader";
323
+ UiKitComponent2["SidebarMenu"] = "SidebarMenu";
324
+ UiKitComponent2["SidebarMenuItem"] = "SidebarMenuItem";
325
+ UiKitComponent2["SidebarMenuButton"] = "SidebarMenuButton";
326
+ UiKitComponent2["SidebarMenuIcon"] = "SidebarMenuIcon";
327
+ UiKitComponent2["SidebarMenuLabel"] = "SidebarMenuLabel";
328
+ UiKitComponent2["UserInfo"] = "UserInfo";
329
+ UiKitComponent2["DropdownMenu"] = "DropdownMenu";
330
+ UiKitComponent2["DropdownMenuTrigger"] = "DropdownMenuTrigger";
331
+ UiKitComponent2["DropdownMenuContent"] = "DropdownMenuContent";
332
+ UiKitComponent2["DropdownMenuItem"] = "DropdownMenuItem";
333
+ UiKitComponent2["DropdownMenuSub"] = "DropdownMenuSub";
334
+ UiKitComponent2["DropdownMenuSubTrigger"] = "DropdownMenuSubTrigger";
335
+ UiKitComponent2["DropdownMenuSubContent"] = "DropdownMenuSubContent";
336
+ return UiKitComponent2;
337
+ })(UiKitComponent || {});
338
+ var UiKitIcon = /* @__PURE__ */ ((UiKitIcon2) => {
339
+ UiKitIcon2["Close"] = "close";
340
+ UiKitIcon2["AppLogo"] = "app-logo";
341
+ UiKitIcon2["AppLogoText"] = "app-logo-text";
342
+ return UiKitIcon2;
343
+ })(UiKitIcon || {});
289
344
  var buttonVariants = classVarianceAuthority.cva(
290
345
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
291
346
  {
292
347
  variants: {
293
348
  variant: {
294
- [uikitContracts.ButtonVariant.Default]: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
295
- [uikitContracts.ButtonVariant.Destructive]: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
296
- [uikitContracts.ButtonVariant.Outline]: "border border-input bg-background shadow-sm hover:bg-accent data-[state=open]:bg-accent",
297
- [uikitContracts.ButtonVariant.Secondary]: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
298
- [uikitContracts.ButtonVariant.Ghost]: "hover:bg-accent data-[state=open]:bg-accent",
299
- [uikitContracts.ButtonVariant.Link]: "text-primary underline-offset-4 hover:underline"
349
+ ["default" /* Default */]: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
350
+ ["destructive" /* Destructive */]: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
351
+ ["outline" /* Outline */]: "border border-input bg-background shadow-sm hover:bg-accent data-[state=open]:bg-accent",
352
+ ["secondary" /* Secondary */]: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
353
+ ["ghost" /* Ghost */]: "hover:bg-accent data-[state=open]:bg-accent",
354
+ ["link" /* Link */]: "text-primary underline-offset-4 hover:underline"
300
355
  },
301
356
  size: {
302
- [uikitContracts.ButtonSize.Default]: "h-9 px-4 py-2",
303
- [uikitContracts.ButtonSize.Sm]: "h-8 rounded-md px-3 text-xs",
304
- [uikitContracts.ButtonSize.Lg]: "h-10 rounded-md px-8",
305
- [uikitContracts.ButtonSize.Icon]: "h-9 w-9"
357
+ ["default" /* Default */]: "h-9 px-4 py-2",
358
+ ["sm" /* Sm */]: "h-8 rounded-md px-3 text-xs",
359
+ ["lg" /* Lg */]: "h-10 rounded-md px-8",
360
+ ["icon" /* Icon */]: "h-9 w-9"
306
361
  }
307
362
  },
308
363
  defaultVariants: {
309
- variant: uikitContracts.ButtonVariant.Default,
310
- size: uikitContracts.ButtonSize.Default
364
+ variant: "default" /* Default */,
365
+ size: "default" /* Default */
311
366
  }
312
367
  }
313
368
  );
@@ -501,7 +556,7 @@ function Calendar({
501
556
  classNames,
502
557
  showOutsideDays = true,
503
558
  captionLayout = "label",
504
- buttonVariant = uikitContracts.ButtonVariant.Ghost,
559
+ buttonVariant = "ghost" /* Ghost */,
505
560
  formatters,
506
561
  components,
507
562
  ...props
@@ -651,8 +706,8 @@ function CalendarDayButton({
651
706
  Button,
652
707
  {
653
708
  ref,
654
- variant: uikitContracts.ButtonVariant.Ghost,
655
- size: uikitContracts.ButtonSize.Icon,
709
+ variant: "ghost" /* Ghost */,
710
+ size: "icon" /* Icon */,
656
711
  "data-day": day.date.toLocaleDateString(),
657
712
  "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
658
713
  "data-range-start": modifiers.range_start,
@@ -1578,8 +1633,8 @@ function DataTablePagination({
1578
1633
  /* @__PURE__ */ jsxRuntime.jsxs(
1579
1634
  Button,
1580
1635
  {
1581
- variant: uikitContracts.ButtonVariant.Outline,
1582
- size: uikitContracts.ButtonSize.Icon,
1636
+ variant: "outline" /* Outline */,
1637
+ size: "icon" /* Icon */,
1583
1638
  className: "hidden size-8 lg:flex",
1584
1639
  onClick: () => table.setPageIndex(0),
1585
1640
  disabled: !table.getCanPreviousPage(),
@@ -1592,8 +1647,8 @@ function DataTablePagination({
1592
1647
  /* @__PURE__ */ jsxRuntime.jsxs(
1593
1648
  Button,
1594
1649
  {
1595
- variant: uikitContracts.ButtonVariant.Outline,
1596
- size: uikitContracts.ButtonSize.Icon,
1650
+ variant: "outline" /* Outline */,
1651
+ size: "icon" /* Icon */,
1597
1652
  className: "size-8",
1598
1653
  onClick: () => table.previousPage(),
1599
1654
  disabled: !table.getCanPreviousPage(),
@@ -1606,8 +1661,8 @@ function DataTablePagination({
1606
1661
  /* @__PURE__ */ jsxRuntime.jsxs(
1607
1662
  Button,
1608
1663
  {
1609
- variant: uikitContracts.ButtonVariant.Outline,
1610
- size: uikitContracts.ButtonSize.Icon,
1664
+ variant: "outline" /* Outline */,
1665
+ size: "icon" /* Icon */,
1611
1666
  className: "size-8",
1612
1667
  onClick: () => table.nextPage(),
1613
1668
  disabled: !table.getCanNextPage(),
@@ -1620,8 +1675,8 @@ function DataTablePagination({
1620
1675
  /* @__PURE__ */ jsxRuntime.jsxs(
1621
1676
  Button,
1622
1677
  {
1623
- variant: uikitContracts.ButtonVariant.Outline,
1624
- size: uikitContracts.ButtonSize.Icon,
1678
+ variant: "outline" /* Outline */,
1679
+ size: "icon" /* Icon */,
1625
1680
  className: "hidden size-8 lg:flex",
1626
1681
  onClick: () => table.setPageIndex(table.getPageCount() - 1),
1627
1682
  disabled: !table.getCanNextPage(),
@@ -1854,8 +1909,8 @@ function DataTableColumnHeader({
1854
1909
  /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
1855
1910
  Button,
1856
1911
  {
1857
- variant: uikitContracts.ButtonVariant.Ghost,
1858
- size: uikitContracts.ButtonSize.Sm,
1912
+ variant: "ghost" /* Ghost */,
1913
+ size: "sm" /* Sm */,
1859
1914
  className: "data-[state=open]:bg-accent -ml-3 h-8",
1860
1915
  children: [
1861
1916
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: title }),
@@ -1889,8 +1944,8 @@ function DataTableViewOptions({
1889
1944
  /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
1890
1945
  Button,
1891
1946
  {
1892
- variant: uikitContracts.ButtonVariant.Outline,
1893
- size: uikitContracts.ButtonSize.Sm,
1947
+ variant: "outline" /* Outline */,
1948
+ size: "sm" /* Sm */,
1894
1949
  className: "ml-auto hidden h-8 lg:flex",
1895
1950
  children: [
1896
1951
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings2, { className: "size-4" }),
@@ -2669,7 +2724,7 @@ function PaginationItem({ ...props }) {
2669
2724
  function PaginationLink({
2670
2725
  className,
2671
2726
  isActive,
2672
- size = uikitContracts.ButtonSize.Icon,
2727
+ size = "icon" /* Icon */,
2673
2728
  asChild,
2674
2729
  ...props
2675
2730
  }) {
@@ -2682,7 +2737,7 @@ function PaginationLink({
2682
2737
  "data-active": isActive,
2683
2738
  className: cn(
2684
2739
  buttonVariants({
2685
- variant: isActive ? uikitContracts.ButtonVariant.Outline : uikitContracts.ButtonVariant.Ghost,
2740
+ variant: isActive ? "outline" /* Outline */ : "ghost" /* Ghost */,
2686
2741
  size
2687
2742
  }),
2688
2743
  className
@@ -2700,7 +2755,7 @@ function PaginationPrevious({
2700
2755
  PaginationLink,
2701
2756
  {
2702
2757
  "aria-label": "Go to previous page",
2703
- size: uikitContracts.ButtonSize.Default,
2758
+ size: "default" /* Default */,
2704
2759
  className: cn("gap-1 px-2.5 sm:pl-2.5", className),
2705
2760
  ...props,
2706
2761
  children: [
@@ -2719,7 +2774,7 @@ function PaginationNext({
2719
2774
  PaginationLink,
2720
2775
  {
2721
2776
  "aria-label": "Go to next page",
2722
- size: uikitContracts.ButtonSize.Default,
2777
+ size: "default" /* Default */,
2723
2778
  className: cn("gap-1 px-2.5 sm:pr-2.5", className),
2724
2779
  ...props,
2725
2780
  children: [
@@ -3095,7 +3150,7 @@ var AlertDialogCancel = React26__namespace.forwardRef(({ className, ...props },
3095
3150
  AlertDialogPrimitive__namespace.Cancel,
3096
3151
  {
3097
3152
  ref,
3098
- className: cn(buttonVariants({ variant: uikitContracts.ButtonVariant.Outline }), className),
3153
+ className: cn(buttonVariants({ variant: "outline" /* Outline */ }), className),
3099
3154
  ...props
3100
3155
  }
3101
3156
  ));
@@ -3639,7 +3694,7 @@ var CarouselItem = React26__namespace.forwardRef(({ className, ...props }, ref)
3639
3694
  );
3640
3695
  });
3641
3696
  CarouselItem.displayName = "CarouselItem";
3642
- var CarouselPrevious = React26__namespace.forwardRef(({ className, variant = uikitContracts.ButtonVariant.Outline, size = uikitContracts.ButtonSize.Icon, ...props }, ref) => {
3697
+ var CarouselPrevious = React26__namespace.forwardRef(({ className, variant = "outline" /* Outline */, size = "icon" /* Icon */, ...props }, ref) => {
3643
3698
  const { orientation, scrollPrev, canScrollPrev } = useCarousel();
3644
3699
  return /* @__PURE__ */ jsxRuntime.jsxs(
3645
3700
  Button,
@@ -3664,7 +3719,7 @@ var CarouselPrevious = React26__namespace.forwardRef(({ className, variant = uik
3664
3719
  );
3665
3720
  });
3666
3721
  CarouselPrevious.displayName = "CarouselPrevious";
3667
- var CarouselNext = React26__namespace.forwardRef(({ className, variant = uikitContracts.ButtonVariant.Outline, size = uikitContracts.ButtonSize.Icon, ...props }, ref) => {
3722
+ var CarouselNext = React26__namespace.forwardRef(({ className, variant = "outline" /* Outline */, size = "icon" /* Icon */, ...props }, ref) => {
3668
3723
  const { orientation, scrollNext, canScrollNext } = useCarousel();
3669
3724
  return /* @__PURE__ */ jsxRuntime.jsxs(
3670
3725
  Button,
@@ -4423,18 +4478,18 @@ function TypographyMuted({
4423
4478
  );
4424
4479
  }
4425
4480
  var IconButton = React26__namespace.default.forwardRef(
4426
- ({ variant = uikitContracts.ButtonVariant.Ghost, size = uikitContracts.IconButtonSize.Default, className, ...props }, ref) => {
4481
+ ({ variant = "ghost" /* Ghost */, size = "default" /* Default */, className, ...props }, ref) => {
4427
4482
  const sizeStyles = {
4428
- [uikitContracts.IconButtonSize.Small]: "h-8 w-8",
4429
- [uikitContracts.IconButtonSize.Default]: "h-9 w-9",
4430
- [uikitContracts.IconButtonSize.Large]: "h-10 w-10"
4483
+ ["sm" /* Small */]: "h-8 w-8",
4484
+ ["default" /* Default */]: "h-9 w-9",
4485
+ ["lg" /* Large */]: "h-10 w-10"
4431
4486
  };
4432
4487
  return /* @__PURE__ */ jsxRuntime.jsx(
4433
4488
  Button,
4434
4489
  {
4435
4490
  ref,
4436
4491
  variant,
4437
- size: uikitContracts.ButtonSize.Icon,
4492
+ size: "icon" /* Icon */,
4438
4493
  className: cn(sizeStyles[size], className),
4439
4494
  ...props
4440
4495
  }
@@ -4442,7 +4497,7 @@ var IconButton = React26__namespace.default.forwardRef(
4442
4497
  }
4443
4498
  );
4444
4499
  IconButton.displayName = "IconButton";
4445
- var DropdownButton = React26__namespace.default.forwardRef(({ children, variant = uikitContracts.ButtonVariant.Outline, className, ...props }, ref) => {
4500
+ var DropdownButton = React26__namespace.default.forwardRef(({ children, variant = "outline" /* Outline */, className, ...props }, ref) => {
4446
4501
  return /* @__PURE__ */ jsxRuntime.jsxs(
4447
4502
  Button,
4448
4503
  {
@@ -4532,7 +4587,7 @@ var inputGroupButtonVariants = classVarianceAuthority.cva(
4532
4587
  }
4533
4588
  }
4534
4589
  );
4535
- var InputGroupButton = React26__namespace.forwardRef(({ className, type = "button", variant = uikitContracts.ButtonVariant.Ghost, size = "xs", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4590
+ var InputGroupButton = React26__namespace.forwardRef(({ className, type = "button", variant = "ghost" /* Ghost */, size = "xs", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4536
4591
  Button,
4537
4592
  {
4538
4593
  ref,
@@ -4667,7 +4722,7 @@ function DatePickerTrigger({
4667
4722
  return /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
4668
4723
  Button,
4669
4724
  {
4670
- variant: uikitContracts.ButtonVariant.Outline,
4725
+ variant: "outline" /* Outline */,
4671
4726
  "data-slot": "date-picker-trigger",
4672
4727
  "data-empty": !date,
4673
4728
  className: cn(
@@ -4761,7 +4816,7 @@ function DatePickerInput({
4761
4816
  /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
4762
4817
  Button,
4763
4818
  {
4764
- variant: uikitContracts.ButtonVariant.Ghost,
4819
+ variant: "ghost" /* Ghost */,
4765
4820
  className: "absolute top-1/2 right-2 size-6 -translate-y-1/2 p-0",
4766
4821
  "aria-label": "Select date",
4767
4822
  children: /* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, { className: "size-3.5" })
@@ -5099,8 +5154,8 @@ var ChatInput = ({
5099
5154
  onAttachFile && /* @__PURE__ */ jsxRuntime.jsx(
5100
5155
  Button,
5101
5156
  {
5102
- variant: uikitContracts.ButtonVariant.Ghost,
5103
- size: uikitContracts.ButtonSize.Icon,
5157
+ variant: "ghost" /* Ghost */,
5158
+ size: "icon" /* Icon */,
5104
5159
  onClick: onAttachFile,
5105
5160
  disabled,
5106
5161
  className: "flex-shrink-0",
@@ -5159,8 +5214,8 @@ var ThreadList = ({
5159
5214
  /* @__PURE__ */ jsxRuntime.jsx(
5160
5215
  Button,
5161
5216
  {
5162
- variant: uikitContracts.ButtonVariant.Ghost,
5163
- size: uikitContracts.ButtonSize.Icon,
5217
+ variant: "ghost" /* Ghost */,
5218
+ size: "icon" /* Icon */,
5164
5219
  onClick: onNewThread,
5165
5220
  "aria-label": "New chat",
5166
5221
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { size: 16 })
@@ -5345,18 +5400,6 @@ var applyTheme = (theme, themeName) => {
5345
5400
  }
5346
5401
  };
5347
5402
 
5348
- Object.defineProperty(exports, "ButtonSize", {
5349
- enumerable: true,
5350
- get: function () { return uikitContracts.ButtonSize; }
5351
- });
5352
- Object.defineProperty(exports, "ButtonVariant", {
5353
- enumerable: true,
5354
- get: function () { return uikitContracts.ButtonVariant; }
5355
- });
5356
- Object.defineProperty(exports, "IconButtonSize", {
5357
- enumerable: true,
5358
- get: function () { return uikitContracts.IconButtonSize; }
5359
- });
5360
5403
  Object.defineProperty(exports, "flexRender", {
5361
5404
  enumerable: true,
5362
5405
  get: function () { return reactTable.flexRender; }
@@ -5595,6 +5638,8 @@ exports.Button = Button;
5595
5638
  exports.ButtonGroup = ButtonGroup;
5596
5639
  exports.ButtonGroupSeparator = ButtonGroupSeparator;
5597
5640
  exports.ButtonGroupText = ButtonGroupText;
5641
+ exports.ButtonSize = ButtonSize;
5642
+ exports.ButtonVariant = ButtonVariant;
5598
5643
  exports.CLOSE_ICON_ID = CLOSE_ICON_ID;
5599
5644
  exports.Calendar = Calendar;
5600
5645
  exports.CalendarDayButton = CalendarDayButton;
@@ -5719,6 +5764,7 @@ exports.HoverCard = HoverCard;
5719
5764
  exports.HoverCardContent = HoverCardContent;
5720
5765
  exports.HoverCardTrigger = HoverCardTrigger;
5721
5766
  exports.IconButton = IconButton;
5767
+ exports.IconButtonSize = IconButtonSize;
5722
5768
  exports.Input = Input;
5723
5769
  exports.InputGroup = InputGroup;
5724
5770
  exports.InputGroupAddon = InputGroupAddon;
@@ -5862,6 +5908,8 @@ exports.TypographyList = TypographyList;
5862
5908
  exports.TypographyMuted = TypographyMuted;
5863
5909
  exports.TypographyP = TypographyP;
5864
5910
  exports.TypographySmall = TypographySmall;
5911
+ exports.UiKitComponent = UiKitComponent;
5912
+ exports.UiKitIcon = UiKitIcon;
5865
5913
  exports.UserInfo = UserInfo;
5866
5914
  exports.alertVariants = alertVariants;
5867
5915
  exports.applyTheme = applyTheme;