@alexgorbatchev/shadcn 0.0.71 → 0.0.72
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/README.md
CHANGED
|
@@ -452,7 +452,7 @@ Keep preferred widths separate from the table's rendered sizing atom. In `onFitW
|
|
|
452
452
|
|
|
453
453
|
For nested layouts, compose `ActionsMenuTrigger`, `ActionsMenuContextTarget`, and `ActionsMenuContextContent` explicitly inside `ActionsMenu`. The dropdown trigger owns its local native dropdown root and popup; the context target and content share an independent context root. A tree row can use `TreeItem render={<ActionsMenuContextTarget />}` and put the trigger in its action slot. For a table row, render the context target as the actual `tr`, then place the dropdown trigger and context content inside a `td`: native popup portals insert focus guards at their declaration, which must remain valid table children.
|
|
454
454
|
|
|
455
|
-
`TreeItem linkProps` places the registered tree item, roving focus, and native drag handlers on an anchor. Pass `href` and anchor events directly, or compose a router link through `linkProps.render`. The outer `render` and `ref` remain available for row overlays; disclosure and `endEnhancer` controls remain siblings of the link. Enter and modified clicks retain native link behavior, while tree arrows retain navigation and expansion behavior. Optional `dropHint={{ content, open, side }}` displays caller-controlled drag feedback without adding a focus target.
|
|
455
|
+
`TreeItem linkProps` places the registered tree item, roving focus, and native drag handlers on an anchor. Pass `href` and anchor events directly, or compose a router link through `linkProps.render`. The outer `render` and `ref` remain available for row overlays; disclosure and `endEnhancer` controls remain siblings of the link. Enter and modified clicks retain native link behavior, while tree arrows retain navigation and expansion behavior. Optional `dropHint={{ content, open, side }}` displays caller-controlled drag feedback without adding a focus target. `isDimmed` fades a settled row, such as completed work, to 70% opacity and exposes `data-dimmed`; hovering or focusing anything in the row restores full opacity, and the row stays interactive.
|
|
456
456
|
|
|
457
457
|
Embedded actions, links, menus, editable fields, and media controls retain their own keyboard behavior. Registered anchor and button rows still participate in tree navigation; rename and search inputs retain their completion and cancellation shortcuts.
|
|
458
458
|
|
|
@@ -8,6 +8,7 @@ type TreeItemState = {
|
|
|
8
8
|
selected: boolean;
|
|
9
9
|
expanded: boolean;
|
|
10
10
|
dropTarget: boolean;
|
|
11
|
+
dimmed: boolean;
|
|
11
12
|
density: IDensityProps["density"];
|
|
12
13
|
};
|
|
13
14
|
type TreeItemProps<T> = useRender.ComponentProps<"div", TreeItemState> & IDensityProps & IAnalyticsProps & {
|
|
@@ -17,6 +18,8 @@ type TreeItemProps<T> = useRender.ComponentProps<"div", TreeItemState> & IDensit
|
|
|
17
18
|
expandOn?: "click" | "doubleClick" | "disclosure";
|
|
18
19
|
isEditing?: boolean;
|
|
19
20
|
isDropTarget?: boolean;
|
|
21
|
+
/** Fades a settled row, such as completed work, to 70% opacity; hover and keyboard focus restore full opacity. */
|
|
22
|
+
isDimmed?: boolean;
|
|
20
23
|
/** The registered native link owns row focus; disclosure and actions remain siblings. */
|
|
21
24
|
linkProps?: useRender.ComponentProps<"a", TreeItemState>;
|
|
22
25
|
/** Domain-controlled drag feedback; omitted rows have no tooltip wrapper. */
|
|
@@ -27,5 +30,5 @@ type TreeItemProps<T> = useRender.ComponentProps<"div", TreeItemState> & IDensit
|
|
|
27
30
|
};
|
|
28
31
|
};
|
|
29
32
|
/** Registered tree row; compose menus with render and place counts/actions in endEnhancer. */
|
|
30
|
-
export declare function TreeItem<T>({ analytics, item, children, startEnhancer, endEnhancer, expandOn, isEditing, isDropTarget, linkProps, dropHint, density, render, ref, ...props }: TreeItemProps<T>): ReactElement;
|
|
33
|
+
export declare function TreeItem<T>({ analytics, item, children, startEnhancer, endEnhancer, expandOn, isEditing, isDropTarget, isDimmed, linkProps, dropHint, density, render, ref, ...props }: TreeItemProps<T>): ReactElement;
|
|
31
34
|
export type { TreeItemProps };
|
|
@@ -36,6 +36,7 @@ function TreeItem({
|
|
|
36
36
|
expandOn = "click",
|
|
37
37
|
isEditing = false,
|
|
38
38
|
isDropTarget = false,
|
|
39
|
+
isDimmed = false,
|
|
39
40
|
linkProps,
|
|
40
41
|
dropHint,
|
|
41
42
|
density,
|
|
@@ -54,6 +55,7 @@ function TreeItem({
|
|
|
54
55
|
selected: isSelected,
|
|
55
56
|
expanded: isExpanded,
|
|
56
57
|
dropTarget: isInsideTarget || isDropTarget,
|
|
58
|
+
dimmed: isDimmed,
|
|
57
59
|
density
|
|
58
60
|
};
|
|
59
61
|
const toggle = () => {
|
|
@@ -146,7 +148,7 @@ function TreeItem({
|
|
|
146
148
|
onDragStart: undefined
|
|
147
149
|
} : {},
|
|
148
150
|
style: { paddingInlineStart: `${item.getItemMeta().level * (item.getTree().getConfig().indent ?? 20) + 8}px` },
|
|
149
|
-
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"),
|
|
151
|
+
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 && "opacity-70 focus-within:opacity-100 hover:opacity-100"),
|
|
150
152
|
children: /* @__PURE__ */ jsxs(Fragment, {
|
|
151
153
|
children: [
|
|
152
154
|
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.72",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
package/llms/setup.md
CHANGED
|
@@ -452,7 +452,7 @@ Keep preferred widths separate from the table's rendered sizing atom. In `onFitW
|
|
|
452
452
|
|
|
453
453
|
For nested layouts, compose `ActionsMenuTrigger`, `ActionsMenuContextTarget`, and `ActionsMenuContextContent` explicitly inside `ActionsMenu`. The dropdown trigger owns its local native dropdown root and popup; the context target and content share an independent context root. A tree row can use `TreeItem render={<ActionsMenuContextTarget />}` and put the trigger in its action slot. For a table row, render the context target as the actual `tr`, then place the dropdown trigger and context content inside a `td`: native popup portals insert focus guards at their declaration, which must remain valid table children.
|
|
454
454
|
|
|
455
|
-
`TreeItem linkProps` places the registered tree item, roving focus, and native drag handlers on an anchor. Pass `href` and anchor events directly, or compose a router link through `linkProps.render`. The outer `render` and `ref` remain available for row overlays; disclosure and `endEnhancer` controls remain siblings of the link. Enter and modified clicks retain native link behavior, while tree arrows retain navigation and expansion behavior. Optional `dropHint={{ content, open, side }}` displays caller-controlled drag feedback without adding a focus target.
|
|
455
|
+
`TreeItem linkProps` places the registered tree item, roving focus, and native drag handlers on an anchor. Pass `href` and anchor events directly, or compose a router link through `linkProps.render`. The outer `render` and `ref` remain available for row overlays; disclosure and `endEnhancer` controls remain siblings of the link. Enter and modified clicks retain native link behavior, while tree arrows retain navigation and expansion behavior. Optional `dropHint={{ content, open, side }}` displays caller-controlled drag feedback without adding a focus target. `isDimmed` fades a settled row, such as completed work, to 70% opacity and exposes `data-dimmed`; hovering or focusing anything in the row restores full opacity, and the row stays interactive.
|
|
456
456
|
|
|
457
457
|
Embedded actions, links, menus, editable fields, and media controls retain their own keyboard behavior. Registered anchor and button rows still participate in tree navigation; rename and search inputs retain their completion and cancellation shortcuts.
|
|
458
458
|
|