@alexgorbatchev/shadcn 0.0.204 → 0.0.206

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.
@@ -24,7 +24,7 @@ import {
24
24
  TableHead2,
25
25
  TableCell2,
26
26
  TableCaption2
27
- } from "./chunk-a33b2w22.js";
27
+ } from "./chunk-qyw2b7nf.js";
28
28
  import {
29
29
  safeHref
30
30
  } from "./chunk-xhtsnwnb.js";
@@ -2600,7 +2600,7 @@ import { mergeProps as mergeProps6 } from "@base-ui/react/merge-props";
2600
2600
  import { useRender as useRender6 } from "@base-ui/react/use-render";
2601
2601
  import { cva as cva4 } from "class-variance-authority";
2602
2602
  import { jsx as jsx26 } from "react/jsx-runtime";
2603
- var markerVariants2 = cva4("group/marker relative flex min-h-4 w-full items-center gap-control-gap text-start text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground [&:is(a,button)]:outline-none [&:is(a,button)]:focus-visible:outline-1 [&:is(a,button)]:focus-visible:outline-ring", {
2603
+ var markerVariants2 = cva4("group/marker relative flex min-h-4 w-full items-center gap-control-gap text-start text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground [&:is(a,button)]:outline-none [&:is(a,button)]:focus-visible:outline-1 [&:is(a,button)]:focus-visible:outline-offset-1 [&:is(a,button)]:focus-visible:outline-ring [&:is(a,button)]:focus-visible:outline-solid", {
2604
2604
  variants: {
2605
2605
  variant: {
2606
2606
  default: "",
@@ -3905,6 +3905,7 @@ function AppShell2({
3905
3905
  defaultSidebarOpen = true,
3906
3906
  label = "Application",
3907
3907
  content = "scroll",
3908
+ topBar = true,
3908
3909
  density
3909
3910
  }) {
3910
3911
  return /* @__PURE__ */ jsxs25(SidebarProvider2, {
@@ -3948,8 +3949,22 @@ function AppShell2({
3948
3949
  })
3949
3950
  })
3950
3951
  }),
3951
- sidebarFooter && /* @__PURE__ */ jsx39(SidebarFooter2, {
3952
+ topBar ? sidebarFooter && /* @__PURE__ */ jsx39(SidebarFooter2, {
3952
3953
  children: sidebarFooter
3954
+ }) : /* @__PURE__ */ jsx39(SidebarFooter2, {
3955
+ children: /* @__PURE__ */ jsxs25("div", {
3956
+ "data-slot": "app-shell-sidebar-footer",
3957
+ className: "flex min-w-0 items-center gap-control-gap group-data-[collapsible=icon]:flex-col group-data-[collapsible=icon]:items-stretch",
3958
+ children: [
3959
+ sidebarFooter && /* @__PURE__ */ jsx39("div", {
3960
+ className: "min-w-0",
3961
+ children: sidebarFooter
3962
+ }),
3963
+ /* @__PURE__ */ jsx39(SidebarTrigger2, {
3964
+ className: "ms-auto group-data-[collapsible=icon]:ms-0 max-md:hidden"
3965
+ })
3966
+ ]
3967
+ })
3953
3968
  })
3954
3969
  ]
3955
3970
  }),
@@ -3960,7 +3975,7 @@ function AppShell2({
3960
3975
  children: [
3961
3976
  /* @__PURE__ */ jsxs25("header", {
3962
3977
  "data-scroll": "none",
3963
- className: "flex shrink-0 items-center gap-control-gap border-b border-border p-panel",
3978
+ className: cn2("flex shrink-0 items-center gap-control-gap border-b border-border p-panel", !topBar && "md:hidden"),
3964
3979
  children: [
3965
3980
  /* @__PURE__ */ jsx39(SidebarTrigger2, {}),
3966
3981
  header
@@ -2,7 +2,7 @@ import {
2
2
  Table2,
3
3
  TableHeader2,
4
4
  TableBody2
5
- } from "./chunk-a33b2w22.js";
5
+ } from "./chunk-qyw2b7nf.js";
6
6
 
7
7
  // src/components/virtual-table/VirtualTable.tsx
8
8
  import {
@@ -55,7 +55,7 @@ function TableRow2({ density, className, stripe, style, ...props }) {
55
55
  "data-slot": "table-row",
56
56
  "data-stripe": stripe ? "" : undefined,
57
57
  style: stripe ? { ...style, ["--row-stripe"]: stripe } : style,
58
- className: cn2("border-b transition-colors outline-none hover:bg-muted/50 has-aria-expanded:bg-muted/50 focus:outline-2 focus:-outline-offset-2 focus:outline-ring data-[state=selected]:bg-muted aria-selected:bg-primary/10 aria-selected:shadow-[inset_3px_0_0_var(--primary)] aria-selected:hover:bg-primary/15", "data-stripe:[&>td:first-child]:shadow-[inset_4px_0_0_var(--row-stripe)] data-stripe:aria-selected:[&>td:first-child]:shadow-[inset_3px_0_0_var(--primary),inset_7px_0_0_var(--row-stripe)]", className),
58
+ className: cn2("border-b transition-colors outline-none hover:bg-muted/50 has-aria-expanded:bg-muted/50 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid data-[state=selected]:bg-muted aria-selected:bg-primary/10 aria-selected:shadow-[inset_3px_0_0_var(--primary)] aria-selected:hover:bg-primary/15", "forced-colors:focus-visible:-outline-offset-2!", "data-stripe:[&>td:first-child]:shadow-[inset_4px_0_0_var(--row-stripe)] data-stripe:aria-selected:[&>td:first-child]:shadow-[inset_3px_0_0_var(--primary),inset_7px_0_0_var(--row-stripe)]", className),
59
59
  ...props
60
60
  });
61
61
  }
@@ -10,7 +10,7 @@ import {
10
10
  TableCell2,
11
11
  TableColumnGroup2,
12
12
  TableColumn2
13
- } from "./chunk-a33b2w22.js";
13
+ } from "./chunk-qyw2b7nf.js";
14
14
  import {
15
15
  OptionSelect2
16
16
  } from "./chunk-h45mqwpq.js";
@@ -29,7 +29,13 @@ type AppShellProps = IDensityProps & {
29
29
  defaultSidebarOpen?: boolean;
30
30
  label?: string;
31
31
  content?: AppShellContent;
32
+ /**
33
+ * Show the top bar with the sidebar toggle and `header` on every screen size (the default). With `false`, wide
34
+ * screens drop the top bar and show the sidebar toggle at the end of the sidebar footer, after `sidebarFooter`;
35
+ * narrow screens keep the top bar, because its toggle is the only way to open the navigation sheet there.
36
+ */
37
+ topBar?: boolean;
32
38
  };
33
- declare function AppShell({ navigation, brand, children, header, sidebarFooter, footer, height, defaultSidebarOpen, label, content, density, }: AppShellProps): ReactElement;
39
+ declare function AppShell({ navigation, brand, children, header, sidebarFooter, footer, height, defaultSidebarOpen, label, content, topBar, density, }: AppShellProps): ReactElement;
34
40
  export { AppShell };
35
41
  export type { AppShellContent, AppShellNavigationItem, AppShellProps };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  DataTable2
3
- } from "../../../chunk-n8b0nshb.js";
3
+ } from "../../../chunk-1n19vtm0.js";
4
4
  import"../../../chunk-1wz92wgg.js";
5
- import"../../../chunk-a33b2w22.js";
5
+ import"../../../chunk-qyw2b7nf.js";
6
6
  import"../../../chunk-jc3cbwyg.js";
7
7
  import"../../../chunk-m4geb1s5.js";
8
8
  import"../../../chunk-cgj3ade2.js";
@@ -203,8 +203,8 @@ import"../../chunk-1wz92wgg.js";
203
203
  import"../../chunk-cgj3ade2.js";
204
204
  import {
205
205
  DataTable2
206
- } from "../../chunk-n8b0nshb.js";
207
- import"../../chunk-a33b2w22.js";
206
+ } from "../../chunk-1n19vtm0.js";
207
+ import"../../chunk-qyw2b7nf.js";
208
208
  import {
209
209
  DaySeparator2
210
210
  } from "../../chunk-3j9enr2q.js";
@@ -7,7 +7,7 @@ import {
7
7
  DataGridColumnHeader2,
8
8
  DataGridFilter2,
9
9
  DataGridPagination2
10
- } from "../../chunk-evv4435t.js";
10
+ } from "../../chunk-v5ab0c6a.js";
11
11
  import"../../chunk-7ny0vyek.js";
12
12
  import"../../chunk-8ssktt4b.js";
13
13
  import"../../chunk-en44w1pn.js";
@@ -17,7 +17,7 @@ import"../../chunk-jpvw9xqy.js";
17
17
  import {
18
18
  Button2
19
19
  } from "../../chunk-hvfe31vg.js";
20
- import"../../chunk-a33b2w22.js";
20
+ import"../../chunk-qyw2b7nf.js";
21
21
  import"../../chunk-h45mqwpq.js";
22
22
  import"../../chunk-7jpsybag.js";
23
23
  import"../../chunk-t9ms87s9.js";
@@ -28,7 +28,7 @@ import {
28
28
  TableRow2,
29
29
  TableHead2,
30
30
  TableCell2
31
- } from "../../chunk-a33b2w22.js";
31
+ } from "../../chunk-qyw2b7nf.js";
32
32
  import"../../chunk-5mydsjp3.js";
33
33
 
34
34
  // src/components/gantt/Gantt.tsx
@@ -26,7 +26,7 @@ import {
26
26
  PaginationPrevious2,
27
27
  PaginationNext2,
28
28
  PaginationEllipsis2
29
- } from "../../chunk-t32f2tde.js";
29
+ } from "../../chunk-gf6fsbrz.js";
30
30
  import {
31
31
  MenuPopup,
32
32
  MenuItem2,
@@ -150,7 +150,7 @@ import {
150
150
  TableHead2,
151
151
  TableCell2,
152
152
  TableCaption2
153
- } from "../../chunk-a33b2w22.js";
153
+ } from "../../chunk-qyw2b7nf.js";
154
154
  import"../../chunk-g1zyjeet.js";
155
155
  import"../../chunk-m4geb1s5.js";
156
156
  import"../../chunk-9ecf92s6.js";
@@ -251,7 +251,7 @@ function TreeItem({
251
251
  onDragStart: undefined
252
252
  } : {},
253
253
  style: { paddingInlineStart: `${item.getItemMeta().level * (item.getTree().getConfig().indent ?? 20) + 8}px` },
254
- className: cn2("relative flex min-h-control min-w-0 cursor-default items-center gap-2 rounded-sm border border-transparent py-1 pr-2 text-sm outline-none pointer-coarse:min-h-11", isAriaDisabled ? "cursor-not-allowed focus-visible:outline-1 focus-visible:outline-ring/60 focus-visible:-outline-offset-1" : "hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", (isSelected || isDropTarget || isInsideTarget) && (selectionStyle === "accent" && isSelected ? "border-primary bg-muted/60 font-medium text-foreground" : "bg-accent text-accent-foreground"), isSelected && "forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:forced-color-adjust-none forced-colors:[&_*]:text-[HighlightText]", tone === "warning" && "before:pointer-events-none before:absolute before:inset-y-1 before:start-0 before:w-0.5 before:rounded-full before:bg-warning", isDimmed && "group/tree-item"),
254
+ className: cn2("relative flex min-h-control min-w-0 cursor-default items-center gap-2 rounded-sm border border-transparent py-1 pr-2 text-sm outline-none pointer-coarse:min-h-11", isAriaDisabled ? "cursor-not-allowed focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-ring focus-visible:outline-solid" : "hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", (isSelected || isDropTarget || isInsideTarget) && (selectionStyle === "accent" && isSelected ? "border-primary bg-muted/60 font-medium text-foreground" : "bg-accent text-accent-foreground"), isSelected && "forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:forced-color-adjust-none forced-colors:[&_*]:text-[HighlightText]", tone === "warning" && "before:pointer-events-none before:absolute before:inset-y-1 before:start-0 before:w-0.5 before:rounded-full before:bg-warning", isDimmed && "group/tree-item"),
255
255
  children: /* @__PURE__ */ jsxs(Fragment, {
256
256
  children: [
257
257
  item.isFolder() && expandOn === "disclosure" ? /* @__PURE__ */ jsx(Button2, {
@@ -1,7 +1,7 @@
1
1
  import"../../chunk-en44w1pn.js";
2
2
  import {
3
3
  TableRow2
4
- } from "../../chunk-a33b2w22.js";
4
+ } from "../../chunk-qyw2b7nf.js";
5
5
  import {
6
6
  DataGridColumnFitContext,
7
7
  getDataGridColumnFit,
@@ -10,7 +10,7 @@ import {
10
10
  DataGridHeaderRows,
11
11
  DataGridCells2,
12
12
  DataGridColumns
13
- } from "../../chunk-evv4435t.js";
13
+ } from "../../chunk-v5ab0c6a.js";
14
14
  import"../../chunk-7ny0vyek.js";
15
15
  import"../../chunk-8ssktt4b.js";
16
16
  import"../../chunk-e6hk39ev.js";
@@ -22,7 +22,7 @@ import"../../chunk-7jpsybag.js";
22
22
  import"../../chunk-t9ms87s9.js";
23
23
  import {
24
24
  VirtualTable2
25
- } from "../../chunk-xpsp5cd9.js";
25
+ } from "../../chunk-gn8vj28x.js";
26
26
  import"../../chunk-5mydsjp3.js";
27
27
 
28
28
  // src/components/virtual-data-grid/VirtualDataGrid.tsx
@@ -1,8 +1,8 @@
1
1
  import"../../chunk-en44w1pn.js";
2
- import"../../chunk-a33b2w22.js";
2
+ import"../../chunk-qyw2b7nf.js";
3
3
  import {
4
4
  VirtualTable2
5
- } from "../../chunk-xpsp5cd9.js";
5
+ } from "../../chunk-gn8vj28x.js";
6
6
  export {
7
7
  VirtualTable2 as VirtualTable
8
8
  };
package/dist/index.js CHANGED
@@ -188,7 +188,7 @@ import {
188
188
  DashboardLayout2,
189
189
  BillingUsage2,
190
190
  SelectionAction2
191
- } from "./chunk-t32f2tde.js";
191
+ } from "./chunk-gf6fsbrz.js";
192
192
  import {
193
193
  statusDotVariants2,
194
194
  StatusDot2
@@ -287,7 +287,7 @@ import {
287
287
  TableColumnGroup2,
288
288
  TableColumn2,
289
289
  TableCaption2
290
- } from "./chunk-a33b2w22.js";
290
+ } from "./chunk-qyw2b7nf.js";
291
291
  import {
292
292
  ScrollArea2,
293
293
  ScrollBar2
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.204",
2054
+ version: "0.0.206",
2055
2055
  description: "Sharp, monospace React components with compact, comfortable, and touch densities.",
2056
2056
  license: "MIT",
2057
2057
  repository: {
@@ -316,6 +316,41 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
316
316
  }
317
317
  ```
318
318
 
319
+ ### KeyboardFocus
320
+
321
+ ```tsx
322
+ {
323
+ render: FocusableRowsExample
324
+ }
325
+ ```
326
+
327
+ ### KeyboardFocusCompact
328
+
329
+ ```tsx
330
+ {
331
+ render: FocusableRowsExample,
332
+ globals: { density: "compact" }
333
+ }
334
+ ```
335
+
336
+ ### KeyboardFocusTouch
337
+
338
+ ```tsx
339
+ {
340
+ render: FocusableRowsExample,
341
+ globals: { density: "touch" }
342
+ }
343
+ ```
344
+
345
+ ### KeyboardFocusRightToLeft
346
+
347
+ ```tsx
348
+ {
349
+ render: FocusableRowsExample,
350
+ args: { dir: "rtl" }
351
+ }
352
+ ```
353
+
319
354
  ### WrappedColumn
320
355
 
321
356
  ```tsx
@@ -9,7 +9,13 @@ Source: src/components/stories/layout/AppShell.stories.tsx
9
9
 
10
10
  ```tsx
11
11
  import { AnalyticsProvider } from "@alexgorbatchev/shadcn/analytics";
12
- import { AppShell, PageHeader, Stack, StatCard, Text } from "@alexgorbatchev/shadcn";
12
+ import { AppShell, Button, PageHeader, Stack, StatCard, Text } from "@alexgorbatchev/shadcn";
13
+ ```
14
+
15
+ ## Supporting imports
16
+
17
+ ```tsx
18
+ import { UserIcon } from "lucide-react";
13
19
  ```
14
20
 
15
21
  ## Default component
@@ -95,3 +101,25 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
95
101
  }
96
102
  }
97
103
  ```
104
+
105
+ ### WithoutTopBar
106
+
107
+ ```tsx
108
+ {
109
+ args: {
110
+ topBar: false,
111
+ header: undefined,
112
+ sidebarFooter: (<Button variant="ghost" size="icon-sm" aria-label="Account">
113
+ <UserIcon />
114
+ </Button>),
115
+ }
116
+ }
117
+ ```
118
+
119
+ ### WithoutTopBarOnPhone
120
+
121
+ ```tsx
122
+ {
123
+ args: { topBar: false, header: undefined }
124
+ }
125
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.204",
3
+ "version": "0.0.206",
4
4
  "description": "Sharp, monospace React components with compact, comfortable, and touch densities.",
5
5
  "license": "MIT",
6
6
  "repository": {