@alexgorbatchev/shadcn 0.0.90 → 0.0.92

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.
@@ -14,12 +14,13 @@ import {
14
14
  // src/components/Toolbar.tsx
15
15
  import { Toolbar as ToolbarPrimitive } from "@base-ui/react/toolbar";
16
16
  import { jsx } from "react/jsx-runtime";
17
- function Toolbar2({ density, className, ...props }) {
17
+ function Toolbar2({ density, className, variant = "framed", ...props }) {
18
18
  return /* @__PURE__ */ jsx(ToolbarPrimitive.Root, {
19
19
  "data-density": density,
20
20
  "data-slot": "toolbar",
21
21
  "data-scroll": "none",
22
- className: (state) => cn2("flex min-w-0 gap-control-gap rounded-sm border border-border bg-card p-1 text-card-foreground data-[orientation=vertical]:flex-col", typeof className === "function" ? className(state) : className),
22
+ "data-variant": variant,
23
+ className: (state) => cn2("flex min-w-0 gap-control-gap rounded-sm text-card-foreground data-[orientation=vertical]:flex-col", variant === "framed" && "border border-border bg-card p-1", typeof className === "function" ? className(state) : className),
23
24
  ...props
24
25
  });
25
26
  }
@@ -68,11 +69,12 @@ function ToolbarInput2({
68
69
  ...analyticsInput
69
70
  });
70
71
  }
71
- function ToolbarGroup2({ density, className, ...props }) {
72
+ function ToolbarGroup2({ density, className, wrap = false, ...props }) {
72
73
  return /* @__PURE__ */ jsx(ToolbarPrimitive.Group, {
73
74
  "data-density": density,
74
75
  "data-slot": "toolbar-group",
75
- className: (state) => cn2("flex items-center gap-control-gap data-[orientation=vertical]:flex-col", typeof className === "function" ? className(state) : className),
76
+ "data-wrap": wrap ? "" : undefined,
77
+ className: (state) => cn2("flex items-center gap-control-gap data-[orientation=vertical]:flex-col", wrap && "flex-wrap justify-start data-[orientation=vertical]:flex-row", typeof className === "function" ? className(state) : className),
76
78
  ...props
77
79
  });
78
80
  }
@@ -2,10 +2,21 @@ import type { IAnalyticsProps } from "../analytics/types.js";
2
2
  import type { ReactElement } from "react";
3
3
  import type { IDensityProps } from "../density/types.js";
4
4
  import { Toolbar as ToolbarPrimitive } from "@base-ui/react/toolbar";
5
- declare function Toolbar({ density, className, ...props }: ToolbarPrimitive.Root.Props & IDensityProps): ReactElement;
5
+ type ToolbarProps = ToolbarPrimitive.Root.Props & IDensityProps & {
6
+ /** `framed` (the default) draws a card around the controls; `plain` lays them out inside another surface. */
7
+ variant?: "framed" | "plain";
8
+ };
9
+ declare function Toolbar({ density, className, variant, ...props }: ToolbarProps): ReactElement;
6
10
  declare function ToolbarButton({ analytics, density, className, ...props }: ToolbarPrimitive.Button.Props & IDensityProps & IAnalyticsProps): ReactElement;
7
11
  declare function ToolbarLink({ analytics, density, className, ...props }: ToolbarPrimitive.Link.Props & IDensityProps & IAnalyticsProps): ReactElement;
8
12
  declare function ToolbarInput({ analytics, density, className, ...props }: ToolbarPrimitive.Input.Props & IDensityProps & IAnalyticsProps): ReactElement;
9
- declare function ToolbarGroup({ density, className, ...props }: ToolbarPrimitive.Group.Props & IDensityProps): ReactElement;
13
+ type ToolbarGroupProps = ToolbarPrimitive.Group.Props & IDensityProps & {
14
+ /**
15
+ * Lets the group's controls wrap onto further lines instead of overflowing, as a set of chips does. They run in
16
+ * rows even inside a vertical toolbar, whose arrow keys still move through them in order.
17
+ */
18
+ wrap?: boolean;
19
+ };
20
+ declare function ToolbarGroup({ density, className, wrap, ...props }: ToolbarGroupProps): ReactElement;
10
21
  declare function ToolbarSeparator({ density, className, ...props }: ToolbarPrimitive.Separator.Props & IDensityProps): ReactElement;
11
22
  export { Toolbar, ToolbarButton, ToolbarLink, ToolbarInput, ToolbarGroup, ToolbarSeparator };
@@ -15,7 +15,7 @@ import {
15
15
  ToolbarButton2,
16
16
  ToolbarGroup2,
17
17
  ToolbarSeparator2
18
- } from "../../chunk-x6ed6smh.js";
18
+ } from "../../chunk-tcbjvdem.js";
19
19
  import"../../chunk-5mydsjp3.js";
20
20
 
21
21
  // src/components/editor/RichTextEditor.tsx
@@ -151,7 +151,7 @@ import"../../chunk-m4geb1s5.js";
151
151
  import"../../chunk-9ecf92s6.js";
152
152
  import"../../chunk-fe33dx54.js";
153
153
  import"../../chunk-tcefvfr8.js";
154
- import"../../chunk-x6ed6smh.js";
154
+ import"../../chunk-tcbjvdem.js";
155
155
  import {
156
156
  Carousel2,
157
157
  CarouselContent2,
package/dist/index.js CHANGED
@@ -224,7 +224,7 @@ import {
224
224
  ToolbarInput2,
225
225
  ToolbarGroup2,
226
226
  ToolbarSeparator2
227
- } from "./chunk-x6ed6smh.js";
227
+ } from "./chunk-tcbjvdem.js";
228
228
  import {
229
229
  Slider2
230
230
  } from "./chunk-7cq1s2ey.js";
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.90",
2054
+ version: "0.0.92",
2055
2055
  description: "Sharp, monospace React components with compact and comfortable densities.",
2056
2056
  license: "MIT",
2057
2057
  repository: {
@@ -87,3 +87,17 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
87
87
  </Toolbar>)
88
88
  }
89
89
  ```
90
+
91
+ ### PlainWrapping
92
+
93
+ ```tsx
94
+ {
95
+ render: (args) => (<div className="w-48">
96
+ <Toolbar {...args} aria-label="Tags" orientation="vertical" variant="plain">
97
+ <ToolbarGroup aria-label="Vibe" wrap>
98
+ {["Dark", "Bright", "Hypnotic", "Warm", "Deep"].map((name) => (<ToolbarButton key={name}>{name}</ToolbarButton>))}
99
+ </ToolbarGroup>
100
+ </Toolbar>
101
+ </div>)
102
+ }
103
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.90",
3
+ "version": "0.0.92",
4
4
  "description": "Sharp, monospace React components with compact and comfortable densities.",
5
5
  "license": "MIT",
6
6
  "repository": {