@olympusoss/canvas 2.6.19
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/package.json +179 -0
- package/src/components/atoms/README.md +11 -0
- package/src/components/atoms/aspect-ratio.tsx +32 -0
- package/src/components/atoms/avatar.tsx +98 -0
- package/src/components/atoms/badge.tsx +44 -0
- package/src/components/atoms/brand-mark.tsx +74 -0
- package/src/components/atoms/button.tsx +104 -0
- package/src/components/atoms/checkbox.tsx +63 -0
- package/src/components/atoms/flex-box.tsx +105 -0
- package/src/components/atoms/icon.tsx +34 -0
- package/src/components/atoms/input.tsx +91 -0
- package/src/components/atoms/label.tsx +41 -0
- package/src/components/atoms/logo.tsx +89 -0
- package/src/components/atoms/progress.tsx +55 -0
- package/src/components/atoms/radio-group.tsx +122 -0
- package/src/components/atoms/scroll-area.tsx +106 -0
- package/src/components/atoms/section.tsx +48 -0
- package/src/components/atoms/separator.tsx +45 -0
- package/src/components/atoms/skeleton.tsx +17 -0
- package/src/components/atoms/slider.tsx +93 -0
- package/src/components/atoms/switch.tsx +60 -0
- package/src/components/atoms/textarea.tsx +78 -0
- package/src/components/atoms/toggle.tsx +80 -0
- package/src/components/charts/activity-heatmap.tsx +96 -0
- package/src/components/charts/axes.tsx +21 -0
- package/src/components/charts/chart-container.tsx +195 -0
- package/src/components/charts/chart-legend.tsx +67 -0
- package/src/components/charts/chart-tooltip.tsx +161 -0
- package/src/components/charts/chart-types.tsx +49 -0
- package/src/components/charts/containers.tsx +11 -0
- package/src/components/charts/data.tsx +16 -0
- package/src/components/charts/details.tsx +25 -0
- package/src/components/charts/gauge.tsx +106 -0
- package/src/components/charts/grids.tsx +8 -0
- package/src/components/charts/index.ts +62 -0
- package/src/components/charts/labeled-bar-list.tsx +85 -0
- package/src/components/charts/references.tsx +8 -0
- package/src/components/charts/service-health-list.tsx +73 -0
- package/src/components/charts/sparkline.tsx +52 -0
- package/src/components/charts/stacked-bar.tsx +104 -0
- package/src/components/charts/text.tsx +10 -0
- package/src/components/charts/world-heat-map-inner.tsx +317 -0
- package/src/components/charts/world-heat-map.tsx +184 -0
- package/src/components/molecules/README.md +12 -0
- package/src/components/molecules/action-bar.tsx +73 -0
- package/src/components/molecules/activity-item.tsx +74 -0
- package/src/components/molecules/alert.tsx +80 -0
- package/src/components/molecules/animated-background.tsx +92 -0
- package/src/components/molecules/brand-lockup.tsx +48 -0
- package/src/components/molecules/breadcrumb.tsx +161 -0
- package/src/components/molecules/button-group.tsx +104 -0
- package/src/components/molecules/calendar.tsx +216 -0
- package/src/components/molecules/card.tsx +101 -0
- package/src/components/molecules/code-block.tsx +48 -0
- package/src/components/molecules/empty-state.tsx +55 -0
- package/src/components/molecules/error-state.tsx +42 -0
- package/src/components/molecules/field-display.tsx +35 -0
- package/src/components/molecules/input-otp.tsx +74 -0
- package/src/components/molecules/loading-state.tsx +36 -0
- package/src/components/molecules/notification-item.tsx +67 -0
- package/src/components/molecules/notification-list.tsx +45 -0
- package/src/components/molecules/number-badge.tsx +53 -0
- package/src/components/molecules/page-header.tsx +88 -0
- package/src/components/molecules/page-tabs.tsx +94 -0
- package/src/components/molecules/pagination.tsx +150 -0
- package/src/components/molecules/phone-input.tsx +200 -0
- package/src/components/molecules/search-bar.tsx +64 -0
- package/src/components/molecules/secret-field.tsx +158 -0
- package/src/components/molecules/section-card.tsx +91 -0
- package/src/components/molecules/stat-card.tsx +96 -0
- package/src/components/molecules/status-badge.tsx +42 -0
- package/src/components/molecules/stepper.tsx +96 -0
- package/src/components/molecules/table.tsx +157 -0
- package/src/components/molecules/toggle-group.tsx +145 -0
- package/src/components/molecules/tooltip.tsx +150 -0
- package/src/components/molecules/user-avatar-chip.tsx +71 -0
- package/src/components/organisms/README.md +14 -0
- package/src/components/organisms/accordion.tsx +149 -0
- package/src/components/organisms/alert-dialog.tsx +269 -0
- package/src/components/organisms/carousel.tsx +244 -0
- package/src/components/organisms/collapsible.tsx +69 -0
- package/src/components/organisms/command.tsx +143 -0
- package/src/components/organisms/context-menu.tsx +333 -0
- package/src/components/organisms/dashboard-grid.tsx +360 -0
- package/src/components/organisms/data-table.tsx +330 -0
- package/src/components/organisms/dialog.tsx +304 -0
- package/src/components/organisms/drawer.tsx +100 -0
- package/src/components/organisms/dropdown-menu.tsx +434 -0
- package/src/components/organisms/editors/code-editor.tsx +144 -0
- package/src/components/organisms/editors/index.ts +4 -0
- package/src/components/organisms/editors/markdown-editor.tsx +153 -0
- package/src/components/organisms/editors/markdown-renderer.ts +27 -0
- package/src/components/organisms/editors/prose-canvas-classes.ts +45 -0
- package/src/components/organisms/editors/rich-text-editor.tsx +126 -0
- package/src/components/organisms/editors/toolbar/md-toolbar.tsx +129 -0
- package/src/components/organisms/editors/toolbar/rte-toolbar.tsx +211 -0
- package/src/components/organisms/editors/toolbar/toolbar-shell.tsx +45 -0
- package/src/components/organisms/editors/use-codemirror-theme.ts +61 -0
- package/src/components/organisms/error-boundary.tsx +61 -0
- package/src/components/organisms/form.tsx +174 -0
- package/src/components/organisms/hover-card.tsx +114 -0
- package/src/components/organisms/menubar.tsx +491 -0
- package/src/components/organisms/navbar.tsx +101 -0
- package/src/components/organisms/navigation-menu.tsx +234 -0
- package/src/components/organisms/popover.tsx +144 -0
- package/src/components/organisms/resizable.tsx +39 -0
- package/src/components/organisms/schema-form.tsx +232 -0
- package/src/components/organisms/select.tsx +303 -0
- package/src/components/organisms/sheet.tsx +256 -0
- package/src/components/organisms/sidebar.tsx +1037 -0
- package/src/components/organisms/sonner.tsx +96 -0
- package/src/components/organisms/tabs.tsx +132 -0
- package/src/components/organisms/theme-provider.tsx +101 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/index.ts +547 -0
- package/src/lib/portal-container.tsx +35 -0
- package/src/lib/utils.ts +6 -0
- package/src/native.ts +23 -0
- package/src/tokens/colors.ts +91 -0
- package/src/tokens/index.ts +3 -0
- package/src/tokens/spacing.ts +55 -0
- package/src/tokens/typography.ts +27 -0
- package/styles/canvas.css +55 -0
- package/styles/dashboard-grid.css +47 -0
- package/styles/leaflet.css +13 -0
- package/styles/tokens.css +234 -0
- package/tailwind.config.ts +70 -0
- package/tsconfig.json +23 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
// Utility
|
|
2
|
+
|
|
3
|
+
/* ────────────────────────────────────────────────────────────────
|
|
4
|
+
ATOMS — single primitive wrappers, no composition.
|
|
5
|
+
Can import only: tokens/, lib/utils.
|
|
6
|
+
──────────────────────────────────────────────────────────────── */
|
|
7
|
+
export { AspectRatio } from "./components/atoms/aspect-ratio";
|
|
8
|
+
export { Avatar, AvatarFallback, AvatarImage } from "./components/atoms/avatar";
|
|
9
|
+
export { Badge, badgeVariants } from "./components/atoms/badge";
|
|
10
|
+
export { BrandMark, type BrandMarkProps } from "./components/atoms/brand-mark";
|
|
11
|
+
export { Button, type ButtonProps, buttonVariants } from "./components/atoms/button";
|
|
12
|
+
export { Checkbox } from "./components/atoms/checkbox";
|
|
13
|
+
export { FlexBox, type FlexBoxProps } from "./components/atoms/flex-box";
|
|
14
|
+
export {
|
|
15
|
+
Icon,
|
|
16
|
+
type IconName,
|
|
17
|
+
type IconProps,
|
|
18
|
+
iconNames,
|
|
19
|
+
} from "./components/atoms/icon";
|
|
20
|
+
export { Input } from "./components/atoms/input";
|
|
21
|
+
export { Label } from "./components/atoms/label";
|
|
22
|
+
export { Logo, type LogoProps } from "./components/atoms/logo";
|
|
23
|
+
export { Progress } from "./components/atoms/progress";
|
|
24
|
+
export { RadioGroup, RadioGroupItem } from "./components/atoms/radio-group";
|
|
25
|
+
export { ScrollArea, ScrollBar } from "./components/atoms/scroll-area";
|
|
26
|
+
export { Section, type SectionProps } from "./components/atoms/section";
|
|
27
|
+
export { Separator } from "./components/atoms/separator";
|
|
28
|
+
export { Skeleton } from "./components/atoms/skeleton";
|
|
29
|
+
export { Slider } from "./components/atoms/slider";
|
|
30
|
+
export { Switch } from "./components/atoms/switch";
|
|
31
|
+
export { Textarea } from "./components/atoms/textarea";
|
|
32
|
+
export { Toggle, toggleVariants } from "./components/atoms/toggle";
|
|
33
|
+
/* ────────────────────────────────────────────────────────────────
|
|
34
|
+
CHARTS — theme-aware Recharts wrappers + auto-palette container,
|
|
35
|
+
plus hand-rolled data-viz primitives (Gauge, StackedBar,
|
|
36
|
+
LabeledBarList, ServiceHealthList, ActivityHeatmap) built on
|
|
37
|
+
canvas tokens.
|
|
38
|
+
──────────────────────────────────────────────────────────────── */
|
|
39
|
+
export {
|
|
40
|
+
ActivityHeatmap,
|
|
41
|
+
type ActivityHeatmapProps,
|
|
42
|
+
} from "./components/charts/activity-heatmap";
|
|
43
|
+
export {
|
|
44
|
+
CartesianAxis,
|
|
45
|
+
PolarAngleAxis,
|
|
46
|
+
PolarRadiusAxis,
|
|
47
|
+
XAxis,
|
|
48
|
+
YAxis,
|
|
49
|
+
ZAxis,
|
|
50
|
+
} from "./components/charts/axes";
|
|
51
|
+
export {
|
|
52
|
+
type ChartConfig,
|
|
53
|
+
ChartContainer,
|
|
54
|
+
ChartStyle,
|
|
55
|
+
useChart,
|
|
56
|
+
} from "./components/charts/chart-container";
|
|
57
|
+
export { ChartLegend, ChartLegendContent } from "./components/charts/chart-legend";
|
|
58
|
+
export { ChartTooltip, ChartTooltipContent } from "./components/charts/chart-tooltip";
|
|
59
|
+
export {
|
|
60
|
+
AreaChart,
|
|
61
|
+
BarChart,
|
|
62
|
+
ComposedChart,
|
|
63
|
+
FunnelChart,
|
|
64
|
+
LineChart,
|
|
65
|
+
PieChart,
|
|
66
|
+
RadarChart,
|
|
67
|
+
RadialBarChart,
|
|
68
|
+
Sankey,
|
|
69
|
+
ScatterChart,
|
|
70
|
+
SunburstChart,
|
|
71
|
+
Treemap,
|
|
72
|
+
} from "./components/charts/chart-types";
|
|
73
|
+
export { Brush, Layer, ResponsiveContainer, Surface } from "./components/charts/containers";
|
|
74
|
+
export {
|
|
75
|
+
Area,
|
|
76
|
+
Bar,
|
|
77
|
+
Funnel,
|
|
78
|
+
Line,
|
|
79
|
+
Pie,
|
|
80
|
+
Radar,
|
|
81
|
+
RadialBar,
|
|
82
|
+
Scatter,
|
|
83
|
+
} from "./components/charts/data";
|
|
84
|
+
export {
|
|
85
|
+
ChartCell,
|
|
86
|
+
ChartCustomized,
|
|
87
|
+
Cross,
|
|
88
|
+
Curve,
|
|
89
|
+
Dot,
|
|
90
|
+
ErrorBar,
|
|
91
|
+
Polygon,
|
|
92
|
+
Rectangle,
|
|
93
|
+
Sector,
|
|
94
|
+
Trapezoid,
|
|
95
|
+
} from "./components/charts/details";
|
|
96
|
+
export { Gauge, type GaugeProps } from "./components/charts/gauge";
|
|
97
|
+
export { CartesianGrid, PolarGrid } from "./components/charts/grids";
|
|
98
|
+
export {
|
|
99
|
+
LabeledBarList,
|
|
100
|
+
type LabeledBarListItem,
|
|
101
|
+
type LabeledBarListProps,
|
|
102
|
+
} from "./components/charts/labeled-bar-list";
|
|
103
|
+
export {
|
|
104
|
+
ReferenceArea,
|
|
105
|
+
ReferenceDot,
|
|
106
|
+
ReferenceLine,
|
|
107
|
+
} from "./components/charts/references";
|
|
108
|
+
export {
|
|
109
|
+
type ServiceHealthItem,
|
|
110
|
+
ServiceHealthList,
|
|
111
|
+
type ServiceHealthListProps,
|
|
112
|
+
type ServiceHealthStatus,
|
|
113
|
+
} from "./components/charts/service-health-list";
|
|
114
|
+
export {
|
|
115
|
+
Sparkline,
|
|
116
|
+
type SparklineProps,
|
|
117
|
+
} from "./components/charts/sparkline";
|
|
118
|
+
export {
|
|
119
|
+
StackedBar,
|
|
120
|
+
type StackedBarProps,
|
|
121
|
+
type StackedBarSegment,
|
|
122
|
+
} from "./components/charts/stacked-bar";
|
|
123
|
+
export { ChartLabel, LabelList, Text } from "./components/charts/text";
|
|
124
|
+
export {
|
|
125
|
+
WorldHeatMap,
|
|
126
|
+
type WorldHeatMapPoint,
|
|
127
|
+
type WorldHeatMapProps,
|
|
128
|
+
} from "./components/charts/world-heat-map";
|
|
129
|
+
/* ────────────────────────────────────────────────────────────────
|
|
130
|
+
MOLECULES — small compositions of atoms.
|
|
131
|
+
Can import: tokens/, lib/utils, atoms/.
|
|
132
|
+
──────────────────────────────────────────────────────────────── */
|
|
133
|
+
export {
|
|
134
|
+
ActionBar,
|
|
135
|
+
type ActionBarAction,
|
|
136
|
+
type ActionBarProps,
|
|
137
|
+
type ActionBarSecondary,
|
|
138
|
+
} from "./components/molecules/action-bar";
|
|
139
|
+
export {
|
|
140
|
+
ActivityFeed,
|
|
141
|
+
type ActivityFeedProps,
|
|
142
|
+
ActivityItem,
|
|
143
|
+
type ActivityItemProps,
|
|
144
|
+
} from "./components/molecules/activity-item";
|
|
145
|
+
export { Alert, AlertDescription, AlertTitle } from "./components/molecules/alert";
|
|
146
|
+
export {
|
|
147
|
+
AnimatedBackground,
|
|
148
|
+
type AnimatedBackgroundOrb,
|
|
149
|
+
type AnimatedBackgroundProps,
|
|
150
|
+
} from "./components/molecules/animated-background";
|
|
151
|
+
export {
|
|
152
|
+
BrandLockup,
|
|
153
|
+
type BrandLockupProps,
|
|
154
|
+
} from "./components/molecules/brand-lockup";
|
|
155
|
+
export {
|
|
156
|
+
Breadcrumb,
|
|
157
|
+
BreadcrumbEllipsis,
|
|
158
|
+
BreadcrumbItem,
|
|
159
|
+
BreadcrumbLink,
|
|
160
|
+
BreadcrumbList,
|
|
161
|
+
BreadcrumbPage,
|
|
162
|
+
BreadcrumbSeparator,
|
|
163
|
+
} from "./components/molecules/breadcrumb";
|
|
164
|
+
export {
|
|
165
|
+
ButtonGroup,
|
|
166
|
+
ButtonGroupSeparator,
|
|
167
|
+
ButtonGroupText,
|
|
168
|
+
buttonGroupVariants,
|
|
169
|
+
} from "./components/molecules/button-group";
|
|
170
|
+
export { Calendar, CalendarDayButton } from "./components/molecules/calendar";
|
|
171
|
+
export {
|
|
172
|
+
Card,
|
|
173
|
+
CardContent,
|
|
174
|
+
CardDescription,
|
|
175
|
+
CardFooter,
|
|
176
|
+
CardHeader,
|
|
177
|
+
CardTitle,
|
|
178
|
+
} from "./components/molecules/card";
|
|
179
|
+
export { CodeBlock, type CodeBlockProps } from "./components/molecules/code-block";
|
|
180
|
+
export { EmptyState, type EmptyStateProps } from "./components/molecules/empty-state";
|
|
181
|
+
export { ErrorState, type ErrorStateProps } from "./components/molecules/error-state";
|
|
182
|
+
export {
|
|
183
|
+
FieldDisplay,
|
|
184
|
+
type FieldDisplayProps,
|
|
185
|
+
} from "./components/molecules/field-display";
|
|
186
|
+
export {
|
|
187
|
+
InputOTP,
|
|
188
|
+
InputOTPGroup,
|
|
189
|
+
InputOTPSeparator,
|
|
190
|
+
InputOTPSlot,
|
|
191
|
+
} from "./components/molecules/input-otp";
|
|
192
|
+
export {
|
|
193
|
+
LoadingState,
|
|
194
|
+
type LoadingStateProps,
|
|
195
|
+
} from "./components/molecules/loading-state";
|
|
196
|
+
export {
|
|
197
|
+
NotificationItem,
|
|
198
|
+
type NotificationItemProps,
|
|
199
|
+
} from "./components/molecules/notification-item";
|
|
200
|
+
export {
|
|
201
|
+
NotificationList,
|
|
202
|
+
type NotificationListProps,
|
|
203
|
+
} from "./components/molecules/notification-list";
|
|
204
|
+
export {
|
|
205
|
+
NumberBadge,
|
|
206
|
+
type NumberBadgeProps,
|
|
207
|
+
} from "./components/molecules/number-badge";
|
|
208
|
+
export {
|
|
209
|
+
PageHeader,
|
|
210
|
+
type PageHeaderBreadcrumb,
|
|
211
|
+
type PageHeaderProps,
|
|
212
|
+
} from "./components/molecules/page-header";
|
|
213
|
+
export {
|
|
214
|
+
PageTabs,
|
|
215
|
+
type PageTabsItem,
|
|
216
|
+
type PageTabsProps,
|
|
217
|
+
} from "./components/molecules/page-tabs";
|
|
218
|
+
export {
|
|
219
|
+
Pagination,
|
|
220
|
+
PaginationContent,
|
|
221
|
+
PaginationEllipsis,
|
|
222
|
+
PaginationItem,
|
|
223
|
+
PaginationLink,
|
|
224
|
+
PaginationNext,
|
|
225
|
+
PaginationPrevious,
|
|
226
|
+
} from "./components/molecules/pagination";
|
|
227
|
+
export {
|
|
228
|
+
PhoneInput,
|
|
229
|
+
type PhoneInputProps,
|
|
230
|
+
} from "./components/molecules/phone-input";
|
|
231
|
+
export { SearchBar, type SearchBarProps } from "./components/molecules/search-bar";
|
|
232
|
+
export {
|
|
233
|
+
SecretField,
|
|
234
|
+
type SecretFieldProps,
|
|
235
|
+
type SecretFieldStatus,
|
|
236
|
+
} from "./components/molecules/secret-field";
|
|
237
|
+
export {
|
|
238
|
+
SectionCard,
|
|
239
|
+
type SectionCardProps,
|
|
240
|
+
} from "./components/molecules/section-card";
|
|
241
|
+
export { StatCard, type StatCardProps } from "./components/molecules/stat-card";
|
|
242
|
+
export {
|
|
243
|
+
StatusBadge,
|
|
244
|
+
type StatusBadgeProps,
|
|
245
|
+
statusBadgeVariants,
|
|
246
|
+
} from "./components/molecules/status-badge";
|
|
247
|
+
export {
|
|
248
|
+
Stepper,
|
|
249
|
+
type StepperProps,
|
|
250
|
+
type StepperStep,
|
|
251
|
+
type StepStatus,
|
|
252
|
+
} from "./components/molecules/stepper";
|
|
253
|
+
export {
|
|
254
|
+
Table,
|
|
255
|
+
TableBody,
|
|
256
|
+
TableCaption,
|
|
257
|
+
TableCell,
|
|
258
|
+
TableFooter,
|
|
259
|
+
TableHead,
|
|
260
|
+
TableHeader,
|
|
261
|
+
TableRow,
|
|
262
|
+
} from "./components/molecules/table";
|
|
263
|
+
export { ToggleGroup, ToggleGroupItem } from "./components/molecules/toggle-group";
|
|
264
|
+
export {
|
|
265
|
+
Tooltip,
|
|
266
|
+
TooltipContent,
|
|
267
|
+
TooltipProvider,
|
|
268
|
+
TooltipTrigger,
|
|
269
|
+
} from "./components/molecules/tooltip";
|
|
270
|
+
export {
|
|
271
|
+
UserAvatarChip,
|
|
272
|
+
type UserAvatarChipProps,
|
|
273
|
+
} from "./components/molecules/user-avatar-chip";
|
|
274
|
+
/* ────────────────────────────────────────────────────────────────
|
|
275
|
+
ORGANISMS — stateful surfaces, compositions of atoms + molecules.
|
|
276
|
+
Can import: tokens/, lib/utils, atoms/, molecules/.
|
|
277
|
+
──────────────────────────────────────────────────────────────── */
|
|
278
|
+
export {
|
|
279
|
+
Accordion,
|
|
280
|
+
AccordionContent,
|
|
281
|
+
AccordionItem,
|
|
282
|
+
AccordionTrigger,
|
|
283
|
+
} from "./components/organisms/accordion";
|
|
284
|
+
export {
|
|
285
|
+
AlertDialog,
|
|
286
|
+
AlertDialogAction,
|
|
287
|
+
AlertDialogCancel,
|
|
288
|
+
AlertDialogContent,
|
|
289
|
+
AlertDialogDescription,
|
|
290
|
+
AlertDialogFooter,
|
|
291
|
+
AlertDialogHeader,
|
|
292
|
+
AlertDialogOverlay,
|
|
293
|
+
AlertDialogPortal,
|
|
294
|
+
AlertDialogTitle,
|
|
295
|
+
AlertDialogTrigger,
|
|
296
|
+
} from "./components/organisms/alert-dialog";
|
|
297
|
+
export {
|
|
298
|
+
Carousel,
|
|
299
|
+
type CarouselApi,
|
|
300
|
+
CarouselContent,
|
|
301
|
+
CarouselItem,
|
|
302
|
+
CarouselNext,
|
|
303
|
+
CarouselPrevious,
|
|
304
|
+
} from "./components/organisms/carousel";
|
|
305
|
+
export {
|
|
306
|
+
Collapsible,
|
|
307
|
+
CollapsibleContent,
|
|
308
|
+
CollapsibleTrigger,
|
|
309
|
+
} from "./components/organisms/collapsible";
|
|
310
|
+
export {
|
|
311
|
+
Command,
|
|
312
|
+
CommandDialog,
|
|
313
|
+
CommandEmpty,
|
|
314
|
+
CommandGroup,
|
|
315
|
+
CommandInput,
|
|
316
|
+
CommandItem,
|
|
317
|
+
CommandList,
|
|
318
|
+
CommandSeparator,
|
|
319
|
+
CommandShortcut,
|
|
320
|
+
} from "./components/organisms/command";
|
|
321
|
+
export {
|
|
322
|
+
ContextMenu,
|
|
323
|
+
ContextMenuCheckboxItem,
|
|
324
|
+
ContextMenuContent,
|
|
325
|
+
ContextMenuGroup,
|
|
326
|
+
ContextMenuItem,
|
|
327
|
+
ContextMenuLabel,
|
|
328
|
+
ContextMenuPortal,
|
|
329
|
+
ContextMenuRadioGroup,
|
|
330
|
+
ContextMenuRadioItem,
|
|
331
|
+
ContextMenuSeparator,
|
|
332
|
+
ContextMenuShortcut,
|
|
333
|
+
ContextMenuSub,
|
|
334
|
+
ContextMenuSubContent,
|
|
335
|
+
ContextMenuSubTrigger,
|
|
336
|
+
ContextMenuTrigger,
|
|
337
|
+
} from "./components/organisms/context-menu";
|
|
338
|
+
export {
|
|
339
|
+
DashboardGrid,
|
|
340
|
+
type DashboardGridBreakpoint,
|
|
341
|
+
type DashboardGridProps,
|
|
342
|
+
type DashboardItem,
|
|
343
|
+
} from "./components/organisms/dashboard-grid";
|
|
344
|
+
export {
|
|
345
|
+
DataTable,
|
|
346
|
+
type DataTableColumn,
|
|
347
|
+
type DataTableProps,
|
|
348
|
+
} from "./components/organisms/data-table";
|
|
349
|
+
export {
|
|
350
|
+
Dialog,
|
|
351
|
+
DialogClose,
|
|
352
|
+
DialogContent,
|
|
353
|
+
DialogDescription,
|
|
354
|
+
DialogFooter,
|
|
355
|
+
DialogHeader,
|
|
356
|
+
DialogOverlay,
|
|
357
|
+
DialogPortal,
|
|
358
|
+
DialogTitle,
|
|
359
|
+
DialogTrigger,
|
|
360
|
+
} from "./components/organisms/dialog";
|
|
361
|
+
export {
|
|
362
|
+
Drawer,
|
|
363
|
+
DrawerClose,
|
|
364
|
+
DrawerContent,
|
|
365
|
+
DrawerDescription,
|
|
366
|
+
DrawerFooter,
|
|
367
|
+
DrawerHeader,
|
|
368
|
+
DrawerOverlay,
|
|
369
|
+
DrawerPortal,
|
|
370
|
+
DrawerTitle,
|
|
371
|
+
DrawerTrigger,
|
|
372
|
+
} from "./components/organisms/drawer";
|
|
373
|
+
export {
|
|
374
|
+
DropdownMenu,
|
|
375
|
+
DropdownMenuCheckboxItem,
|
|
376
|
+
DropdownMenuContent,
|
|
377
|
+
DropdownMenuGroup,
|
|
378
|
+
DropdownMenuItem,
|
|
379
|
+
DropdownMenuLabel,
|
|
380
|
+
DropdownMenuPortal,
|
|
381
|
+
DropdownMenuRadioGroup,
|
|
382
|
+
DropdownMenuRadioItem,
|
|
383
|
+
DropdownMenuSeparator,
|
|
384
|
+
DropdownMenuShortcut,
|
|
385
|
+
DropdownMenuSub,
|
|
386
|
+
DropdownMenuSubContent,
|
|
387
|
+
DropdownMenuSubTrigger,
|
|
388
|
+
DropdownMenuTrigger,
|
|
389
|
+
} from "./components/organisms/dropdown-menu";
|
|
390
|
+
export {
|
|
391
|
+
CodeEditor,
|
|
392
|
+
type CodeEditorLanguage,
|
|
393
|
+
type CodeEditorProps,
|
|
394
|
+
MarkdownEditor,
|
|
395
|
+
type MarkdownEditorProps,
|
|
396
|
+
RichTextEditor,
|
|
397
|
+
type RichTextEditorProps,
|
|
398
|
+
TOOLBAR_ITEM_IDS,
|
|
399
|
+
type ToolbarItemId,
|
|
400
|
+
} from "./components/organisms/editors";
|
|
401
|
+
export {
|
|
402
|
+
ErrorBoundary,
|
|
403
|
+
type ErrorBoundaryProps,
|
|
404
|
+
} from "./components/organisms/error-boundary";
|
|
405
|
+
export {
|
|
406
|
+
Form,
|
|
407
|
+
FormControl,
|
|
408
|
+
FormDescription,
|
|
409
|
+
FormField,
|
|
410
|
+
FormItem,
|
|
411
|
+
FormLabel,
|
|
412
|
+
FormMessage,
|
|
413
|
+
useFormField,
|
|
414
|
+
} from "./components/organisms/form";
|
|
415
|
+
export {
|
|
416
|
+
HoverCard,
|
|
417
|
+
HoverCardContent,
|
|
418
|
+
HoverCardTrigger,
|
|
419
|
+
} from "./components/organisms/hover-card";
|
|
420
|
+
export {
|
|
421
|
+
Menubar,
|
|
422
|
+
MenubarCheckboxItem,
|
|
423
|
+
MenubarContent,
|
|
424
|
+
MenubarGroup,
|
|
425
|
+
MenubarItem,
|
|
426
|
+
MenubarLabel,
|
|
427
|
+
MenubarMenu,
|
|
428
|
+
MenubarPortal,
|
|
429
|
+
MenubarRadioGroup,
|
|
430
|
+
MenubarRadioItem,
|
|
431
|
+
MenubarSeparator,
|
|
432
|
+
MenubarShortcut,
|
|
433
|
+
MenubarSub,
|
|
434
|
+
MenubarSubContent,
|
|
435
|
+
MenubarSubTrigger,
|
|
436
|
+
MenubarTrigger,
|
|
437
|
+
} from "./components/organisms/menubar";
|
|
438
|
+
export {
|
|
439
|
+
NavBar,
|
|
440
|
+
type NavBarProps,
|
|
441
|
+
type NavLink,
|
|
442
|
+
} from "./components/organisms/navbar";
|
|
443
|
+
export {
|
|
444
|
+
NavigationMenu,
|
|
445
|
+
NavigationMenuContent,
|
|
446
|
+
NavigationMenuIndicator,
|
|
447
|
+
NavigationMenuItem,
|
|
448
|
+
NavigationMenuLink,
|
|
449
|
+
NavigationMenuList,
|
|
450
|
+
NavigationMenuTrigger,
|
|
451
|
+
NavigationMenuViewport,
|
|
452
|
+
navigationMenuTriggerStyle,
|
|
453
|
+
} from "./components/organisms/navigation-menu";
|
|
454
|
+
export {
|
|
455
|
+
Popover,
|
|
456
|
+
PopoverAnchor,
|
|
457
|
+
PopoverContent,
|
|
458
|
+
PopoverTrigger,
|
|
459
|
+
} from "./components/organisms/popover";
|
|
460
|
+
export {
|
|
461
|
+
ResizableHandle,
|
|
462
|
+
ResizablePanel,
|
|
463
|
+
ResizablePanelGroup,
|
|
464
|
+
} from "./components/organisms/resizable";
|
|
465
|
+
export {
|
|
466
|
+
canvasSchemaFormTemplates,
|
|
467
|
+
canvasSchemaFormWidgets,
|
|
468
|
+
type IChangeEvent,
|
|
469
|
+
type RJSFSchema,
|
|
470
|
+
SchemaForm,
|
|
471
|
+
type SchemaFormProps,
|
|
472
|
+
type UiSchema,
|
|
473
|
+
type WidgetProps,
|
|
474
|
+
} from "./components/organisms/schema-form";
|
|
475
|
+
export {
|
|
476
|
+
Select,
|
|
477
|
+
SelectContent,
|
|
478
|
+
SelectGroup,
|
|
479
|
+
SelectItem,
|
|
480
|
+
SelectLabel,
|
|
481
|
+
SelectScrollDownButton,
|
|
482
|
+
SelectScrollUpButton,
|
|
483
|
+
SelectSeparator,
|
|
484
|
+
SelectTrigger,
|
|
485
|
+
SelectValue,
|
|
486
|
+
} from "./components/organisms/select";
|
|
487
|
+
export {
|
|
488
|
+
Sheet,
|
|
489
|
+
SheetClose,
|
|
490
|
+
SheetContent,
|
|
491
|
+
SheetDescription,
|
|
492
|
+
SheetFooter,
|
|
493
|
+
SheetHeader,
|
|
494
|
+
SheetOverlay,
|
|
495
|
+
SheetPortal,
|
|
496
|
+
SheetTitle,
|
|
497
|
+
SheetTrigger,
|
|
498
|
+
} from "./components/organisms/sheet";
|
|
499
|
+
export {
|
|
500
|
+
Sidebar,
|
|
501
|
+
SidebarContent,
|
|
502
|
+
SidebarFooter,
|
|
503
|
+
SidebarGroup,
|
|
504
|
+
SidebarGroupAction,
|
|
505
|
+
SidebarGroupContent,
|
|
506
|
+
SidebarGroupLabel,
|
|
507
|
+
SidebarHeader,
|
|
508
|
+
SidebarInput,
|
|
509
|
+
SidebarInset,
|
|
510
|
+
SidebarMenu,
|
|
511
|
+
SidebarMenuAction,
|
|
512
|
+
SidebarMenuBadge,
|
|
513
|
+
SidebarMenuButton,
|
|
514
|
+
SidebarMenuItem,
|
|
515
|
+
SidebarMenuSkeleton,
|
|
516
|
+
SidebarMenuSub,
|
|
517
|
+
SidebarMenuSubButton,
|
|
518
|
+
SidebarMenuSubItem,
|
|
519
|
+
SidebarProvider,
|
|
520
|
+
SidebarRail,
|
|
521
|
+
SidebarSeparator,
|
|
522
|
+
SidebarTrigger,
|
|
523
|
+
useSidebar,
|
|
524
|
+
} from "./components/organisms/sidebar";
|
|
525
|
+
export { Toaster, toast } from "./components/organisms/sonner";
|
|
526
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./components/organisms/tabs";
|
|
527
|
+
export {
|
|
528
|
+
type ResolvedTheme,
|
|
529
|
+
type Theme,
|
|
530
|
+
ThemeProvider,
|
|
531
|
+
type ThemeProviderProps,
|
|
532
|
+
useTheme,
|
|
533
|
+
} from "./components/organisms/theme-provider";
|
|
534
|
+
// Hooks
|
|
535
|
+
export { useIsMobile } from "./hooks/use-mobile";
|
|
536
|
+
export {
|
|
537
|
+
PortalContainerProvider,
|
|
538
|
+
usePortalContainer,
|
|
539
|
+
} from "./lib/portal-container";
|
|
540
|
+
export { cn } from "./lib/utils";
|
|
541
|
+
|
|
542
|
+
/* ────────────────────────────────────────────────────────────────
|
|
543
|
+
Design tokens (cross-platform)
|
|
544
|
+
──────────────────────────────────────────────────────────────── */
|
|
545
|
+
export { colors, hslToString, hslToVar } from "./tokens/colors";
|
|
546
|
+
export { defaultRadius, radius, spacing } from "./tokens/spacing";
|
|
547
|
+
export { fontFamily, fontSize, fontWeight } from "./tokens/typography";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Where Radix-portalled UI (Select, DropdownMenu, Popover, Dialog, Tooltip,
|
|
7
|
+
* etc.) should mount. Defaults to `undefined`, which lets each Radix Portal
|
|
8
|
+
* fall back to its built-in default (`document.body`).
|
|
9
|
+
*
|
|
10
|
+
* Apps that render canvas inside iframes (e.g. the docs site's example
|
|
11
|
+
* previews) override this with the iframe's body so the portalled content
|
|
12
|
+
* stays in the same document as the trigger — without that, Radix's
|
|
13
|
+
* outside-click detection treats the iframe boundary as "outside" and the
|
|
14
|
+
* dropdown closes the moment it opens.
|
|
15
|
+
*/
|
|
16
|
+
const PortalContainerContext = React.createContext<HTMLElement | null | undefined>(undefined);
|
|
17
|
+
|
|
18
|
+
export interface PortalContainerProviderProps {
|
|
19
|
+
value: HTMLElement | null | undefined;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function PortalContainerProvider({ value, children }: PortalContainerProviderProps) {
|
|
24
|
+
return (
|
|
25
|
+
<PortalContainerContext.Provider value={value}>{children}</PortalContainerContext.Provider>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Read the current portal container. Returns `undefined` if no provider is
|
|
31
|
+
* mounted (Radix falls back to its default).
|
|
32
|
+
*/
|
|
33
|
+
export function usePortalContainer(): HTMLElement | null | undefined {
|
|
34
|
+
return React.useContext(PortalContainerContext);
|
|
35
|
+
}
|
package/src/lib/utils.ts
ADDED
package/src/native.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Native entry point.
|
|
3
|
+
*
|
|
4
|
+
* Currently exports only platform-agnostic tokens and types.
|
|
5
|
+
* When an RN app is built, add .native.tsx component implementations
|
|
6
|
+
* alongside the web components and export them here.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export type { ButtonProps } from "./components/atoms/button";
|
|
10
|
+
// Types only (no DOM dependencies)
|
|
11
|
+
export type { IconName, IconProps } from "./components/atoms/icon";
|
|
12
|
+
export type { CodeBlockProps } from "./components/molecules/code-block";
|
|
13
|
+
export type { EmptyStateProps } from "./components/molecules/empty-state";
|
|
14
|
+
export type { ErrorStateProps } from "./components/molecules/error-state";
|
|
15
|
+
export type { FieldDisplayProps } from "./components/molecules/field-display";
|
|
16
|
+
export type { LoadingStateProps } from "./components/molecules/loading-state";
|
|
17
|
+
export type { SearchBarProps } from "./components/molecules/search-bar";
|
|
18
|
+
export type { StatusBadgeProps } from "./components/molecules/status-badge";
|
|
19
|
+
export type { DataTableColumn, DataTableProps } from "./components/organisms/data-table";
|
|
20
|
+
// Design tokens (shared with web)
|
|
21
|
+
export { colors, hslToString, hslToVar } from "./tokens/colors";
|
|
22
|
+
export { defaultRadius, radius, spacing } from "./tokens/spacing";
|
|
23
|
+
export { fontFamily, fontSize, fontWeight } from "./tokens/typography";
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* shadcn/ui default color tokens — platform-agnostic.
|
|
3
|
+
* Used by both web (via CSS custom properties) and React Native (via NativeWind/direct).
|
|
4
|
+
*
|
|
5
|
+
* Values are HSL arrays [h, s%, l%] matching the shadcn zinc/neutral theme.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const colors = {
|
|
9
|
+
light: {
|
|
10
|
+
background: [0, 0, 100],
|
|
11
|
+
foreground: [240, 10, 3.9],
|
|
12
|
+
card: [0, 0, 100],
|
|
13
|
+
cardForeground: [240, 10, 3.9],
|
|
14
|
+
popover: [0, 0, 100],
|
|
15
|
+
popoverForeground: [240, 10, 3.9],
|
|
16
|
+
primary: [240, 5.9, 10],
|
|
17
|
+
primaryForeground: [0, 0, 98],
|
|
18
|
+
secondary: [240, 4.8, 95.9],
|
|
19
|
+
secondaryForeground: [240, 5.9, 10],
|
|
20
|
+
muted: [240, 4.8, 95.9],
|
|
21
|
+
mutedForeground: [240, 3.8, 46.1],
|
|
22
|
+
accent: [240, 4.8, 95.9],
|
|
23
|
+
accentForeground: [240, 5.9, 10],
|
|
24
|
+
destructive: [0, 84.2, 60.2],
|
|
25
|
+
destructiveForeground: [0, 0, 98],
|
|
26
|
+
border: [240, 5.9, 90],
|
|
27
|
+
input: [240, 5.9, 90],
|
|
28
|
+
ring: [240, 5.9, 10],
|
|
29
|
+
chart1: [12, 76, 61],
|
|
30
|
+
chart2: [173, 58, 39],
|
|
31
|
+
chart3: [197, 37, 24],
|
|
32
|
+
chart4: [43, 74, 66],
|
|
33
|
+
chart5: [27, 87, 67],
|
|
34
|
+
sidebar: {
|
|
35
|
+
background: [230, 25, 97],
|
|
36
|
+
foreground: [230, 15, 40],
|
|
37
|
+
primary: [230, 45, 25],
|
|
38
|
+
primaryForeground: [0, 0, 98],
|
|
39
|
+
accent: [230, 40, 92],
|
|
40
|
+
accentForeground: [230, 45, 25],
|
|
41
|
+
border: [230, 20, 90],
|
|
42
|
+
ring: [217.2, 91.2, 59.8],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
dark: {
|
|
46
|
+
background: [240, 10, 3.9],
|
|
47
|
+
foreground: [0, 0, 98],
|
|
48
|
+
card: [240, 10, 3.9],
|
|
49
|
+
cardForeground: [0, 0, 98],
|
|
50
|
+
popover: [240, 10, 3.9],
|
|
51
|
+
popoverForeground: [0, 0, 98],
|
|
52
|
+
primary: [0, 0, 98],
|
|
53
|
+
primaryForeground: [240, 5.9, 10],
|
|
54
|
+
secondary: [240, 3.7, 15.9],
|
|
55
|
+
secondaryForeground: [0, 0, 98],
|
|
56
|
+
muted: [240, 3.7, 15.9],
|
|
57
|
+
mutedForeground: [240, 5, 64.9],
|
|
58
|
+
accent: [240, 3.7, 15.9],
|
|
59
|
+
accentForeground: [0, 0, 98],
|
|
60
|
+
destructive: [0, 62.8, 30.6],
|
|
61
|
+
destructiveForeground: [0, 0, 98],
|
|
62
|
+
border: [240, 3.7, 15.9],
|
|
63
|
+
input: [240, 3.7, 15.9],
|
|
64
|
+
ring: [240, 4.9, 83.9],
|
|
65
|
+
chart1: [220, 70, 50],
|
|
66
|
+
chart2: [160, 60, 45],
|
|
67
|
+
chart3: [30, 80, 55],
|
|
68
|
+
chart4: [280, 65, 60],
|
|
69
|
+
chart5: [340, 75, 55],
|
|
70
|
+
sidebar: {
|
|
71
|
+
background: [230, 12, 10],
|
|
72
|
+
foreground: [230, 8, 80],
|
|
73
|
+
primary: [217, 91, 65],
|
|
74
|
+
primaryForeground: [0, 0, 100],
|
|
75
|
+
accent: [230, 25, 22],
|
|
76
|
+
accentForeground: [230, 60, 88],
|
|
77
|
+
border: [230, 8, 18],
|
|
78
|
+
ring: [217.2, 91.2, 59.8],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
} as const;
|
|
82
|
+
|
|
83
|
+
/** Convert an HSL tuple to a CSS-compatible string */
|
|
84
|
+
export function hslToString(hsl: readonly [number, number, number]): string {
|
|
85
|
+
return `hsl(${hsl[0]} ${hsl[1]}% ${hsl[2]}%)`;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Convert an HSL tuple to the space-separated format used in CSS variables */
|
|
89
|
+
export function hslToVar(hsl: readonly [number, number, number]): string {
|
|
90
|
+
return `${hsl[0]} ${hsl[1]}% ${hsl[2]}%`;
|
|
91
|
+
}
|