vaderjs-daisyui 0.0.4 → 0.0.6

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 (31) hide show
  1. package/Components/Actions/Button/index.tsx +4 -4
  2. package/Components/Actions/Dropdown/index.tsx +1 -1
  3. package/Components/Actions/Fab/index.tsx +1 -1
  4. package/Components/Actions/Modal/index.tsx +3 -0
  5. package/Components/Actions/Swap/index.tsx +4 -4
  6. package/Components/Actions/ThemeController/index.tsx +1 -1
  7. package/Components/Data/Display/Accordion/index.tsx +2 -2
  8. package/Components/Data/Display/Avatar/index.tsx +1 -1
  9. package/Components/Data/Display/Badge/index.tsx +1 -1
  10. package/Components/Data/Display/Card/index.tsx +5 -8
  11. package/Components/Data/Display/Carousel/index.tsx +1 -1
  12. package/Components/Data/Display/ChatBubble/index.tsx +1 -1
  13. package/Components/Data/Display/Collapse/index.tsx +1 -1
  14. package/Components/Data/Display/Countdown/index.tsx +1 -1
  15. package/Components/Data/Display/Diff/index.tsx +1 -1
  16. package/Components/Data/Display/Hover/Card/index.tsx +4 -2
  17. package/Components/Data/Display/Hover/Gallery/index.tsx +1 -1
  18. package/Components/Data/Display/Keyboard/index.tsx +1 -1
  19. package/Components/Data/Display/List/index.tsx +1 -1
  20. package/Components/Data/Display/Stat/index.tsx +1 -1
  21. package/Components/Data/Display/Table/index.tsx +1 -1
  22. package/Components/Data/Display/TextRotate/index.tsx +1 -1
  23. package/Components/Data/Display/Timeline/index.tsx +1 -1
  24. package/Components/Navigation/BreadCrumbs/index.tsx +1 -1
  25. package/Components/Navigation/Doc/index.tsx +1 -1
  26. package/Components/Navigation/Link/index.tsx +1 -1
  27. package/LICENSE +21 -0
  28. package/README.md +9 -0
  29. package/index.ts +8 -7
  30. package/package.json +2 -3
  31. package/jsconfig.json +0 -16
@@ -1,4 +1,4 @@
1
- const { createElement, component, VNode } = window.Vader;
1
+ import { component, createElement, VNode } from "vaderjs";
2
2
 
3
3
  export type ButtonProps = {
4
4
  color?: "neutral" | "primary" | "secondary" | "accent" | "info" | "success" | "warning" | "error";
@@ -9,11 +9,11 @@ export type ButtonProps = {
9
9
  disabled?: boolean;
10
10
  className?: string;
11
11
  onClick?: (e: MouseEvent) => void;
12
- children?:VNode |VNode[] | string;
12
+ children?: VNode | VNode[] | string;
13
13
  ariaLabel?: string;
14
14
  };
15
-
16
- const Button = component<ButtonProps>((props):VNode => {
15
+
16
+ const Button = component<ButtonProps>((props): VNode => {
17
17
  const {
18
18
  color,
19
19
  style,
@@ -1,4 +1,4 @@
1
- const { component, createElement, useState, useRef, useOnClickOutside, useEffect } = window.Vader
1
+ import { component, createElement, useState, useRef, useOnClickOutside, useEffect } from "vaderjs";
2
2
 
3
3
  export type DropdownProps = {
4
4
  method?: "details" | "popover" | "focus";
@@ -1,5 +1,5 @@
1
1
  // Fab.tsx
2
- const { component, createElement, useState, useRef, useEffect } = window.Vader
2
+ import { component, createElement, useState, useRef, useEffect } from "vaderjs";
3
3
 
4
4
  interface FabProps {
5
5
  mainIcon: any;
@@ -14,6 +14,7 @@ interface ModalProps {
14
14
  onClose?: () => void;
15
15
  title?: string;
16
16
  children?:VNode |VNode[] | string;
17
+ modalid?: string; // for accessibility and testing
17
18
  size?: string; // DaisyUI sizes: w-11/12 max-w-md etc.
18
19
  placement?: "top" | "middle" | "bottom";
19
20
  horizontal?: "start" | "center" | "end"; // horizontal alignment
@@ -49,6 +50,7 @@ export const Modal = component((props: ModalProps) => {
49
50
  horizontal = "center",
50
51
  backdrop = true,
51
52
  openClass = "",
53
+ modalid = "vader-modal",
52
54
  } = props;
53
55
 
54
56
  let modalRef: HTMLDivElement | null = null;
@@ -117,6 +119,7 @@ export const Modal = component((props: ModalProps) => {
117
119
  {
118
120
  className: `modal modal-open ${placementClass} ${openClass}`,
119
121
  "aria-modal": "true",
122
+ id: modalid,
120
123
  role: "dialog",
121
124
  },
122
125
  backdrop &&
@@ -1,9 +1,9 @@
1
- const { useState, component, createElement } = window.Vader
1
+ import { useState, component, createElement, VNode } from "vaderjs";
2
2
 
3
3
  export type SwapProps = {
4
- on?:VNode |VNode[] | string;
5
- off?:VNode |VNode[] | string;
6
- indeterminate?:VNode |VNode[] | string;
4
+ on?: VNode | VNode[] | string;
5
+ off?: VNode | VNode[] | string;
6
+ indeterminate?: VNode | VNode[] | string;
7
7
  active?: boolean; // Controlled toggle
8
8
  rotate?: boolean;
9
9
  flip?: boolean;
@@ -1,4 +1,4 @@
1
- const { component, createElement, useState } = window.Vader
1
+ import { component, createElement, useState, VNode } from "vaderjs";
2
2
 
3
3
  export type ThemeOption = {
4
4
  value: string;
@@ -1,7 +1,7 @@
1
- const { component, createElement } = window.Vader
1
+ import { component, createElement, VNode } from "vaderjs";
2
2
 
3
3
  export type AccordionItem = {
4
- title: string | VNode;
4
+ title: string | VNode;
5
5
  content: string | VNode;
6
6
  value?: string; // for radio inputs
7
7
  open?: boolean; // for details
@@ -1,4 +1,4 @@
1
- const { component, createElement, VNode } = window.Vader
1
+ import { component, createElement, VNode } from "vaderjs";
2
2
 
3
3
  export type AvatarProps = {
4
4
  src?: string;
@@ -1,4 +1,4 @@
1
- const { component, createElement, VNode } = window.Vader
1
+ import { component, createElement, VNode } from "vaderjs";
2
2
 
3
3
  export type BadgeProps = {
4
4
  children?: string | VNode;
@@ -1,5 +1,5 @@
1
- const { component, createElement } = window.Vader
2
- import { Badge, BadgeProps } from "../Badge/index";
1
+ import { component, createElement, VNode } from "vaderjs";
2
+ import { Badge, BadgeProps } from "../Badge";
3
3
 
4
4
  export type CardProps = {
5
5
  title?: string | VNode;
@@ -8,11 +8,10 @@ export type CardProps = {
8
8
  figure?: VNode;
9
9
  size?: "xs" | "sm" | "md" | "lg" | "xl";
10
10
  style?: "border" | "dash";
11
- side?: boolean;
12
- imageFull?: boolean;
13
- center?: boolean;
11
+ side?: boolean; // card-side
12
+ imageFull?: boolean; // image-full
13
+ center?: boolean; // center content
14
14
  className?: string;
15
- children?: VNode | VNode[]; // ✅ ADD THIS
16
15
  };
17
16
 
18
17
  export const Card = component((props: CardProps) => {
@@ -27,7 +26,6 @@ export const Card = component((props: CardProps) => {
27
26
  imageFull,
28
27
  center,
29
28
  className,
30
- children
31
29
  } = props;
32
30
 
33
31
  const classes = ["card"];
@@ -50,7 +48,6 @@ export const Card = component((props: CardProps) => {
50
48
  { className: bodyClasses.join(" ") },
51
49
  title ? (typeof title === "string" ? createElement("h2", { className: "card-title" }, title) : title) : null,
52
50
  body ? (typeof body === "string" ? createElement("p", {}, body) : body) : null,
53
- children ? (Array.isArray(children) ? children : [children]) : null, // ✅
54
51
  actions ? (Array.isArray(actions) ? actions.map(a => a) : actions) : null
55
52
  )
56
53
  );
@@ -1,5 +1,5 @@
1
1
  // Carousel.tsx
2
- const { component, createElement } = window.Vader
2
+ import { component, createElement } from "vaderjs";
3
3
 
4
4
  interface CarouselProps {
5
5
  images: string[];
@@ -1,5 +1,5 @@
1
1
  // ChatBubbles.ts
2
- const { component, createElement } = window.Vader
2
+ import { component, createElement } from "vaderjs";
3
3
 
4
4
  export type ChatColor =
5
5
  | "neutral"
@@ -1,5 +1,5 @@
1
1
  // Collapse.ts
2
- const { component, createElement } = window.Vader
2
+ import { component, createElement } from "vaderjs";
3
3
 
4
4
  export interface CollapseItem {
5
5
  id: string | number;
@@ -1,5 +1,5 @@
1
1
  // Countdown.ts
2
- const { component, createElement, useState, useEffect, useRef } = window.Vader
2
+ import { component, createElement, useState, useEffect, useRef } from "vaderjs";
3
3
 
4
4
  export interface CountdownUnit {
5
5
  label?: string;
@@ -1,4 +1,4 @@
1
- const { component, createElement, useRef, useEffect} = window.Vader
1
+ import { component, createElement, useRef, useEffect } from "vaderjs";
2
2
 
3
3
  export interface DiffProps {
4
4
  item1: any;
@@ -1,4 +1,4 @@
1
- const { component, createElement } = window.Vader
1
+ import { component, createElement } from "vaderjs";
2
2
 
3
3
  export interface Hover3DProps {
4
4
  children: any;
@@ -16,7 +16,9 @@ const Hover3D = component(
16
16
  {
17
17
  class: `hover-3d ${className}`.trim(),
18
18
  ...(Tag === "a" && href ? { href } : {}),
19
- },
19
+ },
20
+
21
+ // ✅ IMPORTANT: spread children
20
22
  children,
21
23
 
22
24
  // required 8 hover zones
@@ -1,5 +1,5 @@
1
1
  // HoverGallery.ts
2
- const { component, createElement } = window.Vader
2
+ import { component, createElement } from "vaderjs";
3
3
 
4
4
  export interface HoverGalleryProps {
5
5
  images: (string | JSX.Element)[];
@@ -1,5 +1,5 @@
1
1
  // Kbd.ts
2
- const { component, createElement } = window.Vader
2
+ import { component, createElement } from "vaderjs";
3
3
 
4
4
  export type KbdSize = "xs" | "sm" | "md" | "lg" | "xl";
5
5
 
@@ -1,5 +1,5 @@
1
1
  // List.ts
2
- const { component, createElement } = window.Vader
2
+ import { component, createElement } from "vaderjs";
3
3
 
4
4
  /* -------------------------------------------------------
5
5
  * List (container)
@@ -1,4 +1,4 @@
1
- const { component, createElement } = window.Vader
1
+ import { component, createElement } from "vaderjs";
2
2
 
3
3
  /* ================================
4
4
  TYPES
@@ -1,4 +1,4 @@
1
- const { createElement } = window.Vader
1
+ import { createElement } from "vaderjs";
2
2
 
3
3
  export interface TableProps {
4
4
  zebra?: boolean;
@@ -1,4 +1,4 @@
1
- const { component, createElement } = window.Vader
1
+ import { component, createElement, VNode } from "vaderjs";
2
2
 
3
3
  export type TextRotateProps = {
4
4
  words: string[] | VNode[];
@@ -1,4 +1,4 @@
1
- const { component, createElement } = window.Vader
1
+ import { component, createElement, VNode } from "vaderjs";
2
2
 
3
3
  export type TimelineItem = {
4
4
  id?: string | number;
@@ -1,4 +1,4 @@
1
- const { component, createElement } = window.Vader
1
+ import { component, createElement, VNode } from "vaderjs";
2
2
 
3
3
  export type BreadcrumbItem = {
4
4
  label: string | VNode;
@@ -1,4 +1,4 @@
1
- const { component, createElement } = window.Vader
1
+ import { component, createElement, VNode } from "vaderjs";
2
2
 
3
3
  export type DockItem = {
4
4
  label?: string;
@@ -1,4 +1,4 @@
1
- const { component, createElement } = window.Vader
1
+ import { component, createElement, VNode } from "vaderjs";
2
2
 
3
3
  export type LinkProps = {
4
4
  href?: string;
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Malik Whitten
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -31,6 +31,15 @@ export default {
31
31
  ```
32
32
  ---
33
33
 
34
+ ## Required CSS File
35
+ Ensure you have a `root.css` in the root of your project directory so tailwind knows how to build
36
+
37
+ ```css
38
+ /*root.css*/
39
+ @import "tailwindcss";
40
+ @plugin "daisyui";
41
+ ```
42
+
34
43
  ## 🔌 **Quick Setup**
35
44
 
36
45
 
package/index.ts CHANGED
@@ -97,17 +97,18 @@ function tailwindInstalled(): boolean {
97
97
  */
98
98
  function ensureStyles(inputPath: string) {
99
99
  const outputPath = path.join(PROJECT_ROOT, "public/styles.css");
100
-
100
+ console.log(`Ensuring styles: input=${inputPath}, output=${outputPath}`);
101
101
  if (!fs.existsSync(outputPath)) {
102
- if (!fs.existsSync(inputPath)) {
102
+
103
+ fs.copyFileSync(inputPath, outputPath);
104
+ }
105
+ if (!fs.existsSync(inputPath)) {
103
106
  fs.writeFileSync(
104
107
  inputPath,
105
- `@tailwind base;\n@tailwind components;\n@tailwind utilities;\n@import "daisyui";`
108
+ `@import "tailwindcss"; \n @plugin "daisyui";`
106
109
  );
107
110
  console.log(`Created default root.css at ${inputPath}`);
108
111
  }
109
- fs.copyFileSync(inputPath, outputPath);
110
- }
111
112
  }
112
113
 
113
114
  /**
@@ -188,7 +189,7 @@ async function createPlugin() {
188
189
 
189
190
  // Run Tailwind build
190
191
  console.log(`🚀 Running TailwindCSS build for ${platform}...`);
191
- const output = path.join(PROJECT_ROOT, "public/styles.css");
192
+ const output = path.join(PROJECT_ROOT, "public/styles.css");
192
193
  await runTailwind(rootCss, output);
193
194
 
194
195
  // Inject link into HTML
@@ -205,4 +206,4 @@ async function createPlugin() {
205
206
  }
206
207
 
207
208
  // Export as default function that creates the plugin
208
- export default createPlugin;
209
+ export default await createPlugin();
package/package.json CHANGED
@@ -2,9 +2,8 @@
2
2
  "name": "vaderjs-daisyui",
3
3
  "description": "Lightweight React-like components wrapping DaisyUI classes. Zero dependencies, fully typed, and ready to ship.",
4
4
  "dependencies": {
5
- "vaderjs-types": "^1.0.0"
5
+ "vaderjs": "latest"
6
6
  },
7
- "types": "./vader.d.ts",
8
7
  "devDependencies": {
9
8
  "@tailwindcss/cli": "^4.1.18",
10
9
  "autoprefixer": "^10.4.23",
@@ -12,5 +11,5 @@
12
11
  "postcss": "^8.5.6",
13
12
  "tailwindcss": "^4.1.18"
14
13
  },
15
- "version": "0.0.4"
14
+ "version": "0.0.6"
16
15
  }
package/jsconfig.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "jsx": "react",
4
- "jsxFactory": "Vader.createElement",
5
- "baseUrl": ".",
6
- "target": "es2024",
7
- "paths": {
8
- "vader": ["./global.d.ts"],
9
- "vader/*": ["./global.d.ts"]
10
- }
11
- },
12
- "include": [
13
- "Components/**/*",
14
- "*.d.ts"
15
- ]
16
- }