@webority/ui-react 0.6.12 → 0.7.0
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/examples.mobile.json-BMXTGiGC-Dl_Tt3py.js +250 -0
- package/dist/libphonenumber-js-BcNT8oq0-DMpMlice.js +11439 -0
- package/dist/types/components/AppColorField.d.ts +4 -1
- package/dist/types/components/AppModal.d.ts +1 -1
- package/dist/types/components/AppPhoneNumberInput.d.ts +1 -1
- package/dist/types/components/AppTabs.d.ts +2 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/ui-react.js +725 -582
- package/package.json +14 -5
- package/dist/types/lib/useListboxMenu.d.ts +0 -46
- package/dist/types/lib/usePopover.d.ts +0 -7
- package/dist/types/lib/useTableSort.d.ts +0 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"react-toastify": "^11.1.0",
|
|
32
|
-
"@webority/theme": "^0.
|
|
33
|
-
"@webority/ui-elements": "^0.
|
|
32
|
+
"@webority/theme": "^0.7.0",
|
|
33
|
+
"@webority/ui-elements": "^0.7.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"bootstrap": "5.3.3",
|
|
@@ -39,16 +39,25 @@
|
|
|
39
39
|
"react-dom": "^19.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
43
|
+
"@testing-library/react": "^16.3.0",
|
|
44
|
+
"@testing-library/user-event": "^14.6.1",
|
|
45
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
42
46
|
"@types/react": "^19.2.17",
|
|
43
47
|
"@vitejs/plugin-react": "^6.0.1",
|
|
44
48
|
"bootstrap": "5.3.3",
|
|
49
|
+
"jsdom": "^26.0.0",
|
|
45
50
|
"react": "^19.2.6",
|
|
46
51
|
"react-bootstrap": "^2.10.6",
|
|
47
52
|
"react-dom": "^19.2.6",
|
|
48
53
|
"typescript": "^7.0.2",
|
|
49
|
-
"vite": "^8.0.12"
|
|
54
|
+
"vite": "^8.0.12",
|
|
55
|
+
"vitest": "^3.2.4"
|
|
50
56
|
},
|
|
51
57
|
"scripts": {
|
|
52
|
-
"build": "vite build && tsc -p tsconfig.json"
|
|
58
|
+
"build": "vite build && tsc -p tsconfig.json",
|
|
59
|
+
"test": "vitest run",
|
|
60
|
+
"test:watch": "vitest",
|
|
61
|
+
"test:coverage": "vitest run --coverage"
|
|
53
62
|
}
|
|
54
63
|
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared portalled-listbox engine for AppSelect and AppSelectMini.
|
|
3
|
-
*
|
|
4
|
-
* Owns: open state (via usePopover), highlight, keyboard (Arrow/Home/End/Enter/Escape),
|
|
5
|
-
* outside-click / scroll / resize dismiss, fixed positioning under the trigger.
|
|
6
|
-
* Shells own chrome, option labels, and optional search field.
|
|
7
|
-
*
|
|
8
|
-
* @param {object} opts
|
|
9
|
-
* @param {unknown[]} opts.items Options currently shown (already filtered if searchable).
|
|
10
|
-
* @param {unknown} opts.value Controlled selected value.
|
|
11
|
-
* @param {(item: unknown, value: unknown) => boolean} opts.isSelected
|
|
12
|
-
* @param {(item: unknown) => void} opts.onPick Called with the chosen item; shell maps to value.
|
|
13
|
-
* @param {boolean} [opts.disabled]
|
|
14
|
-
* @param {"match-width"|"mini"} [opts.position] match-width = full field width; mini = toolbar align.
|
|
15
|
-
* @param {"left"|"right"} [opts.menuAlign] mini only.
|
|
16
|
-
* @param {() => void} [opts.onOpened] After open (e.g. focus search input).
|
|
17
|
-
* @param {(e: KeyboardEvent) => boolean} [opts.shouldIgnoreSpace] Return true to type space in search.
|
|
18
|
-
*/
|
|
19
|
-
export default function useListboxMenu({ items, value, isSelected, onPick, disabled, position, menuAlign, onOpened, shouldIgnoreSpace, }: {
|
|
20
|
-
items: unknown[];
|
|
21
|
-
value: unknown;
|
|
22
|
-
isSelected: (item: unknown, value: unknown) => boolean;
|
|
23
|
-
onPick: (item: unknown) => void;
|
|
24
|
-
disabled?: boolean;
|
|
25
|
-
position?: "match-width" | "mini";
|
|
26
|
-
menuAlign?: "left" | "right";
|
|
27
|
-
onOpened?: () => void;
|
|
28
|
-
shouldIgnoreSpace?: (e: KeyboardEvent) => boolean;
|
|
29
|
-
}): {
|
|
30
|
-
open: boolean | import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
31
|
-
setOpen: boolean | import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
32
|
-
pos: any;
|
|
33
|
-
hasPos: boolean;
|
|
34
|
-
highlight: number;
|
|
35
|
-
setHighlight: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
36
|
-
rootRef: import("react").RefObject<any>;
|
|
37
|
-
menuRef: import("react").RefObject<any>;
|
|
38
|
-
triggerRef: import("react").RefObject<any>;
|
|
39
|
-
listId: string;
|
|
40
|
-
activeId: string;
|
|
41
|
-
close: (restoreFocus?: boolean) => void;
|
|
42
|
-
selectAt: (index: any) => void;
|
|
43
|
-
onListKeyDown: (e: any) => void;
|
|
44
|
-
onTriggerKeyDown: (e: any) => void;
|
|
45
|
-
toggle: () => void;
|
|
46
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Coordinated open/close state for a floating popover. Behaves like useState(false)
|
|
3
|
-
* but, whenever it opens, closes every other popover using this hook. Returns
|
|
4
|
-
* `[open, setOpen]` with the same (stable-setter) API as useState so call sites stay
|
|
5
|
-
* unchanged.
|
|
6
|
-
*/
|
|
7
|
-
export default function usePopover(): (boolean | import("react").Dispatch<import("react").SetStateAction<boolean>>)[];
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared client-side table sort. Every ledger screen had its own identical
|
|
3
|
-
* `toggleSort` + comparator + `useMemo(sorted)`; this is that logic, once.
|
|
4
|
-
*
|
|
5
|
-
* `accessors` maps a column key to a value getter (defaults to `row[key]`) for
|
|
6
|
-
* columns whose sort value differs from the field name (e.g. "dates" → startDate).
|
|
7
|
-
* Pass a module-level constant so its identity is stable across renders.
|
|
8
|
-
*
|
|
9
|
-
* Numeric pairs compare numerically; everything else by locale string.
|
|
10
|
-
*/
|
|
11
|
-
export declare function useTableSort(rows: any, { defaultSort, accessors }?: {
|
|
12
|
-
accessors?: {};
|
|
13
|
-
defaultSort?: {
|
|
14
|
-
key: any;
|
|
15
|
-
dir: string;
|
|
16
|
-
};
|
|
17
|
-
}): {
|
|
18
|
-
sort: {
|
|
19
|
-
key: any;
|
|
20
|
-
dir: string;
|
|
21
|
-
};
|
|
22
|
-
toggleSort: (key: any) => void;
|
|
23
|
-
sorted: any;
|
|
24
|
-
};
|
|
25
|
-
export default useTableSort;
|