@fldr/ui 0.3.5 → 0.3.7

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 (43) hide show
  1. package/THEMING.md +1 -1
  2. package/ai/component-registry.json +962 -43
  3. package/ai/component-registry.md +1 -1
  4. package/dist/.build-complete +1 -1
  5. package/dist/blocks-source/activity-feed/activity-feed.test.tsx +75 -0
  6. package/dist/blocks-source/activity-feed/activity-feed.tsx +256 -0
  7. package/dist/blocks-source/app-shell/app-shell.test.tsx +74 -0
  8. package/dist/blocks-source/app-shell/app-shell.tsx +123 -0
  9. package/dist/blocks-source/auth-card/auth-card.test.tsx +64 -0
  10. package/dist/blocks-source/auth-card/auth-card.tsx +234 -0
  11. package/dist/blocks-source/dashboard-page/dashboard-page.tsx +167 -0
  12. package/dist/blocks-source/error-page/error-page.test.tsx +60 -0
  13. package/dist/blocks-source/error-page/error-page.tsx +97 -0
  14. package/dist/blocks-source/file-table/file-item.tsx +164 -0
  15. package/dist/blocks-source/file-table/file-table.test.tsx +82 -0
  16. package/dist/blocks-source/file-table/file-table.tsx +292 -0
  17. package/dist/blocks-source/folder-grid/folder-grid.test.tsx +54 -0
  18. package/dist/blocks-source/folder-grid/folder-grid.tsx +170 -0
  19. package/dist/blocks-source/login-page/login-page.tsx +47 -0
  20. package/dist/blocks-source/onboarding-checklist/onboarding-checklist.test.tsx +50 -0
  21. package/dist/blocks-source/onboarding-checklist/onboarding-checklist.tsx +180 -0
  22. package/dist/blocks-source/settings-section/settings-section.test.tsx +43 -0
  23. package/dist/blocks-source/settings-section/settings-section.tsx +165 -0
  24. package/dist/blocks-source/share-dialog/share-dialog.test.tsx +69 -0
  25. package/dist/blocks-source/share-dialog/share-dialog.tsx +307 -0
  26. package/dist/blocks-source/stat-grid/stat-grid.test.tsx +52 -0
  27. package/dist/blocks-source/stat-grid/stat-grid.tsx +153 -0
  28. package/dist/blocks-source/upload-dropzone/upload-dropzone.test.tsx +82 -0
  29. package/dist/blocks-source/upload-dropzone/upload-dropzone.tsx +264 -0
  30. package/dist/blocks.d.ts +780 -0
  31. package/dist/blocks.js +1664 -0
  32. package/dist/chunks/delete-resource-cmlptb61ih8s84r3.js +151 -0
  33. package/dist/chunks/{tabs-o59bv7348nh2gppm.js → tabs-cja62qojznpj99et.js} +2 -0
  34. package/dist/components/tabs.js +1 -1
  35. package/dist/delete-resource-DY-GFy2s.d.ts +48 -0
  36. package/dist/index.d.ts +4 -50
  37. package/dist/index.js +2 -147
  38. package/dist/primitives.d.ts +1 -1
  39. package/dist/styles/kumo-standalone.css +1 -1
  40. package/dist/styles/theme-fldr.css +12 -0
  41. package/dist/theming.d.ts +29 -2
  42. package/dist/theming.js +19 -4
  43. package/package.json +5 -1
@@ -469,6 +469,18 @@
469
469
  }
470
470
  }
471
471
 
472
+ /* Kumo density "comfortable". Generated by generateDensityCSS(). */
473
+ @layer base {
474
+ :root,
475
+ [data-density="comfortable"] {
476
+ --spacing: 0.24rem;
477
+ --text-xs: 11.67px;
478
+ --text-sm: 12.67px;
479
+ --text-base: 13.67px;
480
+ --text-lg: 15.67px;
481
+ }
482
+ }
483
+
472
484
  /* Kumo density "compact". Generated by generateDensityCSS(). */
473
485
  @layer base {
474
486
  [data-density="compact"] {
package/dist/theming.d.ts CHANGED
@@ -42,6 +42,8 @@ interface KumoDensity {
42
42
  spacing: string;
43
43
  /** Font sizes and line heights. */
44
44
  typography?: Partial<Record<KumoTypographyToken, string>>;
45
+ /** Also apply on `:root`, so pages without `data-density` get this scale. */
46
+ default?: boolean;
45
47
  }
46
48
  export declare function defineDensity<const T extends KumoDensity>(density: T): T;
47
49
  /** Generate the CSS for a density. Load it after Kumo's styles. */
@@ -135,6 +137,21 @@ export declare const compactDensity: {
135
137
  readonly lg: "15px";
136
138
  };
137
139
  };
140
+ /**
141
+ * fldr's default scale, a third of the way from Kumo's stock size to compact:
142
+ * 13.67px body text. Applies on `:root`, so it needs no attribute.
143
+ */
144
+ export declare const comfortableDensity: {
145
+ readonly name: "comfortable";
146
+ readonly default: true;
147
+ readonly spacing: "0.24rem";
148
+ readonly typography: {
149
+ readonly xs: "11.67px";
150
+ readonly sm: "12.67px";
151
+ readonly base: "13.67px";
152
+ readonly lg: "15.67px";
153
+ };
154
+ };
138
155
  //#endregion
139
156
  //#region src/themes/index.d.ts
140
157
  /**
@@ -210,7 +227,17 @@ export declare const BUILT_IN_THEMES: (KumoTheme | {
210
227
  };
211
228
  })[];
212
229
  /** Densities shipped in `theme-fldr.css`, applied with `data-density="<name>"`. */
213
- export declare const BUILT_IN_DENSITIES: {
230
+ export declare const BUILT_IN_DENSITIES: ({
231
+ readonly name: "comfortable";
232
+ readonly default: true;
233
+ readonly spacing: "0.24rem";
234
+ readonly typography: {
235
+ readonly xs: "11.67px";
236
+ readonly sm: "12.67px";
237
+ readonly base: "13.67px";
238
+ readonly lg: "15.67px";
239
+ };
240
+ } | {
214
241
  readonly name: "compact";
215
242
  readonly spacing: "0.22rem";
216
243
  readonly typography: {
@@ -219,6 +246,6 @@ export declare const BUILT_IN_DENSITIES: {
219
246
  readonly base: "13px";
220
247
  readonly lg: "15px";
221
248
  };
222
- }[];
249
+ })[];
223
250
  //#endregion
224
251
  export type { ColorMode, KumoColorToken, KumoDensity, KumoTextToken, KumoTheme, KumoTypographyToken };
package/dist/theming.js CHANGED
@@ -181,7 +181,7 @@ function defineDensity(density) {
181
181
  }
182
182
  /** Generate the CSS for a density. Load it after Kumo's styles. */
183
183
  function generateDensityCSS(density) {
184
- const { name, spacing, typography = {} } = density;
184
+ const { name, spacing, typography = {}, default: isDefault } = density;
185
185
  if (!NAME.test(name)) throw new Error(`Invalid density name "${name}": use lowercase letters, digits and dashes`);
186
186
  assertKnown("typography", Object.keys(typography), THEME_CONFIG.typography);
187
187
  const lines = [` --spacing: ${spacing};`];
@@ -189,7 +189,7 @@ function generateDensityCSS(density) {
189
189
  return [
190
190
  `/* Kumo density "${name}". Generated by generateDensityCSS(). */`,
191
191
  "@layer base {",
192
- ` [data-density="${name}"] {`,
192
+ ` ${isDefault ? ":root, " : ""}[data-density="${name}"] {`,
193
193
  ...lines,
194
194
  " }",
195
195
  "}",
@@ -365,6 +365,21 @@ const compactDensity = defineDensity({
365
365
  lg: "15px"
366
366
  }
367
367
  });
368
+ /**
369
+ * fldr's default scale, a third of the way from Kumo's stock size to compact:
370
+ * 13.67px body text. Applies on `:root`, so it needs no attribute.
371
+ */
372
+ const comfortableDensity = defineDensity({
373
+ name: "comfortable",
374
+ default: true,
375
+ spacing: "0.24rem",
376
+ typography: {
377
+ xs: "11.67px",
378
+ sm: "12.67px",
379
+ base: "13.67px",
380
+ lg: "15.67px"
381
+ }
382
+ });
368
383
  //#endregion
369
384
  //#region src/themes/index.ts
370
385
  /**
@@ -381,6 +396,6 @@ const BUILT_IN_THEMES = [
381
396
  fldrInkTheme
382
397
  ];
383
398
  /** Densities shipped in `theme-fldr.css`, applied with `data-density="<name>"`. */
384
- const BUILT_IN_DENSITIES = [compactDensity];
399
+ const BUILT_IN_DENSITIES = [comfortableDensity, compactDensity];
385
400
  //#endregion
386
- export { BUILT_IN_DENSITIES, BUILT_IN_THEMES, compactDensity, defineDensity, defineTheme, extendTheme, fldrGreenTheme, fldrInkTheme, fldrOrangeTheme, fldrRoseTheme, fldrTheme, fldrVioletTheme, generateDensityCSS, generateThemeCSS };
401
+ export { BUILT_IN_DENSITIES, BUILT_IN_THEMES, comfortableDensity, compactDensity, defineDensity, defineTheme, extendTheme, fldrGreenTheme, fldrInkTheme, fldrOrangeTheme, fldrRoseTheme, fldrTheme, fldrVioletTheme, generateDensityCSS, generateThemeCSS };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fldr/ui",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "private": false,
5
5
  "description": "fldr's design system: Cloudflare Kumo with a theme authoring API and PandaCSS preset",
6
6
  "keywords": [
@@ -47,6 +47,10 @@
47
47
  "types": "./dist/ai/schemas.d.ts",
48
48
  "import": "./dist/ai/schemas.js"
49
49
  },
50
+ "./blocks": {
51
+ "types": "./dist/blocks.d.ts",
52
+ "import": "./dist/blocks.js"
53
+ },
50
54
  "./catalog": {
51
55
  "types": "./dist/catalog.d.ts",
52
56
  "import": "./dist/catalog.js"