@theweekendprojects/emvb-daisyui 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +106 -2
- package/licenses/daisyui-MIT.txt +3 -0
- package/package.json +55 -4
- package/src/catalog/basic.ts +407 -0
- package/src/catalog/class-names.ts +623 -0
- package/src/catalog/countdown.ts +392 -0
- package/src/catalog/data-display.ts +563 -0
- package/src/catalog/forms.ts +433 -0
- package/src/catalog/index.ts +77 -0
- package/src/catalog/interactive.ts +567 -0
- package/src/catalog/layout-marketing.ts +641 -0
- package/src/catalog/missing-complex.ts +430 -0
- package/src/catalog/missing-primitives.ts +409 -0
- package/src/catalog/navigation.ts +438 -0
- package/src/catalog/value-class.ts +20 -0
- package/src/compatibility/index.ts +104 -0
- package/src/compound/editor.ts +299 -0
- package/src/compound/index.ts +157 -0
- package/src/conformance/cli.ts +9 -0
- package/src/conformance/compile.ts +77 -0
- package/src/conformance/index.ts +4 -0
- package/src/conformance/manifest.ts +39 -0
- package/src/conformance/official-inventory.ts +135 -0
- package/src/conformance/report-cli.ts +5 -0
- package/src/conformance/report.ts +59 -0
- package/src/conformance/verify-css.ts +22 -0
- package/src/extension/class-token.ts +11 -0
- package/src/extension/classes.ts +636 -0
- package/src/extension/collect-classes.ts +73 -0
- package/src/extension/content.ts +93 -0
- package/src/extension/daisy.css +12397 -0
- package/src/extension/daisy.js +1 -0
- package/src/extension/elements.ts +262 -0
- package/src/extension/index.ts +39 -0
- package/src/extension/to-output.ts +113 -0
- package/src/generator/artifacts.ts +81 -0
- package/src/generator/class-names.ts +35 -0
- package/src/generator/cli.ts +21 -0
- package/src/generator/generate.ts +122 -0
- package/src/generator/index.ts +2 -0
- package/src/generator/write-class-names.ts +10 -0
- package/src/index.ts +12 -0
- package/src/render/classes.ts +48 -0
- package/src/render/href.ts +19 -0
- package/src/render/index.ts +3 -0
- package/src/render/provider.ts +37 -0
- package/src/renderer.ts +6 -0
- package/src/runtime/browser.ts +11 -0
- package/src/runtime/index.ts +41 -0
- package/src/test-support.ts +13 -0
- package/src/themes/index.ts +72 -0
- package/src/types.ts +116 -0
- package/src/validation/index.ts +153 -0
- package/src/verified/primitives.ts +62 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export type DaisyOfficialCategory =
|
|
2
|
+
| "Actions"
|
|
3
|
+
| "Data display"
|
|
4
|
+
| "Navigation"
|
|
5
|
+
| "Feedback"
|
|
6
|
+
| "Data input"
|
|
7
|
+
| "Layout"
|
|
8
|
+
| "Mockup"
|
|
9
|
+
| "Effects";
|
|
10
|
+
export type DaisyPaletteIcon =
|
|
11
|
+
| "accordion"
|
|
12
|
+
| "alert"
|
|
13
|
+
| "avatar"
|
|
14
|
+
| "badge"
|
|
15
|
+
| "breadcrumbs"
|
|
16
|
+
| "button"
|
|
17
|
+
| "calendar"
|
|
18
|
+
| "card"
|
|
19
|
+
| "carousel"
|
|
20
|
+
| "chat"
|
|
21
|
+
| "checkbox"
|
|
22
|
+
| "code"
|
|
23
|
+
| "divider"
|
|
24
|
+
| "drawer"
|
|
25
|
+
| "dropdown"
|
|
26
|
+
| "form"
|
|
27
|
+
| "image"
|
|
28
|
+
| "input"
|
|
29
|
+
| "layout"
|
|
30
|
+
| "link"
|
|
31
|
+
| "list"
|
|
32
|
+
| "loading"
|
|
33
|
+
| "menu"
|
|
34
|
+
| "modal"
|
|
35
|
+
| "navigation"
|
|
36
|
+
| "progress"
|
|
37
|
+
| "radio"
|
|
38
|
+
| "range"
|
|
39
|
+
| "rating"
|
|
40
|
+
| "select"
|
|
41
|
+
| "stack"
|
|
42
|
+
| "stats"
|
|
43
|
+
| "table"
|
|
44
|
+
| "tabs"
|
|
45
|
+
| "text"
|
|
46
|
+
| "textarea"
|
|
47
|
+
| "toggle"
|
|
48
|
+
| "tooltip";
|
|
49
|
+
export interface OfficialDaisyComponent {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
category: DaisyOfficialCategory;
|
|
53
|
+
icon: DaisyPaletteIcon;
|
|
54
|
+
}
|
|
55
|
+
const item = (
|
|
56
|
+
id: string,
|
|
57
|
+
name: string,
|
|
58
|
+
category: DaisyOfficialCategory,
|
|
59
|
+
icon: DaisyPaletteIcon,
|
|
60
|
+
): OfficialDaisyComponent => ({ id, name, category, icon });
|
|
61
|
+
|
|
62
|
+
/** Pinned official daisyUI 5.7.50 inventory. Update only with an official-version upgrade. */
|
|
63
|
+
export const OFFICIAL_DAISYUI_COMPONENTS = [
|
|
64
|
+
item("accordion", "Accordion", "Data display", "accordion"),
|
|
65
|
+
item("alert", "Alert", "Feedback", "alert"),
|
|
66
|
+
item("aura", "Aura", "Effects", "layout"),
|
|
67
|
+
item("avatar", "Avatar", "Data display", "avatar"),
|
|
68
|
+
item("badge", "Badge", "Data display", "badge"),
|
|
69
|
+
item("breadcrumbs", "Breadcrumbs", "Navigation", "breadcrumbs"),
|
|
70
|
+
item("button", "Button", "Actions", "button"),
|
|
71
|
+
item("calendar", "Calendar", "Data input", "calendar"),
|
|
72
|
+
item("card", "Card", "Data display", "card"),
|
|
73
|
+
item("carousel", "Carousel", "Data display", "carousel"),
|
|
74
|
+
item("chat-bubble", "Chat bubble", "Data display", "chat"),
|
|
75
|
+
item("checkbox", "Checkbox", "Data input", "checkbox"),
|
|
76
|
+
item("collapse", "Collapse", "Data display", "accordion"),
|
|
77
|
+
item("countdown", "Countdown", "Data display", "stats"),
|
|
78
|
+
item("diff", "Diff", "Data display", "layout"),
|
|
79
|
+
item("divider", "Divider", "Layout", "divider"),
|
|
80
|
+
item("dock", "Dock", "Navigation", "navigation"),
|
|
81
|
+
item("drawer", "Drawer sidebar", "Layout", "drawer"),
|
|
82
|
+
item("dropdown", "Dropdown", "Actions", "dropdown"),
|
|
83
|
+
item("fab", "FAB / Speed Dial", "Actions", "button"),
|
|
84
|
+
item("fieldset", "Fieldset", "Data input", "form"),
|
|
85
|
+
item("file-input", "File Input", "Data input", "input"),
|
|
86
|
+
item("filter", "Filter", "Data input", "radio"),
|
|
87
|
+
item("footer", "Footer", "Navigation", "navigation"),
|
|
88
|
+
item("hero", "Hero", "Layout", "layout"),
|
|
89
|
+
item("hover-3d", "Hover 3D Card", "Effects", "card"),
|
|
90
|
+
item("hover-gallery", "Hover Gallery", "Effects", "image"),
|
|
91
|
+
item("indicator", "Indicator", "Layout", "badge"),
|
|
92
|
+
item("input", "Text Input", "Data input", "input"),
|
|
93
|
+
item("join", "Join (group items)", "Layout", "layout"),
|
|
94
|
+
item("kbd", "Kbd", "Data display", "code"),
|
|
95
|
+
item("label", "Label", "Data input", "text"),
|
|
96
|
+
item("link", "Link", "Navigation", "link"),
|
|
97
|
+
item("list", "List", "Data display", "list"),
|
|
98
|
+
item("loading", "Loading", "Feedback", "loading"),
|
|
99
|
+
item("mask", "Mask", "Layout", "image"),
|
|
100
|
+
item("megamenu", "Megamenu", "Navigation", "menu"),
|
|
101
|
+
item("menu", "Menu", "Navigation", "menu"),
|
|
102
|
+
item("browser-mockup", "Browser mockup", "Mockup", "layout"),
|
|
103
|
+
item("code-mockup", "Code mockup", "Mockup", "code"),
|
|
104
|
+
item("phone-mockup", "Phone mockup", "Mockup", "layout"),
|
|
105
|
+
item("window-mockup", "Window mockup", "Mockup", "layout"),
|
|
106
|
+
item("modal", "Modal", "Actions", "modal"),
|
|
107
|
+
item("navbar", "Navbar", "Navigation", "navigation"),
|
|
108
|
+
item("otp", "OTP", "Data input", "input"),
|
|
109
|
+
item("pagination", "Pagination", "Navigation", "navigation"),
|
|
110
|
+
item("progress", "Progress", "Feedback", "progress"),
|
|
111
|
+
item("radial-progress", "Radial progress", "Feedback", "progress"),
|
|
112
|
+
item("radio", "Radio", "Data input", "radio"),
|
|
113
|
+
item("range", "Range slider", "Data input", "range"),
|
|
114
|
+
item("rating", "Rating", "Data input", "rating"),
|
|
115
|
+
item("select", "Select", "Data input", "select"),
|
|
116
|
+
item("skeleton", "Skeleton", "Feedback", "loading"),
|
|
117
|
+
item("stack", "Stack", "Layout", "stack"),
|
|
118
|
+
item("stats", "Stat", "Data display", "stats"),
|
|
119
|
+
item("status", "Status", "Data display", "badge"),
|
|
120
|
+
item("steps", "Steps", "Navigation", "navigation"),
|
|
121
|
+
item("swap", "Swap", "Actions", "toggle"),
|
|
122
|
+
item("tabs", "Tabs", "Navigation", "tabs"),
|
|
123
|
+
item("table", "Table", "Data display", "table"),
|
|
124
|
+
item("text-rotate", "Text Rotate", "Effects", "text"),
|
|
125
|
+
item("textarea", "Textarea", "Data input", "textarea"),
|
|
126
|
+
item("theme-controller", "Theme Controller", "Data input", "toggle"),
|
|
127
|
+
item("timeline", "Timeline", "Data display", "list"),
|
|
128
|
+
item("toast", "Toast", "Feedback", "alert"),
|
|
129
|
+
item("toggle", "Toggle", "Data input", "toggle"),
|
|
130
|
+
item("tooltip", "Tooltip", "Feedback", "tooltip"),
|
|
131
|
+
item("validator", "Validator", "Data input", "form"),
|
|
132
|
+
] as const;
|
|
133
|
+
|
|
134
|
+
export const officialDaisyComponent = (id: string): OfficialDaisyComponent | undefined =>
|
|
135
|
+
OFFICIAL_DAISYUI_COMPONENTS.find((entry) => entry.id === id);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { writeFile } from "node:fs/promises";
|
|
2
|
+
import { catalogSupportReport } from "./report.ts";
|
|
3
|
+
const output = process.argv[2] ?? "generated/daisyui-support-report.json";
|
|
4
|
+
await writeFile(output, `${JSON.stringify(catalogSupportReport(), null, 2)}\n`);
|
|
5
|
+
console.log(`Wrote ${output}`);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { DAISY_COMPONENT_CATALOG } from "../catalog/index.ts";
|
|
2
|
+
import { DAISYUI_CONFORMANCE, isVerifiedDaisyComponent } from "./manifest.ts";
|
|
3
|
+
import { OFFICIAL_DAISYUI_COMPONENTS } from "./official-inventory.ts";
|
|
4
|
+
|
|
5
|
+
export type CatalogSupportStatus = "verified" | "experimental" | "missing";
|
|
6
|
+
export interface CatalogSupportEntry {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
category: string;
|
|
10
|
+
icon: string;
|
|
11
|
+
status: CatalogSupportStatus;
|
|
12
|
+
fields: string[];
|
|
13
|
+
rootClass?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CatalogSupportReport {
|
|
16
|
+
daisyuiVersion: string;
|
|
17
|
+
tailwindcssVersion: string;
|
|
18
|
+
generatedAt: string;
|
|
19
|
+
officialTotal: number;
|
|
20
|
+
implemented: number;
|
|
21
|
+
verified: number;
|
|
22
|
+
experimental: number;
|
|
23
|
+
missing: number;
|
|
24
|
+
components: CatalogSupportEntry[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function catalogSupportReport(now = new Date()): CatalogSupportReport {
|
|
28
|
+
const local = new Map(DAISY_COMPONENT_CATALOG.map((definition) => [definition.id, definition]));
|
|
29
|
+
const components = OFFICIAL_DAISYUI_COMPONENTS.map((official): CatalogSupportEntry => {
|
|
30
|
+
const definition = local.get(official.id);
|
|
31
|
+
return {
|
|
32
|
+
id: official.id,
|
|
33
|
+
label: official.name,
|
|
34
|
+
category: official.category,
|
|
35
|
+
icon: official.icon,
|
|
36
|
+
status: !definition
|
|
37
|
+
? "missing"
|
|
38
|
+
: isVerifiedDaisyComponent(official.id)
|
|
39
|
+
? "verified"
|
|
40
|
+
: "experimental",
|
|
41
|
+
fields: definition?.fields.map((field) => field.key) ?? [],
|
|
42
|
+
rootClass: definition?.rootClass,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
const verified = components.filter((item) => item.status === "verified").length;
|
|
46
|
+
const experimental = components.filter((item) => item.status === "experimental").length;
|
|
47
|
+
const missing = components.filter((item) => item.status === "missing").length;
|
|
48
|
+
return {
|
|
49
|
+
daisyuiVersion: DAISYUI_CONFORMANCE.daisyuiVersion,
|
|
50
|
+
tailwindcssVersion: DAISYUI_CONFORMANCE.tailwindcssVersion,
|
|
51
|
+
generatedAt: now.toISOString(),
|
|
52
|
+
officialTotal: components.length,
|
|
53
|
+
implemented: verified + experimental,
|
|
54
|
+
verified,
|
|
55
|
+
experimental,
|
|
56
|
+
missing,
|
|
57
|
+
components,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DAISYUI_CONFORMANCE } from "./manifest.ts";
|
|
2
|
+
|
|
3
|
+
export interface CssConformanceResult {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
checked: number;
|
|
6
|
+
missing: string[];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const selectorPattern = (selector: string): RegExp =>
|
|
10
|
+
new RegExp(`${selector.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?![A-Za-z0-9_-])`);
|
|
11
|
+
|
|
12
|
+
/** Verifies required selectors in CSS actually compiled by the pinned official Tailwind+daisyUI packages. */
|
|
13
|
+
export function verifyCompiledCss(css: string): CssConformanceResult {
|
|
14
|
+
const missing = DAISYUI_CONFORMANCE.requiredSelectors.filter(
|
|
15
|
+
(selector) => !selectorPattern(selector).test(css),
|
|
16
|
+
);
|
|
17
|
+
return {
|
|
18
|
+
ok: missing.length === 0,
|
|
19
|
+
checked: DAISYUI_CONFORMANCE.requiredSelectors.length,
|
|
20
|
+
missing,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const PREFIX = "daisy-";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* One catalog class as the extension writes it. The catalog uses plain names (`btn`, `[--value:70]`).
|
|
5
|
+
* daisyUI with a prefix renames its own CSS variables as well as its classes, so its rules read
|
|
6
|
+
* `--daisy-value`, not `--value`. A per-instance variable class is renamed to match, or the rule
|
|
7
|
+
* never sees it and a countdown or a radial stays at 0.
|
|
8
|
+
*/
|
|
9
|
+
export function prefixClassToken(token: string): string {
|
|
10
|
+
return PREFIX + token.replace(/^\[--([a-z][a-z0-9-]*):/, `[--${PREFIX}$1:`);
|
|
11
|
+
}
|