@motor-hero/ui-kit 0.34.1 → 0.35.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.
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../src/components/date-picker.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAc9B,MAAM,WAAW,eAAe;IAC9B;mEAC+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAA;IACvC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;IAC3C,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAmTD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qBAEhD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,qBAEpD"}
1
+ {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../src/components/date-picker.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAc9B,MAAM,WAAW,eAAe;IAC9B;mEAC+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAA;IACvC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;IAC3C,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAqUD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qBAEhD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,qBAEpD"}
package/dist/index.cjs CHANGED
@@ -1339,7 +1339,10 @@ var calendarClassNames = {
1339
1339
  months: "relative flex flex-col gap-4",
1340
1340
  month: "flex w-full flex-col gap-4",
1341
1341
  month_caption: "flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
1342
- caption_label: "text-sm font-medium select-none",
1342
+ caption_label: "flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm font-medium select-none [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
1343
+ dropdowns: "flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
1344
+ dropdown_root: "relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",
1345
+ dropdown: "absolute inset-0 bg-popover opacity-0",
1343
1346
  nav: "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
1344
1347
  button_previous: navButtonClass2,
1345
1348
  button_next: navButtonClass2,
@@ -1355,8 +1358,13 @@ var calendarClassNames = {
1355
1358
  hidden: "invisible"
1356
1359
  };
1357
1360
  var calendarComponents = {
1358
- Chevron: ({ orientation }) => orientation === "left" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react7.ChevronLeft, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react7.ChevronRight, { className: "size-4" })
1361
+ Chevron: ({ orientation }) => {
1362
+ if (orientation === "left") return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react7.ChevronLeft, { className: "size-4" });
1363
+ if (orientation === "right") return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react7.ChevronRight, { className: "size-4" });
1364
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react7.ChevronDown, { className: "size-4" });
1365
+ }
1359
1366
  };
1367
+ var formatMonthDropdown = (date) => date.toLocaleString("pt-BR", { month: "short" });
1360
1368
  function DatePickerImpl({
1361
1369
  value,
1362
1370
  onChange,
@@ -1381,6 +1389,8 @@ function DatePickerImpl({
1381
1389
  const committedDate = withTime ? dateTimeToDate(value) : dateOnlyToDate(value);
1382
1390
  const displayValue = displayFor(value, withTime);
1383
1391
  const matchers = toMatchers(minDate, maxDate, disabledDates);
1392
+ const startMonth = dateOnlyToDate(minDate) ?? (0, import_date_fns.subYears)(/* @__PURE__ */ new Date(), 100);
1393
+ const endMonth = dateOnlyToDate(maxDate) ?? (0, import_date_fns.endOfYear)(/* @__PURE__ */ new Date());
1384
1394
  const setOpen = (next) => {
1385
1395
  setOpenRaw(next);
1386
1396
  if (next) {
@@ -1477,6 +1487,10 @@ function DatePickerImpl({
1477
1487
  {
1478
1488
  mode: "single",
1479
1489
  locale: import_locale.ptBR,
1490
+ captionLayout: "dropdown",
1491
+ formatters: { formatMonthDropdown },
1492
+ startMonth,
1493
+ endMonth,
1480
1494
  selected: withTime ? pendingDate : committedDate,
1481
1495
  defaultMonth: (withTime ? pendingDate : committedDate) ?? /* @__PURE__ */ new Date(),
1482
1496
  onSelect: (date) => date && handleCalendarSelect(date),