@pebble-software/bonsai 0.1.1 → 0.1.2

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.
@@ -1,13 +1,13 @@
1
- import { COMPONENT as h } from "../constants.js";
2
- import { jsxs as p, jsx as t } from "react/jsx-runtime";
3
- import * as x from "react";
4
- import { getDefaultClassNames as _, DayPicker as S } from "react-day-picker";
5
- import { c as a, b, B as z } from "../chunks/button-jfJanilw.js";
6
- import { IconSelector as k, IconCheck as C, IconChevronUp as D, IconChevronDown as v, IconChevronLeft as I, IconChevronRight as j } from "@tabler/icons-react";
1
+ import { COMPONENT as w } from "../constants.js";
2
+ import { jsxs as h, jsx as t } from "react/jsx-runtime";
3
+ import * as N from "react";
4
+ import { getDefaultClassNames as C, DayPicker as I } from "react-day-picker";
5
+ import { c as a, b as p, B as j } from "../chunks/button-jfJanilw.js";
6
+ import { IconSelector as P, IconCheck as L, IconChevronUp as R, IconChevronDown as _, IconChevronLeft as A, IconChevronRight as B } from "@tabler/icons-react";
7
7
  import { Select as s } from "@base-ui/react/select";
8
- const y = s.Root;
9
- y.displayName = "Select";
10
- function P({ className: n, ...e }) {
8
+ const S = s.Root;
9
+ S.displayName = "Select";
10
+ function E({ className: n, ...e }) {
11
11
  return /* @__PURE__ */ t(
12
12
  s.Value,
13
13
  {
@@ -21,23 +21,23 @@ function P({ className: n, ...e }) {
21
21
  }
22
22
  );
23
23
  }
24
- function L({
24
+ function T({
25
25
  className: n,
26
26
  size: e = "lg",
27
- variant: i = "outline",
27
+ variant: d = "outline",
28
28
  raised: c,
29
29
  extrude: m,
30
30
  children: f,
31
31
  ...r
32
32
  }) {
33
- return /* @__PURE__ */ p(
33
+ return /* @__PURE__ */ h(
34
34
  s.Trigger,
35
35
  {
36
36
  "data-slot": "select-trigger",
37
37
  "data-size": e,
38
38
  "aria-label": r["aria-label"] ?? "select-trigger",
39
39
  className: a(
40
- b({ size: e, variant: i, raised: c, extrude: m }),
40
+ p({ size: e, variant: d, raised: c, extrude: m }),
41
41
  "group/select-trigger neo-base neo-input-focus disabled:opacity-50 [&_svg]:shrink-0 w-full",
42
42
  n
43
43
  ),
@@ -49,7 +49,7 @@ function L({
49
49
  {
50
50
  className: "flex items-center justify-center",
51
51
  render: /* @__PURE__ */ t(
52
- k,
52
+ P,
53
53
  {
54
54
  "data-slot": "select-selector",
55
55
  className: "text-muted size-4 pointer-events-none"
@@ -61,10 +61,10 @@ function L({
61
61
  }
62
62
  );
63
63
  }
64
- function R({
64
+ function M({
65
65
  className: n,
66
66
  children: e,
67
- side: i = "bottom",
67
+ side: d = "bottom",
68
68
  sideOffset: c = 4,
69
69
  align: m = "center",
70
70
  alignOffset: f = 0,
@@ -74,13 +74,13 @@ function R({
74
74
  return /* @__PURE__ */ t(s.Portal, { children: /* @__PURE__ */ t(
75
75
  s.Positioner,
76
76
  {
77
- side: i,
77
+ side: d,
78
78
  sideOffset: c,
79
79
  align: m,
80
80
  alignOffset: f,
81
81
  alignItemWithTrigger: r,
82
82
  className: "isolate z-50",
83
- children: /* @__PURE__ */ p(
83
+ children: /* @__PURE__ */ h(
84
84
  s.Popup,
85
85
  {
86
86
  "data-slot": "select-content",
@@ -98,21 +98,21 @@ function R({
98
98
  ),
99
99
  ...g,
100
100
  children: [
101
- /* @__PURE__ */ t(B, {}),
101
+ /* @__PURE__ */ t(V, {}),
102
102
  /* @__PURE__ */ t(s.List, { className: "flex flex-col gap-0.5 p-0.5", children: e }),
103
- /* @__PURE__ */ t(E, {})
103
+ /* @__PURE__ */ t(W, {})
104
104
  ]
105
105
  }
106
106
  )
107
107
  }
108
108
  ) });
109
109
  }
110
- function A({
110
+ function U({
111
111
  className: n,
112
112
  children: e,
113
- ...i
113
+ ...d
114
114
  }) {
115
- return /* @__PURE__ */ p(
115
+ return /* @__PURE__ */ h(
116
116
  s.Item,
117
117
  {
118
118
  "data-slot": "select-item",
@@ -124,21 +124,21 @@ function A({
124
124
  "[&_svg]:pointer-events-none [&_svg]:shrink-0",
125
125
  n
126
126
  ),
127
- ...i,
127
+ ...d,
128
128
  children: [
129
129
  /* @__PURE__ */ t(s.ItemText, { className: "flex flex-1 gap-2 shrink-0 whitespace-nowrap", children: e }),
130
130
  /* @__PURE__ */ t(
131
131
  s.ItemIndicator,
132
132
  {
133
133
  render: /* @__PURE__ */ t("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
134
- children: /* @__PURE__ */ t(C, { className: "pointer-events-none" })
134
+ children: /* @__PURE__ */ t(L, { className: "pointer-events-none" })
135
135
  }
136
136
  )
137
137
  ]
138
138
  }
139
139
  );
140
140
  }
141
- function B({
141
+ function V({
142
142
  className: n,
143
143
  ...e
144
144
  }) {
@@ -151,11 +151,11 @@ function B({
151
151
  n
152
152
  ),
153
153
  ...e,
154
- children: /* @__PURE__ */ t(D, {})
154
+ children: /* @__PURE__ */ t(R, {})
155
155
  }
156
156
  );
157
157
  }
158
- function E({
158
+ function W({
159
159
  className: n,
160
160
  ...e
161
161
  }) {
@@ -168,27 +168,29 @@ function E({
168
168
  n
169
169
  ),
170
170
  ...e,
171
- children: /* @__PURE__ */ t(v, {})
171
+ children: /* @__PURE__ */ t(_, {})
172
172
  }
173
173
  );
174
174
  }
175
- function T({
175
+ function O({
176
176
  className: n,
177
177
  classNames: e,
178
- showOutsideDays: i = !0,
178
+ showOutsideDays: d = !0,
179
179
  captionLayout: c = "label",
180
180
  hideWeekdays: m = !1,
181
181
  buttonVariant: f = "outline",
182
182
  hideWeekends: r,
183
183
  formatters: g,
184
- components: w,
185
- ...N
184
+ components: z,
185
+ ...x
186
186
  }) {
187
- const o = _();
187
+ const o = C(), { selected: b } = x, v = typeof b == "string" ? $(b) : void 0, D = v ? { ...x, selected: v } : x;
188
188
  return /* @__PURE__ */ t(
189
- S,
189
+ I,
190
190
  {
191
- showOutsideDays: i,
191
+ mode: "single",
192
+ defaultMonth: v ?? (b instanceof Date ? b : void 0),
193
+ showOutsideDays: d,
192
194
  className: a(
193
195
  "p-3 bg-surface group/calendar [--cell-size:--spacing(8)]",
194
196
  "in-data-[slot=card-content]:bg-transparent",
@@ -208,12 +210,12 @@ function T({
208
210
  o.nav
209
211
  ),
210
212
  button_previous: a(
211
- b({ variant: f, icon: "sm" }),
213
+ p({ variant: f, icon: "sm" }),
212
214
  "aria-disabled:opacity-50 aria-disabled:translate-[0px] aria-disabled:shadow-none aria-disabled:pointer-events-none",
213
215
  o.button_previous
214
216
  ),
215
217
  button_next: a(
216
- b({ variant: f, icon: "sm" }),
218
+ p({ variant: f, icon: "sm" }),
217
219
  "aria-disabled:opacity-50 aria-disabled:translate-[0px] aria-disabled:shadow-none aria-disabled:pointer-events-none",
218
220
  o.button_next
219
221
  ),
@@ -257,48 +259,54 @@ function T({
257
259
  ...e
258
260
  },
259
261
  components: {
260
- Root: ({ className: l, rootRef: d, ...u }) => /* @__PURE__ */ t(
262
+ Root: ({ className: l, rootRef: i, ...u }) => /* @__PURE__ */ t(
261
263
  "div",
262
264
  {
263
265
  "data-slot": "calendar",
264
- ref: d,
266
+ ref: i,
265
267
  className: a(l),
266
268
  ...u
267
269
  }
268
270
  ),
269
- Chevron: ({ className: l, orientation: d, ...u }) => d === "left" ? /* @__PURE__ */ t(I, { className: a("size-4", l), ...u }) : d === "right" ? /* @__PURE__ */ t(
270
- j,
271
+ Chevron: ({ className: l, orientation: i, ...u }) => i === "left" ? /* @__PURE__ */ t(A, { className: a("size-4", l), ...u }) : i === "right" ? /* @__PURE__ */ t(
272
+ B,
271
273
  {
272
274
  className: a("size-4", l),
273
275
  ...u
274
276
  }
275
- ) : /* @__PURE__ */ t(v, { className: a("size-4", l), ...u }),
276
- Weekday: ({ children: l, ...d }) => {
277
- const u = d["aria-label"] === "Saturday" || d["aria-label"] === "Sunday";
278
- return r && u ? /* @__PURE__ */ t("td", { hidden: !0 }) : /* @__PURE__ */ t("td", { ...d, children: l });
277
+ ) : /* @__PURE__ */ t(_, { className: a("size-4", l), ...u }),
278
+ Weekday: ({ children: l, ...i }) => {
279
+ const u = i["aria-label"] === "Saturday" || i["aria-label"] === "Sunday";
280
+ return r && u ? /* @__PURE__ */ t("td", { hidden: !0 }) : /* @__PURE__ */ t("td", { ...i, children: l });
279
281
  },
280
- Day: ({ children: l, ...d }) => {
281
- const u = new Date(d.day.date).getDay();
282
- return r && (u === 0 || u === 6) ? /* @__PURE__ */ t("td", { hidden: !0 }) : d.modifiers.hidden ? /* @__PURE__ */ t("td", { className: "all-unset size-(--cell-size) m-1 bg-foreground opacity-20 rounded-base" }) : /* @__PURE__ */ t("td", { ...d, children: l });
282
+ // `day` and `modifiers` are for us, not the DOM: spread onto the <td>
283
+ // they leak as `day="[object Object]"` attributes.
284
+ Day: ({ children: l, day: i, modifiers: u, ...k }) => {
285
+ const y = new Date(i.date).getDay();
286
+ return r && (y === 0 || y === 6) ? /* @__PURE__ */ t("td", { hidden: !0 }) : u.hidden ? /* @__PURE__ */ t("td", { className: "all-unset size-(--cell-size) m-1 bg-foreground opacity-20 rounded-base" }) : /* @__PURE__ */ t("td", { ...k, children: l });
283
287
  },
284
- Dropdown: V,
285
- DayButton: U,
286
- ...w
288
+ Dropdown: F,
289
+ DayButton: q,
290
+ ...z
287
291
  },
288
- ...N
292
+ ...D
289
293
  }
290
294
  );
291
295
  }
292
- function U({
296
+ function $(n) {
297
+ const e = /^(\d{4})-(\d{2})-(\d{2})$/.exec(n);
298
+ return e ? new Date(+e[1], +e[2] - 1, +e[3]) : new Date(n);
299
+ }
300
+ function q({
293
301
  day: n,
294
302
  modifiers: e,
295
- ...i
303
+ ...d
296
304
  }) {
297
- const c = x.useRef(null);
298
- return x.useEffect(() => {
305
+ const c = N.useRef(null);
306
+ return N.useEffect(() => {
299
307
  e.focused && c.current?.focus();
300
308
  }, [e.focused]), /* @__PURE__ */ t(
301
- z,
309
+ j,
302
310
  {
303
311
  "data-slot": "calendar-day-button",
304
312
  "data-day": n.date.toLocaleDateString(),
@@ -312,38 +320,38 @@ function U({
312
320
  extrude: e.selected ? null : "xs",
313
321
  disabled: e.disabled,
314
322
  icon: "sm",
315
- ...i
323
+ ...d
316
324
  }
317
325
  );
318
326
  }
319
- function V(n) {
320
- const { options: e, onChange: i, value: c } = n, m = e?.find((r) => r.value === c), f = (r) => {
321
- i?.({
327
+ function F(n) {
328
+ const { options: e, onChange: d, value: c } = n, m = e?.find((r) => r.value === c), f = (r) => {
329
+ d?.({
322
330
  target: { value: r }
323
331
  });
324
332
  };
325
- return /* @__PURE__ */ p(
326
- y,
333
+ return /* @__PURE__ */ h(
334
+ S,
327
335
  {
328
336
  value: c?.toString(),
329
337
  onValueChange: (r) => f(r),
330
338
  children: [
331
339
  /* @__PURE__ */ t(
332
- L,
340
+ T,
333
341
  {
334
342
  variant: "ghost",
335
343
  raised: null,
336
344
  extrude: null,
337
345
  className: "w-fit mx-1",
338
346
  size: "sm",
339
- children: /* @__PURE__ */ t(P, { children: m?.label })
347
+ children: /* @__PURE__ */ t(E, { children: m?.label })
340
348
  }
341
349
  ),
342
- /* @__PURE__ */ t(R, { className: "bg-transparent border-0 w-30 shadow-none", children: /* @__PURE__ */ t("div", { className: "p-2", children: /* @__PURE__ */ t("div", { className: "flex flex-col items-center bg-foreground shadow-xs rounded-base", children: e?.map((r) => /* @__PURE__ */ t(
343
- A,
350
+ /* @__PURE__ */ t(M, { className: "bg-transparent border-0 w-30 shadow-none", children: /* @__PURE__ */ t("div", { className: "p-2", children: /* @__PURE__ */ t("div", { className: "flex flex-col items-center bg-foreground shadow-xs rounded-base", children: e?.map((r) => /* @__PURE__ */ t(
351
+ U,
344
352
  {
345
353
  className: a(
346
- b({ extrude: "md" }),
354
+ p({ extrude: "md" }),
347
355
  "not-last:rounded-b-none not-first:rounded-t-none border-2 not-last:border-b-0 hover:border-2 hover:z-2 z-1 duration-200"
348
356
  ),
349
357
  value: r.value.toString(),
@@ -355,12 +363,12 @@ function V(n) {
355
363
  }
356
364
  );
357
365
  }
358
- const H = {
366
+ const Z = {
359
367
  components: {
360
- [h.CALENDAR]: T
368
+ [w.CALENDAR]: O
361
369
  },
362
370
  controlledInputs: {
363
- [h.CALENDAR]: {
371
+ [w.CALENDAR]: {
364
372
  valueProp: "selected",
365
373
  changeProp: "onSelect",
366
374
  extractor: (n) => n
@@ -368,7 +376,7 @@ const H = {
368
376
  }
369
377
  };
370
378
  export {
371
- T as Calendar,
372
- H as calendarPreset
379
+ O as Calendar,
380
+ Z as calendarPreset
373
381
  };
374
382
  //# sourceMappingURL=calendar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","sources":["../../src/components/ui/select.tsx","../../src/components/ui/calendar.tsx","../../src/renderer/presets/calendar.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Select as SelectPrimitive } from \"@base-ui/react/select\";\nimport {\n IconSelector,\n IconCheck,\n IconChevronUp,\n IconChevronDown,\n} from \"@tabler/icons-react\";\nimport { cn } from \"@/lib/utils\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport { buttonVariants } from \"./button\";\n\nconst Select = SelectPrimitive.Root;\n(Select as any).displayName = \"Select\";\n\nfunction SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {\n return (\n <SelectPrimitive.Group\n data-slot=\"select-group\"\n className={cn(\"scroll-my-1 p-1\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectValue({ className, ...props }: SelectPrimitive.Value.Props) {\n return (\n <SelectPrimitive.Value\n data-slot=\"select-value\"\n className={cn(\n \"flex flex-1 text-left\",\n \"group/select-trigger:line-clamp-1 group/select-trigger:items-center data-placeholder:text-subtle font-base\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface SelectTriggerProps\n extends\n SelectPrimitive.Trigger.Props,\n Omit<VariantProps<typeof buttonVariants>, \"icon\"> {}\n\nfunction SelectTrigger({\n className,\n size = \"lg\",\n variant = \"outline\",\n raised,\n extrude,\n children,\n ...props\n}: SelectTriggerProps) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n aria-label={props[\"aria-label\"] ?? \"select-trigger\"}\n className={cn(\n buttonVariants({ size, variant, raised, extrude }),\n \"group/select-trigger neo-base neo-input-focus disabled:opacity-50 [&_svg]:shrink-0 w-full\",\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon\n className=\"flex items-center justify-center\"\n render={\n <IconSelector\n data-slot=\"select-selector\"\n className=\"text-muted size-4 pointer-events-none\"\n />\n }\n />\n </SelectPrimitive.Trigger>\n );\n}\n\nfunction SelectContent({\n className,\n children,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n alignItemWithTrigger = true,\n ...props\n}: SelectPrimitive.Popup.Props &\n Pick<\n SelectPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"alignItemWithTrigger\"\n >) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n className=\"isolate z-50\"\n >\n <SelectPrimitive.Popup\n data-slot=\"select-content\"\n className={cn(\n \"neo-base neo-focus relative isolate bg-surface text-foreground rounded-base shadow-md border-2 z-50 duration-100\",\n \"max-h-(--available-height) w-(--anchor-width) min-w-36\",\n \"origin-(--transform-origin) overflow-x-hidden overflow-y-auto\",\n \"data-open:animate-in data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95\",\n \"data-closed:animate-out data-closed:fade-out-0\",\n \"data-[side=top]:slide-in-from-bottom-2\",\n \"data-[side=bottom]:slide-in-from-top-2\",\n \"data-[side=left]:slide-in-from-right-2\",\n \"data-[side=right]:slide-in-from-left-2\",\n className,\n )}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.List className=\"flex flex-col gap-0.5 p-0.5\">\n {children}\n </SelectPrimitive.List>\n <SelectScrollDownButton />\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n );\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: SelectPrimitive.GroupLabel.Props) {\n return (\n <SelectPrimitive.GroupLabel\n data-slot=\"select-label\"\n className={cn(\"text-muted px-2 py-1.5 text-xs\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: SelectPrimitive.Item.Props) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"neo-base flex items-center gap-2 py-1.5 pr-8 pl-2 relative w-full cursor-pointer select-none\",\n \"border-2 border-transparent hover:border-border focus-visible:border-border outline-hidden rounded-base text-sm\",\n \"*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n >\n <SelectPrimitive.ItemText className=\"flex flex-1 gap-2 shrink-0 whitespace-nowrap\">\n {children}\n </SelectPrimitive.ItemText>\n <SelectPrimitive.ItemIndicator\n render={\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />\n }\n >\n <IconCheck className=\"pointer-events-none\" />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n );\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: SelectPrimitive.Separator.Props) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\n \"bg-foreground -mx-1 my-1 h-px pointer-events-none\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {\n return (\n <SelectPrimitive.ScrollUpArrow\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"bg-surface z-10 flex cursor-default items-center justify-center py-1 top-0 w-full\",\n className,\n )}\n {...props}\n >\n <IconChevronUp />\n </SelectPrimitive.ScrollUpArrow>\n );\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {\n return (\n <SelectPrimitive.ScrollDownArrow\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"bg-surface z-10 flex cursor-default items-center justify-center py-1 bottom-0 w-full\",\n className,\n )}\n {...props}\n >\n <IconChevronDown />\n </SelectPrimitive.ScrollDownArrow>\n );\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n DayPicker,\n getDefaultClassNames,\n type DayButton,\n type DropdownOption,\n} from \"react-day-picker\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Button, buttonVariants } from \"@/components/ui/button\";\nimport {\n IconChevronLeft,\n IconChevronRight,\n IconChevronDown,\n} from \"@tabler/icons-react\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"./select\";\n\ntype CalendarProps = React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"];\n hideWeekends?: boolean;\n};\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n hideWeekdays = false,\n buttonVariant = \"outline\",\n hideWeekends,\n formatters,\n components,\n ...props\n}: CalendarProps) {\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n \"p-3 bg-surface group/calendar [--cell-size:--spacing(8)]\",\n \"in-data-[slot=card-content]:bg-transparent\",\n \"in-data-[slot=popover-content]:bg-transparent\",\n className,\n )}\n captionLayout={captionLayout}\n formatters={{\n formatCaption: (date) =>\n date.toLocaleString(\"default\", { month: \"short\", year: \"numeric\" }),\n formatMonthDropdown: (date) =>\n date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n nav: cn(\n \"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between\",\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant, icon: \"sm\" }),\n \"aria-disabled:opacity-50 aria-disabled:translate-[0px] aria-disabled:shadow-none aria-disabled:pointer-events-none\",\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant, icon: \"sm\" }),\n \"aria-disabled:opacity-50 aria-disabled:translate-[0px] aria-disabled:shadow-none aria-disabled:pointer-events-none\",\n defaultClassNames.button_next,\n ),\n caption_label: cn(\"select-none\", defaultClassNames.caption_label),\n months: cn(\n \"flex gap-4 flex-col md:flex-row relative\",\n defaultClassNames.months,\n ),\n month: cn(\n \"flex flex-col w-full gap-4 *:first:*:h-(--cell-size) *:first:*:flex *:first:*:items-center *:first:*:justify-center *:first:**:font-medium *:first:**:font-heading *:first:**:text-base\",\n defaultClassNames.month,\n ),\n month_grid: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n hideWeekdays\n ? \"hidden\"\n : \"text-sm font-normal font-heading text-muted text-center select-none flex-1\",\n defaultClassNames.weekday,\n ),\n week_number: cn(\n \"text-sm font-normal font-heading text-muted text-center select-none flex size-(--cell-size) items-center justify-center my-auto\",\n defaultClassNames.week_number,\n ),\n week_number_header: cn(\n \"select-none w-(--cell-size)\",\n defaultClassNames.week_number_header,\n ),\n week: cn(\"flex w-full\", defaultClassNames.week),\n day: cn(\n \"relative text-center group/day select-none transition-[width,padding,margin] duration-200\",\n defaultClassNames.day,\n ),\n day_button: cn(\"m-1\", defaultClassNames.day_button),\n today: cn(\n \"*:data-[slot=calendar-day-button]:font-semibold *:data-[slot=calendar-day-button]:text-lg\",\n defaultClassNames.today,\n ),\n outside: cn(\n \"text-muted aria-selected:text-foreground opacity-50 hover:opacity-100 aria-selected:opacity-100 aria-selected:*:data-[slot=calendar-day-button]:bg-main-secondary hover:*:data-[slot=calendar-day-button]:bg-surface *:data-[slot=calendar-day-button]:bg-foreground/20\",\n defaultClassNames.outside,\n ),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n );\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return (\n <IconChevronLeft className={cn(\"size-4\", className)} {...props} />\n );\n }\n\n if (orientation === \"right\") {\n return (\n <IconChevronRight\n className={cn(\"size-4\", className)}\n {...props}\n />\n );\n }\n\n return (\n <IconChevronDown className={cn(\"size-4\", className)} {...props} />\n );\n },\n Weekday: ({ children, ...props }) => {\n const isWeekend =\n props[\"aria-label\"] === \"Saturday\" ||\n props[\"aria-label\"] === \"Sunday\";\n if (hideWeekends && isWeekend) {\n return <td hidden />;\n }\n return <td {...props}>{children}</td>;\n },\n Day: ({ children, ...props }) => {\n const weekday = new Date(props.day.date).getDay();\n const isWeekend = weekday === 0 || weekday === 6;\n if (hideWeekends && isWeekend) {\n return <td hidden />;\n }\n if (props.modifiers.hidden) {\n return (\n <td className=\"all-unset size-(--cell-size) m-1 bg-foreground opacity-20 rounded-base\" />\n );\n }\n return <td {...props}>{children}</td>;\n },\n Dropdown: CalendarDropdown,\n DayButton: CalendarDayButton,\n ...components,\n }}\n {...props}\n />\n );\n}\n\nfunction CalendarDayButton({\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <Button\n data-slot=\"calendar-day-button\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n aria-label={day.date.toDateString()}\n raised={\n modifiers.range_start || modifiers.range_end\n ? \"md\"\n : modifiers.range_middle\n ? \"xs\"\n : \"sm\"\n }\n variant={modifiers.selected ? \"default\" : \"outline\"}\n extrude={modifiers.selected ? null : \"xs\"}\n disabled={modifiers.disabled}\n icon=\"sm\"\n {...props}\n />\n );\n}\n\nfunction CalendarDropdown(\n props: Omit<React.SelectHTMLAttributes<HTMLSelectElement>, \"children\"> & {\n options?: DropdownOption[] | undefined;\n },\n) {\n const { options, onChange, value } = props;\n const selected = options?.find((option) => option.value === value);\n const handleChange = (value: string) => {\n const changeEvent = {\n target: { value },\n } as React.ChangeEvent<HTMLSelectElement>;\n onChange?.(changeEvent);\n };\n\n return (\n <Select\n value={value?.toString()}\n onValueChange={(value) => handleChange(value as any)}\n >\n <SelectTrigger\n variant=\"ghost\"\n raised={null}\n extrude={null}\n className=\"w-fit mx-1\"\n size=\"sm\"\n >\n <SelectValue>{selected?.label}</SelectValue>\n </SelectTrigger>\n <SelectContent className=\"bg-transparent border-0 w-30 shadow-none\">\n <div className=\"p-2\">\n <div className=\"flex flex-col items-center bg-foreground shadow-xs rounded-base\">\n {options?.map((option) => (\n <SelectItem\n className={cn(\n buttonVariants({ extrude: \"md\" }),\n \"not-last:rounded-b-none not-first:rounded-t-none border-2 not-last:border-b-0 hover:border-2 hover:z-2 z-1 duration-200\",\n )}\n key={option.value}\n value={option.value.toString()}\n >\n {option.label}\n </SelectItem>\n ))}\n </div>\n </div>\n </SelectContent>\n </Select>\n );\n}\n\nexport { Calendar };\n","import { COMPONENT } from \"@bonsai/constants\";\n\nimport { Calendar } from \"../../components/ui/calendar\";\nimport type { BonsaiPreset } from \"../core-registry\";\n\n/** Opt-in `calendar` component. Pulls in react-day-picker. */\nexport const calendarPreset: BonsaiPreset = {\n components: {\n [COMPONENT.CALENDAR]: Calendar,\n },\n controlledInputs: {\n [COMPONENT.CALENDAR]: {\n valueProp: \"selected\",\n changeProp: \"onSelect\",\n extractor: (date) => date,\n },\n },\n};\n\nexport { Calendar };\n"],"names":["Select","SelectPrimitive","SelectValue","className","props","jsx","cn","SelectTrigger","size","variant","raised","extrude","children","jsxs","buttonVariants","IconSelector","SelectContent","side","sideOffset","align","alignOffset","alignItemWithTrigger","SelectScrollUpButton","SelectScrollDownButton","SelectItem","IconCheck","IconChevronUp","IconChevronDown","Calendar","classNames","showOutsideDays","captionLayout","hideWeekdays","buttonVariant","hideWeekends","formatters","components","defaultClassNames","getDefaultClassNames","DayPicker","date","rootRef","orientation","IconChevronLeft","IconChevronRight","isWeekend","weekday","CalendarDropdown","CalendarDayButton","day","modifiers","ref","React","Button","options","onChange","value","selected","option","handleChange","calendarPreset","COMPONENT"],"mappings":";;;;;;;AAcA,MAAMA,IAASC,EAAgB;AAC9BD,EAAe,cAAc;AAY9B,SAASE,EAAY,EAAE,WAAAC,GAAW,GAAGC,KAAsC;AACzE,SACE,gBAAAC;AAAA,IAACJ,EAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAWK;AAAA,QACT;AAAA,QACA;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAOA,SAASG,EAAc;AAAA,EACrB,WAAAJ;AAAA,EACA,MAAAK,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGR;AACL,GAAuB;AACrB,SACE,gBAAAS;AAAA,IAACZ,EAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,aAAWO;AAAA,MACX,cAAYJ,EAAM,YAAY,KAAK;AAAA,MACnC,WAAWE;AAAA,QACTQ,EAAe,EAAE,MAAAN,GAAM,SAAAC,GAAS,QAAAC,GAAQ,SAAAC,GAAS;AAAA,QACjD;AAAA,QACAR;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,MAEH,UAAA;AAAA,QAAAQ;AAAA,QACD,gBAAAP;AAAA,UAACJ,EAAgB;AAAA,UAAhB;AAAA,YACC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AAkB;AAAA,IAChB,CAACiC,EAAU,QAAQ,GAAG;AAAA,MACpB,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,WAAW,CAACrB,MAASA;AAAA,IAAA;AAAA,EACvB;AAEJ;"}
1
+ {"version":3,"file":"calendar.js","sources":["../../src/components/ui/select.tsx","../../src/components/ui/calendar.tsx","../../src/renderer/presets/calendar.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Select as SelectPrimitive } from \"@base-ui/react/select\";\nimport {\n IconSelector,\n IconCheck,\n IconChevronUp,\n IconChevronDown,\n} from \"@tabler/icons-react\";\nimport { cn } from \"@/lib/utils\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport { buttonVariants } from \"./button\";\n\nconst Select = SelectPrimitive.Root;\n(Select as any).displayName = \"Select\";\n\nfunction SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {\n return (\n <SelectPrimitive.Group\n data-slot=\"select-group\"\n className={cn(\"scroll-my-1 p-1\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectValue({ className, ...props }: SelectPrimitive.Value.Props) {\n return (\n <SelectPrimitive.Value\n data-slot=\"select-value\"\n className={cn(\n \"flex flex-1 text-left\",\n \"group/select-trigger:line-clamp-1 group/select-trigger:items-center data-placeholder:text-subtle font-base\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface SelectTriggerProps\n extends\n SelectPrimitive.Trigger.Props,\n Omit<VariantProps<typeof buttonVariants>, \"icon\"> {}\n\nfunction SelectTrigger({\n className,\n size = \"lg\",\n variant = \"outline\",\n raised,\n extrude,\n children,\n ...props\n}: SelectTriggerProps) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n aria-label={props[\"aria-label\"] ?? \"select-trigger\"}\n className={cn(\n buttonVariants({ size, variant, raised, extrude }),\n \"group/select-trigger neo-base neo-input-focus disabled:opacity-50 [&_svg]:shrink-0 w-full\",\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon\n className=\"flex items-center justify-center\"\n render={\n <IconSelector\n data-slot=\"select-selector\"\n className=\"text-muted size-4 pointer-events-none\"\n />\n }\n />\n </SelectPrimitive.Trigger>\n );\n}\n\nfunction SelectContent({\n className,\n children,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n alignItemWithTrigger = true,\n ...props\n}: SelectPrimitive.Popup.Props &\n Pick<\n SelectPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"alignItemWithTrigger\"\n >) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n className=\"isolate z-50\"\n >\n <SelectPrimitive.Popup\n data-slot=\"select-content\"\n className={cn(\n \"neo-base neo-focus relative isolate bg-surface text-foreground rounded-base shadow-md border-2 z-50 duration-100\",\n \"max-h-(--available-height) w-(--anchor-width) min-w-36\",\n \"origin-(--transform-origin) overflow-x-hidden overflow-y-auto\",\n \"data-open:animate-in data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95\",\n \"data-closed:animate-out data-closed:fade-out-0\",\n \"data-[side=top]:slide-in-from-bottom-2\",\n \"data-[side=bottom]:slide-in-from-top-2\",\n \"data-[side=left]:slide-in-from-right-2\",\n \"data-[side=right]:slide-in-from-left-2\",\n className,\n )}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.List className=\"flex flex-col gap-0.5 p-0.5\">\n {children}\n </SelectPrimitive.List>\n <SelectScrollDownButton />\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n );\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: SelectPrimitive.GroupLabel.Props) {\n return (\n <SelectPrimitive.GroupLabel\n data-slot=\"select-label\"\n className={cn(\"text-muted px-2 py-1.5 text-xs\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: SelectPrimitive.Item.Props) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"neo-base flex items-center gap-2 py-1.5 pr-8 pl-2 relative w-full cursor-pointer select-none\",\n \"border-2 border-transparent hover:border-border focus-visible:border-border outline-hidden rounded-base text-sm\",\n \"*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n >\n <SelectPrimitive.ItemText className=\"flex flex-1 gap-2 shrink-0 whitespace-nowrap\">\n {children}\n </SelectPrimitive.ItemText>\n <SelectPrimitive.ItemIndicator\n render={\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />\n }\n >\n <IconCheck className=\"pointer-events-none\" />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n );\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: SelectPrimitive.Separator.Props) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\n \"bg-foreground -mx-1 my-1 h-px pointer-events-none\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {\n return (\n <SelectPrimitive.ScrollUpArrow\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"bg-surface z-10 flex cursor-default items-center justify-center py-1 top-0 w-full\",\n className,\n )}\n {...props}\n >\n <IconChevronUp />\n </SelectPrimitive.ScrollUpArrow>\n );\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {\n return (\n <SelectPrimitive.ScrollDownArrow\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"bg-surface z-10 flex cursor-default items-center justify-center py-1 bottom-0 w-full\",\n className,\n )}\n {...props}\n >\n <IconChevronDown />\n </SelectPrimitive.ScrollDownArrow>\n );\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n DayPicker,\n getDefaultClassNames,\n type DayButton,\n type DropdownOption,\n} from \"react-day-picker\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Button, buttonVariants } from \"@/components/ui/button\";\nimport {\n IconChevronLeft,\n IconChevronRight,\n IconChevronDown,\n} from \"@tabler/icons-react\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"./select\";\n\ntype CalendarProps = React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"];\n hideWeekends?: boolean;\n};\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n hideWeekdays = false,\n buttonVariant = \"outline\",\n hideWeekends,\n formatters,\n components,\n ...props\n}: CalendarProps) {\n const defaultClassNames = getDefaultClassNames();\n const { selected } = props as { selected?: unknown };\n const parsed = typeof selected === \"string\" ? parseDate(selected) : undefined;\n // A string only comes from untyped template data, which binds single mode.\n const pickerProps = parsed ? ({ ...props, selected: parsed } as typeof props) : props;\n\n return (\n <DayPicker\n // Templates bind `selected`/`onSelect` without a `mode`, and without one\n // DayPicker isn't interactive: no day buttons, so the grid collapses.\n mode=\"single\"\n // Open on the selected day's month, not today's.\n defaultMonth={parsed ?? (selected instanceof Date ? selected : undefined)}\n showOutsideDays={showOutsideDays}\n className={cn(\n \"p-3 bg-surface group/calendar [--cell-size:--spacing(8)]\",\n \"in-data-[slot=card-content]:bg-transparent\",\n \"in-data-[slot=popover-content]:bg-transparent\",\n className,\n )}\n captionLayout={captionLayout}\n formatters={{\n formatCaption: (date) =>\n date.toLocaleString(\"default\", { month: \"short\", year: \"numeric\" }),\n formatMonthDropdown: (date) =>\n date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n nav: cn(\n \"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between\",\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant, icon: \"sm\" }),\n \"aria-disabled:opacity-50 aria-disabled:translate-[0px] aria-disabled:shadow-none aria-disabled:pointer-events-none\",\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant, icon: \"sm\" }),\n \"aria-disabled:opacity-50 aria-disabled:translate-[0px] aria-disabled:shadow-none aria-disabled:pointer-events-none\",\n defaultClassNames.button_next,\n ),\n caption_label: cn(\"select-none\", defaultClassNames.caption_label),\n months: cn(\n \"flex gap-4 flex-col md:flex-row relative\",\n defaultClassNames.months,\n ),\n month: cn(\n \"flex flex-col w-full gap-4 *:first:*:h-(--cell-size) *:first:*:flex *:first:*:items-center *:first:*:justify-center *:first:**:font-medium *:first:**:font-heading *:first:**:text-base\",\n defaultClassNames.month,\n ),\n month_grid: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n hideWeekdays\n ? \"hidden\"\n : \"text-sm font-normal font-heading text-muted text-center select-none flex-1\",\n defaultClassNames.weekday,\n ),\n week_number: cn(\n \"text-sm font-normal font-heading text-muted text-center select-none flex size-(--cell-size) items-center justify-center my-auto\",\n defaultClassNames.week_number,\n ),\n week_number_header: cn(\n \"select-none w-(--cell-size)\",\n defaultClassNames.week_number_header,\n ),\n week: cn(\"flex w-full\", defaultClassNames.week),\n day: cn(\n \"relative text-center group/day select-none transition-[width,padding,margin] duration-200\",\n defaultClassNames.day,\n ),\n day_button: cn(\"m-1\", defaultClassNames.day_button),\n today: cn(\n \"*:data-[slot=calendar-day-button]:font-semibold *:data-[slot=calendar-day-button]:text-lg\",\n defaultClassNames.today,\n ),\n outside: cn(\n \"text-muted aria-selected:text-foreground opacity-50 hover:opacity-100 aria-selected:opacity-100 aria-selected:*:data-[slot=calendar-day-button]:bg-main-secondary hover:*:data-[slot=calendar-day-button]:bg-surface *:data-[slot=calendar-day-button]:bg-foreground/20\",\n defaultClassNames.outside,\n ),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n );\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return (\n <IconChevronLeft className={cn(\"size-4\", className)} {...props} />\n );\n }\n\n if (orientation === \"right\") {\n return (\n <IconChevronRight\n className={cn(\"size-4\", className)}\n {...props}\n />\n );\n }\n\n return (\n <IconChevronDown className={cn(\"size-4\", className)} {...props} />\n );\n },\n Weekday: ({ children, ...props }) => {\n const isWeekend =\n props[\"aria-label\"] === \"Saturday\" ||\n props[\"aria-label\"] === \"Sunday\";\n if (hideWeekends && isWeekend) {\n return <td hidden />;\n }\n return <td {...props}>{children}</td>;\n },\n // `day` and `modifiers` are for us, not the DOM: spread onto the <td>\n // they leak as `day=\"[object Object]\"` attributes.\n Day: ({ children, day, modifiers, ...props }) => {\n const weekday = new Date(day.date).getDay();\n const isWeekend = weekday === 0 || weekday === 6;\n if (hideWeekends && isWeekend) {\n return <td hidden />;\n }\n if (modifiers.hidden) {\n return (\n <td className=\"all-unset size-(--cell-size) m-1 bg-foreground opacity-20 rounded-base\" />\n );\n }\n return <td {...props}>{children}</td>;\n },\n Dropdown: CalendarDropdown,\n DayButton: CalendarDayButton,\n ...components,\n }}\n {...pickerProps}\n />\n );\n}\n\n// Bound data carries dates as JSON strings. A bare `2024-01-01` parses as UTC\n// midnight, which is the day before west of UTC, so read it as a local date.\nfunction parseDate(value: string): Date {\n const ymd = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(value);\n return ymd ? new Date(+ymd[1], +ymd[2] - 1, +ymd[3]) : new Date(value);\n}\n\nfunction CalendarDayButton({\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <Button\n data-slot=\"calendar-day-button\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n aria-label={day.date.toDateString()}\n raised={\n modifiers.range_start || modifiers.range_end\n ? \"md\"\n : modifiers.range_middle\n ? \"xs\"\n : \"sm\"\n }\n variant={modifiers.selected ? \"default\" : \"outline\"}\n extrude={modifiers.selected ? null : \"xs\"}\n disabled={modifiers.disabled}\n icon=\"sm\"\n {...props}\n />\n );\n}\n\nfunction CalendarDropdown(\n props: Omit<React.SelectHTMLAttributes<HTMLSelectElement>, \"children\"> & {\n options?: DropdownOption[] | undefined;\n },\n) {\n const { options, onChange, value } = props;\n const selected = options?.find((option) => option.value === value);\n const handleChange = (value: string) => {\n const changeEvent = {\n target: { value },\n } as React.ChangeEvent<HTMLSelectElement>;\n onChange?.(changeEvent);\n };\n\n return (\n <Select\n value={value?.toString()}\n onValueChange={(value) => handleChange(value as any)}\n >\n <SelectTrigger\n variant=\"ghost\"\n raised={null}\n extrude={null}\n className=\"w-fit mx-1\"\n size=\"sm\"\n >\n <SelectValue>{selected?.label}</SelectValue>\n </SelectTrigger>\n <SelectContent className=\"bg-transparent border-0 w-30 shadow-none\">\n <div className=\"p-2\">\n <div className=\"flex flex-col items-center bg-foreground shadow-xs rounded-base\">\n {options?.map((option) => (\n <SelectItem\n className={cn(\n buttonVariants({ extrude: \"md\" }),\n \"not-last:rounded-b-none not-first:rounded-t-none border-2 not-last:border-b-0 hover:border-2 hover:z-2 z-1 duration-200\",\n )}\n key={option.value}\n value={option.value.toString()}\n >\n {option.label}\n </SelectItem>\n ))}\n </div>\n </div>\n </SelectContent>\n </Select>\n );\n}\n\nexport { Calendar };\n","import { COMPONENT } from \"@bonsai/constants\";\n\nimport { Calendar } from \"../../components/ui/calendar\";\nimport type { BonsaiPreset } from \"../core-registry\";\n\n/** Opt-in `calendar` component. Pulls in react-day-picker. */\nexport const calendarPreset: BonsaiPreset = {\n components: {\n [COMPONENT.CALENDAR]: Calendar,\n },\n controlledInputs: {\n [COMPONENT.CALENDAR]: {\n valueProp: \"selected\",\n changeProp: \"onSelect\",\n extractor: (date) => date,\n },\n },\n};\n\nexport { Calendar };\n"],"names":["Select","SelectPrimitive","SelectValue","className","props","jsx","cn","SelectTrigger","size","variant","raised","extrude","children","jsxs","buttonVariants","IconSelector","SelectContent","side","sideOffset","align","alignOffset","alignItemWithTrigger","SelectScrollUpButton","SelectScrollDownButton","SelectItem","IconCheck","IconChevronUp","IconChevronDown","Calendar","classNames","showOutsideDays","captionLayout","hideWeekdays","buttonVariant","hideWeekends","formatters","components","defaultClassNames","getDefaultClassNames","selected","parsed","parseDate","pickerProps","DayPicker","date","rootRef","orientation","IconChevronLeft","IconChevronRight","isWeekend","day","modifiers","weekday","CalendarDropdown","CalendarDayButton","value","ymd","ref","React","Button","options","onChange","option","handleChange","calendarPreset","COMPONENT"],"mappings":";;;;;;;AAcA,MAAMA,IAASC,EAAgB;AAC9BD,EAAe,cAAc;AAY9B,SAASE,EAAY,EAAE,WAAAC,GAAW,GAAGC,KAAsC;AACzE,SACE,gBAAAC;AAAA,IAACJ,EAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAWK;AAAA,QACT;AAAA,QACA;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAOA,SAASG,EAAc;AAAA,EACrB,WAAAJ;AAAA,EACA,MAAAK,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UA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AAA;AAAA,MACd,eAAe,CAACA,MAAUQ,EAAaR,CAAY;AAAA,MAEnD,UAAA;AAAA,QAAA,gBAAAlD;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAU;AAAA,YACV,MAAK;AAAA,YAEL,UAAA,gBAAAF,EAACH,GAAA,EAAa,UAAAqC,GAAU,MAAA,CAAM;AAAA,UAAA;AAAA,QAAA;AAAA,QAEhC,gBAAAlC,EAACW,GAAA,EAAc,WAAU,4CACvB,4BAAC,OAAA,EAAI,WAAU,OACb,UAAA,gBAAAX,EAAC,SAAI,WAAU,mEACZ,UAAAuD,GAAS,IAAI,CAACE,MACb,gBAAAzD;AAAA,UAACmB;AAAA,UAAA;AAAA,YACC,WAAWlB;AAAA,cACTQ,EAAe,EAAE,SAAS,MAAM;AAAA,cAChC;AAAA,YAAA;AAAA,YAGF,OAAOgD,EAAO,MAAM,SAAA;AAAA,YAEnB,UAAAA,EAAO;AAAA,UAAA;AAAA,UAHHA,EAAO;AAAA,QAAA,CAKf,EAAA,CACH,EAAA,CACF,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;ACxRO,MAAME,IAA+B;AAAA,EAC1C,YAAY;AAAA,IACV,CAACC,EAAU,QAAQ,GAAGrC;AAAA,EAAA;AAAA,EAExB,kBAAkB;AAAA,IAChB,CAACqC,EAAU,QAAQ,GAAG;AAAA,MACpB,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,WAAW,CAACrB,MAASA;AAAA,IAAA;AAAA,EACvB;AAEJ;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pebble-software/bonsai",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css"