|
1 | | -// Basic usage example for TimeSlice |
2 | | -export const timeSliceBasicExample = `import { TimeSlice } from "@bizarre/ui" |
| 1 | +// Basic usage example for Chrono |
| 2 | +export const chronoBasicExample = `import { Chrono } from "@bizarre/ui" |
3 | 3 |
|
4 | 4 | export function TimeRangePicker() { |
5 | 5 | const handleDateRangeChange = (range) => { |
6 | 6 | console.log('Date range changed:', range) |
7 | 7 | } |
8 | 8 |
|
9 | 9 | return ( |
10 | | - <TimeSlice.Root onDateRangeChange={handleDateRangeChange}> |
11 | | - <TimeSlice.Input /> |
12 | | - <TimeSlice.Portal> |
13 | | - <TimeSlice.Shortcut duration={{ minutes: 15 }}> |
| 10 | + <Chrono.Root onDateRangeChange={handleDateRangeChange}> |
| 11 | + <Chrono.Input /> |
| 12 | + <Chrono.Portal> |
| 13 | + <Chrono.Shortcut duration={{ minutes: 15 }}> |
14 | 14 | 15 minutes |
15 | | - </TimeSlice.Shortcut> |
16 | | - <TimeSlice.Shortcut duration={{ hours: 1 }}> |
| 15 | + </Chrono.Shortcut> |
| 16 | + <Chrono.Shortcut duration={{ hours: 1 }}> |
17 | 17 | 1 hour |
18 | | - </TimeSlice.Shortcut> |
19 | | - <TimeSlice.Shortcut duration={{ days: 1 }}> |
| 18 | + </Chrono.Shortcut> |
| 19 | + <Chrono.Shortcut duration={{ days: 1 }}> |
20 | 20 | 1 day |
21 | | - </TimeSlice.Shortcut> |
22 | | - <TimeSlice.Shortcut duration={{ months: 1 }}> |
| 21 | + </Chrono.Shortcut> |
| 22 | + <Chrono.Shortcut duration={{ months: 1 }}> |
23 | 23 | 1 month |
24 | | - </TimeSlice.Shortcut> |
25 | | - </TimeSlice.Portal> |
26 | | - </TimeSlice.Root> |
| 24 | + </Chrono.Shortcut> |
| 25 | + </Chrono.Portal> |
| 26 | + </Chrono.Root> |
27 | 27 | ) |
28 | 28 | }` |
29 | 29 |
|
30 | | -// Implementation example for TimeSlice - similar to the actual implementation but simplified |
31 | | -export const timeSliceImplementationExample = `import React from 'react' |
32 | | -import { TimeSlice } from '@bizarre/ui' |
| 30 | +// Implementation example for Chrono - similar to the actual implementation but simplified |
| 31 | +export const chronoImplementationExample = `import React from 'react' |
| 32 | +import { Chrono } from '@bizarre/ui' |
33 | 33 | import { ChevronDown } from 'lucide-react' |
34 | 34 |
|
35 | 35 | export function CustomTimeRangePicker() { |
@@ -67,56 +67,56 @@ export function CustomTimeRangePicker() { |
67 | 67 | }, [dateRange]) |
68 | 68 |
|
69 | 69 | return ( |
70 | | - <TimeSlice.Root |
| 70 | + <Chrono.Root |
71 | 71 | onDateRangeChange={setDateRange} |
72 | 72 | defaultDateRange={dateRange} |
73 | 73 | onOpenChange={setIsOpen} |
74 | 74 | > |
75 | | - <TimeSlice.Trigger asChild> |
| 75 | + <Chrono.Trigger asChild> |
76 | 76 | <div className="flex items-center w-full"> |
77 | 77 | <div className="flex-1 flex items-center border border-zinc-800 rounded-md px-3 py-2 cursor-pointer"> |
78 | 78 | <div className="flex items-center w-full"> |
79 | 79 | <div className="h-[22px] min-w-[44px] bg-zinc-800 rounded-md text-xs text-center mr-2"> |
80 | 80 | {activeDurationLabel} |
81 | 81 | </div> |
82 | | - <TimeSlice.Input className="bg-transparent text-sm w-full outline-none border-none" /> |
| 82 | + <Chrono.Input className="bg-transparent text-sm w-full outline-none border-none" /> |
83 | 83 | <div className={\`transition-transform \${isOpen ? "rotate-180" : ""}\`}> |
84 | 84 | <ChevronDown className="h-4 w-4" /> |
85 | 85 | </div> |
86 | 86 | </div> |
87 | 87 | </div> |
88 | 88 | </div> |
89 | | - </TimeSlice.Trigger> |
| 89 | + </Chrono.Trigger> |
90 | 90 |
|
91 | | - <TimeSlice.Portal className="bg-zinc-900 border border-zinc-800 rounded-md mt-1.5 p-1.5 flex flex-col gap-1"> |
| 91 | + <Chrono.Portal className="bg-zinc-900 border border-zinc-800 rounded-md mt-1.5 p-1.5 flex flex-col gap-1"> |
92 | 92 | <div className="pb-1.5 px-1.5 mb-1 border-b border-zinc-800"> |
93 | 93 | <div className="text-xs font-medium">Quick select</div> |
94 | 94 | </div> |
95 | | - <TimeSlice.Shortcut duration={{ minutes: 15 }} asChild> |
| 95 | + <Chrono.Shortcut duration={{ minutes: 15 }} asChild> |
96 | 96 | <div className="hover:bg-zinc-800 p-2 rounded-sm flex items-center justify-between"> |
97 | 97 | <span>15 minutes</span> |
98 | 98 | <span className="text-xs text-zinc-500">15m</span> |
99 | 99 | </div> |
100 | | - </TimeSlice.Shortcut> |
101 | | - <TimeSlice.Shortcut duration={{ hours: 1 }} asChild> |
| 100 | + </Chrono.Shortcut> |
| 101 | + <Chrono.Shortcut duration={{ hours: 1 }} asChild> |
102 | 102 | <div className="hover:bg-zinc-800 p-2 rounded-sm flex items-center justify-between"> |
103 | 103 | <span>1 hour</span> |
104 | 104 | <span className="text-xs text-zinc-500">1h</span> |
105 | 105 | </div> |
106 | | - </TimeSlice.Shortcut> |
107 | | - <TimeSlice.Shortcut duration={{ days: 1 }} asChild> |
| 106 | + </Chrono.Shortcut> |
| 107 | + <Chrono.Shortcut duration={{ days: 1 }} asChild> |
108 | 108 | <div className="hover:bg-zinc-800 p-2 rounded-sm flex items-center justify-between"> |
109 | 109 | <span>1 day</span> |
110 | 110 | <span className="text-xs text-zinc-500">1d</span> |
111 | 111 | </div> |
112 | | - </TimeSlice.Shortcut> |
113 | | - <TimeSlice.Shortcut duration={{ months: 1 }} asChild> |
| 112 | + </Chrono.Shortcut> |
| 113 | + <Chrono.Shortcut duration={{ months: 1 }} asChild> |
114 | 114 | <div className="hover:bg-zinc-800 p-2 rounded-sm flex items-center justify-between"> |
115 | 115 | <span>1 month</span> |
116 | 116 | <span className="text-xs text-zinc-500">1mo</span> |
117 | 117 | </div> |
118 | | - </TimeSlice.Shortcut> |
119 | | - </TimeSlice.Portal> |
120 | | - </TimeSlice.Root> |
| 118 | + </Chrono.Shortcut> |
| 119 | + </Chrono.Portal> |
| 120 | + </Chrono.Root> |
121 | 121 | ) |
122 | 122 | }` |
0 commit comments