@moldea.ai/website-ui 1.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 (37) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -0
  3. package/cover.png +0 -0
  4. package/dist/chunks/exceptions-BYCwx4kO.js +20 -0
  5. package/dist/chunks/exceptions-BYCwx4kO.js.map +1 -0
  6. package/dist/exceptions.d.ts +9 -0
  7. package/dist/exceptions.d.ts.map +1 -0
  8. package/dist/index.d.ts +8 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +5 -0
  11. package/dist/search/index.d.ts +22 -0
  12. package/dist/search/index.d.ts.map +1 -0
  13. package/dist/search.js +66 -0
  14. package/dist/search.js.map +1 -0
  15. package/dist/site/index.d.ts +41 -0
  16. package/dist/site/index.d.ts.map +1 -0
  17. package/dist/site.js +54 -0
  18. package/dist/site.js.map +1 -0
  19. package/dist/theme/index.d.ts +15 -0
  20. package/dist/theme/index.d.ts.map +1 -0
  21. package/dist/theme.js +18 -0
  22. package/dist/theme.js.map +1 -0
  23. package/package.json +118 -0
  24. package/src/components/action-button/action-button.component.astro +25 -0
  25. package/src/components/action-link/action-link.component.astro +18 -0
  26. package/src/components/brand-logo/brand-logo.component.astro +55 -0
  27. package/src/components/breadcrumbs/breadcrumbs.component.astro +52 -0
  28. package/src/components/inline-brand-text/inline-brand-text.component.astro +20 -0
  29. package/src/components/local-search/local-search.component.astro +188 -0
  30. package/src/components/theme-bootstrap/theme-bootstrap.component.astro +32 -0
  31. package/src/components/theme-control/theme-control.component.astro +126 -0
  32. package/src/exceptions.ts +21 -0
  33. package/src/search/index.ts +118 -0
  34. package/src/site/index.ts +74 -0
  35. package/src/styles.css +248 -0
  36. package/src/theme/index.ts +19 -0
  37. package/src/tokens.css +155 -0
package/src/styles.css ADDED
@@ -0,0 +1,248 @@
1
+ @import 'tailwindcss';
2
+ @import '@fontsource-variable/ubuntu-sans/wght.css';
3
+ @import './tokens.css';
4
+
5
+ @source './components/**/*.{astro,ts}';
6
+
7
+ @layer base {
8
+ * {
9
+ @apply border-border;
10
+ }
11
+
12
+ html {
13
+ @apply bg-background font-sans text-foreground antialiased;
14
+ color-scheme: light;
15
+ scroll-behavior: smooth;
16
+ }
17
+
18
+ html.dark {
19
+ color-scheme: dark;
20
+ }
21
+
22
+ body {
23
+ @apply min-w-80 bg-background text-foreground;
24
+ margin: 0;
25
+ overflow-wrap: break-word;
26
+ }
27
+
28
+ ::selection {
29
+ @apply bg-primary text-primary-foreground;
30
+ }
31
+
32
+ a,
33
+ button,
34
+ summary,
35
+ select,
36
+ input {
37
+ @apply outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background;
38
+ }
39
+
40
+ button:not(:disabled),
41
+ summary,
42
+ select {
43
+ cursor: pointer;
44
+ }
45
+ }
46
+
47
+ @layer components {
48
+ .page-shell {
49
+ width: min(100%, 82rem);
50
+ margin-inline: auto;
51
+ padding-inline: var(--spacing-page-gutter);
52
+ }
53
+
54
+ .docs-shell {
55
+ width: min(100%, 94rem);
56
+ margin-inline: auto;
57
+ padding-inline: var(--spacing-page-gutter);
58
+ }
59
+
60
+ .eyebrow {
61
+ @apply text-xs font-bold tracking-[0.16em] text-muted-foreground uppercase;
62
+ }
63
+
64
+ .display-title {
65
+ font-size: clamp(2.65rem, 9vw, 6.6rem);
66
+ line-height: 0.91;
67
+ letter-spacing: -0.065em;
68
+ }
69
+
70
+ .section-title {
71
+ font-size: clamp(2rem, 5vw, 4.25rem);
72
+ line-height: 0.98;
73
+ letter-spacing: -0.045em;
74
+ }
75
+
76
+ .surface-card {
77
+ @apply rounded-xl border border-border bg-card shadow-surface;
78
+ }
79
+
80
+ .interactive-card {
81
+ @apply transition duration-200 ease-out hover:-translate-y-0.5 hover:border-foreground/25 active:translate-y-px motion-reduce:transform-none motion-reduce:transition-none;
82
+ }
83
+
84
+ .action-control {
85
+ @apply inline-flex shrink-0 items-center justify-center rounded-lg border bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-transparent! focus-visible:shadow-none focus-visible:ring-2 focus-visible:ring-foreground focus-visible:ring-offset-2 focus-visible:ring-offset-background not-disabled:not-aria-disabled:active:not-aria-[haspopup]:translate-y-px disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 motion-reduce:transition-none dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4;
86
+ }
87
+
88
+ .action-primary {
89
+ @apply border-transparent bg-primary text-primary-foreground not-disabled:not-aria-disabled:hover:bg-primary/80 dark:not-disabled:not-aria-disabled:hover:bg-primary/30;
90
+ }
91
+
92
+ .action-outline {
93
+ @apply border-border bg-background text-foreground not-disabled:not-aria-disabled:hover:bg-secondary not-disabled:not-aria-disabled:hover:text-foreground aria-expanded:bg-secondary aria-expanded:text-foreground dark:bg-border/30 dark:not-disabled:not-aria-disabled:hover:bg-border/50;
94
+ }
95
+
96
+ .action-secondary {
97
+ @apply border-transparent bg-secondary text-foreground not-disabled:not-aria-disabled:hover:bg-secondary/70 aria-expanded:bg-secondary aria-expanded:text-foreground;
98
+ }
99
+
100
+ .action-ghost {
101
+ @apply border-transparent bg-transparent text-foreground not-disabled:not-aria-disabled:hover:bg-secondary not-disabled:not-aria-disabled:hover:text-foreground aria-expanded:bg-secondary aria-expanded:text-foreground dark:not-disabled:not-aria-disabled:hover:bg-secondary/50;
102
+ }
103
+
104
+ .action-link {
105
+ @apply border-transparent bg-transparent px-0! text-primary underline-offset-4 not-disabled:not-aria-disabled:hover:underline dark:text-primary-foreground dark:not-disabled:not-aria-disabled:hover:text-primary-foreground/80;
106
+ }
107
+
108
+ .action-size-sm {
109
+ @apply min-h-8 gap-1.5 px-3 py-1.5 text-sm;
110
+ }
111
+
112
+ .action-size-md {
113
+ @apply min-h-10 gap-2 px-4 py-2 text-sm;
114
+ }
115
+
116
+ .action-size-lg {
117
+ @apply min-h-12 gap-2 px-5 py-3;
118
+ }
119
+
120
+ .action-size-icon {
121
+ @apply size-10;
122
+ }
123
+
124
+ .prose-moldea {
125
+ @apply min-w-0 text-[1.05rem] leading-8 text-foreground;
126
+ }
127
+
128
+ .prose-moldea > :first-child {
129
+ margin-top: 0;
130
+ }
131
+
132
+ .prose-moldea :is(h2, h3, h4) {
133
+ @apply scroll-mt-24 font-heading font-semibold tracking-tight text-foreground;
134
+ }
135
+
136
+ .prose-moldea h2 {
137
+ @apply mt-14 mb-5 border-t pt-10 text-3xl;
138
+ }
139
+
140
+ .prose-moldea > h2:first-child {
141
+ @apply mt-0 border-t-0 pt-0;
142
+ }
143
+
144
+ .prose-moldea h3 {
145
+ @apply mt-10 mb-4 text-2xl;
146
+ }
147
+
148
+ .prose-moldea h4 {
149
+ @apply mt-8 mb-3 text-xl;
150
+ }
151
+
152
+ .prose-moldea :is(p, ul, ol, table, pre, blockquote) {
153
+ @apply my-5;
154
+ }
155
+
156
+ .prose-moldea :is(ul, ol) {
157
+ @apply space-y-2 ps-6;
158
+ }
159
+
160
+ .prose-moldea ul {
161
+ list-style: disc;
162
+ }
163
+
164
+ .prose-moldea ol {
165
+ list-style: decimal;
166
+ }
167
+
168
+ .prose-moldea a,
169
+ .text-link {
170
+ @apply font-medium text-link underline decoration-link/40 underline-offset-4 hover:decoration-current;
171
+ }
172
+
173
+ .prose-moldea code:not(pre code) {
174
+ @apply rounded-md bg-code px-1.5 py-1 font-mono text-[0.86em] font-semibold text-code-foreground;
175
+ }
176
+
177
+ .prose-moldea pre {
178
+ @apply max-w-full overflow-x-auto rounded-xl border bg-code p-5 text-sm leading-6 text-code-foreground shadow-inset;
179
+ }
180
+
181
+ .prose-moldea-wrap-code pre {
182
+ white-space: pre-wrap;
183
+ overflow-wrap: anywhere;
184
+ }
185
+
186
+ .prose-moldea .shiki,
187
+ .prose-moldea .shiki code {
188
+ background: transparent !important;
189
+ }
190
+
191
+ .prose-moldea .shiki span {
192
+ color: var(--shiki-light);
193
+ }
194
+
195
+ .dark .prose-moldea .shiki span {
196
+ color: var(--shiki-dark);
197
+ }
198
+
199
+ .prose-moldea blockquote {
200
+ @apply rounded-r-lg border-s-4 bg-accent px-5 py-1 text-accent-foreground;
201
+ }
202
+
203
+ .prose-moldea table {
204
+ @apply w-full border-collapse text-sm;
205
+ }
206
+
207
+ .prose-moldea th {
208
+ @apply bg-muted text-start font-semibold text-foreground;
209
+ }
210
+
211
+ .prose-moldea :is(th, td) {
212
+ @apply border px-3 py-2.5 align-top;
213
+ }
214
+
215
+ .table-scroll {
216
+ @apply my-5 max-w-full overflow-x-auto rounded-xl border focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background;
217
+ }
218
+ }
219
+
220
+ @media (prefers-color-scheme: dark) {
221
+ html:not(.light):not(.dark) {
222
+ color-scheme: dark;
223
+ }
224
+ }
225
+
226
+ @media (prefers-reduced-motion: reduce) {
227
+ ::view-transition-old(root),
228
+ ::view-transition-new(root) {
229
+ animation: none !important;
230
+ }
231
+
232
+ .action-control:not(:disabled):not([aria-disabled='true']):active:not([aria-haspopup]) {
233
+ translate: none;
234
+ }
235
+
236
+ .interactive-card:active {
237
+ translate: none;
238
+ }
239
+
240
+ *,
241
+ *::before,
242
+ *::after {
243
+ scroll-behavior: auto !important;
244
+ transition-duration: 0.01ms !important;
245
+ animation-duration: 0.01ms !important;
246
+ animation-iteration-count: 1 !important;
247
+ }
248
+ }
@@ -0,0 +1,19 @@
1
+ // persisted website theme choices
2
+ export type IThemePreference = 'dark' | 'light' | 'system';
3
+
4
+ /**
5
+ * Normalizes an unknown persisted preference to a supported theme choice.
6
+ * @param value Persisted storage value.
7
+ * @returns A supported explicit or system preference.
8
+ */
9
+ export const parseThemePreference = (value: unknown): IThemePreference =>
10
+ value === 'dark' || value === 'light' || value === 'system' ? value : 'system';
11
+
12
+ /**
13
+ * Resolves whether the effective theme should be dark.
14
+ * @param preference Explicit or system theme preference.
15
+ * @param doesSystemPreferDark Current operating-system preference.
16
+ * @returns Whether the effective website theme is dark.
17
+ */
18
+ export const isDarkTheme = (preference: IThemePreference, doesSystemPreferDark: boolean): boolean =>
19
+ preference === 'dark' || (preference === 'system' && doesSystemPreferDark);
package/src/tokens.css ADDED
@@ -0,0 +1,155 @@
1
+ @custom-variant dark (&:is(.dark *));
2
+
3
+ @theme inline {
4
+ --font-heading: var(--font-sans);
5
+ --font-sans: 'Ubuntu Sans Variable', sans-serif;
6
+ --font-mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
7
+
8
+ --color-background: var(--background);
9
+ --color-foreground: var(--foreground);
10
+ --color-card: var(--card);
11
+ --color-elevated: var(--elevated);
12
+ --color-primary: var(--primary);
13
+ --color-primary-foreground: var(--primary-foreground);
14
+ --color-secondary: var(--secondary);
15
+ --color-secondary-foreground: var(--secondary-foreground);
16
+ --color-muted: var(--muted);
17
+ --color-muted-foreground: var(--muted-foreground);
18
+ --color-accent: var(--accent);
19
+ --color-accent-foreground: var(--accent-foreground);
20
+ --color-border: var(--border);
21
+ --color-input: var(--input);
22
+ --color-ring: var(--ring);
23
+ --color-destructive: var(--destructive);
24
+ --color-warning: var(--warning);
25
+ --color-warning-foreground: var(--warning-foreground);
26
+ --color-success: var(--success);
27
+ --color-success-foreground: var(--success-foreground);
28
+ --color-info: var(--info);
29
+ --color-info-foreground: var(--info-foreground);
30
+ --color-sidebar: var(--sidebar);
31
+ --color-sidebar-foreground: var(--sidebar-foreground);
32
+ --color-link: var(--link);
33
+ --color-code: var(--code-background);
34
+ --color-code-foreground: var(--code-foreground);
35
+
36
+ --radius-sm: calc(var(--radius) * 0.6);
37
+ --radius-md: calc(var(--radius) * 0.8);
38
+ --radius-lg: var(--radius);
39
+ --radius-xl: calc(var(--radius) * 1.4);
40
+ --radius-2xl: calc(var(--radius) * 1.8);
41
+ --radius-3xl: calc(var(--radius) * 2.2);
42
+ --radius-4xl: calc(var(--radius) * 2.6);
43
+
44
+ --spacing-control-xs: 1.5rem;
45
+ --spacing-control-sm: 1.75rem;
46
+ --spacing-control-md: 2rem;
47
+ --spacing-control-lg: 2.25rem;
48
+ --spacing-page-gutter: clamp(1rem, 2vw, 2rem);
49
+ --spacing-section-gap: clamp(2rem, 5vw, 4rem);
50
+
51
+ --shadow-xs: var(--shadow-xs-value);
52
+ --shadow-sm: var(--shadow-sm-value);
53
+ --shadow-md: var(--shadow-md-value);
54
+ --shadow-lg: var(--shadow-lg-value);
55
+ --shadow-xl: var(--shadow-xl-value);
56
+ --shadow-raised: var(--shadow-raised-value);
57
+ --shadow-surface: var(--shadow-surface-value);
58
+ --shadow-inset: var(--shadow-inset-value);
59
+ }
60
+
61
+ :root {
62
+ --shadow-xs-value: 0 1px 2px oklch(0.18 0.018 215 / 8%);
63
+ --shadow-sm-value:
64
+ 0 1px 2px oklch(18.142% 0.01839 215.333 / 4%),
65
+ 0 8px 20px -14px oklch(18.142% 0.01839 215.333 / 10%);
66
+ --shadow-md-value:
67
+ 0 2px 4px oklch(18.142% 0.01839 215.333 / 5%),
68
+ 0 12px 28px -16px oklch(18.142% 0.01839 215.333 / 14%);
69
+ --shadow-lg-value:
70
+ 0 4px 8px oklch(18.142% 0.01839 215.333 / 6%),
71
+ 0 18px 40px -18px oklch(18.142% 0.01839 215.333 / 16%);
72
+ --shadow-xl-value:
73
+ 0 8px 16px oklch(18.142% 0.01839 215.333 / 7%),
74
+ 0 24px 56px -24px oklch(18.142% 0.01839 215.333 / 20%);
75
+ --shadow-surface-value: var(--shadow-sm-value);
76
+ --shadow-raised-value: var(--shadow-md-value);
77
+ --shadow-inset-value:
78
+ inset 0 1px 0 oklch(100% 0.00011 271.152 / 82%), 0 1px 2px oklch(18.142% 0.01839 215.333 / 6%);
79
+
80
+ --background: oklch(99.426% 0.00274 84.294);
81
+ --foreground: oklch(18.142% 0.01839 215.333);
82
+ --card: var(--background);
83
+ --elevated: oklch(100% 0.00011 271.152);
84
+ --primary: oklch(15.434% 0.00002 271.152);
85
+ --primary-foreground: oklch(99.048% 0.00493 166.268);
86
+ --secondary: oklch(96.563% 0.00641 197.995);
87
+ --secondary-foreground: oklch(48.046% 0.02817 216.324);
88
+ --muted: var(--secondary);
89
+ --muted-foreground: var(--secondary-foreground);
90
+ --accent: var(--secondary);
91
+ --accent-foreground: var(--foreground);
92
+ --destructive: oklch(58.042% 0.2304 27.044);
93
+ --border: oklch(89.894% 0.01222 210.227);
94
+ --input: var(--border);
95
+ --ring: var(--foreground);
96
+ --warning: oklch(77.997% 0.15037 75.683);
97
+ --warning-foreground: oklch(30% 0.075 65);
98
+ --success: var(--foreground);
99
+ --success-foreground: var(--background);
100
+ --info: oklch(55.927% 0.13086 255.341);
101
+ --info-foreground: oklch(99% 0.005 255);
102
+ --sidebar: oklch(97.8% 0.005 198);
103
+ --sidebar-foreground: var(--foreground);
104
+ --link: oklch(42% 0.12 255.341);
105
+ --code-background: oklch(95.1% 0.007 226);
106
+ --code-foreground: oklch(20% 0.026 232);
107
+ --syntax-comment: oklch(51% 0.024 220);
108
+ --syntax-keyword: oklch(47% 0.15 301);
109
+ --syntax-string: oklch(43% 0.1 154);
110
+ --syntax-function: oklch(42% 0.13 255);
111
+ --radius: 0.625rem;
112
+ }
113
+
114
+ .dark {
115
+ --shadow-xs-value: 0 0 oklch(0% 0 0 / 0%);
116
+ --shadow-sm-value: 0 0 oklch(0% 0 0 / 0%);
117
+ --shadow-md-value: 0 0 oklch(0% 0 0 / 0%);
118
+ --shadow-lg-value: 0 0 oklch(0% 0 0 / 0%);
119
+ --shadow-xl-value: 0 0 oklch(0% 0 0 / 0%);
120
+ --shadow-surface-value: var(--shadow-sm-value);
121
+ --shadow-raised-value: var(--shadow-md-value);
122
+ --shadow-inset-value: inset 0 0 oklch(0% 0 0 / 0%);
123
+
124
+ --background: oklch(27.837% 0.03355 257.693);
125
+ --foreground: oklch(97.024% 0.00684 124.958);
126
+ --card: var(--background);
127
+ --elevated: oklch(31.5% 0.034 258);
128
+ --primary: oklch(15.434% 0.00002 271.152);
129
+ --primary-foreground: oklch(99.048% 0.00493 166.268);
130
+ --secondary: oklch(37.306% 0.03436 260.191);
131
+ --secondary-foreground: oklch(83.038% 0.0135 209.117);
132
+ --muted: var(--secondary);
133
+ --muted-foreground: var(--secondary-foreground);
134
+ --accent: var(--secondary);
135
+ --accent-foreground: var(--foreground);
136
+ --destructive: oklch(70.008% 0.19081 23.736);
137
+ --border: oklch(100% 0.00011 271.152 / 25.9%);
138
+ --input: var(--border);
139
+ --ring: var(--foreground);
140
+ --warning: oklch(83.007% 0.1399 77.932);
141
+ --warning-foreground: oklch(25% 0.07 65);
142
+ --success: var(--foreground);
143
+ --success-foreground: var(--background);
144
+ --info: oklch(71.903% 0.11999 254.944);
145
+ --info-foreground: oklch(20% 0.05 255);
146
+ --sidebar: oklch(25.3% 0.031 258);
147
+ --sidebar-foreground: var(--foreground);
148
+ --link: oklch(78% 0.1 244);
149
+ --code-background: oklch(23.8% 0.027 258);
150
+ --code-foreground: oklch(94% 0.01 215);
151
+ --syntax-comment: oklch(72% 0.025 220);
152
+ --syntax-keyword: oklch(78% 0.12 310);
153
+ --syntax-string: oklch(80% 0.11 150);
154
+ --syntax-function: oklch(78% 0.1 250);
155
+ }