@realmorg/ui 0.0.0-stage → 2.0.0-alpha.3

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 (66) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +44 -2
  3. package/components/accordion.html +139 -0
  4. package/components/alert-dialog.html +236 -0
  5. package/components/alert.html +83 -0
  6. package/components/aspect-ratio.html +29 -0
  7. package/components/attachment.html +98 -0
  8. package/components/avatar.html +149 -0
  9. package/components/badge.html +62 -0
  10. package/components/breadcrumb.html +159 -0
  11. package/components/bubble.html +77 -0
  12. package/components/button-group.html +98 -0
  13. package/components/button.html +194 -0
  14. package/components/calendar.html +176 -0
  15. package/components/card.html +143 -0
  16. package/components/carousel.html +208 -0
  17. package/components/chart.html +168 -0
  18. package/components/checkbox.html +99 -0
  19. package/components/code-block.html +64 -0
  20. package/components/collapsible.html +90 -0
  21. package/components/combobox.html +237 -0
  22. package/components/command.html +201 -0
  23. package/components/context-menu.html +81 -0
  24. package/components/dialog.html +327 -0
  25. package/components/direction.html +23 -0
  26. package/components/drawer.html +267 -0
  27. package/components/dropdown-menu.html +421 -0
  28. package/components/empty.html +132 -0
  29. package/components/field.html +143 -0
  30. package/components/hover-card.html +111 -0
  31. package/components/input-group.html +91 -0
  32. package/components/input-otp.html +151 -0
  33. package/components/input.html +94 -0
  34. package/components/item.html +208 -0
  35. package/components/kbd.html +45 -0
  36. package/components/label.html +46 -0
  37. package/components/marker.html +41 -0
  38. package/components/menubar.html +137 -0
  39. package/components/message-scroller.html +68 -0
  40. package/components/message.html +95 -0
  41. package/components/navigation-menu.html +233 -0
  42. package/components/pagination.html +160 -0
  43. package/components/popover.html +164 -0
  44. package/components/progress.html +45 -0
  45. package/components/radio-group.html +120 -0
  46. package/components/resizable.html +170 -0
  47. package/components/scroll-area.html +56 -0
  48. package/components/select.html +103 -0
  49. package/components/separator.html +31 -0
  50. package/components/sheet.html +173 -0
  51. package/components/sidebar.html +393 -0
  52. package/components/skeleton.html +36 -0
  53. package/components/slider.html +108 -0
  54. package/components/spinner.html +53 -0
  55. package/components/switch.html +95 -0
  56. package/components/table.html +81 -0
  57. package/components/tabs.html +182 -0
  58. package/components/textarea.html +80 -0
  59. package/components/toaster.html +134 -0
  60. package/components/toggle-group.html +71 -0
  61. package/components/toggle.html +87 -0
  62. package/components/tooltip.html +114 -0
  63. package/dist/theme.css +158 -0
  64. package/dist/ui.html +7923 -0
  65. package/package.json +40 -3
  66. package/theme.css +158 -0
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "name": "@realmorg/ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "2.0.0-alpha.3",
4
+ "description": "About 60 accessible UI components built with REALM.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/realmorg/realm.git",
10
+ "directory": "packages/ui"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "components",
15
+ "theme.css"
16
+ ],
17
+ "exports": {
18
+ "./ui.html": "./dist/ui.html",
19
+ "./theme.css": "./theme.css",
20
+ "./components/*": "./components/*"
21
+ },
22
+ "devDependencies": {
23
+ "@vitest/browser-playwright": "5.0.5",
24
+ "playwright": "1.64.1",
25
+ "vite": "8.3.4",
26
+ "vitest": "5.0.5",
27
+ "@realmorg/realm": "2.0.0-alpha.3",
28
+ "tsconfig": "0.0.0"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "peerDependencies": {
34
+ "@realmorg/realm": "^2.0.0-alpha.3"
35
+ },
36
+ "scripts": {
37
+ "build": "node scripts/bundle.mjs",
38
+ "test": "vitest run",
39
+ "test:cross": "vitest run --project cross",
40
+ "typecheck": "tsc --noEmit",
41
+ "coverage": "rm -rf coverage-components && vitest run --project chromium && node ../../scripts/component-coverage.mjs coverage-components"
42
+ }
6
43
  }
package/theme.css ADDED
@@ -0,0 +1,158 @@
1
+ :root {
2
+ color-scheme: light;
3
+ --radius: 0.625rem;
4
+ --spacing: 0.25rem;
5
+ --text-xs: 0.75rem;
6
+ --text-sm: 0.875rem;
7
+ --text-base: 1rem;
8
+ --text-lg: 1.125rem;
9
+ --text-xl: 1.25rem;
10
+ --text-2xl: 1.5rem;
11
+ --text-3xl: 1.875rem;
12
+ --text-4xl: 2.25rem;
13
+ --leading-tight: 1.25;
14
+ --leading-normal: 1.5;
15
+ --font-weight-normal: 400;
16
+ --font-weight-medium: 500;
17
+ --font-weight-semibold: 600;
18
+ --font-weight-bold: 700;
19
+ --tracking-tight: -0.025em;
20
+ --radius-xs: calc(var(--radius) - 6px);
21
+ --radius-sm: calc(var(--radius) - 4px);
22
+ --radius-md: calc(var(--radius) - 2px);
23
+ --radius-lg: var(--radius);
24
+ --radius-xl: calc(var(--radius) + 4px);
25
+ --radius-2xl: calc(var(--radius) + 8px);
26
+ --radius-full: 9999px;
27
+ --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
28
+ --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
29
+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
30
+ --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
31
+ --default-transition-duration: 150ms;
32
+ --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
33
+ --focus-ring: 0 0 0 2px var(--ring);
34
+ --background: oklch(1 0 0);
35
+ --foreground: oklch(0.145 0 0);
36
+ --card: oklch(1 0 0);
37
+ --card-foreground: oklch(0.145 0 0);
38
+ --popover: oklch(1 0 0);
39
+ --popover-foreground: oklch(0.145 0 0);
40
+ --primary: oklch(0.56 0.21 347);
41
+ --primary-foreground: oklch(0.985 0 0);
42
+ --secondary: oklch(0.97 0 0);
43
+ --secondary-foreground: oklch(0.205 0 0);
44
+ --muted: oklch(0.97 0 0);
45
+ --muted-foreground: oklch(0.5 0 0);
46
+ --accent: oklch(0.97 0 0);
47
+ --accent-foreground: oklch(0.205 0 0);
48
+ --destructive: oklch(0.54 0.22 27);
49
+ --destructive-foreground: oklch(0.985 0 0);
50
+ --border: oklch(0.89 0 0);
51
+ --input: oklch(0.62 0 0);
52
+ --ring: oklch(0.6 0.2 347);
53
+ --chart-1: oklch(0.56 0.21 347);
54
+ --chart-2: oklch(0.58 0.17 5);
55
+ --chart-3: oklch(0.455 0.13 333);
56
+ --chart-4: oklch(0.43 0.17 260);
57
+ --chart-5: oklch(0.55 0.1 226);
58
+ --sidebar: oklch(0.985 0 0);
59
+ --sidebar-foreground: oklch(0.145 0 0);
60
+ --sidebar-primary: oklch(0.56 0.21 347);
61
+ --sidebar-primary-foreground: oklch(0.985 0 0);
62
+ --sidebar-ring: oklch(0.6 0.2 347);
63
+ --sidebar-accent: oklch(0.97 0 0);
64
+ --sidebar-border: oklch(0.89 0 0);
65
+ --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
66
+ --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
67
+ }
68
+
69
+ :root[data-theme="dark"] {
70
+ color-scheme: dark;
71
+ --background: oklch(0.145 0 0);
72
+ --foreground: oklch(0.985 0 0);
73
+ --card: oklch(0.205 0 0);
74
+ --card-foreground: oklch(0.985 0 0);
75
+ --popover: oklch(0.205 0 0);
76
+ --popover-foreground: oklch(0.985 0 0);
77
+ --primary: oklch(0.7 0.19 347);
78
+ --primary-foreground: oklch(0.145 0 0);
79
+ --secondary: oklch(0.269 0 0);
80
+ --secondary-foreground: oklch(0.985 0 0);
81
+ --muted: oklch(0.269 0 0);
82
+ --muted-foreground: oklch(0.708 0 0);
83
+ --accent: oklch(0.269 0 0);
84
+ --accent-foreground: oklch(0.985 0 0);
85
+ --destructive: oklch(0.704 0.191 22.216);
86
+ --destructive-foreground: oklch(0.145 0 0);
87
+ --border: oklch(1 0 0 / 10%);
88
+ --input: oklch(1 0 0 / 40%);
89
+ --ring: oklch(0.6 0.2 347);
90
+ --chart-1: oklch(0.7 0.19 347);
91
+ --chart-2: oklch(0.7 0.17 10);
92
+ --chart-3: oklch(0.6 0.15 320);
93
+ --chart-4: oklch(0.6 0.17 260);
94
+ --chart-5: oklch(0.75 0.11 226);
95
+ --sidebar: oklch(0.205 0 0);
96
+ --sidebar-foreground: oklch(0.985 0 0);
97
+ --sidebar-primary: oklch(0.7 0.19 347);
98
+ --sidebar-primary-foreground: oklch(0.145 0 0);
99
+ --sidebar-ring: oklch(0.6 0.2 347);
100
+ --sidebar-accent: oklch(0.269 0 0);
101
+ --sidebar-border: oklch(1 0 0 / 10%);
102
+ }
103
+
104
+ @media (prefers-color-scheme: dark) {
105
+ :root:not([data-theme="light"]) {
106
+ color-scheme: dark;
107
+ --background: oklch(0.145 0 0);
108
+ --foreground: oklch(0.985 0 0);
109
+ --card: oklch(0.205 0 0);
110
+ --card-foreground: oklch(0.985 0 0);
111
+ --popover: oklch(0.205 0 0);
112
+ --popover-foreground: oklch(0.985 0 0);
113
+ --primary: oklch(0.7 0.19 347);
114
+ --primary-foreground: oklch(0.145 0 0);
115
+ --secondary: oklch(0.269 0 0);
116
+ --secondary-foreground: oklch(0.985 0 0);
117
+ --muted: oklch(0.269 0 0);
118
+ --muted-foreground: oklch(0.708 0 0);
119
+ --accent: oklch(0.269 0 0);
120
+ --accent-foreground: oklch(0.985 0 0);
121
+ --destructive: oklch(0.704 0.191 22.216);
122
+ --destructive-foreground: oklch(0.145 0 0);
123
+ --border: oklch(1 0 0 / 10%);
124
+ --input: oklch(1 0 0 / 40%);
125
+ --ring: oklch(0.6 0.2 347);
126
+ --chart-1: oklch(0.7 0.19 347);
127
+ --chart-2: oklch(0.7 0.17 10);
128
+ --chart-3: oklch(0.6 0.15 320);
129
+ --chart-4: oklch(0.6 0.17 260);
130
+ --chart-5: oklch(0.75 0.11 226);
131
+ --sidebar: oklch(0.205 0 0);
132
+ --sidebar-foreground: oklch(0.985 0 0);
133
+ --sidebar-primary: oklch(0.7 0.19 347);
134
+ --sidebar-primary-foreground: oklch(0.145 0 0);
135
+ --sidebar-ring: oklch(0.6 0.2 347);
136
+ --sidebar-accent: oklch(0.269 0 0);
137
+ --sidebar-border: oklch(1 0 0 / 10%);
138
+ }
139
+ }
140
+
141
+ /* Taps respond at once and a double tap does not zoom. Pinch zoom still works. */
142
+ html {
143
+ touch-action: manipulation;
144
+ }
145
+
146
+ /* iOS Safari only sends clicks for taps on clickable elements, so tapping outside an open popover
147
+ or menu would not close it. Touch screens show no cursor, so this changes nothing visible. */
148
+ @media (pointer: coarse) {
149
+ html {
150
+ cursor: pointer;
151
+ }
152
+ }
153
+
154
+ body {
155
+ background: var(--background);
156
+ color: var(--foreground);
157
+ font-family: var(--font-sans);
158
+ }