@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.d.cts CHANGED
@@ -555,20 +555,20 @@ declare const FramedIcon: React$1.ForwardRefExoticComponent<FramedIconProps & Re
555
555
 
556
556
  declare const statusStyles: {
557
557
  readonly INACTIVE: {
558
- readonly background: "bg-[#f4f6f8]";
559
- readonly color: "text-[#9696b9]";
558
+ readonly background: "bg-[var(--chekin-color-surface-input-empty)]";
559
+ readonly color: "text-[var(--chekin-color-gray-2)]";
560
560
  };
561
561
  readonly ACTIVE: {
562
- readonly background: "bg-[#eff6ff]";
563
- readonly color: "text-[#385cf8]";
562
+ readonly background: "bg-[var(--chekin-color-surface-autocomplete)]";
563
+ readonly color: "text-[var(--chekin-color-brand-blue)]";
564
564
  };
565
565
  readonly SUCCESS: {
566
566
  readonly background: "bg-[#e8fcf7]";
567
567
  readonly color: "text-[#2bc29f]";
568
568
  };
569
569
  readonly DANGER: {
570
- readonly background: "bg-[#fff5f9]";
571
- readonly color: "text-[#ff2467]";
570
+ readonly background: "bg-[#ffe2ed]";
571
+ readonly color: "text-[var(--error-message-color)]";
572
572
  };
573
573
  };
574
574
  interface HaloIconProps extends PropsWithChildren {
@@ -795,6 +795,8 @@ declare const uiKitTranslations: {
795
795
  past_dates: string;
796
796
  future_dates: string;
797
797
  signature_placeholder_text: string;
798
+ camera_permissions_denied: string;
799
+ clear: string;
798
800
  };
799
801
  readonly es: {
800
802
  verified: string;
@@ -1229,6 +1231,8 @@ declare const uiKitI18nResources: {
1229
1231
  past_dates: string;
1230
1232
  future_dates: string;
1231
1233
  signature_placeholder_text: string;
1234
+ camera_permissions_denied: string;
1235
+ clear: string;
1232
1236
  };
1233
1237
  };
1234
1238
  readonly es: {
package/dist/index.d.ts CHANGED
@@ -555,20 +555,20 @@ declare const FramedIcon: React$1.ForwardRefExoticComponent<FramedIconProps & Re
555
555
 
556
556
  declare const statusStyles: {
557
557
  readonly INACTIVE: {
558
- readonly background: "bg-[#f4f6f8]";
559
- readonly color: "text-[#9696b9]";
558
+ readonly background: "bg-[var(--chekin-color-surface-input-empty)]";
559
+ readonly color: "text-[var(--chekin-color-gray-2)]";
560
560
  };
561
561
  readonly ACTIVE: {
562
- readonly background: "bg-[#eff6ff]";
563
- readonly color: "text-[#385cf8]";
562
+ readonly background: "bg-[var(--chekin-color-surface-autocomplete)]";
563
+ readonly color: "text-[var(--chekin-color-brand-blue)]";
564
564
  };
565
565
  readonly SUCCESS: {
566
566
  readonly background: "bg-[#e8fcf7]";
567
567
  readonly color: "text-[#2bc29f]";
568
568
  };
569
569
  readonly DANGER: {
570
- readonly background: "bg-[#fff5f9]";
571
- readonly color: "text-[#ff2467]";
570
+ readonly background: "bg-[#ffe2ed]";
571
+ readonly color: "text-[var(--error-message-color)]";
572
572
  };
573
573
  };
574
574
  interface HaloIconProps extends PropsWithChildren {
@@ -795,6 +795,8 @@ declare const uiKitTranslations: {
795
795
  past_dates: string;
796
796
  future_dates: string;
797
797
  signature_placeholder_text: string;
798
+ camera_permissions_denied: string;
799
+ clear: string;
798
800
  };
799
801
  readonly es: {
800
802
  verified: string;
@@ -1229,6 +1231,8 @@ declare const uiKitI18nResources: {
1229
1231
  past_dates: string;
1230
1232
  future_dates: string;
1231
1233
  signature_placeholder_text: string;
1234
+ camera_permissions_denied: string;
1235
+ clear: string;
1232
1236
  };
1233
1237
  };
1234
1238
  readonly es: {
package/dist/index.js CHANGED
@@ -4059,20 +4059,20 @@ var HALO_ICON_STATUS = {
4059
4059
  import { jsx as jsx49 } from "react/jsx-runtime";
4060
4060
  var statusStyles = {
4061
4061
  [HALO_ICON_STATUS.inactive]: {
4062
- background: "bg-[#f4f6f8]",
4063
- color: "text-[#9696b9]"
4062
+ background: "bg-[var(--chekin-color-surface-input-empty)]",
4063
+ color: "text-[var(--chekin-color-gray-2)]"
4064
4064
  },
4065
4065
  [HALO_ICON_STATUS.active]: {
4066
- background: "bg-[#eff6ff]",
4067
- color: "text-[#385cf8]"
4066
+ background: "bg-[var(--chekin-color-surface-autocomplete)]",
4067
+ color: "text-[var(--chekin-color-brand-blue)]"
4068
4068
  },
4069
4069
  [HALO_ICON_STATUS.success]: {
4070
4070
  background: "bg-[#e8fcf7]",
4071
4071
  color: "text-[#2bc29f]"
4072
4072
  },
4073
4073
  [HALO_ICON_STATUS.danger]: {
4074
- background: "bg-[#fff5f9]",
4075
- color: "text-[#ff2467]"
4074
+ background: "bg-[#ffe2ed]",
4075
+ color: "text-[var(--error-message-color)]"
4076
4076
  }
4077
4077
  };
4078
4078
  var HaloIcon = forwardRef21(
@@ -5186,7 +5186,9 @@ var translation_default2 = {
5186
5186
  date_range_min_days_error_other: "Range must be at least {{count}} days",
5187
5187
  past_dates: "Date cannot be before {{minDate}}",
5188
5188
  future_dates: "Date cannot be after {{maxDate}}",
5189
- signature_placeholder_text: "Sign inside this box.<br/> Use your finger.<br/> Tap to start."
5189
+ signature_placeholder_text: "Sign inside this box.<br/> Use your finger.<br/> Tap to start.",
5190
+ camera_permissions_denied: "The camera doesn't open? Make sure to allow the browser permission to use the camera.",
5191
+ clear: "Clear"
5190
5192
  };
5191
5193
 
5192
5194
  // src/locales/es/translation.json
@@ -15941,6 +15943,7 @@ var createDisabledMatchers = ({
15941
15943
 
15942
15944
  // src/dashboard/date-range-picker/hooks/useRangeValue.ts
15943
15945
  import * as React63 from "react";
15946
+ var getRangeKey = (range) => `${range?.from?.getTime() ?? ""}-${range?.to?.getTime() ?? ""}`;
15944
15947
  function useRangeValue({
15945
15948
  value: externalValue,
15946
15949
  defaultValue,
@@ -15948,22 +15951,29 @@ function useRangeValue({
15948
15951
  name
15949
15952
  }) {
15950
15953
  const isControlled = externalValue !== void 0;
15951
- const [internalValue, setInternalValue] = React63.useState(
15952
- defaultValue
15954
+ const [draft, setDraft] = React63.useState(
15955
+ isControlled ? externalValue : defaultValue
15953
15956
  );
15954
- const value = isControlled ? externalValue : internalValue;
15957
+ const lastExternalKeyRef = React63.useRef(getRangeKey(externalValue));
15958
+ if (isControlled) {
15959
+ const externalKey = getRangeKey(externalValue);
15960
+ if (externalKey !== lastExternalKeyRef.current) {
15961
+ lastExternalKeyRef.current = externalKey;
15962
+ setDraft(externalValue);
15963
+ }
15964
+ }
15955
15965
  const commit = React63.useCallback(
15956
15966
  (next) => {
15957
- if (!isControlled) setInternalValue(next);
15967
+ setDraft(next);
15958
15968
  if (next === void 0) {
15959
15969
  onChange?.(void 0, name);
15960
15970
  return;
15961
15971
  }
15962
- if (next?.from && next?.to) onChange?.(next, name);
15972
+ if (next.from && next.to) onChange?.(next, name);
15963
15973
  },
15964
- [isControlled, name, onChange]
15974
+ [name, onChange]
15965
15975
  );
15966
- return { value, commit };
15976
+ return { value: draft, commit };
15967
15977
  }
15968
15978
 
15969
15979
  // src/dashboard/date-range-picker/hooks/useRangeTextInputs.ts
@@ -16209,54 +16219,8 @@ function DateRangeInputs({
16209
16219
  );
16210
16220
  }
16211
16221
 
16212
- // src/dashboard/date-range-picker/components/DateRangeCalendar.tsx
16213
- import { ArrowLeft, ArrowRight } from "lucide-react";
16214
- import {
16215
- DayPicker as DayPicker2
16216
- } from "react-day-picker";
16217
-
16218
- // src/dashboard/_calendar/dashboardCalendarClassNames.ts
16219
- var dashboardCalendarClassNames = {
16220
- root: "relative",
16221
- months: "relative flex flex-col gap-6 sm:flex-row sm:gap-8",
16222
- month: "w-full",
16223
- 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)]",
16224
- caption_label: "px-3 text-[18px] font-normal",
16225
- nav: "absolute left-0 right-0 top-[4px] z-10 flex justify-between px-[6px] pointer-events-none",
16226
- 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",
16227
- 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",
16228
- weekday: "size-9 p-0 text-[14px] font-normal text-[var(--chekin-color-brand-blue)]",
16229
- day_button: [
16230
- "relative mx-auto flex size-9 items-center justify-center whitespace-nowrap rounded-full p-0",
16231
- "text-[14px] font-light text-[var(--chekin-color-brand-navy)] outline-offset-2",
16232
- "focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--chekin-color-brand-blue)]/60",
16233
- "hover:bg-[#f0f8ff]",
16234
- "group-data-[selected]:bg-[var(--chekin-color-brand-blue)] group-data-[selected]:text-white",
16235
- "group-data-[disabled]:pointer-events-none group-data-[disabled]:text-[var(--chekin-color-gray-2)] group-data-[disabled]:line-through",
16236
- "group-data-[outside]:text-[var(--chekin-color-gray-2)]",
16237
- "group-data-[outside]:group-data-[selected]:text-white",
16238
- "group-[.range-middle]:rounded-none group-[.range-middle]:bg-transparent",
16239
- "group-data-[selected]:group-[.range-middle]:bg-[#edf7ff] group-data-[selected]:group-[.range-middle]:text-[var(--chekin-color-brand-navy)]"
16240
- ].join(" "),
16241
- day: "group size-9 p-0 text-center text-[14px]",
16242
- range_start: "range-start",
16243
- range_end: "range-end",
16244
- range_middle: "range-middle",
16245
- today: [
16246
- "*:after:pointer-events-none *:after:absolute *:after:bottom-1 *:after:start-1/2",
16247
- "*:after:z-10 *:after:size-[3px] *:after:-translate-x-1/2 *:after:rounded-full",
16248
- "*:after:bg-[var(--chekin-color-brand-blue)]",
16249
- "[&[data-selected]:not(.range-middle)>*]:after:bg-white"
16250
- ].join(" "),
16251
- outside: "text-[var(--chekin-color-gray-2)]",
16252
- hidden: "invisible"
16253
- };
16254
-
16255
16222
  // src/dashboard/date-range-picker/components/DateRangeCalendar.tsx
16256
16223
  import { jsx as jsx167 } from "react/jsx-runtime";
16257
- var calendarComponents = {
16258
- Chevron: ({ orientation }) => orientation === "left" ? /* @__PURE__ */ jsx167(ArrowLeft, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ jsx167(ArrowRight, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
16259
- };
16260
16224
  function DateRangeCalendar({
16261
16225
  value,
16262
16226
  month,
@@ -16269,11 +16233,11 @@ function DateRangeCalendar({
16269
16233
  minDays,
16270
16234
  autoFocus,
16271
16235
  disabledMatchers,
16272
- components: customComponents,
16236
+ components,
16273
16237
  ...dayPickerProps
16274
16238
  }) {
16275
16239
  return /* @__PURE__ */ jsx167(
16276
- DayPicker2,
16240
+ Calendar,
16277
16241
  {
16278
16242
  mode: "range",
16279
16243
  selected: value,
@@ -16281,16 +16245,14 @@ function DateRangeCalendar({
16281
16245
  onMonthChange,
16282
16246
  onSelect,
16283
16247
  numberOfMonths,
16284
- showOutsideDays: true,
16285
16248
  startMonth: minDate,
16286
16249
  endMonth: maxDate,
16287
16250
  max: maxDays,
16288
16251
  min: minDays,
16289
16252
  autoFocus,
16290
- classNames: dashboardCalendarClassNames,
16291
- components: { ...calendarComponents, ...customComponents },
16292
- className: "p-5",
16293
16253
  disabled: disabledMatchers,
16254
+ components,
16255
+ className: "p-5",
16294
16256
  ...dayPickerProps
16295
16257
  }
16296
16258
  );