@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.
@@ -446,13 +446,20 @@ function AccordionItem2({ density, className, ...props }) {
446
446
  ...props
447
447
  });
448
448
  }
449
- function AccordionTrigger2({ density, className, children, ...props }) {
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
- className: (state) => cn2("group/accordion-trigger relative flex flex-1 items-start justify-between 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]:ms-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground", typeof className === "function" ? className(state) : className),
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: "link",
635
- size: "sm",
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 content = { label, description, descriptionLines, recommended, recommendedLabel, reason, image, marker };
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
- declare function AccordionTrigger({ density, className, children, ...props }: AccordionTriggerProps): ReactElement;
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
- /** One option of an `OptionCardGroup`: a bordered card with a leading letter, a bold label and a muted description. */
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
  /**
@@ -26,7 +26,7 @@ import {
26
26
  PaginationPrevious2,
27
27
  PaginationNext2,
28
28
  PaginationEllipsis2
29
- } from "../../chunk-rzdp3st2.js";
29
+ } from "../../chunk-9vndmsce.js";
30
30
  import {
31
31
  MenuPopup,
32
32
  MenuItem2,
package/dist/index.js CHANGED
@@ -187,7 +187,7 @@ import {
187
187
  StatusTracker2,
188
188
  DashboardLayout2,
189
189
  BillingUsage2
190
- } from "./chunk-rzdp3st2.js";
190
+ } from "./chunk-9vndmsce.js";
191
191
  import {
192
192
  Combobox2,
193
193
  ComboboxValue2,
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.130",
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
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.130",
3
+ "version": "0.0.132",
4
4
  "description": "Sharp, monospace React components with compact and comfortable densities.",
5
5
  "license": "MIT",
6
6
  "repository": {