@alexgorbatchev/shadcn 0.0.130 → 0.0.132
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-rzdp3st2.js → chunk-9vndmsce.js} +36 -5
- package/dist/components/Accordion.d.ts +8 -2
- package/dist/components/OptionCardGroup.d.ts +5 -1
- package/dist/components/json-render/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/prototype.js +1 -1
- package/llms/components/layout/Accordion.md +13 -0
- package/package.json +1 -1
|
@@ -446,13 +446,20 @@ function AccordionItem2({ density, className, ...props }) {
|
|
|
446
446
|
...props
|
|
447
447
|
});
|
|
448
448
|
}
|
|
449
|
-
function AccordionTrigger2({
|
|
449
|
+
function AccordionTrigger2({
|
|
450
|
+
density,
|
|
451
|
+
className,
|
|
452
|
+
children,
|
|
453
|
+
chevronPlacement = "end",
|
|
454
|
+
...props
|
|
455
|
+
}) {
|
|
450
456
|
return /* @__PURE__ */ jsx5(AccordionPrimitive.Header, {
|
|
451
457
|
className: "flex",
|
|
452
458
|
children: /* @__PURE__ */ jsxs3(AccordionPrimitive.Trigger, {
|
|
453
459
|
"data-density": density,
|
|
454
460
|
"data-slot": "accordion-trigger",
|
|
455
|
-
|
|
461
|
+
"data-chevron-placement": chevronPlacement,
|
|
462
|
+
className: (state) => cn2("group/accordion-trigger relative flex flex-1 items-start rounded-sm border border-transparent py-2.5 text-start text-sm font-medium transition-colors outline-none hover:underline focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground", chevronPlacement === "end" ? "justify-between **:data-[slot=accordion-trigger-icon]:ms-auto" : "justify-start gap-2 **:data-[slot=accordion-trigger-icon]:mt-0.5", typeof className === "function" ? className(state) : className),
|
|
456
463
|
...props,
|
|
457
464
|
children: [
|
|
458
465
|
children,
|
|
@@ -631,8 +638,8 @@ function FoldToggle({ fold, descriptionId }) {
|
|
|
631
638
|
return null;
|
|
632
639
|
return /* @__PURE__ */ jsx6(Button2, {
|
|
633
640
|
type: "button",
|
|
634
|
-
variant: "
|
|
635
|
-
size: "
|
|
641
|
+
variant: "outline",
|
|
642
|
+
size: "xs",
|
|
636
643
|
"data-slot": "option-card-fold",
|
|
637
644
|
"aria-expanded": fold.isOpen,
|
|
638
645
|
"aria-controls": descriptionId,
|
|
@@ -660,7 +667,31 @@ function OptionCard2({
|
|
|
660
667
|
}) {
|
|
661
668
|
const ids = useOptionCardIds();
|
|
662
669
|
const fold = useFold(descriptionLines);
|
|
663
|
-
const
|
|
670
|
+
const radioMarker = /* @__PURE__ */ jsxs4("span", {
|
|
671
|
+
className: "flex items-start gap-1.5",
|
|
672
|
+
children: [
|
|
673
|
+
/* @__PURE__ */ jsx6("span", {
|
|
674
|
+
"data-slot": "option-card-radio",
|
|
675
|
+
className: "mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border border-input group-data-checked/option-card:border-primary",
|
|
676
|
+
children: /* @__PURE__ */ jsx6("span", {
|
|
677
|
+
className: "hidden size-2 rounded-full bg-primary group-data-checked/option-card:block forced-colors:bg-[Highlight]"
|
|
678
|
+
})
|
|
679
|
+
}),
|
|
680
|
+
marker ?? /* @__PURE__ */ jsx6("span", {
|
|
681
|
+
className: "before:content-[counter(option-card,lower-alpha)]"
|
|
682
|
+
})
|
|
683
|
+
]
|
|
684
|
+
});
|
|
685
|
+
const content = {
|
|
686
|
+
label,
|
|
687
|
+
description,
|
|
688
|
+
descriptionLines,
|
|
689
|
+
recommended,
|
|
690
|
+
recommendedLabel,
|
|
691
|
+
reason,
|
|
692
|
+
image,
|
|
693
|
+
marker: radioMarker
|
|
694
|
+
};
|
|
664
695
|
return /* @__PURE__ */ jsxs4("div", {
|
|
665
696
|
"data-slot": "option-card-item",
|
|
666
697
|
className: "relative min-w-0",
|
|
@@ -6,8 +6,14 @@ type AccordionProps = IAnalyticsProps & AccordionPrimitive.Root.Props & IDensity
|
|
|
6
6
|
declare function Accordion({ analytics, density, className, ...props }: AccordionProps): ReactElement;
|
|
7
7
|
type AccordionItemProps = AccordionPrimitive.Item.Props & IDensityProps;
|
|
8
8
|
declare function AccordionItem({ density, className, ...props }: AccordionItemProps): ReactElement;
|
|
9
|
-
type AccordionTriggerProps = AccordionPrimitive.Trigger.Props & IDensityProps
|
|
10
|
-
|
|
9
|
+
type AccordionTriggerProps = AccordionPrimitive.Trigger.Props & IDensityProps & {
|
|
10
|
+
/**
|
|
11
|
+
* Where the chevron sits: at the row's trailing edge (`end`, the default), or directly after the label (`inline`),
|
|
12
|
+
* so on a wide row it stays beside the words it expands instead of hundreds of pixels away.
|
|
13
|
+
*/
|
|
14
|
+
chevronPlacement?: "end" | "inline";
|
|
15
|
+
};
|
|
16
|
+
declare function AccordionTrigger({ density, className, children, chevronPlacement, ...props }: AccordionTriggerProps): ReactElement;
|
|
11
17
|
type AccordionContentProps = AccordionPrimitive.Panel.Props & IDensityProps;
|
|
12
18
|
declare function AccordionContent({ density, className, children, ...props }: AccordionContentProps): ReactElement;
|
|
13
19
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -39,7 +39,11 @@ interface IOptionCardContentProps {
|
|
|
39
39
|
marker?: ReactNode;
|
|
40
40
|
}
|
|
41
41
|
type OptionCardProps = Omit<RadioPrimitive.Root.Props, "children"> & IDensityProps & IOptionCardContentProps;
|
|
42
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* One option of an `OptionCardGroup`: a bordered card with a leading radio mark and letter, a bold label and a muted
|
|
44
|
+
* description. The radio mark shows the choice by shape as well as colour, and sets single choice apart from an
|
|
45
|
+
* `OptionCheckboxCard`'s checkbox.
|
|
46
|
+
*/
|
|
43
47
|
declare function OptionCard({ label, description, descriptionLines, recommended, recommendedLabel, reason, image, marker, density, className, ...props }: OptionCardProps): ReactElement;
|
|
44
48
|
type OptionCheckboxCardProps = Omit<CheckboxPrimitive.Root.Props, "children"> & IDensityProps & IOptionCardContentProps;
|
|
45
49
|
/**
|
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.132",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
|
@@ -247,3 +247,16 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
247
247
|
</Card>)
|
|
248
248
|
}
|
|
249
249
|
```
|
|
250
|
+
|
|
251
|
+
### InlineChevron
|
|
252
|
+
|
|
253
|
+
```tsx
|
|
254
|
+
{
|
|
255
|
+
render: () => (<Accordion className="w-[40rem]">
|
|
256
|
+
<AccordionItem value="badges">
|
|
257
|
+
<AccordionTrigger chevronPlacement="inline">Badge printing for the workshop</AccordionTrigger>
|
|
258
|
+
<AccordionContent>Their team name, printed on the front.</AccordionContent>
|
|
259
|
+
</AccordionItem>
|
|
260
|
+
</Accordion>)
|
|
261
|
+
}
|
|
262
|
+
```
|