@scattered-light/loomiere-base-ui 0.0.0-stage → 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.
Files changed (46) hide show
  1. package/README.md +26 -2
  2. package/dist/index.d.ts +107 -0
  3. package/dist/index.js +315 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/styles/components/Accordion.css +120 -0
  6. package/dist/styles/components/AlertDialog.css +8 -0
  7. package/dist/styles/components/Autocomplete.css +201 -0
  8. package/dist/styles/components/Avatar.css +134 -0
  9. package/dist/styles/components/Button.css +129 -0
  10. package/dist/styles/components/Checkbox.css +156 -0
  11. package/dist/styles/components/CheckboxGroup.css +15 -0
  12. package/dist/styles/components/Collapsible.css +115 -0
  13. package/dist/styles/components/Combobox.css +484 -0
  14. package/dist/styles/components/ContextMenu.css +168 -0
  15. package/dist/styles/components/Dialog.css +145 -0
  16. package/dist/styles/components/Drawer.css +126 -0
  17. package/dist/styles/components/Field.css +60 -0
  18. package/dist/styles/components/Fieldset.css +41 -0
  19. package/dist/styles/components/Form.css +19 -0
  20. package/dist/styles/components/Input.css +136 -0
  21. package/dist/styles/components/Menu.css +148 -0
  22. package/dist/styles/components/Menubar.css +192 -0
  23. package/dist/styles/components/Meter.css +59 -0
  24. package/dist/styles/components/NavigationMenu.css +419 -0
  25. package/dist/styles/components/NumberField.css +90 -0
  26. package/dist/styles/components/OTPField.css +62 -0
  27. package/dist/styles/components/Popover.css +161 -0
  28. package/dist/styles/components/PreviewCard.css +116 -0
  29. package/dist/styles/components/Progress.css +76 -0
  30. package/dist/styles/components/Radio.css +151 -0
  31. package/dist/styles/components/ScrollArea.css +81 -0
  32. package/dist/styles/components/Select.css +273 -0
  33. package/dist/styles/components/Separator.css +27 -0
  34. package/dist/styles/components/Slider.css +165 -0
  35. package/dist/styles/components/Switch.css +165 -0
  36. package/dist/styles/components/Tabs.css +135 -0
  37. package/dist/styles/components/Toast.css +235 -0
  38. package/dist/styles/components/Toggle.css +109 -0
  39. package/dist/styles/components/ToggleGroup.css +20 -0
  40. package/dist/styles/components/Toolbar.css +61 -0
  41. package/dist/styles/components/Tooltip.css +59 -0
  42. package/dist/styles/index.css +52 -0
  43. package/dist/styles/reset/accessibility.css +65 -0
  44. package/dist/styles/reset/reset-accessibility.css +110 -0
  45. package/dist/styles/reset/reset.css +442 -0
  46. package/package.json +50 -4
@@ -0,0 +1,65 @@
1
+ /* @scattered-light/loomiere-base-ui 0.1.0 · styles for @base-ui/react 1.9.0 */
2
+ /* Focus, invalid, contrast — requires theme tokens (after theme-accessibility.css). */
3
+
4
+ :focus-visible {
5
+ outline: var(--sl-a11y-focus-outline-width) solid var(--sl-focus-ring);
6
+ outline-offset: var(--sl-a11y-focus-outline-offset);
7
+ border-radius: var(--sl-a11y-focus-ring-radius);
8
+ }
9
+
10
+ a:focus-visible {
11
+ outline: var(--sl-a11y-focus-outline-width) solid var(--sl-focus-ring);
12
+ outline-offset: var(--sl-a11y-link-focus-outline-offset);
13
+ border-radius: var(--sl-a11y-link-focus-ring-radius);
14
+ }
15
+
16
+ input:invalid,
17
+ textarea:invalid,
18
+ select:invalid {
19
+ border-color: var(--sl-status-error, #ef4444);
20
+ }
21
+
22
+ input:invalid:focus,
23
+ textarea:invalid:focus,
24
+ select:invalid:focus {
25
+ outline-color: var(--sl-status-error, #ef4444);
26
+ }
27
+
28
+ [required]::after,
29
+ [aria-required='true']::after {
30
+ content: ' *';
31
+ color: var(--sl-status-error, #ef4444);
32
+ }
33
+
34
+ @media (prefers-contrast: more) {
35
+ button,
36
+ a {
37
+ text-decoration: underline;
38
+ }
39
+ }
40
+
41
+ @media (forced-colors: active) {
42
+ :focus-visible {
43
+ outline: 2px solid CanvasText;
44
+ }
45
+
46
+ button,
47
+ a {
48
+ border: 1px solid ButtonText;
49
+ }
50
+ }
51
+
52
+ @media (pointer: coarse) {
53
+ button,
54
+ a,
55
+ input[type='button'],
56
+ input[type='submit'],
57
+ input[type='reset'],
58
+ input[type='checkbox'],
59
+ input[type='radio'],
60
+ select,
61
+ textarea {
62
+ min-height: var(--sl-a11y-min-touch-target);
63
+ min-width: var(--sl-a11y-min-touch-target);
64
+ }
65
+ }
@@ -0,0 +1,110 @@
1
+ /* @scattered-light/loomiere-base-ui 0.1.0 · styles for @base-ui/react 1.9.0 */
2
+ /* Accessibility — base rules (no theme color dependencies). Theme-specific focus/invalid: accessibility-theme.css */
3
+
4
+ /* Remove default focus; keyboard focus styled in accessibility-theme.css */
5
+ :focus {
6
+ outline: none;
7
+ }
8
+
9
+ button:focus,
10
+ input:focus,
11
+ textarea:focus,
12
+ select:focus {
13
+ outline: none;
14
+ }
15
+
16
+ :focus:not(:focus-visible) {
17
+ outline: none;
18
+ }
19
+
20
+ .sr-only,
21
+ .visually-hidden {
22
+ position: absolute;
23
+ width: 1px;
24
+ height: 1px;
25
+ padding: 0;
26
+ margin: -1px;
27
+ overflow: hidden;
28
+ clip: rect(0, 0, 0, 0);
29
+ white-space: nowrap;
30
+ border-width: 0;
31
+ }
32
+
33
+ .sr-only-focusable:focus,
34
+ .visually-hidden-focusable:focus {
35
+ position: static;
36
+ width: auto;
37
+ height: auto;
38
+ padding: inherit;
39
+ margin: inherit;
40
+ overflow: visible;
41
+ clip: auto;
42
+ white-space: normal;
43
+ }
44
+
45
+ main {
46
+ min-height: 100vh;
47
+ display: flex;
48
+ flex-direction: column;
49
+ }
50
+
51
+ main:focus {
52
+ outline: none;
53
+ }
54
+
55
+ /* Covers every component: transitions and animations finish at once, so
56
+ component styles don't repeat their own reduced-motion rules. */
57
+ @media (prefers-reduced-motion: reduce) {
58
+ *,
59
+ *::before,
60
+ *::after {
61
+ animation-duration: 0.01ms !important;
62
+ animation-iteration-count: 1 !important;
63
+ transition-duration: 0.01ms !important;
64
+ scroll-behavior: auto !important;
65
+ }
66
+ }
67
+
68
+ [aria-live='polite'],
69
+ [aria-live='assertive'] {
70
+ position: relative;
71
+ }
72
+
73
+ :disabled,
74
+ [aria-disabled='true'] {
75
+ cursor: not-allowed;
76
+ opacity: 0.6;
77
+ }
78
+
79
+ @media print {
80
+ a[href^='http']::after {
81
+ content: ' (' attr(href) ')';
82
+ font-size: 0.8em;
83
+ font-weight: normal;
84
+ }
85
+
86
+ a[href^='#']::after,
87
+ a[href^='/']::after {
88
+ content: '';
89
+ }
90
+
91
+ * {
92
+ background: white !important;
93
+ color: black !important;
94
+ box-shadow: none !important;
95
+ text-shadow: none !important;
96
+ }
97
+
98
+ a,
99
+ a:visited {
100
+ text-decoration: underline;
101
+ }
102
+
103
+ h1, h2, h3, h4, h5, h6 {
104
+ page-break-after: avoid;
105
+ }
106
+
107
+ img {
108
+ page-break-inside: avoid;
109
+ }
110
+ }
@@ -0,0 +1,442 @@
1
+ /* @scattered-light/loomiere-base-ui 0.1.0 · styles for @base-ui/react 1.9.0 */
2
+ /* CSS Reset - Mojave Theme */
3
+
4
+ /* ============================================
5
+ FONTS
6
+ ============================================ */
7
+ @import url('https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:wght@300;400;500;600;700&family=Funnel+Display:wght@300;400;500;600;700&family=Roboto+Mono:wght@300;400;500;600;700&display=swap');
8
+
9
+
10
+ /* ============================================
11
+ COLOR SCHEME HELPER
12
+ ============================================ */
13
+ :root {
14
+ /* Follows the theme in effect (data-theme or the system), so native scrollbars and pickers match. */
15
+ color-scheme: var(--sl-color-scheme);
16
+ }
17
+
18
+ /* ============================================
19
+ BOX SIZING
20
+ ============================================ */
21
+ *,
22
+ *::before,
23
+ *::after {
24
+ box-sizing: border-box;
25
+ }
26
+
27
+ /* ============================================
28
+ OVERRIDES FOR ALL
29
+ ============================================ */
30
+ * {
31
+ margin: 0;
32
+ padding: 0;
33
+ }
34
+
35
+ /* Respect user's motion preferences */
36
+ @media (prefers-reduced-motion: no-preference) {
37
+ html {
38
+ scroll-behavior: smooth; /* Smooth scrolling */
39
+ }
40
+
41
+ a {
42
+ transition: all 0.2s ease; /* Responsive typography adjustments */
43
+
44
+ }
45
+ }
46
+
47
+ /* ============================================
48
+ SCROLLBARS
49
+ ============================================ */
50
+ * {
51
+ scrollbar-width: thin;
52
+ scrollbar-color: var(--sl-content-scrollbar-thumb) var(--sl-content-scrollbar-track);
53
+ }
54
+
55
+ *::-webkit-scrollbar {
56
+ width: var(--sl-space-2);
57
+ height: var(--sl-space-2);
58
+ }
59
+
60
+ *::-webkit-scrollbar-track {
61
+ background: var(--sl-content-scrollbar-track);
62
+ }
63
+
64
+ *::-webkit-scrollbar-thumb {
65
+ background: var(--sl-content-scrollbar-thumb);
66
+ border-radius: 0.25rem;
67
+ }
68
+
69
+ *::-webkit-scrollbar-thumb:hover {
70
+ background: var(--sl-content-scrollbar-thumb-hover);
71
+ }
72
+
73
+ /* ============================================
74
+ HTML
75
+ ============================================ */
76
+ html {
77
+ -webkit-font-smoothing: antialiased;
78
+ -moz-osx-font-smoothing: grayscale;
79
+ text-rendering: optimizeLegibility;
80
+ font-size: 100%; /* Don't override user's browser font size */
81
+ -webkit-text-size-adjust: 100%; /* Prevent text size adjustment on orientation change */
82
+ }
83
+
84
+ /* ============================================
85
+ BODY
86
+ ============================================ */
87
+
88
+ body {
89
+ /* Layout */
90
+ min-height: 100vh;
91
+ background: var(--sl-content-page-background);
92
+ /*Basic text styling*/
93
+ font-family: var(--sl-font-family-body);
94
+ font-size: var(--sl-font-size-md);
95
+ font-weight: var(--sl-font-weight-normal);
96
+ line-height: var(--sl-line-height-md);
97
+ letter-spacing: var(--sl-letter-spacing-normal);
98
+ color: var(--sl-content-prose-color);
99
+ /* Improve text rendering for better readability */
100
+ text-rendering: optimizeLegibility;
101
+ -webkit-font-smoothing: antialiased;
102
+ -moz-osx-font-smoothing: grayscale;
103
+ font-feature-settings: 'kern' 1; /* Enable kerning */
104
+ }
105
+
106
+ /* ============================================
107
+ TYPOGRAPHY
108
+ ============================================ */
109
+ h1,
110
+ h2,
111
+ h3,
112
+ h4,
113
+ h5,
114
+ h6 {
115
+ font-family: var(--sl-font-family-display);
116
+ font-weight: var(--sl-font-weight-semibold);
117
+ font-size: var(--sl-font-size-md);
118
+ line-height: var(--sl-line-height-md);
119
+ letter-spacing: var(--sl-letter-spacing-normal);
120
+ overflow-wrap: break-word;
121
+ }
122
+
123
+ /* Paragraphs */
124
+ p {
125
+ overflow-wrap: break-word;
126
+ max-inline-size: var(--sl-measure-base);
127
+ text-wrap: pretty;
128
+ margin-block-end: var(--sl-space-4);
129
+ }
130
+
131
+ /* Links */
132
+ a {
133
+ color: var(--sl-content-link-color);
134
+ text-decoration: underline;
135
+ text-decoration-color: var(--sl-content-link-underline-color);
136
+ text-decoration-thickness: 0.125em;
137
+ transition: all 0.2s ease;
138
+
139
+ &:hover {
140
+ color: var(--sl-content-link-hover-color);
141
+ text-decoration-color: var(--sl-content-link-underline-hover-color);
142
+
143
+ }
144
+ }
145
+
146
+ /* Small text */
147
+ small {
148
+ font-size: var(--sl-font-size-sm);
149
+ line-height: var(--sl-line-height-sm);
150
+ }
151
+
152
+ /* Emphasis */
153
+ strong,
154
+ b {
155
+ font-weight: var(--sl-font-weight-bold);
156
+ }
157
+
158
+ em,
159
+ i {
160
+ font-style: italic;
161
+ }
162
+
163
+ /* Mark/Highlight */
164
+ mark {
165
+ background: var(--sl-content-mark-background);
166
+ color: inherit;
167
+ padding: var(--sl-space-0-5) var(--sl-space-1-5);
168
+ border-radius: var(--sl-radius-sm);
169
+ }
170
+
171
+ /* Abbreviations */
172
+ abbr[title] {
173
+ text-decoration: underline dotted;
174
+ text-decoration-color: var(--sl-color-neutral-500);
175
+ cursor: help;
176
+ }
177
+
178
+ /* Subscript and Superscript */
179
+ sub,
180
+ sup {
181
+ font-size: var(--sl-font-size-xs);
182
+ line-height: var(--sl-line-height-md);
183
+ position: relative;
184
+ vertical-align: baseline;
185
+ }
186
+
187
+ sup {
188
+ inset-block-start: -var(--sl-space-2);
189
+ }
190
+
191
+ sub {
192
+ inset-block-end: -var(--sl-space-1);
193
+ }
194
+
195
+ /* Lists */
196
+ ul,
197
+ ol {
198
+ list-style: none;
199
+ max-inline-size: var(--sl-measure-base);
200
+ padding-inline-start: var(--sl-space-6);
201
+ margin-block-end: var(--sl-space-4);
202
+ }
203
+
204
+ /* Better list semantics */
205
+ ul[role='list'],
206
+ ol[role='list'] {
207
+ list-style: none;
208
+ }
209
+
210
+ li {
211
+ margin-block-end: var(--sl-space-2);
212
+ }
213
+
214
+ li::marker {
215
+ color: var(--sl-content-list-marker-color);
216
+ }
217
+
218
+ /* Nested lists */
219
+ li > ul,
220
+ li > ol {
221
+ margin-block-start: var(--sl-space-2);
222
+ margin-block-end: 0;
223
+ }
224
+
225
+ /* Blockquotes */
226
+ blockquote {
227
+ max-inline-size: var(--sl-measure-base);
228
+ margin-block: var(--sl-space-6);
229
+ margin-inline-start: 0;
230
+ padding-inline-start: var(--sl-space-6);
231
+ border-inline-start: var(--sl-space-1) solid var(--sl-content-blockquote-border);
232
+ font-size: var(--sl-font-size-xl);
233
+ font-weight: var(--sl-font-weight-normal);
234
+ line-height: var(--sl-line-height-md);
235
+ letter-spacing: var(--sl-letter-spacing-normal);
236
+ font-style: italic;
237
+ color: inherit;
238
+ }
239
+
240
+ blockquote cite {
241
+ display: block;
242
+ margin-block-start: var(--sl-space-3);
243
+ font-size: var(--sl-font-size-sm);
244
+ font-style: normal;
245
+ color: var(--sl-content-blockquote-cite);
246
+ }
247
+
248
+ blockquote cite::before {
249
+ content: '— ';
250
+ }
251
+
252
+ /* Code */
253
+ code,
254
+ kbd,
255
+ samp,
256
+ pre {
257
+ font-family: var(--sl-font-family-mono);
258
+ font-size: var(--sl-font-size-sm);
259
+ }
260
+
261
+ code {
262
+ padding: 0.125em 0.375em;
263
+ background: var(--sl-content-code-background);
264
+ border: var(--sl-stroke-thin) solid var(--sl-content-code-border);
265
+ border-radius: var(--sl-radius-sm);
266
+ color: var(--sl-content-code-text);
267
+ }
268
+
269
+ pre {
270
+ max-inline-size: 100%;
271
+ padding: var(--sl-space-4);
272
+ background: var(--sl-content-pre-background);
273
+ border: var(--sl-stroke-thin) solid var(--sl-content-pre-border);
274
+ color: var(--sl-content-pre-text);
275
+ border-radius: var(--sl-space-2);
276
+ overflow-x: auto;
277
+ margin-block: var(--sl-space-6);
278
+ }
279
+
280
+ pre code {
281
+ padding: 0;
282
+ background: transparent;
283
+ border: none;
284
+ color: inherit;
285
+ }
286
+
287
+ /* ============================================
288
+ IMAGES AND MEDIA
289
+ ============================================ */
290
+ img,
291
+ picture,
292
+ video,
293
+ canvas,
294
+ svg {
295
+ display: block;
296
+ max-width: 100%;
297
+ }
298
+
299
+ /* ============================================
300
+ FORM ELEMENTS
301
+ ============================================ */
302
+ input,
303
+ button,
304
+ textarea,
305
+ select {
306
+ font: inherit;
307
+ color: inherit;
308
+ }
309
+
310
+ button {
311
+ background: transparent;
312
+ border: var(--sl-stroke-thin) solid transparent;
313
+ cursor: pointer;
314
+
315
+ /* Improve button accessibility */
316
+ &:disabled {
317
+ cursor: not-allowed;
318
+ opacity: 0.6;
319
+ }
320
+ }
321
+
322
+ /* Remove default appearance for form controls */
323
+ input[type='search']::-webkit-search-decoration,
324
+ input[type='search']::-webkit-search-cancel-button,
325
+ input[type='search']::-webkit-search-results-button,
326
+ input[type='search']::-webkit-search-results-decoration {
327
+ -webkit-appearance: none;
328
+ }
329
+
330
+ /* Remove spinner from number inputs */
331
+ input[type='number']::-webkit-inner-spin-button,
332
+ input[type='number']::-webkit-outer-spin-button {
333
+ -webkit-appearance: none;
334
+ margin: 0;
335
+ }
336
+
337
+ input[type='number'] {
338
+ -moz-appearance: textfield;
339
+ appearance: textfield;
340
+ }
341
+
342
+ /* Remove default fieldset styles */
343
+ fieldset {
344
+ border: var(--sl-stroke-thin) solid var(--sl-content-field-border);
345
+ border-radius: var(--sl-radius-sm);
346
+ }
347
+
348
+ /* ============================================
349
+ TABLES
350
+ ============================================ */
351
+ /* Improve table accessibility */
352
+ table {
353
+ border-collapse: collapse;
354
+ border-spacing: 0;
355
+ width: 100%;
356
+ }
357
+
358
+ th {
359
+ text-align: left;
360
+ font-weight: var(--sl-font-weight-semibold);
361
+ }
362
+
363
+ /* ============================================
364
+ OTHER ELEMENTS
365
+ ============================================ */
366
+
367
+ /* Remove default legend styles */
368
+ legend {
369
+ padding: 0;
370
+ }
371
+
372
+ /* Keyboard input */
373
+ kbd {
374
+ padding: var(--sl-space-0-5) var(--sl-space-2-5);
375
+ background: var(--sl-content-kbd-background);
376
+ color: var(--sl-content-kbd-text);
377
+ border-radius: var(--sl-radius-sm);
378
+ font-size: var(--sl-font-size-sm);
379
+ box-shadow: var(--sl-elevation-xs);
380
+ }
381
+
382
+ /* Horizontal rule */
383
+ hr {
384
+ border: none;
385
+ border-block-start: var(--sl-stroke-thin) solid var(--sl-content-hr-border);
386
+ margin-block: var(--sl-space-8);
387
+ }
388
+
389
+ /* Hidden attribute */
390
+ [hidden] {
391
+ display: none !important;
392
+ }
393
+
394
+ /* Disabled state */
395
+ [disabled] {
396
+ cursor: not-allowed;
397
+ }
398
+
399
+ /* Color When User Selects Text */
400
+ ::selection {
401
+ background: var(--sl-content-selection-background);
402
+ color: var(--sl-content-selection-text);
403
+ }
404
+
405
+ ::-moz-selection {
406
+ background: var(--sl-content-selection-background);
407
+ color: var(--sl-content-selection-text);
408
+ }
409
+
410
+ /* ============================================
411
+ PRINT STYLES
412
+ ============================================ */
413
+
414
+ @media print {
415
+ body {
416
+ font-size: 12pt;
417
+ line-height: 1.5;
418
+ color: #000;
419
+ }
420
+
421
+ h1 {
422
+ font-size: 24pt;
423
+ }
424
+
425
+ h2 {
426
+ font-size: 20pt;
427
+ }
428
+
429
+ h3 {
430
+ font-size: 16pt;
431
+ }
432
+
433
+ a {
434
+ color: #000;
435
+ text-decoration: underline;
436
+ }
437
+
438
+ a[href^='http']::after {
439
+ content: ' (' attr(href) ')';
440
+ font-size: 0.8em;
441
+ }
442
+ }
package/package.json CHANGED
@@ -1,6 +1,52 @@
1
1
  {
2
2
  "name": "@scattered-light/loomiere-base-ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Base UI components styled by any Loomiere theme. Brand-free: every value is a --sl- variable.",
5
+ "keywords": ["base-ui", "react", "components", "design-tokens", "loomiere"],
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/ScatteredLight/loomiere.git",
9
+ "directory": "packages/loomiere-base-ui"
10
+ },
11
+ "baseUi": {
12
+ "target": "1.9.0",
13
+ "$comment": "The @base-ui/react release these styles were written and checked against. npm run check:base-ui compares it with the installed version."
14
+ },
15
+ "type": "module",
16
+ "sideEffects": ["*.css"],
17
+ "main": "./dist/index.js",
18
+ "module": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js",
24
+ "default": "./dist/index.js"
25
+ },
26
+ "./styles.css": "./dist/styles/index.css",
27
+ "./styles/*": "./dist/styles/*",
28
+ "./package.json": "./package.json"
29
+ },
30
+ "files": ["dist"],
31
+ "scripts": {
32
+ "build": "npm run check:base-ui && tsup && node build/build-styles.mjs",
33
+ "check:base-ui": "node build/check-base-ui.mjs",
34
+ "prepack": "npm run build"
35
+ },
36
+ "publishConfig": {
37
+ "access": "public",
38
+ "provenance": false
39
+ },
40
+ "engines": {
41
+ "node": ">=20.19.0"
42
+ },
43
+ "peerDependencies": {
44
+ "@base-ui/react": "^1.9.0",
45
+ "@material-symbols/font-400": "^0.39.0 || ^0.44.0",
46
+ "react": "^18.0.0",
47
+ "react-dom": "^18.0.0"
48
+ },
49
+ "devDependencies": {
50
+ "@scattered-light/loomiere": "0.1.0"
51
+ }
52
+ }