@alexgorbatchev/shadcn 0.0.132 → 0.0.133

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
@@ -12,7 +12,7 @@
12
12
  # What It Does
13
13
 
14
14
  - **Consistent controls**: Provides buttons, forms, selections, navigation, overlays, and loading states.
15
- - **Two densities**: Offers compact 20px controls and comfortable 28px controls, with provider and component overrides.
15
+ - **Three densities**: Offers compact 20px, comfortable 28px, and touch 44px standard controls, with provider and component overrides.
16
16
  - **Theme choices**: Supports light, dark, and system preference, with customizable accent colors and fonts.
17
17
  - **Interactive reference**: Shows component variants and states in Storybook with editable controls and source examples.
18
18
 
@@ -194,14 +194,17 @@ An independent production Vite consumer installed from the archive verifies RTL
194
194
 
195
195
  # Configuration
196
196
 
197
- | Option | Type | Default | Description |
198
- | :--------------------------- | :------------------------------ | :------------------------------ | :--------------------------------------------------------------------- |
199
- | `ThemeProvider.defaultTheme` | `"light" \| "dark" \| "system"` | `"system"` | Initial preference when storage has no saved value. |
200
- | `ThemeProvider.storageKey` | `string` | `"shadcn-alexgorbatchev-theme"` | Local storage key for the preference. |
201
- | `ThemeProvider.forcedTheme` | `"light" \| "dark"` | unset | Overrides the displayed palette without changing the saved preference. |
202
- | `ThemeProvider.preset` | `"devhost" \| "shadcn"` | `"devhost"` | Document-wide design preset, independent of color mode and density. |
203
- | `DensityProvider.density` | `"compact" \| "comfortable"` | `"comfortable"` | Density for descendants and their portals. |
204
- | Component `density` | `"compact" \| "comfortable"` | inherited | Local override on styled components that expose the prop. |
197
+ | Option | Type | Default | Description |
198
+ | :------------------------------ | :-------------------------------------- | :------------------------------ | :----------------------------------------------------------------------- |
199
+ | `ThemeProvider.defaultTheme` | `"light" \| "dark" \| "system"` | `"system"` | Initial preference when storage has no saved value. |
200
+ | `ThemeProvider.storageKey` | `string` | `"shadcn-alexgorbatchev-theme"` | Local storage key for the preference. |
201
+ | `ThemeProvider.forcedTheme` | `"light" \| "dark"` | unset | Overrides the displayed palette without changing the saved preference. |
202
+ | `ThemeProvider.preset` | `"devhost" \| "shadcn"` | `"devhost"` | Document-wide design preset, independent of color mode and density. |
203
+ | `DensityProvider.density` | `"compact" \| "comfortable" \| "touch"` | `"comfortable"` | Density for descendants and their portals. |
204
+ | `DensityProvider.touchOnMobile` | `boolean` | `false` | Selects touch density below 48rem or when the primary pointer is coarse. |
205
+ | Component `density` | `"compact" \| "comfortable" \| "touch"` | inherited | Local override on styled components that expose the prop. |
206
+
207
+ Use `<DensityProvider touchOnMobile>` to select touch density on phones while using comfortable density on wider screens with a fine pointer. Touch uses 16px input text and a 44px minimum height for menu and select rows.
205
208
 
206
209
  `useTheme()` returns `theme`, `resolvedTheme`, `setTheme`, and `preset`. Call `setTheme("light")`, `setTheme("dark")`, or `setTheme("system")` from a component inside the provider.
207
210
 
@@ -79,7 +79,7 @@ import { Menu as MenuPrimitive2 } from "@base-ui/react/menu";
79
79
  import { ChevronRightIcon, CheckIcon } from "lucide-react";
80
80
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
81
81
  "use client";
82
- var menuItemClassName = "group/menu-item relative flex cursor-default items-center data-has-description:flex-wrap data-has-reason:flex-wrap data-has-reason:data-disabled:pointer-events-auto data-has-reason:data-disabled:opacity-100 data-has-reason:data-disabled:text-muted-foreground gap-control-gap rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive";
82
+ var menuItemClassName = "group/menu-item relative flex min-h-(--ag-item-min-h) cursor-default items-center data-has-description:flex-wrap data-has-reason:flex-wrap data-has-reason:data-disabled:pointer-events-auto data-has-reason:data-disabled:opacity-100 data-has-reason:data-disabled:text-muted-foreground gap-control-gap rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive";
83
83
  function MenuGroup2({ ...props }) {
84
84
  return /* @__PURE__ */ jsx2(MenuPrimitive2.Group, {
85
85
  "data-slot": "menu-group",
@@ -185,7 +185,7 @@ function MenuSubTrigger2({ density, className, inset, children, ...props }) {
185
185
  "data-density": density,
186
186
  "data-slot": "menu-sub-trigger",
187
187
  "data-inset": inset,
188
- className: (state) => cn2("flex cursor-default items-center gap-control-gap rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", typeof className === "function" ? className(state) : className),
188
+ className: (state) => cn2("flex min-h-(--ag-item-min-h) cursor-default items-center gap-control-gap rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", typeof className === "function" ? className(state) : className),
189
189
  ...props,
190
190
  children: [
191
191
  children,
@@ -257,7 +257,7 @@ function MenuCheckboxItem2({
257
257
  "data-density": density,
258
258
  "data-slot": "menu-checkbox-item",
259
259
  "data-inset": inset,
260
- className: (state) => cn2("relative flex cursor-default items-center gap-control-gap rounded-md py-1 pe-8 ps-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", typeof className === "function" ? className(state) : className),
260
+ className: (state) => cn2("relative flex min-h-(--ag-item-min-h) cursor-default items-center gap-control-gap rounded-md py-1 pe-8 ps-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", typeof className === "function" ? className(state) : className),
261
261
  checked,
262
262
  ...props,
263
263
  onCheckedChange: trackedOnCheckedChange,
@@ -286,7 +286,7 @@ function MenuRadioItem2({ density, className, children, inset, ...props }) {
286
286
  "data-density": density,
287
287
  "data-slot": "menu-radio-item",
288
288
  "data-inset": inset,
289
- className: (state) => cn2("relative flex cursor-default items-center gap-control-gap rounded-md py-1 pe-8 ps-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", typeof className === "function" ? className(state) : className),
289
+ className: (state) => cn2("relative flex min-h-(--ag-item-min-h) cursor-default items-center gap-control-gap rounded-md py-1 pe-8 ps-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", typeof className === "function" ? className(state) : className),
290
290
  ...props,
291
291
  children: [
292
292
  /* @__PURE__ */ jsx2("span", {
@@ -9,7 +9,7 @@ import {
9
9
  MenuItem2,
10
10
  DropdownMenu2,
11
11
  DropdownMenuTrigger2
12
- } from "./chunk-zrmtxp7r.js";
12
+ } from "./chunk-9y4pg1xb.js";
13
13
  import {
14
14
  mono
15
15
  } from "./chunk-fgmcbtyt.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-en44w1pn.js";
10
10
  import {
11
11
  OptionSelect2
12
- } from "./chunk-yw9j9sj6.js";
12
+ } from "./chunk-h45mqwpq.js";
13
13
  import {
14
14
  Badge2
15
15
  } from "./chunk-dbe9ppwf.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-2sx8m8b2.js";
7
7
  import {
8
8
  OptionSelect2
9
- } from "./chunk-yw9j9sj6.js";
9
+ } from "./chunk-h45mqwpq.js";
10
10
  import {
11
11
  useAnalyticsCallback
12
12
  } from "./chunk-5mydsjp3.js";
@@ -122,7 +122,7 @@ function SelectItem2({ density, className, children, ...props }) {
122
122
  return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
123
123
  "data-density": density,
124
124
  "data-slot": "select-item",
125
- className: (state) => cn2("relative flex w-full cursor-default items-center gap-control-gap rounded-md py-1 pe-8 ps-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", typeof className === "function" ? className(state) : className),
125
+ className: (state) => cn2("relative flex min-h-(--ag-item-min-h) w-full cursor-default items-center gap-control-gap rounded-md py-1 pe-8 ps-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", typeof className === "function" ? className(state) : className),
126
126
  ...props,
127
127
  children: [
128
128
  /* @__PURE__ */ jsx(SelectPrimitive.ItemText, {
@@ -168,7 +168,7 @@ function ComboboxItem2({ density, className, children, ...props }) {
168
168
  return /* @__PURE__ */ jsxs(ComboboxPrimitive.Item, {
169
169
  "data-density": density,
170
170
  "data-slot": "combobox-item",
171
- className: (state) => cn2("relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", typeof className === "function" ? className(state) : className),
171
+ className: (state) => cn2("relative flex min-h-(--ag-item-min-h) w-full cursor-default items-center gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", typeof className === "function" ? className(state) : className),
172
172
  ...props,
173
173
  children: [
174
174
  children,
@@ -39,7 +39,7 @@ import {
39
39
  MenuShortcut2,
40
40
  DropdownMenu2,
41
41
  DropdownMenuTrigger2
42
- } from "./chunk-zrmtxp7r.js";
42
+ } from "./chunk-9y4pg1xb.js";
43
43
  import {
44
44
  Alert2,
45
45
  AlertTitle2,
@@ -102,7 +102,7 @@ import {
102
102
  ComboboxChip2,
103
103
  ComboboxChipsInput2,
104
104
  useComboboxAnchor2
105
- } from "./chunk-636bahx2.js";
105
+ } from "./chunk-hjq0tgn9.js";
106
106
  import {
107
107
  Empty2,
108
108
  EmptyHeader2,
@@ -121,13 +121,13 @@ import {
121
121
  SelectContent2,
122
122
  SelectItem2,
123
123
  OptionSelect2
124
- } from "./chunk-yw9j9sj6.js";
125
- import {
126
- ThemeContext
127
- } from "./chunk-1j2hz3w9.js";
124
+ } from "./chunk-h45mqwpq.js";
128
125
  import {
129
126
  useMediaQuery
130
127
  } from "./chunk-cc35g6sr.js";
128
+ import {
129
+ ThemeContext
130
+ } from "./chunk-1j2hz3w9.js";
131
131
  import {
132
132
  Avatar2,
133
133
  AvatarImage2,
@@ -703,7 +703,7 @@ function OptionCard2({
703
703
  "data-folding": fold.isFoldable || undefined,
704
704
  "aria-labelledby": recommended ? `${ids.label} ${ids.tag}` : ids.label,
705
705
  "aria-describedby": getDescribedBy(ids, content),
706
- className: (state) => cn2(CARD_CLASS, typeof className === "function" ? className(state) : className),
706
+ className: (state) => cn2(CARD_CLASS, "grid-cols-[minmax(2rem,max-content)_minmax(0,1fr)]", typeof className === "function" ? className(state) : className),
707
707
  ...props,
708
708
  children: /* @__PURE__ */ jsx6(OptionCardContent, {
709
709
  ids,
@@ -1216,20 +1216,24 @@ function AlertDialogCancel2({
1216
1216
  import { mergeProps as mergeProps2 } from "@base-ui/react/merge-props";
1217
1217
  import { useRender as useRender2 } from "@base-ui/react/use-render";
1218
1218
  import { jsx as jsx15 } from "react/jsx-runtime";
1219
+ var TOUCH_QUERY = "(width < 48rem), (pointer: coarse)";
1219
1220
  function DensityProvider2({
1220
1221
  density = "comfortable",
1222
+ touchOnMobile = false,
1221
1223
  className,
1222
1224
  render,
1223
1225
  ...props
1224
1226
  }) {
1227
+ const matchesTouchQuery = useMediaQuery(TOUCH_QUERY);
1228
+ const resolvedDensity = touchOnMobile && matchesTouchQuery ? "touch" : density;
1225
1229
  const element = useRender2({
1226
1230
  defaultTagName: "div",
1227
1231
  props: mergeProps2({ className: cn2("font-sans text-base leading-(--ag-leading)", className) }, props),
1228
1232
  render,
1229
- state: { slot: "density-provider", density }
1233
+ state: { slot: "density-provider", density: resolvedDensity }
1230
1234
  });
1231
1235
  return /* @__PURE__ */ jsx15(DensityContext.Provider, {
1232
- value: density,
1236
+ value: resolvedDensity,
1233
1237
  children: element
1234
1238
  });
1235
1239
  }
@@ -2133,7 +2137,7 @@ function MenubarItem2({
2133
2137
  "data-slot": "menubar-item",
2134
2138
  inset,
2135
2139
  variant,
2136
- className: (state) => cn2("group/menubar-item gap-control-gap rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive!", typeof className === "function" ? className(state) : className),
2140
+ className: (state) => cn2("group/menubar-item min-h-(--ag-item-min-h) gap-control-gap rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive!", typeof className === "function" ? className(state) : className),
2137
2141
  ...props,
2138
2142
  onClick: trackedOnClick
2139
2143
  });
@@ -2152,7 +2156,7 @@ function MenubarCheckboxItem2({
2152
2156
  "data-density": density,
2153
2157
  "data-slot": "menubar-checkbox-item",
2154
2158
  "data-inset": inset,
2155
- className: (state) => cn2("relative flex cursor-default items-center gap-control-gap rounded-md py-1 pe-1.5 ps-7 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", typeof className === "function" ? className(state) : className),
2159
+ className: (state) => cn2("relative flex min-h-(--ag-item-min-h) cursor-default items-center gap-control-gap rounded-md py-1 pe-1.5 ps-7 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", typeof className === "function" ? className(state) : className),
2156
2160
  checked,
2157
2161
  ...props,
2158
2162
  onCheckedChange: trackedOnCheckedChange,
@@ -2178,7 +2182,7 @@ function MenubarRadioItem2({ density, className, children, inset, ...props }) {
2178
2182
  "data-density": density,
2179
2183
  "data-slot": "menubar-radio-item",
2180
2184
  "data-inset": inset,
2181
- className: (state) => cn2("relative flex cursor-default items-center gap-control-gap rounded-md py-1 pe-1.5 ps-7 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", typeof className === "function" ? className(state) : className),
2185
+ className: (state) => cn2("relative flex min-h-(--ag-item-min-h) cursor-default items-center gap-control-gap rounded-md py-1 pe-1.5 ps-7 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", typeof className === "function" ? className(state) : className),
2182
2186
  ...props,
2183
2187
  children: [
2184
2188
  /* @__PURE__ */ jsx23("span", {
@@ -2227,7 +2231,7 @@ function MenubarSubTrigger2({ density, className, inset, ...props }) {
2227
2231
  density,
2228
2232
  "data-slot": "menubar-sub-trigger",
2229
2233
  inset,
2230
- className: (state) => cn2("gap-control-gap rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground data-inset:ps-7 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4", typeof className === "function" ? className(state) : className),
2234
+ className: (state) => cn2("min-h-(--ag-item-min-h) gap-control-gap rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground data-inset:ps-7 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4", typeof className === "function" ? className(state) : className),
2231
2235
  ...props
2232
2236
  });
2233
2237
  }
@@ -3029,9 +3033,9 @@ import { useState as useState4 } from "react";
3029
3033
  import { Radio } from "@base-ui/react/radio";
3030
3034
  import { StarIcon, CircleOffIcon } from "lucide-react";
3031
3035
  import { jsx as jsx31 } from "react/jsx-runtime";
3032
- var ITEM_SIZES = { comfortable: "size-5", compact: "size-4" };
3033
- var STAR_SIZES = { comfortable: "size-3.5", compact: "size-3" };
3034
- var CLEAR_SIZES = { comfortable: "size-3", compact: "size-2.5" };
3036
+ var ITEM_SIZES = { comfortable: "size-5", compact: "size-4", touch: "size-control" };
3037
+ var STAR_SIZES = { comfortable: "size-3.5", compact: "size-3", touch: "size-5" };
3038
+ var CLEAR_SIZES = { comfortable: "size-3", compact: "size-2.5", touch: "size-4" };
3035
3039
  function StarRating2({
3036
3040
  analytics,
3037
3041
  label,
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-2sx8m8b2.js";
13
13
  import {
14
14
  OptionSelect2
15
- } from "./chunk-yw9j9sj6.js";
15
+ } from "./chunk-h45mqwpq.js";
16
16
  import {
17
17
  useAnalyticsCallback
18
18
  } from "./chunk-5mydsjp3.js";
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-qn4a3gg4.js";
14
14
  import {
15
15
  OptionSelect2
16
- } from "./chunk-yw9j9sj6.js";
16
+ } from "./chunk-h45mqwpq.js";
17
17
  import {
18
18
  Input2
19
19
  } from "./chunk-7vg045gd.js";
@@ -7,6 +7,7 @@ type DensityProviderState = {
7
7
  };
8
8
  export interface IDensityProviderProps extends useRender.ComponentProps<"div", DensityProviderState> {
9
9
  density?: Density;
10
+ touchOnMobile?: boolean;
10
11
  }
11
- export declare function DensityProvider({ density, className, render, ...props }: IDensityProviderProps): ReactElement;
12
+ export declare function DensityProvider({ density, touchOnMobile, className, render, ...props }: IDensityProviderProps): ReactElement;
12
13
  export {};
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RegenerateMenu2
3
- } from "../../../chunk-aasp54x3.js";
4
- import"../../../chunk-zrmtxp7r.js";
3
+ } from "../../../chunk-br5ff2c5.js";
4
+ import"../../../chunk-9y4pg1xb.js";
5
5
  import"../../../chunk-2sx8m8b2.js";
6
6
  import"../../../chunk-x90xmrba.js";
7
7
  import"../../../chunk-jpvw9xqy.js";
@@ -481,10 +481,10 @@ import {
481
481
  import {
482
482
  RecommendationCard2
483
483
  } from "../../chunk-x3gz994f.js";
484
- import"../../chunk-zrmtxp7r.js";
484
+ import"../../chunk-9y4pg1xb.js";
485
485
  import {
486
486
  RegenerateMenu2
487
- } from "../../chunk-aasp54x3.js";
487
+ } from "../../chunk-br5ff2c5.js";
488
488
  import {
489
489
  ResearchReport2
490
490
  } from "../../chunk-fdhssr0q.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  McpConfigDialog2
3
- } from "../../../chunk-zkex6fdh.js";
3
+ } from "../../../chunk-cbyqgfv4.js";
4
4
  import"../../../chunk-m4geb1s5.js";
5
5
  import"../../../chunk-dbe9ppwf.js";
6
6
  import"../../../chunk-m32ptxf3.js";
7
7
  import"../../../chunk-tcefvfr8.js";
8
- import"../../../chunk-yw9j9sj6.js";
8
+ import"../../../chunk-h45mqwpq.js";
9
9
  import"../../../chunk-d22t4qx6.js";
10
10
  import"../../../chunk-7vg045gd.js";
11
11
  import"../../../chunk-7jpsybag.js";
@@ -133,12 +133,12 @@ import"../../../chunk-732drvzb.js";
133
133
  import {
134
134
  DirectiveText2
135
135
  } from "../../../chunk-xdefvgvq.js";
136
- import"../../../chunk-yw9j9sj6.js";
136
+ import"../../../chunk-h45mqwpq.js";
137
137
  import"../../../chunk-m32ptxf3.js";
138
138
  import"../../../chunk-52aadmkc.js";
139
139
  import {
140
140
  McpConfigDialog2
141
- } from "../../../chunk-zkex6fdh.js";
141
+ } from "../../../chunk-cbyqgfv4.js";
142
142
  import"../../../chunk-ywaq50sv.js";
143
143
  import"../../../chunk-cdx1h86b.js";
144
144
  import {
@@ -10,8 +10,8 @@ import {
10
10
  import {
11
11
  Calendar2,
12
12
  CalendarDayButton2
13
- } from "../../chunk-0wzgpx58.js";
14
- import"../../chunk-yw9j9sj6.js";
13
+ } from "../../chunk-gtdmrz5d.js";
14
+ import"../../chunk-h45mqwpq.js";
15
15
  import {
16
16
  Popover2,
17
17
  PopoverTrigger2,
@@ -7,7 +7,7 @@ import {
7
7
  DataGridColumnHeader2,
8
8
  DataGridFilter2,
9
9
  DataGridPagination2
10
- } from "../../chunk-kmvfmhpt.js";
10
+ } from "../../chunk-ywhbkd15.js";
11
11
  import"../../chunk-7ny0vyek.js";
12
12
  import"../../chunk-8ssktt4b.js";
13
13
  import"../../chunk-en44w1pn.js";
@@ -18,7 +18,7 @@ import {
18
18
  Button2
19
19
  } from "../../chunk-2sx8m8b2.js";
20
20
  import"../../chunk-qn4a3gg4.js";
21
- import"../../chunk-yw9j9sj6.js";
21
+ import"../../chunk-h45mqwpq.js";
22
22
  import"../../chunk-7jpsybag.js";
23
23
  import"../../chunk-7vg045gd.js";
24
24
  import {
@@ -46,7 +46,7 @@ import {
46
46
  ComboboxChip2,
47
47
  ComboboxChipsInput2,
48
48
  useComboboxAnchor2
49
- } from "../../chunk-636bahx2.js";
49
+ } from "../../chunk-hjq0tgn9.js";
50
50
  import {
51
51
  Badge2
52
52
  } from "../../chunk-dbe9ppwf.js";
@@ -7,7 +7,7 @@ import {
7
7
  DragSource2,
8
8
  DropTarget2,
9
9
  Kanban2
10
- } from "../../chunk-ytfn5vnk.js";
10
+ } from "../../chunk-xb79xnjp.js";
11
11
  import"../../chunk-en44w1pn.js";
12
12
  import"../../chunk-dbe9ppwf.js";
13
13
  import"../../chunk-7ny0vyek.js";
@@ -20,7 +20,7 @@ import {
20
20
  } from "../../chunk-2sx8m8b2.js";
21
21
  import {
22
22
  OptionSelect2
23
- } from "../../chunk-yw9j9sj6.js";
23
+ } from "../../chunk-h45mqwpq.js";
24
24
  import {
25
25
  Table2,
26
26
  TableHeader2,
@@ -26,7 +26,7 @@ import {
26
26
  PaginationPrevious2,
27
27
  PaginationNext2,
28
28
  PaginationEllipsis2
29
- } from "../../chunk-9vndmsce.js";
29
+ } from "../../chunk-sd9tjknn.js";
30
30
  import {
31
31
  MenuPopup,
32
32
  MenuItem2,
@@ -34,7 +34,7 @@ import {
34
34
  MenuRadioItem2,
35
35
  DropdownMenu2,
36
36
  DropdownMenuTrigger2
37
- } from "../../chunk-zrmtxp7r.js";
37
+ } from "../../chunk-9y4pg1xb.js";
38
38
  import {
39
39
  Alert2,
40
40
  AlertTitle2,
@@ -94,13 +94,13 @@ import {
94
94
  CardContent2
95
95
  } from "../../chunk-9t68th3s.js";
96
96
  import"../../chunk-remfbhfg.js";
97
- import"../../chunk-636bahx2.js";
97
+ import"../../chunk-hjq0tgn9.js";
98
98
  import {
99
99
  Tabs2,
100
100
  TabsList2,
101
101
  TabsTrigger2,
102
102
  TabsContent2
103
- } from "../../chunk-ytfn5vnk.js";
103
+ } from "../../chunk-xb79xnjp.js";
104
104
  import"../../chunk-4e96tpw0.js";
105
105
  import {
106
106
  Checkbox2
@@ -111,8 +111,7 @@ import {
111
111
  SelectTrigger2,
112
112
  SelectContent2,
113
113
  SelectItem2
114
- } from "../../chunk-yw9j9sj6.js";
115
- import"../../chunk-1j2hz3w9.js";
114
+ } from "../../chunk-h45mqwpq.js";
116
115
  import {
117
116
  Drawer2,
118
117
  DrawerContent2,
@@ -120,6 +119,7 @@ import {
120
119
  DrawerTitle2,
121
120
  DrawerDescription2
122
121
  } from "../../chunk-cc35g6sr.js";
122
+ import"../../chunk-1j2hz3w9.js";
123
123
  import {
124
124
  Toggle2,
125
125
  ToggleGroup2,
@@ -11,8 +11,8 @@ import {
11
11
  getCalendarClassNames,
12
12
  CalendarDayButton2,
13
13
  CalendarDropdown
14
- } from "../../chunk-0wzgpx58.js";
15
- import"../../chunk-yw9j9sj6.js";
14
+ } from "../../chunk-gtdmrz5d.js";
15
+ import"../../chunk-h45mqwpq.js";
16
16
  import {
17
17
  useAnalyticsCallback
18
18
  } from "../../chunk-5mydsjp3.js";
@@ -10,14 +10,14 @@ import {
10
10
  DataGridHeaderRows,
11
11
  DataGridCells2,
12
12
  DataGridColumns
13
- } from "../../chunk-kmvfmhpt.js";
13
+ } from "../../chunk-ywhbkd15.js";
14
14
  import"../../chunk-7ny0vyek.js";
15
15
  import"../../chunk-8ssktt4b.js";
16
16
  import"../../chunk-e6hk39ev.js";
17
17
  import"../../chunk-x90xmrba.js";
18
18
  import"../../chunk-jpvw9xqy.js";
19
19
  import"../../chunk-2sx8m8b2.js";
20
- import"../../chunk-yw9j9sj6.js";
20
+ import"../../chunk-h45mqwpq.js";
21
21
  import"../../chunk-7jpsybag.js";
22
22
  import"../../chunk-7vg045gd.js";
23
23
  import {
@@ -1,4 +1,4 @@
1
- export type Density = "compact" | "comfortable";
1
+ export type Density = "compact" | "comfortable" | "touch";
2
2
  export interface IDensityProps {
3
3
  density?: Density;
4
4
  }
package/dist/index.js CHANGED
@@ -187,7 +187,7 @@ import {
187
187
  StatusTracker2,
188
188
  DashboardLayout2,
189
189
  BillingUsage2
190
- } from "./chunk-9vndmsce.js";
190
+ } from "./chunk-sd9tjknn.js";
191
191
  import {
192
192
  Combobox2,
193
193
  ComboboxValue2,
@@ -205,7 +205,7 @@ import {
205
205
  ComboboxChip2,
206
206
  ComboboxChipsInput2,
207
207
  useComboboxAnchor2
208
- } from "./chunk-636bahx2.js";
208
+ } from "./chunk-hjq0tgn9.js";
209
209
  import {
210
210
  Tabs2,
211
211
  tabsListVariants2,
@@ -220,7 +220,7 @@ import {
220
220
  useDropTarget2,
221
221
  DropTarget2,
222
222
  Kanban2
223
- } from "./chunk-ytfn5vnk.js";
223
+ } from "./chunk-xb79xnjp.js";
224
224
  import {
225
225
  NumberField2,
226
226
  NumberFieldGroup2,
@@ -266,7 +266,7 @@ import {
266
266
  MenuShortcut2,
267
267
  DropdownMenu2,
268
268
  DropdownMenuTrigger2
269
- } from "./chunk-zrmtxp7r.js";
269
+ } from "./chunk-9y4pg1xb.js";
270
270
  import {
271
271
  Empty2,
272
272
  EmptyHeader2,
@@ -432,7 +432,7 @@ import {
432
432
  SelectScrollUpButton2,
433
433
  SelectScrollDownButton2,
434
434
  OptionSelect2
435
- } from "./chunk-yw9j9sj6.js";
435
+ } from "./chunk-h45mqwpq.js";
436
436
  import {
437
437
  Dialog2,
438
438
  DialogTrigger2,
package/dist/prototype.js CHANGED
@@ -2051,8 +2051,8 @@ var program = new Command;
2051
2051
  // package.json
2052
2052
  var package_default = {
2053
2053
  name: "@alexgorbatchev/shadcn",
2054
- version: "0.0.132",
2055
- description: "Sharp, monospace React components with compact and comfortable densities.",
2054
+ version: "0.0.133",
2055
+ description: "Sharp, monospace React components with compact, comfortable, and touch densities.",
2056
2056
  license: "MIT",
2057
2057
  repository: {
2058
2058
  type: "git",
package/dist/theme.css CHANGED
@@ -97,6 +97,7 @@
97
97
  --ag-panel-padding-sm: 12px;
98
98
  --ag-field-gap: 20px;
99
99
  --ag-section-gap: 32px;
100
+ --ag-item-min-h: 0px;
100
101
  /* Target emphasis: a dark and a light line that keep 3:1 against any content in every theme, so they stay fixed. */
101
102
  --target-emphasis: #4a0a3a;
102
103
  --target-emphasis-contrast: #ffffff;
@@ -323,6 +324,7 @@
323
324
  --ag-panel-padding-sm: 12px;
324
325
  --ag-field-gap: 20px;
325
326
  --ag-section-gap: 32px;
327
+ --ag-item-min-h: 0px;
326
328
  }
327
329
 
328
330
  [data-density="compact"] {
@@ -341,6 +343,26 @@
341
343
  --ag-panel-padding-sm: 6px;
342
344
  --ag-field-gap: 8px;
343
345
  --ag-section-gap: 16px;
346
+ --ag-item-min-h: 0px;
347
+ }
348
+
349
+ [data-density="touch"] {
350
+ --ag-text-xs: 12px;
351
+ --ag-control-text: 14px;
352
+ --ag-text: 16px;
353
+ --ag-heading: 20px;
354
+ --ag-leading: 1.5;
355
+ --ag-cell-leading: 1.5;
356
+ --ag-control-h: 44px;
357
+ --ag-control-x: 12px;
358
+ --ag-control-gap: 8px;
359
+ --ag-tag-h: 22px;
360
+ --ag-tag-x: 6px;
361
+ --ag-panel-padding: 16px;
362
+ --ag-panel-padding-sm: 12px;
363
+ --ag-field-gap: 20px;
364
+ --ag-section-gap: 32px;
365
+ --ag-item-min-h: var(--ag-control-h);
344
366
  }
345
367
 
346
368
  * {
@@ -73,6 +73,14 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
73
73
  }
74
74
  ```
75
75
 
76
+ ### Touch
77
+
78
+ ```tsx
79
+ {
80
+ args: { density: "touch" }
81
+ }
82
+ ```
83
+
76
84
  ### DefaultDensity
77
85
 
78
86
  ```tsx
package/llms/setup.md CHANGED
@@ -12,7 +12,7 @@
12
12
  # What It Does
13
13
 
14
14
  - **Consistent controls**: Provides buttons, forms, selections, navigation, overlays, and loading states.
15
- - **Two densities**: Offers compact 20px controls and comfortable 28px controls, with provider and component overrides.
15
+ - **Three densities**: Offers compact 20px, comfortable 28px, and touch 44px standard controls, with provider and component overrides.
16
16
  - **Theme choices**: Supports light, dark, and system preference, with customizable accent colors and fonts.
17
17
  - **Interactive reference**: Shows component variants and states in Storybook with editable controls and source examples.
18
18
 
@@ -194,14 +194,17 @@ An independent production Vite consumer installed from the archive verifies RTL
194
194
 
195
195
  # Configuration
196
196
 
197
- | Option | Type | Default | Description |
198
- | :--------------------------- | :------------------------------ | :------------------------------ | :--------------------------------------------------------------------- |
199
- | `ThemeProvider.defaultTheme` | `"light" \| "dark" \| "system"` | `"system"` | Initial preference when storage has no saved value. |
200
- | `ThemeProvider.storageKey` | `string` | `"shadcn-alexgorbatchev-theme"` | Local storage key for the preference. |
201
- | `ThemeProvider.forcedTheme` | `"light" \| "dark"` | unset | Overrides the displayed palette without changing the saved preference. |
202
- | `ThemeProvider.preset` | `"devhost" \| "shadcn"` | `"devhost"` | Document-wide design preset, independent of color mode and density. |
203
- | `DensityProvider.density` | `"compact" \| "comfortable"` | `"comfortable"` | Density for descendants and their portals. |
204
- | Component `density` | `"compact" \| "comfortable"` | inherited | Local override on styled components that expose the prop. |
197
+ | Option | Type | Default | Description |
198
+ | :------------------------------ | :-------------------------------------- | :------------------------------ | :----------------------------------------------------------------------- |
199
+ | `ThemeProvider.defaultTheme` | `"light" \| "dark" \| "system"` | `"system"` | Initial preference when storage has no saved value. |
200
+ | `ThemeProvider.storageKey` | `string` | `"shadcn-alexgorbatchev-theme"` | Local storage key for the preference. |
201
+ | `ThemeProvider.forcedTheme` | `"light" \| "dark"` | unset | Overrides the displayed palette without changing the saved preference. |
202
+ | `ThemeProvider.preset` | `"devhost" \| "shadcn"` | `"devhost"` | Document-wide design preset, independent of color mode and density. |
203
+ | `DensityProvider.density` | `"compact" \| "comfortable" \| "touch"` | `"comfortable"` | Density for descendants and their portals. |
204
+ | `DensityProvider.touchOnMobile` | `boolean` | `false` | Selects touch density below 48rem or when the primary pointer is coarse. |
205
+ | Component `density` | `"compact" \| "comfortable" \| "touch"` | inherited | Local override on styled components that expose the prop. |
206
+
207
+ Use `<DensityProvider touchOnMobile>` to select touch density on phones while using comfortable density on wider screens with a fine pointer. Touch uses 16px input text and a 44px minimum height for menu and select rows.
205
208
 
206
209
  `useTheme()` returns `theme`, `resolvedTheme`, `setTheme`, and `preset`. Call `setTheme("light")`, `setTheme("dark")`, or `setTheme("system")` from a component inside the provider.
207
210
 
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # @alexgorbatchev/shadcn
2
2
 
3
- > Sharp, monospace React components with compact and comfortable densities.
3
+ > Sharp, monospace React components with compact, comfortable, and touch densities.
4
4
 
5
5
  Generated from the public package exports and Storybook sources.
6
6
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.132",
4
- "description": "Sharp, monospace React components with compact and comfortable densities.",
3
+ "version": "0.0.133",
4
+ "description": "Sharp, monospace React components with compact, comfortable, and touch densities.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",