@chekinapp/ui 0.0.76 → 0.0.79

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
@@ -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
@@ -8589,7 +8591,7 @@ var SignatureCanvas = (0, import_react69.forwardRef)(
8589
8591
  type: "button",
8590
8592
  className: cn(
8591
8593
  "absolute left-0 top-0 z-10 flex h-[174px] w-[250px] flex-col items-center",
8592
- "justify-between rounded border-0 bg-[var(--signature-canvas-placeholder-bg)] px-0 pb-11 pt-10",
8594
+ "justify-between rounded border-0 bg-[var(--signature-canvas-placeholder-bg)] px-0 pb-7 pt-10",
8593
8595
  "cursor-pointer select-none"
8594
8596
  ),
8595
8597
  onClick: onEnable,
@@ -8600,7 +8602,7 @@ var SignatureCanvas = (0, import_react69.forwardRef)(
8600
8602
  "span",
8601
8603
  {
8602
8604
  className: cn(
8603
- "mx-auto max-w-[154px] break-words text-center text-sm font-medium uppercase",
8605
+ "mx-auto mt-2 max-w-[154px] break-words text-center text-sm font-medium uppercase",
8604
8606
  "text-[var(--signature-canvas-placeholder-text)] opacity-[0.55]"
8605
8607
  ),
8606
8608
  children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_i18next16.Trans, { i18nKey: "signature_placeholder_text" })
@@ -10234,15 +10236,15 @@ function UploadedFilesList({
10234
10236
  return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: cn("flex flex-wrap gap-2.5", className), children: files.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
10235
10237
  "div",
10236
10238
  {
10237
- className: "flex cursor-default items-center gap-2 rounded border border-[var(--chekin-color-gray-2)] bg-[var(--chekin-color-surface-pressed)] py-1.5 pl-3 pr-1.5",
10239
+ className: "flex cursor-default items-center gap-2 rounded border border-[#acacd5] bg-[#f0f0f8] py-1.5 pl-3 pr-1.5",
10238
10240
  children: [
10239
- /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "text-nowrap text-sm font-medium leading-5 text-[var(--chekin-color-brand-navy)]", children: file.name }),
10241
+ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "text-nowrap text-sm font-medium leading-5 text-[#161643]", children: file.name }),
10240
10242
  /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
10241
10243
  "button",
10242
10244
  {
10243
10245
  type: "button",
10244
10246
  onClick: () => onRemoveFile(file.name),
10245
- className: "flex h-[18px] w-[18px] shrink-0 cursor-pointer items-center justify-center rounded bg-[var(--chekin-color-gray-1)] transition-all hover:shadow-md active:opacity-95",
10247
+ className: "flex h-[18px] w-[18px] shrink-0 cursor-pointer items-center justify-center rounded bg-[#6b6b95] transition-all hover:shadow-md active:opacity-95",
10246
10248
  "aria-label": `Remove ${file.name}`,
10247
10249
  children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_lucide_react37.X, { className: "h-3.5 w-3.5 text-white", strokeWidth: 3 })
10248
10250
  }
@@ -14823,7 +14825,9 @@ function DashboardMultiSelectInternal({
14823
14825
  }, [isOpen, filteredOptions]);
14824
14826
  React58.useEffect(() => {
14825
14827
  if (!isOpen || !isMobile2) return;
14826
- const frame = window.requestAnimationFrame(() => mobileSearchInputRef.current?.focus());
14828
+ const frame = window.requestAnimationFrame(
14829
+ () => mobileSearchInputRef.current?.focus()
14830
+ );
14827
14831
  return () => window.cancelAnimationFrame(frame);
14828
14832
  }, [isOpen, isMobile2]);
14829
14833
  const openMenu = () => {
@@ -16292,6 +16296,7 @@ var createDisabledMatchers = ({
16292
16296
 
16293
16297
  // src/dashboard/date-range-picker/hooks/useRangeValue.ts
16294
16298
  var React63 = __toESM(require("react"), 1);
16299
+ var getRangeKey = (range) => `${range?.from?.getTime() ?? ""}-${range?.to?.getTime() ?? ""}`;
16295
16300
  function useRangeValue({
16296
16301
  value: externalValue,
16297
16302
  defaultValue,
@@ -16299,22 +16304,29 @@ function useRangeValue({
16299
16304
  name
16300
16305
  }) {
16301
16306
  const isControlled = externalValue !== void 0;
16302
- const [internalValue, setInternalValue] = React63.useState(
16303
- defaultValue
16307
+ const [draft, setDraft] = React63.useState(
16308
+ isControlled ? externalValue : defaultValue
16304
16309
  );
16305
- 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
+ }
16306
16318
  const commit = React63.useCallback(
16307
16319
  (next) => {
16308
- if (!isControlled) setInternalValue(next);
16320
+ setDraft(next);
16309
16321
  if (next === void 0) {
16310
16322
  onChange?.(void 0, name);
16311
16323
  return;
16312
16324
  }
16313
- if (next?.from && next?.to) onChange?.(next, name);
16325
+ if (next.from && next.to) onChange?.(next, name);
16314
16326
  },
16315
- [isControlled, name, onChange]
16327
+ [name, onChange]
16316
16328
  );
16317
- return { value, commit };
16329
+ return { value: draft, commit };
16318
16330
  }
16319
16331
 
16320
16332
  // src/dashboard/date-range-picker/hooks/useRangeTextInputs.ts
@@ -16560,52 +16572,8 @@ function DateRangeInputs({
16560
16572
  );
16561
16573
  }
16562
16574
 
16563
- // src/dashboard/date-range-picker/components/DateRangeCalendar.tsx
16564
- var import_lucide_react52 = require("lucide-react");
16565
- var import_react_day_picker2 = require("react-day-picker");
16566
-
16567
- // src/dashboard/_calendar/dashboardCalendarClassNames.ts
16568
- var dashboardCalendarClassNames = {
16569
- root: "relative",
16570
- months: "relative flex flex-col gap-6 sm:flex-row sm:gap-8",
16571
- month: "w-full",
16572
- 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)]",
16573
- caption_label: "px-3 text-[18px] font-normal",
16574
- nav: "absolute left-0 right-0 top-[4px] z-10 flex justify-between px-[6px] pointer-events-none",
16575
- 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",
16576
- 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",
16577
- weekday: "size-9 p-0 text-[14px] font-normal text-[var(--chekin-color-brand-blue)]",
16578
- day_button: [
16579
- "relative mx-auto flex size-9 items-center justify-center whitespace-nowrap rounded-full p-0",
16580
- "text-[14px] font-light text-[var(--chekin-color-brand-navy)] outline-offset-2",
16581
- "focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--chekin-color-brand-blue)]/60",
16582
- "hover:bg-[#f0f8ff]",
16583
- "group-data-[selected]:bg-[var(--chekin-color-brand-blue)] group-data-[selected]:text-white",
16584
- "group-data-[disabled]:pointer-events-none group-data-[disabled]:text-[var(--chekin-color-gray-2)] group-data-[disabled]:line-through",
16585
- "group-data-[outside]:text-[var(--chekin-color-gray-2)]",
16586
- "group-data-[outside]:group-data-[selected]:text-white",
16587
- "group-[.range-middle]:rounded-none group-[.range-middle]:bg-transparent",
16588
- "group-data-[selected]:group-[.range-middle]:bg-[#edf7ff] group-data-[selected]:group-[.range-middle]:text-[var(--chekin-color-brand-navy)]"
16589
- ].join(" "),
16590
- day: "group size-9 p-0 text-center text-[14px]",
16591
- range_start: "range-start",
16592
- range_end: "range-end",
16593
- range_middle: "range-middle",
16594
- today: [
16595
- "*:after:pointer-events-none *:after:absolute *:after:bottom-1 *:after:start-1/2",
16596
- "*:after:z-10 *:after:size-[3px] *:after:-translate-x-1/2 *:after:rounded-full",
16597
- "*:after:bg-[var(--chekin-color-brand-blue)]",
16598
- "[&[data-selected]:not(.range-middle)>*]:after:bg-white"
16599
- ].join(" "),
16600
- outside: "text-[var(--chekin-color-gray-2)]",
16601
- hidden: "invisible"
16602
- };
16603
-
16604
16575
  // src/dashboard/date-range-picker/components/DateRangeCalendar.tsx
16605
16576
  var import_jsx_runtime169 = require("react/jsx-runtime");
16606
- var calendarComponents = {
16607
- 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" })
16608
- };
16609
16577
  function DateRangeCalendar({
16610
16578
  value,
16611
16579
  month,
@@ -16618,11 +16586,11 @@ function DateRangeCalendar({
16618
16586
  minDays,
16619
16587
  autoFocus,
16620
16588
  disabledMatchers,
16621
- components: customComponents,
16589
+ components,
16622
16590
  ...dayPickerProps
16623
16591
  }) {
16624
16592
  return /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
16625
- import_react_day_picker2.DayPicker,
16593
+ Calendar,
16626
16594
  {
16627
16595
  mode: "range",
16628
16596
  selected: value,
@@ -16630,16 +16598,14 @@ function DateRangeCalendar({
16630
16598
  onMonthChange,
16631
16599
  onSelect,
16632
16600
  numberOfMonths,
16633
- showOutsideDays: true,
16634
16601
  startMonth: minDate,
16635
16602
  endMonth: maxDate,
16636
16603
  max: maxDays,
16637
16604
  min: minDays,
16638
16605
  autoFocus,
16639
- classNames: dashboardCalendarClassNames,
16640
- components: { ...calendarComponents, ...customComponents },
16641
- className: "p-5",
16642
16606
  disabled: disabledMatchers,
16607
+ components,
16608
+ className: "p-5",
16643
16609
  ...dayPickerProps
16644
16610
  }
16645
16611
  );
@@ -16756,7 +16722,13 @@ var DashboardDateRangePicker = React66.forwardRef(function DashboardDateRangePic
16756
16722
  const normalizedMaxDate = React66.useMemo(() => toDate(maxDate), [maxDate]);
16757
16723
  const formatter = React66.useMemo(() => formatDate(displayFormat), [displayFormat]);
16758
16724
  const parser = React66.useMemo(() => parseDate(displayFormat), [displayFormat]);
16759
- const { fromText, toText, setFromText, setToText, handleFromBlur, handleToBlur } = useRangeTextInputs({ value, format: formatter, parse: parser, onCommit: commit, onBlur });
16725
+ const { fromText, toText, setFromText, setToText, handleFromBlur, handleToBlur } = useRangeTextInputs({
16726
+ value,
16727
+ format: formatter,
16728
+ parse: parser,
16729
+ onCommit: commit,
16730
+ onBlur
16731
+ });
16760
16732
  const { month, setMonth, syncMonthToValue } = useRangeMonthSync(value);
16761
16733
  const [isOpen, setIsOpen] = React66.useState(false);
16762
16734
  const [focusedInput, setFocusedInput] = React66.useState(null);
@@ -16839,7 +16811,15 @@ var DashboardDateRangePicker = React66.forwardRef(function DashboardDateRangePic
16839
16811
  open: openCalendar,
16840
16812
  close: closeCalendar
16841
16813
  }),
16842
- [closeCalendar, commit, formatter, openCalendar, setFromText, setToText, syncMonthToValue]
16814
+ [
16815
+ closeCalendar,
16816
+ commit,
16817
+ formatter,
16818
+ openCalendar,
16819
+ setFromText,
16820
+ setToText,
16821
+ syncMonthToValue
16822
+ ]
16843
16823
  );
16844
16824
  return /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(
16845
16825
  "div",
@@ -17000,7 +16980,7 @@ var DashboardDateRangePicker = React66.forwardRef(function DashboardDateRangePic
17000
16980
  var React67 = __toESM(require("react"), 1);
17001
16981
  var import_react_i18next37 = require("react-i18next");
17002
16982
  var import_date_fns4 = require("date-fns");
17003
- var import_react_day_picker3 = require("react-day-picker");
16983
+ var import_react_day_picker2 = require("react-day-picker");
17004
16984
  function isAfterMax(date, maxDate) {
17005
16985
  return (0, import_date_fns4.isAfter)(resetTime(date), resetTime(maxDate));
17006
16986
  }
@@ -17029,7 +17009,7 @@ function useValidateDates({
17029
17009
  const startDate = dates?.from;
17030
17010
  const endDate = dates?.to;
17031
17011
  if (!startDate || !endDate) return true;
17032
- 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))) {
17033
17013
  handleError(t("wrong_period_of_dates"));
17034
17014
  return false;
17035
17015
  }
@@ -17131,7 +17111,7 @@ var DashboardTimePicker = React68.forwardRef(
17131
17111
 
17132
17112
  // src/dashboard/file-input/FileInput.tsx
17133
17113
  var React69 = __toESM(require("react"), 1);
17134
- var import_lucide_react53 = require("lucide-react");
17114
+ var import_lucide_react52 = require("lucide-react");
17135
17115
  var import_react_i18next38 = require("react-i18next");
17136
17116
  var import_jsx_runtime173 = require("react/jsx-runtime");
17137
17117
  function defaultFileNameFromUrl(url) {
@@ -17254,7 +17234,7 @@ var DashboardFileInput = React69.forwardRef(
17254
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",
17255
17235
  children: [
17256
17236
  /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("span", { className: "truncate", children: resolvedDownloadLabel }),
17257
- /* @__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 })
17258
17238
  ]
17259
17239
  }
17260
17240
  ) : /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("span", { className: "truncate text-[14px] font-medium text-[var(--chekin-color-brand-navy)]", children: value.name }),
@@ -17266,15 +17246,7 @@ var DashboardFileInput = React69.forwardRef(
17266
17246
  onClick: handleClear,
17267
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]",
17268
17248
  "aria-label": t("remove_file"),
17269
- children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(
17270
- import_lucide_react53.SquareX,
17271
- {
17272
- size: 15,
17273
- fill: "#9696b9",
17274
- color: "#f8f8f8",
17275
- strokeWidth: 1.8
17276
- }
17277
- )
17249
+ children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_lucide_react52.SquareX, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
17278
17250
  }
17279
17251
  )
17280
17252
  ]
@@ -17282,7 +17254,7 @@ var DashboardFileInput = React69.forwardRef(
17282
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 ?? "" }),
17283
17255
  /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("span", { className: "ml-auto flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
17284
17256
  loading && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(ThreeDotsLoader, { height: 18, width: 18 }),
17285
- /* @__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 })
17286
17258
  ] })
17287
17259
  ]
17288
17260
  }
@@ -17400,7 +17372,7 @@ function DashboardSelectIconsBox({
17400
17372
 
17401
17373
  // src/searchable-select/SearchableSelect.tsx
17402
17374
  var React71 = __toESM(require("react"), 1);
17403
- var import_lucide_react54 = require("lucide-react");
17375
+ var import_lucide_react53 = require("lucide-react");
17404
17376
  var import_react_virtual3 = require("@tanstack/react-virtual");
17405
17377
  var import_react82 = require("react");
17406
17378
  var import_jsx_runtime175 = require("react/jsx-runtime");
@@ -17638,7 +17610,7 @@ var SearchableSelectInternal = ({
17638
17610
  onKeyDown: handleTriggerKeyDown,
17639
17611
  onBlur,
17640
17612
  trailingAdornment: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
17641
- import_lucide_react54.ChevronDown,
17613
+ import_lucide_react53.ChevronDown,
17642
17614
  {
17643
17615
  className: cn(
17644
17616
  "h-6 w-6 text-[#1F1F1B] transition-transform",
@@ -17736,7 +17708,7 @@ function SearchableSelectContent({
17736
17708
  return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)("div", { className: "p-2", children: [
17737
17709
  /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)("div", { className: "relative mb-2", children: [
17738
17710
  /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
17739
- import_lucide_react54.Search,
17711
+ import_lucide_react53.Search,
17740
17712
  {
17741
17713
  "aria-hidden": "true",
17742
17714
  className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 text-[#9696B9]"