@alexgorbatchev/shadcn 0.0.135 → 0.0.137
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.
|
@@ -83,7 +83,10 @@ export interface IJsonFieldLabelProps {
|
|
|
83
83
|
id?: string;
|
|
84
84
|
htmlFor?: string;
|
|
85
85
|
}
|
|
86
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* The field's "Required" and "Default" tags, in that order; nothing when neither applies. "Required" asks for an
|
|
88
|
+
* answer, so a read-only value never carries it.
|
|
89
|
+
*/
|
|
87
90
|
export declare function JsonFieldTags({ field }: {
|
|
88
91
|
field: IJsonField;
|
|
89
92
|
}): ReactElement | null;
|
|
@@ -333,11 +333,12 @@ function useJsonField({ path, label, checks, ownErrors = [] }) {
|
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
335
|
function JsonFieldTags({ field }) {
|
|
336
|
-
|
|
336
|
+
const isRequiredShown = field.isRequired && field.mode !== "values";
|
|
337
|
+
if (!isRequiredShown && !field.isDefault)
|
|
337
338
|
return null;
|
|
338
339
|
return /* @__PURE__ */ jsxs2(Fragment, {
|
|
339
340
|
children: [
|
|
340
|
-
|
|
341
|
+
isRequiredShown && /* @__PURE__ */ jsx5(Badge2, {
|
|
341
342
|
variant: "outline",
|
|
342
343
|
children: "Required"
|
|
343
344
|
}),
|
|
@@ -350,7 +351,7 @@ function JsonFieldTags({ field }) {
|
|
|
350
351
|
});
|
|
351
352
|
}
|
|
352
353
|
function JsonFieldLabel({ field, id, htmlFor }) {
|
|
353
|
-
if (!field.label && !field.isRequired && !field.isDefault)
|
|
354
|
+
if (!field.label && !(field.isRequired && field.mode !== "values") && !field.isDefault)
|
|
354
355
|
return null;
|
|
355
356
|
return /* @__PURE__ */ jsxs2("div", {
|
|
356
357
|
"data-slot": "json-field-label",
|
|
@@ -295,7 +295,12 @@ function TreeItem({
|
|
|
295
295
|
className: "flex shrink-0 items-center",
|
|
296
296
|
children: marker
|
|
297
297
|
}),
|
|
298
|
-
|
|
298
|
+
descriptionLabel && /* @__PURE__ */ jsx("span", {
|
|
299
|
+
id: descriptionId,
|
|
300
|
+
hidden: true,
|
|
301
|
+
children: descriptionLabel
|
|
302
|
+
}),
|
|
303
|
+
(description !== undefined && description !== null || actions) && /* @__PURE__ */ jsxs("div", {
|
|
299
304
|
className: cn2("flex shrink-0 items-center gap-1 text-xs tabular-nums", faded),
|
|
300
305
|
children: [
|
|
301
306
|
description !== undefined && description !== null && /* @__PURE__ */ jsx("span", {
|
|
@@ -304,11 +309,6 @@ function TreeItem({
|
|
|
304
309
|
"data-slot": "tree-item-description",
|
|
305
310
|
children: description
|
|
306
311
|
}),
|
|
307
|
-
descriptionLabel && /* @__PURE__ */ jsx("span", {
|
|
308
|
-
id: descriptionId,
|
|
309
|
-
hidden: true,
|
|
310
|
-
children: descriptionLabel
|
|
311
|
-
}),
|
|
312
312
|
actions && /* @__PURE__ */ jsx("div", {
|
|
313
313
|
"aria-hidden": "true",
|
|
314
314
|
"data-slot": "tree-item-actions",
|
package/dist/prototype.js
CHANGED
|
@@ -2051,7 +2051,7 @@ var program = new Command;
|
|
|
2051
2051
|
// package.json
|
|
2052
2052
|
var package_default = {
|
|
2053
2053
|
name: "@alexgorbatchev/shadcn",
|
|
2054
|
-
version: "0.0.
|
|
2054
|
+
version: "0.0.137",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact, comfortable, and touch densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|