@alexgorbatchev/shadcn 0.0.136 → 0.0.138
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/{chunk-cnpasqar.js → chunk-qmgjztwg.js} +5 -9
- package/dist/components/OptionCardGroup.d.ts +4 -1
- package/dist/components/json-render/JsonForm.d.ts +4 -1
- package/dist/components/json-render/index.js +5 -4
- package/dist/index.js +1 -1
- package/dist/prototype.js +1 -1
- package/package.json +1 -1
|
@@ -496,7 +496,7 @@ import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
|
|
|
496
496
|
import { CheckIcon } from "lucide-react";
|
|
497
497
|
import { jsx as jsx6, jsxs as jsxs4, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
498
498
|
"use client";
|
|
499
|
-
var GROUP_CLASS = "grid w-full gap-2
|
|
499
|
+
var GROUP_CLASS = "grid w-full gap-2";
|
|
500
500
|
function OptionCardGroup2({ analytics, density, className, ...props }) {
|
|
501
501
|
const trackedOnValueChange = useAnalyticsCallback("OptionCardGroup", analytics, { name: "ui.change-request" }, props.onValueChange);
|
|
502
502
|
return /* @__PURE__ */ jsx6(RadioGroupPrimitive, {
|
|
@@ -517,7 +517,7 @@ function OptionCheckboxGroup2({ analytics, density, className, ...props }) {
|
|
|
517
517
|
onValueChange: trackedOnValueChange
|
|
518
518
|
});
|
|
519
519
|
}
|
|
520
|
-
var CARD_CLASS = "group/option-card grid w-full cursor-pointer grid-cols-[1.25rem_minmax(0,1fr)] items-start gap-x-2 rounded-md border border-input bg-card p-panel-sm text-start text-sm text-card-foreground transition-colors outline-none
|
|
520
|
+
var CARD_CLASS = "group/option-card grid w-full cursor-pointer grid-cols-[1.25rem_minmax(0,1fr)] items-start gap-x-2 rounded-md border border-input bg-card p-panel-sm text-start text-sm text-card-foreground transition-colors outline-none hover:bg-muted/40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid data-checked:border-primary data-checked:ring-1 data-checked:ring-primary forced-colors:data-checked:border-[color:Highlight] aria-invalid:not-data-checked:border-destructive data-disabled:cursor-not-allowed data-disabled:opacity-50 data-disabled:hover:bg-card data-readonly:cursor-default data-folding:pb-10";
|
|
521
521
|
function useFold(lines) {
|
|
522
522
|
const ref = useRef(null);
|
|
523
523
|
const [isOverflowing, setIsOverflowing] = useState(false);
|
|
@@ -573,9 +573,7 @@ function OptionCardContent({
|
|
|
573
573
|
"data-slot": "option-card-marker",
|
|
574
574
|
"aria-hidden": "true",
|
|
575
575
|
className: "font-mono leading-5 text-muted-foreground group-data-checked/option-card:text-primary forced-colors:group-data-checked/option-card:text-[color:Highlight]",
|
|
576
|
-
children: marker
|
|
577
|
-
className: "before:content-[counter(option-card,lower-alpha)]"
|
|
578
|
-
})
|
|
576
|
+
children: marker
|
|
579
577
|
}),
|
|
580
578
|
/* @__PURE__ */ jsxs4("span", {
|
|
581
579
|
className: "flex min-w-0 flex-col gap-1",
|
|
@@ -677,9 +675,7 @@ function OptionCard2({
|
|
|
677
675
|
className: "hidden size-2 rounded-full bg-primary group-data-checked/option-card:block forced-colors:bg-[Highlight]"
|
|
678
676
|
})
|
|
679
677
|
}),
|
|
680
|
-
marker
|
|
681
|
-
className: "before:content-[counter(option-card,lower-alpha)]"
|
|
682
|
-
})
|
|
678
|
+
marker
|
|
683
679
|
]
|
|
684
680
|
});
|
|
685
681
|
const content = {
|
|
@@ -703,7 +699,7 @@ function OptionCard2({
|
|
|
703
699
|
"data-folding": fold.isFoldable || undefined,
|
|
704
700
|
"aria-labelledby": recommended ? `${ids.label} ${ids.tag}` : ids.label,
|
|
705
701
|
"aria-describedby": getDescribedBy(ids, content),
|
|
706
|
-
className: (state) => cn2(CARD_CLASS, "grid-cols-[
|
|
702
|
+
className: (state) => cn2(CARD_CLASS, "grid-cols-[max-content_minmax(0,1fr)]", typeof className === "function" ? className(state) : className),
|
|
707
703
|
...props,
|
|
708
704
|
children: /* @__PURE__ */ jsx6(OptionCardContent, {
|
|
709
705
|
ids,
|
|
@@ -35,7 +35,10 @@ interface IOptionCardContentProps {
|
|
|
35
35
|
reason?: ReactNode;
|
|
36
36
|
/** A picture of the option shown above its label, such as a screenshot of a design choice. */
|
|
37
37
|
image?: ReactNode;
|
|
38
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* An optional short identifier beside the card's radio mark or checkbox. Cards carry no letter by default: the mark
|
|
40
|
+
* leads the card, and readers took letters for numbering written by the author.
|
|
41
|
+
*/
|
|
39
42
|
marker?: ReactNode;
|
|
40
43
|
}
|
|
41
44
|
type OptionCardProps = Omit<RadioPrimitive.Root.Props, "children"> & IDensityProps & IOptionCardContentProps;
|
|
@@ -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;
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
PaginationPrevious2,
|
|
27
27
|
PaginationNext2,
|
|
28
28
|
PaginationEllipsis2
|
|
29
|
-
} from "../../chunk-
|
|
29
|
+
} from "../../chunk-qmgjztwg.js";
|
|
30
30
|
import {
|
|
31
31
|
MenuPopup,
|
|
32
32
|
MenuItem2,
|
|
@@ -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",
|
package/dist/index.js
CHANGED
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.138",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact, comfortable, and touch densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|