@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 +55 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +47 -77
- package/dist/index.js.map +1 -1
- package/package.json +23 -4
- package/postcss.config.mjs +7 -0
- package/src/global.css +213 -0
- package/tailwind.config.js +97 -0
package/dist/index.d.cts
CHANGED
|
@@ -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
|
@@ -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
|
@@ -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
|
|
@@ -8218,7 +8220,7 @@ var SignatureCanvas = forwardRef40(
|
|
|
8218
8220
|
type: "button",
|
|
8219
8221
|
className: cn(
|
|
8220
8222
|
"absolute left-0 top-0 z-10 flex h-[174px] w-[250px] flex-col items-center",
|
|
8221
|
-
"justify-between rounded border-0 bg-[var(--signature-canvas-placeholder-bg)] px-0 pb-
|
|
8223
|
+
"justify-between rounded border-0 bg-[var(--signature-canvas-placeholder-bg)] px-0 pb-7 pt-10",
|
|
8222
8224
|
"cursor-pointer select-none"
|
|
8223
8225
|
),
|
|
8224
8226
|
onClick: onEnable,
|
|
@@ -8229,7 +8231,7 @@ var SignatureCanvas = forwardRef40(
|
|
|
8229
8231
|
"span",
|
|
8230
8232
|
{
|
|
8231
8233
|
className: cn(
|
|
8232
|
-
"mx-auto max-w-[154px] break-words text-center text-sm font-medium uppercase",
|
|
8234
|
+
"mx-auto mt-2 max-w-[154px] break-words text-center text-sm font-medium uppercase",
|
|
8233
8235
|
"text-[var(--signature-canvas-placeholder-text)] opacity-[0.55]"
|
|
8234
8236
|
),
|
|
8235
8237
|
children: /* @__PURE__ */ jsx102(Trans, { i18nKey: "signature_placeholder_text" })
|
|
@@ -9870,15 +9872,15 @@ function UploadedFilesList({
|
|
|
9870
9872
|
return /* @__PURE__ */ jsx129("div", { className: cn("flex flex-wrap gap-2.5", className), children: files.map((file, index) => /* @__PURE__ */ jsxs77(
|
|
9871
9873
|
"div",
|
|
9872
9874
|
{
|
|
9873
|
-
className: "flex cursor-default items-center gap-2 rounded border border-[
|
|
9875
|
+
className: "flex cursor-default items-center gap-2 rounded border border-[#acacd5] bg-[#f0f0f8] py-1.5 pl-3 pr-1.5",
|
|
9874
9876
|
children: [
|
|
9875
|
-
/* @__PURE__ */ jsx129("span", { className: "text-nowrap text-sm font-medium leading-5 text-[
|
|
9877
|
+
/* @__PURE__ */ jsx129("span", { className: "text-nowrap text-sm font-medium leading-5 text-[#161643]", children: file.name }),
|
|
9876
9878
|
/* @__PURE__ */ jsx129(
|
|
9877
9879
|
"button",
|
|
9878
9880
|
{
|
|
9879
9881
|
type: "button",
|
|
9880
9882
|
onClick: () => onRemoveFile(file.name),
|
|
9881
|
-
className: "flex h-[18px] w-[18px] shrink-0 cursor-pointer items-center justify-center rounded bg-[
|
|
9883
|
+
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",
|
|
9882
9884
|
"aria-label": `Remove ${file.name}`,
|
|
9883
9885
|
children: /* @__PURE__ */ jsx129(X6, { className: "h-3.5 w-3.5 text-white", strokeWidth: 3 })
|
|
9884
9886
|
}
|
|
@@ -14470,7 +14472,9 @@ function DashboardMultiSelectInternal({
|
|
|
14470
14472
|
}, [isOpen, filteredOptions]);
|
|
14471
14473
|
React58.useEffect(() => {
|
|
14472
14474
|
if (!isOpen || !isMobile2) return;
|
|
14473
|
-
const frame = window.requestAnimationFrame(
|
|
14475
|
+
const frame = window.requestAnimationFrame(
|
|
14476
|
+
() => mobileSearchInputRef.current?.focus()
|
|
14477
|
+
);
|
|
14474
14478
|
return () => window.cancelAnimationFrame(frame);
|
|
14475
14479
|
}, [isOpen, isMobile2]);
|
|
14476
14480
|
const openMenu = () => {
|
|
@@ -15939,6 +15943,7 @@ var createDisabledMatchers = ({
|
|
|
15939
15943
|
|
|
15940
15944
|
// src/dashboard/date-range-picker/hooks/useRangeValue.ts
|
|
15941
15945
|
import * as React63 from "react";
|
|
15946
|
+
var getRangeKey = (range) => `${range?.from?.getTime() ?? ""}-${range?.to?.getTime() ?? ""}`;
|
|
15942
15947
|
function useRangeValue({
|
|
15943
15948
|
value: externalValue,
|
|
15944
15949
|
defaultValue,
|
|
@@ -15946,22 +15951,29 @@ function useRangeValue({
|
|
|
15946
15951
|
name
|
|
15947
15952
|
}) {
|
|
15948
15953
|
const isControlled = externalValue !== void 0;
|
|
15949
|
-
const [
|
|
15950
|
-
defaultValue
|
|
15954
|
+
const [draft, setDraft] = React63.useState(
|
|
15955
|
+
isControlled ? externalValue : defaultValue
|
|
15951
15956
|
);
|
|
15952
|
-
const
|
|
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
|
+
}
|
|
15953
15965
|
const commit = React63.useCallback(
|
|
15954
15966
|
(next) => {
|
|
15955
|
-
|
|
15967
|
+
setDraft(next);
|
|
15956
15968
|
if (next === void 0) {
|
|
15957
15969
|
onChange?.(void 0, name);
|
|
15958
15970
|
return;
|
|
15959
15971
|
}
|
|
15960
|
-
if (next
|
|
15972
|
+
if (next.from && next.to) onChange?.(next, name);
|
|
15961
15973
|
},
|
|
15962
|
-
[
|
|
15974
|
+
[name, onChange]
|
|
15963
15975
|
);
|
|
15964
|
-
return { value, commit };
|
|
15976
|
+
return { value: draft, commit };
|
|
15965
15977
|
}
|
|
15966
15978
|
|
|
15967
15979
|
// src/dashboard/date-range-picker/hooks/useRangeTextInputs.ts
|
|
@@ -16207,54 +16219,8 @@ function DateRangeInputs({
|
|
|
16207
16219
|
);
|
|
16208
16220
|
}
|
|
16209
16221
|
|
|
16210
|
-
// src/dashboard/date-range-picker/components/DateRangeCalendar.tsx
|
|
16211
|
-
import { ArrowLeft, ArrowRight } from "lucide-react";
|
|
16212
|
-
import {
|
|
16213
|
-
DayPicker as DayPicker2
|
|
16214
|
-
} from "react-day-picker";
|
|
16215
|
-
|
|
16216
|
-
// src/dashboard/_calendar/dashboardCalendarClassNames.ts
|
|
16217
|
-
var dashboardCalendarClassNames = {
|
|
16218
|
-
root: "relative",
|
|
16219
|
-
months: "relative flex flex-col gap-6 sm:flex-row sm:gap-8",
|
|
16220
|
-
month: "w-full",
|
|
16221
|
-
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)]",
|
|
16222
|
-
caption_label: "px-3 text-[18px] font-normal",
|
|
16223
|
-
nav: "absolute left-0 right-0 top-[4px] z-10 flex justify-between px-[6px] pointer-events-none",
|
|
16224
|
-
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",
|
|
16225
|
-
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",
|
|
16226
|
-
weekday: "size-9 p-0 text-[14px] font-normal text-[var(--chekin-color-brand-blue)]",
|
|
16227
|
-
day_button: [
|
|
16228
|
-
"relative mx-auto flex size-9 items-center justify-center whitespace-nowrap rounded-full p-0",
|
|
16229
|
-
"text-[14px] font-light text-[var(--chekin-color-brand-navy)] outline-offset-2",
|
|
16230
|
-
"focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--chekin-color-brand-blue)]/60",
|
|
16231
|
-
"hover:bg-[#f0f8ff]",
|
|
16232
|
-
"group-data-[selected]:bg-[var(--chekin-color-brand-blue)] group-data-[selected]:text-white",
|
|
16233
|
-
"group-data-[disabled]:pointer-events-none group-data-[disabled]:text-[var(--chekin-color-gray-2)] group-data-[disabled]:line-through",
|
|
16234
|
-
"group-data-[outside]:text-[var(--chekin-color-gray-2)]",
|
|
16235
|
-
"group-data-[outside]:group-data-[selected]:text-white",
|
|
16236
|
-
"group-[.range-middle]:rounded-none group-[.range-middle]:bg-transparent",
|
|
16237
|
-
"group-data-[selected]:group-[.range-middle]:bg-[#edf7ff] group-data-[selected]:group-[.range-middle]:text-[var(--chekin-color-brand-navy)]"
|
|
16238
|
-
].join(" "),
|
|
16239
|
-
day: "group size-9 p-0 text-center text-[14px]",
|
|
16240
|
-
range_start: "range-start",
|
|
16241
|
-
range_end: "range-end",
|
|
16242
|
-
range_middle: "range-middle",
|
|
16243
|
-
today: [
|
|
16244
|
-
"*:after:pointer-events-none *:after:absolute *:after:bottom-1 *:after:start-1/2",
|
|
16245
|
-
"*:after:z-10 *:after:size-[3px] *:after:-translate-x-1/2 *:after:rounded-full",
|
|
16246
|
-
"*:after:bg-[var(--chekin-color-brand-blue)]",
|
|
16247
|
-
"[&[data-selected]:not(.range-middle)>*]:after:bg-white"
|
|
16248
|
-
].join(" "),
|
|
16249
|
-
outside: "text-[var(--chekin-color-gray-2)]",
|
|
16250
|
-
hidden: "invisible"
|
|
16251
|
-
};
|
|
16252
|
-
|
|
16253
16222
|
// src/dashboard/date-range-picker/components/DateRangeCalendar.tsx
|
|
16254
16223
|
import { jsx as jsx167 } from "react/jsx-runtime";
|
|
16255
|
-
var calendarComponents = {
|
|
16256
|
-
Chevron: ({ orientation }) => orientation === "left" ? /* @__PURE__ */ jsx167(ArrowLeft, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ jsx167(ArrowRight, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
|
|
16257
|
-
};
|
|
16258
16224
|
function DateRangeCalendar({
|
|
16259
16225
|
value,
|
|
16260
16226
|
month,
|
|
@@ -16267,11 +16233,11 @@ function DateRangeCalendar({
|
|
|
16267
16233
|
minDays,
|
|
16268
16234
|
autoFocus,
|
|
16269
16235
|
disabledMatchers,
|
|
16270
|
-
components
|
|
16236
|
+
components,
|
|
16271
16237
|
...dayPickerProps
|
|
16272
16238
|
}) {
|
|
16273
16239
|
return /* @__PURE__ */ jsx167(
|
|
16274
|
-
|
|
16240
|
+
Calendar,
|
|
16275
16241
|
{
|
|
16276
16242
|
mode: "range",
|
|
16277
16243
|
selected: value,
|
|
@@ -16279,16 +16245,14 @@ function DateRangeCalendar({
|
|
|
16279
16245
|
onMonthChange,
|
|
16280
16246
|
onSelect,
|
|
16281
16247
|
numberOfMonths,
|
|
16282
|
-
showOutsideDays: true,
|
|
16283
16248
|
startMonth: minDate,
|
|
16284
16249
|
endMonth: maxDate,
|
|
16285
16250
|
max: maxDays,
|
|
16286
16251
|
min: minDays,
|
|
16287
16252
|
autoFocus,
|
|
16288
|
-
classNames: dashboardCalendarClassNames,
|
|
16289
|
-
components: { ...calendarComponents, ...customComponents },
|
|
16290
|
-
className: "p-5",
|
|
16291
16253
|
disabled: disabledMatchers,
|
|
16254
|
+
components,
|
|
16255
|
+
className: "p-5",
|
|
16292
16256
|
...dayPickerProps
|
|
16293
16257
|
}
|
|
16294
16258
|
);
|
|
@@ -16405,7 +16369,13 @@ var DashboardDateRangePicker = React66.forwardRef(function DashboardDateRangePic
|
|
|
16405
16369
|
const normalizedMaxDate = React66.useMemo(() => toDate(maxDate), [maxDate]);
|
|
16406
16370
|
const formatter = React66.useMemo(() => formatDate(displayFormat), [displayFormat]);
|
|
16407
16371
|
const parser = React66.useMemo(() => parseDate(displayFormat), [displayFormat]);
|
|
16408
|
-
const { fromText, toText, setFromText, setToText, handleFromBlur, handleToBlur } = useRangeTextInputs({
|
|
16372
|
+
const { fromText, toText, setFromText, setToText, handleFromBlur, handleToBlur } = useRangeTextInputs({
|
|
16373
|
+
value,
|
|
16374
|
+
format: formatter,
|
|
16375
|
+
parse: parser,
|
|
16376
|
+
onCommit: commit,
|
|
16377
|
+
onBlur
|
|
16378
|
+
});
|
|
16409
16379
|
const { month, setMonth, syncMonthToValue } = useRangeMonthSync(value);
|
|
16410
16380
|
const [isOpen, setIsOpen] = React66.useState(false);
|
|
16411
16381
|
const [focusedInput, setFocusedInput] = React66.useState(null);
|
|
@@ -16488,7 +16458,15 @@ var DashboardDateRangePicker = React66.forwardRef(function DashboardDateRangePic
|
|
|
16488
16458
|
open: openCalendar,
|
|
16489
16459
|
close: closeCalendar
|
|
16490
16460
|
}),
|
|
16491
|
-
[
|
|
16461
|
+
[
|
|
16462
|
+
closeCalendar,
|
|
16463
|
+
commit,
|
|
16464
|
+
formatter,
|
|
16465
|
+
openCalendar,
|
|
16466
|
+
setFromText,
|
|
16467
|
+
setToText,
|
|
16468
|
+
syncMonthToValue
|
|
16469
|
+
]
|
|
16492
16470
|
);
|
|
16493
16471
|
return /* @__PURE__ */ jsx169(
|
|
16494
16472
|
"div",
|
|
@@ -16918,15 +16896,7 @@ var DashboardFileInput = React69.forwardRef(
|
|
|
16918
16896
|
onClick: handleClear,
|
|
16919
16897
|
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]",
|
|
16920
16898
|
"aria-label": t("remove_file"),
|
|
16921
|
-
children: /* @__PURE__ */ jsx171(
|
|
16922
|
-
SquareX5,
|
|
16923
|
-
{
|
|
16924
|
-
size: 15,
|
|
16925
|
-
fill: "#9696b9",
|
|
16926
|
-
color: "#f8f8f8",
|
|
16927
|
-
strokeWidth: 1.8
|
|
16928
|
-
}
|
|
16929
|
-
)
|
|
16899
|
+
children: /* @__PURE__ */ jsx171(SquareX5, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
16930
16900
|
}
|
|
16931
16901
|
)
|
|
16932
16902
|
]
|