@makoai/app-sdk 2.23.0 → 2.25.0

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
@@ -558,6 +558,19 @@ component or prop is an SDK pull request.
558
558
  @import "@makoai/app-sdk/tailwind.css";
559
559
  ```
560
560
 
561
+ Calendar and Command (2.24) ship on their own subpaths, so an app without
562
+ react-day-picker or cmdk never loads them:
563
+
564
+ ```ts
565
+ import { Calendar } from "@makoai/app-sdk/components/calendar";
566
+ import { Command, CommandInput, CommandList } from "@makoai/app-sdk/components/command";
567
+ ```
568
+
569
+ shadcn's stock components pass refs as props, so they need React 19. On
570
+ React 18 a ref is dropped: a Calendar's arrow keys stop moving focus. Apps
571
+ that use them run React 19; `mako-app-lint --rules=react-version` flags any
572
+ that does not.
573
+
561
574
  Thin props (2.23), marked "Mako thin prop" in the source. Stock behaviour
562
575
  stays the default:
563
576
 
@@ -601,6 +614,14 @@ Run it in an app folder (or pass several). It exits 1 on a finding;
601
614
  `src/`. A date key the helpers cannot build takes
602
615
  `// mako-lint-ignore utc-display` on its line.
603
616
  - `local-shadcn`: a `src/components/ui/<name>.tsx` the SDK ships.
617
+ - `react-version` (2.24): React below 19 in an app that uses shadcn
618
+ (`src/components/ui`, radix-ui, or the SDK's `/components` or `/menu`).
619
+ From 2.25 it also flags React 19 with recharts 2 and no react-is 19
620
+ override. recharts 2 reads chart children with react-is 18, which drops
621
+ anything inside a `<>` fragment: a chart loses its reference lines. The
622
+ fix is `"pnpm": { "overrides": { "react-is": "^19.1.10" } }`.
623
+
624
+ `--rules=react-version` runs only the named rules (2.24).
604
625
 
605
626
  ### Chart tooltips: `TableTooltip` (2.10+, every series from 2.15)
606
627
 
@@ -0,0 +1,220 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "../menu/utils"
5
+ import {
6
+ ChevronDownIcon,
7
+ ChevronLeftIcon,
8
+ ChevronRightIcon,
9
+ } from "lucide-react"
10
+ import {
11
+ DayPicker,
12
+ getDefaultClassNames,
13
+ type DayButton,
14
+ } from "react-day-picker"
15
+
16
+ import { Button, buttonVariants } from "./button"
17
+
18
+ function Calendar({
19
+ className,
20
+ classNames,
21
+ showOutsideDays = true,
22
+ captionLayout = "label",
23
+ buttonVariant = "ghost",
24
+ formatters,
25
+ components,
26
+ ...props
27
+ }: React.ComponentProps<typeof DayPicker> & {
28
+ buttonVariant?: React.ComponentProps<typeof Button>["variant"]
29
+ }) {
30
+ const defaultClassNames = getDefaultClassNames()
31
+
32
+ return (
33
+ <DayPicker
34
+ showOutsideDays={showOutsideDays}
35
+ className={cn(
36
+ "group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
37
+ String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
38
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
39
+ className
40
+ )}
41
+ captionLayout={captionLayout}
42
+ formatters={{
43
+ formatMonthDropdown: (date) =>
44
+ date.toLocaleString("default", { month: "short" }),
45
+ ...formatters,
46
+ }}
47
+ classNames={{
48
+ root: cn("w-fit", defaultClassNames.root),
49
+ months: cn(
50
+ "relative flex flex-col gap-4 md:flex-row",
51
+ defaultClassNames.months
52
+ ),
53
+ month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
54
+ nav: cn(
55
+ "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
56
+ defaultClassNames.nav
57
+ ),
58
+ button_previous: cn(
59
+ buttonVariants({ variant: buttonVariant }),
60
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
61
+ defaultClassNames.button_previous
62
+ ),
63
+ button_next: cn(
64
+ buttonVariants({ variant: buttonVariant }),
65
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
66
+ defaultClassNames.button_next
67
+ ),
68
+ month_caption: cn(
69
+ "flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
70
+ defaultClassNames.month_caption
71
+ ),
72
+ dropdowns: cn(
73
+ "flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
74
+ defaultClassNames.dropdowns
75
+ ),
76
+ dropdown_root: cn(
77
+ "relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",
78
+ defaultClassNames.dropdown_root
79
+ ),
80
+ dropdown: cn(
81
+ "absolute inset-0 bg-popover opacity-0",
82
+ defaultClassNames.dropdown
83
+ ),
84
+ caption_label: cn(
85
+ "font-medium select-none",
86
+ captionLayout === "label"
87
+ ? "text-sm"
88
+ : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
89
+ defaultClassNames.caption_label
90
+ ),
91
+ month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
92
+ weekdays: cn("flex", defaultClassNames.weekdays),
93
+ weekday: cn(
94
+ "flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none",
95
+ defaultClassNames.weekday
96
+ ),
97
+ week: cn("mt-2 flex w-full", defaultClassNames.week),
98
+ week_number_header: cn(
99
+ "w-(--cell-size) select-none",
100
+ defaultClassNames.week_number_header
101
+ ),
102
+ week_number: cn(
103
+ "text-[0.8rem] text-muted-foreground select-none",
104
+ defaultClassNames.week_number
105
+ ),
106
+ day: cn(
107
+ "group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md",
108
+ props.showWeekNumber
109
+ ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md"
110
+ : "[&:first-child[data-selected=true]_button]:rounded-l-md",
111
+ defaultClassNames.day
112
+ ),
113
+ range_start: cn(
114
+ "rounded-l-md bg-accent",
115
+ defaultClassNames.range_start
116
+ ),
117
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
118
+ range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
119
+ today: cn(
120
+ "rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none",
121
+ defaultClassNames.today
122
+ ),
123
+ outside: cn(
124
+ "text-muted-foreground aria-selected:text-muted-foreground",
125
+ defaultClassNames.outside
126
+ ),
127
+ disabled: cn(
128
+ "text-muted-foreground opacity-50",
129
+ defaultClassNames.disabled
130
+ ),
131
+ hidden: cn("invisible", defaultClassNames.hidden),
132
+ ...classNames,
133
+ }}
134
+ components={{
135
+ Root: ({ className, rootRef, ...props }) => {
136
+ return (
137
+ <div
138
+ data-slot="calendar"
139
+ ref={rootRef}
140
+ className={cn(className)}
141
+ {...props}
142
+ />
143
+ )
144
+ },
145
+ Chevron: ({ className, orientation, ...props }) => {
146
+ if (orientation === "left") {
147
+ return (
148
+ <ChevronLeftIcon className={cn("size-4", className)} {...props} />
149
+ )
150
+ }
151
+
152
+ if (orientation === "right") {
153
+ return (
154
+ <ChevronRightIcon
155
+ className={cn("size-4", className)}
156
+ {...props}
157
+ />
158
+ )
159
+ }
160
+
161
+ return (
162
+ <ChevronDownIcon className={cn("size-4", className)} {...props} />
163
+ )
164
+ },
165
+ DayButton: CalendarDayButton,
166
+ WeekNumber: ({ children, ...props }) => {
167
+ return (
168
+ <td {...props}>
169
+ <div className="flex size-(--cell-size) items-center justify-center text-center">
170
+ {children}
171
+ </div>
172
+ </td>
173
+ )
174
+ },
175
+ ...components,
176
+ }}
177
+ {...props}
178
+ />
179
+ )
180
+ }
181
+
182
+ function CalendarDayButton({
183
+ className,
184
+ day,
185
+ modifiers,
186
+ ...props
187
+ }: React.ComponentProps<typeof DayButton>) {
188
+ const defaultClassNames = getDefaultClassNames()
189
+
190
+ const ref = React.useRef<HTMLButtonElement>(null)
191
+ React.useEffect(() => {
192
+ if (modifiers.focused) ref.current?.focus()
193
+ }, [modifiers.focused])
194
+
195
+ return (
196
+ <Button
197
+ ref={ref}
198
+ variant="ghost"
199
+ size="icon"
200
+ data-day={day.date.toLocaleDateString()}
201
+ data-selected-single={
202
+ modifiers.selected &&
203
+ !modifiers.range_start &&
204
+ !modifiers.range_end &&
205
+ !modifiers.range_middle
206
+ }
207
+ data-range-start={modifiers.range_start}
208
+ data-range-end={modifiers.range_end}
209
+ data-range-middle={modifiers.range_middle}
210
+ className={cn(
211
+ "flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70",
212
+ defaultClassNames.day,
213
+ className
214
+ )}
215
+ {...props}
216
+ />
217
+ )
218
+ }
219
+
220
+ export { Calendar, CalendarDayButton }
@@ -0,0 +1,184 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Command as CommandPrimitive } from "cmdk"
5
+ import { cn } from "../menu/utils"
6
+ import { SearchIcon } from "lucide-react"
7
+
8
+ import {
9
+ Dialog,
10
+ DialogContent,
11
+ DialogDescription,
12
+ DialogHeader,
13
+ DialogTitle,
14
+ } from "./dialog"
15
+
16
+ function Command({
17
+ className,
18
+ ...props
19
+ }: React.ComponentProps<typeof CommandPrimitive>) {
20
+ return (
21
+ <CommandPrimitive
22
+ data-slot="command"
23
+ className={cn(
24
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
25
+ className
26
+ )}
27
+ {...props}
28
+ />
29
+ )
30
+ }
31
+
32
+ function CommandDialog({
33
+ title = "Command Palette",
34
+ description = "Search for a command to run...",
35
+ children,
36
+ className,
37
+ showCloseButton = true,
38
+ ...props
39
+ }: React.ComponentProps<typeof Dialog> & {
40
+ title?: string
41
+ description?: string
42
+ className?: string
43
+ showCloseButton?: boolean
44
+ }) {
45
+ return (
46
+ <Dialog {...props}>
47
+ <DialogHeader className="sr-only">
48
+ <DialogTitle>{title}</DialogTitle>
49
+ <DialogDescription>{description}</DialogDescription>
50
+ </DialogHeader>
51
+ <DialogContent
52
+ className={cn("overflow-hidden p-0", className)}
53
+ showCloseButton={showCloseButton}
54
+ >
55
+ <Command className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
56
+ {children}
57
+ </Command>
58
+ </DialogContent>
59
+ </Dialog>
60
+ )
61
+ }
62
+
63
+ function CommandInput({
64
+ className,
65
+ ...props
66
+ }: React.ComponentProps<typeof CommandPrimitive.Input>) {
67
+ return (
68
+ <div
69
+ data-slot="command-input-wrapper"
70
+ className="flex h-9 items-center gap-2 border-b px-3"
71
+ >
72
+ <SearchIcon className="size-4 shrink-0 opacity-50" />
73
+ <CommandPrimitive.Input
74
+ data-slot="command-input"
75
+ className={cn(
76
+ "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
77
+ className
78
+ )}
79
+ {...props}
80
+ />
81
+ </div>
82
+ )
83
+ }
84
+
85
+ function CommandList({
86
+ className,
87
+ ...props
88
+ }: React.ComponentProps<typeof CommandPrimitive.List>) {
89
+ return (
90
+ <CommandPrimitive.List
91
+ data-slot="command-list"
92
+ className={cn(
93
+ "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
94
+ className
95
+ )}
96
+ {...props}
97
+ />
98
+ )
99
+ }
100
+
101
+ function CommandEmpty({
102
+ ...props
103
+ }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
104
+ return (
105
+ <CommandPrimitive.Empty
106
+ data-slot="command-empty"
107
+ className="py-6 text-center text-sm"
108
+ {...props}
109
+ />
110
+ )
111
+ }
112
+
113
+ function CommandGroup({
114
+ className,
115
+ ...props
116
+ }: React.ComponentProps<typeof CommandPrimitive.Group>) {
117
+ return (
118
+ <CommandPrimitive.Group
119
+ data-slot="command-group"
120
+ className={cn(
121
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
122
+ className
123
+ )}
124
+ {...props}
125
+ />
126
+ )
127
+ }
128
+
129
+ function CommandSeparator({
130
+ className,
131
+ ...props
132
+ }: React.ComponentProps<typeof CommandPrimitive.Separator>) {
133
+ return (
134
+ <CommandPrimitive.Separator
135
+ data-slot="command-separator"
136
+ className={cn("-mx-1 h-px bg-border", className)}
137
+ {...props}
138
+ />
139
+ )
140
+ }
141
+
142
+ function CommandItem({
143
+ className,
144
+ ...props
145
+ }: React.ComponentProps<typeof CommandPrimitive.Item>) {
146
+ return (
147
+ <CommandPrimitive.Item
148
+ data-slot="command-item"
149
+ className={cn(
150
+ "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
151
+ className
152
+ )}
153
+ {...props}
154
+ />
155
+ )
156
+ }
157
+
158
+ function CommandShortcut({
159
+ className,
160
+ ...props
161
+ }: React.ComponentProps<"span">) {
162
+ return (
163
+ <span
164
+ data-slot="command-shortcut"
165
+ className={cn(
166
+ "ml-auto text-xs tracking-widest text-muted-foreground",
167
+ className
168
+ )}
169
+ {...props}
170
+ />
171
+ )
172
+ }
173
+
174
+ export {
175
+ Command,
176
+ CommandDialog,
177
+ CommandInput,
178
+ CommandList,
179
+ CommandEmpty,
180
+ CommandGroup,
181
+ CommandItem,
182
+ CommandShortcut,
183
+ CommandSeparator,
184
+ }
package/index.js CHANGED
@@ -38,7 +38,7 @@ import {
38
38
  * in a page (or this export) says which SDK a deployed app actually runs.
39
39
  * Kept in step with package.json by snapshot.test.mjs.
40
40
  */
41
- export const SDK_VERSION = "2.23.0";
41
+ export const SDK_VERSION = "2.25.0";
42
42
  if (typeof window !== "undefined") {
43
43
  try {
44
44
  window.__MAKO_APP_SDK__ = SDK_VERSION;
package/lint.js CHANGED
@@ -1,24 +1,37 @@
1
1
  #!/usr/bin/env node
2
- // mako-app-lint (2.21): the 2 app rules a reviewer kept repeating.
2
+ // mako-app-lint (2.21; react-version and --rules from 2.24, recharts check
3
+ // 2.25): app rules a
4
+ // reviewer kept repeating.
3
5
  //
4
6
  // utc-display getUTC*, timeZone: "UTC" or toISOString().slice in display
5
7
  // code. Instants show in the viewer's zone (formatTime), day
6
8
  // buckets unshifted (formatDate), keys come from toDayKey.
7
9
  // local-shadcn src/components/ui/<name>.tsx where @makoai/app-sdk ships
8
10
  // that component (/components, /menu). Import it instead.
11
+ // react-version an app on React below 19 that uses shadcn (src/components/ui,
12
+ // radix-ui, or the SDK's /components or /menu). shadcn's stock
13
+ // components pass refs as props, which React 18 drops: on
14
+ // 18 Nov 2026 a Calendar's arrow keys stopped moving focus.
15
+ // Also React 19 with recharts 2 and no react-is 19 override:
16
+ // recharts 2 reads chart children with react-is 18, which
17
+ // drops anything in a <> fragment (19 Nov 2026: reference
18
+ // lines vanished from a chart).
9
19
  //
10
- // Usage: npx mako-app-lint [app dir …] [--warn]. Exit 1 on findings unless
11
- // --warn. A line ending in `// mako-lint-ignore utc-display` is skipped (a
20
+ // Usage: npx mako-app-lint [app dir …] [--warn] [--rules=a,b]. Exit 1 on
21
+ // findings unless --warn. --rules runs only the named rules. A line ending in `// mako-lint-ignore utc-display` is skipped (a
12
22
  // date key the helpers cannot build, with the reason on the line above).
13
23
  import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from "node:fs";
14
24
  import path from "node:path";
15
25
  import { fileURLToPath } from "node:url";
16
26
 
27
+ /** Components on their own subpath: they need a peer most apps lack (react-day-picker, cmdk). */
28
+ export const SDK_SUBPATH_COMPONENTS = ["calendar", "command"];
29
+
17
30
  export const SDK_COMPONENTS = [
18
31
  "alert", "avatar", "badge", "button", "card", "checkbox", "collapsible",
19
32
  "dialog", "dropdown-menu", "input", "label", "popover", "progress",
20
33
  "select", "separator", "sheet", "skeleton", "slider", "switch", "table",
21
- "tabs", "toggle", "toggle-group", "tooltip",
34
+ "tabs", "toggle", "toggle-group", "tooltip", ...SDK_SUBPATH_COMPONENTS,
22
35
  ];
23
36
 
24
37
  const UTC_DISPLAY = /\.getUTC(?:FullYear|Month|Date|Day|Hours|Minutes|Seconds)\(|timeZone:\s*["']UTC["']|toISOString\(\)\s*\.\s*(?:slice|substring|substr)\(/;
@@ -34,21 +47,74 @@ function walk(dir, out = []) {
34
47
  return out;
35
48
  }
36
49
 
37
- /** Findings for one app folder: { file, line, rule, message }. */
38
- export function lintApp(appDir) {
39
- const findings = [];
50
+ /** The lowest major a package.json range allows: "^18.2.0" → 18, ">=19" → 19; null when unreadable. */
51
+ export function minMajor(range) {
52
+ const m = /(\d+)/.exec(String(range ?? ""));
53
+ return m ? Number(m[1]) : null;
54
+ }
55
+
56
+ /** The react-is range an override pins: pnpm.overrides, npm overrides or yarn resolutions. */
57
+ function reactIsOverride(pkg) {
58
+ return pkg.pnpm?.overrides?.["react-is"] ?? pkg.overrides?.["react-is"] ?? pkg.resolutions?.["react-is"];
59
+ }
60
+
61
+ /** react-version: React below 19 with shadcn, or React 19 with recharts 2 on react-is 18. */
62
+ function reactVersionFindings(appDir) {
63
+ const pj = path.join(appDir, "package.json");
64
+ if (!existsSync(pj)) return [];
65
+ let pkg;
66
+ try {
67
+ pkg = JSON.parse(readFileSync(pj, "utf8"));
68
+ } catch {
69
+ return [];
70
+ }
71
+ const deps = { ...pkg.dependencies, ...pkg.devDependencies };
72
+ const major = minMajor(deps.react);
73
+ if (major == null) return [];
74
+ if (major >= 19) {
75
+ if (minMajor(deps.recharts) !== 2 || (minMajor(reactIsOverride(pkg)) ?? 0) >= 19) return [];
76
+ return [{
77
+ file: "package.json",
78
+ line: 1,
79
+ rule: "react-version",
80
+ message: `React ${deps.react} with recharts ${deps.recharts}: recharts 2 reads chart children with react-is 18, which drops anything in a <> fragment. Add "pnpm": { "overrides": { "react-is": "^19.1.10" } }`,
81
+ }];
82
+ }
83
+ const why = [];
84
+ if (existsSync(path.join(appDir, "src", "components", "ui"))) why.push("src/components/ui");
85
+ if (Object.keys(deps).some(d => d === "radix-ui" || d.startsWith("@radix-ui/"))) why.push("radix-ui");
86
+ if (walk(path.join(appDir, "src")).some(f => /@makoai\/app-sdk\/(components|menu)/.test(readFileSync(f, "utf8")))) {
87
+ why.push("@makoai/app-sdk/components or /menu");
88
+ }
89
+ if (!why.length) return [];
90
+ return [{
91
+ file: "package.json",
92
+ line: 1,
93
+ rule: "react-version",
94
+ message: `React ${deps.react} with shadcn (${why.join(", ")}): shadcn passes refs as props, which React 18 drops. Move to react and react-dom ^19`,
95
+ }];
96
+ }
97
+
98
+ /** Findings for one app folder: { file, line, rule, message }. `rules` limits them (default: all). */
99
+ export function lintApp(appDir, rules) {
100
+ const on = name => !rules || rules.includes(name);
101
+ const findings = on("react-version") ? reactVersionFindings(appDir) : [];
40
102
  const src = path.join(appDir, "src");
41
103
  for (const file of walk(src)) {
42
104
  const rel = path.relative(appDir, file);
43
105
  const ui = /^src[\\/]components[\\/]ui[\\/]([a-z-]+)\.tsx$/.exec(rel);
44
- if (ui && SDK_COMPONENTS.includes(ui[1])) {
45
- const from = ["dropdown-menu", "checkbox"].includes(ui[1]) ? "@makoai/app-sdk/menu" : "@makoai/app-sdk/components";
106
+ if (on("local-shadcn") && ui && SDK_COMPONENTS.includes(ui[1])) {
107
+ const from = ["dropdown-menu", "checkbox"].includes(ui[1])
108
+ ? "@makoai/app-sdk/menu"
109
+ : SDK_SUBPATH_COMPONENTS.includes(ui[1])
110
+ ? `@makoai/app-sdk/components/${ui[1]}`
111
+ : "@makoai/app-sdk/components";
46
112
  findings.push({ file: rel, line: 1, rule: "local-shadcn", message: `the SDK ships ${ui[1]}: import it from "${from}" and delete this copy` });
47
113
  }
48
114
  readFileSync(file, "utf8")
49
115
  .split("\n")
50
116
  .forEach((text, i) => {
51
- if (!UTC_DISPLAY.test(text) || /mako-lint-ignore utc-display/.test(text)) return;
117
+ if (!on("utc-display") || !UTC_DISPLAY.test(text) || /mako-lint-ignore utc-display/.test(text)) return;
52
118
  findings.push({
53
119
  file: rel,
54
120
  line: i + 1,
@@ -62,10 +128,12 @@ export function lintApp(appDir) {
62
128
 
63
129
  function main(argv) {
64
130
  const warn = argv.includes("--warn");
131
+ const rulesArg = argv.find(a => a.startsWith("--rules="));
132
+ const rules = rulesArg ? rulesArg.slice("--rules=".length).split(",").filter(Boolean) : undefined;
65
133
  const dirs = argv.filter(a => !a.startsWith("--"));
66
134
  let total = 0;
67
135
  for (const dir of dirs.length ? dirs : ["."]) {
68
- for (const f of lintApp(path.resolve(dir))) {
136
+ for (const f of lintApp(path.resolve(dir), rules)) {
69
137
  total++;
70
138
  console.log(`${path.join(dir, f.file)}:${f.line} ${f.rule} ${f.message}`);
71
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makoai/app-sdk",
3
- "version": "2.23.0",
3
+ "version": "2.25.0",
4
4
  "description": "Mako app SDK: data bindings (useQuery/useDuckDB), URL state, theme, and the house dashboard kit (/ui).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -47,6 +47,14 @@
47
47
  "types": "./components/index.ts",
48
48
  "default": "./components/index.ts"
49
49
  },
50
+ "./components/calendar": {
51
+ "types": "./components/calendar.tsx",
52
+ "default": "./components/calendar.tsx"
53
+ },
54
+ "./components/command": {
55
+ "types": "./components/command.tsx",
56
+ "default": "./components/command.tsx"
57
+ },
50
58
  "./ui.css": "./ui.css",
51
59
  "./tailwind.css": "./tailwind.css"
52
60
  },
@@ -73,9 +81,11 @@
73
81
  "peerDependencies": {
74
82
  "class-variance-authority": ">=0.7",
75
83
  "clsx": ">=2",
84
+ "cmdk": ">=1",
76
85
  "lucide-react": ">=0.400",
77
86
  "radix-ui": ">=1.4",
78
87
  "react": ">=18",
88
+ "react-day-picker": ">=9",
79
89
  "react-dom": ">=18",
80
90
  "tailwind-merge": ">=2"
81
91
  },
@@ -86,12 +96,18 @@
86
96
  "clsx": {
87
97
  "optional": true
88
98
  },
99
+ "cmdk": {
100
+ "optional": true
101
+ },
89
102
  "lucide-react": {
90
103
  "optional": true
91
104
  },
92
105
  "radix-ui": {
93
106
  "optional": true
94
107
  },
108
+ "react-day-picker": {
109
+ "optional": true
110
+ },
95
111
  "tailwind-merge": {
96
112
  "optional": true
97
113
  }
@@ -106,10 +122,12 @@
106
122
  "apache-arrow": "17.0.0",
107
123
  "class-variance-authority": "^0.7.1",
108
124
  "clsx": "^2.1.1",
125
+ "cmdk": "^1.1.1",
109
126
  "esbuild": "^0.28.2",
110
127
  "jsdom": "^30.1.2",
111
128
  "lucide-react": "^1.61.0",
112
129
  "radix-ui": "^1.8.1",
130
+ "react-day-picker": "^10.0.2",
113
131
  "tailwind-merge": "^3.7.0"
114
132
  }
115
133
  }