@neoptocom/neopto-ui 0.7.2 → 0.7.4

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
@@ -100,11 +100,13 @@ This library uses **Tailwind CSS v4** utility classes directly in components (e.
100
100
 
101
101
  ### AppBackground
102
102
 
103
+ A full-page background component with built-in light/dark mode support and smooth transitions.
104
+
103
105
  ```tsx
104
- import { AppBackground, assets } from "@neoptocom/neopto-ui";
106
+ import { AppBackground } from "@neoptocom/neopto-ui";
105
107
 
106
- // Use built-in NeoPTO backgrounds
107
- <AppBackground lightImage={assets.bgLight} darkImage={assets.bgDark}>
108
+ // Use default NeoPTO branded backgrounds (recommended)
109
+ <AppBackground>
108
110
  <YourApp />
109
111
  </AppBackground>
110
112
 
@@ -114,9 +116,11 @@ import { AppBackground, assets } from "@neoptocom/neopto-ui";
114
116
  darkImage="/path/to/dark-bg.jpg"
115
117
  >
116
118
  <YourApp />
117
- </AppBackground>;
119
+ </AppBackground>
118
120
  ```
119
121
 
122
+ **Best Practice:** Add `AppBackground` to your root layout (`app/layout.tsx`) so it wraps your entire app and persists across pages.
123
+
120
124
  ### Button
121
125
 
122
126
  ```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;
@@ -69,7 +69,7 @@ function AppBackground({
69
69
  lightImage && /* @__PURE__ */ jsxRuntime.jsx(
70
70
  "div",
71
71
  {
72
- className: "fixed inset-0 -z-10 transition-opacity duration-500 dark:opacity-0",
72
+ className: "fixed inset-0 z-[-10] transition-opacity duration-500 opacity-100 dark:opacity-0",
73
73
  style: {
74
74
  backgroundImage: `url(${lightImage})`,
75
75
  backgroundSize: "cover",
@@ -81,7 +81,7 @@ function AppBackground({
81
81
  darkImage && /* @__PURE__ */ jsxRuntime.jsx(
82
82
  "div",
83
83
  {
84
- className: "fixed inset-0 -z-10 transition-opacity duration-500 opacity-0 dark:opacity-100",
84
+ className: "fixed inset-0 z-[-10] transition-opacity duration-500 opacity-0 dark:opacity-100",
85
85
  style: {
86
86
  backgroundImage: `url(${darkImage})`,
87
87
  backgroundSize: "cover",
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;
@@ -48,7 +48,7 @@ function AppBackground({
48
48
  lightImage && /* @__PURE__ */ jsx(
49
49
  "div",
50
50
  {
51
- className: "fixed inset-0 -z-10 transition-opacity duration-500 dark:opacity-0",
51
+ className: "fixed inset-0 z-[-10] transition-opacity duration-500 opacity-100 dark:opacity-0",
52
52
  style: {
53
53
  backgroundImage: `url(${lightImage})`,
54
54
  backgroundSize: "cover",
@@ -60,7 +60,7 @@ function AppBackground({
60
60
  darkImage && /* @__PURE__ */ jsx(
61
61
  "div",
62
62
  {
63
- className: "fixed inset-0 -z-10 transition-opacity duration-500 opacity-0 dark:opacity-100",
63
+ className: "fixed inset-0 z-[-10] transition-opacity duration-500 opacity-0 dark:opacity-100",
64
64
  style: {
65
65
  backgroundImage: `url(${darkImage})`,
66
66
  backgroundSize: "cover",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neoptocom/neopto-ui",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
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;
@@ -43,7 +44,7 @@ export function AppBackground({
43
44
  {/* Light mode background image */}
44
45
  {lightImage && (
45
46
  <div
46
- className="fixed inset-0 -z-10 transition-opacity duration-500 dark:opacity-0"
47
+ className="fixed inset-0 z-[-10] transition-opacity duration-500 opacity-100 dark:opacity-0"
47
48
  style={{
48
49
  backgroundImage: `url(${lightImage})`,
49
50
  backgroundSize: "cover",
@@ -56,7 +57,7 @@ export function AppBackground({
56
57
  {/* Dark mode background image */}
57
58
  {darkImage && (
58
59
  <div
59
- className="fixed inset-0 -z-10 transition-opacity duration-500 opacity-0 dark:opacity-100"
60
+ className="fixed inset-0 z-[-10] transition-opacity duration-500 opacity-0 dark:opacity-100"
60
61
  style={{
61
62
  backgroundImage: `url(${darkImage})`,
62
63
  backgroundSize: "cover",
@@ -1,5 +1,9 @@
1
1
  /* Tailwind v4+ core */
2
2
  @import "tailwindcss";
3
+
4
+ /* Configure dark mode to use class strategy */
5
+ @variant dark (&:where(.dark, .dark *));
6
+
3
7
  @import "./tokens.css";
4
8
 
5
9
  /* Ensure Tailwind scans your source & story files */