@rise-x/apps-sdk 0.7.0 → 0.9.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 +104 -1
- package/build/rsbuild/index.d.ts +31 -0
- package/build/rsbuild/index.js +204 -0
- package/build/ui/components/accordion.d.ts +7 -0
- package/build/ui/components/app-frame.d.ts +13 -0
- package/build/ui/components/aspect-ratio.d.ts +4 -0
- package/build/ui/components/button-group.d.ts +7 -0
- package/build/ui/components/carousel.d.ts +18 -0
- package/build/ui/components/chart.d.ts +45 -94
- package/build/ui/components/collapsible.d.ts +6 -0
- package/build/ui/components/combobox.d.ts +19 -0
- package/build/ui/components/command.d.ts +18 -0
- package/build/ui/components/context-menu.d.ts +29 -0
- package/build/ui/components/date-picker.d.ts +16 -0
- package/build/ui/components/direction.d.ts +6 -0
- package/build/ui/components/field.d.ts +25 -0
- package/build/ui/components/hover-card.d.ts +6 -0
- package/build/ui/components/input-group.d.ts +13 -0
- package/build/ui/components/input-otp.d.ts +34 -0
- package/build/ui/components/input.d.ts +1 -3
- package/build/ui/components/item.d.ts +23 -0
- package/build/ui/components/kbd.d.ts +4 -0
- package/build/ui/components/menubar.d.ts +26 -0
- package/build/ui/components/message-scroller.d.ts +15 -0
- package/build/ui/components/nav.d.ts +2 -1
- package/build/ui/components/navigation-menu.d.ts +13 -0
- package/build/ui/components/page-header.d.ts +7 -1
- package/build/ui/index.d.ts +20 -0
- package/build/ui/reference/components/accordion.tsx +85 -0
- package/build/ui/reference/components/ai.tsx +3 -1
- package/build/ui/reference/components/alert-dialog.tsx +10 -16
- package/build/ui/reference/components/app-frame.tsx +71 -0
- package/build/ui/reference/components/aspect-ratio.tsx +28 -0
- package/build/ui/reference/components/button-group.tsx +77 -0
- package/build/ui/reference/components/button.tsx +4 -2
- package/build/ui/reference/components/carousel.tsx +248 -0
- package/build/ui/reference/components/chart.tsx +441 -1131
- package/build/ui/reference/components/collapsible.tsx +43 -0
- package/build/ui/reference/components/combobox.tsx +146 -0
- package/build/ui/reference/components/command.tsx +181 -0
- package/build/ui/reference/components/context-menu.tsx +243 -0
- package/build/ui/reference/components/data-table.tsx +3 -3
- package/build/ui/reference/components/date-picker.tsx +218 -0
- package/build/ui/reference/components/dialog.tsx +3 -3
- package/build/ui/reference/components/direction.tsx +22 -0
- package/build/ui/reference/components/dropdown-menu.tsx +1 -1
- package/build/ui/reference/components/field.tsx +252 -0
- package/build/ui/reference/components/hover-card.tsx +64 -0
- package/build/ui/reference/components/input-group.tsx +157 -0
- package/build/ui/reference/components/input-otp.tsx +106 -0
- package/build/ui/reference/components/input.tsx +4 -32
- package/build/ui/reference/components/item.tsx +188 -0
- package/build/ui/reference/components/kbd.tsx +43 -0
- package/build/ui/reference/components/label.tsx +1 -1
- package/build/ui/reference/components/menubar.tsx +275 -0
- package/build/ui/reference/components/message-scroller.tsx +141 -0
- package/build/ui/reference/components/message.tsx +12 -6
- package/build/ui/reference/components/nav.tsx +14 -3
- package/build/ui/reference/components/navigation-menu.tsx +191 -0
- package/build/ui/reference/components/page-header.tsx +32 -0
- package/build/ui/reference/components/popover.tsx +2 -2
- package/build/ui/reference/components/select.tsx +11 -8
- package/build/ui/reference/components/sheet.tsx +10 -2
- package/build/ui/reference/components/timeline.tsx +7 -0
- package/build/ui/reference/components/toggle.tsx +1 -1
- package/build/ui/reference/index.ts +20 -0
- package/build/ui/standalone.js +167 -28
- package/build/ui/styles.css +1 -1
- package/package.json +27 -2
- package/rsbuild/package.json +8 -0
- package/template/AGENTS.md +15 -7
- package/template/src/App.tsx +18 -11
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ClockIcon } from 'lucide-react';
|
|
2
3
|
|
|
3
4
|
import { cn } from '@rise-x/ui/lib/utils';
|
|
5
|
+
import { Button } from '@rise-x/ui/components/button';
|
|
4
6
|
|
|
5
7
|
/*
|
|
6
8
|
* PAGE HEADER. Title, optional back-link, subtitle, actions, and tabs that sit
|
|
@@ -102,6 +104,35 @@ function PageHeaderActions({ className, ...props }: React.ComponentProps<'div'>)
|
|
|
102
104
|
return <div data-slot="page-header-actions" className={cn('flex gap-2', className)} {...props} />;
|
|
103
105
|
}
|
|
104
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
|
+
|
|
105
136
|
/* Tabs as an underline on the header rule, not a segmented control. A segmented
|
|
106
137
|
* control says "filter this view"; an underlined tab says "this is a different
|
|
107
138
|
* view of the same thing", which is what a page-level tab is. */
|
|
@@ -203,6 +234,7 @@ export {
|
|
|
203
234
|
PageHeaderTitle,
|
|
204
235
|
PageHeaderSubtitle,
|
|
205
236
|
PageHeaderActions,
|
|
237
|
+
PageHeaderActivity,
|
|
206
238
|
PageHeaderTabs,
|
|
207
239
|
PageHeaderTab,
|
|
208
240
|
Toolbar,
|
|
@@ -26,7 +26,7 @@ function PopoverContent({
|
|
|
26
26
|
align={align}
|
|
27
27
|
sideOffset={sideOffset}
|
|
28
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-
|
|
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
30
|
className,
|
|
31
31
|
)}
|
|
32
32
|
{...props}
|
|
@@ -43,7 +43,7 @@ function PopoverHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
43
43
|
return (
|
|
44
44
|
<div
|
|
45
45
|
data-slot="popover-header"
|
|
46
|
-
className={cn('flex flex-col gap-1 text-
|
|
46
|
+
className={cn('flex flex-col gap-1 text-ui', className)}
|
|
47
47
|
{...props}
|
|
48
48
|
/>
|
|
49
49
|
);
|
|
@@ -14,7 +14,7 @@ function SelectGroup({ className, ...props }: React.ComponentProps<typeof Select
|
|
|
14
14
|
return (
|
|
15
15
|
<SelectPrimitive.Group
|
|
16
16
|
data-slot="select-group"
|
|
17
|
-
className={cn('scroll-my-1.5
|
|
17
|
+
className={cn('scroll-my-1.5', className)}
|
|
18
18
|
{...props}
|
|
19
19
|
/>
|
|
20
20
|
);
|
|
@@ -53,8 +53,11 @@ function SelectTrigger({
|
|
|
53
53
|
function SelectContent({
|
|
54
54
|
className,
|
|
55
55
|
children,
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
/* popper, not radix's item-aligned default: every other menu in the kit
|
|
57
|
+
* (dropdown, combobox, date picker) opens BELOW its trigger — a select that
|
|
58
|
+
* overlays its own trigger and the labels around it is the odd one out. */
|
|
59
|
+
position = 'popper',
|
|
60
|
+
align = 'start',
|
|
58
61
|
...props
|
|
59
62
|
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
60
63
|
return (
|
|
@@ -63,7 +66,10 @@ function SelectContent({
|
|
|
63
66
|
data-slot="select-content"
|
|
64
67
|
data-align-trigger={position === 'item-aligned'}
|
|
65
68
|
className={cn(
|
|
66
|
-
|
|
69
|
+
/* p-1.5 matches every other menu surface (dropdown, context,
|
|
70
|
+
* menubar, command) — without it the rounded-md items sit flush
|
|
71
|
+
* against the rounded-xl edge and clip at the corners. */
|
|
72
|
+
'relative z-50 max-h-(--radix-select-content-available-height) w-(--radix-select-trigger-width) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl bg-popover p-1.5 text-popover-foreground shadow-pop duration-100 data-[align-trigger=true]:animate-none 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',
|
|
67
73
|
position === 'popper' &&
|
|
68
74
|
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
69
75
|
className,
|
|
@@ -75,10 +81,7 @@ function SelectContent({
|
|
|
75
81
|
<SelectScrollUpButton />
|
|
76
82
|
<SelectPrimitive.Viewport
|
|
77
83
|
data-position={position}
|
|
78
|
-
className=
|
|
79
|
-
'data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)',
|
|
80
|
-
position === 'popper' && '',
|
|
81
|
-
)}
|
|
84
|
+
className="data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)"
|
|
82
85
|
>
|
|
83
86
|
{children}
|
|
84
87
|
</SelectPrimitive.Viewport>
|
|
@@ -18,6 +18,14 @@ import { XIcon } from 'lucide-react';
|
|
|
18
18
|
* "Function components cannot be given refs" warning on every open. Only Sheet
|
|
19
19
|
* (Root) and SheetPortal are left as plain functions: neither renders a DOM
|
|
20
20
|
* node, and radix's own are plain too.
|
|
21
|
+
*
|
|
22
|
+
* WHEN. The Sheet is the surface for ON-DEMAND supplementary content — the
|
|
23
|
+
* activity log, an asset render, any "show me more about this" data. It opens
|
|
24
|
+
* from an affordance in the page header (the activity icon button is the
|
|
25
|
+
* canonical case), slides in from the right and dims the page behind it, with
|
|
26
|
+
* any filter or search living inside the panel. The docked Panel (nav.tsx) is
|
|
27
|
+
* only for surfaces that are part of the page's own layout — a persistent
|
|
28
|
+
* master-detail pane or a filter rail — where the page must stay interactive.
|
|
21
29
|
*/
|
|
22
30
|
|
|
23
31
|
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
@@ -51,7 +59,7 @@ const SheetOverlay = React.forwardRef<
|
|
|
51
59
|
ref={ref}
|
|
52
60
|
data-slot="sheet-overlay"
|
|
53
61
|
className={cn(
|
|
54
|
-
'fixed inset-0 z-50 bg-black/30 duration-100 supports-backdrop-filter:backdrop-blur-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0',
|
|
62
|
+
'fixed inset-0 z-50 bg-black/30 duration-100 dark:bg-black/60 supports-backdrop-filter:backdrop-blur-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0',
|
|
55
63
|
className,
|
|
56
64
|
)}
|
|
57
65
|
{...props}
|
|
@@ -158,7 +166,7 @@ const SheetDescription = React.forwardRef<
|
|
|
158
166
|
<SheetPrimitive.Description
|
|
159
167
|
ref={ref}
|
|
160
168
|
data-slot="sheet-description"
|
|
161
|
-
className={cn('text-
|
|
169
|
+
className={cn('text-ui text-muted-foreground', className)}
|
|
162
170
|
{...props}
|
|
163
171
|
/>
|
|
164
172
|
);
|
|
@@ -11,6 +11,13 @@ import { cn } from '@rise-x/ui/lib/utils';
|
|
|
11
11
|
*
|
|
12
12
|
* The rail is drawn on the node's ::after rather than as a border on the row,
|
|
13
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.
|
|
14
21
|
*/
|
|
15
22
|
function Timeline({ className, ...props }: React.ComponentProps<'ol'>) {
|
|
16
23
|
return <ol data-slot="timeline" className={cn('flex flex-col', className)} {...props} />;
|
|
@@ -7,7 +7,7 @@ import { Toggle as TogglePrimitive } from 'radix-ui';
|
|
|
7
7
|
import { cn } from '@rise-x/ui/lib/utils';
|
|
8
8
|
|
|
9
9
|
const toggleVariants = cva(
|
|
10
|
-
"group/toggle inline-flex items-center justify-center gap-1 rounded-md text-
|
|
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
11
|
{
|
|
12
12
|
variants: {
|
|
13
13
|
variant: {
|
|
@@ -1,27 +1,47 @@
|
|
|
1
1
|
// Root barrel — lets consumers `import { Button, cn } from '@rise-x/ui'`.
|
|
2
2
|
// Subpath imports (`@rise-x/ui/components/button`) remain the canonical form
|
|
3
3
|
// written by the shadcn CLI; both resolve to the same source modules.
|
|
4
|
+
export * from './components/accordion';
|
|
4
5
|
export * from './components/ai';
|
|
5
6
|
export * from './components/alert';
|
|
6
7
|
export * from './components/alert-dialog';
|
|
8
|
+
export * from './components/app-frame';
|
|
9
|
+
export * from './components/aspect-ratio';
|
|
7
10
|
export * from './components/avatar';
|
|
8
11
|
export * from './components/badge';
|
|
9
12
|
export * from './components/button';
|
|
13
|
+
export * from './components/button-group';
|
|
10
14
|
export * from './components/calendar';
|
|
11
15
|
export * from './components/card';
|
|
16
|
+
export * from './components/carousel';
|
|
12
17
|
export * from './components/chart';
|
|
13
18
|
export * from './components/checkbox';
|
|
19
|
+
export * from './components/collapsible';
|
|
20
|
+
export * from './components/combobox';
|
|
21
|
+
export * from './components/command';
|
|
22
|
+
export * from './components/context-menu';
|
|
14
23
|
export * from './components/data-table';
|
|
24
|
+
export * from './components/date-picker';
|
|
15
25
|
export * from './components/dialog';
|
|
26
|
+
export * from './components/direction';
|
|
16
27
|
export * from './components/dropdown-menu';
|
|
17
28
|
export * from './components/empty-state';
|
|
29
|
+
export * from './components/field';
|
|
18
30
|
export * from './components/file-upload';
|
|
31
|
+
export * from './components/hover-card';
|
|
19
32
|
export * from './components/input';
|
|
33
|
+
export * from './components/input-group';
|
|
34
|
+
export * from './components/input-otp';
|
|
35
|
+
export * from './components/item';
|
|
36
|
+
export * from './components/kbd';
|
|
20
37
|
export * from './components/label';
|
|
21
38
|
export * from './components/list';
|
|
22
39
|
export * from './components/map';
|
|
40
|
+
export * from './components/menubar';
|
|
23
41
|
export * from './components/message';
|
|
42
|
+
export * from './components/message-scroller';
|
|
24
43
|
export * from './components/nav';
|
|
44
|
+
export * from './components/navigation-menu';
|
|
25
45
|
export * from './components/page-header';
|
|
26
46
|
export * from './components/popover';
|
|
27
47
|
export * from './components/progress';
|