@rise-x/apps-sdk 0.8.0 → 0.11.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.
- package/README.md +209 -21
- package/build/rsbuild/index.d.ts +36 -0
- package/build/rsbuild/index.js +225 -0
- package/build/ui/classes.json +209 -0
- package/build/ui/components/ai.d.ts +33 -1
- package/build/ui/components/app-frame.d.ts +19 -0
- package/build/ui/components/chat-input.d.ts +28 -0
- package/build/ui/components/message-scroller.d.ts +34 -10
- package/build/ui/components/nav.d.ts +2 -1
- package/build/ui/components/sheet.d.ts +10 -0
- package/build/ui/components/thinking-rings.d.ts +4 -0
- package/build/ui/demo.html +26794 -0
- package/build/ui/index.d.ts +3 -0
- package/build/ui/standalone.js +59 -58
- package/build/ui/styles.css +1 -1
- package/package.json +24 -3
- package/rsbuild/package.json +8 -0
- package/template/AGENTS.md +18 -10
- package/template/README.md +5 -5
- package/template/package.json +8 -9
- package/template/rsbuild.config.mts +17 -0
- package/template/src/App.tsx +21 -11
- package/template/tsconfig.json +3 -1
- package/build/ui/reference/README.md +0 -11
- package/build/ui/reference/components/accordion.tsx +0 -85
- package/build/ui/reference/components/ai.tsx +0 -291
- package/build/ui/reference/components/alert-dialog.tsx +0 -213
- package/build/ui/reference/components/alert.tsx +0 -112
- package/build/ui/reference/components/aspect-ratio.tsx +0 -28
- package/build/ui/reference/components/avatar.tsx +0 -158
- package/build/ui/reference/components/badge.tsx +0 -160
- package/build/ui/reference/components/button-group.tsx +0 -77
- package/build/ui/reference/components/button.tsx +0 -107
- package/build/ui/reference/components/calendar.tsx +0 -119
- package/build/ui/reference/components/card.tsx +0 -144
- package/build/ui/reference/components/carousel.tsx +0 -248
- package/build/ui/reference/components/chart.tsx +0 -704
- package/build/ui/reference/components/checkbox.tsx +0 -44
- package/build/ui/reference/components/collapsible.tsx +0 -43
- package/build/ui/reference/components/combobox.tsx +0 -141
- package/build/ui/reference/components/command.tsx +0 -181
- package/build/ui/reference/components/context-menu.tsx +0 -243
- package/build/ui/reference/components/data-table.tsx +0 -650
- package/build/ui/reference/components/date-picker.tsx +0 -218
- package/build/ui/reference/components/dialog.tsx +0 -172
- package/build/ui/reference/components/direction.tsx +0 -22
- package/build/ui/reference/components/dropdown-menu.tsx +0 -245
- package/build/ui/reference/components/empty-state.tsx +0 -63
- package/build/ui/reference/components/field.tsx +0 -252
- package/build/ui/reference/components/file-upload.tsx +0 -116
- package/build/ui/reference/components/hover-card.tsx +0 -64
- package/build/ui/reference/components/input-group.tsx +0 -157
- package/build/ui/reference/components/input-otp.tsx +0 -106
- package/build/ui/reference/components/input.tsx +0 -86
- package/build/ui/reference/components/item.tsx +0 -188
- package/build/ui/reference/components/kbd.tsx +0 -43
- package/build/ui/reference/components/label.tsx +0 -19
- package/build/ui/reference/components/list.tsx +0 -191
- package/build/ui/reference/components/map.css +0 -251
- package/build/ui/reference/components/map.tsx +0 -294
- package/build/ui/reference/components/menubar.tsx +0 -275
- package/build/ui/reference/components/message-scroller.tsx +0 -141
- package/build/ui/reference/components/message.tsx +0 -171
- package/build/ui/reference/components/nav.tsx +0 -122
- package/build/ui/reference/components/navigation-menu.tsx +0 -191
- package/build/ui/reference/components/page-header.tsx +0 -245
- package/build/ui/reference/components/popover.tsx +0 -76
- package/build/ui/reference/components/progress.tsx +0 -31
- package/build/ui/reference/components/radio.tsx +0 -65
- package/build/ui/reference/components/resizable.tsx +0 -40
- package/build/ui/reference/components/scroll-area.tsx +0 -55
- package/build/ui/reference/components/segmented.tsx +0 -45
- package/build/ui/reference/components/select.tsx +0 -188
- package/build/ui/reference/components/separator.tsx +0 -26
- package/build/ui/reference/components/sheet.tsx +0 -184
- package/build/ui/reference/components/skeleton.tsx +0 -15
- package/build/ui/reference/components/slider.tsx +0 -161
- package/build/ui/reference/components/snackbar.tsx +0 -27
- package/build/ui/reference/components/sonner.tsx +0 -43
- package/build/ui/reference/components/spinner.tsx +0 -27
- package/build/ui/reference/components/statistic.tsx +0 -122
- package/build/ui/reference/components/stepper.tsx +0 -138
- package/build/ui/reference/components/switch.tsx +0 -47
- package/build/ui/reference/components/table.tsx +0 -246
- package/build/ui/reference/components/textarea.tsx +0 -28
- package/build/ui/reference/components/timeline.tsx +0 -101
- package/build/ui/reference/components/toggle-group.tsx +0 -86
- package/build/ui/reference/components/toggle.tsx +0 -46
- package/build/ui/reference/components/tooltip.tsx +0 -53
- package/build/ui/reference/index.ts +0 -68
- package/build/ui/reference/lib/utils.ts +0 -34
- package/template/webpack.config.js +0 -112
- package/template/webpack.local.config.js +0 -68
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { cn } from '@rise-x/ui/lib/utils';
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
* Roomier than a dense grid — 44px header, 52px rows, 16px cell padding —
|
|
7
|
-
* because Rise-X rows routinely carry two lines of identity. No zebra
|
|
8
|
-
* striping: the hairline divider is enough, and stripes fight with selection
|
|
9
|
-
* and status tints.
|
|
10
|
-
*
|
|
11
|
-
* GREY IS A BUDGET, AND A TABLE IS MOSTLY ROWS. A fill that reads as gentle on
|
|
12
|
-
* a 32px control covers half the screen here, so it is spent only on what the
|
|
13
|
-
* USER is doing to a row: hover 4.5% → press/select 8% → selected-and-hovered
|
|
14
|
-
* 13%. Hover always sits BELOW selection, never level with it, or a transient
|
|
15
|
-
* state gets read as a persistent one.
|
|
16
|
-
*
|
|
17
|
-
* STRUCTURE: the expanded region spends no grey — the turned chevron and the
|
|
18
|
-
* indented detail are already unambiguous, and four open rows would flood.
|
|
19
|
-
* GROUP HEADERS DO get a band (`--muted`), because a group boundary has to be
|
|
20
|
-
* findable while scanning a long table and space alone loses that fight once the
|
|
21
|
-
* rows are dense. It sits BELOW every row-interaction fill, so it still cannot
|
|
22
|
-
* be confused with hover or selection.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
function Table({
|
|
26
|
-
className,
|
|
27
|
-
containerClassName,
|
|
28
|
-
...props
|
|
29
|
-
}: React.ComponentProps<'table'> & {
|
|
30
|
-
/** Extends the scroll container the table always renders inside. Sticky
|
|
31
|
-
* headers pin to THIS element, so a vertically scrolling table puts its
|
|
32
|
-
* max-height + overflow-y here — an outer scroll div never receives the
|
|
33
|
-
* stick. */
|
|
34
|
-
containerClassName?: string;
|
|
35
|
-
}) {
|
|
36
|
-
return (
|
|
37
|
-
<div
|
|
38
|
-
data-slot="table-container"
|
|
39
|
-
className={cn('relative w-full overflow-x-auto', containerClassName)}
|
|
40
|
-
>
|
|
41
|
-
<table
|
|
42
|
-
data-slot="table"
|
|
43
|
-
className={cn('w-full caption-bottom border-separate border-spacing-0 text-ui', className)}
|
|
44
|
-
{...props}
|
|
45
|
-
/>
|
|
46
|
-
</div>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/* Optional wrapper: the card the table lives in. 18px radius (grouped
|
|
51
|
-
* surface), hairline border, no shadow. */
|
|
52
|
-
function TableWrap({ className, ...props }: React.ComponentProps<'div'>) {
|
|
53
|
-
return (
|
|
54
|
-
<div
|
|
55
|
-
data-slot="table-wrap"
|
|
56
|
-
className={cn('overflow-x-auto rounded-2xl border border-border bg-card', className)}
|
|
57
|
-
{...props}
|
|
58
|
-
/>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {
|
|
63
|
-
return <thead data-slot="table-header" className={cn(className)} {...props} />;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
|
|
67
|
-
return (
|
|
68
|
-
<tbody
|
|
69
|
-
data-slot="table-body"
|
|
70
|
-
className={cn('[&_tr:last-child>td]:border-b-0', className)}
|
|
71
|
-
{...props}
|
|
72
|
-
/>
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {
|
|
77
|
-
return (
|
|
78
|
-
<tfoot
|
|
79
|
-
data-slot="table-footer"
|
|
80
|
-
className={cn('border-t bg-muted/50 font-medium [&>tr]:last:border-b-0', className)}
|
|
81
|
-
{...props}
|
|
82
|
-
/>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function TableRow({
|
|
87
|
-
className,
|
|
88
|
-
expanded,
|
|
89
|
-
...props
|
|
90
|
-
}: React.ComponentProps<'tr'> & {
|
|
91
|
-
/** This row is showing its own TableExpandedRow beneath it. Drops the
|
|
92
|
-
* hairline underneath so the pair reads as one uninterrupted surface. */
|
|
93
|
-
expanded?: boolean;
|
|
94
|
-
}) {
|
|
95
|
-
return (
|
|
96
|
-
<tr
|
|
97
|
-
data-slot="table-row"
|
|
98
|
-
data-expanded={expanded ? '' : undefined}
|
|
99
|
-
className={cn(
|
|
100
|
-
'transition-colors duration-150 ease-decelerate hover:bg-fill-0 active:bg-fill-1',
|
|
101
|
-
'data-expanded:[&>td]:border-b-transparent',
|
|
102
|
-
// Selection is a NEUTRAL fill, not brand: at 20 selected rows a green
|
|
103
|
-
// wash swamps the table, and the filled checkbox already says
|
|
104
|
-
// "selected". Brand-as-selection survives only where one thing can be
|
|
105
|
-
// selected at a time (nav item, detail list).
|
|
106
|
-
'data-[state=selected]:bg-fill-1 data-[state=selected]:hover:bg-fill-2',
|
|
107
|
-
className,
|
|
108
|
-
)}
|
|
109
|
-
{...props}
|
|
110
|
-
/>
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/* Group header: a grey band, opaque so it survives a sticky header. Air above
|
|
115
|
-
* still separates it from the group that ended, and there is no rule below, so
|
|
116
|
-
* it attaches to the group it opens rather than floating between the two. */
|
|
117
|
-
function TableGroupRow({
|
|
118
|
-
className,
|
|
119
|
-
children,
|
|
120
|
-
colSpan,
|
|
121
|
-
cellClassName,
|
|
122
|
-
...props
|
|
123
|
-
}: React.ComponentProps<'tr'> & {
|
|
124
|
-
colSpan?: number;
|
|
125
|
-
/** Merged onto the inner cell — the band's own size, case and padding live
|
|
126
|
-
* there, not on the row. */
|
|
127
|
-
cellClassName?: string;
|
|
128
|
-
}) {
|
|
129
|
-
return (
|
|
130
|
-
<tr data-slot="table-group-row" className={cn('bg-muted hover:bg-muted', className)} {...props}>
|
|
131
|
-
<td
|
|
132
|
-
colSpan={colSpan}
|
|
133
|
-
className={cn(
|
|
134
|
-
'border-b-0 bg-muted px-4 py-2.5 align-middle text-micro font-medium tracking-[0.04em] text-muted-foreground uppercase',
|
|
135
|
-
cellClassName,
|
|
136
|
-
)}
|
|
137
|
-
>
|
|
138
|
-
{children}
|
|
139
|
-
</td>
|
|
140
|
-
</tr>
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/* Expanded detail. On the card surface, deliberately: expansion is not a state
|
|
145
|
-
* the user can be wrong about — the chevron has turned and the detail is
|
|
146
|
-
* plainly detail — so it spends no grey. Belonging is structural instead. Put
|
|
147
|
-
* `data-expanded` on the PARENT row so its hairline drops and the pair reads as
|
|
148
|
-
* one uninterrupted surface. */
|
|
149
|
-
function TableExpandedRow({ className, ...props }: React.ComponentProps<'tr'>) {
|
|
150
|
-
return (
|
|
151
|
-
<tr
|
|
152
|
-
data-slot="table-expanded-row"
|
|
153
|
-
className={cn(
|
|
154
|
-
'bg-card hover:bg-card [&>td]:h-auto [&>td]:border-b [&>td]:border-border [&>td]:p-0',
|
|
155
|
-
className,
|
|
156
|
-
)}
|
|
157
|
-
{...props}
|
|
158
|
-
/>
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
|
|
163
|
-
return (
|
|
164
|
-
<th
|
|
165
|
-
data-slot="table-head"
|
|
166
|
-
className={cn(
|
|
167
|
-
'h-11 border-b border-border bg-card px-4 text-left align-middle text-xs font-medium tracking-[0.01em] whitespace-nowrap text-muted-foreground [&:has([role=checkbox])]:pr-0',
|
|
168
|
-
className,
|
|
169
|
-
)}
|
|
170
|
-
{...props}
|
|
171
|
-
/>
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
|
|
176
|
-
return (
|
|
177
|
-
<td
|
|
178
|
-
data-slot="table-cell"
|
|
179
|
-
className={cn(
|
|
180
|
-
'h-13 border-b border-border-subtle px-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0',
|
|
181
|
-
className,
|
|
182
|
-
)}
|
|
183
|
-
{...props}
|
|
184
|
-
/>
|
|
185
|
-
);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {
|
|
189
|
-
return (
|
|
190
|
-
<caption
|
|
191
|
-
data-slot="table-caption"
|
|
192
|
-
className={cn('mt-4 text-ui text-muted-foreground', className)}
|
|
193
|
-
{...props}
|
|
194
|
-
/>
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/* Two-line cell: identity on top, context beneath. The reason rows are 52px. */
|
|
199
|
-
function TableCellStack({ className, ...props }: React.ComponentProps<'span'>) {
|
|
200
|
-
return (
|
|
201
|
-
<span
|
|
202
|
-
data-slot="table-cell-stack"
|
|
203
|
-
className={cn(
|
|
204
|
-
'flex flex-col leading-[1.35] [&>small]:text-micro [&>small]:leading-[1.35] [&>small]:text-subtle',
|
|
205
|
-
className,
|
|
206
|
-
)}
|
|
207
|
-
{...props}
|
|
208
|
-
/>
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/* Lazy loading, not pagination. The sentinel sits inside the table container so
|
|
213
|
-
* the header stays put and scroll position is never reset. */
|
|
214
|
-
function TableLazySentinel({ className, children, ...props }: React.ComponentProps<'div'>) {
|
|
215
|
-
return (
|
|
216
|
-
<div
|
|
217
|
-
data-slot="table-lazy"
|
|
218
|
-
className={cn(
|
|
219
|
-
// hairline above: the sentinel is chrome, not the next row, and without
|
|
220
|
-
// a rule it reads as a row that failed to render
|
|
221
|
-
'flex items-center justify-center gap-[9px] border-t border-border-subtle px-4 py-3.5 text-xs text-subtle',
|
|
222
|
-
className,
|
|
223
|
-
)}
|
|
224
|
-
{...props}
|
|
225
|
-
>
|
|
226
|
-
<span className="size-[13px] animate-spin rounded-full border-[1.5px] border-border border-t-muted-foreground" />
|
|
227
|
-
{children ?? 'Loading more…'}
|
|
228
|
-
</div>
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export {
|
|
233
|
-
Table,
|
|
234
|
-
TableWrap,
|
|
235
|
-
TableHeader,
|
|
236
|
-
TableBody,
|
|
237
|
-
TableFooter,
|
|
238
|
-
TableHead,
|
|
239
|
-
TableRow,
|
|
240
|
-
TableGroupRow,
|
|
241
|
-
TableExpandedRow,
|
|
242
|
-
TableCell,
|
|
243
|
-
TableCellStack,
|
|
244
|
-
TableCaption,
|
|
245
|
-
TableLazySentinel,
|
|
246
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { cn } from '@rise-x/ui/lib/utils';
|
|
4
|
-
|
|
5
|
-
// forwardRef (not React 19 ref-as-prop): the classic React 18 host also renders
|
|
6
|
-
// these components and strips `ref` from plain function components — imperative
|
|
7
|
-
// focus/measure from consumers would silently break there.
|
|
8
|
-
const Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<'textarea'>>(
|
|
9
|
-
function Textarea({ className, ...props }, ref) {
|
|
10
|
-
return (
|
|
11
|
-
<textarea
|
|
12
|
-
ref={ref}
|
|
13
|
-
data-slot="textarea"
|
|
14
|
-
className={cn(
|
|
15
|
-
'flex field-sizing-content min-h-16 w-full resize-y rounded-lg border border-input bg-card px-2.5 py-2 text-ui text-foreground transition-[border-color,box-shadow] duration-100 outline-none',
|
|
16
|
-
'placeholder:text-subtle',
|
|
17
|
-
'focus-visible:border-brand focus-visible:ring-3 focus-visible:ring-brand/12',
|
|
18
|
-
'disabled:cursor-not-allowed disabled:bg-muted disabled:text-subtle',
|
|
19
|
-
'aria-invalid:border-error aria-invalid:focus-visible:border-error aria-invalid:focus-visible:ring-error/18',
|
|
20
|
-
className,
|
|
21
|
-
)}
|
|
22
|
-
{...props}
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
25
|
-
},
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
export { Textarea };
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@rise-x/ui/lib/utils';
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* Timeline / activity log / audit trail / version history are ONE component.
|
|
8
|
-
* They differ in content, not in structure: a rail, a node per entry, and a
|
|
9
|
-
* two-line body. Building four of these would mean four sets of spacing
|
|
10
|
-
* decisions drifting apart.
|
|
11
|
-
*
|
|
12
|
-
* The rail is drawn on the node's ::after rather than as a border on the row,
|
|
13
|
-
* so the last entry has no dangling tail and nothing needs a modifier class.
|
|
14
|
-
*
|
|
15
|
-
* PLACEMENT. Activity is ambient context, not page content: it opens from an
|
|
16
|
-
* icon button in the page header (every app's default affordance) and slides
|
|
17
|
-
* in from the right as a Sheet over the dimmed page, with its filter and
|
|
18
|
-
* search inside the panel. Never lay it out as an inline column beside the
|
|
19
|
-
* content — that spends a third of every viewport on history the user rarely
|
|
20
|
-
* reads, and the page's real content pays for it.
|
|
21
|
-
*/
|
|
22
|
-
function Timeline({ className, ...props }: React.ComponentProps<'ol'>) {
|
|
23
|
-
return <ol data-slot="timeline" className={cn('flex flex-col', className)} {...props} />;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const nodeVariants = cva(
|
|
27
|
-
'relative z-10 grid size-[18px] shrink-0 place-items-center rounded-full [&_svg]:size-2.5',
|
|
28
|
-
{
|
|
29
|
-
variants: {
|
|
30
|
-
tone: {
|
|
31
|
-
neutral: 'bg-fill-2 text-muted-foreground',
|
|
32
|
-
success: 'bg-success/15 text-success-text',
|
|
33
|
-
warning: 'bg-warning/16 text-warning-text',
|
|
34
|
-
error: 'bg-error/14 text-error-text',
|
|
35
|
-
info: 'bg-info/14 text-info-text',
|
|
36
|
-
ai: 'bg-ai/14 text-ai-text',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
defaultVariants: { tone: 'neutral' },
|
|
40
|
-
},
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
function TimelineItem({
|
|
44
|
-
className,
|
|
45
|
-
tone = 'neutral',
|
|
46
|
-
glyph,
|
|
47
|
-
children,
|
|
48
|
-
last,
|
|
49
|
-
...props
|
|
50
|
-
}: React.ComponentProps<'li'> &
|
|
51
|
-
VariantProps<typeof nodeVariants> & {
|
|
52
|
-
glyph?: React.ReactNode;
|
|
53
|
-
/** Suppresses the connecting rail below the node. */
|
|
54
|
-
last?: boolean;
|
|
55
|
-
}) {
|
|
56
|
-
return (
|
|
57
|
-
<li
|
|
58
|
-
data-slot="timeline-item"
|
|
59
|
-
className={cn('relative flex gap-2.5 pb-4 last:pb-0', className)}
|
|
60
|
-
{...props}
|
|
61
|
-
>
|
|
62
|
-
<div className="relative flex flex-col items-center">
|
|
63
|
-
<span className={cn(nodeVariants({ tone }))}>{glyph}</span>
|
|
64
|
-
{!last && <span aria-hidden className="w-px flex-1 bg-border" />}
|
|
65
|
-
</div>
|
|
66
|
-
<div className="min-w-0 flex-1">{children}</div>
|
|
67
|
-
</li>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function TimelineTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
72
|
-
return (
|
|
73
|
-
<div
|
|
74
|
-
data-slot="timeline-title"
|
|
75
|
-
className={cn('text-ui leading-[1.35] font-medium', className)}
|
|
76
|
-
{...props}
|
|
77
|
-
/>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function TimelineMeta({ className, ...props }: React.ComponentProps<'div'>) {
|
|
82
|
-
return (
|
|
83
|
-
<div
|
|
84
|
-
data-slot="timeline-meta"
|
|
85
|
-
className={cn('mt-0.5 text-micro text-subtle', className)}
|
|
86
|
-
{...props}
|
|
87
|
-
/>
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function TimelineBody({ className, ...props }: React.ComponentProps<'div'>) {
|
|
92
|
-
return (
|
|
93
|
-
<div
|
|
94
|
-
data-slot="timeline-body"
|
|
95
|
-
className={cn('mt-1 text-xs text-muted-foreground', className)}
|
|
96
|
-
{...props}
|
|
97
|
-
/>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export { Timeline, TimelineItem, TimelineTitle, TimelineMeta, TimelineBody, nodeVariants };
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { type VariantProps } from 'class-variance-authority';
|
|
5
|
-
import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';
|
|
6
|
-
|
|
7
|
-
import { cn } from '@rise-x/ui/lib/utils';
|
|
8
|
-
import { toggleVariants } from '@rise-x/ui/components/toggle';
|
|
9
|
-
|
|
10
|
-
const ToggleGroupContext = React.createContext<
|
|
11
|
-
VariantProps<typeof toggleVariants> & {
|
|
12
|
-
spacing?: number;
|
|
13
|
-
orientation?: 'horizontal' | 'vertical';
|
|
14
|
-
}
|
|
15
|
-
>({
|
|
16
|
-
size: 'default',
|
|
17
|
-
variant: 'default',
|
|
18
|
-
spacing: 2,
|
|
19
|
-
orientation: 'horizontal',
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
function ToggleGroup({
|
|
23
|
-
className,
|
|
24
|
-
variant,
|
|
25
|
-
size,
|
|
26
|
-
spacing = 2,
|
|
27
|
-
orientation = 'horizontal',
|
|
28
|
-
children,
|
|
29
|
-
...props
|
|
30
|
-
}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
|
|
31
|
-
VariantProps<typeof toggleVariants> & {
|
|
32
|
-
spacing?: number;
|
|
33
|
-
orientation?: 'horizontal' | 'vertical';
|
|
34
|
-
}) {
|
|
35
|
-
return (
|
|
36
|
-
<ToggleGroupPrimitive.Root
|
|
37
|
-
data-slot="toggle-group"
|
|
38
|
-
data-variant={variant}
|
|
39
|
-
data-size={size}
|
|
40
|
-
data-spacing={spacing}
|
|
41
|
-
data-orientation={orientation}
|
|
42
|
-
style={{ '--gap': spacing } as React.CSSProperties}
|
|
43
|
-
className={cn(
|
|
44
|
-
'group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[spacing=0]:data-[variant=outline]:rounded-lg data-vertical:flex-col data-vertical:items-stretch',
|
|
45
|
-
className,
|
|
46
|
-
)}
|
|
47
|
-
{...props}
|
|
48
|
-
>
|
|
49
|
-
<ToggleGroupContext.Provider value={{ variant, size, spacing, orientation }}>
|
|
50
|
-
{children}
|
|
51
|
-
</ToggleGroupContext.Provider>
|
|
52
|
-
</ToggleGroupPrimitive.Root>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function ToggleGroupItem({
|
|
57
|
-
className,
|
|
58
|
-
children,
|
|
59
|
-
variant = 'default',
|
|
60
|
-
size = 'default',
|
|
61
|
-
...props
|
|
62
|
-
}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>) {
|
|
63
|
-
const context = React.useContext(ToggleGroupContext);
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<ToggleGroupPrimitive.Item
|
|
67
|
-
data-slot="toggle-group-item"
|
|
68
|
-
data-variant={context.variant || variant}
|
|
69
|
-
data-size={context.size || size}
|
|
70
|
-
data-spacing={context.spacing}
|
|
71
|
-
className={cn(
|
|
72
|
-
'shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-3 group-data-[spacing=0]/toggle-group:shadow-none focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-2.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-2.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-3xl group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-3xl group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-3xl group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-3xl data-[state=on]:bg-muted group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t',
|
|
73
|
-
toggleVariants({
|
|
74
|
-
variant: context.variant || variant,
|
|
75
|
-
size: context.size || size,
|
|
76
|
-
}),
|
|
77
|
-
className,
|
|
78
|
-
)}
|
|
79
|
-
{...props}
|
|
80
|
-
>
|
|
81
|
-
{children}
|
|
82
|
-
</ToggleGroupPrimitive.Item>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
5
|
-
import { Toggle as TogglePrimitive } from 'radix-ui';
|
|
6
|
-
|
|
7
|
-
import { cn } from '@rise-x/ui/lib/utils';
|
|
8
|
-
|
|
9
|
-
const toggleVariants = cva(
|
|
10
|
-
"group/toggle inline-flex items-center justify-center gap-1 rounded-md text-ui font-medium whitespace-nowrap transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
11
|
-
{
|
|
12
|
-
variants: {
|
|
13
|
-
variant: {
|
|
14
|
-
default: 'bg-transparent',
|
|
15
|
-
outline: 'border border-input bg-transparent hover:bg-muted',
|
|
16
|
-
},
|
|
17
|
-
size: {
|
|
18
|
-
default:
|
|
19
|
-
'h-control min-w-8 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5',
|
|
20
|
-
sm: 'h-8 min-w-8 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
21
|
-
lg: 'h-control-lg min-w-9 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
defaultVariants: {
|
|
25
|
-
variant: 'default',
|
|
26
|
-
size: 'default',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
function Toggle({
|
|
32
|
-
className,
|
|
33
|
-
variant = 'default',
|
|
34
|
-
size = 'default',
|
|
35
|
-
...props
|
|
36
|
-
}: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>) {
|
|
37
|
-
return (
|
|
38
|
-
<TogglePrimitive.Root
|
|
39
|
-
data-slot="toggle"
|
|
40
|
-
className={cn(toggleVariants({ variant, size, className }))}
|
|
41
|
-
{...props}
|
|
42
|
-
/>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { Toggle, toggleVariants };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Tooltip as TooltipPrimitive } from 'radix-ui';
|
|
5
|
-
|
|
6
|
-
import { cn } from '@rise-x/ui/lib/utils';
|
|
7
|
-
|
|
8
|
-
function TooltipProvider({
|
|
9
|
-
delayDuration = 0,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
12
|
-
return (
|
|
13
|
-
<TooltipPrimitive.Provider
|
|
14
|
-
data-slot="tooltip-provider"
|
|
15
|
-
delayDuration={delayDuration}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
22
|
-
return <TooltipPrimitive.Root data-slot="tooltip" {...props} />;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
26
|
-
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function TooltipContent({
|
|
30
|
-
className,
|
|
31
|
-
sideOffset = 0,
|
|
32
|
-
children,
|
|
33
|
-
...props
|
|
34
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
35
|
-
return (
|
|
36
|
-
<TooltipPrimitive.Portal>
|
|
37
|
-
<TooltipPrimitive.Content
|
|
38
|
-
data-slot="tooltip-content"
|
|
39
|
-
sideOffset={sideOffset}
|
|
40
|
-
className={cn(
|
|
41
|
-
'z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
42
|
-
className,
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
>
|
|
46
|
-
{children}
|
|
47
|
-
<TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=left]:translate-x-[-1.5px] data-[side=right]:translate-x-[1.5px]" />
|
|
48
|
-
</TooltipPrimitive.Content>
|
|
49
|
-
</TooltipPrimitive.Portal>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// Root barrel — lets consumers `import { Button, cn } from '@rise-x/ui'`.
|
|
2
|
-
// Subpath imports (`@rise-x/ui/components/button`) remain the canonical form
|
|
3
|
-
// written by the shadcn CLI; both resolve to the same source modules.
|
|
4
|
-
export * from './components/accordion';
|
|
5
|
-
export * from './components/ai';
|
|
6
|
-
export * from './components/alert';
|
|
7
|
-
export * from './components/alert-dialog';
|
|
8
|
-
export * from './components/aspect-ratio';
|
|
9
|
-
export * from './components/avatar';
|
|
10
|
-
export * from './components/badge';
|
|
11
|
-
export * from './components/button';
|
|
12
|
-
export * from './components/button-group';
|
|
13
|
-
export * from './components/calendar';
|
|
14
|
-
export * from './components/card';
|
|
15
|
-
export * from './components/carousel';
|
|
16
|
-
export * from './components/chart';
|
|
17
|
-
export * from './components/checkbox';
|
|
18
|
-
export * from './components/collapsible';
|
|
19
|
-
export * from './components/combobox';
|
|
20
|
-
export * from './components/command';
|
|
21
|
-
export * from './components/context-menu';
|
|
22
|
-
export * from './components/data-table';
|
|
23
|
-
export * from './components/date-picker';
|
|
24
|
-
export * from './components/dialog';
|
|
25
|
-
export * from './components/direction';
|
|
26
|
-
export * from './components/dropdown-menu';
|
|
27
|
-
export * from './components/empty-state';
|
|
28
|
-
export * from './components/field';
|
|
29
|
-
export * from './components/file-upload';
|
|
30
|
-
export * from './components/hover-card';
|
|
31
|
-
export * from './components/input';
|
|
32
|
-
export * from './components/input-group';
|
|
33
|
-
export * from './components/input-otp';
|
|
34
|
-
export * from './components/item';
|
|
35
|
-
export * from './components/kbd';
|
|
36
|
-
export * from './components/label';
|
|
37
|
-
export * from './components/list';
|
|
38
|
-
export * from './components/map';
|
|
39
|
-
export * from './components/menubar';
|
|
40
|
-
export * from './components/message';
|
|
41
|
-
export * from './components/message-scroller';
|
|
42
|
-
export * from './components/nav';
|
|
43
|
-
export * from './components/navigation-menu';
|
|
44
|
-
export * from './components/page-header';
|
|
45
|
-
export * from './components/popover';
|
|
46
|
-
export * from './components/progress';
|
|
47
|
-
export * from './components/radio';
|
|
48
|
-
export * from './components/resizable';
|
|
49
|
-
export * from './components/scroll-area';
|
|
50
|
-
export * from './components/segmented';
|
|
51
|
-
export * from './components/select';
|
|
52
|
-
export * from './components/separator';
|
|
53
|
-
export * from './components/sheet';
|
|
54
|
-
export * from './components/skeleton';
|
|
55
|
-
export * from './components/slider';
|
|
56
|
-
export * from './components/snackbar';
|
|
57
|
-
export * from './components/sonner';
|
|
58
|
-
export * from './components/spinner';
|
|
59
|
-
export * from './components/statistic';
|
|
60
|
-
export * from './components/stepper';
|
|
61
|
-
export * from './components/switch';
|
|
62
|
-
export * from './components/table';
|
|
63
|
-
export * from './components/textarea';
|
|
64
|
-
export * from './components/timeline';
|
|
65
|
-
export * from './components/toggle';
|
|
66
|
-
export * from './components/toggle-group';
|
|
67
|
-
export * from './components/tooltip';
|
|
68
|
-
export { cn } from './lib/utils';
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { clsx, type ClassValue } from 'clsx';
|
|
2
|
-
import { extendTailwindMerge } from 'tailwind-merge';
|
|
3
|
-
|
|
4
|
-
/*
|
|
5
|
-
* tailwind-merge has to be told about the tokens we added, or it silently
|
|
6
|
-
* deletes them.
|
|
7
|
-
*
|
|
8
|
-
* `text-*` is ambiguous — it is both the font-size scale and the text-colour
|
|
9
|
-
* scale — and tailwind-merge resolves the ambiguity from its built-in list of
|
|
10
|
-
* known sizes. Our custom steps (`text-ui` 13px, `text-micro` 11px) are not on
|
|
11
|
-
* that list, so it classified them as COLOURS. Any variant that also set a text
|
|
12
|
-
* colour then won the conflict and dropped the size: every Button variant
|
|
13
|
-
* except `outline` was rendering at the inherited 16px instead of 13px, which
|
|
14
|
-
* is invisible in code review and obvious in a pixel diff.
|
|
15
|
-
*
|
|
16
|
-
* The same trap applies to the spacing tokens (`h-control`) and the fill scale
|
|
17
|
-
* (`bg-fill-1`), so both are declared here too.
|
|
18
|
-
*/
|
|
19
|
-
const twMerge = extendTailwindMerge({
|
|
20
|
-
extend: {
|
|
21
|
-
classGroups: {
|
|
22
|
-
'font-size': [{ text: ['ui', 'micro'] }],
|
|
23
|
-
'text-color': [{ text: ['subtle', 'brand-text', 'ai-text'] }],
|
|
24
|
-
h: [{ h: ['control', 'control-xs', 'control-sm', 'control-lg'] }],
|
|
25
|
-
w: [{ w: ['control', 'control-xs', 'control-sm', 'control-lg'] }],
|
|
26
|
-
size: [{ size: ['control', 'control-xs', 'control-sm', 'control-lg'] }],
|
|
27
|
-
'bg-color': [{ bg: ['fill-0', 'fill-1', 'fill-2', 'fill-3'] }],
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export function cn(...inputs: ClassValue[]) {
|
|
33
|
-
return twMerge(clsx(inputs));
|
|
34
|
-
}
|