@rise-x/apps-sdk 0.6.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.
Files changed (185) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +553 -0
  3. package/build/_internal.d.ts +2 -0
  4. package/build/_internal.js +23 -0
  5. package/build/accessors.d.ts +8 -0
  6. package/build/accessors.js +40 -0
  7. package/build/cli/index.d.ts +13 -0
  8. package/build/cli/index.js +54 -0
  9. package/build/cli/init.d.ts +6 -0
  10. package/build/cli/init.js +179 -0
  11. package/build/cli/templating.d.ts +2 -0
  12. package/build/cli/templating.js +84 -0
  13. package/build/connectors/agents.d.ts +85 -0
  14. package/build/connectors/agents.js +404 -0
  15. package/build/connectors/assets.d.ts +76 -0
  16. package/build/connectors/assets.js +204 -0
  17. package/build/connectors/deps.d.ts +4 -0
  18. package/build/connectors/deps.js +2 -0
  19. package/build/connectors/errors.d.ts +11 -0
  20. package/build/connectors/errors.js +67 -0
  21. package/build/connectors/flows.d.ts +37 -0
  22. package/build/connectors/flows.js +191 -0
  23. package/build/connectors/index.d.ts +8 -0
  24. package/build/connectors/index.js +50 -0
  25. package/build/connectors/sse.d.ts +12 -0
  26. package/build/connectors/sse.js +157 -0
  27. package/build/connectors/types.d.ts +285 -0
  28. package/build/connectors/types.js +419 -0
  29. package/build/connectors/work.d.ts +84 -0
  30. package/build/connectors/work.js +224 -0
  31. package/build/hooks.d.ts +4 -0
  32. package/build/hooks.js +28 -0
  33. package/build/index.d.ts +6 -0
  34. package/build/index.js +34 -0
  35. package/build/lifecycle.d.ts +23 -0
  36. package/build/lifecycle.js +6 -0
  37. package/build/mockShell.d.ts +10 -0
  38. package/build/mockShell.js +55 -0
  39. package/build/query/agents.d.ts +80 -0
  40. package/build/query/agents.js +143 -0
  41. package/build/query/assets.d.ts +73 -0
  42. package/build/query/assets.js +152 -0
  43. package/build/query/client.d.ts +5 -0
  44. package/build/query/client.js +68 -0
  45. package/build/query/context.d.ts +2 -0
  46. package/build/query/context.js +34 -0
  47. package/build/query/flows.d.ts +54 -0
  48. package/build/query/flows.js +81 -0
  49. package/build/query/index.d.ts +10 -0
  50. package/build/query/index.js +85 -0
  51. package/build/query/keys.d.ts +51 -0
  52. package/build/query/keys.js +79 -0
  53. package/build/query/layer.d.ts +175 -0
  54. package/build/query/layer.js +35 -0
  55. package/build/query/shared.d.ts +43 -0
  56. package/build/query/shared.js +116 -0
  57. package/build/query/work.d.ts +75 -0
  58. package/build/query/work.js +172 -0
  59. package/build/shell/index.d.ts +1 -0
  60. package/build/shell/index.js +6 -0
  61. package/build/shell/installShellBridge.d.ts +11 -0
  62. package/build/shell/installShellBridge.js +104 -0
  63. package/build/shellBridge.d.ts +36 -0
  64. package/build/shellBridge.js +10 -0
  65. package/build/topBar.d.ts +25 -0
  66. package/build/topBar.js +17 -0
  67. package/build/ui/components/ai.d.ts +49 -0
  68. package/build/ui/components/alert-dialog.d.ts +27 -0
  69. package/build/ui/components/alert.d.ts +14 -0
  70. package/build/ui/components/avatar.d.ts +17 -0
  71. package/build/ui/components/badge.d.ts +19 -0
  72. package/build/ui/components/button.d.ts +13 -0
  73. package/build/ui/components/calendar.d.ts +21 -0
  74. package/build/ui/components/card.d.ts +16 -0
  75. package/build/ui/components/chart.d.ts +124 -0
  76. package/build/ui/components/checkbox.d.ts +4 -0
  77. package/build/ui/components/data-table.d.ts +70 -0
  78. package/build/ui/components/dialog.d.ts +17 -0
  79. package/build/ui/components/dropdown-menu.d.ts +29 -0
  80. package/build/ui/components/empty-state.d.ts +7 -0
  81. package/build/ui/components/file-upload.d.ts +17 -0
  82. package/build/ui/components/input.d.ts +8 -0
  83. package/build/ui/components/label.d.ts +4 -0
  84. package/build/ui/components/list.d.ts +24 -0
  85. package/build/ui/components/map.d.ts +26 -0
  86. package/build/ui/components/message.d.ts +24 -0
  87. package/build/ui/components/nav.d.ts +12 -0
  88. package/build/ui/components/page-header.d.ts +27 -0
  89. package/build/ui/components/popover.d.ts +10 -0
  90. package/build/ui/components/progress.d.ts +4 -0
  91. package/build/ui/components/radio.d.ts +6 -0
  92. package/build/ui/components/resizable.d.ts +7 -0
  93. package/build/ui/components/scroll-area.d.ts +5 -0
  94. package/build/ui/components/segmented.d.ts +6 -0
  95. package/build/ui/components/select.d.ts +15 -0
  96. package/build/ui/components/separator.d.ts +4 -0
  97. package/build/ui/components/sheet.d.ts +14 -0
  98. package/build/ui/components/skeleton.d.ts +3 -0
  99. package/build/ui/components/slider.d.ts +15 -0
  100. package/build/ui/components/snackbar.d.ts +3 -0
  101. package/build/ui/components/sonner.d.ts +4 -0
  102. package/build/ui/components/spinner.d.ts +5 -0
  103. package/build/ui/components/statistic.d.ts +19 -0
  104. package/build/ui/components/stepper.d.ts +12 -0
  105. package/build/ui/components/switch.d.ts +6 -0
  106. package/build/ui/components/table.d.ts +24 -0
  107. package/build/ui/components/textarea.d.ts +3 -0
  108. package/build/ui/components/timeline.d.ts +15 -0
  109. package/build/ui/components/toggle-group.d.ts +10 -0
  110. package/build/ui/components/toggle.d.ts +9 -0
  111. package/build/ui/components/tooltip.d.ts +7 -0
  112. package/build/ui/index.d.ts +46 -0
  113. package/build/ui/index.js +8 -0
  114. package/build/ui/lib/utils.d.ts +2 -0
  115. package/build/ui/reference/README.md +11 -0
  116. package/build/ui/reference/components/ai.tsx +291 -0
  117. package/build/ui/reference/components/alert-dialog.tsx +208 -0
  118. package/build/ui/reference/components/alert.tsx +112 -0
  119. package/build/ui/reference/components/avatar.tsx +158 -0
  120. package/build/ui/reference/components/badge.tsx +160 -0
  121. package/build/ui/reference/components/button.tsx +100 -0
  122. package/build/ui/reference/components/calendar.tsx +119 -0
  123. package/build/ui/reference/components/card.tsx +144 -0
  124. package/build/ui/reference/components/chart.tsx +1394 -0
  125. package/build/ui/reference/components/checkbox.tsx +44 -0
  126. package/build/ui/reference/components/data-table.tsx +480 -0
  127. package/build/ui/reference/components/dialog.tsx +172 -0
  128. package/build/ui/reference/components/dropdown-menu.tsx +245 -0
  129. package/build/ui/reference/components/empty-state.tsx +63 -0
  130. package/build/ui/reference/components/file-upload.tsx +116 -0
  131. package/build/ui/reference/components/input.tsx +114 -0
  132. package/build/ui/reference/components/label.tsx +19 -0
  133. package/build/ui/reference/components/list.tsx +191 -0
  134. package/build/ui/reference/components/map.css +251 -0
  135. package/build/ui/reference/components/map.tsx +294 -0
  136. package/build/ui/reference/components/message.tsx +171 -0
  137. package/build/ui/reference/components/nav.tsx +113 -0
  138. package/build/ui/reference/components/page-header.tsx +213 -0
  139. package/build/ui/reference/components/popover.tsx +76 -0
  140. package/build/ui/reference/components/progress.tsx +31 -0
  141. package/build/ui/reference/components/radio.tsx +65 -0
  142. package/build/ui/reference/components/resizable.tsx +40 -0
  143. package/build/ui/reference/components/scroll-area.tsx +55 -0
  144. package/build/ui/reference/components/segmented.tsx +45 -0
  145. package/build/ui/reference/components/select.tsx +185 -0
  146. package/build/ui/reference/components/separator.tsx +26 -0
  147. package/build/ui/reference/components/sheet.tsx +173 -0
  148. package/build/ui/reference/components/skeleton.tsx +15 -0
  149. package/build/ui/reference/components/slider.tsx +161 -0
  150. package/build/ui/reference/components/snackbar.tsx +27 -0
  151. package/build/ui/reference/components/sonner.tsx +43 -0
  152. package/build/ui/reference/components/spinner.tsx +27 -0
  153. package/build/ui/reference/components/statistic.tsx +122 -0
  154. package/build/ui/reference/components/stepper.tsx +138 -0
  155. package/build/ui/reference/components/switch.tsx +47 -0
  156. package/build/ui/reference/components/table.tsx +233 -0
  157. package/build/ui/reference/components/textarea.tsx +28 -0
  158. package/build/ui/reference/components/timeline.tsx +94 -0
  159. package/build/ui/reference/components/toggle-group.tsx +86 -0
  160. package/build/ui/reference/components/toggle.tsx +46 -0
  161. package/build/ui/reference/components/tooltip.tsx +53 -0
  162. package/build/ui/reference/index.ts +49 -0
  163. package/build/ui/reference/lib/utils.ts +34 -0
  164. package/build/ui/standalone-stub.js +5 -0
  165. package/build/ui/standalone.js +135 -0
  166. package/build/ui/styles.css +3 -0
  167. package/connectors/package.json +8 -0
  168. package/package.json +114 -0
  169. package/query/package.json +8 -0
  170. package/shell/package.json +8 -0
  171. package/template/AGENTS.md +70 -0
  172. package/template/CLAUDE.md +4 -0
  173. package/template/README.md +102 -0
  174. package/template/_gitignore +6 -0
  175. package/template/commitlint.config.js +12 -0
  176. package/template/package.json +31 -0
  177. package/template/public/index.html +13 -0
  178. package/template/src/App.tsx +171 -0
  179. package/template/src/bootstrap.tsx +13 -0
  180. package/template/src/index.tsx +1 -0
  181. package/template/src/lifecycle.ts +20 -0
  182. package/template/tsconfig.json +31 -0
  183. package/template/webpack.config.js +112 -0
  184. package/template/webpack.local.config.js +68 -0
  185. package/ui/package.json +8 -0
@@ -0,0 +1,213 @@
1
+ import * as React from 'react';
2
+
3
+ import { cn } from '@rise-x/ui/lib/utils';
4
+
5
+ /*
6
+ * PAGE HEADER. Title, optional back-link, subtitle, actions, and tabs that sit
7
+ * ON the header's bottom border rather than in a container of their own — one
8
+ * rule doing two jobs, which is why the header needs no second divider.
9
+ *
10
+ * The back-link goes ABOVE the title, not beside it. Beside the title it
11
+ * competes with it for the same line and the eye has to sort out which is the
12
+ * page name; above, it reads as "where I came from" and the title stays first.
13
+ */
14
+ function PageHeader({
15
+ className,
16
+ variant = 'card',
17
+ ...props
18
+ }: React.ComponentProps<'header'> & {
19
+ /**
20
+ * `card` — a white band with a bottom rule, for headers that own tabs.
21
+ * `bare` — sits directly ON the page background with no surface and no rule,
22
+ * so the content below can be a set of white tiles (metrics, tables, cards).
23
+ * Use this whenever the page is a dashboard rather than a single document:
24
+ * a white header above white tiles produces two stacked surfaces with a seam
25
+ * between them and nothing gained.
26
+ */
27
+ variant?: 'card' | 'bare';
28
+ }) {
29
+ return (
30
+ <header
31
+ data-slot="page-header"
32
+ data-variant={variant}
33
+ className={cn(
34
+ variant === 'card' && 'border-b border-border bg-card px-5 pt-3.5',
35
+ variant === 'bare' && 'bg-transparent px-0 pt-0 pb-5',
36
+ className,
37
+ )}
38
+ {...props}
39
+ />
40
+ );
41
+ }
42
+
43
+ function PageHeaderRow({ className, ...props }: React.ComponentProps<'div'>) {
44
+ return (
45
+ <div
46
+ data-slot="page-header-row"
47
+ className={cn(
48
+ 'flex items-start gap-3 [&>[data-slot=page-header-actions]]:ml-auto',
49
+ className,
50
+ )}
51
+ {...props}
52
+ />
53
+ );
54
+ }
55
+
56
+ function PageHeaderBack({ className, children, ...props }: React.ComponentProps<'button'>) {
57
+ return (
58
+ <button
59
+ type="button"
60
+ data-slot="page-header-back"
61
+ className={cn(
62
+ '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',
63
+ className,
64
+ )}
65
+ {...props}
66
+ >
67
+ <svg
68
+ viewBox="0 0 24 24"
69
+ fill="none"
70
+ stroke="currentColor"
71
+ strokeWidth={2.5}
72
+ strokeLinecap="round"
73
+ >
74
+ <path d="M15 6l-6 6 6 6" />
75
+ </svg>
76
+ {children}
77
+ </button>
78
+ );
79
+ }
80
+
81
+ function PageHeaderTitle({ className, ...props }: React.ComponentProps<'h1'>) {
82
+ return (
83
+ <h1
84
+ data-slot="page-header-title"
85
+ className={cn('text-[17px] leading-tight font-medium tracking-[-0.01em]', className)}
86
+ {...props}
87
+ />
88
+ );
89
+ }
90
+
91
+ function PageHeaderSubtitle({ className, ...props }: React.ComponentProps<'p'>) {
92
+ return (
93
+ <p
94
+ data-slot="page-header-subtitle"
95
+ className={cn('mt-0.5 text-xs text-muted-foreground', className)}
96
+ {...props}
97
+ />
98
+ );
99
+ }
100
+
101
+ function PageHeaderActions({ className, ...props }: React.ComponentProps<'div'>) {
102
+ return <div data-slot="page-header-actions" className={cn('flex gap-2', className)} {...props} />;
103
+ }
104
+
105
+ /* Tabs as an underline on the header rule, not a segmented control. A segmented
106
+ * control says "filter this view"; an underlined tab says "this is a different
107
+ * view of the same thing", which is what a page-level tab is. */
108
+ function PageHeaderTabs({ className, ...props }: React.ComponentProps<'div'>) {
109
+ return (
110
+ <div
111
+ data-slot="page-header-tabs"
112
+ role="tablist"
113
+ className={cn('-mb-px mt-3 flex gap-[18px]', className)}
114
+ {...props}
115
+ />
116
+ );
117
+ }
118
+
119
+ function PageHeaderTab({
120
+ className,
121
+ selected,
122
+ ...props
123
+ }: React.ComponentProps<'button'> & { selected?: boolean }) {
124
+ return (
125
+ <button
126
+ type="button"
127
+ role="tab"
128
+ data-slot="page-header-tab"
129
+ aria-selected={selected}
130
+ className={cn(
131
+ 'h-[34px] border-0 bg-transparent px-px text-ui text-muted-foreground transition-colors outline-none hover:text-foreground',
132
+ 'aria-selected:font-medium aria-selected:text-foreground aria-selected:shadow-[inset_0_-1px_0_var(--foreground)]',
133
+ className,
134
+ )}
135
+ {...props}
136
+ />
137
+ );
138
+ }
139
+
140
+ /* TOOLBAR — the row above a data view. Wraps rather than scrolling sideways: a
141
+ * horizontally scrolling filter bar hides the filters that are applied. */
142
+ function Toolbar({ className, ...props }: React.ComponentProps<'div'>) {
143
+ return (
144
+ <div
145
+ data-slot="toolbar"
146
+ className={cn(
147
+ 'flex flex-wrap items-center gap-2 [&>[data-slot=toolbar-end]]:ml-auto',
148
+ className,
149
+ )}
150
+ {...props}
151
+ />
152
+ );
153
+ }
154
+
155
+ function ToolbarEnd({ className, ...props }: React.ComponentProps<'div'>) {
156
+ return <div data-slot="toolbar-end" className={cn('flex gap-2', className)} {...props} />;
157
+ }
158
+
159
+ function ToolbarSeparator({ className, ...props }: React.ComponentProps<'span'>) {
160
+ return (
161
+ <span
162
+ data-slot="toolbar-separator"
163
+ aria-hidden
164
+ className={cn('h-5 w-px shrink-0 bg-border', className)}
165
+ {...props}
166
+ />
167
+ );
168
+ }
169
+
170
+ /* Breadcrumbs. The current page is not a link and is not muted — it is the one
171
+ * item you are actually on. */
172
+ function Breadcrumbs({ className, ...props }: React.ComponentProps<'nav'>) {
173
+ return (
174
+ <nav
175
+ data-slot="breadcrumbs"
176
+ aria-label="Breadcrumb"
177
+ className={cn(
178
+ 'flex items-center gap-1.5 text-xs text-muted-foreground [&>[aria-current]]:font-medium [&>[aria-current]]:text-foreground',
179
+ className,
180
+ )}
181
+ {...props}
182
+ />
183
+ );
184
+ }
185
+
186
+ function BreadcrumbSeparator({ className, ...props }: React.ComponentProps<'span'>) {
187
+ return (
188
+ <span
189
+ data-slot="breadcrumb-separator"
190
+ aria-hidden
191
+ className={cn('text-subtle', className)}
192
+ {...props}
193
+ >
194
+ /
195
+ </span>
196
+ );
197
+ }
198
+
199
+ export {
200
+ PageHeader,
201
+ PageHeaderRow,
202
+ PageHeaderBack,
203
+ PageHeaderTitle,
204
+ PageHeaderSubtitle,
205
+ PageHeaderActions,
206
+ PageHeaderTabs,
207
+ PageHeaderTab,
208
+ Toolbar,
209
+ ToolbarEnd,
210
+ ToolbarSeparator,
211
+ Breadcrumbs,
212
+ BreadcrumbSeparator,
213
+ };
@@ -0,0 +1,76 @@
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-sm 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 dark:ring-foreground/10 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-sm', 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
+ };
@@ -0,0 +1,31 @@
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 };
@@ -0,0 +1,65 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
5
+
6
+ import { cn } from '@rise-x/ui/lib/utils';
7
+
8
+ /*
9
+ * 15px circle, same box as Checkbox — the only difference is the shape, which
10
+ * is the whole point: round means "one of these", square means "any of these".
11
+ * Checked fills with `primary` (neutral), matching Checkbox; a radio records a
12
+ * choice, not an affirmation, so it does not get brand.
13
+ */
14
+ function RadioGroup({
15
+ className,
16
+ ...props
17
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
18
+ return (
19
+ <RadioGroupPrimitive.Root
20
+ data-slot="radio-group"
21
+ className={cn('grid gap-2', className)}
22
+ {...props}
23
+ />
24
+ );
25
+ }
26
+
27
+ function Radio({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
28
+ return (
29
+ <RadioGroupPrimitive.Item
30
+ data-slot="radio"
31
+ className={cn(
32
+ 'peer grid size-[15px] shrink-0 place-items-center rounded-full border border-input bg-card transition-[background-color,border-color] duration-100 outline-none',
33
+ 'focus-visible:ring-3 focus-visible:ring-ring-control/35',
34
+ 'disabled:cursor-not-allowed disabled:opacity-45',
35
+ 'aria-invalid:border-error aria-invalid:ring-3 aria-invalid:ring-error/20',
36
+ 'data-checked:border-primary data-checked:bg-primary',
37
+ className,
38
+ )}
39
+ {...props}
40
+ >
41
+ <RadioGroupPrimitive.Indicator
42
+ data-slot="radio-indicator"
43
+ className="block size-[7px] rounded-full bg-primary-foreground"
44
+ />
45
+ </RadioGroupPrimitive.Item>
46
+ );
47
+ }
48
+
49
+ /* Checkbox/radio with a label and optional helper line. The row is the click
50
+ * target, and the helper sits under the label rather than beside it so a long
51
+ * explanation does not push the control off-centre. */
52
+ function ChoiceRow({ className, ...props }: React.ComponentProps<'label'>) {
53
+ return (
54
+ <label
55
+ data-slot="choice-row"
56
+ className={cn(
57
+ 'flex cursor-pointer items-start gap-2 text-ui [&>*:first-child]:mt-[3px] [&_small]:block [&_small]:text-micro [&_small]:text-subtle',
58
+ className,
59
+ )}
60
+ {...props}
61
+ />
62
+ );
63
+ }
64
+
65
+ export { RadioGroup, Radio, ChoiceRow };
@@ -0,0 +1,40 @@
1
+ import * as ResizablePrimitive from 'react-resizable-panels';
2
+
3
+ import { cn } from '@rise-x/ui/lib/utils';
4
+
5
+ function ResizablePanelGroup({ className, ...props }: ResizablePrimitive.GroupProps) {
6
+ return (
7
+ <ResizablePrimitive.Group
8
+ data-slot="resizable-panel-group"
9
+ className={cn('flex h-full w-full aria-[orientation=vertical]:flex-col', className)}
10
+ {...props}
11
+ />
12
+ );
13
+ }
14
+
15
+ function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps) {
16
+ return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />;
17
+ }
18
+
19
+ function ResizableHandle({
20
+ withHandle,
21
+ className,
22
+ ...props
23
+ }: ResizablePrimitive.SeparatorProps & {
24
+ withHandle?: boolean;
25
+ }) {
26
+ return (
27
+ <ResizablePrimitive.Separator
28
+ data-slot="resizable-handle"
29
+ className={cn(
30
+ 'relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90',
31
+ className,
32
+ )}
33
+ {...props}
34
+ >
35
+ {withHandle && <div className="z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border" />}
36
+ </ResizablePrimitive.Separator>
37
+ );
38
+ }
39
+
40
+ export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
@@ -0,0 +1,55 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';
5
+
6
+ import { cn } from '@rise-x/ui/lib/utils';
7
+
8
+ function ScrollArea({
9
+ className,
10
+ children,
11
+ ...props
12
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
13
+ return (
14
+ <ScrollAreaPrimitive.Root
15
+ data-slot="scroll-area"
16
+ className={cn('relative', className)}
17
+ {...props}
18
+ >
19
+ <ScrollAreaPrimitive.Viewport
20
+ data-slot="scroll-area-viewport"
21
+ className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1"
22
+ >
23
+ {children}
24
+ </ScrollAreaPrimitive.Viewport>
25
+ <ScrollBar />
26
+ <ScrollAreaPrimitive.Corner />
27
+ </ScrollAreaPrimitive.Root>
28
+ );
29
+ }
30
+
31
+ function ScrollBar({
32
+ className,
33
+ orientation = 'vertical',
34
+ ...props
35
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
36
+ return (
37
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
38
+ data-slot="scroll-area-scrollbar"
39
+ data-orientation={orientation}
40
+ orientation={orientation}
41
+ className={cn(
42
+ 'flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent',
43
+ className,
44
+ )}
45
+ {...props}
46
+ >
47
+ <ScrollAreaPrimitive.ScrollAreaThumb
48
+ data-slot="scroll-area-thumb"
49
+ className="relative flex-1 rounded-full bg-border"
50
+ />
51
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
52
+ );
53
+ }
54
+
55
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,45 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+
5
+ import { cn } from '@rise-x/ui/lib/utils';
6
+
7
+ /*
8
+ * iOS-style segmented control: a filled track with a white thumb floating on a
9
+ * tight shadow. No border — the fill IS the container, and a border around a
10
+ * filled track is the same statement twice.
11
+ */
12
+ function Segmented({ className, ...props }: React.ComponentProps<'div'>) {
13
+ return (
14
+ <div
15
+ data-slot="segmented"
16
+ role="group"
17
+ className={cn('inline-flex gap-0.5 rounded-lg border-0 bg-fill-1 p-0.5', className)}
18
+ {...props}
19
+ />
20
+ );
21
+ }
22
+
23
+ function SegmentedItem({
24
+ className,
25
+ selected,
26
+ ...props
27
+ }: React.ComponentProps<'button'> & { selected?: boolean }) {
28
+ return (
29
+ <button
30
+ type="button"
31
+ data-slot="segmented-item"
32
+ aria-pressed={selected}
33
+ className={cn(
34
+ 'inline-flex h-control-xs items-center gap-1.5 rounded-md border-0 bg-transparent px-2.5 text-xs text-muted-foreground transition-[background-color,color] duration-200 ease-decelerate outline-none',
35
+ 'focus-visible:ring-3 focus-visible:ring-ring-control/35',
36
+ 'aria-pressed:bg-card aria-pressed:font-medium aria-pressed:text-foreground aria-pressed:shadow-[0_1px_3px_rgb(16_24_40/0.12),0_1px_1px_rgb(16_24_40/0.06)]',
37
+ '[&_svg]:size-3 [&_svg]:shrink-0',
38
+ className,
39
+ )}
40
+ {...props}
41
+ />
42
+ );
43
+ }
44
+
45
+ export { Segmented, SegmentedItem };