@okjt/dashboard 0.5.0 → 0.6.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/dist/AdminInput.js +5 -2
- package/package.json +2 -2
package/dist/AdminInput.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useId } from "react";
|
|
3
|
+
import { useComponentDefaults } from "./DashboardProvider.js";
|
|
3
4
|
const baseInputClasses = "w-full px-4 py-2 rounded-lg border border-tone-200 bg-[var(--okjt-field-bg,transparent)] text-[color:var(--okjt-field-text,inherit)] focus:outline-none focus:ring-2 focus:ring-accent/20 focus:border-accent transition-colors";
|
|
4
5
|
function makeField(Tag, extraClasses, displayName) {
|
|
5
|
-
const Field = forwardRef(function Field2({ label, error, bare = false, className = "", id, children, ...props }, ref) {
|
|
6
|
+
const Field = forwardRef(function Field2({ label, error, bare = false, className = "", id, children, baseClassName, ...props }, ref) {
|
|
7
|
+
const { classNames } = useComponentDefaults("Field", {});
|
|
8
|
+
const base = baseClassName ?? classNames?.[Tag] ?? `${baseInputClasses}${extraClasses ? ` ${extraClasses}` : ""}`;
|
|
6
9
|
const generatedId = useId();
|
|
7
10
|
const inputId = id || generatedId;
|
|
8
11
|
const errorId = `${inputId}-error`;
|
|
@@ -13,7 +16,7 @@ function makeField(Tag, extraClasses, displayName) {
|
|
|
13
16
|
id: inputId,
|
|
14
17
|
"aria-invalid": error ? true : void 0,
|
|
15
18
|
"aria-describedby": error && !bare ? errorId : void 0,
|
|
16
|
-
className: `${
|
|
19
|
+
className: `${base} ${error ? "border-red-400" : ""} ${className}`,
|
|
17
20
|
...props,
|
|
18
21
|
children
|
|
19
22
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okjt/dashboard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Dashboard pages for OKJTech projects: page layout, hero, summary cards, floating toolbar with search and filters, side panel, lists, bulk actions, one way to save, and working together: presence, version history, sharing; the dashboard shell, sign-in pages and account menu",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"test": "node build.mjs && vitest run"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@okjt/ui": "^0.
|
|
26
|
+
"@okjt/ui": "^0.4.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@tanstack/react-query": ">=5",
|