@olympusoss/canvas 2.20.1 → 4.0.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 (208) hide show
  1. package/package.json +41 -177
  2. package/src/cn.ts +3 -0
  3. package/src/index.ts +12 -603
  4. package/src/theme.ts +41 -0
  5. package/src/tokens.ts +11 -0
  6. package/styles/base.css +17 -0
  7. package/styles/canvas.css +69 -52
  8. package/styles/components/alert.css +66 -0
  9. package/styles/components/app-shell.css +46 -0
  10. package/styles/components/avatar.css +15 -0
  11. package/styles/components/badge.css +83 -0
  12. package/styles/components/breadcrumb.css +35 -0
  13. package/styles/components/button-group.css +23 -0
  14. package/styles/components/button.css +107 -0
  15. package/styles/components/calendar.css +73 -0
  16. package/styles/components/card.css +58 -0
  17. package/styles/components/checkbox.css +55 -0
  18. package/styles/components/code-block.css +18 -0
  19. package/styles/components/combobox.css +75 -0
  20. package/styles/components/command.css +94 -0
  21. package/styles/components/data-table.css +142 -0
  22. package/styles/components/dialog.css +72 -0
  23. package/styles/components/dropdown.css +54 -0
  24. package/styles/components/empty-state.css +17 -0
  25. package/styles/components/field.css +27 -0
  26. package/styles/components/filter-panel.css +58 -0
  27. package/styles/components/form.css +27 -0
  28. package/styles/components/icon.css +8 -0
  29. package/styles/components/input-group.css +45 -0
  30. package/styles/components/input.css +56 -0
  31. package/styles/components/kbd.css +15 -0
  32. package/styles/components/page-header.css +52 -0
  33. package/styles/components/pagination.css +48 -0
  34. package/styles/components/popover.css +14 -0
  35. package/styles/components/radio.css +28 -0
  36. package/styles/components/row-menu.css +69 -0
  37. package/styles/components/section-card.css +49 -0
  38. package/styles/components/select.css +57 -0
  39. package/styles/components/separator.css +32 -0
  40. package/styles/components/sheet.css +70 -0
  41. package/styles/components/sidebar.css +146 -0
  42. package/styles/components/skeleton.css +32 -0
  43. package/styles/components/spinner.css +26 -0
  44. package/styles/components/stat-card.css +71 -0
  45. package/styles/components/stepper.css +63 -0
  46. package/styles/components/switch.css +45 -0
  47. package/styles/components/tabs.css +40 -0
  48. package/styles/components/textarea.css +31 -0
  49. package/styles/components/toast.css +95 -0
  50. package/styles/components/tooltip.css +53 -0
  51. package/styles/components/topbar.css +24 -0
  52. package/styles/components/typography.css +105 -0
  53. package/styles/patterns/backdrops.css +35 -0
  54. package/styles/patterns/density.css +66 -0
  55. package/styles/patterns/focus.css +38 -0
  56. package/styles/patterns/glass.css +85 -0
  57. package/styles/patterns/high-contrast.css +70 -0
  58. package/styles/patterns/reduced-motion.css +12 -0
  59. package/styles/patterns/scrollbar.css +10 -0
  60. package/styles/reset.css +89 -0
  61. package/styles/tokens/colors.css +106 -0
  62. package/styles/tokens/motion.css +33 -0
  63. package/styles/tokens/radius.css +10 -0
  64. package/styles/tokens/shadows.css +35 -0
  65. package/styles/tokens/spacing.css +19 -0
  66. package/styles/tokens/typography.css +6 -0
  67. package/styles/tokens/z-index.css +12 -0
  68. package/tsconfig.json +20 -21
  69. package/README.md +0 -60
  70. package/src/components/atoms/README.md +0 -11
  71. package/src/components/atoms/aspect-ratio.tsx +0 -32
  72. package/src/components/atoms/avatar.tsx +0 -98
  73. package/src/components/atoms/badge.tsx +0 -44
  74. package/src/components/atoms/brand-mark.tsx +0 -74
  75. package/src/components/atoms/button.tsx +0 -105
  76. package/src/components/atoms/checkbox.tsx +0 -63
  77. package/src/components/atoms/flex-box.tsx +0 -105
  78. package/src/components/atoms/icon.tsx +0 -34
  79. package/src/components/atoms/input.tsx +0 -92
  80. package/src/components/atoms/label.tsx +0 -41
  81. package/src/components/atoms/logo.tsx +0 -89
  82. package/src/components/atoms/progress.tsx +0 -55
  83. package/src/components/atoms/radio-group.tsx +0 -122
  84. package/src/components/atoms/scroll-area.tsx +0 -106
  85. package/src/components/atoms/section.tsx +0 -48
  86. package/src/components/atoms/separator.tsx +0 -45
  87. package/src/components/atoms/skeleton.tsx +0 -17
  88. package/src/components/atoms/slider.tsx +0 -93
  89. package/src/components/atoms/spinner.tsx +0 -47
  90. package/src/components/atoms/switch.tsx +0 -60
  91. package/src/components/atoms/textarea.tsx +0 -78
  92. package/src/components/atoms/toggle.tsx +0 -80
  93. package/src/components/charts/activity-heatmap.tsx +0 -186
  94. package/src/components/charts/axes.tsx +0 -21
  95. package/src/components/charts/chart-container.tsx +0 -254
  96. package/src/components/charts/chart-legend.tsx +0 -67
  97. package/src/components/charts/chart-tooltip.tsx +0 -161
  98. package/src/components/charts/chart-types.tsx +0 -49
  99. package/src/components/charts/containers.tsx +0 -11
  100. package/src/components/charts/data.tsx +0 -16
  101. package/src/components/charts/details.tsx +0 -25
  102. package/src/components/charts/dot-pulse.tsx +0 -61
  103. package/src/components/charts/gauge.tsx +0 -106
  104. package/src/components/charts/grids.tsx +0 -8
  105. package/src/components/charts/index.ts +0 -62
  106. package/src/components/charts/labeled-bar-list.tsx +0 -85
  107. package/src/components/charts/metric-breakdown.tsx +0 -316
  108. package/src/components/charts/references.tsx +0 -8
  109. package/src/components/charts/service-health-list.tsx +0 -85
  110. package/src/components/charts/sparkline-area.tsx +0 -80
  111. package/src/components/charts/sparkline.tsx +0 -52
  112. package/src/components/charts/stacked-bar.tsx +0 -104
  113. package/src/components/charts/text.tsx +0 -10
  114. package/src/components/charts/world-heat-map-inner.tsx +0 -317
  115. package/src/components/charts/world-heat-map.tsx +0 -184
  116. package/src/components/molecules/README.md +0 -12
  117. package/src/components/molecules/action-bar.tsx +0 -73
  118. package/src/components/molecules/activity-item.tsx +0 -74
  119. package/src/components/molecules/alert.tsx +0 -86
  120. package/src/components/molecules/animated-background.tsx +0 -92
  121. package/src/components/molecules/auth-shell.tsx +0 -95
  122. package/src/components/molecules/brand-lockup.tsx +0 -48
  123. package/src/components/molecules/breadcrumb.tsx +0 -157
  124. package/src/components/molecules/button-group.tsx +0 -104
  125. package/src/components/molecules/calendar.tsx +0 -217
  126. package/src/components/molecules/card.tsx +0 -102
  127. package/src/components/molecules/client-brand.tsx +0 -95
  128. package/src/components/molecules/code-block.tsx +0 -86
  129. package/src/components/molecules/countdown-button.tsx +0 -92
  130. package/src/components/molecules/empty-state.tsx +0 -56
  131. package/src/components/molecules/error-state.tsx +0 -42
  132. package/src/components/molecules/field-display.tsx +0 -35
  133. package/src/components/molecules/input-otp.tsx +0 -74
  134. package/src/components/molecules/launcher-card.tsx +0 -152
  135. package/src/components/molecules/loading-state.tsx +0 -36
  136. package/src/components/molecules/notification-item.tsx +0 -67
  137. package/src/components/molecules/notification-list.tsx +0 -45
  138. package/src/components/molecules/number-badge.tsx +0 -53
  139. package/src/components/molecules/or-separator.tsx +0 -38
  140. package/src/components/molecules/page-header.tsx +0 -88
  141. package/src/components/molecules/page-tabs.tsx +0 -94
  142. package/src/components/molecules/pagination.tsx +0 -150
  143. package/src/components/molecules/password-input.tsx +0 -83
  144. package/src/components/molecules/password-strength-meter.tsx +0 -104
  145. package/src/components/molecules/phone-input.tsx +0 -200
  146. package/src/components/molecules/search-bar.tsx +0 -64
  147. package/src/components/molecules/secret-field.tsx +0 -158
  148. package/src/components/molecules/section-card.tsx +0 -91
  149. package/src/components/molecules/social-buttons.tsx +0 -165
  150. package/src/components/molecules/stat-card.tsx +0 -100
  151. package/src/components/molecules/status-badge.tsx +0 -42
  152. package/src/components/molecules/stepper.tsx +0 -96
  153. package/src/components/molecules/table.tsx +0 -157
  154. package/src/components/molecules/terminal.tsx +0 -74
  155. package/src/components/molecules/toggle-group.tsx +0 -145
  156. package/src/components/molecules/tooltip.tsx +0 -155
  157. package/src/components/molecules/user-avatar-chip.tsx +0 -71
  158. package/src/components/organisms/README.md +0 -14
  159. package/src/components/organisms/accordion.tsx +0 -154
  160. package/src/components/organisms/alert-dialog.tsx +0 -277
  161. package/src/components/organisms/carousel.tsx +0 -244
  162. package/src/components/organisms/collapsible.tsx +0 -69
  163. package/src/components/organisms/command.tsx +0 -144
  164. package/src/components/organisms/context-menu.tsx +0 -339
  165. package/src/components/organisms/dashboard-grid.tsx +0 -369
  166. package/src/components/organisms/data-table.tsx +0 -330
  167. package/src/components/organisms/dialog.tsx +0 -312
  168. package/src/components/organisms/drawer.tsx +0 -123
  169. package/src/components/organisms/dropdown-menu.tsx +0 -440
  170. package/src/components/organisms/editors/code-editor.tsx +0 -144
  171. package/src/components/organisms/editors/index.ts +0 -4
  172. package/src/components/organisms/editors/markdown-editor.tsx +0 -153
  173. package/src/components/organisms/editors/markdown-renderer.ts +0 -27
  174. package/src/components/organisms/editors/prose-canvas-classes.ts +0 -45
  175. package/src/components/organisms/editors/rich-text-editor.tsx +0 -126
  176. package/src/components/organisms/editors/toolbar/md-toolbar.tsx +0 -129
  177. package/src/components/organisms/editors/toolbar/rte-toolbar.tsx +0 -211
  178. package/src/components/organisms/editors/toolbar/toolbar-shell.tsx +0 -45
  179. package/src/components/organisms/editors/use-codemirror-theme.ts +0 -61
  180. package/src/components/organisms/error-boundary.tsx +0 -61
  181. package/src/components/organisms/form.tsx +0 -174
  182. package/src/components/organisms/hover-card.tsx +0 -115
  183. package/src/components/organisms/menubar.tsx +0 -498
  184. package/src/components/organisms/navbar.tsx +0 -104
  185. package/src/components/organisms/navigation-menu.tsx +0 -235
  186. package/src/components/organisms/popover.tsx +0 -149
  187. package/src/components/organisms/resizable.tsx +0 -58
  188. package/src/components/organisms/schema-form.tsx +0 -232
  189. package/src/components/organisms/select.tsx +0 -309
  190. package/src/components/organisms/sheet.tsx +0 -265
  191. package/src/components/organisms/sidebar.tsx +0 -1040
  192. package/src/components/organisms/sonner.tsx +0 -96
  193. package/src/components/organisms/tabs.tsx +0 -133
  194. package/src/components/organisms/theme-provider.tsx +0 -101
  195. package/src/hooks/use-mobile.tsx +0 -19
  196. package/src/lib/portal-container.tsx +0 -35
  197. package/src/lib/utils.ts +0 -6
  198. package/src/native.ts +0 -23
  199. package/src/tokens/colors.ts +0 -91
  200. package/src/tokens/index.ts +0 -3
  201. package/src/tokens/spacing.ts +0 -55
  202. package/src/tokens/typography.ts +0 -27
  203. package/styles/dashboard-grid.css +0 -47
  204. package/styles/fonts/Roboto-VariableFont_wdth_wght.ttf +0 -0
  205. package/styles/glass.css +0 -171
  206. package/styles/leaflet.css +0 -13
  207. package/styles/tokens.css +0 -317
  208. package/tailwind.config.ts +0 -70
@@ -0,0 +1,70 @@
1
+ @layer canvas.patterns {
2
+ @media (prefers-contrast: more) {
3
+ :root {
4
+ --border: 240 5.9% 50%;
5
+ --input: 240 5.9% 50%;
6
+ --muted-foreground: 240 6% 25%;
7
+ --shadow-xs: none;
8
+ --shadow-sm: none;
9
+ --shadow-md: none;
10
+ --shadow-lg: none;
11
+ --shadow-elevated: none;
12
+ }
13
+
14
+ .dark {
15
+ --border: 240 5% 60%;
16
+ --input: 240 5% 60%;
17
+ --muted-foreground: 240 5% 80%;
18
+ }
19
+
20
+ .btn,
21
+ .input,
22
+ .select,
23
+ .textarea,
24
+ .checkbox,
25
+ .radio,
26
+ .switch {
27
+ border-width: 2px;
28
+ }
29
+
30
+ .card,
31
+ .stat-card,
32
+ .section-card,
33
+ .dt-wrap,
34
+ .empty-card,
35
+ .alert {
36
+ border-width: 2px;
37
+ }
38
+
39
+ .badge,
40
+ .status-badge,
41
+ .kbd {
42
+ border-width: 2px;
43
+ }
44
+
45
+ .sidebar {
46
+ border-right-width: 2px;
47
+ }
48
+
49
+ .topbar {
50
+ border-bottom-width: 2px;
51
+ }
52
+
53
+ .dt-table th,
54
+ .dt-table td {
55
+ border-bottom-width: 2px;
56
+ }
57
+
58
+ .tab.active {
59
+ border-bottom-width: 3px;
60
+ }
61
+
62
+ .sep {
63
+ border-top-width: 2px;
64
+ }
65
+
66
+ .sep-v {
67
+ border-left-width: 2px;
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,12 @@
1
+ @layer canvas.patterns {
2
+ @media (prefers-reduced-motion: reduce) {
3
+ *,
4
+ ::before,
5
+ ::after {
6
+ animation-duration: 0.01ms !important;
7
+ animation-iteration-count: 1 !important;
8
+ transition-duration: 0.01ms !important;
9
+ scroll-behavior: auto !important;
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,10 @@
1
+ @layer canvas.patterns {
2
+ * {
3
+ scrollbar-width: thin;
4
+ scrollbar-color: hsl(var(--muted-foreground) / 0.25) transparent;
5
+ }
6
+
7
+ html[data-surface="glass"] * {
8
+ scrollbar-color: hsl(255 100% 100% / 0.30) transparent;
9
+ }
10
+ }
@@ -0,0 +1,89 @@
1
+ @layer canvas.reset {
2
+ *,
3
+ ::after,
4
+ ::before {
5
+ box-sizing: border-box;
6
+ margin: 0;
7
+ padding: 0;
8
+ }
9
+
10
+ html {
11
+ line-height: 1.5;
12
+ -webkit-text-size-adjust: 100%;
13
+ tab-size: 4;
14
+ }
15
+
16
+ body {
17
+ line-height: inherit;
18
+ }
19
+
20
+ hr {
21
+ height: 0;
22
+ color: inherit;
23
+ border-top-width: 1px;
24
+ }
25
+
26
+ h1, h2, h3, h4, h5, h6 {
27
+ font-size: inherit;
28
+ font-weight: inherit;
29
+ }
30
+
31
+ a {
32
+ color: inherit;
33
+ text-decoration: inherit;
34
+ }
35
+
36
+ b, strong {
37
+ font-weight: bolder;
38
+ }
39
+
40
+ code, kbd, samp, pre {
41
+ font-size: 1em;
42
+ }
43
+
44
+ small {
45
+ font-size: 80%;
46
+ }
47
+
48
+ button, input, optgroup, select, textarea {
49
+ font-family: inherit;
50
+ font-feature-settings: inherit;
51
+ font-variation-settings: inherit;
52
+ font-size: 100%;
53
+ font-weight: inherit;
54
+ line-height: inherit;
55
+ color: inherit;
56
+ }
57
+
58
+ button, select {
59
+ text-transform: none;
60
+ }
61
+
62
+ button,
63
+ [type="button"],
64
+ [type="reset"],
65
+ [type="submit"] {
66
+ -webkit-appearance: button;
67
+ appearance: button;
68
+ }
69
+
70
+ table {
71
+ text-indent: 0;
72
+ border-color: inherit;
73
+ border-collapse: collapse;
74
+ }
75
+
76
+ img, svg, video, canvas, audio, iframe, embed, object {
77
+ display: block;
78
+ vertical-align: middle;
79
+ }
80
+
81
+ img, video {
82
+ max-width: 100%;
83
+ height: auto;
84
+ }
85
+
86
+ [hidden] {
87
+ display: none;
88
+ }
89
+ }
@@ -0,0 +1,106 @@
1
+ @layer canvas.tokens {
2
+ :root {
3
+ --background: 0 0% 100%;
4
+ --foreground: 240 10% 3.9%;
5
+ --card: 0 0% 100%;
6
+ --card-foreground: 240 10% 3.9%;
7
+ --popover: 0 0% 100%;
8
+ --popover-foreground: 240 10% 3.9%;
9
+ --primary: 240 5.9% 10%;
10
+ --primary-foreground: 0 0% 98%;
11
+ --secondary: 240 4.8% 95.9%;
12
+ --secondary-foreground: 240 5.9% 10%;
13
+ --muted: 240 4.8% 95.9%;
14
+ --muted-foreground: 240 3.8% 46.1%;
15
+ --accent: 240 4.8% 95.9%;
16
+ --accent-foreground: 240 5.9% 10%;
17
+ --destructive: 0 72% 51%;
18
+ --destructive-foreground: 0 0% 98%;
19
+ --border: 240 5.9% 90%;
20
+ --input: 240 5.9% 90%;
21
+ --ring: 240 5.9% 10%;
22
+ --radius: 0.5rem;
23
+
24
+ --chart-1: 12 76% 61%;
25
+ --chart-2: 173 58% 39%;
26
+ --chart-3: 197 37% 24%;
27
+ --chart-4: 43 74% 66%;
28
+ --chart-5: 27 87% 67%;
29
+
30
+ --sidebar-background: 0 0% 98%;
31
+ --sidebar-foreground: 240 5.3% 26.1%;
32
+ --sidebar-primary: 240 5.9% 10%;
33
+ --sidebar-primary-foreground: 0 0% 98%;
34
+ --sidebar-accent: 240 4.8% 95.9%;
35
+ --sidebar-accent-foreground: 240 5.9% 10%;
36
+ --sidebar-border: 220 13% 91%;
37
+ --sidebar-ring: 217.2 91.2% 59.8%;
38
+
39
+ --brand-blue-700: #1e40af;
40
+ --brand-blue-400: #60a5fa;
41
+ --brand-gradient: linear-gradient(135deg, #1e40af 0%, #60a5fa 100%);
42
+
43
+ --orb-indigo: #6366f1;
44
+ --orb-violet: #8b5cf6;
45
+ --orb-cyan: #06b6d4;
46
+
47
+ --color-success: hsl(143 70% 45%);
48
+ --color-warning: hsl(38 92% 50%);
49
+ --color-info: hsl(217 91% 60%);
50
+
51
+ --success-bg: 141 79% 85%;
52
+ --success-fg: 144 61% 20%;
53
+ --warning-bg: 48 96% 89%;
54
+ --warning-fg: 40 80% 27%;
55
+ --error-bg: 0 93% 94%;
56
+ --error-fg: 0 70% 35%;
57
+ --info-bg: 214 95% 93%;
58
+ --info-fg: 221 83% 45%;
59
+ }
60
+
61
+ .dark {
62
+ --background: 240 10% 3.9%;
63
+ --foreground: 0 0% 98%;
64
+ --card: 240 10% 3.9%;
65
+ --card-foreground: 0 0% 98%;
66
+ --popover: 240 10% 3.9%;
67
+ --popover-foreground: 0 0% 98%;
68
+ --primary: 0 0% 98%;
69
+ --primary-foreground: 240 5.9% 10%;
70
+ --secondary: 240 3.7% 15.9%;
71
+ --secondary-foreground: 0 0% 98%;
72
+ --muted: 240 3.7% 15.9%;
73
+ --muted-foreground: 240 5% 64.9%;
74
+ --accent: 240 3.7% 15.9%;
75
+ --accent-foreground: 0 0% 98%;
76
+ --destructive: 0 62.8% 30.6%;
77
+ --destructive-foreground: 0 0% 98%;
78
+ --border: 240 3.7% 15.9%;
79
+ --input: 240 3.7% 15.9%;
80
+ --ring: 240 4.9% 83.9%;
81
+
82
+ --chart-1: 220 70% 50%;
83
+ --chart-2: 160 60% 45%;
84
+ --chart-3: 30 80% 55%;
85
+ --chart-4: 280 65% 60%;
86
+ --chart-5: 340 75% 55%;
87
+
88
+ --sidebar-background: 240 5.9% 10%;
89
+ --sidebar-foreground: 240 4.8% 95.9%;
90
+ --sidebar-primary: 224.3 76.3% 48%;
91
+ --sidebar-primary-foreground: 0 0% 100%;
92
+ --sidebar-accent: 240 3.7% 15.9%;
93
+ --sidebar-accent-foreground: 240 4.8% 95.9%;
94
+ --sidebar-border: 240 3.7% 15.9%;
95
+ --sidebar-ring: 217.2 91.2% 59.8%;
96
+
97
+ --success-bg: 149 50% 22%;
98
+ --success-fg: 142 70% 65%;
99
+ --warning-bg: 38 50% 20%;
100
+ --warning-fg: 43 90% 65%;
101
+ --error-bg: 0 50% 18%;
102
+ --error-fg: 0 80% 70%;
103
+ --info-bg: 217 50% 22%;
104
+ --info-fg: 217 90% 72%;
105
+ }
106
+ }
@@ -0,0 +1,33 @@
1
+ @layer canvas.tokens {
2
+ @keyframes toast-in {
3
+ from { opacity: 0; transform: translateY(8px); }
4
+ to { opacity: 1; transform: translateY(0); }
5
+ }
6
+
7
+ @keyframes modal-in {
8
+ from { opacity: 0; transform: scale(0.96); }
9
+ to { opacity: 1; transform: scale(1); }
10
+ }
11
+
12
+ @keyframes fade-in {
13
+ from { opacity: 0; }
14
+ to { opacity: 1; }
15
+ }
16
+
17
+ @keyframes slide-in {
18
+ from { transform: translateX(100%); }
19
+ to { transform: translateX(0); }
20
+ }
21
+
22
+ :root {
23
+ --duration-fast: 150ms;
24
+ --duration-normal: 200ms;
25
+ --duration-slow: 300ms;
26
+ --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
27
+
28
+ --animate-toast-in: toast-in var(--duration-normal) ease-out;
29
+ --animate-modal-in: modal-in 180ms ease-out;
30
+ --animate-fade-in: fade-in var(--duration-normal) ease-out;
31
+ --animate-slide-in: slide-in 240ms var(--ease-out);
32
+ }
33
+ }
@@ -0,0 +1,10 @@
1
+ @layer canvas.tokens {
2
+ :root {
3
+ --radius-sm: 4px;
4
+ --radius-md: 6px;
5
+ --radius-lg: 8px;
6
+ --radius-xl: 12px;
7
+ --radius-2xl: 16px;
8
+ --radius-full: 9999px;
9
+ }
10
+ }
@@ -0,0 +1,35 @@
1
+ @layer canvas.tokens {
2
+ :root {
3
+ --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
4
+ --shadow-sm:
5
+ 0 1px 2px hsl(220 30% 20% / 0.04),
6
+ 0 2px 4px -1px hsl(220 30% 20% / 0.06);
7
+ --shadow-md:
8
+ 0 1px 2px hsl(220 30% 20% / 0.04),
9
+ 0 8px 24px -12px hsl(220 30% 20% / 0.12);
10
+ --shadow-lg:
11
+ 0 2px 4px hsl(220 30% 20% / 0.04),
12
+ 0 12px 32px -8px hsl(220 30% 20% / 0.16);
13
+ --shadow-elevated:
14
+ 0 1px 2px hsl(220 30% 20% / 0.04),
15
+ 0 8px 24px -12px hsl(220 30% 20% / 0.12),
16
+ inset 0 1px 0 hsl(0 0% 100% / 0.5);
17
+ }
18
+
19
+ .dark {
20
+ --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.2);
21
+ --shadow-sm:
22
+ 0 1px 2px hsl(0 0% 0% / 0.2),
23
+ 0 2px 4px -1px hsl(0 0% 0% / 0.2);
24
+ --shadow-md:
25
+ 0 1px 2px hsl(0 0% 0% / 0.4),
26
+ 0 8px 24px -12px hsl(0 0% 0% / 0.5);
27
+ --shadow-lg:
28
+ 0 2px 4px hsl(0 0% 0% / 0.3),
29
+ 0 12px 32px -8px hsl(0 0% 0% / 0.5);
30
+ --shadow-elevated:
31
+ 0 1px 2px hsl(0 0% 0% / 0.4),
32
+ 0 8px 24px -12px hsl(0 0% 0% / 0.5),
33
+ inset 0 1px 0 hsl(0 0% 100% / 0.06);
34
+ }
35
+ }
@@ -0,0 +1,19 @@
1
+ @layer canvas.tokens {
2
+ :root {
3
+ --space-0: 0px;
4
+ --space-px: 1px;
5
+ --space-0-5: 0.125rem;
6
+ --space-1: 0.25rem;
7
+ --space-1-5: 0.375rem;
8
+ --space-2: 0.5rem;
9
+ --space-2-5: 0.625rem;
10
+ --space-3: 0.75rem;
11
+ --space-4: 1rem;
12
+ --space-5: 1.25rem;
13
+ --space-6: 1.5rem;
14
+ --space-8: 2rem;
15
+ --space-10: 2.5rem;
16
+ --space-12: 3rem;
17
+ --space-16: 4rem;
18
+ }
19
+ }
@@ -0,0 +1,6 @@
1
+ @layer canvas.tokens {
2
+ :root {
3
+ --font-sans: "Inter", system-ui, -apple-system, sans-serif;
4
+ --font-mono: "JetBrains Mono", "Fira Code", monospace;
5
+ }
6
+ }
@@ -0,0 +1,12 @@
1
+ @layer canvas.tokens {
2
+ :root {
3
+ --z-base: 0;
4
+ --z-dropdown: 10;
5
+ --z-sticky: 20;
6
+ --z-overlay: 30;
7
+ --z-sidebar: 40;
8
+ --z-modal: 50;
9
+ --z-popover: 60;
10
+ --z-toast: 70;
11
+ }
12
+ }
package/tsconfig.json CHANGED
@@ -1,23 +1,22 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "ESNext",
5
- "moduleResolution": "bundler",
6
- "jsx": "react-jsx",
7
- "strict": true,
8
- "esModuleInterop": true,
9
- "skipLibCheck": true,
10
- "forceConsistentCasingInFileNames": true,
11
- "resolveJsonModule": true,
12
- "isolatedModules": true,
13
- "declaration": true,
14
- "declarationMap": true,
15
- "outDir": "./dist",
16
- "baseUrl": ".",
17
- "paths": {
18
- "@/*": ["./src/*"]
19
- }
20
- },
21
- "include": ["src/**/*.ts", "src/**/*.tsx"],
22
- "exclude": ["node_modules", "dist"]
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "resolveJsonModule": true,
11
+ "isolatedModules": true,
12
+ "declaration": true,
13
+ "declarationMap": true,
14
+ "outDir": "./dist",
15
+ "baseUrl": ".",
16
+ "paths": {
17
+ "@/*": ["./src/*"]
18
+ }
19
+ },
20
+ "include": ["src/**/*.ts"],
21
+ "exclude": ["node_modules", "dist"]
23
22
  }
package/README.md DELETED
@@ -1,60 +0,0 @@
1
- # @olympusoss/canvas
2
-
3
- The Olympus design system — a React + Tailwind component library used by every Olympus app (Athena, Hera, Daedalus, …). Built on top of Radix primitives, Lucide icons, and Tailwind v4.
4
-
5
- **Source-only package.** Ships TypeScript source via `main: ./src/index.ts` rather than a built bundle, so consumers tree-shake what they actually use and get accurate types from the source.
6
-
7
- ## Install
8
-
9
- ```sh
10
- npm install @olympusoss/canvas
11
- # peers
12
- npm install react react-dom
13
- ```
14
-
15
- Optional peers (only install if you use the related components):
16
-
17
- ```sh
18
- npm install @rjsf/core @rjsf/utils @rjsf/validator-ajv8 # SchemaForm
19
- npm install libphonenumber-js # PhoneInput
20
- ```
21
-
22
- ## Quick start
23
-
24
- ```tsx
25
- import "@olympusoss/canvas/styles/tokens.css";
26
- import { Button, Icon } from "@olympusoss/canvas";
27
-
28
- export default function App() {
29
- return (
30
- <Button variant="default" size="sm">
31
- <Icon name="Plus" />
32
- New identity
33
- </Button>
34
- );
35
- }
36
- ```
37
-
38
- Tailwind v4 setup (in your app's CSS entrypoint):
39
-
40
- ```css
41
- @import "tailwindcss";
42
- @source "../node_modules/@olympusoss/canvas/src/**/*.{ts,tsx}";
43
- ```
44
-
45
- That `@source` directive tells Tailwind to scan Canvas's source files so utility classes used by Canvas components are included in your build.
46
-
47
- ## Components
48
-
49
- - **Atoms** — Button, Input, Badge, Icon, Avatar, Switch, Slider, …
50
- - **Molecules** — PageHeader, StatCard, SectionCard, StatusBadge, FieldDisplay, EmptyState, DataTable's pieces, …
51
- - **Organisms** — DashboardGrid, DataTable, Sidebar, Dialog, Sheet, Drawer, Popover, Form, Tabs, CodeEditor, MarkdownEditor, RichTextEditor, …
52
- - **Charts** — Theme-aware Recharts wrappers + extras: Sparkline, Gauge, ActivityHeatmap, LabeledBarList, ServiceHealthList, StackedBar, WorldHeatMap, …
53
-
54
- Browse the live docs for usage, props, and interactive examples for every component:
55
-
56
- → **https://olympusoss.github.io/canvas/**
57
-
58
- ## License
59
-
60
- MIT — see [LICENSE](./LICENSE) (or the `license` field in `package.json`).
@@ -1,11 +0,0 @@
1
- # Atoms
2
-
3
- Single primitive wrappers. Zero composition.
4
-
5
- **Can import**: `tokens/`, `lib/utils`, React. **That's it.**
6
-
7
- **Cannot import**: anything from `molecules/`, `organisms/`, or `templates/`.
8
-
9
- If an atom wants to compose another atom, it's probably a molecule — promote it.
10
-
11
- See [CONTRIBUTING.md](../../../CONTRIBUTING.md) for the full atomic-design rules.
@@ -1,32 +0,0 @@
1
- "use client";
2
-
3
- import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
4
- import type * as React from "react";
5
-
6
- export interface AspectRatioProps
7
- extends React.ComponentPropsWithoutRef<typeof AspectRatioPrimitive.Root> {
8
- /**
9
- * Aspect ratio expressed as a number (e.g. `16/9`, `4/3`, `1`). The
10
- * child element is sized to fit this ratio while preserving the
11
- * container's width.
12
- */
13
- ratio?: number;
14
- /**
15
- * Render as a Radix Slot — useful when wrapping a custom container that
16
- * already has its own DOM element.
17
- * @default false
18
- */
19
- asChild?: boolean;
20
- children?: React.ReactNode;
21
- className?: string;
22
- }
23
-
24
- /**
25
- * Re-export of Radix's `AspectRatio.Root`. Pass `ratio` (number, e.g.
26
- * `16/9`) to lock a child's aspect ratio.
27
- */
28
- const AspectRatio = AspectRatioPrimitive.Root as React.ForwardRefExoticComponent<
29
- AspectRatioProps & React.RefAttributes<HTMLDivElement>
30
- >;
31
-
32
- export { AspectRatio };
@@ -1,98 +0,0 @@
1
- "use client";
2
-
3
- import * as AvatarPrimitive from "@radix-ui/react-avatar";
4
- import * as React from "react";
5
-
6
- import { cn } from "../../lib/utils";
7
-
8
- export interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> {
9
- /**
10
- * Render as a Radix Slot — wrap a custom element while keeping the
11
- * Avatar's image-loading behaviour.
12
- * @default false
13
- */
14
- asChild?: boolean;
15
- /** Avatar content — typically `<AvatarImage>` + `<AvatarFallback>`. */
16
- children?: React.ReactNode;
17
- className?: string;
18
- }
19
-
20
- /**
21
- * Round profile-image container. Composes `Avatar` + `AvatarImage` +
22
- * `AvatarFallback`. Defaults to `h-10 w-10`.
23
- */
24
- const Avatar = React.forwardRef<React.ElementRef<typeof AvatarPrimitive.Root>, AvatarProps>(
25
- ({ className, ...props }, ref) => (
26
- <AvatarPrimitive.Root
27
- ref={ref}
28
- className={cn(
29
- "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full bg-white",
30
- className,
31
- )}
32
- {...props}
33
- />
34
- ),
35
- );
36
- Avatar.displayName = AvatarPrimitive.Root.displayName;
37
-
38
- export interface AvatarImageProps
39
- extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image> {
40
- /** Image URL. Hides itself if loading errors so the fallback can render. */
41
- src?: string;
42
- /** Accessible label. Defaults to the empty string for decorative use. */
43
- alt?: string;
44
- /** Radix lifecycle hook for tracking the load state. */
45
- onLoadingStatusChange?: (status: "idle" | "loading" | "loaded" | "error") => void;
46
- asChild?: boolean;
47
- className?: string;
48
- }
49
-
50
- /**
51
- * The `<img>` slot inside `<Avatar>`. Hides itself if loading errors so the
52
- * fallback can render.
53
- */
54
- const AvatarImage = React.forwardRef<
55
- React.ElementRef<typeof AvatarPrimitive.Image>,
56
- AvatarImageProps
57
- >(({ className, ...props }, ref) => (
58
- <AvatarPrimitive.Image
59
- ref={ref}
60
- className={cn("aspect-square h-full w-full", className)}
61
- {...props}
62
- />
63
- ));
64
- AvatarImage.displayName = AvatarPrimitive.Image.displayName;
65
-
66
- export interface AvatarFallbackProps
67
- extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback> {
68
- /**
69
- * Wait this many ms before showing the fallback (avoids flash on fast
70
- * image loads).
71
- */
72
- delayMs?: number;
73
- asChild?: boolean;
74
- /** Initials, icon, or silhouette. */
75
- children?: React.ReactNode;
76
- className?: string;
77
- }
78
-
79
- /**
80
- * Rendered when the image is missing or still loading — typically initials,
81
- * an icon, or a silhouette.
82
- */
83
- const AvatarFallback = React.forwardRef<
84
- React.ElementRef<typeof AvatarPrimitive.Fallback>,
85
- AvatarFallbackProps
86
- >(({ className, ...props }, ref) => (
87
- <AvatarPrimitive.Fallback
88
- ref={ref}
89
- className={cn(
90
- "flex h-full w-full items-center justify-center rounded-full bg-white",
91
- className,
92
- )}
93
- {...props}
94
- />
95
- ));
96
- AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
97
-
98
- export { Avatar, AvatarFallback, AvatarImage };