@remit/ui 0.0.234 → 0.0.235

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.
@@ -2,8 +2,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import { useDrag } from "@use-gesture/react";
3
3
  import { Check, Mail, MailOpen, Trash2 } from "lucide-react";
4
4
  import { useRef, useState } from "react";
5
- import { mergeProps } from "react-aria";
6
5
  import { cn } from "../lib/cn.js";
6
+ import { mergeProps } from "../lib/merge-props.js";
7
7
  import { SWIPE_AXIS_THRESHOLD, SWIPE_DRAG_CONFIG, } from "../lib/swipe-config.js";
8
8
  import { holdConfig, isHold, LONG_PRESS_DELAY_MS, swallowReleaseClick, touchMenuSuppressionProps, } from "../lib/use-long-press.js";
9
9
  import { Avatar } from "./avatar.js";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export { mergeProps } from "react-aria";
2
1
  export { type BriefCategoryFilter, CATEGORY_PRESENTATION, CATEGORY_SECTION_ORDER, type CategoryPresentation, categoryChips, categoryLabels, categoryTone, getCategoryLabel, isBriefCategory, isThreadCategory, type ThreadCategory, } from "./category-presentation.js";
3
2
  export { AccountMenu, type AccountMenuProps, type AccountMenuSection, } from "./components/account-menu.js";
4
3
  export { type AccountServiceChange, type AccountServiceChangeCopy, AccountServiceChangeDialog, type AccountServiceChangeDialogProps, accountServiceChangeCopy, } from "./components/account-service-change-dialog.js";
@@ -208,6 +207,7 @@ export { defaultKeyboardHints, KEY_HINT_GROUPS, type KeyboardHint, type KeyHint,
208
207
  export { type DispatchResult, dispatchKey, isControlTarget, isEditableTarget, type KeyStroke, ROW_ATTRIBUTE, type SequencePrefix, } from "./lib/keymap-dispatch.js";
209
208
  export { isLabelColorValue, type LabelColorValue, labelColorOptions, labelDotClass, } from "./lib/label-color.js";
210
209
  export { DESKTOP_MEDIA_QUERY, DESKTOP_MIN_WIDTH, } from "./lib/layout-breakpoints.js";
210
+ export { mergeProps } from "./lib/merge-props.js";
211
211
  export { miniMonthWeeks, shiftMonth } from "./lib/mini-month.js";
212
212
  export { type OverlayAnswers, type OverlayScopeOptions, overlayStack, resolveAgainstOverlays, useOverlayScope, } from "./lib/overlay-scope.js";
213
213
  export { placePopup } from "./lib/popup-placement.js";
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- export { mergeProps } from "react-aria";
2
1
  export { CATEGORY_PRESENTATION, CATEGORY_SECTION_ORDER, categoryChips, categoryLabels, categoryTone, getCategoryLabel, isBriefCategory, isThreadCategory, } from "./category-presentation.js";
3
2
  export { AccountMenu, } from "./components/account-menu.js";
4
3
  export { AccountServiceChangeDialog, accountServiceChangeCopy, } from "./components/account-service-change-dialog.js";
@@ -206,6 +205,7 @@ export { defaultKeyboardHints, KEY_HINT_GROUPS, keyboardHintsFor, keysForAction,
206
205
  export { dispatchKey, isControlTarget, isEditableTarget, ROW_ATTRIBUTE, } from "./lib/keymap-dispatch.js";
207
206
  export { isLabelColorValue, labelColorOptions, labelDotClass, } from "./lib/label-color.js";
208
207
  export { DESKTOP_MEDIA_QUERY, DESKTOP_MIN_WIDTH, } from "./lib/layout-breakpoints.js";
208
+ export { mergeProps } from "./lib/merge-props.js";
209
209
  export { miniMonthWeeks, shiftMonth } from "./lib/mini-month.js";
210
210
  export { overlayStack, resolveAgainstOverlays, useOverlayScope, } from "./lib/overlay-scope.js";
211
211
  export { placePopup } from "./lib/popup-placement.js";
@@ -0,0 +1,8 @@
1
+ type Props = object;
2
+ type TupleTypes<T extends readonly unknown[]> = T[number];
3
+ type UnionToIntersection<U> = (U extends unknown ? (arg: U) => void : never) extends (arg: infer I) => void ? I : never;
4
+ type MergedProps<T extends readonly (Props | null | undefined)[]> = UnionToIntersection<TupleTypes<{
5
+ [K in keyof T]: NonNullable<T[K]>;
6
+ }>>;
7
+ export declare function mergeProps<T extends readonly (Props | null | undefined)[]>(...sources: T): MergedProps<T>;
8
+ export {};
@@ -0,0 +1,29 @@
1
+ function isEventHandlerKey(key) {
2
+ return /^on[A-Z]/.test(key);
3
+ }
4
+ function isHandler(value) {
5
+ return typeof value === "function";
6
+ }
7
+ function chainHandlers(first, second) {
8
+ return (...args) => {
9
+ first(...args);
10
+ second(...args);
11
+ };
12
+ }
13
+ export function mergeProps(...sources) {
14
+ const merged = {};
15
+ for (const source of sources) {
16
+ if (!source)
17
+ continue;
18
+ for (const [key, value] of Object.entries(source)) {
19
+ const previous = merged[key];
20
+ if (isEventHandlerKey(key) && isHandler(previous) && isHandler(value)) {
21
+ merged[key] = chainHandlers(previous, value);
22
+ }
23
+ else if (value !== undefined || !(key in merged)) {
24
+ merged[key] = value;
25
+ }
26
+ }
27
+ }
28
+ return merged;
29
+ }
@@ -1,5 +1,5 @@
1
1
  import { useDrag } from "@use-gesture/react";
2
- import { mergeProps } from "react-aria";
2
+ import { mergeProps } from "./merge-props.js";
3
3
  /**
4
4
  * Suppression lives on the document, not on the row.
5
5
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/ui",
3
- "version": "0.0.234",
3
+ "version": "0.0.235",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -50,7 +50,6 @@
50
50
  "@lexical/selection": "0.49.0",
51
51
  "@lexical/table": "0.49.0",
52
52
  "@lexical/utils": "0.49.0",
53
- "@react-types/shared": "3.36.0",
54
53
  "@use-gesture/react": "10.3.1",
55
54
  "@use-gesture/vanilla": "10.3.1",
56
55
  "clsx": "2.1.1",
@@ -58,7 +57,6 @@
58
57
  "franc-min": "6.2.0",
59
58
  "lexical": "0.49.0",
60
59
  "lucide-react": "0.468.0",
61
- "react-aria": "3.50.0",
62
60
  "react-resizable-panels": "2.1.9",
63
61
  "react-simple-pull-to-refresh": "1.3.4",
64
62
  "tailwind-merge": "2.6.1",