@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,245 @@
1
+ import * as React from 'react';
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
3
+
4
+ import { cn } from '@rise-x/ui/lib/utils';
5
+ import { CheckIcon, ChevronRightIcon } from 'lucide-react';
6
+
7
+ function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
8
+ return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
9
+ }
10
+
11
+ function DropdownMenuPortal({
12
+ ...props
13
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
14
+ return <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
15
+ }
16
+
17
+ function DropdownMenuTrigger({
18
+ ...props
19
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
20
+ return <DropdownMenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
21
+ }
22
+
23
+ function DropdownMenuContent({
24
+ className,
25
+ align = 'start',
26
+ sideOffset = 4,
27
+ ...props
28
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
29
+ return (
30
+ <DropdownMenuPrimitive.Portal>
31
+ <DropdownMenuPrimitive.Content
32
+ data-slot="dropdown-menu-content"
33
+ sideOffset={sideOffset}
34
+ align={align}
35
+ className={cn(
36
+ 'z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-48 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl bg-popover p-1.5 text-popover-foreground shadow-pop 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-[state=closed]:overflow-hidden 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',
37
+ className,
38
+ )}
39
+ {...props}
40
+ />
41
+ </DropdownMenuPrimitive.Portal>
42
+ );
43
+ }
44
+
45
+ function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
46
+ return <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
47
+ }
48
+
49
+ function DropdownMenuItem({
50
+ className,
51
+ inset,
52
+ variant = 'default',
53
+ ...props
54
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
55
+ inset?: boolean;
56
+ variant?: 'default' | 'destructive';
57
+ }) {
58
+ return (
59
+ <DropdownMenuPrimitive.Item
60
+ data-slot="dropdown-menu-item"
61
+ data-inset={inset}
62
+ data-variant={variant}
63
+ className={cn(
64
+ "group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-md h-7 px-2 text-ui font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-9.5 data-[variant=destructive]:text-error-text data-[variant=destructive]:focus:bg-error/10 data-[variant=destructive]:focus:text-error-text dark:data-[variant=destructive]:focus:bg-error/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-error-text",
65
+ className,
66
+ )}
67
+ {...props}
68
+ />
69
+ );
70
+ }
71
+
72
+ function DropdownMenuCheckboxItem({
73
+ className,
74
+ children,
75
+ checked,
76
+ inset,
77
+ ...props
78
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
79
+ inset?: boolean;
80
+ }) {
81
+ return (
82
+ <DropdownMenuPrimitive.CheckboxItem
83
+ data-slot="dropdown-menu-checkbox-item"
84
+ data-inset={inset}
85
+ className={cn(
86
+ "relative flex cursor-default items-center gap-2 rounded-md h-7 pr-8 pl-2 text-ui font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-9.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
87
+ className,
88
+ )}
89
+ checked={checked}
90
+ {...props}
91
+ >
92
+ <span
93
+ className="pointer-events-none absolute right-2 flex items-center justify-center"
94
+ data-slot="dropdown-menu-checkbox-item-indicator"
95
+ >
96
+ <DropdownMenuPrimitive.ItemIndicator>
97
+ <CheckIcon />
98
+ </DropdownMenuPrimitive.ItemIndicator>
99
+ </span>
100
+ {children}
101
+ </DropdownMenuPrimitive.CheckboxItem>
102
+ );
103
+ }
104
+
105
+ function DropdownMenuRadioGroup({
106
+ ...props
107
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
108
+ return <DropdownMenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />;
109
+ }
110
+
111
+ function DropdownMenuRadioItem({
112
+ className,
113
+ children,
114
+ inset,
115
+ ...props
116
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
117
+ inset?: boolean;
118
+ }) {
119
+ return (
120
+ <DropdownMenuPrimitive.RadioItem
121
+ data-slot="dropdown-menu-radio-item"
122
+ data-inset={inset}
123
+ className={cn(
124
+ "relative flex cursor-default items-center gap-2 rounded-md h-7 pr-8 pl-2 text-ui font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-9.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
125
+ className,
126
+ )}
127
+ {...props}
128
+ >
129
+ <span
130
+ className="pointer-events-none absolute right-2 flex items-center justify-center"
131
+ data-slot="dropdown-menu-radio-item-indicator"
132
+ >
133
+ <DropdownMenuPrimitive.ItemIndicator>
134
+ <CheckIcon />
135
+ </DropdownMenuPrimitive.ItemIndicator>
136
+ </span>
137
+ {children}
138
+ </DropdownMenuPrimitive.RadioItem>
139
+ );
140
+ }
141
+
142
+ function DropdownMenuLabel({
143
+ className,
144
+ inset,
145
+ ...props
146
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
147
+ inset?: boolean;
148
+ }) {
149
+ return (
150
+ <DropdownMenuPrimitive.Label
151
+ data-slot="dropdown-menu-label"
152
+ data-inset={inset}
153
+ className={cn('px-3 py-2.5 text-xs text-muted-foreground data-inset:pl-9.5', className)}
154
+ {...props}
155
+ />
156
+ );
157
+ }
158
+
159
+ function DropdownMenuSeparator({
160
+ className,
161
+ ...props
162
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
163
+ return (
164
+ <DropdownMenuPrimitive.Separator
165
+ data-slot="dropdown-menu-separator"
166
+ className={cn('-mx-1.5 my-1.5 h-px bg-border/50', className)}
167
+ {...props}
168
+ />
169
+ );
170
+ }
171
+
172
+ function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {
173
+ return (
174
+ <span
175
+ data-slot="dropdown-menu-shortcut"
176
+ className={cn(
177
+ 'ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground',
178
+ className,
179
+ )}
180
+ {...props}
181
+ />
182
+ );
183
+ }
184
+
185
+ function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
186
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
187
+ }
188
+
189
+ function DropdownMenuSubTrigger({
190
+ className,
191
+ inset,
192
+ children,
193
+ ...props
194
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
195
+ inset?: boolean;
196
+ }) {
197
+ return (
198
+ <DropdownMenuPrimitive.SubTrigger
199
+ data-slot="dropdown-menu-sub-trigger"
200
+ data-inset={inset}
201
+ className={cn(
202
+ "flex cursor-default items-center gap-2 rounded-md h-7 px-2 text-ui font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-9.5 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
203
+ className,
204
+ )}
205
+ {...props}
206
+ >
207
+ {children}
208
+ <ChevronRightIcon className="ml-auto" />
209
+ </DropdownMenuPrimitive.SubTrigger>
210
+ );
211
+ }
212
+
213
+ function DropdownMenuSubContent({
214
+ className,
215
+ ...props
216
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
217
+ return (
218
+ <DropdownMenuPrimitive.SubContent
219
+ data-slot="dropdown-menu-sub-content"
220
+ className={cn(
221
+ 'z-50 min-w-36 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-xl bg-popover p-1.5 text-popover-foreground shadow-pop 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',
222
+ className,
223
+ )}
224
+ {...props}
225
+ />
226
+ );
227
+ }
228
+
229
+ export {
230
+ DropdownMenu,
231
+ DropdownMenuPortal,
232
+ DropdownMenuTrigger,
233
+ DropdownMenuContent,
234
+ DropdownMenuGroup,
235
+ DropdownMenuLabel,
236
+ DropdownMenuItem,
237
+ DropdownMenuCheckboxItem,
238
+ DropdownMenuRadioGroup,
239
+ DropdownMenuRadioItem,
240
+ DropdownMenuSeparator,
241
+ DropdownMenuShortcut,
242
+ DropdownMenuSub,
243
+ DropdownMenuSubTrigger,
244
+ DropdownMenuSubContent,
245
+ };
@@ -0,0 +1,63 @@
1
+ import * as React from 'react';
2
+
3
+ import { cn } from '@rise-x/ui/lib/utils';
4
+
5
+ /*
6
+ * Centred, quiet, and short. An empty state is read once and then never again,
7
+ * so it earns a glyph, a line, a sub-line and at most one action — not a
8
+ * bordered panel with an illustration.
9
+ */
10
+ function EmptyState({ className, ...props }: React.ComponentProps<'div'>) {
11
+ return (
12
+ <div
13
+ data-slot="empty-state"
14
+ className={cn('flex flex-col items-center gap-[3px] px-4 py-8 text-center', className)}
15
+ {...props}
16
+ />
17
+ );
18
+ }
19
+
20
+ function EmptyStateGlyph({ className, ...props }: React.ComponentProps<'span'>) {
21
+ return (
22
+ <span
23
+ data-slot="empty-state-glyph"
24
+ className={cn(
25
+ 'mb-[5px] grid size-8 place-items-center rounded-lg bg-muted text-subtle [&_svg]:size-[15px]',
26
+ className,
27
+ )}
28
+ {...props}
29
+ />
30
+ );
31
+ }
32
+
33
+ function EmptyStateTitle({ className, ...props }: React.ComponentProps<'div'>) {
34
+ return (
35
+ <div
36
+ data-slot="empty-state-title"
37
+ className={cn('text-ui font-medium', className)}
38
+ {...props}
39
+ />
40
+ );
41
+ }
42
+
43
+ function EmptyStateDescription({ className, ...props }: React.ComponentProps<'div'>) {
44
+ return (
45
+ <div
46
+ data-slot="empty-state-description"
47
+ className={cn('max-w-[42ch] text-xs text-muted-foreground', className)}
48
+ {...props}
49
+ />
50
+ );
51
+ }
52
+
53
+ function EmptyStateActions({ className, ...props }: React.ComponentProps<'div'>) {
54
+ return (
55
+ <div
56
+ data-slot="empty-state-actions"
57
+ className={cn('mt-3 flex items-center gap-2', className)}
58
+ {...props}
59
+ />
60
+ );
61
+ }
62
+
63
+ export { EmptyState, EmptyStateGlyph, EmptyStateTitle, EmptyStateDescription, EmptyStateActions };
@@ -0,0 +1,116 @@
1
+ import * as React from 'react';
2
+
3
+ import { cn } from '@rise-x/ui/lib/utils';
4
+
5
+ /*
6
+ * Upload. The drop zone is DASHED when idle and turns solid brand when a file
7
+ * is over it — the same empty-slot/filled grammar the filter triggers use, so
8
+ * "a place something goes" looks the same everywhere in the system.
9
+ */
10
+ function FileDrop({
11
+ className,
12
+ active,
13
+ ...props
14
+ }: React.ComponentProps<'div'> & { active?: boolean }) {
15
+ return (
16
+ <div
17
+ data-slot="file-drop"
18
+ data-active={active ? '' : undefined}
19
+ className={cn(
20
+ 'rounded-xl border border-dashed border-border-strong bg-muted p-6 text-center transition-colors',
21
+ active && 'border-solid border-brand bg-brand-tint',
22
+ className,
23
+ )}
24
+ {...props}
25
+ />
26
+ );
27
+ }
28
+
29
+ function FileDropGlyph({ className, ...props }: React.ComponentProps<'span'>) {
30
+ return (
31
+ <span
32
+ data-slot="file-drop-glyph"
33
+ className={cn(
34
+ 'mx-auto mb-2 grid size-8 place-items-center rounded-lg bg-card text-subtle [&>svg]:size-4',
35
+ className,
36
+ )}
37
+ {...props}
38
+ />
39
+ );
40
+ }
41
+
42
+ /* A file CARD, not a thumbnail. Name plus type · size plus an action — a preview
43
+ * image of a PDF tells you nothing that the filename doesn't. */
44
+ function FileCard({
45
+ className,
46
+ glyph,
47
+ name,
48
+ meta,
49
+ action,
50
+ ...props
51
+ }: React.ComponentProps<'div'> & {
52
+ glyph?: React.ReactNode;
53
+ name: React.ReactNode;
54
+ meta?: React.ReactNode;
55
+ action?: React.ReactNode;
56
+ }) {
57
+ return (
58
+ <div
59
+ data-slot="file-card"
60
+ className={cn(
61
+ 'flex items-center gap-2.5 rounded-lg border border-border bg-card px-2.5 py-2',
62
+ className,
63
+ )}
64
+ {...props}
65
+ >
66
+ {glyph ? (
67
+ <span className="grid size-7 shrink-0 place-items-center rounded-md bg-fill-1 text-muted-foreground [&>svg]:size-3.5">
68
+ {glyph}
69
+ </span>
70
+ ) : null}
71
+ <span className="min-w-0 flex-1">
72
+ <span className="block truncate text-xs">{name}</span>
73
+ {meta ? <span className="block text-micro text-subtle">{meta}</span> : null}
74
+ </span>
75
+ {action}
76
+ </div>
77
+ );
78
+ }
79
+
80
+ function AttachmentList({ className, ...props }: React.ComponentProps<'div'>) {
81
+ return (
82
+ <div
83
+ data-slot="attachment-list"
84
+ className={cn('flex flex-col gap-1.5', className)}
85
+ {...props}
86
+ />
87
+ );
88
+ }
89
+
90
+ /* Image/media tile. Fixed square so a gallery of mixed aspect ratios still
91
+ * lines up; the image is cropped rather than letterboxed. */
92
+ function MediaThumb({
93
+ className,
94
+ size = 56,
95
+ ...props
96
+ }: React.ComponentProps<'div'> & { size?: number }) {
97
+ return (
98
+ <div
99
+ data-slot="media-thumb"
100
+ style={{ width: size, height: size }}
101
+ className={cn(
102
+ 'grid shrink-0 place-items-center overflow-hidden rounded-lg border border-border bg-muted text-subtle [&>img]:size-full [&>img]:object-cover [&>svg]:size-4',
103
+ className,
104
+ )}
105
+ {...props}
106
+ />
107
+ );
108
+ }
109
+
110
+ function MediaGallery({ className, ...props }: React.ComponentProps<'div'>) {
111
+ return (
112
+ <div data-slot="media-gallery" className={cn('flex flex-wrap gap-2', className)} {...props} />
113
+ );
114
+ }
115
+
116
+ export { FileDrop, FileDropGlyph, FileCard, AttachmentList, MediaThumb, MediaGallery };
@@ -0,0 +1,114 @@
1
+ import * as React from 'react';
2
+
3
+ import { cn } from '@rise-x/ui/lib/utils';
4
+
5
+ /*
6
+ * 32px, 10px radius, 13px text, on the card surface with a border a step
7
+ * stronger than the page's hairlines — a field has to read as enterable before
8
+ * you click it.
9
+ *
10
+ * Focus is the BRAND ring, unlike Button's neutral one. The distinction is
11
+ * deliberate: a control you operate gets grey, a field you commit data into
12
+ * gets brand affirmation.
13
+ *
14
+ * forwardRef (not React 19 ref-as-prop): the classic React 18 host also renders
15
+ * these components and strips `ref` from plain function components — imperative
16
+ * focus/measure from consumers would silently break there.
17
+ */
18
+ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(function Input(
19
+ { className, type, ...props },
20
+ ref,
21
+ ) {
22
+ return (
23
+ <input
24
+ ref={ref}
25
+ type={type}
26
+ data-slot="input"
27
+ className={cn(
28
+ 'h-control w-full min-w-0 rounded-lg border border-input bg-card px-2.5 text-ui text-foreground transition-[border-color,box-shadow] duration-100 outline-none',
29
+ 'file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-ui file:font-medium file:text-foreground',
30
+ 'placeholder:text-subtle',
31
+ 'focus-visible:border-brand focus-visible:ring-3 focus-visible:ring-brand/12',
32
+ 'disabled:cursor-not-allowed disabled:bg-muted disabled:text-subtle',
33
+ 'aria-invalid:border-error aria-invalid:focus-visible:border-error aria-invalid:focus-visible:ring-error/18',
34
+ className,
35
+ )}
36
+ {...props}
37
+ />
38
+ );
39
+ });
40
+
41
+ /* Numbers right-align and use tabular figures so decimal points stack. */
42
+ function InputNumeric({ className, ...props }: React.ComponentProps<'input'>) {
43
+ return <Input className={cn('text-right tabular-nums', className)} {...props} />;
44
+ }
45
+
46
+ /* Icon-in-field wrapper. The icon is decorative and non-interactive; use
47
+ * InputAction for anything clickable (reveal password, clear). */
48
+ function InputField({ className, ...props }: React.ComponentProps<'div'>) {
49
+ return (
50
+ <div
51
+ data-slot="input-field"
52
+ className={cn(
53
+ 'relative flex items-center',
54
+ '[&>svg]:pointer-events-none [&>svg]:absolute [&>svg]:left-2.5 [&>svg]:size-3.5 [&>svg]:text-subtle',
55
+ // the padding has to follow the icon: `[&>svg~input]:pl-7` on its own
56
+ // indented the value away from an empty left edge and let it run under a
57
+ // trailing icon
58
+ '[&>svg:not([data-position=end])~input]:pl-7',
59
+ '[&>svg[data-position=end]~input]:pr-7',
60
+ '[&>svg[data-position=end]]:right-2.5 [&>svg[data-position=end]]:left-auto',
61
+ className,
62
+ )}
63
+ {...props}
64
+ />
65
+ );
66
+ }
67
+
68
+ function InputAction({ className, ...props }: React.ComponentProps<'button'>) {
69
+ return (
70
+ <button
71
+ type="button"
72
+ data-slot="input-action"
73
+ className={cn(
74
+ 'absolute right-1 grid size-6 place-items-center rounded-md text-subtle transition-colors hover:bg-muted hover:text-foreground [&_svg]:size-3.5',
75
+ className,
76
+ )}
77
+ {...props}
78
+ />
79
+ );
80
+ }
81
+
82
+ /* Prefix / suffix affix (currency, units). Borders are shared, not doubled:
83
+ * the affix drops the edge it meets so the group reads as one control. */
84
+ function InputGroup({ className, ...props }: React.ComponentProps<'div'>) {
85
+ return (
86
+ <div
87
+ data-slot="input-group"
88
+ className={cn(
89
+ 'flex [&>input]:rounded-none',
90
+ '[&>[data-slot=input-affix]:first-child]:rounded-l-lg [&>[data-slot=input-affix]:first-child]:border-r-0',
91
+ '[&>[data-slot=input-affix]:last-child]:rounded-r-lg [&>[data-slot=input-affix]:last-child]:border-l-0',
92
+ '[&>[data-slot=input-affix]:first-child+input]:rounded-r-lg',
93
+ '[&>input:has(+[data-slot=input-affix])]:rounded-l-lg',
94
+ className,
95
+ )}
96
+ {...props}
97
+ />
98
+ );
99
+ }
100
+
101
+ function InputAffix({ className, ...props }: React.ComponentProps<'span'>) {
102
+ return (
103
+ <span
104
+ data-slot="input-affix"
105
+ className={cn(
106
+ 'inline-flex h-control shrink-0 items-center border border-input bg-muted px-2.5 text-xs text-muted-foreground',
107
+ className,
108
+ )}
109
+ {...props}
110
+ />
111
+ );
112
+ }
113
+
114
+ export { Input, InputNumeric, InputField, InputAction, InputGroup, InputAffix };
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import { Label as LabelPrimitive } from 'radix-ui';
3
+
4
+ import { cn } from '@rise-x/ui/lib/utils';
5
+
6
+ function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
7
+ return (
8
+ <LabelPrimitive.Root
9
+ data-slot="label"
10
+ className={cn(
11
+ 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
12
+ className,
13
+ )}
14
+ {...props}
15
+ />
16
+ );
17
+ }
18
+
19
+ export { Label };