@chekinapp/ui 0.0.77 → 0.0.80

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/dist/index.cjs CHANGED
@@ -4439,20 +4439,20 @@ var HALO_ICON_STATUS = {
4439
4439
  var import_jsx_runtime51 = require("react/jsx-runtime");
4440
4440
  var statusStyles = {
4441
4441
  [HALO_ICON_STATUS.inactive]: {
4442
- background: "bg-[#f4f6f8]",
4443
- color: "text-[#9696b9]"
4442
+ background: "bg-[var(--chekin-color-surface-input-empty)]",
4443
+ color: "text-[var(--chekin-color-gray-2)]"
4444
4444
  },
4445
4445
  [HALO_ICON_STATUS.active]: {
4446
- background: "bg-[#eff6ff]",
4447
- color: "text-[#385cf8]"
4446
+ background: "bg-[var(--chekin-color-surface-autocomplete)]",
4447
+ color: "text-[var(--chekin-color-brand-blue)]"
4448
4448
  },
4449
4449
  [HALO_ICON_STATUS.success]: {
4450
4450
  background: "bg-[#e8fcf7]",
4451
4451
  color: "text-[#2bc29f]"
4452
4452
  },
4453
4453
  [HALO_ICON_STATUS.danger]: {
4454
- background: "bg-[#fff5f9]",
4455
- color: "text-[#ff2467]"
4454
+ background: "bg-[#ffe2ed]",
4455
+ color: "text-[var(--error-message-color)]"
4456
4456
  }
4457
4457
  };
4458
4458
  var HaloIcon = (0, import_react42.forwardRef)(
@@ -5557,7 +5557,9 @@ var translation_default2 = {
5557
5557
  date_range_min_days_error_other: "Range must be at least {{count}} days",
5558
5558
  past_dates: "Date cannot be before {{minDate}}",
5559
5559
  future_dates: "Date cannot be after {{maxDate}}",
5560
- signature_placeholder_text: "Sign inside this box.<br/> Use your finger.<br/> Tap to start."
5560
+ signature_placeholder_text: "Sign inside this box.<br/> Use your finger.<br/> Tap to start.",
5561
+ camera_permissions_denied: "The camera doesn't open? Make sure to allow the browser permission to use the camera.",
5562
+ clear: "Clear"
5561
5563
  };
5562
5564
 
5563
5565
  // src/locales/es/translation.json
@@ -16294,6 +16296,7 @@ var createDisabledMatchers = ({
16294
16296
 
16295
16297
  // src/dashboard/date-range-picker/hooks/useRangeValue.ts
16296
16298
  var React63 = __toESM(require("react"), 1);
16299
+ var getRangeKey = (range) => `${range?.from?.getTime() ?? ""}-${range?.to?.getTime() ?? ""}`;
16297
16300
  function useRangeValue({
16298
16301
  value: externalValue,
16299
16302
  defaultValue,
@@ -16301,22 +16304,29 @@ function useRangeValue({
16301
16304
  name
16302
16305
  }) {
16303
16306
  const isControlled = externalValue !== void 0;
16304
- const [internalValue, setInternalValue] = React63.useState(
16305
- defaultValue
16307
+ const [draft, setDraft] = React63.useState(
16308
+ isControlled ? externalValue : defaultValue
16306
16309
  );
16307
- const value = isControlled ? externalValue : internalValue;
16310
+ const lastExternalKeyRef = React63.useRef(getRangeKey(externalValue));
16311
+ if (isControlled) {
16312
+ const externalKey = getRangeKey(externalValue);
16313
+ if (externalKey !== lastExternalKeyRef.current) {
16314
+ lastExternalKeyRef.current = externalKey;
16315
+ setDraft(externalValue);
16316
+ }
16317
+ }
16308
16318
  const commit = React63.useCallback(
16309
16319
  (next) => {
16310
- if (!isControlled) setInternalValue(next);
16320
+ setDraft(next);
16311
16321
  if (next === void 0) {
16312
16322
  onChange?.(void 0, name);
16313
16323
  return;
16314
16324
  }
16315
- if (next?.from && next?.to) onChange?.(next, name);
16325
+ if (next.from && next.to) onChange?.(next, name);
16316
16326
  },
16317
- [isControlled, name, onChange]
16327
+ [name, onChange]
16318
16328
  );
16319
- return { value, commit };
16329
+ return { value: draft, commit };
16320
16330
  }
16321
16331
 
16322
16332
  // src/dashboard/date-range-picker/hooks/useRangeTextInputs.ts
@@ -16562,52 +16572,8 @@ function DateRangeInputs({
16562
16572
  );
16563
16573
  }
16564
16574
 
16565
- // src/dashboard/date-range-picker/components/DateRangeCalendar.tsx
16566
- var import_lucide_react52 = require("lucide-react");
16567
- var import_react_day_picker2 = require("react-day-picker");
16568
-
16569
- // src/dashboard/_calendar/dashboardCalendarClassNames.ts
16570
- var dashboardCalendarClassNames = {
16571
- root: "relative",
16572
- months: "relative flex flex-col gap-6 sm:flex-row sm:gap-8",
16573
- month: "w-full",
16574
- month_caption: "relative z-0 mb-3 flex h-9 items-center justify-center text-[18px] font-normal capitalize text-[var(--chekin-color-brand-navy)]",
16575
- caption_label: "px-3 text-[18px] font-normal",
16576
- nav: "absolute left-0 right-0 top-[4px] z-10 flex justify-between px-[6px] pointer-events-none",
16577
- button_previous: "pointer-events-auto inline-flex h-[26px] w-[26px] items-center justify-center rounded-[2px] border border-[#9696b9] bg-transparent text-[var(--chekin-color-brand-blue)] outline-none transition-colors hover:bg-[#f0f8ff] disabled:cursor-default disabled:opacity-40 disabled:hover:bg-transparent",
16578
- button_next: "pointer-events-auto inline-flex h-[26px] w-[26px] items-center justify-center rounded-[2px] border border-[#9696b9] bg-transparent text-[var(--chekin-color-brand-blue)] outline-none transition-colors hover:bg-[#f0f8ff] disabled:cursor-default disabled:opacity-40 disabled:hover:bg-transparent",
16579
- weekday: "size-9 p-0 text-[14px] font-normal text-[var(--chekin-color-brand-blue)]",
16580
- day_button: [
16581
- "relative mx-auto flex size-9 items-center justify-center whitespace-nowrap rounded-full p-0",
16582
- "text-[14px] font-light text-[var(--chekin-color-brand-navy)] outline-offset-2",
16583
- "focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--chekin-color-brand-blue)]/60",
16584
- "hover:bg-[#f0f8ff]",
16585
- "group-data-[selected]:bg-[var(--chekin-color-brand-blue)] group-data-[selected]:text-white",
16586
- "group-data-[disabled]:pointer-events-none group-data-[disabled]:text-[var(--chekin-color-gray-2)] group-data-[disabled]:line-through",
16587
- "group-data-[outside]:text-[var(--chekin-color-gray-2)]",
16588
- "group-data-[outside]:group-data-[selected]:text-white",
16589
- "group-[.range-middle]:rounded-none group-[.range-middle]:bg-transparent",
16590
- "group-data-[selected]:group-[.range-middle]:bg-[#edf7ff] group-data-[selected]:group-[.range-middle]:text-[var(--chekin-color-brand-navy)]"
16591
- ].join(" "),
16592
- day: "group size-9 p-0 text-center text-[14px]",
16593
- range_start: "range-start",
16594
- range_end: "range-end",
16595
- range_middle: "range-middle",
16596
- today: [
16597
- "*:after:pointer-events-none *:after:absolute *:after:bottom-1 *:after:start-1/2",
16598
- "*:after:z-10 *:after:size-[3px] *:after:-translate-x-1/2 *:after:rounded-full",
16599
- "*:after:bg-[var(--chekin-color-brand-blue)]",
16600
- "[&[data-selected]:not(.range-middle)>*]:after:bg-white"
16601
- ].join(" "),
16602
- outside: "text-[var(--chekin-color-gray-2)]",
16603
- hidden: "invisible"
16604
- };
16605
-
16606
16575
  // src/dashboard/date-range-picker/components/DateRangeCalendar.tsx
16607
16576
  var import_jsx_runtime169 = require("react/jsx-runtime");
16608
- var calendarComponents = {
16609
- Chevron: ({ orientation }) => orientation === "left" ? /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(import_lucide_react52.ArrowLeft, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(import_lucide_react52.ArrowRight, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
16610
- };
16611
16577
  function DateRangeCalendar({
16612
16578
  value,
16613
16579
  month,
@@ -16620,11 +16586,11 @@ function DateRangeCalendar({
16620
16586
  minDays,
16621
16587
  autoFocus,
16622
16588
  disabledMatchers,
16623
- components: customComponents,
16589
+ components,
16624
16590
  ...dayPickerProps
16625
16591
  }) {
16626
16592
  return /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
16627
- import_react_day_picker2.DayPicker,
16593
+ Calendar,
16628
16594
  {
16629
16595
  mode: "range",
16630
16596
  selected: value,
@@ -16632,16 +16598,14 @@ function DateRangeCalendar({
16632
16598
  onMonthChange,
16633
16599
  onSelect,
16634
16600
  numberOfMonths,
16635
- showOutsideDays: true,
16636
16601
  startMonth: minDate,
16637
16602
  endMonth: maxDate,
16638
16603
  max: maxDays,
16639
16604
  min: minDays,
16640
16605
  autoFocus,
16641
- classNames: dashboardCalendarClassNames,
16642
- components: { ...calendarComponents, ...customComponents },
16643
- className: "p-5",
16644
16606
  disabled: disabledMatchers,
16607
+ components,
16608
+ className: "p-5",
16645
16609
  ...dayPickerProps
16646
16610
  }
16647
16611
  );
@@ -17016,7 +16980,7 @@ var DashboardDateRangePicker = React66.forwardRef(function DashboardDateRangePic
17016
16980
  var React67 = __toESM(require("react"), 1);
17017
16981
  var import_react_i18next37 = require("react-i18next");
17018
16982
  var import_date_fns4 = require("date-fns");
17019
- var import_react_day_picker3 = require("react-day-picker");
16983
+ var import_react_day_picker2 = require("react-day-picker");
17020
16984
  function isAfterMax(date, maxDate) {
17021
16985
  return (0, import_date_fns4.isAfter)(resetTime(date), resetTime(maxDate));
17022
16986
  }
@@ -17045,7 +17009,7 @@ function useValidateDates({
17045
17009
  const startDate = dates?.from;
17046
17010
  const endDate = dates?.to;
17047
17011
  if (!startDate || !endDate) return true;
17048
- if (disabledDays && ((0, import_react_day_picker3.dateMatchModifiers)(startDate, disabledDays, import_react_day_picker3.dateLib) || (0, import_react_day_picker3.dateMatchModifiers)(endDate, disabledDays, import_react_day_picker3.dateLib))) {
17012
+ if (disabledDays && ((0, import_react_day_picker2.dateMatchModifiers)(startDate, disabledDays, import_react_day_picker2.dateLib) || (0, import_react_day_picker2.dateMatchModifiers)(endDate, disabledDays, import_react_day_picker2.dateLib))) {
17049
17013
  handleError(t("wrong_period_of_dates"));
17050
17014
  return false;
17051
17015
  }
@@ -17147,7 +17111,7 @@ var DashboardTimePicker = React68.forwardRef(
17147
17111
 
17148
17112
  // src/dashboard/file-input/FileInput.tsx
17149
17113
  var React69 = __toESM(require("react"), 1);
17150
- var import_lucide_react53 = require("lucide-react");
17114
+ var import_lucide_react52 = require("lucide-react");
17151
17115
  var import_react_i18next38 = require("react-i18next");
17152
17116
  var import_jsx_runtime173 = require("react/jsx-runtime");
17153
17117
  function defaultFileNameFromUrl(url) {
@@ -17270,7 +17234,7 @@ var DashboardFileInput = React69.forwardRef(
17270
17234
  className: "inline-flex items-center gap-[7px] truncate border-0 bg-transparent p-0 text-[14px] font-medium text-[var(--chekin-color-brand-navy)] outline-none",
17271
17235
  children: [
17272
17236
  /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("span", { className: "truncate", children: resolvedDownloadLabel }),
17273
- /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_lucide_react53.Download, { size: 15 })
17237
+ /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_lucide_react52.Download, { size: 15 })
17274
17238
  ]
17275
17239
  }
17276
17240
  ) : /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("span", { className: "truncate text-[14px] font-medium text-[var(--chekin-color-brand-navy)]", children: value.name }),
@@ -17282,7 +17246,7 @@ var DashboardFileInput = React69.forwardRef(
17282
17246
  onClick: handleClear,
17283
17247
  className: "ml-2 flex h-[15px] w-[15px] items-center justify-center rounded-[3px] border-0 bg-transparent p-0 text-[#9696b9] outline-none hover:shadow-[0_3px_3px_#0f477734]",
17284
17248
  "aria-label": t("remove_file"),
17285
- children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_lucide_react53.SquareX, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
17249
+ children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_lucide_react52.SquareX, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
17286
17250
  }
17287
17251
  )
17288
17252
  ]
@@ -17290,7 +17254,7 @@ var DashboardFileInput = React69.forwardRef(
17290
17254
  ) : /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("span", { className: "block min-w-0 flex-1 truncate text-left text-[var(--chekin-color-gray-1)]", children: placeholder ?? "" }),
17291
17255
  /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("span", { className: "ml-auto flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
17292
17256
  loading && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(ThreeDotsLoader, { height: 18, width: 18 }),
17293
- /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_lucide_react53.Paperclip, { size: 20 })
17257
+ /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_lucide_react52.Paperclip, { size: 20 })
17294
17258
  ] })
17295
17259
  ]
17296
17260
  }
@@ -17408,7 +17372,7 @@ function DashboardSelectIconsBox({
17408
17372
 
17409
17373
  // src/searchable-select/SearchableSelect.tsx
17410
17374
  var React71 = __toESM(require("react"), 1);
17411
- var import_lucide_react54 = require("lucide-react");
17375
+ var import_lucide_react53 = require("lucide-react");
17412
17376
  var import_react_virtual3 = require("@tanstack/react-virtual");
17413
17377
  var import_react82 = require("react");
17414
17378
  var import_jsx_runtime175 = require("react/jsx-runtime");
@@ -17646,7 +17610,7 @@ var SearchableSelectInternal = ({
17646
17610
  onKeyDown: handleTriggerKeyDown,
17647
17611
  onBlur,
17648
17612
  trailingAdornment: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
17649
- import_lucide_react54.ChevronDown,
17613
+ import_lucide_react53.ChevronDown,
17650
17614
  {
17651
17615
  className: cn(
17652
17616
  "h-6 w-6 text-[#1F1F1B] transition-transform",
@@ -17744,7 +17708,7 @@ function SearchableSelectContent({
17744
17708
  return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)("div", { className: "p-2", children: [
17745
17709
  /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)("div", { className: "relative mb-2", children: [
17746
17710
  /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
17747
- import_lucide_react54.Search,
17711
+ import_lucide_react53.Search,
17748
17712
  {
17749
17713
  "aria-hidden": "true",
17750
17714
  className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 text-[#9696B9]"