@rise-x/apps-sdk 0.9.0 → 0.11.1
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 +117 -32
- package/build/rsbuild/index.d.ts +6 -1
- package/build/rsbuild/index.js +24 -3
- package/build/ui/classes.json +209 -0
- package/build/ui/components/ai.d.ts +33 -1
- package/build/ui/components/app-frame.d.ts +16 -10
- package/build/ui/components/chat-input.d.ts +28 -0
- package/build/ui/components/message-scroller.d.ts +34 -10
- 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 +2 -0
- package/build/ui/standalone.js +60 -58
- package/build/ui/styles.css +1 -1
- package/package.json +4 -3
- package/template/AGENTS.md +3 -3
- package/template/README.md +5 -5
- package/template/package.json +8 -9
- package/template/rsbuild.config.mts +17 -0
- package/template/src/App.tsx +4 -1
- 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 -293
- package/build/ui/reference/components/alert-dialog.tsx +0 -207
- package/build/ui/reference/components/alert.tsx +0 -112
- package/build/ui/reference/components/app-frame.tsx +0 -71
- 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 -109
- 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 -146
- 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 -177
- package/build/ui/reference/components/nav.tsx +0 -127
- 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 -69
- 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,127 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from 'radix-ui';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@rise-x/ui/lib/utils';
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* Sidebar navigation. A borderless list, not a panel: the active item is a fill
|
|
8
|
-
* plus a brand-tinted icon, with NO left rail. A rail is a one-sided border, and
|
|
9
|
-
* a one-sided border reads as something stuck to the row rather than part of it —
|
|
10
|
-
* the same reason status cards use a glyph instead of an edge stripe.
|
|
11
|
-
*
|
|
12
|
-
* Brand appears on the active icon only. In single-select navigation there is
|
|
13
|
-
* exactly one at a time, so it cannot swamp the view the way brand-as-selection
|
|
14
|
-
* does in a multi-select table.
|
|
15
|
-
*/
|
|
16
|
-
function Nav({ className, ...props }: React.ComponentProps<'nav'>) {
|
|
17
|
-
return <nav data-slot="nav" className={cn('flex flex-col gap-px', className)} {...props} />;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function NavItem({
|
|
21
|
-
className,
|
|
22
|
-
current,
|
|
23
|
-
asChild = false,
|
|
24
|
-
...props
|
|
25
|
-
}: React.ComponentProps<'button'> & { current?: boolean; asChild?: boolean }) {
|
|
26
|
-
// asChild renders the item styling onto a link (router <Link>, <a>) so
|
|
27
|
-
// navigation stays cmd/middle-clickable; the default stays a real button.
|
|
28
|
-
const Comp = asChild ? Slot.Root : 'button';
|
|
29
|
-
return (
|
|
30
|
-
<Comp
|
|
31
|
-
type={asChild ? undefined : 'button'}
|
|
32
|
-
data-slot="nav-item"
|
|
33
|
-
aria-current={current ? 'page' : undefined}
|
|
34
|
-
className={cn(
|
|
35
|
-
'flex h-[30px] w-full cursor-pointer items-center gap-2 rounded-md border-0 bg-transparent px-2 text-left text-ui text-muted-foreground transition-colors duration-150 ease-decelerate',
|
|
36
|
-
'hover:bg-muted hover:text-foreground',
|
|
37
|
-
// Same focus treatment as every other operable control in the kit
|
|
38
|
-
// (Button, Input, SegmentedItem): the neutral ring, not the brand one.
|
|
39
|
-
'outline-none focus-visible:ring-3 focus-visible:ring-ring-control/35',
|
|
40
|
-
'aria-[current=page]:bg-muted aria-[current=page]:font-medium aria-[current=page]:text-foreground',
|
|
41
|
-
'[&>svg]:size-[15px] [&>svg]:shrink-0 [&>svg]:opacity-85',
|
|
42
|
-
'aria-[current=page]:[&>svg]:text-brand-text aria-[current=page]:[&>svg]:opacity-100',
|
|
43
|
-
'[&>[data-slot=badge]]:ml-auto',
|
|
44
|
-
className,
|
|
45
|
-
)}
|
|
46
|
-
{...props}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function NavSection({ className, ...props }: React.ComponentProps<'div'>) {
|
|
52
|
-
return (
|
|
53
|
-
<div
|
|
54
|
-
data-slot="nav-section"
|
|
55
|
-
className={cn(
|
|
56
|
-
'px-2 pt-3.5 pb-1 text-micro tracking-[0.04em] text-subtle uppercase',
|
|
57
|
-
className,
|
|
58
|
-
)}
|
|
59
|
-
{...props}
|
|
60
|
-
/>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/*
|
|
65
|
-
* SIDEBAR PANEL — the detail pane beside a list. Floats with a margin rather
|
|
66
|
-
* than butting against the window edge, so the page background shows through on
|
|
67
|
-
* all four sides and the panel reads as a separate object.
|
|
68
|
-
*
|
|
69
|
-
* This is for surfaces that are PART OF THE PAGE's layout — a persistent
|
|
70
|
-
* master-detail pane, a filter rail — where the rest of the page stays
|
|
71
|
-
* interactive. For on-demand context (the activity log, an asset render, any
|
|
72
|
-
* supplementary data) do not dock a Panel into the layout: open a Sheet from
|
|
73
|
-
* the page header instead (see sheet.tsx).
|
|
74
|
-
*/
|
|
75
|
-
function Panel({ className, ...props }: React.ComponentProps<'aside'>) {
|
|
76
|
-
return (
|
|
77
|
-
<aside
|
|
78
|
-
data-slot="panel"
|
|
79
|
-
className={cn(
|
|
80
|
-
'flex w-[262px] shrink-0 flex-col overflow-hidden rounded-2xl bg-card shadow-card',
|
|
81
|
-
className,
|
|
82
|
-
)}
|
|
83
|
-
{...props}
|
|
84
|
-
/>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function PanelHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
89
|
-
return (
|
|
90
|
-
<div
|
|
91
|
-
data-slot="panel-header"
|
|
92
|
-
className={cn(
|
|
93
|
-
'flex items-center gap-2 border-b border-border-subtle px-3.5 py-3 [&>[data-slot=button]:last-child]:ml-auto',
|
|
94
|
-
className,
|
|
95
|
-
)}
|
|
96
|
-
{...props}
|
|
97
|
-
/>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function PanelTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
102
|
-
return (
|
|
103
|
-
<div data-slot="panel-title" className={cn('text-ui font-medium', className)} {...props} />
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function PanelBody({ className, ...props }: React.ComponentProps<'div'>) {
|
|
108
|
-
return (
|
|
109
|
-
<div
|
|
110
|
-
data-slot="panel-body"
|
|
111
|
-
className={cn('flex-1 overflow-y-auto p-3.5', className)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function PanelFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
118
|
-
return (
|
|
119
|
-
<div
|
|
120
|
-
data-slot="panel-footer"
|
|
121
|
-
className={cn('flex gap-2 border-t border-border-subtle p-3.5', className)}
|
|
122
|
-
{...props}
|
|
123
|
-
/>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export { Nav, NavItem, NavSection, Panel, PanelHeader, PanelTitle, PanelBody, PanelFooter };
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { NavigationMenu as NavigationMenuPrimitive } from 'radix-ui';
|
|
5
|
-
import { ChevronDownIcon } from 'lucide-react';
|
|
6
|
-
|
|
7
|
-
import { cn } from '@rise-x/ui/lib/utils';
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
* A horizontal navigation menu with drop-down panels — the marketing-site and
|
|
11
|
-
* portal-landing shape.
|
|
12
|
-
*
|
|
13
|
-
* READ THIS BEFORE REACHING FOR IT. This is NOT how a Rise-X app navigates.
|
|
14
|
-
* App navigation is a LEFT RAIL built from `Nav`, and a federated app must never
|
|
15
|
-
* render a top bar at any width, because the host already renders one above every
|
|
16
|
-
* app. Two nav bars stacked is the exact thing that rule exists to prevent.
|
|
17
|
-
*
|
|
18
|
-
* So this component is for the surfaces that are not apps: a public site, a
|
|
19
|
-
* sign-in shell, a documentation portal. If you are inside an app and you want
|
|
20
|
-
* this, you want `Nav` plus `PageHeaderTabs`.
|
|
21
|
-
*
|
|
22
|
-
* The trigger keeps the ghost-button grammar and the panel is Popover's surface,
|
|
23
|
-
* so it belongs to the same system even though its use is narrow.
|
|
24
|
-
*/
|
|
25
|
-
function NavigationMenu({
|
|
26
|
-
className,
|
|
27
|
-
children,
|
|
28
|
-
viewport = true,
|
|
29
|
-
...props
|
|
30
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & { viewport?: boolean }) {
|
|
31
|
-
return (
|
|
32
|
-
<NavigationMenuPrimitive.Root
|
|
33
|
-
data-slot="navigation-menu"
|
|
34
|
-
data-viewport={viewport}
|
|
35
|
-
className={cn(
|
|
36
|
-
'group/navigation-menu relative flex max-w-max flex-1 items-center justify-center',
|
|
37
|
-
className,
|
|
38
|
-
)}
|
|
39
|
-
{...props}
|
|
40
|
-
>
|
|
41
|
-
{children}
|
|
42
|
-
{viewport && <NavigationMenuViewport />}
|
|
43
|
-
</NavigationMenuPrimitive.Root>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function NavigationMenuList({
|
|
48
|
-
className,
|
|
49
|
-
...props
|
|
50
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
|
|
51
|
-
return (
|
|
52
|
-
<NavigationMenuPrimitive.List
|
|
53
|
-
data-slot="navigation-menu-list"
|
|
54
|
-
className={cn(
|
|
55
|
-
'group flex flex-1 list-none items-center justify-center gap-0.5 p-0',
|
|
56
|
-
className,
|
|
57
|
-
)}
|
|
58
|
-
{...props}
|
|
59
|
-
/>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function NavigationMenuItem({
|
|
64
|
-
className,
|
|
65
|
-
...props
|
|
66
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
|
|
67
|
-
return (
|
|
68
|
-
<NavigationMenuPrimitive.Item
|
|
69
|
-
data-slot="navigation-menu-item"
|
|
70
|
-
className={cn('relative', className)}
|
|
71
|
-
{...props}
|
|
72
|
-
/>
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function NavigationMenuTrigger({
|
|
77
|
-
className,
|
|
78
|
-
children,
|
|
79
|
-
...props
|
|
80
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
|
|
81
|
-
return (
|
|
82
|
-
<NavigationMenuPrimitive.Trigger
|
|
83
|
-
data-slot="navigation-menu-trigger"
|
|
84
|
-
className={cn(
|
|
85
|
-
'group inline-flex h-control cursor-pointer items-center justify-center gap-1.5 rounded-lg border-0 bg-transparent px-3 text-ui font-medium text-muted-foreground transition-colors duration-150 ease-decelerate outline-none select-none',
|
|
86
|
-
'hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring-control/35',
|
|
87
|
-
'data-open:bg-muted data-open:text-foreground',
|
|
88
|
-
className,
|
|
89
|
-
)}
|
|
90
|
-
{...props}
|
|
91
|
-
>
|
|
92
|
-
{children}
|
|
93
|
-
<ChevronDownIcon
|
|
94
|
-
aria-hidden
|
|
95
|
-
className="size-3 shrink-0 transition-transform duration-200 ease-decelerate group-data-open:rotate-180"
|
|
96
|
-
/>
|
|
97
|
-
</NavigationMenuPrimitive.Trigger>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function NavigationMenuContent({
|
|
102
|
-
className,
|
|
103
|
-
...props
|
|
104
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
|
|
105
|
-
return (
|
|
106
|
-
<NavigationMenuPrimitive.Content
|
|
107
|
-
data-slot="navigation-menu-content"
|
|
108
|
-
className={cn(
|
|
109
|
-
'top-0 left-0 w-full p-2.5 md:absolute md:w-auto',
|
|
110
|
-
// without a viewport the content is its own popover surface
|
|
111
|
-
'group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:min-w-48 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-xl group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow-pop group-data-[viewport=false]/navigation-menu:duration-100 group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95',
|
|
112
|
-
className,
|
|
113
|
-
)}
|
|
114
|
-
{...props}
|
|
115
|
-
/>
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/*
|
|
120
|
-
* The viewport is one shared panel every menu animates INTO, sized to whichever
|
|
121
|
-
* content is open. That is what makes the panel appear to resize between menus
|
|
122
|
-
* rather than one closing and another opening — and it is why the panel radius
|
|
123
|
-
* lives here and not on the content.
|
|
124
|
-
*/
|
|
125
|
-
function NavigationMenuViewport({
|
|
126
|
-
className,
|
|
127
|
-
...props
|
|
128
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
|
|
129
|
-
return (
|
|
130
|
-
<div className="absolute top-full left-0 isolate z-50 flex justify-center">
|
|
131
|
-
<NavigationMenuPrimitive.Viewport
|
|
132
|
-
data-slot="navigation-menu-viewport"
|
|
133
|
-
className={cn(
|
|
134
|
-
'relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full origin-top-center overflow-hidden rounded-xl bg-popover text-popover-foreground shadow-pop duration-200 md:w-(--radix-navigation-menu-viewport-width) dark:ring-foreground/10 data-open:animate-in data-open:zoom-in-90 data-closed:animate-out data-closed:zoom-out-95',
|
|
135
|
-
className,
|
|
136
|
-
)}
|
|
137
|
-
{...props}
|
|
138
|
-
/>
|
|
139
|
-
</div>
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
function NavigationMenuLink({
|
|
144
|
-
className,
|
|
145
|
-
...props
|
|
146
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
|
|
147
|
-
return (
|
|
148
|
-
<NavigationMenuPrimitive.Link
|
|
149
|
-
data-slot="navigation-menu-link"
|
|
150
|
-
className={cn(
|
|
151
|
-
'flex flex-col gap-0.5 rounded-md p-2 text-ui outline-none transition-colors duration-150 ease-decelerate',
|
|
152
|
-
'hover:bg-accent hover:text-accent-foreground focus-visible:ring-3 focus-visible:ring-ring-control/35',
|
|
153
|
-
// the current page is not muted — it is the one you are on
|
|
154
|
-
'data-[active=true]:bg-accent data-[active=true]:font-medium data-[active=true]:text-accent-foreground',
|
|
155
|
-
'[&_p]:text-xs [&_p]:font-normal [&_p]:text-muted-foreground [&_svg]:size-3.5 [&_svg]:shrink-0',
|
|
156
|
-
className,
|
|
157
|
-
)}
|
|
158
|
-
{...props}
|
|
159
|
-
/>
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/* The little arrow that tracks which trigger is open. */
|
|
164
|
-
function NavigationMenuIndicator({
|
|
165
|
-
className,
|
|
166
|
-
...props
|
|
167
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
|
|
168
|
-
return (
|
|
169
|
-
<NavigationMenuPrimitive.Indicator
|
|
170
|
-
data-slot="navigation-menu-indicator"
|
|
171
|
-
className={cn(
|
|
172
|
-
'top-full z-50 flex h-1.5 items-end justify-center overflow-hidden duration-200 data-visible:animate-in data-visible:fade-in data-hidden:animate-out data-hidden:fade-out',
|
|
173
|
-
className,
|
|
174
|
-
)}
|
|
175
|
-
{...props}
|
|
176
|
-
>
|
|
177
|
-
<div className="relative top-[60%] size-2 rotate-45 rounded-tl-[2px] bg-popover shadow-pop" />
|
|
178
|
-
</NavigationMenuPrimitive.Indicator>
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export {
|
|
183
|
-
NavigationMenu,
|
|
184
|
-
NavigationMenuList,
|
|
185
|
-
NavigationMenuItem,
|
|
186
|
-
NavigationMenuContent,
|
|
187
|
-
NavigationMenuTrigger,
|
|
188
|
-
NavigationMenuLink,
|
|
189
|
-
NavigationMenuIndicator,
|
|
190
|
-
NavigationMenuViewport,
|
|
191
|
-
};
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ClockIcon } from 'lucide-react';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@rise-x/ui/lib/utils';
|
|
5
|
-
import { Button } from '@rise-x/ui/components/button';
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
* PAGE HEADER. Title, optional back-link, subtitle, actions, and tabs that sit
|
|
9
|
-
* ON the header's bottom border rather than in a container of their own — one
|
|
10
|
-
* rule doing two jobs, which is why the header needs no second divider.
|
|
11
|
-
*
|
|
12
|
-
* The back-link goes ABOVE the title, not beside it. Beside the title it
|
|
13
|
-
* competes with it for the same line and the eye has to sort out which is the
|
|
14
|
-
* page name; above, it reads as "where I came from" and the title stays first.
|
|
15
|
-
*/
|
|
16
|
-
function PageHeader({
|
|
17
|
-
className,
|
|
18
|
-
variant = 'card',
|
|
19
|
-
...props
|
|
20
|
-
}: React.ComponentProps<'header'> & {
|
|
21
|
-
/**
|
|
22
|
-
* `card` — a white band with a bottom rule, for headers that own tabs.
|
|
23
|
-
* `bare` — sits directly ON the page background with no surface and no rule,
|
|
24
|
-
* so the content below can be a set of white tiles (metrics, tables, cards).
|
|
25
|
-
* Use this whenever the page is a dashboard rather than a single document:
|
|
26
|
-
* a white header above white tiles produces two stacked surfaces with a seam
|
|
27
|
-
* between them and nothing gained.
|
|
28
|
-
*/
|
|
29
|
-
variant?: 'card' | 'bare';
|
|
30
|
-
}) {
|
|
31
|
-
return (
|
|
32
|
-
<header
|
|
33
|
-
data-slot="page-header"
|
|
34
|
-
data-variant={variant}
|
|
35
|
-
className={cn(
|
|
36
|
-
variant === 'card' && 'border-b border-border bg-card px-5 pt-3.5',
|
|
37
|
-
variant === 'bare' && 'bg-transparent px-0 pt-0 pb-5',
|
|
38
|
-
className,
|
|
39
|
-
)}
|
|
40
|
-
{...props}
|
|
41
|
-
/>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function PageHeaderRow({ className, ...props }: React.ComponentProps<'div'>) {
|
|
46
|
-
return (
|
|
47
|
-
<div
|
|
48
|
-
data-slot="page-header-row"
|
|
49
|
-
className={cn(
|
|
50
|
-
'flex items-start gap-3 [&>[data-slot=page-header-actions]]:ml-auto',
|
|
51
|
-
className,
|
|
52
|
-
)}
|
|
53
|
-
{...props}
|
|
54
|
-
/>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function PageHeaderBack({ className, children, ...props }: React.ComponentProps<'button'>) {
|
|
59
|
-
return (
|
|
60
|
-
<button
|
|
61
|
-
type="button"
|
|
62
|
-
data-slot="page-header-back"
|
|
63
|
-
className={cn(
|
|
64
|
-
'mb-1.5 inline-flex h-[22px] items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground [&>svg]:size-3',
|
|
65
|
-
className,
|
|
66
|
-
)}
|
|
67
|
-
{...props}
|
|
68
|
-
>
|
|
69
|
-
<svg
|
|
70
|
-
viewBox="0 0 24 24"
|
|
71
|
-
fill="none"
|
|
72
|
-
stroke="currentColor"
|
|
73
|
-
strokeWidth={2.5}
|
|
74
|
-
strokeLinecap="round"
|
|
75
|
-
>
|
|
76
|
-
<path d="M15 6l-6 6 6 6" />
|
|
77
|
-
</svg>
|
|
78
|
-
{children}
|
|
79
|
-
</button>
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function PageHeaderTitle({ className, ...props }: React.ComponentProps<'h1'>) {
|
|
84
|
-
return (
|
|
85
|
-
<h1
|
|
86
|
-
data-slot="page-header-title"
|
|
87
|
-
className={cn('text-[17px] leading-tight font-medium tracking-[-0.01em]', className)}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function PageHeaderSubtitle({ className, ...props }: React.ComponentProps<'p'>) {
|
|
94
|
-
return (
|
|
95
|
-
<p
|
|
96
|
-
data-slot="page-header-subtitle"
|
|
97
|
-
className={cn('mt-0.5 text-xs text-muted-foreground', className)}
|
|
98
|
-
{...props}
|
|
99
|
-
/>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function PageHeaderActions({ className, ...props }: React.ComponentProps<'div'>) {
|
|
104
|
-
return <div data-slot="page-header-actions" className={cn('flex gap-2', className)} {...props} />;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/* The activity affordance every app ships: one icon button, always the same
|
|
108
|
-
* glyph, first in PageHeaderActions. It opens the activity log as a Sheet
|
|
109
|
-
* sliding in from the right over the dimmed page, with its filter and search
|
|
110
|
-
* inside — never an inline column beside the content (see timeline.tsx).
|
|
111
|
-
* icon-sm because header actions are sm across the system: the header is
|
|
112
|
-
* chrome, and 30px keeps it denser than the content it introduces.
|
|
113
|
-
*
|
|
114
|
-
* forwardRef for the same reason button.tsx uses it: the canonical usage is
|
|
115
|
-
* `<SheetTrigger asChild><PageHeaderActivity /></SheetTrigger>`, and radix's
|
|
116
|
-
* Slot injects a ref the React 18 host would strip from a plain function. */
|
|
117
|
-
const PageHeaderActivity = React.forwardRef<
|
|
118
|
-
HTMLButtonElement,
|
|
119
|
-
React.ComponentPropsWithoutRef<typeof Button>
|
|
120
|
-
>(function PageHeaderActivity({ className, ...props }, ref) {
|
|
121
|
-
return (
|
|
122
|
-
<Button
|
|
123
|
-
ref={ref}
|
|
124
|
-
variant="outline"
|
|
125
|
-
size="icon-sm"
|
|
126
|
-
aria-label="Activity"
|
|
127
|
-
data-slot="page-header-activity"
|
|
128
|
-
className={className}
|
|
129
|
-
{...props}
|
|
130
|
-
>
|
|
131
|
-
<ClockIcon />
|
|
132
|
-
</Button>
|
|
133
|
-
);
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
/* Tabs as an underline on the header rule, not a segmented control. A segmented
|
|
137
|
-
* control says "filter this view"; an underlined tab says "this is a different
|
|
138
|
-
* view of the same thing", which is what a page-level tab is. */
|
|
139
|
-
function PageHeaderTabs({ className, ...props }: React.ComponentProps<'div'>) {
|
|
140
|
-
return (
|
|
141
|
-
<div
|
|
142
|
-
data-slot="page-header-tabs"
|
|
143
|
-
role="tablist"
|
|
144
|
-
className={cn('-mb-px mt-3 flex gap-[18px]', className)}
|
|
145
|
-
{...props}
|
|
146
|
-
/>
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function PageHeaderTab({
|
|
151
|
-
className,
|
|
152
|
-
selected,
|
|
153
|
-
...props
|
|
154
|
-
}: React.ComponentProps<'button'> & { selected?: boolean }) {
|
|
155
|
-
return (
|
|
156
|
-
<button
|
|
157
|
-
type="button"
|
|
158
|
-
role="tab"
|
|
159
|
-
data-slot="page-header-tab"
|
|
160
|
-
aria-selected={selected}
|
|
161
|
-
className={cn(
|
|
162
|
-
'h-[34px] border-0 bg-transparent px-px text-ui text-muted-foreground transition-colors outline-none hover:text-foreground',
|
|
163
|
-
'aria-selected:font-medium aria-selected:text-foreground aria-selected:shadow-[inset_0_-1px_0_var(--foreground)]',
|
|
164
|
-
className,
|
|
165
|
-
)}
|
|
166
|
-
{...props}
|
|
167
|
-
/>
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/* TOOLBAR — the row above a data view. Wraps rather than scrolling sideways: a
|
|
172
|
-
* horizontally scrolling filter bar hides the filters that are applied. */
|
|
173
|
-
function Toolbar({ className, ...props }: React.ComponentProps<'div'>) {
|
|
174
|
-
return (
|
|
175
|
-
<div
|
|
176
|
-
data-slot="toolbar"
|
|
177
|
-
className={cn(
|
|
178
|
-
'flex flex-wrap items-center gap-2 [&>[data-slot=toolbar-end]]:ml-auto',
|
|
179
|
-
className,
|
|
180
|
-
)}
|
|
181
|
-
{...props}
|
|
182
|
-
/>
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function ToolbarEnd({ className, ...props }: React.ComponentProps<'div'>) {
|
|
187
|
-
return <div data-slot="toolbar-end" className={cn('flex gap-2', className)} {...props} />;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
function ToolbarSeparator({ className, ...props }: React.ComponentProps<'span'>) {
|
|
191
|
-
return (
|
|
192
|
-
<span
|
|
193
|
-
data-slot="toolbar-separator"
|
|
194
|
-
aria-hidden
|
|
195
|
-
className={cn('h-5 w-px shrink-0 bg-border', className)}
|
|
196
|
-
{...props}
|
|
197
|
-
/>
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/* Breadcrumbs. The current page is not a link and is not muted — it is the one
|
|
202
|
-
* item you are actually on. */
|
|
203
|
-
function Breadcrumbs({ className, ...props }: React.ComponentProps<'nav'>) {
|
|
204
|
-
return (
|
|
205
|
-
<nav
|
|
206
|
-
data-slot="breadcrumbs"
|
|
207
|
-
aria-label="Breadcrumb"
|
|
208
|
-
className={cn(
|
|
209
|
-
'flex items-center gap-1.5 text-xs text-muted-foreground [&>[aria-current]]:font-medium [&>[aria-current]]:text-foreground',
|
|
210
|
-
className,
|
|
211
|
-
)}
|
|
212
|
-
{...props}
|
|
213
|
-
/>
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function BreadcrumbSeparator({ className, ...props }: React.ComponentProps<'span'>) {
|
|
218
|
-
return (
|
|
219
|
-
<span
|
|
220
|
-
data-slot="breadcrumb-separator"
|
|
221
|
-
aria-hidden
|
|
222
|
-
className={cn('text-subtle', className)}
|
|
223
|
-
{...props}
|
|
224
|
-
>
|
|
225
|
-
/
|
|
226
|
-
</span>
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
export {
|
|
231
|
-
PageHeader,
|
|
232
|
-
PageHeaderRow,
|
|
233
|
-
PageHeaderBack,
|
|
234
|
-
PageHeaderTitle,
|
|
235
|
-
PageHeaderSubtitle,
|
|
236
|
-
PageHeaderActions,
|
|
237
|
-
PageHeaderActivity,
|
|
238
|
-
PageHeaderTabs,
|
|
239
|
-
PageHeaderTab,
|
|
240
|
-
Toolbar,
|
|
241
|
-
ToolbarEnd,
|
|
242
|
-
ToolbarSeparator,
|
|
243
|
-
Breadcrumbs,
|
|
244
|
-
BreadcrumbSeparator,
|
|
245
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Popover as PopoverPrimitive } from 'radix-ui';
|
|
5
|
-
|
|
6
|
-
import { cn } from '@rise-x/ui/lib/utils';
|
|
7
|
-
|
|
8
|
-
function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
9
|
-
return <PopoverPrimitive.Root data-slot="popover" {...props} />;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
13
|
-
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function PopoverContent({
|
|
17
|
-
className,
|
|
18
|
-
align = 'center',
|
|
19
|
-
sideOffset = 4,
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
22
|
-
return (
|
|
23
|
-
<PopoverPrimitive.Portal>
|
|
24
|
-
<PopoverPrimitive.Content
|
|
25
|
-
data-slot="popover-content"
|
|
26
|
-
align={align}
|
|
27
|
-
sideOffset={sideOffset}
|
|
28
|
-
className={cn(
|
|
29
|
-
'z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-4 rounded-xl bg-popover p-4 text-ui text-popover-foreground shadow-pop outline-hidden duration-100 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-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',
|
|
30
|
-
className,
|
|
31
|
-
)}
|
|
32
|
-
{...props}
|
|
33
|
-
/>
|
|
34
|
-
</PopoverPrimitive.Portal>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
39
|
-
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function PopoverHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
43
|
-
return (
|
|
44
|
-
<div
|
|
45
|
-
data-slot="popover-header"
|
|
46
|
-
className={cn('flex flex-col gap-1 text-ui', className)}
|
|
47
|
-
{...props}
|
|
48
|
-
/>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function PopoverTitle({ className, ...props }: React.ComponentProps<'h2'>) {
|
|
53
|
-
return (
|
|
54
|
-
<div data-slot="popover-title" className={cn('text-ui font-medium', className)} {...props} />
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function PopoverDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
59
|
-
return (
|
|
60
|
-
<p
|
|
61
|
-
data-slot="popover-description"
|
|
62
|
-
className={cn('text-muted-foreground', className)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export {
|
|
69
|
-
Popover,
|
|
70
|
-
PopoverAnchor,
|
|
71
|
-
PopoverContent,
|
|
72
|
-
PopoverDescription,
|
|
73
|
-
PopoverHeader,
|
|
74
|
-
PopoverTitle,
|
|
75
|
-
PopoverTrigger,
|
|
76
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Progress as ProgressPrimitive } from 'radix-ui';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@rise-x/ui/lib/utils';
|
|
5
|
-
|
|
6
|
-
function Progress({
|
|
7
|
-
className,
|
|
8
|
-
value,
|
|
9
|
-
...props
|
|
10
|
-
}: React.ComponentProps<typeof ProgressPrimitive.Root>) {
|
|
11
|
-
return (
|
|
12
|
-
<ProgressPrimitive.Root
|
|
13
|
-
data-slot="progress"
|
|
14
|
-
className={cn(
|
|
15
|
-
// --muted (#f5f5f5) is invisible on a white card; the translucent fill
|
|
16
|
-
// reads on white, on grey and in dark without a second token
|
|
17
|
-
'relative flex h-1.5 w-full items-center overflow-x-hidden rounded-full bg-fill-2',
|
|
18
|
-
className,
|
|
19
|
-
)}
|
|
20
|
-
{...props}
|
|
21
|
-
>
|
|
22
|
-
<ProgressPrimitive.Indicator
|
|
23
|
-
data-slot="progress-indicator"
|
|
24
|
-
className="size-full flex-1 bg-primary transition-all"
|
|
25
|
-
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
26
|
-
/>
|
|
27
|
-
</ProgressPrimitive.Root>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { Progress };
|