@matteoaliano/forest-ui 0.8.1 → 0.8.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.
package/README.md CHANGED
@@ -4,26 +4,57 @@ Forest Design System — A multi-tenant MUI v7 + Emotion component library.
4
4
 
5
5
  ## Installation
6
6
 
7
+ Install the package and its peer dependencies:
8
+
7
9
  ```bash
8
- npm install @matteoaliano/forest-ui
10
+ npm install @matteoaliano/forest-ui \
11
+ @mui/material@^7 @mui/icons-material@^7 \
12
+ @mui/x-charts@^7 @mui/x-data-grid@^7 @mui/x-date-pickers@^8 \
13
+ @emotion/react @emotion/styled dayjs
9
14
  ```
10
15
 
16
+ Forest UI re-exports MUI components with Forest defaults, so you should import everything from `@matteoaliano/forest-ui` rather than `@mui/material`. The only direct MUI import you need is `@mui/icons-material` for icons.
17
+
11
18
  ## Quick Start
12
19
 
13
20
  ```tsx
14
21
  import { ForestProvider, Button, Typography } from '@matteoaliano/forest-ui';
15
- import '@fontsource/poppins'; // or load Aeonik font
22
+ import '@matteoaliano/forest-ui/fonts/aeonik/aeonik.css';
16
23
 
17
24
  function App() {
18
25
  return (
19
26
  <ForestProvider>
20
27
  <Typography variant="h1">Hello Forest</Typography>
21
- <Button variant="contained">Click me</Button>
28
+ <Button>Click me</Button>
22
29
  </ForestProvider>
23
30
  );
24
31
  }
25
32
  ```
26
33
 
34
+ ## Next.js setup
35
+
36
+ Forest UI works with Next.js 14 / 15 / 16 (App Router and Pages Router). For best results with Turbopack and bundle size, add the following to `next.config.js`:
37
+
38
+ ```js
39
+ /** @type {import('next').NextConfig} */
40
+ const nextConfig = {
41
+ transpilePackages: ['@matteoaliano/forest-ui'],
42
+ experimental: {
43
+ optimizePackageImports: [
44
+ '@matteoaliano/forest-ui',
45
+ '@mui/material',
46
+ '@mui/icons-material',
47
+ ],
48
+ },
49
+ };
50
+
51
+ module.exports = nextConfig;
52
+ ```
53
+
54
+ Because `ForestProvider` is a client component, wrap your app in a client boundary (a `'use client'` component or a dedicated `providers.tsx`) before mounting it inside the App Router root layout.
55
+
56
+ > **Known issue:** some `@mui/x-*` packages have intermittent Turbopack issues upstream that are unrelated to Forest UI. If you hit one, falling back to webpack (`next dev` without `--turbo`) usually clears it.
57
+
27
58
  ## Theme Presets
28
59
 
29
60
  Three presets are available:
package/dist/index.d.mts CHANGED
@@ -331,22 +331,57 @@ declare function Input({ ...props }: InputProps): react_jsx_runtime.JSX.Element;
331
331
  type IconButtonProps = IconButtonProps$1;
332
332
  declare function IconButton(props: IconButtonProps): react_jsx_runtime.JSX.Element;
333
333
 
334
- type LogoProduct = 'wsuite' | 'studio' | 'feedati' | 'ai-hub';
334
+ /**
335
+ * AUTO-GENERATED by scripts/generate-logo-inner.mjs — do not edit by hand.
336
+ *
337
+ * Inner SVG markup for the <Logo> component, sourced from /logos/. Figma
338
+ * instance suffixes have been replaced with `__ID__` so the runtime can
339
+ * substitute a unique identifier per <Logo> instance.
340
+ */
341
+ type LogoVariant$1 = "logo" | "logomark";
342
+ type LogoColor$1 = "default" | "positive" | "negative" | "negative-payoff";
343
+ interface LogoArtwork {
344
+ viewBox: string;
345
+ inner: string;
346
+ }
347
+ declare const PRODUCT_ARTWORK: {
348
+ readonly studio: Record<LogoVariant$1, Partial<Record<LogoColor$1, LogoArtwork>>>;
349
+ readonly "ai-hub": Record<LogoVariant$1, Partial<Record<LogoColor$1, LogoArtwork>>>;
350
+ readonly contix: Record<LogoVariant$1, Partial<Record<LogoColor$1, LogoArtwork>>>;
351
+ readonly sentimenthub: Record<LogoVariant$1, Partial<Record<LogoColor$1, LogoArtwork>>>;
352
+ readonly adgenie: Record<LogoVariant$1, Partial<Record<LogoColor$1, LogoArtwork>>>;
353
+ readonly "revenue-pulse": Record<LogoVariant$1, Partial<Record<LogoColor$1, LogoArtwork>>>;
354
+ };
355
+ type LogoProductKey = keyof typeof PRODUCT_ARTWORK;
356
+
357
+ /**
358
+ * All product brands exposed by `<Logo>`. Driven entirely by the SVG files
359
+ * under `/logos/<product>-logos/` — add a folder there and regenerate via
360
+ * `scripts/generate-logo-inner.mjs` to expose a new brand here.
361
+ */
362
+ type LogoProduct = LogoProductKey;
335
363
  type LogoVariant = 'logo' | 'logomark';
336
- type LogoColor = 'positive' | 'negative' | 'negative-payoff';
364
+ /**
365
+ * Color treatment.
366
+ *
367
+ * For `variant="logo"`:
368
+ * - `default` — full-color artwork with depth (drop shadows, radial gradient). For hero usage.
369
+ * - `positive` — flat colored wordmark, optimized for light surfaces.
370
+ * - `negative` — white-only artwork for dark surfaces.
371
+ * - `negative-payoff` — colored mark + light payoff caption (use on a colored hero).
372
+ *
373
+ * For `variant="logomark"` only `default` and `negative` are valid. Other
374
+ * values fall back to `default`.
375
+ */
376
+ type LogoColor = 'default' | 'positive' | 'negative' | 'negative-payoff';
337
377
  interface LogoProps extends Omit<BoxProps<'svg'>, 'component' | 'children'> {
338
- /** Product brand */
378
+ /** Product brand. Defaults to `studio`. */
339
379
  product?: LogoProduct;
340
- /** `logo` = wordmark with payoff caption, `logomark` = square brand icon */
380
+ /** `logo` = wordmark with payoff caption, `logomark` = square brand icon. */
341
381
  variant?: LogoVariant;
342
382
  /**
343
- * Color treatment.
344
- * - `positive` (default): colored mark for use on light backgrounds
345
- * - `negative`: white mark for use on dark backgrounds
346
- * - `negative-payoff`: colored mark with light payoff caption (for use on a colored hero)
347
- *
348
- * Falls back to `positive` if a product doesn't define the requested color.
349
- * `negative-payoff` falls back to `negative` for `logomark` variants (no payoff to invert).
383
+ * Color treatment. Defaults to `default`. Logomarks only support
384
+ * `default` / `negative` anything else falls back to `default`.
350
385
  */
351
386
  color?: LogoColor;
352
387
  }
@@ -354,9 +389,12 @@ interface LogoProps extends Omit<BoxProps<'svg'>, 'component' | 'children'> {
354
389
  * Logo component for the Forest product suite.
355
390
  *
356
391
  * @example
357
- * <Logo product="studio" variant="logo" color="positive" />
358
- * <Logo product="studio" variant="logo" color="negative" />
359
- * <Logo product="ai-hub" variant="logomark" color="negative" />
392
+ * <Logo product="studio" /> // default lockup
393
+ * <Logo product="studio" color="positive" /> // flat positive
394
+ * <Logo product="adgenie" color="negative" /> // for dark surfaces
395
+ * <Logo product="ai-hub" color="negative-payoff" /> // for a colored hero
396
+ * <Logo product="revenue-pulse" variant="logomark" /> // default mark
397
+ * <Logo product="revenue-pulse" variant="logomark" color="negative" />
360
398
  */
361
399
  declare const Logo: React$1.ForwardRefExoticComponent<Omit<LogoProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
362
400
 
package/dist/index.d.ts CHANGED
@@ -331,22 +331,57 @@ declare function Input({ ...props }: InputProps): react_jsx_runtime.JSX.Element;
331
331
  type IconButtonProps = IconButtonProps$1;
332
332
  declare function IconButton(props: IconButtonProps): react_jsx_runtime.JSX.Element;
333
333
 
334
- type LogoProduct = 'wsuite' | 'studio' | 'feedati' | 'ai-hub';
334
+ /**
335
+ * AUTO-GENERATED by scripts/generate-logo-inner.mjs — do not edit by hand.
336
+ *
337
+ * Inner SVG markup for the <Logo> component, sourced from /logos/. Figma
338
+ * instance suffixes have been replaced with `__ID__` so the runtime can
339
+ * substitute a unique identifier per <Logo> instance.
340
+ */
341
+ type LogoVariant$1 = "logo" | "logomark";
342
+ type LogoColor$1 = "default" | "positive" | "negative" | "negative-payoff";
343
+ interface LogoArtwork {
344
+ viewBox: string;
345
+ inner: string;
346
+ }
347
+ declare const PRODUCT_ARTWORK: {
348
+ readonly studio: Record<LogoVariant$1, Partial<Record<LogoColor$1, LogoArtwork>>>;
349
+ readonly "ai-hub": Record<LogoVariant$1, Partial<Record<LogoColor$1, LogoArtwork>>>;
350
+ readonly contix: Record<LogoVariant$1, Partial<Record<LogoColor$1, LogoArtwork>>>;
351
+ readonly sentimenthub: Record<LogoVariant$1, Partial<Record<LogoColor$1, LogoArtwork>>>;
352
+ readonly adgenie: Record<LogoVariant$1, Partial<Record<LogoColor$1, LogoArtwork>>>;
353
+ readonly "revenue-pulse": Record<LogoVariant$1, Partial<Record<LogoColor$1, LogoArtwork>>>;
354
+ };
355
+ type LogoProductKey = keyof typeof PRODUCT_ARTWORK;
356
+
357
+ /**
358
+ * All product brands exposed by `<Logo>`. Driven entirely by the SVG files
359
+ * under `/logos/<product>-logos/` — add a folder there and regenerate via
360
+ * `scripts/generate-logo-inner.mjs` to expose a new brand here.
361
+ */
362
+ type LogoProduct = LogoProductKey;
335
363
  type LogoVariant = 'logo' | 'logomark';
336
- type LogoColor = 'positive' | 'negative' | 'negative-payoff';
364
+ /**
365
+ * Color treatment.
366
+ *
367
+ * For `variant="logo"`:
368
+ * - `default` — full-color artwork with depth (drop shadows, radial gradient). For hero usage.
369
+ * - `positive` — flat colored wordmark, optimized for light surfaces.
370
+ * - `negative` — white-only artwork for dark surfaces.
371
+ * - `negative-payoff` — colored mark + light payoff caption (use on a colored hero).
372
+ *
373
+ * For `variant="logomark"` only `default` and `negative` are valid. Other
374
+ * values fall back to `default`.
375
+ */
376
+ type LogoColor = 'default' | 'positive' | 'negative' | 'negative-payoff';
337
377
  interface LogoProps extends Omit<BoxProps<'svg'>, 'component' | 'children'> {
338
- /** Product brand */
378
+ /** Product brand. Defaults to `studio`. */
339
379
  product?: LogoProduct;
340
- /** `logo` = wordmark with payoff caption, `logomark` = square brand icon */
380
+ /** `logo` = wordmark with payoff caption, `logomark` = square brand icon. */
341
381
  variant?: LogoVariant;
342
382
  /**
343
- * Color treatment.
344
- * - `positive` (default): colored mark for use on light backgrounds
345
- * - `negative`: white mark for use on dark backgrounds
346
- * - `negative-payoff`: colored mark with light payoff caption (for use on a colored hero)
347
- *
348
- * Falls back to `positive` if a product doesn't define the requested color.
349
- * `negative-payoff` falls back to `negative` for `logomark` variants (no payoff to invert).
383
+ * Color treatment. Defaults to `default`. Logomarks only support
384
+ * `default` / `negative` anything else falls back to `default`.
350
385
  */
351
386
  color?: LogoColor;
352
387
  }
@@ -354,9 +389,12 @@ interface LogoProps extends Omit<BoxProps<'svg'>, 'component' | 'children'> {
354
389
  * Logo component for the Forest product suite.
355
390
  *
356
391
  * @example
357
- * <Logo product="studio" variant="logo" color="positive" />
358
- * <Logo product="studio" variant="logo" color="negative" />
359
- * <Logo product="ai-hub" variant="logomark" color="negative" />
392
+ * <Logo product="studio" /> // default lockup
393
+ * <Logo product="studio" color="positive" /> // flat positive
394
+ * <Logo product="adgenie" color="negative" /> // for dark surfaces
395
+ * <Logo product="ai-hub" color="negative-payoff" /> // for a colored hero
396
+ * <Logo product="revenue-pulse" variant="logomark" /> // default mark
397
+ * <Logo product="revenue-pulse" variant="logomark" color="negative" />
360
398
  */
361
399
  declare const Logo: React$1.ForwardRefExoticComponent<Omit<LogoProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
362
400