@omniviewdev/ui 0.1.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/LICENSE +661 -0
- package/dist/Button-Dmu1cikC.cjs +1 -0
- package/dist/Button-lr02bh_m.js +51 -0
- package/dist/CodeBlock-B1iQO7zU.js +73 -0
- package/dist/CodeBlock-CIyG0DbW.cjs +2 -0
- package/dist/CopyButton-CACe3RCF.cjs +1 -0
- package/dist/CopyButton-DPBgL0K8.js +77 -0
- package/dist/ErrorState-CexYrMpy.js +188 -0
- package/dist/ErrorState-CnIR-1xa.cjs +1 -0
- package/dist/HotkeyHint-6SOi-MaU.js +37 -0
- package/dist/HotkeyHint-DrTOTrIM.cjs +1 -0
- package/dist/Icon-CKdIOrjZ.cjs +1 -0
- package/dist/Icon-CuO9W7cA.js +27 -0
- package/dist/SearchInput-CFBBNdI2.cjs +1 -0
- package/dist/SearchInput-D3AsCI5H.js +41 -0
- package/dist/Select-CnRBSc5w.cjs +1 -0
- package/dist/Select-DTUF31OP.js +206 -0
- package/dist/Skeleton-BUYyXUiC.js +32 -0
- package/dist/Skeleton-CfdQWLQM.cjs +1 -0
- package/dist/StatusDot-CYyJxjJK.cjs +1 -0
- package/dist/StatusDot-CncykBAY.js +68 -0
- package/dist/StatusPill-C1NaiCzd.js +29 -0
- package/dist/StatusPill-C7yn7dSA.cjs +1 -0
- package/dist/TabPanel-CkUSl6Bt.cjs +1 -0
- package/dist/TabPanel-DLHbgKpl.js +124 -0
- package/dist/Text-By4P3in5.js +71 -0
- package/dist/Text-Mk6Uyg1w.cjs +1 -0
- package/dist/Tooltip-44-P5KfQ.cjs +1 -0
- package/dist/Tooltip-BEVuYuZ3.js +41 -0
- package/dist/_commonjsHelpers-CvWRHxnb.js +26 -0
- package/dist/_commonjsHelpers-D3HyQheV.cjs +1 -0
- package/dist/buttons/ActionMenu.d.ts +21 -0
- package/dist/buttons/Button.d.ts +31 -0
- package/dist/buttons/ButtonGroup.d.ts +18 -0
- package/dist/buttons/ConfirmButton.d.ts +10 -0
- package/dist/buttons/CopyButton.d.ts +11 -0
- package/dist/buttons/IconButton.d.ts +21 -0
- package/dist/buttons/SearchBar.d.ts +22 -0
- package/dist/buttons/ToggleButton.d.ts +18 -0
- package/dist/buttons/ToggleGroup.d.ts +23 -0
- package/dist/buttons/Toolbar.d.ts +15 -0
- package/dist/buttons/ToolbarGroup.d.ts +11 -0
- package/dist/buttons/index.d.ts +22 -0
- package/dist/buttons.cjs +1 -0
- package/dist/buttons.js +430 -0
- package/dist/cells/BadgesCell.d.ts +19 -0
- package/dist/cells/ChipCell.d.ts +16 -0
- package/dist/cells/SelectBoxHeader.d.ts +11 -0
- package/dist/cells/SelectBoxRow.d.ts +11 -0
- package/dist/cells/TextCell.d.ts +25 -0
- package/dist/cells/index.d.ts +5 -0
- package/dist/cells.cjs +1 -0
- package/dist/cells.js +284 -0
- package/dist/charts/BarChart.d.ts +15 -0
- package/dist/charts/ChartContainer.d.ts +12 -0
- package/dist/charts/ChartLegend.d.ts +11 -0
- package/dist/charts/GaugeCard.d.ts +18 -0
- package/dist/charts/MetricsPanel.d.ts +61 -0
- package/dist/charts/PieChart.d.ts +13 -0
- package/dist/charts/ScatterChart.d.ts +25 -0
- package/dist/charts/Sparkline.d.ts +16 -0
- package/dist/charts/StackedAreaChart.d.ts +18 -0
- package/dist/charts/TimeSeriesChart.d.ts +43 -0
- package/dist/charts/formatters.d.ts +17 -0
- package/dist/charts/index.d.ts +21 -0
- package/dist/charts/palette.d.ts +7 -0
- package/dist/charts/types.d.ts +67 -0
- package/dist/charts/useChartTheme.d.ts +13 -0
- package/dist/charts.cjs +1 -0
- package/dist/charts.js +967 -0
- package/dist/components/ActionCard.d.ts +22 -0
- package/dist/components/AspectRatio.d.ts +13 -0
- package/dist/components/Avatar.d.ts +19 -0
- package/dist/components/Badge.d.ts +22 -0
- package/dist/components/Card.d.ts +24 -0
- package/dist/components/Chip.d.ts +32 -0
- package/dist/components/ClipboardText.d.ts +14 -0
- package/dist/components/DetailsCard.d.ts +25 -0
- package/dist/components/EmptySearch.d.ts +12 -0
- package/dist/components/ExpandableSections.d.ts +51 -0
- package/dist/components/FileIcon.d.ts +12 -0
- package/dist/components/HotkeyHint.d.ts +8 -0
- package/dist/components/Icon.d.ts +7 -0
- package/dist/components/InlineEdit.d.ts +14 -0
- package/dist/components/KVCard.d.ts +12 -0
- package/dist/components/Kbd.d.ts +8 -0
- package/dist/components/List.d.ts +29 -0
- package/dist/components/ListCard.d.ts +30 -0
- package/dist/components/ListItem.d.ts +27 -0
- package/dist/components/LoadingOverlay.d.ts +14 -0
- package/dist/components/MediaCard.d.ts +24 -0
- package/dist/components/MetricsSection.d.ts +37 -0
- package/dist/components/OverflowText.d.ts +12 -0
- package/dist/components/StatCard.d.ts +26 -0
- package/dist/components/StatusCard.d.ts +29 -0
- package/dist/components/TruncatedList.d.ts +13 -0
- package/dist/domain/DescriptionList.d.ts +12 -0
- package/dist/domain/EventsList.d.ts +11 -0
- package/dist/domain/FilterBar.d.ts +23 -0
- package/dist/domain/LogsViewer.d.ts +15 -0
- package/dist/domain/MetricCard.d.ts +14 -0
- package/dist/domain/ObjectInspector.d.ts +19 -0
- package/dist/domain/ResourceBreadcrumb.d.ts +19 -0
- package/dist/domain/ResourceRef.d.ts +15 -0
- package/dist/domain/ResourceStatus.d.ts +17 -0
- package/dist/domain/SecretValueMask.d.ts +11 -0
- package/dist/domain/Timeline.d.ts +21 -0
- package/dist/domain/index.d.ts +23 -0
- package/dist/domain/types.d.ts +25 -0
- package/dist/domain.cjs +1 -0
- package/dist/domain.js +871 -0
- package/dist/editors/CodeEditor.d.ts +19 -0
- package/dist/editors/CommandPalette.d.ts +22 -0
- package/dist/editors/DiffViewer.d.ts +14 -0
- package/dist/editors/MarkdownPreview.d.ts +9 -0
- package/dist/editors/Terminal.d.ts +18 -0
- package/dist/editors/index.d.ts +11 -0
- package/dist/editors/themes.d.ts +4 -0
- package/dist/editors.cjs +42 -0
- package/dist/editors.js +38396 -0
- package/dist/feedback/Alert.d.ts +21 -0
- package/dist/feedback/ConnectionIndicator.d.ts +15 -0
- package/dist/feedback/EmptyState.d.ts +17 -0
- package/dist/feedback/ErrorState.d.ts +12 -0
- package/dist/feedback/IDEStatusFooter.d.ts +104 -0
- package/dist/feedback/NotificationStack.d.ts +32 -0
- package/dist/feedback/ProgressBar.d.ts +16 -0
- package/dist/feedback/ProgressRing.d.ts +26 -0
- package/dist/feedback/RunButton.d.ts +17 -0
- package/dist/feedback/Skeleton.d.ts +13 -0
- package/dist/feedback/StatusBar.d.ts +12 -0
- package/dist/feedback/StatusBarItem.d.ts +18 -0
- package/dist/feedback/StatusDot.d.ts +14 -0
- package/dist/feedback/StatusPill.d.ts +13 -0
- package/dist/feedback/index.d.ts +29 -0
- package/dist/feedback.cjs +1 -0
- package/dist/feedback.js +1011 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +1632 -0
- package/dist/inputs/Autocomplete.d.ts +30 -0
- package/dist/inputs/Checkbox.d.ts +17 -0
- package/dist/inputs/ColorPicker.d.ts +13 -0
- package/dist/inputs/DebouncedInput.d.ts +10 -0
- package/dist/inputs/FormField.d.ts +15 -0
- package/dist/inputs/FormSection.d.ts +14 -0
- package/dist/inputs/KeyValueEditor.d.ts +17 -0
- package/dist/inputs/RadioGroup.d.ts +23 -0
- package/dist/inputs/SearchInput.d.ts +14 -0
- package/dist/inputs/Select.d.ts +32 -0
- package/dist/inputs/Slider.d.ts +24 -0
- package/dist/inputs/Switch.d.ts +17 -0
- package/dist/inputs/TagInput.d.ts +18 -0
- package/dist/inputs/TextArea.d.ts +26 -0
- package/dist/inputs/TextField.d.ts +39 -0
- package/dist/inputs/TimeRangePicker.d.ts +21 -0
- package/dist/inputs/index.d.ts +31 -0
- package/dist/inputs.cjs +21 -0
- package/dist/inputs.js +15834 -0
- package/dist/layout/AppShell.d.ts +18 -0
- package/dist/layout/DockLayout.d.ts +23 -0
- package/dist/layout/Inline.d.ts +15 -0
- package/dist/layout/Panel.d.ts +17 -0
- package/dist/layout/ResizableSplitPane.d.ts +18 -0
- package/dist/layout/Spacer.d.ts +9 -0
- package/dist/layout/Stack.d.ts +19 -0
- package/dist/layout/index.d.ts +16 -0
- package/dist/layout/useResizablePanel.d.ts +18 -0
- package/dist/layout.cjs +5 -0
- package/dist/layout.js +378 -0
- package/dist/menus/ContextMenu.d.ts +12 -0
- package/dist/menus/DropdownMenu.d.ts +20 -0
- package/dist/menus/MenuBar.d.ts +11 -0
- package/dist/menus/NestedMenuItem.d.ts +13 -0
- package/dist/menus/SplitButton.d.ts +15 -0
- package/dist/menus/index.d.ts +11 -0
- package/dist/menus/types.d.ts +24 -0
- package/dist/menus.cjs +1 -0
- package/dist/menus.js +355 -0
- package/dist/navigation/Breadcrumbs.d.ts +18 -0
- package/dist/navigation/DraggableTabs.d.ts +24 -0
- package/dist/navigation/Pagination.d.ts +15 -0
- package/dist/navigation/PersistentTabPanel.d.ts +13 -0
- package/dist/navigation/Stepper.d.ts +19 -0
- package/dist/navigation/TabPanel.d.ts +11 -0
- package/dist/navigation/Tabs.d.ts +26 -0
- package/dist/navigation/TreeView.d.ts +27 -0
- package/dist/navigation/index.d.ts +16 -0
- package/dist/navigation.cjs +1 -0
- package/dist/navigation.js +429 -0
- package/dist/overlays/Dialog.d.ts +18 -0
- package/dist/overlays/Drawer.d.ts +17 -0
- package/dist/overlays/ErrorOverlay.d.ts +21 -0
- package/dist/overlays/Modal.d.ts +14 -0
- package/dist/overlays/NotificationCenter.d.ts +31 -0
- package/dist/overlays/Popover.d.ts +15 -0
- package/dist/overlays/Spotlight.d.ts +24 -0
- package/dist/overlays/ToastProvider.d.ts +32 -0
- package/dist/overlays/Tooltip.d.ts +15 -0
- package/dist/overlays/index.d.ts +20 -0
- package/dist/overlays/useToast.d.ts +21 -0
- package/dist/overlays.cjs +1 -0
- package/dist/overlays.js +865 -0
- package/dist/sidebars/ActivityBar.d.ts +16 -0
- package/dist/sidebars/NavMenu.d.ts +27 -0
- package/dist/sidebars/NavMenu.test.d.ts +1 -0
- package/dist/sidebars/PropertyGrid.d.ts +16 -0
- package/dist/sidebars/SidebarGroup.d.ts +15 -0
- package/dist/sidebars/SidebarPanel.d.ts +19 -0
- package/dist/sidebars/SidebarTreeItem.d.ts +21 -0
- package/dist/sidebars/index.d.ts +13 -0
- package/dist/sidebars/types.d.ts +29 -0
- package/dist/sidebars.cjs +1 -0
- package/dist/sidebars.js +762 -0
- package/dist/table/ColumnFilter.d.ts +10 -0
- package/dist/table/DataTable.d.ts +23 -0
- package/dist/table/IDETable.d.ts +48 -0
- package/dist/table/TableEmptyState.d.ts +12 -0
- package/dist/table/TableSkeleton.d.ts +11 -0
- package/dist/table/TableToolbar.d.ts +15 -0
- package/dist/table/index.d.ts +12 -0
- package/dist/table/types.d.ts +4 -0
- package/dist/table.cjs +1 -0
- package/dist/table.js +580 -0
- package/dist/theme/AppTheme.d.ts +14 -0
- package/dist/theme/customizations/dataDisplay.d.ts +2 -0
- package/dist/theme/customizations/feedback.d.ts +2 -0
- package/dist/theme/customizations/inputs.d.ts +2 -0
- package/dist/theme/customizations/navigation.d.ts +2 -0
- package/dist/theme/index.d.ts +36 -0
- package/dist/theme/primitives.d.ts +234 -0
- package/dist/theme.cjs +1 -0
- package/dist/theme.js +1362 -0
- package/dist/tokens.css +252 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/maps.d.ts +25 -0
- package/dist/types/variants.d.ts +21 -0
- package/dist/types.cjs +1 -0
- package/dist/types.js +96 -0
- package/dist/typography/CodeBlock.d.ts +15 -0
- package/dist/typography/CodeInline.d.ts +10 -0
- package/dist/typography/Heading.d.ts +13 -0
- package/dist/typography/Link.d.ts +18 -0
- package/dist/typography/Text.d.ts +22 -0
- package/dist/typography/index.d.ts +10 -0
- package/dist/typography.cjs +1 -0
- package/dist/typography.js +120 -0
- package/dist/ui.css +1 -0
- package/dist/units-BuBKbqQ7.js +54 -0
- package/dist/units-CDpdlN1W.cjs +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/language.d.ts +4 -0
- package/dist/utils/time.d.ts +5 -0
- package/dist/utils/units.d.ts +7 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.js +78 -0
- package/package.json +261 -0
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Omniview Design Tokens
|
|
3
|
+
*
|
|
4
|
+
* Three-tier token architecture:
|
|
5
|
+
* Tier 1 — Primitives: raw scale values (colors, spacing units)
|
|
6
|
+
* Tier 2 — Semantic: purpose-named tokens that reference primitives
|
|
7
|
+
* Tier 3 — Component: scoped to specific UI regions (deferred)
|
|
8
|
+
*
|
|
9
|
+
* Naming convention: --ov-{category}-{role}-{modifier}
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
:root {
|
|
13
|
+
/* ================================================================
|
|
14
|
+
* TIER 1 — PRIMITIVES
|
|
15
|
+
* Raw scale values. Never use these directly in components.
|
|
16
|
+
* ================================================================ */
|
|
17
|
+
|
|
18
|
+
/* Neutral scale (14-step, cool-tinted) */
|
|
19
|
+
--ov-scale-gray-0: #0D1117;
|
|
20
|
+
--ov-scale-gray-1: #10141A;
|
|
21
|
+
--ov-scale-gray-2: #151B23;
|
|
22
|
+
--ov-scale-gray-3: #1A2130;
|
|
23
|
+
--ov-scale-gray-4: #1F2937;
|
|
24
|
+
--ov-scale-gray-5: #253345;
|
|
25
|
+
--ov-scale-gray-6: #2D3D52;
|
|
26
|
+
--ov-scale-gray-7: #364559;
|
|
27
|
+
--ov-scale-gray-8: #3E4F66;
|
|
28
|
+
--ov-scale-gray-9: #6B7D96;
|
|
29
|
+
--ov-scale-gray-10: #8B9BB5;
|
|
30
|
+
--ov-scale-gray-11: #ABB8CC;
|
|
31
|
+
--ov-scale-gray-12: #CBD5E1;
|
|
32
|
+
--ov-scale-gray-13: #ECF0F6;
|
|
33
|
+
|
|
34
|
+
/* ================================================================
|
|
35
|
+
* TIER 2 — SEMANTIC TOKENS (default: dark theme)
|
|
36
|
+
* ================================================================ */
|
|
37
|
+
|
|
38
|
+
/* --- Backgrounds --- */
|
|
39
|
+
--ov-bg-base: var(--ov-scale-gray-0);
|
|
40
|
+
--ov-bg-surface: var(--ov-scale-gray-2);
|
|
41
|
+
--ov-bg-surface-raised: var(--ov-scale-gray-3);
|
|
42
|
+
--ov-bg-surface-overlay: var(--ov-scale-gray-4);
|
|
43
|
+
--ov-bg-surface-inset: var(--ov-scale-gray-1);
|
|
44
|
+
|
|
45
|
+
/* --- Foreground / text --- */
|
|
46
|
+
--ov-fg-base: #ECF0F6;
|
|
47
|
+
--ov-fg-default: rgba(236, 240, 246, 0.92);
|
|
48
|
+
--ov-fg-muted: rgba(236, 240, 246, 0.64);
|
|
49
|
+
--ov-fg-faint: rgba(236, 240, 246, 0.44);
|
|
50
|
+
--ov-fg-disabled: rgba(236, 240, 246, 0.28);
|
|
51
|
+
--ov-fg-accent: #79C0FF;
|
|
52
|
+
|
|
53
|
+
/* --- Borders --- */
|
|
54
|
+
--ov-border-default: var(--ov-scale-gray-8);
|
|
55
|
+
--ov-border-muted: var(--ov-scale-gray-7);
|
|
56
|
+
--ov-border-emphasis: var(--ov-scale-gray-9);
|
|
57
|
+
|
|
58
|
+
/* --- Accent --- */
|
|
59
|
+
--ov-accent: #58A6FF;
|
|
60
|
+
--ov-accent-muted: rgba(88, 166, 255, 0.20);
|
|
61
|
+
--ov-accent-subtle: rgba(88, 166, 255, 0.10);
|
|
62
|
+
--ov-accent-fg: #79C0FF;
|
|
63
|
+
|
|
64
|
+
/* --- Status: Success --- */
|
|
65
|
+
--ov-success-emphasis: #1A7F37;
|
|
66
|
+
--ov-success-default: #56D364;
|
|
67
|
+
--ov-success-muted: rgba(86, 211, 100, 0.12);
|
|
68
|
+
|
|
69
|
+
/* --- Status: Warning --- */
|
|
70
|
+
--ov-warning-emphasis: #9A6700;
|
|
71
|
+
--ov-warning-default: #E3B341;
|
|
72
|
+
--ov-warning-muted: rgba(227, 179, 65, 0.12);
|
|
73
|
+
|
|
74
|
+
/* --- Status: Danger --- */
|
|
75
|
+
--ov-danger-emphasis: #CF222E;
|
|
76
|
+
--ov-danger-default: #F47067;
|
|
77
|
+
--ov-danger-muted: rgba(244, 112, 103, 0.12);
|
|
78
|
+
|
|
79
|
+
/* --- Status: Info --- */
|
|
80
|
+
--ov-info-emphasis: #1F6FEB;
|
|
81
|
+
--ov-info-default: #58A6FF;
|
|
82
|
+
--ov-info-muted: rgba(88, 166, 255, 0.12);
|
|
83
|
+
|
|
84
|
+
/* --- Typography --- */
|
|
85
|
+
--ov-font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
|
|
86
|
+
Helvetica, Arial, sans-serif;
|
|
87
|
+
--ov-font-mono: "SF Mono", "Cascadia Code", "JetBrains Mono", "Fira Code",
|
|
88
|
+
Menlo, Consolas, "Liberation Mono", monospace;
|
|
89
|
+
|
|
90
|
+
--ov-text-xs: 0.6875rem; /* 11px */
|
|
91
|
+
--ov-text-sm: 0.75rem; /* 12px */
|
|
92
|
+
--ov-text-base: 0.875rem; /* 14px */
|
|
93
|
+
--ov-text-md: 0.9375rem; /* 15px */
|
|
94
|
+
--ov-text-lg: 1rem; /* 16px */
|
|
95
|
+
--ov-text-xl: 1.25rem; /* 20px */
|
|
96
|
+
--ov-text-2xl: 1.5rem; /* 24px */
|
|
97
|
+
|
|
98
|
+
--ov-weight-regular: 400;
|
|
99
|
+
--ov-weight-medium: 500;
|
|
100
|
+
--ov-weight-semibold: 600;
|
|
101
|
+
|
|
102
|
+
--ov-mono-size: 13px;
|
|
103
|
+
--ov-mono-leading: 1.54;
|
|
104
|
+
--ov-mono-weight: 400;
|
|
105
|
+
|
|
106
|
+
/* --- Spacing (4px grid) --- */
|
|
107
|
+
--ov-space-0: 0px;
|
|
108
|
+
--ov-space-1: 4px;
|
|
109
|
+
--ov-space-2: 8px;
|
|
110
|
+
--ov-space-3: 12px;
|
|
111
|
+
--ov-space-4: 16px;
|
|
112
|
+
--ov-space-5: 20px;
|
|
113
|
+
--ov-space-6: 24px;
|
|
114
|
+
--ov-space-8: 32px;
|
|
115
|
+
--ov-space-10: 40px;
|
|
116
|
+
--ov-space-12: 48px;
|
|
117
|
+
|
|
118
|
+
/* --- Layout dimensions --- */
|
|
119
|
+
--ov-header-height: 38px;
|
|
120
|
+
--ov-footer-height: 24px;
|
|
121
|
+
--ov-sidenav-width: 42px;
|
|
122
|
+
--ov-sidebar-width: 260px;
|
|
123
|
+
--ov-sidebar-min-width: 200px;
|
|
124
|
+
--ov-sidebar-max-width: 400px;
|
|
125
|
+
--ov-detail-panel-width: 560px;
|
|
126
|
+
--ov-detail-panel-min: 400px;
|
|
127
|
+
--ov-detail-panel-max: 800px;
|
|
128
|
+
--ov-bottom-drawer-height: 280px;
|
|
129
|
+
|
|
130
|
+
/* --- Elevation: Shadows --- */
|
|
131
|
+
--ov-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.30), 0 1px 2px rgba(0, 0, 0, 0.20);
|
|
132
|
+
--ov-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.25);
|
|
133
|
+
--ov-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.40), 0 4px 8px rgba(0, 0, 0, 0.30);
|
|
134
|
+
--ov-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.45);
|
|
135
|
+
|
|
136
|
+
/* --- Elevation: Radius --- */
|
|
137
|
+
--ov-radius-none: 0;
|
|
138
|
+
--ov-radius-sm: 4px;
|
|
139
|
+
--ov-radius-md: 6px;
|
|
140
|
+
--ov-radius-lg: 8px;
|
|
141
|
+
--ov-radius-xl: 12px;
|
|
142
|
+
--ov-radius-full: 9999px;
|
|
143
|
+
|
|
144
|
+
/* --- Motion: Durations --- */
|
|
145
|
+
--ov-duration-instant: 0ms;
|
|
146
|
+
--ov-duration-fast: 100ms;
|
|
147
|
+
--ov-duration-normal: 200ms;
|
|
148
|
+
--ov-duration-slow: 300ms;
|
|
149
|
+
|
|
150
|
+
/* --- Motion: Easing --- */
|
|
151
|
+
--ov-ease-default: cubic-bezier(0.2, 0, 0, 1);
|
|
152
|
+
--ov-ease-in: cubic-bezier(0.4, 0, 1, 1);
|
|
153
|
+
--ov-ease-out: cubic-bezier(0, 0, 0.2, 1);
|
|
154
|
+
|
|
155
|
+
/* --- Interactive states --- */
|
|
156
|
+
--ov-state-hover: rgba(255, 255, 255, 0.04);
|
|
157
|
+
--ov-state-active: rgba(255, 255, 255, 0.07);
|
|
158
|
+
--ov-state-selected: var(--ov-accent-subtle);
|
|
159
|
+
--ov-state-focus: 0 0 0 2px var(--ov-accent);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* ================================================================
|
|
163
|
+
* LIGHT THEME OVERRIDES
|
|
164
|
+
* ================================================================ */
|
|
165
|
+
[data-ov-theme="light"] {
|
|
166
|
+
--ov-bg-base: #FFFFFF;
|
|
167
|
+
--ov-bg-surface: #F6F8FA;
|
|
168
|
+
--ov-bg-surface-raised: #FFFFFF;
|
|
169
|
+
--ov-bg-surface-overlay: #FFFFFF;
|
|
170
|
+
--ov-bg-surface-inset: #EFF2F5;
|
|
171
|
+
|
|
172
|
+
--ov-fg-base: #1F2328;
|
|
173
|
+
--ov-fg-default: rgba(31, 35, 40, 0.92);
|
|
174
|
+
--ov-fg-muted: rgba(31, 35, 40, 0.64);
|
|
175
|
+
--ov-fg-faint: rgba(31, 35, 40, 0.44);
|
|
176
|
+
--ov-fg-disabled: rgba(31, 35, 40, 0.28);
|
|
177
|
+
--ov-fg-accent: #0969DA;
|
|
178
|
+
|
|
179
|
+
--ov-border-default: #D0D7DE;
|
|
180
|
+
--ov-border-muted: #D8DEE4;
|
|
181
|
+
--ov-border-emphasis: #636C76;
|
|
182
|
+
|
|
183
|
+
--ov-accent: #0969DA;
|
|
184
|
+
--ov-accent-muted: rgba(9, 105, 218, 0.20);
|
|
185
|
+
--ov-accent-subtle: rgba(9, 105, 218, 0.10);
|
|
186
|
+
--ov-accent-fg: #0550AE;
|
|
187
|
+
|
|
188
|
+
--ov-success-emphasis: #1A7F37;
|
|
189
|
+
--ov-success-default: #1A7F37;
|
|
190
|
+
--ov-success-muted: rgba(26, 127, 55, 0.10);
|
|
191
|
+
|
|
192
|
+
--ov-warning-emphasis: #9A6700;
|
|
193
|
+
--ov-warning-default: #9A6700;
|
|
194
|
+
--ov-warning-muted: rgba(154, 103, 0, 0.10);
|
|
195
|
+
|
|
196
|
+
--ov-danger-emphasis: #CF222E;
|
|
197
|
+
--ov-danger-default: #CF222E;
|
|
198
|
+
--ov-danger-muted: rgba(207, 34, 46, 0.10);
|
|
199
|
+
|
|
200
|
+
--ov-info-emphasis: #0969DA;
|
|
201
|
+
--ov-info-default: #0969DA;
|
|
202
|
+
--ov-info-muted: rgba(9, 105, 218, 0.10);
|
|
203
|
+
|
|
204
|
+
--ov-shadow-sm: 0 1px 3px rgba(31, 35, 40, 0.10), 0 1px 2px rgba(31, 35, 40, 0.06);
|
|
205
|
+
--ov-shadow-md: 0 4px 12px rgba(31, 35, 40, 0.12), 0 2px 4px rgba(31, 35, 40, 0.08);
|
|
206
|
+
--ov-shadow-lg: 0 8px 24px rgba(31, 35, 40, 0.16), 0 4px 8px rgba(31, 35, 40, 0.10);
|
|
207
|
+
--ov-shadow-xl: 0 16px 48px rgba(31, 35, 40, 0.20);
|
|
208
|
+
|
|
209
|
+
--ov-state-hover: rgba(31, 35, 40, 0.04);
|
|
210
|
+
--ov-state-active: rgba(31, 35, 40, 0.07);
|
|
211
|
+
--ov-state-selected: var(--ov-accent-subtle);
|
|
212
|
+
--ov-state-focus: 0 0 0 2px var(--ov-accent);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* ================================================================
|
|
216
|
+
* HIGH CONTRAST THEME OVERRIDES
|
|
217
|
+
* ================================================================ */
|
|
218
|
+
[data-ov-theme="high-contrast"] {
|
|
219
|
+
--ov-bg-base: #010409;
|
|
220
|
+
--ov-bg-surface: #0D1117;
|
|
221
|
+
--ov-bg-surface-raised: #161B22;
|
|
222
|
+
--ov-bg-surface-overlay: #1F2937;
|
|
223
|
+
--ov-bg-surface-inset: #010409;
|
|
224
|
+
|
|
225
|
+
--ov-fg-base: #FFFFFF;
|
|
226
|
+
--ov-fg-default: #F0F6FC;
|
|
227
|
+
--ov-fg-muted: #C9D1D9;
|
|
228
|
+
--ov-fg-faint: #8B949E;
|
|
229
|
+
--ov-fg-disabled: #484F58;
|
|
230
|
+
--ov-fg-accent: #79C0FF;
|
|
231
|
+
|
|
232
|
+
--ov-border-default: #6E7681;
|
|
233
|
+
--ov-border-muted: #3D444D;
|
|
234
|
+
--ov-border-emphasis: #F0F6FC;
|
|
235
|
+
|
|
236
|
+
--ov-accent: #58A6FF;
|
|
237
|
+
--ov-accent-muted: rgba(88, 166, 255, 0.30);
|
|
238
|
+
--ov-accent-subtle: rgba(88, 166, 255, 0.15);
|
|
239
|
+
--ov-accent-fg: #79C0FF;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* ================================================================
|
|
243
|
+
* REDUCED MOTION
|
|
244
|
+
* ================================================================ */
|
|
245
|
+
@media (prefers-reduced-motion: reduce) {
|
|
246
|
+
:root {
|
|
247
|
+
--ov-duration-instant: 0ms;
|
|
248
|
+
--ov-duration-fast: 0ms;
|
|
249
|
+
--ov-duration-normal: 0ms;
|
|
250
|
+
--ov-duration-slow: 0ms;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @omniviewdev/ui type system
|
|
3
|
+
*
|
|
4
|
+
* Re-exports all variant types and mapping utilities.
|
|
5
|
+
*/
|
|
6
|
+
export type { SemanticColor, Emphasis, ComponentSize, Density, Shape, Elevation, Status, } from './variants';
|
|
7
|
+
export { toMuiColor, toMuiVariant, toMuiSize, toMuiInputSize, sizeOverrideSx, toBorderRadius, toCssColor, statusToColor, INPUT_HEIGHTS, } from './maps';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SemanticColor, Emphasis, ComponentSize, Shape, Status } from './variants';
|
|
2
|
+
/** Maps our SemanticColor to a MUI palette color prop value */
|
|
3
|
+
export declare function toMuiColor(color: SemanticColor): string;
|
|
4
|
+
/** Maps our Emphasis to a MUI variant prop value */
|
|
5
|
+
export declare function toMuiVariant(emphasis: Emphasis): string;
|
|
6
|
+
/** Maps our ComponentSize to a MUI size prop value */
|
|
7
|
+
export declare function toMuiSize(size: ComponentSize): 'small' | 'medium' | 'large';
|
|
8
|
+
/**
|
|
9
|
+
* Returns sx overrides for sizes that MUI doesn't natively support (xs, xl).
|
|
10
|
+
* Returns undefined if no override is needed.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sizeOverrideSx(size: ComponentSize): Record<string, unknown> | undefined;
|
|
13
|
+
/** Height tokens for input components (Select, Autocomplete, TextField, TextArea). */
|
|
14
|
+
export declare const INPUT_HEIGHTS: Record<ComponentSize, string>;
|
|
15
|
+
/**
|
|
16
|
+
* Maps ComponentSize to the MUI size for FormControl / InputLabel internals.
|
|
17
|
+
* xs/sm → 'small' (compact label font), md/lg/xl → 'medium' (standard label font).
|
|
18
|
+
*/
|
|
19
|
+
export declare function toMuiInputSize(size: ComponentSize): 'small' | 'medium';
|
|
20
|
+
/** Maps our Shape to a CSS border-radius value */
|
|
21
|
+
export declare function toBorderRadius(shape: Shape): string | number;
|
|
22
|
+
/** Maps our SemanticColor to a --ov-* CSS custom property */
|
|
23
|
+
export declare function toCssColor(color: SemanticColor): string;
|
|
24
|
+
/** Maps a Status value to the corresponding SemanticColor */
|
|
25
|
+
export declare function statusToColor(status: Status): SemanticColor;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global Variant Type System
|
|
3
|
+
*
|
|
4
|
+
* Canonical types used by every component in @omniviewdev/ui.
|
|
5
|
+
* Consumers use our API (emphasis, SemanticColor, ComponentSize) —
|
|
6
|
+
* MUI prop names are hidden behind the mapping layer in maps.ts.
|
|
7
|
+
*/
|
|
8
|
+
/** Consistent color prop across all components */
|
|
9
|
+
export type SemanticColor = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info' | 'neutral' | 'accent' | 'danger' | 'muted';
|
|
10
|
+
/** Visual weight / fill style */
|
|
11
|
+
export type Emphasis = 'solid' | 'soft' | 'outline' | 'ghost' | 'link';
|
|
12
|
+
/** Consistent sizing */
|
|
13
|
+
export type ComponentSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
14
|
+
/** Density for tables/forms */
|
|
15
|
+
export type Density = 'compact' | 'comfortable' | 'spacious';
|
|
16
|
+
/** Border radius presets */
|
|
17
|
+
export type Shape = 'rounded' | 'pill' | 'square';
|
|
18
|
+
/** Surface depth */
|
|
19
|
+
export type Elevation = 'flat' | 'raised' | 'overlay';
|
|
20
|
+
/** Status values for indicators */
|
|
21
|
+
export type Status = 'healthy' | 'warning' | 'degraded' | 'error' | 'unknown' | 'pending';
|
package/dist/types.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={primary:"primary",secondary:"secondary",success:"success",warning:"warning",error:"error",info:"info",neutral:"default",accent:"primary",danger:"error",muted:"inherit"};function n(r){return e[r]}const o={solid:"contained",soft:"soft",outline:"outlined",ghost:"text",link:"link"};function t(r){return o[r]}const a={xs:"small",sm:"small",md:"medium",lg:"large",xl:"large"};function i(r){return a[r]}function u(r){if(r==="xs")return{minHeight:"1.5rem",padding:"2px 8px",fontSize:"0.6875rem"};if(r==="xl")return{minHeight:"3.25rem",padding:"12px 24px",fontSize:"1rem"}}const s={xs:"1.75rem",sm:"2.25rem",md:"2.75rem",lg:"3.25rem",xl:"3.75rem"};function d(r){return r==="xs"||r==="sm"?"small":"medium"}const l={rounded:"var(--ov-radius-md, 6px)",pill:999,square:0};function c(r){return l[r]}const m={primary:"var(--ov-accent)",secondary:"var(--ov-fg-muted)",success:"var(--ov-success-default)",warning:"var(--ov-warning-default)",error:"var(--ov-danger-default)",info:"var(--ov-info-default)",neutral:"var(--ov-fg-default)",accent:"var(--ov-accent)",danger:"var(--ov-danger-default)",muted:"var(--ov-fg-muted)"};function f(r){return m[r]}const g={healthy:"success",warning:"warning",degraded:"warning",error:"error",unknown:"neutral",pending:"info"};function v(r){return g[r]}exports.INPUT_HEIGHTS=s;exports.sizeOverrideSx=u;exports.statusToColor=v;exports.toBorderRadius=c;exports.toCssColor=f;exports.toMuiColor=n;exports.toMuiInputSize=d;exports.toMuiSize=i;exports.toMuiVariant=t;
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const n = {
|
|
2
|
+
primary: "primary",
|
|
3
|
+
secondary: "secondary",
|
|
4
|
+
success: "success",
|
|
5
|
+
warning: "warning",
|
|
6
|
+
error: "error",
|
|
7
|
+
info: "info",
|
|
8
|
+
neutral: "default",
|
|
9
|
+
accent: "primary",
|
|
10
|
+
danger: "error",
|
|
11
|
+
muted: "inherit"
|
|
12
|
+
};
|
|
13
|
+
function u(r) {
|
|
14
|
+
return n[r];
|
|
15
|
+
}
|
|
16
|
+
const e = {
|
|
17
|
+
solid: "contained",
|
|
18
|
+
soft: "soft",
|
|
19
|
+
outline: "outlined",
|
|
20
|
+
ghost: "text",
|
|
21
|
+
link: "link"
|
|
22
|
+
};
|
|
23
|
+
function s(r) {
|
|
24
|
+
return e[r];
|
|
25
|
+
}
|
|
26
|
+
const o = {
|
|
27
|
+
xs: "small",
|
|
28
|
+
sm: "small",
|
|
29
|
+
md: "medium",
|
|
30
|
+
lg: "large",
|
|
31
|
+
xl: "large"
|
|
32
|
+
};
|
|
33
|
+
function d(r) {
|
|
34
|
+
return o[r];
|
|
35
|
+
}
|
|
36
|
+
function c(r) {
|
|
37
|
+
if (r === "xs")
|
|
38
|
+
return { minHeight: "1.5rem", padding: "2px 8px", fontSize: "0.6875rem" };
|
|
39
|
+
if (r === "xl")
|
|
40
|
+
return { minHeight: "3.25rem", padding: "12px 24px", fontSize: "1rem" };
|
|
41
|
+
}
|
|
42
|
+
const l = {
|
|
43
|
+
xs: "1.75rem",
|
|
44
|
+
sm: "2.25rem",
|
|
45
|
+
md: "2.75rem",
|
|
46
|
+
lg: "3.25rem",
|
|
47
|
+
xl: "3.75rem"
|
|
48
|
+
};
|
|
49
|
+
function m(r) {
|
|
50
|
+
return r === "xs" || r === "sm" ? "small" : "medium";
|
|
51
|
+
}
|
|
52
|
+
const t = {
|
|
53
|
+
rounded: "var(--ov-radius-md, 6px)",
|
|
54
|
+
pill: 999,
|
|
55
|
+
square: 0
|
|
56
|
+
};
|
|
57
|
+
function f(r) {
|
|
58
|
+
return t[r];
|
|
59
|
+
}
|
|
60
|
+
const a = {
|
|
61
|
+
primary: "var(--ov-accent)",
|
|
62
|
+
secondary: "var(--ov-fg-muted)",
|
|
63
|
+
success: "var(--ov-success-default)",
|
|
64
|
+
warning: "var(--ov-warning-default)",
|
|
65
|
+
error: "var(--ov-danger-default)",
|
|
66
|
+
info: "var(--ov-info-default)",
|
|
67
|
+
neutral: "var(--ov-fg-default)",
|
|
68
|
+
accent: "var(--ov-accent)",
|
|
69
|
+
danger: "var(--ov-danger-default)",
|
|
70
|
+
muted: "var(--ov-fg-muted)"
|
|
71
|
+
};
|
|
72
|
+
function g(r) {
|
|
73
|
+
return a[r];
|
|
74
|
+
}
|
|
75
|
+
const i = {
|
|
76
|
+
healthy: "success",
|
|
77
|
+
warning: "warning",
|
|
78
|
+
degraded: "warning",
|
|
79
|
+
error: "error",
|
|
80
|
+
unknown: "neutral",
|
|
81
|
+
pending: "info"
|
|
82
|
+
};
|
|
83
|
+
function v(r) {
|
|
84
|
+
return i[r];
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
l as INPUT_HEIGHTS,
|
|
88
|
+
c as sizeOverrideSx,
|
|
89
|
+
v as statusToColor,
|
|
90
|
+
f as toBorderRadius,
|
|
91
|
+
g as toCssColor,
|
|
92
|
+
u as toMuiColor,
|
|
93
|
+
m as toMuiInputSize,
|
|
94
|
+
d as toMuiSize,
|
|
95
|
+
s as toMuiVariant
|
|
96
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
|
+
export interface CodeBlockProps {
|
|
3
|
+
children: string;
|
|
4
|
+
language?: string;
|
|
5
|
+
lineNumbers?: boolean;
|
|
6
|
+
copy?: boolean;
|
|
7
|
+
maxHeight?: number | string;
|
|
8
|
+
wrap?: boolean;
|
|
9
|
+
sx?: SxProps<Theme>;
|
|
10
|
+
}
|
|
11
|
+
declare function CodeBlock({ children, lineNumbers, copy, maxHeight, wrap, sx, }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare namespace CodeBlock {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
export default CodeBlock;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
|
+
export interface CodeInlineProps {
|
|
3
|
+
children: string;
|
|
4
|
+
sx?: SxProps<Theme>;
|
|
5
|
+
}
|
|
6
|
+
declare function CodeInline({ children, sx }: CodeInlineProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare namespace CodeInline {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
10
|
+
export default CodeInline;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
|
+
export interface HeadingProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6 | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
5
|
+
id?: string;
|
|
6
|
+
copyLink?: boolean;
|
|
7
|
+
sx?: SxProps<Theme>;
|
|
8
|
+
}
|
|
9
|
+
declare function Heading({ children, level, id, copyLink, sx, }: HeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare namespace Heading {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
13
|
+
export default Heading;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
|
+
import { SemanticColor } from '../types';
|
|
3
|
+
import { ReactNode, MouseEventHandler } from 'react';
|
|
4
|
+
export interface LinkProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
href?: string;
|
|
7
|
+
color?: SemanticColor;
|
|
8
|
+
underline?: 'always' | 'hover' | 'none';
|
|
9
|
+
/** Opens in new tab with rel="noopener noreferrer" */
|
|
10
|
+
external?: boolean;
|
|
11
|
+
onClick?: MouseEventHandler;
|
|
12
|
+
sx?: SxProps<Theme>;
|
|
13
|
+
}
|
|
14
|
+
declare function Link({ children, href, color, underline, external, onClick, sx, }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare namespace Link {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
export default Link;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
|
+
import { SemanticColor, ComponentSize } from '../types';
|
|
3
|
+
export type TextWeight = 'normal' | 'medium' | 'semibold' | 'bold';
|
|
4
|
+
export interface TextProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
variant?: 'body' | 'caption' | 'overline' | 'mono' | 'code';
|
|
7
|
+
color?: SemanticColor;
|
|
8
|
+
size?: ComponentSize;
|
|
9
|
+
weight?: TextWeight;
|
|
10
|
+
truncate?: boolean;
|
|
11
|
+
noWrap?: boolean;
|
|
12
|
+
lines?: number;
|
|
13
|
+
muted?: boolean;
|
|
14
|
+
inline?: boolean;
|
|
15
|
+
component?: React.ElementType;
|
|
16
|
+
sx?: SxProps<Theme>;
|
|
17
|
+
}
|
|
18
|
+
declare function Text({ children, variant, color, size, weight, truncate, noWrap, lines, muted, inline: _inline, component, sx, }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare namespace Text {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
export default Text;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as Text } from './Text';
|
|
2
|
+
export type { TextProps } from './Text';
|
|
3
|
+
export { default as Heading } from './Heading';
|
|
4
|
+
export type { HeadingProps } from './Heading';
|
|
5
|
+
export { default as CodeInline } from './CodeInline';
|
|
6
|
+
export type { CodeInlineProps } from './CodeInline';
|
|
7
|
+
export { default as CodeBlock } from './CodeBlock';
|
|
8
|
+
export type { CodeBlockProps } from './CodeBlock';
|
|
9
|
+
export { default as Link } from './Link';
|
|
10
|
+
export type { LinkProps } from './Link';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./Text-Mk6Uyg1w.cjs"),i=require("react/jsx-runtime"),v=require("@mui/material/Typography"),s=require("@mui/material/Box"),y=require("@mui/icons-material/Link"),h=require("./CodeBlock-CIyG0DbW.cjs"),m=require("@mui/material/Link"),x=require("./types.cjs"),b={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"};function l({children:n,level:o=2,id:e,copyLink:t=!1,sx:r}){const a=typeof o=="string"?parseInt(o.replace("h",""),10):o,c=b[a],u=()=>{if(e){const f=`${window.location.origin}${window.location.pathname}#${e}`;navigator.clipboard.writeText(f)}};return i.jsxs(v,{variant:c,id:e,sx:{color:"var(--ov-fg-base)",fontWeight:"var(--ov-weight-semibold)",display:"flex",alignItems:"center",gap:.5,"&:hover .ov-heading-anchor":{opacity:1},...typeof r=="object"&&!Array.isArray(r)?r:{}},children:[n,t&&e&&i.jsx(s,{component:"button",className:"ov-heading-anchor",onClick:u,sx:{opacity:0,transition:"opacity 150ms",background:"none",border:"none",cursor:"pointer",color:"var(--ov-fg-faint)",display:"inline-flex",p:0,"&:hover":{color:"var(--ov-fg-default)"}},children:i.jsx(y,{sx:{fontSize:"0.7em"}})})]})}l.displayName="Heading";function d({children:n,sx:o}){return i.jsx(s,{component:"code",sx:{fontFamily:"var(--ov-font-mono)",fontSize:"0.85em",backgroundColor:"var(--ov-bg-surface-inset)",color:"var(--ov-fg-default)",padding:"2px 6px",borderRadius:"3px",whiteSpace:"nowrap",...typeof o=="object"&&!Array.isArray(o)?o:{}},children:n})}d.displayName="CodeInline";function p({children:n,href:o,color:e="primary",underline:t="hover",external:r=!1,onClick:a,sx:c}){return i.jsx(m,{href:o,color:x.toMuiColor(e),underline:t,onClick:a,...r?{target:"_blank",rel:"noopener noreferrer"}:{},sx:c,children:n})}p.displayName="Link";exports.Text=g.Text;exports.CodeBlock=h.CodeBlock;exports.CodeInline=d;exports.Heading=l;exports.Link=p;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { T as A } from "./Text-By4P3in5.js";
|
|
2
|
+
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import m from "@mui/material/Typography";
|
|
4
|
+
import c from "@mui/material/Box";
|
|
5
|
+
import d from "@mui/icons-material/Link";
|
|
6
|
+
import { C as S } from "./CodeBlock-B1iQO7zU.js";
|
|
7
|
+
import h from "@mui/material/Link";
|
|
8
|
+
import { toMuiColor as v } from "./types.js";
|
|
9
|
+
const g = {
|
|
10
|
+
1: "h1",
|
|
11
|
+
2: "h2",
|
|
12
|
+
3: "h3",
|
|
13
|
+
4: "h4",
|
|
14
|
+
5: "h5",
|
|
15
|
+
6: "h6"
|
|
16
|
+
};
|
|
17
|
+
function y({
|
|
18
|
+
children: n,
|
|
19
|
+
level: o = 2,
|
|
20
|
+
id: r,
|
|
21
|
+
copyLink: i = !1,
|
|
22
|
+
sx: e
|
|
23
|
+
}) {
|
|
24
|
+
const t = typeof o == "string" ? parseInt(o.replace("h", ""), 10) : o, p = g[t], l = () => {
|
|
25
|
+
if (r) {
|
|
26
|
+
const f = `${window.location.origin}${window.location.pathname}#${r}`;
|
|
27
|
+
navigator.clipboard.writeText(f);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ s(
|
|
31
|
+
m,
|
|
32
|
+
{
|
|
33
|
+
variant: p,
|
|
34
|
+
id: r,
|
|
35
|
+
sx: {
|
|
36
|
+
color: "var(--ov-fg-base)",
|
|
37
|
+
fontWeight: "var(--ov-weight-semibold)",
|
|
38
|
+
display: "flex",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
gap: 0.5,
|
|
41
|
+
"&:hover .ov-heading-anchor": { opacity: 1 },
|
|
42
|
+
...typeof e == "object" && !Array.isArray(e) ? e : {}
|
|
43
|
+
},
|
|
44
|
+
children: [
|
|
45
|
+
n,
|
|
46
|
+
i && r && /* @__PURE__ */ a(
|
|
47
|
+
c,
|
|
48
|
+
{
|
|
49
|
+
component: "button",
|
|
50
|
+
className: "ov-heading-anchor",
|
|
51
|
+
onClick: l,
|
|
52
|
+
sx: {
|
|
53
|
+
opacity: 0,
|
|
54
|
+
transition: "opacity 150ms",
|
|
55
|
+
background: "none",
|
|
56
|
+
border: "none",
|
|
57
|
+
cursor: "pointer",
|
|
58
|
+
color: "var(--ov-fg-faint)",
|
|
59
|
+
display: "inline-flex",
|
|
60
|
+
p: 0,
|
|
61
|
+
"&:hover": { color: "var(--ov-fg-default)" }
|
|
62
|
+
},
|
|
63
|
+
children: /* @__PURE__ */ a(d, { sx: { fontSize: "0.7em" } })
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
y.displayName = "Heading";
|
|
71
|
+
function u({ children: n, sx: o }) {
|
|
72
|
+
return /* @__PURE__ */ a(
|
|
73
|
+
c,
|
|
74
|
+
{
|
|
75
|
+
component: "code",
|
|
76
|
+
sx: {
|
|
77
|
+
fontFamily: "var(--ov-font-mono)",
|
|
78
|
+
fontSize: "0.85em",
|
|
79
|
+
backgroundColor: "var(--ov-bg-surface-inset)",
|
|
80
|
+
color: "var(--ov-fg-default)",
|
|
81
|
+
padding: "2px 6px",
|
|
82
|
+
borderRadius: "3px",
|
|
83
|
+
whiteSpace: "nowrap",
|
|
84
|
+
...typeof o == "object" && !Array.isArray(o) ? o : {}
|
|
85
|
+
},
|
|
86
|
+
children: n
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
u.displayName = "CodeInline";
|
|
91
|
+
function x({
|
|
92
|
+
children: n,
|
|
93
|
+
href: o,
|
|
94
|
+
color: r = "primary",
|
|
95
|
+
underline: i = "hover",
|
|
96
|
+
external: e = !1,
|
|
97
|
+
onClick: t,
|
|
98
|
+
sx: p
|
|
99
|
+
}) {
|
|
100
|
+
return /* @__PURE__ */ a(
|
|
101
|
+
h,
|
|
102
|
+
{
|
|
103
|
+
href: o,
|
|
104
|
+
color: v(r),
|
|
105
|
+
underline: i,
|
|
106
|
+
onClick: t,
|
|
107
|
+
...e ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
108
|
+
sx: p,
|
|
109
|
+
children: n
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
x.displayName = "Link";
|
|
114
|
+
export {
|
|
115
|
+
S as CodeBlock,
|
|
116
|
+
u as CodeInline,
|
|
117
|
+
y as Heading,
|
|
118
|
+
x as Link,
|
|
119
|
+
A as Text
|
|
120
|
+
};
|