@alexgorbatchev/shadcn 0.0.195 → 0.0.197

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.
@@ -8,7 +8,7 @@ import {
8
8
  Alert2,
9
9
  AlertTitle2,
10
10
  AlertDescription2
11
- } from "./chunk-zxxvw5b9.js";
11
+ } from "./chunk-n3br443n.js";
12
12
  import {
13
13
  mono
14
14
  } from "./chunk-fgmcbtyt.js";
@@ -13,23 +13,33 @@ var alertVariants = cva([
13
13
  ].join(" "), {
14
14
  variants: {
15
15
  variant: {
16
- default: "bg-card text-card-foreground",
17
- success: "bg-success text-success-foreground *:data-[slot=alert-description]:text-success-foreground",
18
- warning: "bg-warning text-warning-foreground *:data-[slot=alert-description]:text-warning-foreground",
19
- info: "bg-card text-primary *:data-[slot=alert-description]:text-primary/90",
20
- destructive: "border-destructive/50 bg-destructive-soft/50 text-destructive *:data-[slot=alert-description]:text-destructive *:[svg]:text-current"
16
+ default: "text-card-foreground [--alert-tone:var(--color-foreground)]",
17
+ success: "text-success [--alert-tone:var(--color-success)] *:data-[slot=alert-description]:text-current",
18
+ warning: "text-warning [--alert-tone:var(--color-warning)] *:data-[slot=alert-description]:text-current",
19
+ info: "text-primary [--alert-tone:var(--color-primary)] *:data-[slot=alert-description]:text-current",
20
+ destructive: "text-destructive [--alert-tone:var(--color-destructive)] *:data-[slot=alert-description]:text-current"
21
+ },
22
+ appearance: {
23
+ tint: "border-(--alert-tone)/40 bg-(--alert-tone)/8",
24
+ outline: "border-(--alert-tone) bg-transparent"
21
25
  }
22
26
  },
27
+ compoundVariants: [
28
+ { variant: "default", appearance: "tint", className: "border-border bg-(--alert-tone)/4" },
29
+ { variant: "default", appearance: "outline", className: "border-border" }
30
+ ],
23
31
  defaultVariants: {
24
- variant: "default"
32
+ variant: "default",
33
+ appearance: "tint"
25
34
  }
26
35
  });
27
- function Alert2({ density, className, variant, ...props }) {
36
+ function Alert2({ density, className, variant, appearance, ...props }) {
28
37
  return /* @__PURE__ */ jsx("div", {
29
38
  "data-density": density,
30
39
  "data-slot": "alert",
40
+ "data-appearance": appearance ?? "tint",
31
41
  role: "alert",
32
- className: cn2(alertVariants({ variant }), className),
42
+ className: cn2(alertVariants({ variant, appearance }), className),
33
43
  ...props
34
44
  });
35
45
  }
@@ -44,7 +44,7 @@ import {
44
44
  Alert2,
45
45
  AlertTitle2,
46
46
  AlertDescription2
47
- } from "./chunk-zxxvw5b9.js";
47
+ } from "./chunk-n3br443n.js";
48
48
  import {
49
49
  Dialog2,
50
50
  DialogClose2,
@@ -544,7 +544,7 @@ function OptionCheckboxGroup2({
544
544
  onValueChange: trackedOnValueChange
545
545
  });
546
546
  }
547
- var CARD_CLASS = "group/option-card grid h-full w-full cursor-pointer grid-cols-[1.25rem_minmax(0,1fr)] content-start 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";
547
+ var CARD_CLASS = "group/option-card grid h-full w-full cursor-pointer grid-cols-[max-content_minmax(0,1fr)] content-start 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";
548
548
  var CARD_CONTROL_SELECTOR = '[data-slot="option-card"], [data-slot="option-checkbox-card"]';
549
549
  function useFold(lines) {
550
550
  const ref = useRef(null);
@@ -732,7 +732,7 @@ function OptionCard2({
732
732
  "data-folding": fold.isFoldable || undefined,
733
733
  "aria-labelledby": recommended ? `${ids.label} ${ids.tag}` : ids.label,
734
734
  "aria-describedby": getDescribedBy(ids, content),
735
- className: (state) => cn2(CARD_CLASS, "grid-cols-[max-content_minmax(0,1fr)]", typeof className === "function" ? className(state) : className),
735
+ className: (state) => cn2(CARD_CLASS, typeof className === "function" ? className(state) : className),
736
736
  ...props,
737
737
  children: /* @__PURE__ */ jsx6(OptionCardContent, {
738
738
  ids,
@@ -3,9 +3,10 @@ import type { ComponentProps, ReactElement } from "react";
3
3
  import { type VariantProps } from "class-variance-authority";
4
4
  declare const alertVariants: (props?: ({
5
5
  variant?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
6
+ appearance?: "outline" | "tint" | null | undefined;
6
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
8
  type AlertProps = ComponentProps<"div"> & VariantProps<typeof alertVariants> & IDensityProps;
8
- declare function Alert({ density, className, variant, ...props }: AlertProps): ReactElement;
9
+ declare function Alert({ density, className, variant, appearance, ...props }: AlertProps): ReactElement;
9
10
  type AlertTitleProps = ComponentProps<"div"> & IDensityProps;
10
11
  declare function AlertTitle({ density, className, ...props }: AlertTitleProps): ReactElement;
11
12
  type AlertDescriptionProps = ComponentProps<"div"> & IDensityProps;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  GuardrailNotice2
3
- } from "../../../chunk-ddp4e9s0.js";
4
- import"../../../chunk-zxxvw5b9.js";
3
+ } from "../../../chunk-231fr3v5.js";
4
+ import"../../../chunk-n3br443n.js";
5
5
  import"../../../chunk-n63meq6q.js";
6
6
  import"../../../chunk-x90xmrba.js";
7
7
  import"../../../chunk-jpvw9xqy.js";
@@ -297,10 +297,10 @@ import {
297
297
  import {
298
298
  GitHubIcon2
299
299
  } from "../../chunk-4bjqbky7.js";
300
- import"../../chunk-zxxvw5b9.js";
300
+ import"../../chunk-n3br443n.js";
301
301
  import {
302
302
  GuardrailNotice2
303
- } from "../../chunk-ddp4e9s0.js";
303
+ } from "../../chunk-231fr3v5.js";
304
304
  import {
305
305
  ImageRoot2,
306
306
  ImagePreview2,
@@ -7,7 +7,7 @@ import {
7
7
  Alert2,
8
8
  AlertTitle2,
9
9
  AlertDescription2
10
- } from "../../chunk-zxxvw5b9.js";
10
+ } from "../../chunk-n3br443n.js";
11
11
  import"../../chunk-e6hk39ev.js";
12
12
  import"../../chunk-x90xmrba.js";
13
13
  import"../../chunk-jpvw9xqy.js";
@@ -26,7 +26,7 @@ import {
26
26
  PaginationPrevious2,
27
27
  PaginationNext2,
28
28
  PaginationEllipsis2
29
- } from "../../chunk-7ymh5yqk.js";
29
+ } from "../../chunk-vj43efr4.js";
30
30
  import {
31
31
  MenuPopup,
32
32
  MenuItem2,
@@ -39,7 +39,7 @@ import {
39
39
  Alert2,
40
40
  AlertTitle2,
41
41
  AlertDescription2
42
- } from "../../chunk-zxxvw5b9.js";
42
+ } from "../../chunk-n3br443n.js";
43
43
  import {
44
44
  Dialog2,
45
45
  DialogContent2,
package/dist/index.js CHANGED
@@ -188,7 +188,7 @@ import {
188
188
  DashboardLayout2,
189
189
  BillingUsage2,
190
190
  SelectionAction2
191
- } from "./chunk-7ymh5yqk.js";
191
+ } from "./chunk-vj43efr4.js";
192
192
  import {
193
193
  statusDotVariants2,
194
194
  StatusDot2
@@ -324,7 +324,7 @@ import {
324
324
  AlertTitle2,
325
325
  AlertDescription2,
326
326
  AlertAction2
327
- } from "./chunk-zxxvw5b9.js";
327
+ } from "./chunk-n3br443n.js";
328
328
  import {
329
329
  FieldSet2,
330
330
  FieldLegend2,
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.195",
2054
+ version: "0.0.197",
2055
2055
  description: "Sharp, monospace React components with compact, comfortable, and touch densities.",
2056
2056
  license: "MIT",
2057
2057
  repository: {
@@ -26,7 +26,10 @@ Alert
26
26
  ## Story controls
27
27
 
28
28
  ```tsx
29
- { variant: { control: "select", options: ["default", "destructive", "success", "warning", "info"] } }
29
+ {
30
+ variant: { control: "select", options: ["default", "destructive", "success", "warning", "info"] },
31
+ appearance: { control: "select", options: ["tint", "outline"] },
32
+ }
30
33
  ```
31
34
 
32
35
  ## Default render
@@ -132,6 +135,28 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
132
135
  }
133
136
  ```
134
137
 
138
+ ### Outline
139
+
140
+ ```tsx
141
+ {
142
+ args: { appearance: "outline", variant: "success" }
143
+ }
144
+ ```
145
+
146
+ ### TintAndOutlineScale
147
+
148
+ ```tsx
149
+ {
150
+ render: () => (<div className="flex w-80 flex-col gap-2">
151
+ {appearances.map((appearance) => variants.map((variant) => (<Alert key={`${appearance}-${variant}`} variant={variant} appearance={appearance} data-variant={variant}>
152
+ <CircleAlertIcon />
153
+ <AlertTitle>Changes saved</AlertTitle>
154
+ <AlertDescription>Your project is up to date.</AlertDescription>
155
+ </Alert>)))}
156
+ </div>)
157
+ }
158
+ ```
159
+
135
160
  ### IconCentredOnText
136
161
 
137
162
  ```tsx
@@ -292,6 +292,23 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
292
292
  }
293
293
  ```
294
294
 
295
+ ### MixedChoiceAlignment
296
+
297
+ ```tsx
298
+ {
299
+ render: () => (<div className="flex w-96 flex-col gap-4">
300
+ <OptionCardGroup aria-label="Strategy">
301
+ <OptionCard value="rolling" label="Rolling update" description="One instance at a time."/>
302
+ <OptionCard value="blue-green" label="Blue-green" description="Switch traffic at once." recommended/>
303
+ </OptionCardGroup>
304
+ <OptionCheckboxGroup aria-label="Teams">
305
+ <OptionCheckboxCard value="support" label="Support" description="Answers customers."/>
306
+ <OptionCheckboxCard value="finance" label="Finance"/>
307
+ </OptionCheckboxGroup>
308
+ </div>)
309
+ }
310
+ ```
311
+
295
312
  ### CompactProseDescription
296
313
 
297
314
  ```tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.195",
3
+ "version": "0.0.197",
4
4
  "description": "Sharp, monospace React components with compact, comfortable, and touch densities.",
5
5
  "license": "MIT",
6
6
  "repository": {