@neoptocom/neopto-ui 0.7.3 → 0.7.5

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/CONSUMER_SETUP.md CHANGED
@@ -34,6 +34,9 @@ In your main CSS file (e.g., `src/index.css`):
34
34
  ```css
35
35
  @import "tailwindcss";
36
36
 
37
+ /* Enable dark mode support */
38
+ @variant dark (&:where(.dark, .dark *));
39
+
37
40
  /* Scan the component library source files */
38
41
  @source "../node_modules/@neoptocom/neopto-ui/src";
39
42
 
@@ -41,6 +44,8 @@ In your main CSS file (e.g., `src/index.css`):
41
44
  @import "@neoptocom/neopto-ui/styles";
42
45
  ```
43
46
 
47
+ **Important:** The `@variant dark` line is required for dark mode to work properly with components like `AppBackground`.
48
+
44
49
  Then import your CSS in `src/main.tsx`:
45
50
 
46
51
  ```tsx
package/README.md CHANGED
@@ -41,6 +41,9 @@ If your CSS file is at `src/app/globals.css` (App Router), use:
41
41
  ```css
42
42
  @import "tailwindcss";
43
43
 
44
+ /* Enable dark mode support */
45
+ @variant dark (&:where(.dark, .dark *));
46
+
44
47
  /* Scan the component library source files */
45
48
  @source "../../node_modules/@neoptocom/neopto-ui/src";
46
49
 
@@ -49,11 +52,12 @@ If your CSS file is at `src/app/globals.css` (App Router), use:
49
52
 
50
53
  /* Scan your own project files */
51
54
  @source "../";
52
-
53
55
  ```
54
56
 
55
57
  **Note:** The path is relative to your CSS file location. Adjust `../` levels accordingly.
56
58
 
59
+ **Important:** The `@variant dark` line is required for dark mode to work properly with components like `AppBackground`.
60
+
57
61
  ```
58
62
 
59
63
  Then import this CSS in your `src/main.tsx`:
@@ -100,11 +104,13 @@ This library uses **Tailwind CSS v4** utility classes directly in components (e.
100
104
 
101
105
  ### AppBackground
102
106
 
107
+ A full-page background component with built-in light/dark mode support and smooth transitions.
108
+
103
109
  ```tsx
104
- import { AppBackground, assets } from "@neoptocom/neopto-ui";
110
+ import { AppBackground } from "@neoptocom/neopto-ui";
105
111
 
106
- // Use built-in NeoPTO backgrounds
107
- <AppBackground lightImage={assets.bgLight} darkImage={assets.bgDark}>
112
+ // Use default NeoPTO branded backgrounds (recommended)
113
+ <AppBackground>
108
114
  <YourApp />
109
115
  </AppBackground>
110
116
 
@@ -114,9 +120,11 @@ import { AppBackground, assets } from "@neoptocom/neopto-ui";
114
120
  darkImage="/path/to/dark-bg.jpg"
115
121
  >
116
122
  <YourApp />
117
- </AppBackground>;
123
+ </AppBackground>
118
124
  ```
119
125
 
126
+ **Best Practice:** Add `AppBackground` to your root layout (`app/layout.tsx`) so it wraps your entire app and persists across pages.
127
+
120
128
  ### Button
121
129
 
122
130
  ```tsx
package/dist/index.cjs CHANGED
@@ -58,8 +58,8 @@ var agentNeopto = agent_neopto_default;
58
58
  var agentNeoptoDark = agent_neopto_dark_default;
59
59
  function AppBackground({
60
60
  children,
61
- lightImage,
62
- darkImage,
61
+ lightImage = bgLight,
62
+ darkImage = bgDark,
63
63
  className = ""
64
64
  }) {
65
65
  const hasImages = lightImage || darkImage;
package/dist/index.d.cts CHANGED
@@ -17,9 +17,9 @@ declare namespace index {
17
17
  type AppBackgroundProps = {
18
18
  /** Content to render inside the background */
19
19
  children: React.ReactNode;
20
- /** Background image URL for light mode */
20
+ /** Background image URL for light mode (defaults to library's light background) */
21
21
  lightImage?: string;
22
- /** Background image URL for dark mode */
22
+ /** Background image URL for dark mode (defaults to library's dark background) */
23
23
  darkImage?: string;
24
24
  /** Additional CSS classes */
25
25
  className?: string;
package/dist/index.d.ts CHANGED
@@ -17,9 +17,9 @@ declare namespace index {
17
17
  type AppBackgroundProps = {
18
18
  /** Content to render inside the background */
19
19
  children: React.ReactNode;
20
- /** Background image URL for light mode */
20
+ /** Background image URL for light mode (defaults to library's light background) */
21
21
  lightImage?: string;
22
- /** Background image URL for dark mode */
22
+ /** Background image URL for dark mode (defaults to library's dark background) */
23
23
  darkImage?: string;
24
24
  /** Additional CSS classes */
25
25
  className?: string;
package/dist/index.js CHANGED
@@ -37,8 +37,8 @@ var agentNeopto = agent_neopto_default;
37
37
  var agentNeoptoDark = agent_neopto_dark_default;
38
38
  function AppBackground({
39
39
  children,
40
- lightImage,
41
- darkImage,
40
+ lightImage = bgLight,
41
+ darkImage = bgDark,
42
42
  className = ""
43
43
  }) {
44
44
  const hasImages = lightImage || darkImage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neoptocom/neopto-ui",
3
- "version": "0.7.3",
3
+ "version": "0.7.5",
4
4
  "private": false,
5
5
  "description": "A modern React component library built with Tailwind CSS v4 and TypeScript. Features dark mode, design tokens, and comprehensive Storybook documentation. Requires Tailwind v4+.",
6
6
  "keywords": [
@@ -1,11 +1,12 @@
1
1
  import * as React from "react";
2
+ import * as assets from "../assets";
2
3
 
3
4
  export type AppBackgroundProps = {
4
5
  /** Content to render inside the background */
5
6
  children: React.ReactNode;
6
- /** Background image URL for light mode */
7
+ /** Background image URL for light mode (defaults to library's light background) */
7
8
  lightImage?: string;
8
- /** Background image URL for dark mode */
9
+ /** Background image URL for dark mode (defaults to library's dark background) */
9
10
  darkImage?: string;
10
11
  /** Additional CSS classes */
11
12
  className?: string;
@@ -13,8 +14,8 @@ export type AppBackgroundProps = {
13
14
 
14
15
  export function AppBackground({
15
16
  children,
16
- lightImage,
17
- darkImage,
17
+ lightImage = assets.bgLight,
18
+ darkImage = assets.bgDark,
18
19
  className = "",
19
20
  }: AppBackgroundProps) {
20
21
  const hasImages = lightImage || darkImage;