@syscore/ui-library 1.1.13 → 1.2.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 (59) hide show
  1. package/client/components/ui/accordion.tsx +6 -9
  2. package/client/components/ui/alert-dialog.tsx +6 -19
  3. package/client/components/ui/alert.tsx +5 -6
  4. package/client/components/ui/avatar.tsx +3 -9
  5. package/client/components/ui/badge.tsx +5 -8
  6. package/client/components/ui/breadcrumb.tsx +7 -16
  7. package/client/components/ui/button.tsx +17 -45
  8. package/client/components/ui/calendar.tsx +24 -28
  9. package/client/components/ui/card.tsx +6 -9
  10. package/client/components/ui/carousel.tsx +14 -14
  11. package/client/components/ui/chart.tsx +25 -28
  12. package/client/components/ui/checkbox.tsx +3 -8
  13. package/client/components/ui/code-badge.tsx +1 -4
  14. package/client/components/ui/command.tsx +12 -48
  15. package/client/components/ui/context-menu.tsx +17 -32
  16. package/client/components/ui/dialog.tsx +9 -18
  17. package/client/components/ui/drawer.tsx +7 -13
  18. package/client/components/ui/dropdown-menu.tsx +17 -29
  19. package/client/components/ui/form.tsx +4 -4
  20. package/client/components/ui/hover-card.tsx +1 -4
  21. package/client/components/ui/input-otp.tsx +7 -10
  22. package/client/components/ui/input.tsx +4 -23
  23. package/client/components/ui/label.tsx +1 -3
  24. package/client/components/ui/menubar.tsx +19 -40
  25. package/client/components/ui/navigation-menu.tsx +10 -27
  26. package/client/components/ui/navigation.tsx +193 -331
  27. package/client/components/ui/pagination.tsx +8 -8
  28. package/client/components/ui/popover.tsx +1 -4
  29. package/client/components/ui/progress.tsx +2 -5
  30. package/client/components/ui/radio-group.tsx +4 -7
  31. package/client/components/ui/resizable.tsx +4 -10
  32. package/client/components/ui/scroll-area.tsx +5 -8
  33. package/client/components/ui/search.tsx +7 -10
  34. package/client/components/ui/select.tsx +11 -36
  35. package/client/components/ui/separator.tsx +2 -2
  36. package/client/components/ui/sheet.tsx +12 -23
  37. package/client/components/ui/sidebar.tsx +55 -82
  38. package/client/components/ui/skeleton.tsx +1 -1
  39. package/client/components/ui/slider.tsx +4 -7
  40. package/client/components/ui/sonner.tsx +5 -8
  41. package/client/components/ui/switch.tsx +2 -9
  42. package/client/components/ui/table.tsx +9 -18
  43. package/client/components/ui/tabs.tsx +19 -28
  44. package/client/components/ui/tag.tsx +6 -66
  45. package/client/components/ui/textarea.tsx +1 -4
  46. package/client/components/ui/toast.tsx +9 -19
  47. package/client/components/ui/toaster.tsx +1 -1
  48. package/client/components/ui/toggle-group.tsx +4 -4
  49. package/client/components/ui/toggle.tsx +13 -13
  50. package/client/components/ui/tooltip.tsx +12 -15
  51. package/client/global.css +5419 -1054
  52. package/client/storybook.css +1164 -0
  53. package/dist/ui/index.cjs.js +1 -1
  54. package/dist/ui/index.d.ts +0 -1
  55. package/dist/ui/index.es.js +976 -1926
  56. package/dist/ui/ui-library.css +1 -0
  57. package/package.json +2 -2
  58. package/client/ui/WELLDashboard/WELLDashboard.stories.tsx +0 -115
  59. package/client/ui/WELLDashboard/index.tsx +0 -317
@@ -12,58 +12,11 @@ export interface TagProps
12
12
  onClick?: () => void;
13
13
  }
14
14
 
15
- const getStatusColors = (
15
+ const getStatusClass = (
16
16
  status: TagStatus,
17
17
  variant: "light" | "dark" = "light"
18
18
  ) => {
19
- const colors = {
20
- light: {
21
- todo: {
22
- bg: "bg-gray-100",
23
- text: "text-gray-600",
24
- },
25
- low: {
26
- bg: "bg-cyan-100",
27
- text: "text-cyan-600",
28
- },
29
- medium: {
30
- bg: "bg-plum-100",
31
- text: "text-plum-600",
32
- },
33
- high: {
34
- bg: "bg-coral-100",
35
- text: "text-coral-600",
36
- },
37
- done: {
38
- bg: "bg-emerald-100",
39
- text: "text-emerald-600",
40
- },
41
- },
42
- dark: {
43
- todo: {
44
- bg: "bg-gray-600",
45
- text: "text-gray-100",
46
- },
47
- low: {
48
- bg: "bg-cyan-700",
49
- text: "text-cyan-100",
50
- },
51
- medium: {
52
- bg: "bg-plum-700",
53
- text: "text-plum-100",
54
- },
55
- high: {
56
- bg: "bg-coral-700",
57
- text: "text-coral-100",
58
- },
59
- done: {
60
- bg: "bg-emerald-700",
61
- text: "text-emerald-100",
62
- },
63
- },
64
- };
65
-
66
- return colors[variant][status];
19
+ return `tag tag--${variant}-${status}`;
67
20
  };
68
21
 
69
22
  export const Tag = React.forwardRef<HTMLButtonElement, TagProps>(
@@ -81,19 +34,12 @@ export const Tag = React.forwardRef<HTMLButtonElement, TagProps>(
81
34
  ) => {
82
35
  // Status tag styling
83
36
  if (status) {
84
- const statusColors = getStatusColors(status, variant);
37
+ const statusClass = getStatusClass(status, variant);
85
38
  return (
86
39
  <button
87
40
  ref={ref}
88
41
  onClick={onClick}
89
- className={cn(
90
- "inline-flex items-center p-[8px] rounded-sm w-fit",
91
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
92
- "disabled:opacity-50 disabled:cursor-not-allowed",
93
- statusColors.bg,
94
- statusColors.text,
95
- className
96
- )}
42
+ className={cn(statusClass, className)}
97
43
  {...props}
98
44
  >
99
45
  <span className="overline-medium">{children}</span>
@@ -107,14 +53,8 @@ export const Tag = React.forwardRef<HTMLButtonElement, TagProps>(
107
53
  ref={ref}
108
54
  onClick={onClick}
109
55
  className={cn(
110
- "inline-flex items-center h-[32px] px-[12px] py-0 rounded-sm w-fit cursor-pointer",
111
-
112
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
113
- "disabled:opacity-50 disabled:cursor-not-allowed",
114
- "transition-all duration-200",
115
- active
116
- ? "bg-cyan-700 text-white hover:border-cyan-700"
117
- : "bg-blue-100 text-blue-700 hover:bg-cyan-700 hover:text-white",
56
+ "tag-general",
57
+ active ? "tag-general--active" : "tag-general--inactive",
118
58
  className
119
59
  )}
120
60
  {...props}
@@ -9,10 +9,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
9
9
  ({ className, ...props }, ref) => {
10
10
  return (
11
11
  <textarea
12
- className={cn(
13
- "flex min-h-[80px] w-full rounded-[6px] border border-gray-200 bg-white p-4 body-base font-medium text-gray-800 placeholder:font-normal placeholder:text-gray-500 focus:border-cyan-300 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:border-blue-200 disabled:bg-transparent ring-0",
14
- className,
15
- )}
12
+ className={cn("textarea body-base", className)}
16
13
  ref={ref}
17
14
  {...props}
18
15
  />
@@ -13,23 +13,19 @@ const ToastViewport = React.forwardRef<
13
13
  >(({ className, ...props }, ref) => (
14
14
  <ToastPrimitives.Viewport
15
15
  ref={ref}
16
- className={cn(
17
- "fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
18
- className,
19
- )}
16
+ className={cn("toast-viewport", className)}
20
17
  {...props}
21
18
  />
22
19
  ));
23
20
  ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
24
21
 
25
22
  const toastVariants = cva(
26
- "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",
23
+ "toast",
27
24
  {
28
25
  variants: {
29
26
  variant: {
30
- default: "border bg-background text-foreground",
31
- destructive:
32
- "destructive group border-destructive bg-destructive text-destructive-foreground",
27
+ default: "toast--default",
28
+ destructive: "toast--destructive",
33
29
  },
34
30
  },
35
31
  defaultVariants: {
@@ -59,10 +55,7 @@ const ToastAction = React.forwardRef<
59
55
  >(({ className, ...props }, ref) => (
60
56
  <ToastPrimitives.Action
61
57
  ref={ref}
62
- className={cn(
63
- "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:group-[.destructive]:ring-destructive",
64
- className,
65
- )}
58
+ className={cn("toast-action", className)}
66
59
  {...props}
67
60
  />
68
61
  ));
@@ -74,14 +67,11 @@ const ToastClose = React.forwardRef<
74
67
  >(({ className, ...props }, ref) => (
75
68
  <ToastPrimitives.Close
76
69
  ref={ref}
77
- className={cn(
78
- "absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-50 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600",
79
- className,
80
- )}
70
+ className={cn("toast-close", className)}
81
71
  toast-close=""
82
72
  {...props}
83
73
  >
84
- <X className="h-4 w-4" />
74
+ <X className="icon-4" />
85
75
  </ToastPrimitives.Close>
86
76
  ));
87
77
  ToastClose.displayName = ToastPrimitives.Close.displayName;
@@ -92,7 +82,7 @@ const ToastTitle = React.forwardRef<
92
82
  >(({ className, ...props }, ref) => (
93
83
  <ToastPrimitives.Title
94
84
  ref={ref}
95
- className={cn("text-sm font-semibold", className)}
85
+ className={cn("toast-title", className)}
96
86
  {...props}
97
87
  />
98
88
  ));
@@ -104,7 +94,7 @@ const ToastDescription = React.forwardRef<
104
94
  >(({ className, ...props }, ref) => (
105
95
  <ToastPrimitives.Description
106
96
  ref={ref}
107
- className={cn("text-sm opacity-90", className)}
97
+ className={cn("toast-description", className)}
108
98
  {...props}
109
99
  />
110
100
  ));
@@ -16,7 +16,7 @@ export function Toaster() {
16
16
  {toasts.map(function ({ id, title, description, action, ...props }) {
17
17
  return (
18
18
  <Toast key={id} {...props}>
19
- <div className="grid gap-1">
19
+ <div className="toast-content">
20
20
  {title && <ToastTitle>{title}</ToastTitle>}
21
21
  {description && (
22
22
  <ToastDescription>{description}</ToastDescription>
@@ -5,14 +5,14 @@ import { cva, type VariantProps } from "class-variance-authority";
5
5
  import { cn } from "@/lib/utils";
6
6
 
7
7
  const toggleVariants = cva(
8
- "inline-flex items-center justify-center rounded-full transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-pointer",
8
+ "toggle-group-item",
9
9
  {
10
10
  variants: {
11
11
  variant: {
12
- default: "bg-gray-100 text-gray-600 hover:bg-gray-200",
12
+ default: "toggle-group-item--default",
13
13
  },
14
14
  size: {
15
- default: "h-8 px-4",
15
+ default: "toggle-group-item--size-default",
16
16
  },
17
17
  },
18
18
  defaultVariants: {
@@ -36,7 +36,7 @@ const ToggleGroup = React.forwardRef<
36
36
  >(({ className, variant, size, children, ...props }, ref) => (
37
37
  <ToggleGroupPrimitive.Root
38
38
  ref={ref}
39
- className={cn("flex items-center justify-center gap-1", className)}
39
+ className={cn("toggle-group", className)}
40
40
  {...props}
41
41
  >
42
42
  <ToggleGroupContext.Provider value={{ variant, size }}>
@@ -4,18 +4,17 @@ import { cn } from "../../lib/utils";
4
4
  import { useSegmentedControl } from "../../hooks/use-segmented-control";
5
5
 
6
6
  const toggleVariants = cva(
7
- "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
7
+ "toggle",
8
8
  {
9
9
  variants: {
10
10
  variant: {
11
- default: "bg-transparent",
12
- outline:
13
- "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
11
+ default: "toggle--default",
12
+ outline: "toggle--outline",
14
13
  },
15
14
  size: {
16
- default: "h-10 px-3",
17
- sm: "h-9 px-2.5",
18
- lg: "h-11 px-5",
15
+ default: "toggle--size-default",
16
+ sm: "toggle--size-sm",
17
+ lg: "toggle--size-lg",
19
18
  },
20
19
  },
21
20
  defaultVariants: {
@@ -50,22 +49,23 @@ const SegmentedControlInner = React.forwardRef<
50
49
  });
51
50
 
52
51
  return (
53
- <div ref={ref} className={cn("inline-flex", className)} {...props}>
52
+ <div ref={ref} className={cn("segmented-control", className)} {...props}>
54
53
  {options.map((option) => {
55
54
  const isReactElement = React.isValidElement(option.label);
55
+ const isActive = selectedValue === option.value;
56
56
 
57
57
  return (
58
58
  <button
59
59
  key={option.value}
60
60
  className={cn(
61
- "inline-flex items-center justify-center h-8 px-4 rounded-full transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-pointer",
62
- selectedValue === option.value
63
- ? "bg-cyan-700 text-white font-semibold"
64
- : "text-gray-600 hover:bg-gray-50 font-medium",
61
+ "segmented-control-button",
62
+ isActive
63
+ ? "segmented-control-button--active"
64
+ : "segmented-control-button--inactive",
65
65
  )}
66
66
  onClick={() => handleValueChange(option.value)}
67
67
  type="button"
68
- data-active={selectedValue === option.value}
68
+ data-active={isActive}
69
69
  >
70
70
  {isReactElement ? (
71
71
  option.label
@@ -15,8 +15,8 @@ const TooltipContext = React.createContext<{
15
15
  triggerRef: React.RefObject<HTMLButtonElement | null>;
16
16
  }>({
17
17
  trigger: "hover",
18
- toggle: () => { },
19
- close: () => { },
18
+ toggle: () => {},
19
+ close: () => {},
20
20
  triggerRef: { current: null },
21
21
  });
22
22
 
@@ -74,7 +74,7 @@ function Tooltip({
74
74
  }
75
75
  onOpenChange?.(newOpen);
76
76
  },
77
- [isControlled, onOpenChange, trigger]
77
+ [isControlled, onOpenChange, trigger],
78
78
  );
79
79
 
80
80
  const close = React.useCallback(() => {
@@ -96,13 +96,13 @@ function Tooltip({
96
96
  const tooltipProps =
97
97
  trigger === "click"
98
98
  ? {
99
- open: isOpen,
100
- onOpenChange: handleOpenChange,
101
- }
99
+ open: isOpen,
100
+ onOpenChange: handleOpenChange,
101
+ }
102
102
  : {
103
- open: isControlled ? controlledOpen : undefined,
104
- onOpenChange,
105
- };
103
+ open: isControlled ? controlledOpen : undefined,
104
+ onOpenChange,
105
+ };
106
106
 
107
107
  return (
108
108
  <TooltipContext.Provider value={{ trigger, toggle, close, triggerRef }}>
@@ -130,7 +130,7 @@ function TooltipTrigger({
130
130
  }
131
131
  onClick?.(e);
132
132
  },
133
- [trigger, toggle, onClick]
133
+ [trigger, toggle, onClick],
134
134
  );
135
135
 
136
136
  return (
@@ -189,14 +189,11 @@ function TooltipContent({
189
189
  sideOffset={sideOffset}
190
190
  alignOffset={alignOffset}
191
191
  side={side}
192
- className={cn(
193
- "group relative bg-gray-700 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-lg p-6 pt-8 shadow-sm mt-3",
194
- className
195
- )}
192
+ className={cn("tooltip-content", className)}
196
193
  {...props}
197
194
  >
198
195
  {/* Marker/Arrow */}
199
- <div className="absolute left-1/2 -translate-x-1/2 flex justify-center group-data-[side=top]:bottom-0 group-data-[side=top]:rotate-180 group-data-[side=bottom]:top-0 group-data-[side=left]:right-0 group-data-[side=right]:left-0 ">
196
+ <div className="tooltip-arrow" data-side={side}>
200
197
  <svg
201
198
  xmlns="http://www.w3.org/2000/svg"
202
199
  width="10"