@alexgorbatchev/shadcn 0.0.117 → 0.0.119
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.
|
@@ -20,6 +20,13 @@ type TreeItemProps<T> = useRender.ComponentProps<"div", TreeItemState> & IDensit
|
|
|
20
20
|
* starts where the icon was; a tree whose disclosure already tells folders from leaves needs no icon.
|
|
21
21
|
*/
|
|
22
22
|
hasIcon?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Calls attention to the row with the `warning` tone: a light tint and a warning-coloured start icon, such as a
|
|
25
|
+
* lightning bolt for something live. A selected row keeps the selection background and adds a warning ring instead.
|
|
26
|
+
* The tint stays light enough for coloured markers and muted text on the row to keep 4.5:1. Pair it with words in
|
|
27
|
+
* `descriptionLabel`, so the meaning never rests on colour.
|
|
28
|
+
*/
|
|
29
|
+
tone?: "default" | "warning";
|
|
23
30
|
endEnhancer?: ReactNode;
|
|
24
31
|
expandOn?: "click" | "doubleClick" | "disclosure";
|
|
25
32
|
isEditing?: boolean;
|
|
@@ -99,5 +106,5 @@ export declare function TreeItemDot({ count, className }: ITreeItemDotProps): Re
|
|
|
99
106
|
* Registered tree row; compose menus with render, put counts in `description` and pointer shortcuts in `actions`.
|
|
100
107
|
* `endEnhancer` holds controls that must stay keyboard reachable on their own.
|
|
101
108
|
*/
|
|
102
|
-
export declare function TreeItem<T>({ analytics, item, children, startEnhancer, endEnhancer, description, descriptionLabel, actions, expandOn, isEditing, isDropTarget, isDimmed, isUnread, hasIcon, leading, marker, linkProps, dropHint, density, render, ref, ...props }: TreeItemProps<T>): ReactElement;
|
|
109
|
+
export declare function TreeItem<T>({ analytics, item, children, startEnhancer, endEnhancer, description, descriptionLabel, actions, expandOn, isEditing, isDropTarget, isDimmed, isUnread, hasIcon, tone, leading, marker, linkProps, dropHint, density, render, ref, ...props }: TreeItemProps<T>): ReactElement;
|
|
103
110
|
export type { TreeItemProps };
|
|
@@ -129,6 +129,7 @@ function TreeItem({
|
|
|
129
129
|
isDimmed = false,
|
|
130
130
|
isUnread = false,
|
|
131
131
|
hasIcon = true,
|
|
132
|
+
tone = "default",
|
|
132
133
|
leading,
|
|
133
134
|
marker,
|
|
134
135
|
linkProps,
|
|
@@ -186,7 +187,7 @@ function TreeItem({
|
|
|
186
187
|
children: [
|
|
187
188
|
(hasIcon || startEnhancer) && /* @__PURE__ */ jsx("span", {
|
|
188
189
|
"aria-hidden": "true",
|
|
189
|
-
className: "flex shrink-0 [&>svg]:size-4",
|
|
190
|
+
className: cn2("flex shrink-0 [&>svg]:size-4", tone === "warning" && "text-warning"),
|
|
190
191
|
children: startEnhancer ?? (item.isFolder() ? isExpanded ? /* @__PURE__ */ jsx(FolderOpenIcon, {}) : /* @__PURE__ */ jsx(FolderIcon, {}) : /* @__PURE__ */ jsx(FileIcon, {}))
|
|
191
192
|
}),
|
|
192
193
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -256,7 +257,7 @@ function TreeItem({
|
|
|
256
257
|
onDragStart: undefined
|
|
257
258
|
} : {},
|
|
258
259
|
style: { paddingInlineStart: `${item.getItemMeta().level * (item.getTree().getConfig().indent ?? 20) + 8}px` },
|
|
259
|
-
className: cn2("relative flex min-h-control min-w-0 cursor-default items-center gap-2 rounded-sm py-1 pr-2 text-sm outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring", (isSelected || isDropTarget || isInsideTarget) && "bg-accent text-accent-foreground", isDimmed && "group/tree-item"),
|
|
260
|
+
className: cn2("relative flex min-h-control min-w-0 cursor-default items-center gap-2 rounded-sm py-1 pr-2 text-sm outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring", (isSelected || isDropTarget || isInsideTarget) && "bg-accent text-accent-foreground", tone === "warning" && (isSelected || isDropTarget || isInsideTarget ? "ring-1 ring-warning ring-inset" : "bg-warning/8 hover:bg-warning/10"), isDimmed && "group/tree-item"),
|
|
260
261
|
children: /* @__PURE__ */ jsxs(Fragment, {
|
|
261
262
|
children: [
|
|
262
263
|
item.isFolder() && expandOn === "disclosure" ? /* @__PURE__ */ jsx(Button2, {
|
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.119",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|