@olympusoss/canvas 2.20.1 → 3.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.
Files changed (214) hide show
  1. package/README.md +69 -35
  2. package/package.json +45 -177
  3. package/src/cn.ts +3 -0
  4. package/src/index.ts +12 -603
  5. package/src/theme.ts +62 -0
  6. package/src/tokens.ts +11 -0
  7. package/styles/base.css +17 -0
  8. package/styles/canvas.css +77 -52
  9. package/styles/components/alert.css +66 -0
  10. package/styles/components/app-shell.css +46 -0
  11. package/styles/components/avatar.css +22 -0
  12. package/styles/components/badge.css +83 -0
  13. package/styles/components/breadcrumb.css +35 -0
  14. package/styles/components/button-group.css +23 -0
  15. package/styles/components/button.css +107 -0
  16. package/styles/components/calendar.css +73 -0
  17. package/styles/components/card.css +58 -0
  18. package/styles/components/checkbox.css +55 -0
  19. package/styles/components/code-block.css +18 -0
  20. package/styles/components/combobox.css +75 -0
  21. package/styles/components/command.css +94 -0
  22. package/styles/components/data-table.css +142 -0
  23. package/styles/components/dialog.css +72 -0
  24. package/styles/components/dropdown.css +54 -0
  25. package/styles/components/empty-state.css +17 -0
  26. package/styles/components/field.css +27 -0
  27. package/styles/components/filter-panel.css +58 -0
  28. package/styles/components/form.css +27 -0
  29. package/styles/components/icon.css +8 -0
  30. package/styles/components/input-group.css +45 -0
  31. package/styles/components/input.css +56 -0
  32. package/styles/components/kbd.css +15 -0
  33. package/styles/components/page-header.css +52 -0
  34. package/styles/components/pagination.css +48 -0
  35. package/styles/components/popover.css +14 -0
  36. package/styles/components/radio.css +28 -0
  37. package/styles/components/row-menu.css +69 -0
  38. package/styles/components/section-card.css +49 -0
  39. package/styles/components/select.css +57 -0
  40. package/styles/components/separator.css +32 -0
  41. package/styles/components/sheet.css +70 -0
  42. package/styles/components/sidebar.css +146 -0
  43. package/styles/components/skeleton.css +32 -0
  44. package/styles/components/spinner.css +26 -0
  45. package/styles/components/stat-card.css +71 -0
  46. package/styles/components/stepper.css +63 -0
  47. package/styles/components/switch.css +45 -0
  48. package/styles/components/tabs.css +40 -0
  49. package/styles/components/textarea.css +31 -0
  50. package/styles/components/toast.css +95 -0
  51. package/styles/components/tooltip.css +53 -0
  52. package/styles/components/topbar.css +24 -0
  53. package/styles/components/typography.css +105 -0
  54. package/styles/patterns/backdrops.css +35 -0
  55. package/styles/patterns/density.css +66 -0
  56. package/styles/patterns/focus.css +22 -0
  57. package/styles/patterns/glass.css +85 -0
  58. package/styles/patterns/high-contrast.css +70 -0
  59. package/styles/patterns/reduced-motion.css +12 -0
  60. package/styles/patterns/scrollbar.css +10 -0
  61. package/styles/reset.css +89 -0
  62. package/styles/tokens/colors.css +106 -0
  63. package/styles/tokens/motion.css +33 -0
  64. package/styles/tokens/radius.css +10 -0
  65. package/styles/tokens/shadows.css +35 -0
  66. package/styles/tokens/spacing.css +19 -0
  67. package/styles/tokens/typography.css +6 -0
  68. package/styles/tokens/z-index.css +12 -0
  69. package/styles/utilities/display.css +66 -0
  70. package/styles/utilities/flexbox.css +240 -0
  71. package/styles/utilities/gap.css +288 -0
  72. package/styles/utilities/grid.css +138 -0
  73. package/styles/utilities/position.css +78 -0
  74. package/styles/utilities/sizing.css +138 -0
  75. package/tsconfig.json +20 -21
  76. package/src/components/atoms/README.md +0 -11
  77. package/src/components/atoms/aspect-ratio.tsx +0 -32
  78. package/src/components/atoms/avatar.tsx +0 -98
  79. package/src/components/atoms/badge.tsx +0 -44
  80. package/src/components/atoms/brand-mark.tsx +0 -74
  81. package/src/components/atoms/button.tsx +0 -105
  82. package/src/components/atoms/checkbox.tsx +0 -63
  83. package/src/components/atoms/flex-box.tsx +0 -105
  84. package/src/components/atoms/icon.tsx +0 -34
  85. package/src/components/atoms/input.tsx +0 -92
  86. package/src/components/atoms/label.tsx +0 -41
  87. package/src/components/atoms/logo.tsx +0 -89
  88. package/src/components/atoms/progress.tsx +0 -55
  89. package/src/components/atoms/radio-group.tsx +0 -122
  90. package/src/components/atoms/scroll-area.tsx +0 -106
  91. package/src/components/atoms/section.tsx +0 -48
  92. package/src/components/atoms/separator.tsx +0 -45
  93. package/src/components/atoms/skeleton.tsx +0 -17
  94. package/src/components/atoms/slider.tsx +0 -93
  95. package/src/components/atoms/spinner.tsx +0 -47
  96. package/src/components/atoms/switch.tsx +0 -60
  97. package/src/components/atoms/textarea.tsx +0 -78
  98. package/src/components/atoms/toggle.tsx +0 -80
  99. package/src/components/charts/activity-heatmap.tsx +0 -186
  100. package/src/components/charts/axes.tsx +0 -21
  101. package/src/components/charts/chart-container.tsx +0 -254
  102. package/src/components/charts/chart-legend.tsx +0 -67
  103. package/src/components/charts/chart-tooltip.tsx +0 -161
  104. package/src/components/charts/chart-types.tsx +0 -49
  105. package/src/components/charts/containers.tsx +0 -11
  106. package/src/components/charts/data.tsx +0 -16
  107. package/src/components/charts/details.tsx +0 -25
  108. package/src/components/charts/dot-pulse.tsx +0 -61
  109. package/src/components/charts/gauge.tsx +0 -106
  110. package/src/components/charts/grids.tsx +0 -8
  111. package/src/components/charts/index.ts +0 -62
  112. package/src/components/charts/labeled-bar-list.tsx +0 -85
  113. package/src/components/charts/metric-breakdown.tsx +0 -316
  114. package/src/components/charts/references.tsx +0 -8
  115. package/src/components/charts/service-health-list.tsx +0 -85
  116. package/src/components/charts/sparkline-area.tsx +0 -80
  117. package/src/components/charts/sparkline.tsx +0 -52
  118. package/src/components/charts/stacked-bar.tsx +0 -104
  119. package/src/components/charts/text.tsx +0 -10
  120. package/src/components/charts/world-heat-map-inner.tsx +0 -317
  121. package/src/components/charts/world-heat-map.tsx +0 -184
  122. package/src/components/molecules/README.md +0 -12
  123. package/src/components/molecules/action-bar.tsx +0 -73
  124. package/src/components/molecules/activity-item.tsx +0 -74
  125. package/src/components/molecules/alert.tsx +0 -86
  126. package/src/components/molecules/animated-background.tsx +0 -92
  127. package/src/components/molecules/auth-shell.tsx +0 -95
  128. package/src/components/molecules/brand-lockup.tsx +0 -48
  129. package/src/components/molecules/breadcrumb.tsx +0 -157
  130. package/src/components/molecules/button-group.tsx +0 -104
  131. package/src/components/molecules/calendar.tsx +0 -217
  132. package/src/components/molecules/card.tsx +0 -102
  133. package/src/components/molecules/client-brand.tsx +0 -95
  134. package/src/components/molecules/code-block.tsx +0 -86
  135. package/src/components/molecules/countdown-button.tsx +0 -92
  136. package/src/components/molecules/empty-state.tsx +0 -56
  137. package/src/components/molecules/error-state.tsx +0 -42
  138. package/src/components/molecules/field-display.tsx +0 -35
  139. package/src/components/molecules/input-otp.tsx +0 -74
  140. package/src/components/molecules/launcher-card.tsx +0 -152
  141. package/src/components/molecules/loading-state.tsx +0 -36
  142. package/src/components/molecules/notification-item.tsx +0 -67
  143. package/src/components/molecules/notification-list.tsx +0 -45
  144. package/src/components/molecules/number-badge.tsx +0 -53
  145. package/src/components/molecules/or-separator.tsx +0 -38
  146. package/src/components/molecules/page-header.tsx +0 -88
  147. package/src/components/molecules/page-tabs.tsx +0 -94
  148. package/src/components/molecules/pagination.tsx +0 -150
  149. package/src/components/molecules/password-input.tsx +0 -83
  150. package/src/components/molecules/password-strength-meter.tsx +0 -104
  151. package/src/components/molecules/phone-input.tsx +0 -200
  152. package/src/components/molecules/search-bar.tsx +0 -64
  153. package/src/components/molecules/secret-field.tsx +0 -158
  154. package/src/components/molecules/section-card.tsx +0 -91
  155. package/src/components/molecules/social-buttons.tsx +0 -165
  156. package/src/components/molecules/stat-card.tsx +0 -100
  157. package/src/components/molecules/status-badge.tsx +0 -42
  158. package/src/components/molecules/stepper.tsx +0 -96
  159. package/src/components/molecules/table.tsx +0 -157
  160. package/src/components/molecules/terminal.tsx +0 -74
  161. package/src/components/molecules/toggle-group.tsx +0 -145
  162. package/src/components/molecules/tooltip.tsx +0 -155
  163. package/src/components/molecules/user-avatar-chip.tsx +0 -71
  164. package/src/components/organisms/README.md +0 -14
  165. package/src/components/organisms/accordion.tsx +0 -154
  166. package/src/components/organisms/alert-dialog.tsx +0 -277
  167. package/src/components/organisms/carousel.tsx +0 -244
  168. package/src/components/organisms/collapsible.tsx +0 -69
  169. package/src/components/organisms/command.tsx +0 -144
  170. package/src/components/organisms/context-menu.tsx +0 -339
  171. package/src/components/organisms/dashboard-grid.tsx +0 -369
  172. package/src/components/organisms/data-table.tsx +0 -330
  173. package/src/components/organisms/dialog.tsx +0 -312
  174. package/src/components/organisms/drawer.tsx +0 -123
  175. package/src/components/organisms/dropdown-menu.tsx +0 -440
  176. package/src/components/organisms/editors/code-editor.tsx +0 -144
  177. package/src/components/organisms/editors/index.ts +0 -4
  178. package/src/components/organisms/editors/markdown-editor.tsx +0 -153
  179. package/src/components/organisms/editors/markdown-renderer.ts +0 -27
  180. package/src/components/organisms/editors/prose-canvas-classes.ts +0 -45
  181. package/src/components/organisms/editors/rich-text-editor.tsx +0 -126
  182. package/src/components/organisms/editors/toolbar/md-toolbar.tsx +0 -129
  183. package/src/components/organisms/editors/toolbar/rte-toolbar.tsx +0 -211
  184. package/src/components/organisms/editors/toolbar/toolbar-shell.tsx +0 -45
  185. package/src/components/organisms/editors/use-codemirror-theme.ts +0 -61
  186. package/src/components/organisms/error-boundary.tsx +0 -61
  187. package/src/components/organisms/form.tsx +0 -174
  188. package/src/components/organisms/hover-card.tsx +0 -115
  189. package/src/components/organisms/menubar.tsx +0 -498
  190. package/src/components/organisms/navbar.tsx +0 -104
  191. package/src/components/organisms/navigation-menu.tsx +0 -235
  192. package/src/components/organisms/popover.tsx +0 -149
  193. package/src/components/organisms/resizable.tsx +0 -58
  194. package/src/components/organisms/schema-form.tsx +0 -232
  195. package/src/components/organisms/select.tsx +0 -309
  196. package/src/components/organisms/sheet.tsx +0 -265
  197. package/src/components/organisms/sidebar.tsx +0 -1040
  198. package/src/components/organisms/sonner.tsx +0 -96
  199. package/src/components/organisms/tabs.tsx +0 -133
  200. package/src/components/organisms/theme-provider.tsx +0 -101
  201. package/src/hooks/use-mobile.tsx +0 -19
  202. package/src/lib/portal-container.tsx +0 -35
  203. package/src/lib/utils.ts +0 -6
  204. package/src/native.ts +0 -23
  205. package/src/tokens/colors.ts +0 -91
  206. package/src/tokens/index.ts +0 -3
  207. package/src/tokens/spacing.ts +0 -55
  208. package/src/tokens/typography.ts +0 -27
  209. package/styles/dashboard-grid.css +0 -47
  210. package/styles/fonts/Roboto-VariableFont_wdth_wght.ttf +0 -0
  211. package/styles/glass.css +0 -171
  212. package/styles/leaflet.css +0 -13
  213. package/styles/tokens.css +0 -317
  214. package/tailwind.config.ts +0 -70
@@ -0,0 +1,78 @@
1
+ /* AUTO-GENERATED by scripts/generate-utilities.ts. Do not edit by hand; run: bun run generate-utilities */
2
+ @layer canvas.utilities {
3
+ .static { position:static; }
4
+ .relative { position:relative; }
5
+ .absolute { position:absolute; }
6
+ .fixed { position:fixed; }
7
+ .sticky { position:sticky; }
8
+ .inset-0 { top:0;right:0;bottom:0;left:0; }
9
+ .top-0 { top:0; }
10
+ .right-0 { right:0; }
11
+ .bottom-0 { bottom:0; }
12
+ .left-0 { left:0; }
13
+
14
+ @media (min-width: 640px) {
15
+ .sm\:static { position:static; }
16
+ .sm\:relative { position:relative; }
17
+ .sm\:absolute { position:absolute; }
18
+ .sm\:fixed { position:fixed; }
19
+ .sm\:sticky { position:sticky; }
20
+ .sm\:inset-0 { top:0;right:0;bottom:0;left:0; }
21
+ .sm\:top-0 { top:0; }
22
+ .sm\:right-0 { right:0; }
23
+ .sm\:bottom-0 { bottom:0; }
24
+ .sm\:left-0 { left:0; }
25
+ }
26
+
27
+ @media (min-width: 768px) {
28
+ .md\:static { position:static; }
29
+ .md\:relative { position:relative; }
30
+ .md\:absolute { position:absolute; }
31
+ .md\:fixed { position:fixed; }
32
+ .md\:sticky { position:sticky; }
33
+ .md\:inset-0 { top:0;right:0;bottom:0;left:0; }
34
+ .md\:top-0 { top:0; }
35
+ .md\:right-0 { right:0; }
36
+ .md\:bottom-0 { bottom:0; }
37
+ .md\:left-0 { left:0; }
38
+ }
39
+
40
+ @media (min-width: 1024px) {
41
+ .lg\:static { position:static; }
42
+ .lg\:relative { position:relative; }
43
+ .lg\:absolute { position:absolute; }
44
+ .lg\:fixed { position:fixed; }
45
+ .lg\:sticky { position:sticky; }
46
+ .lg\:inset-0 { top:0;right:0;bottom:0;left:0; }
47
+ .lg\:top-0 { top:0; }
48
+ .lg\:right-0 { right:0; }
49
+ .lg\:bottom-0 { bottom:0; }
50
+ .lg\:left-0 { left:0; }
51
+ }
52
+
53
+ @media (min-width: 1280px) {
54
+ .xl\:static { position:static; }
55
+ .xl\:relative { position:relative; }
56
+ .xl\:absolute { position:absolute; }
57
+ .xl\:fixed { position:fixed; }
58
+ .xl\:sticky { position:sticky; }
59
+ .xl\:inset-0 { top:0;right:0;bottom:0;left:0; }
60
+ .xl\:top-0 { top:0; }
61
+ .xl\:right-0 { right:0; }
62
+ .xl\:bottom-0 { bottom:0; }
63
+ .xl\:left-0 { left:0; }
64
+ }
65
+
66
+ @media (min-width: 1536px) {
67
+ .\32 xl\:static { position:static; }
68
+ .\32 xl\:relative { position:relative; }
69
+ .\32 xl\:absolute { position:absolute; }
70
+ .\32 xl\:fixed { position:fixed; }
71
+ .\32 xl\:sticky { position:sticky; }
72
+ .\32 xl\:inset-0 { top:0;right:0;bottom:0;left:0; }
73
+ .\32 xl\:top-0 { top:0; }
74
+ .\32 xl\:right-0 { right:0; }
75
+ .\32 xl\:bottom-0 { bottom:0; }
76
+ .\32 xl\:left-0 { left:0; }
77
+ }
78
+ }
@@ -0,0 +1,138 @@
1
+ /* AUTO-GENERATED by scripts/generate-utilities.ts. Do not edit by hand; run: bun run generate-utilities */
2
+ @layer canvas.utilities {
3
+ .w-full { width:100%; }
4
+ .w-screen { width:100vw; }
5
+ .w-auto { width:auto; }
6
+ .w-min { width:min-content; }
7
+ .w-max { width:max-content; }
8
+ .w-fit { width:fit-content; }
9
+ .w-1\/2 { width:50%; }
10
+ .w-0 { width:0px; }
11
+ .h-full { height:100%; }
12
+ .h-screen { height:100vh; }
13
+ .h-auto { height:auto; }
14
+ .h-min { height:min-content; }
15
+ .h-max { height:max-content; }
16
+ .h-fit { height:fit-content; }
17
+ .h-dvh { height:100dvh; }
18
+ .h-0 { height:0px; }
19
+ .min-w-0 { min-width:0px; }
20
+ .min-h-0 { min-height:0px; }
21
+ .max-w-full { max-width:100%; }
22
+ .max-h-full { max-height:100%; }
23
+
24
+ @media (min-width: 640px) {
25
+ .sm\:w-full { width:100%; }
26
+ .sm\:w-screen { width:100vw; }
27
+ .sm\:w-auto { width:auto; }
28
+ .sm\:w-min { width:min-content; }
29
+ .sm\:w-max { width:max-content; }
30
+ .sm\:w-fit { width:fit-content; }
31
+ .sm\:w-1\/2 { width:50%; }
32
+ .sm\:w-0 { width:0px; }
33
+ .sm\:h-full { height:100%; }
34
+ .sm\:h-screen { height:100vh; }
35
+ .sm\:h-auto { height:auto; }
36
+ .sm\:h-min { height:min-content; }
37
+ .sm\:h-max { height:max-content; }
38
+ .sm\:h-fit { height:fit-content; }
39
+ .sm\:h-dvh { height:100dvh; }
40
+ .sm\:h-0 { height:0px; }
41
+ .sm\:min-w-0 { min-width:0px; }
42
+ .sm\:min-h-0 { min-height:0px; }
43
+ .sm\:max-w-full { max-width:100%; }
44
+ .sm\:max-h-full { max-height:100%; }
45
+ }
46
+
47
+ @media (min-width: 768px) {
48
+ .md\:w-full { width:100%; }
49
+ .md\:w-screen { width:100vw; }
50
+ .md\:w-auto { width:auto; }
51
+ .md\:w-min { width:min-content; }
52
+ .md\:w-max { width:max-content; }
53
+ .md\:w-fit { width:fit-content; }
54
+ .md\:w-1\/2 { width:50%; }
55
+ .md\:w-0 { width:0px; }
56
+ .md\:h-full { height:100%; }
57
+ .md\:h-screen { height:100vh; }
58
+ .md\:h-auto { height:auto; }
59
+ .md\:h-min { height:min-content; }
60
+ .md\:h-max { height:max-content; }
61
+ .md\:h-fit { height:fit-content; }
62
+ .md\:h-dvh { height:100dvh; }
63
+ .md\:h-0 { height:0px; }
64
+ .md\:min-w-0 { min-width:0px; }
65
+ .md\:min-h-0 { min-height:0px; }
66
+ .md\:max-w-full { max-width:100%; }
67
+ .md\:max-h-full { max-height:100%; }
68
+ }
69
+
70
+ @media (min-width: 1024px) {
71
+ .lg\:w-full { width:100%; }
72
+ .lg\:w-screen { width:100vw; }
73
+ .lg\:w-auto { width:auto; }
74
+ .lg\:w-min { width:min-content; }
75
+ .lg\:w-max { width:max-content; }
76
+ .lg\:w-fit { width:fit-content; }
77
+ .lg\:w-1\/2 { width:50%; }
78
+ .lg\:w-0 { width:0px; }
79
+ .lg\:h-full { height:100%; }
80
+ .lg\:h-screen { height:100vh; }
81
+ .lg\:h-auto { height:auto; }
82
+ .lg\:h-min { height:min-content; }
83
+ .lg\:h-max { height:max-content; }
84
+ .lg\:h-fit { height:fit-content; }
85
+ .lg\:h-dvh { height:100dvh; }
86
+ .lg\:h-0 { height:0px; }
87
+ .lg\:min-w-0 { min-width:0px; }
88
+ .lg\:min-h-0 { min-height:0px; }
89
+ .lg\:max-w-full { max-width:100%; }
90
+ .lg\:max-h-full { max-height:100%; }
91
+ }
92
+
93
+ @media (min-width: 1280px) {
94
+ .xl\:w-full { width:100%; }
95
+ .xl\:w-screen { width:100vw; }
96
+ .xl\:w-auto { width:auto; }
97
+ .xl\:w-min { width:min-content; }
98
+ .xl\:w-max { width:max-content; }
99
+ .xl\:w-fit { width:fit-content; }
100
+ .xl\:w-1\/2 { width:50%; }
101
+ .xl\:w-0 { width:0px; }
102
+ .xl\:h-full { height:100%; }
103
+ .xl\:h-screen { height:100vh; }
104
+ .xl\:h-auto { height:auto; }
105
+ .xl\:h-min { height:min-content; }
106
+ .xl\:h-max { height:max-content; }
107
+ .xl\:h-fit { height:fit-content; }
108
+ .xl\:h-dvh { height:100dvh; }
109
+ .xl\:h-0 { height:0px; }
110
+ .xl\:min-w-0 { min-width:0px; }
111
+ .xl\:min-h-0 { min-height:0px; }
112
+ .xl\:max-w-full { max-width:100%; }
113
+ .xl\:max-h-full { max-height:100%; }
114
+ }
115
+
116
+ @media (min-width: 1536px) {
117
+ .\32 xl\:w-full { width:100%; }
118
+ .\32 xl\:w-screen { width:100vw; }
119
+ .\32 xl\:w-auto { width:auto; }
120
+ .\32 xl\:w-min { width:min-content; }
121
+ .\32 xl\:w-max { width:max-content; }
122
+ .\32 xl\:w-fit { width:fit-content; }
123
+ .\32 xl\:w-1\/2 { width:50%; }
124
+ .\32 xl\:w-0 { width:0px; }
125
+ .\32 xl\:h-full { height:100%; }
126
+ .\32 xl\:h-screen { height:100vh; }
127
+ .\32 xl\:h-auto { height:auto; }
128
+ .\32 xl\:h-min { height:min-content; }
129
+ .\32 xl\:h-max { height:max-content; }
130
+ .\32 xl\:h-fit { height:fit-content; }
131
+ .\32 xl\:h-dvh { height:100dvh; }
132
+ .\32 xl\:h-0 { height:0px; }
133
+ .\32 xl\:min-w-0 { min-width:0px; }
134
+ .\32 xl\:min-h-0 { min-height:0px; }
135
+ .\32 xl\:max-w-full { max-width:100%; }
136
+ .\32 xl\:max-h-full { max-height:100%; }
137
+ }
138
+ }
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
  }
@@ -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 };
@@ -1,44 +0,0 @@
1
- import { cva, type VariantProps } from "class-variance-authority";
2
- import type * as React from "react";
3
-
4
- import { cn } from "../../lib/utils";
5
-
6
- const badgeVariants = cva(
7
- "inline-flex items-center rounded-md border border-border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
8
- {
9
- variants: {
10
- variant: {
11
- default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
12
- secondary:
13
- "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
14
- destructive:
15
- "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
16
- outline: "text-foreground",
17
- },
18
- },
19
- defaultVariants: {
20
- variant: "default",
21
- },
22
- },
23
- );
24
-
25
- export interface BadgeProps
26
- extends React.HTMLAttributes<HTMLDivElement>,
27
- VariantProps<typeof badgeVariants> {
28
- /**
29
- * Visual style. `default` is filled brand colour, `secondary` is a muted
30
- * neutral, `outline` is bordered with no fill, `destructive` flags an
31
- * error or warning state.
32
- * @default "default"
33
- */
34
- variant?: "default" | "secondary" | "destructive" | "outline";
35
- /** Badge label or any nested elements. */
36
- children?: React.ReactNode;
37
- className?: string;
38
- }
39
-
40
- function Badge({ className, variant, ...props }: BadgeProps) {
41
- return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
42
- }
43
-
44
- export { Badge, badgeVariants };
@@ -1,74 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- export interface BrandMarkProps extends React.SVGAttributes<SVGSVGElement> {
8
- /**
9
- * SVG path data (`d` attribute) for the brand mark. Required — canvas
10
- * does not ship a default brand shape; consuming apps supply their own.
11
- */
12
- path: string;
13
- /**
14
- * SVG `viewBox` matching the path's coordinate space.
15
- * @default "0 0 24 24"
16
- */
17
- viewBox?: string;
18
- /**
19
- * Optional inner `transform` applied to the path's `<g>` group — useful
20
- * when the path coordinates need to be translated, rotated, or scaled
21
- * relative to the viewBox.
22
- */
23
- transform?: string;
24
- /**
25
- * Gradient start colour. When omitted, the path is filled with
26
- * `currentColor` and no gradient is generated.
27
- */
28
- from?: string;
29
- /**
30
- * Gradient end colour. Required when `from` is set.
31
- */
32
- to?: string;
33
- }
34
-
35
- /**
36
- * Generic brand-mark primitive. Renders a single SVG `path` either with
37
- * `currentColor` (the default) or with a two-stop linear gradient when both
38
- * `from` and `to` are provided. Sizing is controlled via `className`
39
- * (`h-10 w-auto`); the SVG honours its `viewBox` aspect ratio.
40
- *
41
- * Apps consuming canvas typically build a thin wrapper around this component
42
- * that hard-codes their own brand path / gradient — see the docs site's
43
- * `OlympusLogo` for a worked example.
44
- */
45
- const BrandMark = React.forwardRef<SVGSVGElement, BrandMarkProps>(
46
- ({ path, viewBox = "0 0 24 24", transform, from, to, className, ...props }, ref) => {
47
- const gradientId = React.useId();
48
- const useGradient = from !== undefined && to !== undefined;
49
- const fill = useGradient ? `url(#${gradientId})` : "currentColor";
50
- const pathEl = <path d={path} fill={fill} fillRule="evenodd" />;
51
- return (
52
- <svg
53
- ref={ref}
54
- xmlns="http://www.w3.org/2000/svg"
55
- viewBox={viewBox}
56
- className={cn("shrink-0", className)}
57
- {...props}
58
- >
59
- {useGradient && (
60
- <defs>
61
- <linearGradient id={gradientId} x1="1" y1="1" x2="0" y2="0">
62
- <stop offset="0%" stopColor={from} />
63
- <stop offset="100%" stopColor={to} />
64
- </linearGradient>
65
- </defs>
66
- )}
67
- {transform ? <g transform={transform}>{pathEl}</g> : pathEl}
68
- </svg>
69
- );
70
- },
71
- );
72
- BrandMark.displayName = "BrandMark";
73
-
74
- export { BrandMark };
@@ -1,105 +0,0 @@
1
- import { Slot } from "@radix-ui/react-slot";
2
- import { cva, type VariantProps } from "class-variance-authority";
3
- import * as React from "react";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- const buttonVariants = cva(
8
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
9
- {
10
- variants: {
11
- variant: {
12
- default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
13
- destructive: "bg-destructive text-destructive-foreground shadow hover:bg-destructive/90",
14
- outline:
15
- "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
16
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
17
- ghost: "hover:bg-accent hover:text-accent-foreground",
18
- link: "text-primary hover:text-brand",
19
- },
20
- size: {
21
- default: "h-9 px-4 py-2",
22
- sm: "h-8 rounded-md px-3 text-xs",
23
- lg: "h-10 rounded-md px-8",
24
- icon: "h-9 w-9",
25
- },
26
- },
27
- defaultVariants: {
28
- variant: "default",
29
- size: "default",
30
- },
31
- },
32
- );
33
-
34
- export interface ButtonProps
35
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
36
- VariantProps<typeof buttonVariants> {
37
- /**
38
- * Visual emphasis preset. `default` is the primary action, `destructive`
39
- * is for irreversible actions, `outline` and `secondary` are quieter,
40
- * `ghost` is borderless, `link` looks like body-text with a soft
41
- * color shift on hover (no underline).
42
- * @default "default"
43
- */
44
- variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
45
- /**
46
- * Height + horizontal padding preset. `sm` is 32px, `default` is 36px,
47
- * `lg` is 40px, `icon` is square 36×36 for icon-only buttons (always
48
- * pair with `aria-label`).
49
- * @default "default"
50
- */
51
- size?: "default" | "sm" | "lg" | "icon";
52
- /**
53
- * Render as a Radix Slot — forwards className and behaviour onto the
54
- * immediate child element instead of rendering a wrapper `<button>`.
55
- * Common pattern for using a router `<Link>` while keeping the Button
56
- * styling.
57
- * @default false
58
- */
59
- asChild?: boolean;
60
- /** Visible label or any nested elements (icons, badges). */
61
- children?: React.ReactNode;
62
- /** Tailwind / CSS classes merged onto the root element via `cn()`. */
63
- className?: string;
64
- /**
65
- * When true, dims the button to 50% opacity and blocks pointer/keyboard
66
- * input.
67
- * @default false
68
- */
69
- disabled?: boolean;
70
- /**
71
- * Native HTML button type. `submit` triggers parent form submission;
72
- * `reset` resets parent form fields; `button` does neither.
73
- * @default "button"
74
- */
75
- type?: "button" | "submit" | "reset";
76
- /** Click handler. Receives a `MouseEvent<HTMLButtonElement>`. */
77
- onClick?: React.MouseEventHandler<HTMLButtonElement>;
78
- /** Form name when this button submits/resets a form (for forms with multiple buttons). */
79
- name?: string;
80
- /** Form value sent with the form when this button is the submitter. */
81
- value?: string | number | readonly string[];
82
- /**
83
- * ID of the form this button belongs to, when the button sits outside
84
- * the `<form>` element.
85
- */
86
- form?: string;
87
- /** Tab order. Default behaviour is one of native `<button>` tab focus. */
88
- tabIndex?: number;
89
- /** Accessible label, required for icon-only buttons (`size="icon"`). */
90
- "aria-label"?: string;
91
- /** ID of an element that describes the button's purpose. */
92
- "aria-describedby"?: string;
93
- }
94
-
95
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
96
- ({ className, variant, size, asChild = false, ...props }, ref) => {
97
- const Comp = asChild ? Slot : "button";
98
- return (
99
- <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
100
- );
101
- },
102
- );
103
- Button.displayName = "Button";
104
-
105
- export { Button, buttonVariants };
@@ -1,63 +0,0 @@
1
- "use client";
2
-
3
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
4
- import { Check } from "lucide-react";
5
- import * as React from "react";
6
-
7
- import { cn } from "../../lib/utils";
8
-
9
- export interface CheckboxProps
10
- extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
11
- /**
12
- * Controlled checked state. Pass `'indeterminate'` to render the dash
13
- * glyph instead of the check.
14
- */
15
- checked?: boolean | "indeterminate";
16
- /**
17
- * Initial state for uncontrolled usage.
18
- * @default false
19
- */
20
- defaultChecked?: boolean | "indeterminate";
21
- /** Fires when the user toggles the checkbox. Use this instead of `onChange`. */
22
- onCheckedChange?: (checked: boolean | "indeterminate") => void;
23
- /**
24
- * Dims to 50% and blocks input.
25
- * @default false
26
- */
27
- disabled?: boolean;
28
- /**
29
- * Block native form submit unless the box is checked.
30
- * @default false
31
- */
32
- required?: boolean;
33
- /** Form field name for native form submission. */
34
- name?: string;
35
- /** Form field value when submitted. */
36
- value?: string;
37
- asChild?: boolean;
38
- className?: string;
39
- }
40
-
41
- /**
42
- * Wraps Radix's `Checkbox.Root`. The check glyph is rendered inside
43
- * automatically.
44
- */
45
- const Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(
46
- ({ className, ...props }, ref) => (
47
- <CheckboxPrimitive.Root
48
- ref={ref}
49
- className={cn(
50
- "grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
51
- className,
52
- )}
53
- {...props}
54
- >
55
- <CheckboxPrimitive.Indicator className={cn("grid place-content-center text-current")}>
56
- <Check className="h-4 w-4" />
57
- </CheckboxPrimitive.Indicator>
58
- </CheckboxPrimitive.Root>
59
- ),
60
- );
61
- Checkbox.displayName = CheckboxPrimitive.Root.displayName;
62
-
63
- export { Checkbox };