@trypattern/sdk 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 (247) hide show
  1. package/README.md +127 -2
  2. package/dist/access.d.ts +31 -0
  3. package/dist/access.js +72 -0
  4. package/dist/actions.d.ts +57 -0
  5. package/dist/actions.js +198 -0
  6. package/dist/api.d.ts +20 -0
  7. package/dist/api.js +34 -0
  8. package/dist/app.d.ts +106 -0
  9. package/dist/app.js +224 -0
  10. package/dist/appearance.d.ts +7 -0
  11. package/dist/appearance.js +2 -0
  12. package/dist/auth/sessionApi.d.ts +41 -0
  13. package/dist/auth/sessionApi.js +158 -0
  14. package/dist/auth/sessionStore.d.ts +20 -0
  15. package/dist/auth/sessionStore.js +40 -0
  16. package/dist/auth/user.d.ts +11 -0
  17. package/dist/auth/user.js +9 -0
  18. package/dist/builtins/Account.d.ts +25 -0
  19. package/dist/builtins/Account.js +15 -0
  20. package/dist/builtins/Palette.d.ts +29 -0
  21. package/dist/builtins/Palette.js +63 -0
  22. package/dist/builtins/SignIn.d.ts +28 -0
  23. package/dist/builtins/SignIn.js +60 -0
  24. package/dist/builtins/Toasts.d.ts +32 -0
  25. package/dist/builtins/Toasts.js +24 -0
  26. package/dist/builtins/actions.d.ts +2 -0
  27. package/dist/builtins/actions.js +45 -0
  28. package/dist/cache.d.ts +24 -0
  29. package/dist/cache.js +112 -0
  30. package/dist/cli/app.d.ts +2 -0
  31. package/dist/cli/app.js +1329 -0
  32. package/dist/cli/screenshot.d.ts +1 -0
  33. package/dist/cli/screenshot.js +96 -0
  34. package/dist/cli/tools.d.ts +12 -0
  35. package/dist/cli/tools.js +35 -0
  36. package/dist/components/AppFrame.d.ts +14 -0
  37. package/dist/components/AppFrame.js +64 -0
  38. package/dist/components/AppearancePicker.d.ts +1 -0
  39. package/dist/components/AppearancePicker.js +12 -0
  40. package/dist/components/Avatar.d.ts +9 -0
  41. package/dist/components/Avatar.js +63 -0
  42. package/dist/components/Badge.d.ts +11 -0
  43. package/dist/components/Badge.js +87 -0
  44. package/dist/components/Button.d.ts +23 -0
  45. package/dist/components/Button.js +249 -0
  46. package/dist/components/Card.d.ts +12 -0
  47. package/dist/components/Card.js +38 -0
  48. package/dist/components/CommandMenu.d.ts +23 -0
  49. package/dist/components/CommandMenu.js +214 -0
  50. package/dist/components/CommandPalette.d.ts +1 -0
  51. package/dist/components/CommandPalette.js +7 -0
  52. package/dist/components/Content.d.ts +7 -0
  53. package/dist/components/Content.js +24 -0
  54. package/dist/components/ContextMenu.d.ts +8 -0
  55. package/dist/components/ContextMenu.js +23 -0
  56. package/dist/components/Dialog.d.ts +11 -0
  57. package/dist/components/Dialog.js +81 -0
  58. package/dist/components/Divider.d.ts +6 -0
  59. package/dist/components/Divider.js +15 -0
  60. package/dist/components/EmptyState.d.ts +8 -0
  61. package/dist/components/EmptyState.js +24 -0
  62. package/dist/components/Form.d.ts +9 -0
  63. package/dist/components/Form.js +23 -0
  64. package/dist/components/Icon.d.ts +10 -0
  65. package/dist/components/Icon.js +22 -0
  66. package/dist/components/IconButton.d.ts +14 -0
  67. package/dist/components/IconButton.js +53 -0
  68. package/dist/components/Kbd.d.ts +6 -0
  69. package/dist/components/Kbd.js +67 -0
  70. package/dist/components/Link.d.ts +9 -0
  71. package/dist/components/Link.js +35 -0
  72. package/dist/components/ListRow.d.ts +12 -0
  73. package/dist/components/ListRow.js +62 -0
  74. package/dist/components/LoadingRows.d.ts +5 -0
  75. package/dist/components/LoadingRows.js +6 -0
  76. package/dist/components/Menu.d.ts +12 -0
  77. package/dist/components/Menu.js +33 -0
  78. package/dist/components/MenuItems.d.ts +21 -0
  79. package/dist/components/MenuItems.js +32 -0
  80. package/dist/components/Placement.d.ts +21 -0
  81. package/dist/components/Placement.js +1 -0
  82. package/dist/components/Popup.d.ts +8 -0
  83. package/dist/components/Popup.js +43 -0
  84. package/dist/components/PopupItem.d.ts +8 -0
  85. package/dist/components/PopupItem.js +51 -0
  86. package/dist/components/PropertyRow.d.ts +7 -0
  87. package/dist/components/PropertyRow.js +23 -0
  88. package/dist/components/Row.d.ts +16 -0
  89. package/dist/components/Row.js +27 -0
  90. package/dist/components/Screen.d.ts +13 -0
  91. package/dist/components/Screen.js +56 -0
  92. package/dist/components/Scrim.d.ts +8 -0
  93. package/dist/components/Scrim.js +40 -0
  94. package/dist/components/ScrollArea.d.ts +15 -0
  95. package/dist/components/ScrollArea.js +13 -0
  96. package/dist/components/SegmentedControl.d.ts +17 -0
  97. package/dist/components/SegmentedControl.js +68 -0
  98. package/dist/components/Select.d.ts +17 -0
  99. package/dist/components/Select.js +107 -0
  100. package/dist/components/SettingsRow.d.ts +8 -0
  101. package/dist/components/SettingsRow.js +32 -0
  102. package/dist/components/Sidebar.d.ts +20 -0
  103. package/dist/components/Sidebar.js +138 -0
  104. package/dist/components/SignInScreen.d.ts +1 -0
  105. package/dist/components/SignInScreen.js +40 -0
  106. package/dist/components/Size.d.ts +1 -0
  107. package/dist/components/Size.js +1 -0
  108. package/dist/components/Skeleton.d.ts +8 -0
  109. package/dist/components/Skeleton.js +48 -0
  110. package/dist/components/Spinner.d.ts +6 -0
  111. package/dist/components/Spinner.js +54 -0
  112. package/dist/components/Stack.d.ts +14 -0
  113. package/dist/components/Stack.js +19 -0
  114. package/dist/components/Switch.d.ts +10 -0
  115. package/dist/components/Switch.js +71 -0
  116. package/dist/components/Text.d.ts +21 -0
  117. package/dist/components/Text.js +77 -0
  118. package/dist/components/TextField.d.ts +25 -0
  119. package/dist/components/TextField.js +68 -0
  120. package/dist/components/Toaster.d.ts +1 -0
  121. package/dist/components/Toaster.js +83 -0
  122. package/dist/components/Tooltip.d.ts +8 -0
  123. package/dist/components/Tooltip.js +43 -0
  124. package/dist/components/controlLook.d.ts +60 -0
  125. package/dist/components/controlLook.js +67 -0
  126. package/dist/components/frame.d.ts +4 -0
  127. package/dist/components/frame.js +2 -0
  128. package/dist/components/icons.d.ts +58 -0
  129. package/dist/components/icons.js +105 -0
  130. package/dist/components/interaction.d.ts +12 -0
  131. package/dist/components/interaction.js +22 -0
  132. package/dist/components/spacing.d.ts +118 -0
  133. package/dist/components/spacing.js +46 -0
  134. package/dist/components/tones.d.ts +28 -0
  135. package/dist/components/tones.js +12 -0
  136. package/dist/entityStore.d.ts +46 -0
  137. package/dist/entityStore.js +160 -0
  138. package/dist/flows/accessFlows.d.ts +9 -0
  139. package/dist/flows/accessFlows.js +151 -0
  140. package/dist/flows/browser.d.ts +32 -0
  141. package/dist/flows/browser.js +164 -0
  142. package/dist/flows/contactSheet.d.ts +1 -0
  143. package/dist/flows/contactSheet.js +63 -0
  144. package/dist/flows/flowBrowser.d.ts +23 -0
  145. package/dist/flows/flowBrowser.js +21 -0
  146. package/dist/flows/flowSetup.d.ts +3 -0
  147. package/dist/flows/flowSetup.js +35 -0
  148. package/dist/flows/flows.d.ts +41 -0
  149. package/dist/flows/flows.js +148 -0
  150. package/dist/flows/screenshotName.d.ts +1 -0
  151. package/dist/flows/screenshotName.js +6 -0
  152. package/dist/gate.d.ts +8 -0
  153. package/dist/gate.js +52 -0
  154. package/dist/hooks/appContext.d.ts +14 -0
  155. package/dist/hooks/appContext.js +5 -0
  156. package/dist/hooks/appHooks.d.ts +21 -0
  157. package/dist/hooks/appHooks.js +24 -0
  158. package/dist/hooks/useAnimatesOnChange.d.ts +1 -0
  159. package/dist/hooks/useAnimatesOnChange.js +14 -0
  160. package/dist/hooks/useStoreState.d.ts +6 -0
  161. package/dist/hooks/useStoreState.js +5 -0
  162. package/dist/index.d.ts +40 -0
  163. package/dist/index.js +19 -0
  164. package/dist/memoryApi.d.ts +19 -0
  165. package/dist/memoryApi.js +42 -0
  166. package/dist/model.d.ts +94 -0
  167. package/dist/model.js +243 -0
  168. package/dist/page.d.ts +11 -0
  169. package/dist/page.js +9 -0
  170. package/dist/platform.d.ts +1 -0
  171. package/dist/platform.js +5 -0
  172. package/dist/react.d.ts +46 -0
  173. package/dist/react.js +38 -0
  174. package/dist/registered.d.ts +54 -0
  175. package/dist/registered.js +17 -0
  176. package/dist/routes.d.ts +38 -0
  177. package/dist/routes.js +21 -0
  178. package/dist/rules/checkAllFiles.d.ts +1 -0
  179. package/dist/rules/checkAllFiles.js +741 -0
  180. package/dist/rules/checkApiRouting.d.ts +1 -0
  181. package/dist/rules/checkApiRouting.js +112 -0
  182. package/dist/rules/lintPlugin.d.ts +252 -0
  183. package/dist/rules/lintPlugin.js +1157 -0
  184. package/dist/rules/messages.d.ts +48 -0
  185. package/dist/rules/messages.js +48 -0
  186. package/dist/rules/themeTokens.d.ts +6 -0
  187. package/dist/rules/themeTokens.js +64 -0
  188. package/dist/schema.d.ts +2 -0
  189. package/dist/schema.js +1 -0
  190. package/dist/server/auth.d.ts +115 -0
  191. package/dist/server/auth.js +131 -0
  192. package/dist/server/authService.d.ts +9 -0
  193. package/dist/server/authService.js +50 -0
  194. package/dist/server/createServer.d.ts +357 -0
  195. package/dist/server/createServer.js +62 -0
  196. package/dist/server/env.d.ts +15 -0
  197. package/dist/server/env.js +1 -0
  198. package/dist/server/index.d.ts +8 -0
  199. package/dist/server/index.js +5 -0
  200. package/dist/server/session.d.ts +28 -0
  201. package/dist/server/session.js +54 -0
  202. package/dist/server/sessions.d.ts +92 -0
  203. package/dist/server/sessions.js +47 -0
  204. package/dist/server/signInWire.d.ts +52 -0
  205. package/dist/server/signInWire.js +22 -0
  206. package/dist/server/tables.d.ts +242 -0
  207. package/dist/server/tables.js +246 -0
  208. package/dist/server/users.d.ts +189 -0
  209. package/dist/server/users.js +49 -0
  210. package/dist/shortcuts.d.ts +3 -0
  211. package/dist/shortcuts.js +40 -0
  212. package/dist/start.d.ts +20 -0
  213. package/dist/start.js +121 -0
  214. package/dist/state.d.ts +14 -0
  215. package/dist/state.js +17 -0
  216. package/dist/store.d.ts +43 -0
  217. package/dist/store.js +198 -0
  218. package/dist/subscribers.d.ts +5 -0
  219. package/dist/subscribers.js +13 -0
  220. package/dist/table.d.ts +143 -0
  221. package/dist/table.js +91 -0
  222. package/dist/tables.d.ts +77 -0
  223. package/dist/tables.js +216 -0
  224. package/dist/theme/reset.css +84 -0
  225. package/dist/theme/scales.d.ts +76 -0
  226. package/dist/theme/scales.js +82 -0
  227. package/dist/theme/tokens.stylex.d.ts +218 -0
  228. package/dist/theme/tokens.stylex.js +233 -0
  229. package/dist/vite/commandBridge.d.ts +2 -0
  230. package/dist/vite/commandBridge.js +46 -0
  231. package/dist/vite/designManifest.d.ts +25 -0
  232. package/dist/vite/designManifest.js +191 -0
  233. package/dist/vite/localWorker.d.ts +4 -0
  234. package/dist/vite/localWorker.js +59 -0
  235. package/dist/vite/rootAlias.d.ts +2 -0
  236. package/dist/vite/rootAlias.js +15 -0
  237. package/dist/vite/vite.d.ts +7 -0
  238. package/dist/vite/vite.js +88 -0
  239. package/dist/wire.d.ts +7 -0
  240. package/dist/wire.js +1 -0
  241. package/package.json +99 -3
  242. package/presets/lintPlugin.js +7 -0
  243. package/presets/oxlint.json +167 -0
  244. package/presets/register.d.ts +19 -0
  245. package/presets/server.d.ts +2 -0
  246. package/presets/tsconfig.app.json +29 -0
  247. package/presets/tsconfig.server.json +27 -0
package/dist/tables.js ADDED
@@ -0,0 +1,216 @@
1
+ import { z } from 'zod';
2
+ import { canSee, changeRefusal, clashesWith, createRefusal, listRefusal, refusalOutcome, publicRow, readScope } from "./access.js";
3
+ import { EntityStore, WriteRefused, entityCalls } from "./entityStore.js";
4
+ import { MemoryServer } from "./memoryApi.js";
5
+ import { StoreBase } from "./store.js";
6
+ import { seededRows } from "./table.js";
7
+ const STATUS_OUTCOMES = { 401: 'forbidden', 403: 'forbidden', 404: 'missing', 409: 'conflict' };
8
+ export class HttpTableApi {
9
+ #table;
10
+ #gate;
11
+ #url;
12
+ #onSignedOut;
13
+ constructor(table, gate, onSignedOut, base = '/api/tables') {
14
+ this.#table = table;
15
+ this.#gate = gate;
16
+ this.#onSignedOut = onSignedOut;
17
+ this.#url = `${base}/${table.name}`;
18
+ }
19
+ list() {
20
+ return this.#call('list', 'GET', '', undefined, z.array(this.#table.row));
21
+ }
22
+ listPublic() {
23
+ return this.#call('listPublic', 'GET', '/public', undefined, z.array(this.#table.publicRow));
24
+ }
25
+ create(row) {
26
+ return this.#call('create', 'POST', '', row, this.#table.row);
27
+ }
28
+ update(row) {
29
+ return this.#call('update', 'PUT', `/${row.id}`, row, this.#table.row);
30
+ }
31
+ async remove(id) {
32
+ await this.#call('remove', 'DELETE', `/${id}`, undefined, z.unknown());
33
+ }
34
+ #call(call, method, path, body, reply) {
35
+ const name = `${this.#table.name}.${call}`;
36
+ return this.#gate.pass(name, async () => {
37
+ const response = await fetch(`${this.#url}${path}`, {
38
+ method,
39
+ headers: { 'content-type': 'application/json' },
40
+ ...(body === undefined ? {} : { body: JSON.stringify(body) })
41
+ });
42
+ if (response.status === 401)
43
+ this.#onSignedOut();
44
+ const refused = STATUS_OUTCOMES[response.status];
45
+ if (refused !== undefined && method !== 'GET') {
46
+ throw new WriteRefused(refused);
47
+ }
48
+ if (!response.ok)
49
+ throw new Error(`${name}: HTTP ${response.status}`);
50
+ return reply.parse(await response.json());
51
+ });
52
+ }
53
+ }
54
+ export class MemoryTableApi {
55
+ #table;
56
+ #viewer;
57
+ #server;
58
+ #saved;
59
+ constructor(table, seed, viewer, options) {
60
+ this.#table = table;
61
+ this.#viewer = viewer;
62
+ this.#server = new MemoryServer(table.name, options);
63
+ this.#saved = seed;
64
+ }
65
+ list() {
66
+ return this.#server.reply('list', () => {
67
+ const viewer = this.#viewer();
68
+ if (listRefusal(this.#table, viewer) !== undefined) {
69
+ throw new Error(`${this.#table.name}.list: not allowed`);
70
+ }
71
+ return this.#saved.filter((row) => canSee(this.#table, viewer, row));
72
+ });
73
+ }
74
+ listPublic() {
75
+ return this.#server.reply('listPublic', () => this.#saved.map((row) => publicRow(this.#table, row)));
76
+ }
77
+ create(row) {
78
+ return this.#server.reply('create', () => {
79
+ const viewer = this.#viewer();
80
+ const refusal = createRefusal(this.#table, viewer);
81
+ if (refusal !== undefined)
82
+ throw new WriteRefused(refusalOutcome(refusal));
83
+ if (this.#table.owned && viewer === null) {
84
+ throw new WriteRefused('forbidden');
85
+ }
86
+ const saved = this.#table.owned && viewer !== null
87
+ ? { ...row, ownerId: viewer.userId }
88
+ : { ...row };
89
+ this.#refuseClash(saved);
90
+ this.#saved = [...this.#saved, saved];
91
+ return saved;
92
+ });
93
+ }
94
+ update(row) {
95
+ return this.#server.reply('update', () => {
96
+ const existing = this.#allowedChange('update', row.id);
97
+ const saved = existing.ownerId === undefined
98
+ ? { ...row }
99
+ : { ...row, ownerId: existing.ownerId };
100
+ this.#refuseClash(saved);
101
+ this.#saved = this.#saved.map((item) => item.id === saved.id ? saved : item);
102
+ return saved;
103
+ });
104
+ }
105
+ remove(id) {
106
+ return this.#server.reply('remove', () => {
107
+ this.#allowedChange('delete', id);
108
+ this.#saved = this.#saved.filter((item) => item.id !== id);
109
+ });
110
+ }
111
+ #allowedChange(operation, id) {
112
+ const existing = this.#saved.find((item) => item.id === id);
113
+ const refusal = changeRefusal(this.#table, operation, this.#viewer(), existing);
114
+ if (refusal !== undefined || existing === undefined) {
115
+ throw new WriteRefused(refusalOutcome(refusal ?? 'missing'));
116
+ }
117
+ return existing;
118
+ }
119
+ #refuseClash(row) {
120
+ if (clashesWith(this.#table, this.#saved, row)) {
121
+ throw new WriteRefused('conflict');
122
+ }
123
+ }
124
+ }
125
+ function eachTable(tables, api) {
126
+ return Object.fromEntries(Object.entries(tables).map(([key, table]) => [key, api(table)]));
127
+ }
128
+ export function httpTables(tables, gate, onSignedOut) {
129
+ return eachTable(tables, (table) => new HttpTableApi(table, gate, onSignedOut));
130
+ }
131
+ export function memoryTables(tables, seed, viewer, options) {
132
+ return eachTable(tables, (table) => new MemoryTableApi(table, seededRows(seed, table.name), viewer, options));
133
+ }
134
+ export function tableCalls(tables) {
135
+ return Object.values(tables).flatMap((table) => [...entityCalls, ...(table.public.length > 0 ? ['listPublic'] : [])].map((call) => `${table.name}.${call}`));
136
+ }
137
+ export function publicStoreName(table) {
138
+ return `public${table.charAt(0).toUpperCase()}${table.slice(1)}`;
139
+ }
140
+ export class PublicTableStore extends StoreBase {
141
+ #loading;
142
+ constructor(table, { api, cache }) {
143
+ super({
144
+ list: () => api.listPublic(),
145
+ cache: cache.scope(`anon:${publicStoreName(table.name)}`, z.array(table.publicRow))
146
+ });
147
+ }
148
+ initialState() {
149
+ const cached = this.deps.cache.read();
150
+ return {
151
+ status: cached === undefined ? 'idle' : 'ready',
152
+ items: cached ?? []
153
+ };
154
+ }
155
+ load() {
156
+ this.#loading ??= this.#fetch().finally(() => {
157
+ this.#loading = undefined;
158
+ });
159
+ return this.#loading;
160
+ }
161
+ async #fetch() {
162
+ if (this.state.status !== 'ready')
163
+ this.set({ status: 'loading' });
164
+ try {
165
+ const items = await this.deps.list();
166
+ this.deps.cache.write(items);
167
+ this.set({ status: 'ready', items });
168
+ }
169
+ catch {
170
+ if (this.state.status === 'loading')
171
+ this.set({ status: 'failed' });
172
+ }
173
+ }
174
+ }
175
+ export class TableStore extends EntityStore {
176
+ #table;
177
+ #viewer;
178
+ #publicView;
179
+ constructor(table, { api, cache, viewer, publicView }) {
180
+ super({
181
+ api,
182
+ writes: table.writes,
183
+ cache: cache.scope(() => `${viewer()?.userId ?? 'anon'}:${table.name}`, z.array(table.row))
184
+ });
185
+ this.#table = table;
186
+ this.#viewer = viewer;
187
+ this.#publicView = publicView;
188
+ }
189
+ get mayRead() {
190
+ return readScope(this.#table, this.#viewer()) !== 'none';
191
+ }
192
+ load() {
193
+ return this.mayRead ? super.load() : Promise.resolve();
194
+ }
195
+ async create(fields) {
196
+ const ownerId = this.#viewer()?.userId;
197
+ return this.#refreshPublic(await super.create({
198
+ ...fields,
199
+ id: crypto.randomUUID(),
200
+ createdAt: new Date().toISOString(),
201
+ ...(this.#table.owned && ownerId !== undefined ? { ownerId } : {})
202
+ }));
203
+ }
204
+ async update(row) {
205
+ return this.#refreshPublic(await super.update(row));
206
+ }
207
+ async remove(id) {
208
+ return this.#refreshPublic(await super.remove(id));
209
+ }
210
+ #refreshPublic(outcome) {
211
+ if (outcome === 'saved' || outcome === 'conflict') {
212
+ void this.#publicView?.load();
213
+ }
214
+ return outcome;
215
+ }
216
+ }
@@ -0,0 +1,84 @@
1
+ @layer reset {
2
+ :root {
3
+ color-scheme: light dark;
4
+ }
5
+
6
+ *,
7
+ *::before,
8
+ *::after {
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ html,
13
+ body,
14
+ #root {
15
+ height: 100%;
16
+ overflow: hidden;
17
+ overscroll-behavior: none;
18
+ }
19
+
20
+ body {
21
+ -webkit-user-select: none;
22
+ user-select: none;
23
+ -webkit-touch-callout: none;
24
+ -webkit-tap-highlight-color: transparent;
25
+ }
26
+
27
+ input,
28
+ textarea,
29
+ [contenteditable]:not([contenteditable='false']) {
30
+ -webkit-user-select: text;
31
+ user-select: text;
32
+ }
33
+
34
+ a,
35
+ button,
36
+ label,
37
+ select,
38
+ summary,
39
+ [role='button'],
40
+ [role='link'],
41
+ input[type='button'],
42
+ input[type='checkbox'],
43
+ input[type='color'],
44
+ input[type='file'],
45
+ input[type='radio'],
46
+ input[type='range'],
47
+ input[type='reset'],
48
+ input[type='submit'] {
49
+ cursor: default;
50
+ }
51
+
52
+ button {
53
+ padding: 0;
54
+ font: inherit;
55
+ color: inherit;
56
+ background: none;
57
+ border: 0;
58
+ }
59
+
60
+ h1,
61
+ h2,
62
+ h3,
63
+ h4,
64
+ h5,
65
+ h6 {
66
+ font-size: inherit;
67
+ font-weight: inherit;
68
+ }
69
+
70
+ body,
71
+ h1,
72
+ h2,
73
+ h3,
74
+ h4,
75
+ h5,
76
+ h6,
77
+ p,
78
+ figure,
79
+ blockquote,
80
+ ul,
81
+ ol {
82
+ margin: 0;
83
+ }
84
+ }
@@ -0,0 +1,76 @@
1
+ export declare const ascendingScales: {
2
+ readonly space: readonly ["xxs", "xs", "sm", "md", "lg", "xl", "xxl", "xxxl"];
3
+ readonly controlHeights: readonly ["heightXs", "heightSm", "heightMd", "heightLg", "heightXl"];
4
+ readonly controlPaddings: readonly ["paddingXs", "paddingSm", "paddingMd", "paddingLg", "paddingXl"];
5
+ readonly controlGaps: readonly ["gapXs", "gapSm", "gapMd", "gapLg", "gapXl"];
6
+ readonly contentWidths: readonly ["contentXs", "contentSm", "contentMd", "contentLg"];
7
+ readonly iconSizes: readonly ["xs", "sm", "md", "lg", "xl"];
8
+ readonly fontSizes: readonly ["captionXs", "captionSm", "captionBase", "captionLg", "bodySm", "bodyBase", "bodyLg", "heading6", "heading5", "heading4", "heading3", "heading2", "heading1"];
9
+ readonly lineHeights: readonly ["captionXs", "caption", "title", "bodySm", "body", "heading6", "heading5", "heading4", "heading3", "heading2", "heading1"];
10
+ };
11
+ export declare const scaleGroups: {
12
+ readonly space: "space";
13
+ readonly controlHeights: "controls";
14
+ readonly controlPaddings: "controls";
15
+ readonly controlGaps: "controls";
16
+ readonly contentWidths: "widths";
17
+ readonly iconSizes: "iconSizes";
18
+ readonly fontSizes: "fontSizes";
19
+ readonly lineHeights: "lineHeights";
20
+ };
21
+ export declare const textInControls: readonly [{
22
+ readonly size: "xs";
23
+ readonly height: "heightXs";
24
+ readonly lineHeight: "caption";
25
+ }, {
26
+ readonly size: "sm";
27
+ readonly height: "heightSm";
28
+ readonly lineHeight: "bodySm";
29
+ }, {
30
+ readonly size: "md";
31
+ readonly height: "heightMd";
32
+ readonly lineHeight: "bodySm";
33
+ }, {
34
+ readonly size: "lg";
35
+ readonly height: "heightLg";
36
+ readonly lineHeight: "bodySm";
37
+ }, {
38
+ readonly size: "xl";
39
+ readonly height: "heightXl";
40
+ readonly lineHeight: "body";
41
+ }];
42
+ export declare const textLines: readonly [{
43
+ readonly lineHeight: "captionXs";
44
+ readonly fontSize: "captionXs";
45
+ }, {
46
+ readonly lineHeight: "caption";
47
+ readonly fontSize: "captionLg";
48
+ }, {
49
+ readonly lineHeight: "title";
50
+ readonly fontSize: "bodyBase";
51
+ }, {
52
+ readonly lineHeight: "bodySm";
53
+ readonly fontSize: "bodySm";
54
+ }, {
55
+ readonly lineHeight: "body";
56
+ readonly fontSize: "bodyBase";
57
+ }, {
58
+ readonly lineHeight: "heading6";
59
+ readonly fontSize: "heading6";
60
+ }, {
61
+ readonly lineHeight: "heading5";
62
+ readonly fontSize: "heading5";
63
+ }, {
64
+ readonly lineHeight: "heading4";
65
+ readonly fontSize: "heading4";
66
+ }, {
67
+ readonly lineHeight: "heading3";
68
+ readonly fontSize: "heading3";
69
+ }, {
70
+ readonly lineHeight: "heading2";
71
+ readonly fontSize: "heading2";
72
+ }, {
73
+ readonly lineHeight: "heading1";
74
+ readonly fontSize: "heading1";
75
+ }];
76
+ export declare const pixelGroups: readonly ["space", "controls", "iconSizes", "fontSizes", "lineHeights", "borders", "radii", "widths"];
@@ -0,0 +1,82 @@
1
+ export const ascendingScales = {
2
+ space: ['xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl', 'xxxl'],
3
+ controlHeights: ['heightXs', 'heightSm', 'heightMd', 'heightLg', 'heightXl'],
4
+ controlPaddings: [
5
+ 'paddingXs',
6
+ 'paddingSm',
7
+ 'paddingMd',
8
+ 'paddingLg',
9
+ 'paddingXl'
10
+ ],
11
+ controlGaps: ['gapXs', 'gapSm', 'gapMd', 'gapLg', 'gapXl'],
12
+ contentWidths: ['contentXs', 'contentSm', 'contentMd', 'contentLg'],
13
+ iconSizes: ['xs', 'sm', 'md', 'lg', 'xl'],
14
+ fontSizes: [
15
+ 'captionXs',
16
+ 'captionSm',
17
+ 'captionBase',
18
+ 'captionLg',
19
+ 'bodySm',
20
+ 'bodyBase',
21
+ 'bodyLg',
22
+ 'heading6',
23
+ 'heading5',
24
+ 'heading4',
25
+ 'heading3',
26
+ 'heading2',
27
+ 'heading1'
28
+ ],
29
+ lineHeights: [
30
+ 'captionXs',
31
+ 'caption',
32
+ 'title',
33
+ 'bodySm',
34
+ 'body',
35
+ 'heading6',
36
+ 'heading5',
37
+ 'heading4',
38
+ 'heading3',
39
+ 'heading2',
40
+ 'heading1'
41
+ ]
42
+ };
43
+ export const scaleGroups = {
44
+ space: 'space',
45
+ controlHeights: 'controls',
46
+ controlPaddings: 'controls',
47
+ controlGaps: 'controls',
48
+ contentWidths: 'widths',
49
+ iconSizes: 'iconSizes',
50
+ fontSizes: 'fontSizes',
51
+ lineHeights: 'lineHeights'
52
+ };
53
+ export const textInControls = [
54
+ { size: 'xs', height: 'heightXs', lineHeight: 'caption' },
55
+ { size: 'sm', height: 'heightSm', lineHeight: 'bodySm' },
56
+ { size: 'md', height: 'heightMd', lineHeight: 'bodySm' },
57
+ { size: 'lg', height: 'heightLg', lineHeight: 'bodySm' },
58
+ { size: 'xl', height: 'heightXl', lineHeight: 'body' }
59
+ ];
60
+ export const textLines = [
61
+ { lineHeight: 'captionXs', fontSize: 'captionXs' },
62
+ { lineHeight: 'caption', fontSize: 'captionLg' },
63
+ { lineHeight: 'title', fontSize: 'bodyBase' },
64
+ { lineHeight: 'bodySm', fontSize: 'bodySm' },
65
+ { lineHeight: 'body', fontSize: 'bodyBase' },
66
+ { lineHeight: 'heading6', fontSize: 'heading6' },
67
+ { lineHeight: 'heading5', fontSize: 'heading5' },
68
+ { lineHeight: 'heading4', fontSize: 'heading4' },
69
+ { lineHeight: 'heading3', fontSize: 'heading3' },
70
+ { lineHeight: 'heading2', fontSize: 'heading2' },
71
+ { lineHeight: 'heading1', fontSize: 'heading1' }
72
+ ];
73
+ export const pixelGroups = [
74
+ 'space',
75
+ 'controls',
76
+ 'iconSizes',
77
+ 'fontSizes',
78
+ 'lineHeights',
79
+ 'borders',
80
+ 'radii',
81
+ 'widths'
82
+ ];
@@ -0,0 +1,218 @@
1
+ import * as stylex from '@stylexjs/stylex';
2
+ export declare const breakpoints: {
3
+ compact: string;
4
+ reducedMotion: string;
5
+ coarsePointer: string;
6
+ };
7
+ export declare const colors: stylex.VarGroup<Readonly<{
8
+ blackFill: string;
9
+ blackTransparent: string;
10
+ borderDefault: string;
11
+ borderInverted: string;
12
+ borderOnStandout: string;
13
+ borderStrong: string;
14
+ borderStrongSolid: string;
15
+ borderSubtle: string;
16
+ brandBorderDefault: string;
17
+ brandBorderFocus: string;
18
+ brandBorderSubtle: string;
19
+ brandGradientSubtle: string;
20
+ brandForeground: string;
21
+ brandSolid: string;
22
+ brandSolidActive: string;
23
+ brandSolidHover: string;
24
+ brandSubtle: string;
25
+ brandSubtleHover: string;
26
+ card: string;
27
+ component: string;
28
+ componentActive: string;
29
+ componentHover: string;
30
+ componentOnContainerStrong: string;
31
+ componentOnContainerStrongHover: string;
32
+ componentOnContainerSubtle: string;
33
+ componentOnContainerSubtleHover: string;
34
+ componentOnInverted: string;
35
+ componentOnSunken: string;
36
+ container: string;
37
+ containerRecessed: string;
38
+ dangerBorderDefault: string;
39
+ dangerBorderSubtle: string;
40
+ dangerForeground: string;
41
+ dangerSolid: string;
42
+ dangerSolidActive: string;
43
+ dangerSolidHover: string;
44
+ dangerSubtle: string;
45
+ dangerSubtleActive: string;
46
+ dangerSubtleHover: string;
47
+ disabled: string;
48
+ divider: string;
49
+ disabledForeground: string;
50
+ invertedSolid: string;
51
+ invertedSolidActive: string;
52
+ invertedSolidHover: string;
53
+ modal: string;
54
+ onBrandSolidForeground: string;
55
+ onBrandSubtleForeground: string;
56
+ onDangerSolidForeground: string;
57
+ onDangerSubtleForeground: string;
58
+ onInvertedForeground: string;
59
+ onPositiveSolidForeground: string;
60
+ onPositiveSubtleForeground: string;
61
+ onStandoutPrimaryForeground: string;
62
+ onStandoutSecondaryForeground: string;
63
+ onWarningSolidForeground: string;
64
+ onWarningSubtleForeground: string;
65
+ page: string;
66
+ positiveBorderDefault: string;
67
+ positiveForeground: string;
68
+ positiveSolid: string;
69
+ positiveSolidHover: string;
70
+ positiveSubtle: string;
71
+ positiveSubtleHover: string;
72
+ primaryForeground: string;
73
+ secondaryForeground: string;
74
+ secondaryForegroundSolid: string;
75
+ shell: string;
76
+ standout: string;
77
+ sunken: string;
78
+ tertiaryForeground: string;
79
+ transparent: string;
80
+ transparentActive: string;
81
+ transparentHover: string;
82
+ warningBorderDefault: string;
83
+ warningForeground: string;
84
+ warningSolid: string;
85
+ warningSolidHover: string;
86
+ warningSubtle: string;
87
+ warningSubtleHover: string;
88
+ whiteFill: string;
89
+ dangerText: string;
90
+ indicatorBorder: string;
91
+ overlay: string;
92
+ }>, symbol>;
93
+ export declare const space: stylex.VarGroup<Readonly<{
94
+ xxs: string;
95
+ xs: string;
96
+ sm: string;
97
+ md: string;
98
+ lg: string;
99
+ xl: string;
100
+ xxl: string;
101
+ xxxl: string;
102
+ }>, symbol>;
103
+ export declare const controls: stylex.VarGroup<Readonly<{
104
+ heightXs: string;
105
+ heightSm: string;
106
+ heightMd: string;
107
+ heightLg: string;
108
+ heightXl: string;
109
+ paddingXs: string;
110
+ paddingSm: string;
111
+ paddingMd: string;
112
+ paddingLg: string;
113
+ paddingXl: string;
114
+ gapXs: string;
115
+ gapSm: string;
116
+ gapMd: string;
117
+ gapLg: string;
118
+ gapXl: string;
119
+ }>, symbol>;
120
+ export declare const iconSizes: stylex.VarGroup<Readonly<{
121
+ xs: string;
122
+ sm: string;
123
+ md: string;
124
+ lg: string;
125
+ xl: string;
126
+ }>, symbol>;
127
+ export declare const borders: stylex.VarGroup<Readonly<{
128
+ hairline: string;
129
+ thin: string;
130
+ }>, symbol>;
131
+ export declare const widths: stylex.VarGroup<Readonly<{
132
+ contentXs: string;
133
+ contentSm: string;
134
+ contentMd: string;
135
+ contentLg: string;
136
+ sidebar: string;
137
+ toast: string;
138
+ }>, symbol>;
139
+ export declare const layers: {
140
+ scrim: string;
141
+ sidebar: string;
142
+ menu: string;
143
+ tooltip: string;
144
+ dialog: string;
145
+ toast: string;
146
+ };
147
+ export declare const radii: stylex.VarGroup<Readonly<{
148
+ xs: string;
149
+ sm: string;
150
+ md: string;
151
+ lg: string;
152
+ xl: string;
153
+ xxl: string;
154
+ xxxl: string;
155
+ xxxxl: string;
156
+ full: string;
157
+ }>, symbol>;
158
+ export declare const fontSizes: stylex.VarGroup<Readonly<{
159
+ captionXs: string;
160
+ captionSm: string;
161
+ captionBase: string;
162
+ captionLg: string;
163
+ bodySm: string;
164
+ bodyBase: string;
165
+ bodyLg: string;
166
+ heading6: string;
167
+ heading5: string;
168
+ heading4: string;
169
+ heading3: string;
170
+ heading2: string;
171
+ heading1: string;
172
+ }>, symbol>;
173
+ export declare const lineHeights: stylex.VarGroup<Readonly<{
174
+ captionXs: string;
175
+ caption: string;
176
+ title: string;
177
+ bodySm: string;
178
+ body: string;
179
+ heading6: string;
180
+ heading5: string;
181
+ heading4: string;
182
+ heading3: string;
183
+ heading2: string;
184
+ heading1: string;
185
+ }>, symbol>;
186
+ export declare const fonts: stylex.VarGroup<Readonly<{
187
+ sans: string;
188
+ mono: string;
189
+ }>, symbol>;
190
+ export declare const fontFeatures: stylex.VarGroup<Readonly<{
191
+ sans: string;
192
+ kbd: string;
193
+ }>, symbol>;
194
+ export declare const fontWeights: stylex.VarGroup<Readonly<{
195
+ normal: string;
196
+ semimedium: string;
197
+ medium: string;
198
+ semibold: string;
199
+ bold: string;
200
+ }>, symbol>;
201
+ export declare const shadows: stylex.VarGroup<Readonly<{
202
+ border: string;
203
+ default: string;
204
+ large: string;
205
+ extraLarge: string;
206
+ }>, symbol>;
207
+ export declare const motion: stylex.VarGroup<Readonly<{
208
+ easeOut: string;
209
+ easeInOut: string;
210
+ slideEasing: string;
211
+ instant: string;
212
+ exit: string;
213
+ fast: string;
214
+ base: string;
215
+ slide: string;
216
+ pulse: string;
217
+ spin: string;
218
+ }>, symbol>;