@alexgorbatchev/shadcn 0.0.114 → 0.0.115

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.
@@ -15,6 +15,11 @@ type TreeItemState = {
15
15
  type TreeItemProps<T> = useRender.ComponentProps<"div", TreeItemState> & IDensityProps & IAnalyticsProps & {
16
16
  item: ItemInstance<T>;
17
17
  startEnhancer?: ReactNode;
18
+ /**
19
+ * Whether the row shows its kind icon (folder or file) before the label. `false` drops it and its gap, so the label
20
+ * starts where the icon was; a tree whose disclosure already tells folders from leaves needs no icon.
21
+ */
22
+ hasIcon?: boolean;
18
23
  endEnhancer?: ReactNode;
19
24
  expandOn?: "click" | "doubleClick" | "disclosure";
20
25
  isEditing?: boolean;
@@ -94,5 +99,5 @@ export declare function TreeItemDot({ count, className }: ITreeItemDotProps): Re
94
99
  * Registered tree row; compose menus with render, put counts in `description` and pointer shortcuts in `actions`.
95
100
  * `endEnhancer` holds controls that must stay keyboard reachable on their own.
96
101
  */
97
- export declare function TreeItem<T>({ analytics, item, children, startEnhancer, endEnhancer, description, descriptionLabel, actions, expandOn, isEditing, isDropTarget, isDimmed, isUnread, leading, marker, linkProps, dropHint, density, render, ref, ...props }: TreeItemProps<T>): ReactElement;
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;
98
103
  export type { TreeItemProps };
@@ -128,6 +128,7 @@ function TreeItem({
128
128
  isDropTarget = false,
129
129
  isDimmed = false,
130
130
  isUnread = false,
131
+ hasIcon = true,
131
132
  leading,
132
133
  marker,
133
134
  linkProps,
@@ -183,7 +184,7 @@ function TreeItem({
183
184
  const faded = isDimmed && "opacity-70 group-hover/tree-item:opacity-100 group-focus-within/tree-item:opacity-100";
184
185
  const label = /* @__PURE__ */ jsxs(Fragment, {
185
186
  children: [
186
- /* @__PURE__ */ jsx("span", {
187
+ (hasIcon || startEnhancer) && /* @__PURE__ */ jsx("span", {
187
188
  "aria-hidden": "true",
188
189
  className: "flex shrink-0 [&>svg]:size-4",
189
190
  children: startEnhancer ?? (item.isFolder() ? isExpanded ? /* @__PURE__ */ jsx(FolderOpenIcon, {}) : /* @__PURE__ */ jsx(FolderIcon, {}) : /* @__PURE__ */ jsx(FileIcon, {}))
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.114",
2054
+ version: "0.0.115",
2055
2055
  description: "Sharp, monospace React components with compact and comfortable densities.",
2056
2056
  license: "MIT",
2057
2057
  repository: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.114",
3
+ "version": "0.0.115",
4
4
  "description": "Sharp, monospace React components with compact and comfortable densities.",
5
5
  "license": "MIT",
6
6
  "repository": {