@catalystsoftware/ui 1.0.5 → 1.0.7

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 (155) hide show
  1. package/dist/data/data.tsx +29 -29
  2. package/dist/data/tailwind.config.js +3821 -261
  3. package/dist/data.tsx +29 -29
  4. package/package.json +4 -3
  5. package/components/catalyst-ui/buttons/burger.tsx +0 -207
  6. package/components/catalyst-ui/core/data-display/timeline.tsx +0 -210
  7. package/components/catalyst-ui/core/feedback/alert.tsx +0 -491
  8. package/components/catalyst-ui/core/feedback/spinner-1.tsx +0 -65
  9. package/components/catalyst-ui/core/feedback/toast.tsx +0 -1857
  10. package/components/catalyst-ui/core/navigation/menu.tsx +0 -164
  11. package/components/catalyst-ui/forms/toggle-class.tsx +0 -176
  12. package/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +0 -419
  13. package/components/catalyst-ui/hooks/use-counter.tsx +0 -13
  14. package/components/catalyst-ui/hooks/use-event-listener.tsx +0 -23
  15. package/components/catalyst-ui/hooks/use-export-markdown.tsx +0 -47
  16. package/components/catalyst-ui/hooks/use-focus.tsx +0 -17
  17. package/components/catalyst-ui/hooks/use-interval.tsx +0 -23
  18. package/components/catalyst-ui/hooks/use-is-client.tsx +0 -16
  19. package/components/catalyst-ui/hooks/use-media-query.tsx +0 -19
  20. package/components/catalyst-ui/hooks/use-mobile.tsx +0 -19
  21. package/components/catalyst-ui/hooks/use-resize-observer.tsx +0 -81
  22. package/components/catalyst-ui/hooks/use-timeout.tsx +0 -21
  23. package/components/catalyst-ui/hooks/use-timer.tsx +0 -209
  24. package/components/catalyst-ui/hooks/use-toggle.tsx +0 -12
  25. package/components/catalyst-ui/media/image.tsx +0 -13
  26. package/components/catalyst-ui/overlays/dual-sidebar.tsx +0 -4142
  27. package/components/catalyst-ui/overlays/sidebar-original.tsx +0 -726
  28. package/components/catalyst-ui/primitives/accordion.tsx +0 -250
  29. package/components/catalyst-ui/primitives/alert-dialog.tsx +0 -126
  30. package/components/catalyst-ui/primitives/aspect-ratio.tsx +0 -9
  31. package/components/catalyst-ui/primitives/avatar.tsx +0 -296
  32. package/components/catalyst-ui/primitives/badge.tsx +0 -57
  33. package/components/catalyst-ui/primitives/breadcrumb.tsx +0 -101
  34. package/components/catalyst-ui/primitives/button.tsx +0 -265
  35. package/components/catalyst-ui/primitives/calendar-v4.tsx +0 -208
  36. package/components/catalyst-ui/primitives/calendar.tsx +0 -295
  37. package/components/catalyst-ui/primitives/card.tsx +0 -618
  38. package/components/catalyst-ui/primitives/carousel.tsx +0 -238
  39. package/components/catalyst-ui/primitives/chart.tsx +0 -347
  40. package/components/catalyst-ui/primitives/checkbox.tsx +0 -225
  41. package/components/catalyst-ui/primitives/collapsible.tsx +0 -212
  42. package/components/catalyst-ui/primitives/command.tsx +0 -393
  43. package/components/catalyst-ui/primitives/context-menu.tsx +0 -236
  44. package/components/catalyst-ui/primitives/dialog.tsx +0 -471
  45. package/components/catalyst-ui/primitives/drawer.tsx +0 -761
  46. package/components/catalyst-ui/primitives/dropdown-menu.tsx +0 -290
  47. package/components/catalyst-ui/primitives/empty.tsx +0 -104
  48. package/components/catalyst-ui/primitives/field.tsx +0 -244
  49. package/components/catalyst-ui/primitives/hover-card.tsx +0 -124
  50. package/components/catalyst-ui/primitives/input-otp.tsx +0 -76
  51. package/components/catalyst-ui/primitives/input.tsx +0 -64
  52. package/components/catalyst-ui/primitives/item.tsx +0 -196
  53. package/components/catalyst-ui/primitives/kbd.tsx +0 -75
  54. package/components/catalyst-ui/primitives/label.tsx +0 -24
  55. package/components/catalyst-ui/primitives/navigation-menu.tsx +0 -150
  56. package/components/catalyst-ui/primitives/pagination.tsx +0 -198
  57. package/components/catalyst-ui/primitives/popover.tsx +0 -232
  58. package/components/catalyst-ui/primitives/progress.tsx +0 -34
  59. package/components/catalyst-ui/primitives/radio-group.tsx +0 -43
  60. package/components/catalyst-ui/primitives/resizable.tsx +0 -56
  61. package/components/catalyst-ui/primitives/select.tsx +0 -155
  62. package/components/catalyst-ui/primitives/separator.tsx +0 -74
  63. package/components/catalyst-ui/primitives/sheet.tsx +0 -126
  64. package/components/catalyst-ui/primitives/skeleton.tsx +0 -15
  65. package/components/catalyst-ui/primitives/slider.tsx +0 -27
  66. package/components/catalyst-ui/primitives/switch.tsx +0 -187
  67. package/components/catalyst-ui/primitives/tabs.tsx +0 -335
  68. package/components/catalyst-ui/primitives/textarea.tsx +0 -24
  69. package/components/catalyst-ui/primitives/toggle-group.tsx +0 -55
  70. package/components/catalyst-ui/primitives/toggle.tsx +0 -42
  71. package/components/catalyst-ui/primitives/tooltip.tsx +0 -116
  72. package/components/catalyst-ui/utils/basic-auth.tsx +0 -40
  73. package/components/catalyst-ui/utils/context-storage.tsx +0 -19
  74. package/components/catalyst-ui/utils/cors-middleware.tsx +0 -71
  75. package/components/catalyst-ui/utils/deferred-content.tsx +0 -595
  76. package/components/catalyst-ui/utils/honeypot-middleware.tsx +0 -38
  77. package/components/catalyst-ui/utils/incId.tsx +0 -75
  78. package/components/catalyst-ui/utils/jwk-auth.tsx +0 -36
  79. package/components/catalyst-ui/utils/request-id.tsx +0 -14
  80. package/components/catalyst-ui/utils/secure-headers.tsx +0 -37
  81. package/components/catalyst-ui/utils/server-timing.tsx +0 -23
  82. package/components/catalyst-ui/utils/utils.ts +0 -43
  83. package/components/catalyst-ui/utils/with-cookie.tsx +0 -43
  84. package/components/catalyst-ui/x/accordian-x.tsx +0 -428
  85. package/components/catalyst-ui/x/alert-x.tsx +0 -413
  86. package/components/catalyst-ui/x/animated-text-x.tsx +0 -2242
  87. package/components/catalyst-ui/x/avatar-x.tsx +0 -515
  88. package/components/catalyst-ui/x/badge-x.tsx +0 -670
  89. package/components/catalyst-ui/x/button-X.tsx +0 -2857
  90. package/components/catalyst-ui/x/button-group-x.tsx +0 -847
  91. package/components/catalyst-ui/x/calendar-x.tsx +0 -1910
  92. package/components/catalyst-ui/x/card-x.tsx +0 -2597
  93. package/components/catalyst-ui/x/checkbox-x.tsx +0 -656
  94. package/components/catalyst-ui/x/collapsible-x.tsx +0 -1360
  95. package/components/catalyst-ui/x/combobox-x.tsx +0 -911
  96. package/components/catalyst-ui/x/data-table-x.tsx +0 -1753
  97. package/components/catalyst-ui/x/date-picker-x.tsx +0 -648
  98. package/components/catalyst-ui/x/dialog-x.tsx +0 -659
  99. package/components/catalyst-ui/x/dropdown-menu-x.tsx +0 -612
  100. package/components/catalyst-ui/x/hover-card-x.tsx +0 -375
  101. package/components/catalyst-ui/x/icon-x.tsx +0 -840
  102. package/components/catalyst-ui/x/input-mask-x.tsx +0 -981
  103. package/components/catalyst-ui/x/input-otp-x.tsx +0 -659
  104. package/components/catalyst-ui/x/loader-x.tsx +0 -1757
  105. package/components/catalyst-ui/x/pagination-x.tsx +0 -622
  106. package/components/catalyst-ui/x/popover-x.tsx +0 -744
  107. package/components/catalyst-ui/x/radio-group-x.tsx +0 -499
  108. package/components/catalyst-ui/x/select-x.tsx +0 -1127
  109. package/components/catalyst-ui/x/sheet-x.tsx +0 -668
  110. package/components/catalyst-ui/x/switch-x.tsx +0 -681
  111. package/components/catalyst-ui/x/table-x.tsx +0 -574
  112. package/components/catalyst-ui/x/tabs-x.tsx +0 -839
  113. package/components/catalyst-ui/x/textarea-x.tsx +0 -1263
  114. package/components/catalyst-ui/x/tooltip-x.tsx +0 -396
  115. package/components/catalyst-ui/x/tracker-x.tsx +0 -560
  116. package/data/bg-data.tsx +0 -901
  117. package/data/buttons-data.tsx +0 -2327
  118. package/data/charts-data.tsx +0 -102
  119. package/data/chat-data.tsx +0 -83
  120. package/data/code-data.tsx +0 -1040
  121. package/data/comboboxes-data.tsx +0 -1843
  122. package/data/command-data.tsx +0 -1381
  123. package/data/core-data.tsx +0 -15953
  124. package/data/crm-data.tsx +0 -47
  125. package/data/data.tsx +0 -159
  126. package/data/date-and-time-data.tsx +0 -554
  127. package/data/dependencies.tsx +0 -7
  128. package/data/ecommerce-data.tsx +0 -1387
  129. package/data/forms-data.tsx +0 -7890
  130. package/data/hooks-data.tsx +0 -5487
  131. package/data/index.ts +0 -34
  132. package/data/inputs-data.tsx +0 -557
  133. package/data/interactive-data.tsx +0 -5394
  134. package/data/lofi-data.tsx +0 -18295
  135. package/data/marketing-data.tsx +0 -2546
  136. package/data/media-data.tsx +0 -1510
  137. package/data/motion-data.tsx +0 -5801
  138. package/data/overlay-data.tsx +0 -4136
  139. package/data/pdf-data.tsx +0 -124
  140. package/data/pos-data.tsx +0 -213
  141. package/data/postcss.config.js +0 -6
  142. package/data/primitive-data.tsx +0 -5170
  143. package/data/prompt-data.tsx +0 -1226
  144. package/data/requiredLibs.ts +0 -4
  145. package/data/sandbox-data.tsx +0 -1
  146. package/data/sidebars-data.tsx +0 -5421
  147. package/data/stacks-data.tsx +0 -32
  148. package/data/table-data.tsx +0 -706
  149. package/data/tailwind.config.js +0 -270
  150. package/data/tailwind.config.ngin.js +0 -3830
  151. package/data/tailwind.css +0 -431
  152. package/data/tools-data.tsx +0 -6910
  153. package/data/typography-data.tsx +0 -2050
  154. package/data/utils-data.tsx +0 -6500
  155. package/data/x-data.tsx +0 -1171
package/dist/data.tsx CHANGED
@@ -1,35 +1,35 @@
1
1
  // remove line
2
2
  // remove line
3
3
  // remove line
4
- import { combinedCore, } from "./data/core-data";
5
- import { combinedCRM, } from "./data/crm-data";
6
- import { combinedEcom, } from "./data/ecommerce-data";
7
- import { combinedTools, } from "./data/tools-data";
8
- import { hooksArray } from "./data/hooks-data";
9
- import { lofiSection } from "./data/lofi-data";
10
- import { combinedPdf } from "./data/pdf-data";
11
- import { utilsData } from "./data/utils-data";
12
- import { utilsBlocks } from "./data/utils-data";
13
- import { sidebarnavcomps, } from "./data/sidebars-data";
14
- import { buttonsData } from "./data/buttons-data";
15
- import { chartComps } from "./data/charts-data";
16
- import { codeData } from "./data/code-data";
17
- import { componentsTimeData } from "./data/date-and-time-data";
18
- import { formsData } from "./data/forms-data";
19
- import { interactiveData } from "./data/interactive-data";
20
- import { componentsMedia } from "./data/media-data";
21
- import { OverlayData } from "./data/overlay-data";
22
- import { primitiveDaata } from "./data/primitive-data";
23
- import { aiPrompt } from "./data/prompt-data";
24
- import { aiPromptBlocks } from "./data/prompt-data";
25
- import { componentsTable } from "./data/table-data";
26
- import { backgroundData } from "./data/bg-data";
27
- import { componentsTypography } from "./data/typography-data";
28
- import { combinedPos } from "./data/pos-data";
29
- import { marketingSections, marketingPages, marketingFeedback } from "./data/marketing-data";
30
- import { inputs } from "./data/inputs-data";
31
- import { xData } from "./data/x-data";
32
- import { Motions } from "./data/motion-data";
4
+ import { combinedCore, } from "@catalystsoftware/ui/data/core-data";
5
+ import { combinedCRM, } from "@catalystsoftware/ui/data/crm-data";
6
+ import { combinedEcom, } from "@catalystsoftware/ui/data/ecommerce-data";
7
+ import { combinedTools, } from "@catalystsoftware/ui/data/tools-data";
8
+ import { hooksArray } from "@catalystsoftware/ui/data/hooks-data";
9
+ import { lofiSection } from "@catalystsoftware/ui/data/lofi-data";
10
+ import { combinedPdf } from "@catalystsoftware/ui/data/pdf-data";
11
+ import { utilsData } from "@catalystsoftware/ui/data/utils-data";
12
+ import { utilsBlocks } from "@catalystsoftware/ui/data/utils-data";
13
+ import { sidebarnavcomps, } from "@catalystsoftware/ui/data/sidebars-data";
14
+ import { buttonsData } from "@catalystsoftware/ui/data/buttons-data";
15
+ import { chartComps } from "@catalystsoftware/ui/data/charts-data";
16
+ import { codeData } from "@catalystsoftware/ui/data/code-data";
17
+ import { componentsTimeData } from "@catalystsoftware/ui/data/date-and-time-data";
18
+ import { formsData } from "@catalystsoftware/ui/data/forms-data";
19
+ import { interactiveData } from "@catalystsoftware/ui/data/interactive-data";
20
+ import { componentsMedia } from "@catalystsoftware/ui/data/media-data";
21
+ import { OverlayData } from "@catalystsoftware/ui/data/overlay-data";
22
+ import { primitiveDaata } from "@catalystsoftware/ui/data/primitive-data";
23
+ import { aiPrompt } from "@catalystsoftware/ui/data/prompt-data";
24
+ import { aiPromptBlocks } from "@catalystsoftware/ui/data/prompt-data";
25
+ import { componentsTable } from "@catalystsoftware/ui/data/table-data";
26
+ import { backgroundData } from "@catalystsoftware/ui/data/bg-data";
27
+ import { componentsTypography } from "@catalystsoftware/ui/data/typography-data";
28
+ import { combinedPos } from "@catalystsoftware/ui/data/pos-data";
29
+ import { marketingSections, marketingPages, marketingFeedback } from "@catalystsoftware/ui/data/marketing-data";
30
+ import { inputs } from "@catalystsoftware/ui/data/inputs-data";
31
+ import { xData } from "@catalystsoftware/ui/data/x-data";
32
+ import { Motions } from "@catalystsoftware/ui/data/motion-data";
33
33
 
34
34
  export const combinedSections = [
35
35
  ...backgroundData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@catalystsoftware/ui",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Catalyst UI Component Library CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,8 +26,9 @@
26
26
  "license": "MIT",
27
27
  "files": [
28
28
  "dist",
29
- "data",
30
- "components",
29
+ "dist/data.tsx",
30
+ "dist/data",
31
+ "dist/components",
31
32
  "README.md"
32
33
  ],
33
34
  "dependencies": {
@@ -1,207 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { cn } from '~/components/catalyst-ui';
3
- import { Button } from '~/components/catalyst-ui'
4
- // @dev app/components/catalyst-ui/data/buttons-data.tsx:1281
5
- interface BurgerMenuProps {
6
- opened?: boolean;
7
- onToggle?: (opened: boolean) => void;
8
- size?: 'sm' | 'md' | 'lg' | 'xl';
9
- color?: string;
10
- className?: string;
11
- 'aria-label'?: string;
12
- disabled?: boolean;
13
- }
14
-
15
- export function Burger({ opened = false, size = 'md', color = 'currentColor',}: BurgerMenuProps) {
16
- const isOpened = opened
17
-
18
- const sizeClasses = {
19
- sm: 'w-4 h-4',
20
- md: 'w-6 h-6',
21
- lg: 'w-8 h-8',
22
- xl: 'w-10 h-10'
23
- };
24
-
25
- const lineHeight = {
26
- sm: '2px',
27
- md: '2px',
28
- lg: '3px',
29
- xl: '3px'
30
- };
31
-
32
- return (
33
- <div className={cn("relative", sizeClasses[size])}>
34
- <span
35
- className={cn("absolute left-0 block transition-all duration-300 ease-in-out rounded-full", "bg-current")}
36
- style={{
37
- width: '100%',
38
- height: lineHeight[size],
39
- color: color,
40
- top: isOpened ? '50%' : '20%',
41
- transform: isOpened ? 'translateY(-50%) rotate(45deg)' : 'translateY(-50%) rotate(0deg)'
42
- }}
43
- />
44
- <span
45
- className={cn(
46
- "absolute left-0 block transition-all duration-300 ease-in-out rounded-full",
47
- "bg-current"
48
- )}
49
- style={{
50
- width: '100%',
51
- height: lineHeight[size],
52
- color: color,
53
- top: '50%',
54
- opacity: isOpened ? 0 : 1,
55
- transform: 'translateY(-50%)'
56
- }}
57
- />
58
- <span
59
- className={cn(
60
- "absolute left-0 block transition-all duration-300 ease-in-out rounded-full",
61
- "bg-current"
62
- )}
63
- style={{
64
- width: '100%',
65
- height: lineHeight[size],
66
- color: color,
67
- bottom: isOpened ? '50%' : '20%',
68
- transform: isOpened ? 'translateY(50%) rotate(-45deg)' : 'translateY(50%) rotate(0deg)'
69
- }}
70
- />
71
- </div>
72
- );
73
- }
74
-
75
- export function BurgerButton({
76
- opened,
77
- onToggle,
78
- size,
79
- color,
80
- className = '',
81
- 'aria-label': ariaLabel = 'Toggle navigation',
82
- disabled = false
83
- }: BurgerMenuProps) {
84
- const [internalOpened, setInternalOpened] = useState(false);
85
-
86
- const isOpened = controlledOpened !== undefined ? controlledOpened : internalOpened;
87
-
88
- const handleToggle = () => {
89
- if (disabled) return;
90
-
91
- const newOpened = !isOpened;
92
- if (controlledOpened === undefined) {
93
- setInternalOpened(newOpened);
94
- }
95
- onToggle?.(newOpened);
96
- };
97
-
98
- const sizeClasses = {
99
- sm: 'w-4 h-4',
100
- md: 'w-6 h-6',
101
- lg: 'w-8 h-8',
102
- xl: 'w-10 h-10'
103
- };
104
-
105
-
106
- return (
107
- <Button
108
- variant="ghost"
109
- size="icon"
110
- onClick={handleToggle}
111
- disabled={disabled}
112
- aria-label={ariaLabel}
113
- className={cn(
114
- "relative p-2 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring",
115
- sizeClasses[size],
116
- className
117
- )}
118
- >
119
- <Burger
120
- opened={opened}
121
- size={size}
122
- color={color}
123
- />
124
- </Button>
125
- );
126
- }
127
-
128
- interface NavigationItem {
129
- id: string;
130
- label: string;
131
- href?: string;
132
- onClick?: () => void;
133
- }
134
-
135
- interface BurgerNavigationProps {
136
- menuItems: NavigationItem[];
137
- isOpen: boolean;
138
- onToggle: (open: boolean) => void;
139
- className?: string;
140
- }
141
-
142
- export function BurgerNavigation({
143
- menuItems,
144
- isOpen,
145
- onToggle,
146
- className = ''
147
- }: BurgerNavigationProps) {
148
- const handleItemClick = (item: NavigationItem) => {
149
- if (item.onClick) {
150
- item.onClick();
151
- } else if (item.href) {
152
- window.location.href = item.href;
153
- }
154
- onToggle(false);
155
- };
156
-
157
- return (
158
- <div className={cn("relative", className)}>
159
- <Burger
160
- opened={isOpen}
161
- onToggle={onToggle}
162
- size="lg"
163
- className="z-50"
164
- />
165
-
166
- <div
167
- className={cn(
168
- "fixed inset-0 bg-background/80 backdrop-blur-sm transition-all duration-300 z-40",
169
- isOpen ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"
170
- )}
171
- onClick={() => onToggle(false)}
172
- />
173
-
174
- <nav
175
- className={cn(
176
- "fixed top-0 right-0 h-full w-80 bg-card border-l border-border shadow-lg transition-transform duration-300 ease-in-out z-50",
177
- isOpen ? "translate-x-0" : "translate-x-full"
178
- )}
179
- >
180
- <div className="flex items-center justify-between p-6 border-b border-border">
181
- <h2 className="text-lg font-semibold text-foreground">Menu</h2>
182
- <Burger
183
- opened={isOpen}
184
- onToggle={onToggle}
185
- size="md"
186
- />
187
- </div>
188
-
189
- <div className="p-6">
190
- <ul className="space-y-2">
191
- {menuItems.map((item) => (
192
- <li key={item.id}>
193
- <button
194
- onClick={() => handleItemClick(item)}
195
- className="w-full text-left p-3 rounded-md hover:bg-accent hover:text-accent-foreground transition-colors duration-150 text-foreground font-medium"
196
- >
197
- {item.label}
198
- </button>
199
- </li>
200
- ))}
201
- </ul>
202
- </div>
203
- </nav>
204
- </div>
205
- );
206
- }
207
-
@@ -1,210 +0,0 @@
1
- "use client";
2
-
3
- import { Slot } from "radix-ui";
4
- import * as React from "react";
5
-
6
- import { cn } from "~/components/catalyst-ui";
7
-
8
- // Types
9
- type TimelineContextValue = {
10
- activeStep: number;
11
- setActiveStep: (step: number) => void;
12
- };
13
-
14
- // Context
15
- const TimelineContext = React.createContext<TimelineContextValue | undefined>(
16
- undefined,
17
- );
18
-
19
- const useTimeline = () => {
20
- const context = React.useContext(TimelineContext);
21
- if (!context) {
22
- throw new Error("useTimeline must be used within a Timeline");
23
- }
24
- return context;
25
- };
26
-
27
- // Components
28
- interface TimelineProps extends React.HTMLAttributes<HTMLDivElement> {
29
- defaultValue?: number;
30
- value?: number;
31
- onValueChange?: (value: number) => void;
32
- orientation?: "horizontal" | "vertical";
33
- }
34
-
35
- function Timeline({
36
- defaultValue = 1,
37
- value,
38
- onValueChange,
39
- orientation = "vertical",
40
- className,
41
- ...props
42
- }: TimelineProps) {
43
- const [activeStep, setInternalStep] = React.useState(defaultValue);
44
-
45
- const setActiveStep = React.useCallback(
46
- (step: number) => {
47
- if (value === undefined) {
48
- setInternalStep(step);
49
- }
50
- onValueChange?.(step);
51
- },
52
- [value, onValueChange],
53
- );
54
-
55
- const currentStep = value ?? activeStep;
56
-
57
- return (
58
- <TimelineContext.Provider
59
- value={{ activeStep: currentStep, setActiveStep }}
60
- >
61
- <div
62
- className={cn(
63
- "group/timeline flex data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row data-[orientation=vertical]:flex-col",
64
- className,
65
- )}
66
- data-orientation={orientation}
67
- data-slot="timeline"
68
- {...props}
69
- />
70
- </TimelineContext.Provider>
71
- );
72
- }
73
-
74
- // TimelineContent
75
- function TimelineContent({
76
- className,
77
- ...props
78
- }: React.HTMLAttributes<HTMLDivElement>) {
79
- return (
80
- <div
81
- className={cn("text-muted-foreground text-sm", className)}
82
- data-slot="timeline-content"
83
- {...props}
84
- />
85
- );
86
- }
87
-
88
- // TimelineDate
89
- interface TimelineDateProps extends React.HTMLAttributes<HTMLTimeElement> {
90
- asChild?: boolean;
91
- }
92
-
93
- function TimelineDate({
94
- asChild = false,
95
- className,
96
- ...props
97
- }: TimelineDateProps) {
98
- const Comp = asChild ? Slot.Root : "time";
99
-
100
- return (
101
- <Comp
102
- className={cn(
103
- "mb-1 block font-medium text-muted-foreground text-xs group-data-[orientation=vertical]/timeline:max-sm:h-4",
104
- className,
105
- )}
106
- data-slot="timeline-date"
107
- {...props}
108
- />
109
- );
110
- }
111
-
112
- // TimelineHeader
113
- function TimelineHeader({
114
- className,
115
- ...props
116
- }: React.HTMLAttributes<HTMLDivElement>) {
117
- return (
118
- <div className={cn(className)} data-slot="timeline-header" {...props} />
119
- );
120
- }
121
-
122
- // TimelineIndicator
123
- interface TimelineIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {
124
- asChild?: boolean;
125
- }
126
-
127
- function TimelineIndicator({
128
- asChild = false,
129
- className,
130
- children,
131
- ...props
132
- }: TimelineIndicatorProps) {
133
- return (
134
- <div
135
- aria-hidden="true"
136
- className={cn(
137
- "group-data-[orientation=horizontal]/timeline:-top-6 group-data-[orientation=horizontal]/timeline:-translate-y-1/2 group-data-[orientation=vertical]/timeline:-left-6 group-data-[orientation=vertical]/timeline:-translate-x-1/2 absolute size-4 rounded-full border-2 border-primary/20 group-data-[orientation=vertical]/timeline:top-0 group-data-[orientation=horizontal]/timeline:left-0 group-data-completed/timeline-item:border-primary",
138
- className,
139
- )}
140
- data-slot="timeline-indicator"
141
- {...props}
142
- >
143
- {children}
144
- </div>
145
- );
146
- }
147
-
148
- // TimelineItem
149
- interface TimelineItemProps extends React.HTMLAttributes<HTMLDivElement> {
150
- step: number;
151
- }
152
-
153
- function TimelineItem({ step, className, ...props }: TimelineItemProps) {
154
- const { activeStep } = useTimeline();
155
-
156
- return (
157
- <div
158
- className={cn(
159
- "group/timeline-item relative flex flex-1 flex-col gap-0.5 group-data-[orientation=vertical]/timeline:ms-8 group-data-[orientation=horizontal]/timeline:mt-8 group-data-[orientation=horizontal]/timeline:not-last:pe-8 group-data-[orientation=vertical]/timeline:not-last:pb-12 has-[+[data-completed]]:[&_[data-slot=timeline-separator]]:bg-primary",
160
- className,
161
- )}
162
- data-completed={step <= activeStep || undefined}
163
- data-slot="timeline-item"
164
- {...props}
165
- />
166
- );
167
- }
168
-
169
- // TimelineSeparator
170
- function TimelineSeparator({
171
- className,
172
- ...props
173
- }: React.HTMLAttributes<HTMLDivElement>) {
174
- return (
175
- <div
176
- aria-hidden="true"
177
- className={cn(
178
- "group-data-[orientation=horizontal]/timeline:-top-6 group-data-[orientation=horizontal]/timeline:-translate-y-1/2 group-data-[orientation=vertical]/timeline:-left-6 group-data-[orientation=vertical]/timeline:-translate-x-1/2 absolute self-start bg-primary/10 group-last/timeline-item:hidden group-data-[orientation=horizontal]/timeline:h-0.5 group-data-[orientation=vertical]/timeline:h-[calc(100%-1rem-0.25rem)] group-data-[orientation=horizontal]/timeline:w-[calc(100%-1rem-0.25rem)] group-data-[orientation=vertical]/timeline:w-0.5 group-data-[orientation=horizontal]/timeline:translate-x-4.5 group-data-[orientation=vertical]/timeline:translate-y-4.5",
179
- className,
180
- )}
181
- data-slot="timeline-separator"
182
- {...props}
183
- />
184
- );
185
- }
186
-
187
- // TimelineTitle
188
- function TimelineTitle({
189
- className,
190
- ...props
191
- }: React.HTMLAttributes<HTMLHeadingElement>) {
192
- return (
193
- <h3
194
- className={cn("font-medium text-sm", className)}
195
- data-slot="timeline-title"
196
- {...props}
197
- />
198
- );
199
- }
200
-
201
- export {
202
- Timeline,
203
- TimelineContent,
204
- TimelineDate,
205
- TimelineHeader,
206
- TimelineIndicator,
207
- TimelineItem,
208
- TimelineSeparator,
209
- TimelineTitle,
210
- };