shadcn-settings 0.1.154 → 0.1.156
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 +4 -0
- package/dist/index.mjs +10 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
</p>
|
|
21
21
|
<!-- template-git-repo:badges:end -->
|
|
22
22
|
|
|
23
|
+
<!-- skills:install:start -->
|
|
24
|
+
**🤖 Agent skill** — `npx skills@latest add https://github.com/OpenSourceAGI/qwksearch-research-agent --skill shadcn-settings` ([what it covers](../../skills/shadcn-settings/SKILL.md))
|
|
25
|
+
<!-- skills:install:end -->
|
|
26
|
+
|
|
23
27
|
# shadcn-settings
|
|
24
28
|
|
|
25
29
|
[](https://codecov.io/gh/OpenSourceAGI/qwksearch-research-agent)
|
package/dist/index.mjs
CHANGED
|
@@ -7,12 +7,11 @@ import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
|
7
7
|
import { Check as o, ChevronDown as s, ChevronUp as c, Eye as l, EyeOff as u, Loader2 as d } from "lucide-react";
|
|
8
8
|
import * as f from "@radix-ui/react-select";
|
|
9
9
|
import * as p from "@radix-ui/react-switch";
|
|
10
|
-
|
|
10
|
+
// src/lib/utils.ts
|
|
11
11
|
function m(...e) {
|
|
12
12
|
return n(t(e));
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
//#region src/components/field-shell.tsx
|
|
14
|
+
// src/components/field-shell.tsx
|
|
16
15
|
var h = r("scroll-mt-4 transition-colors", {
|
|
17
16
|
variants: { variant: {
|
|
18
17
|
card: "rounded-xl border border-border bg-card/80 p-4 lg:p-6",
|
|
@@ -75,8 +74,7 @@ function v({ anchorId: e, title: t, description: n, links: r, titleAddon: o, cla
|
|
|
75
74
|
})
|
|
76
75
|
});
|
|
77
76
|
}
|
|
78
|
-
|
|
79
|
-
//#region src/lib/use-commit.ts
|
|
77
|
+
// src/lib/use-commit.ts
|
|
80
78
|
function y(t) {
|
|
81
79
|
let [n, r] = e.useState(!1), i = e.useRef(!0);
|
|
82
80
|
return e.useEffect(() => (i.current = !0, () => {
|
|
@@ -97,8 +95,7 @@ function y(t) {
|
|
|
97
95
|
}, [t])
|
|
98
96
|
};
|
|
99
97
|
}
|
|
100
|
-
|
|
101
|
-
//#region src/components/fields/text-field.tsx
|
|
98
|
+
// src/components/fields/text-field.tsx
|
|
102
99
|
var b = "w-full rounded-lg border border-input bg-background px-3 py-2 pr-10 !text-xs text-foreground placeholder:text-muted-foreground transition-colors focus-visible:outline-none focus-visible:border-ring disabled:cursor-not-allowed disabled:opacity-60 lg:px-4 lg:py-3 lg:!text-[13px]";
|
|
103
100
|
function x({ field: t, value: n, onChange: r, onCommit: o, variant: s, anchorId: c, titleAddon: f, classNames: p, disabled: h, multiline: g = !1, secret: _ = !1 }) {
|
|
104
101
|
let { committing: x, commit: S } = y(o), [C, w] = e.useState(!1), T = typeof t.default == "string" ? t.default : "", E = n ?? T, [D, O] = e.useState(E), [k, A] = e.useState(E);
|
|
@@ -161,8 +158,7 @@ function w(e) {
|
|
|
161
158
|
multiline: !0
|
|
162
159
|
});
|
|
163
160
|
}
|
|
164
|
-
|
|
165
|
-
//#region src/components/ui/select.tsx
|
|
161
|
+
// src/components/ui/select.tsx
|
|
166
162
|
var T = f.Root, E = f.Group, D = f.Value, O = e.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ a(f.Trigger, {
|
|
167
163
|
ref: r,
|
|
168
164
|
className: m("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm", "placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring", "disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", e),
|
|
@@ -212,8 +208,7 @@ var M = e.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */
|
|
|
212
208
|
}), /* @__PURE__ */ i(f.ItemText, { children: t })]
|
|
213
209
|
}));
|
|
214
210
|
M.displayName = f.Item.displayName;
|
|
215
|
-
|
|
216
|
-
//#region src/components/fields/select-field.tsx
|
|
211
|
+
// src/components/fields/select-field.tsx
|
|
217
212
|
function N({ field: e, value: t, onChange: n, onCommit: r, variant: o, anchorId: s, titleAddon: c, classNames: l, disabled: u }) {
|
|
218
213
|
let { committing: d, commit: f } = y(r), p = typeof e.default == "string" ? e.default : void 0, m = t ?? p, h = (e.options ?? []).filter((e) => e.value !== "");
|
|
219
214
|
return /* @__PURE__ */ i(v, {
|
|
@@ -240,8 +235,7 @@ function N({ field: e, value: t, onChange: n, onCommit: r, variant: o, anchorId:
|
|
|
240
235
|
})
|
|
241
236
|
});
|
|
242
237
|
}
|
|
243
|
-
|
|
244
|
-
//#region src/components/ui/switch.tsx
|
|
238
|
+
// src/components/ui/switch.tsx
|
|
245
239
|
var P = e.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ i(p.Root, {
|
|
246
240
|
ref: n,
|
|
247
241
|
className: m("peer inline-flex h-[1.15rem] w-8 shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-sm transition-colors outline-none", "focus-visible:ring-2 focus-visible:ring-ring/50", "data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", "disabled:cursor-not-allowed disabled:opacity-50", e),
|
|
@@ -249,8 +243,7 @@ var P = e.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ i(p.Root, {
|
|
|
249
243
|
children: /* @__PURE__ */ i(p.Thumb, { className: m("pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform", "data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0") })
|
|
250
244
|
}));
|
|
251
245
|
P.displayName = "Switch";
|
|
252
|
-
|
|
253
|
-
//#region src/components/fields/switch-field.tsx
|
|
246
|
+
// src/components/fields/switch-field.tsx
|
|
254
247
|
function F({ field: e, value: t, onChange: n, onCommit: r, variant: a, anchorId: o, titleAddon: s, classNames: c, disabled: l }) {
|
|
255
248
|
let { committing: u, commit: d } = y(r), f = t === !0 || t === "true" || t === void 0 && e.default === !0;
|
|
256
249
|
return /* @__PURE__ */ i(v, {
|
|
@@ -272,8 +265,7 @@ function F({ field: e, value: t, onChange: n, onCommit: r, variant: a, anchorId:
|
|
|
272
265
|
})
|
|
273
266
|
});
|
|
274
267
|
}
|
|
275
|
-
|
|
276
|
-
//#region src/components/settings-field.tsx
|
|
268
|
+
// src/components/settings-field.tsx
|
|
277
269
|
var I = {
|
|
278
270
|
string: S,
|
|
279
271
|
password: C,
|
|
@@ -301,8 +293,7 @@ function R({ renderers: t, ...n }) {
|
|
|
301
293
|
}), [t]), a = r[n.field.type] ?? r.unknown ?? L;
|
|
302
294
|
return /* @__PURE__ */ i(a, { ...n });
|
|
303
295
|
}
|
|
304
|
-
|
|
305
|
-
//#region src/components/settings-list.tsx
|
|
296
|
+
// src/components/settings-list.tsx
|
|
306
297
|
function z({ fields: e, getValue: t, onCommit: n, onChange: r, variant: a, renderers: o, anchorId: s, renderTitleAddon: c, classNames: l, className: u }) {
|
|
307
298
|
return /* @__PURE__ */ i("div", {
|
|
308
299
|
className: m("flex-1 space-y-6 overflow-y-auto px-6 py-6", u),
|
|
@@ -319,5 +310,4 @@ function z({ fields: e, getValue: t, onCommit: n, onChange: r, variant: a, rende
|
|
|
319
310
|
}, e.key))
|
|
320
311
|
});
|
|
321
312
|
}
|
|
322
|
-
//#endregion
|
|
323
313
|
export { v as FieldShell, C as PasswordField, T as Select, j as SelectContent, N as SelectField, E as SelectGroup, M as SelectItem, O as SelectTrigger, D as SelectValue, R as SettingsField, z as SettingsList, S as StringField, P as Switch, F as SwitchField, w as TextareaField, I as builtinRenderers, m as cn, y as useCommit };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shadcn-settings",
|
|
3
3
|
"description": "Prop-driven, schema-based settings form renderer built on shadcn/ui — string, password, textarea, select and switch field variants with card, inline and ghost layouts",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.156",
|
|
5
5
|
"author": "vtempest",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|