@adamjanicki/ui-extended 1.1.2 → 1.1.3
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/README.md +0 -6
- package/components/Autocomplete.d.ts +1 -1
- package/components/Autocomplete.js +6 -2
- package/components/Popover.d.ts +2 -2
- package/components/Tooltip.d.ts +1 -1
- package/package.json +9 -21
- package/style.css +1 -1
package/README.md
CHANGED
|
@@ -8,12 +8,6 @@
|
|
|
8
8
|
npm install @adamjanicki/ui-extended
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
// Add here
|
|
15
|
-
```
|
|
16
|
-
|
|
17
11
|
## Importing CSS
|
|
18
12
|
|
|
19
13
|
Unfortunately, there was no great way to handle CSS. I often hate how large libraries make it extremely difficult to override CSS without using `!important`, or using inline styles. So, I've decided to just import the CSS directly into your project. Here's an example of how to do it:
|
|
@@ -95,5 +95,5 @@ interface Props<T> {
|
|
|
95
95
|
*/
|
|
96
96
|
remainOpenOnSelectOrEnter?: boolean;
|
|
97
97
|
}
|
|
98
|
-
declare const Autocomplete: <T>(props: Props<T>) => JSX.Element;
|
|
98
|
+
declare const Autocomplete: <T>(props: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
99
99
|
export default Autocomplete;
|
|
@@ -125,13 +125,17 @@ var Autocomplete = function (props) {
|
|
|
125
125
|
setOn(undefined);
|
|
126
126
|
onInputChange(e);
|
|
127
127
|
if (e.target.value) {
|
|
128
|
-
!open
|
|
128
|
+
if (!open) {
|
|
129
|
+
openMenu();
|
|
130
|
+
}
|
|
129
131
|
}
|
|
130
132
|
else {
|
|
131
133
|
focusInput();
|
|
132
134
|
}
|
|
133
135
|
}, onClick: function () {
|
|
134
|
-
!open
|
|
136
|
+
if (!open) {
|
|
137
|
+
openMenu();
|
|
138
|
+
}
|
|
135
139
|
}, ref: inputRef, autoComplete: "off" }) })), _jsxs(Popover, __assign({}, popoverProps, { open: popoverOpen, triggerRef: inputContainerRef, style: __assign(__assign({ zIndex: 100 }, ((popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.style) || {})), { padding: 0, margin: 0, width: (_b = (_a = inputContainerRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) !== null && _b !== void 0 ? _b : 0 }), className: classNames("ajui-autocomplete-popover", popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.className), children: [_jsx("ul", __assign({}, listProps, { className: classNames("ajui-autocomplete-ul", listProps.className), children: filteredOptions.length
|
|
136
140
|
? filteredOptions.map(function (option, index) {
|
|
137
141
|
var group = groupMap.get(index);
|
package/components/Popover.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ type Props = {
|
|
|
8
8
|
/**
|
|
9
9
|
* The trigger ref for the element to position the popover over.
|
|
10
10
|
*/
|
|
11
|
-
triggerRef: React.RefObject<HTMLElement>;
|
|
11
|
+
triggerRef: React.RefObject<HTMLElement | null>;
|
|
12
12
|
/**
|
|
13
13
|
* Whether the popover is open.
|
|
14
14
|
*/
|
|
@@ -42,5 +42,5 @@ type Props = {
|
|
|
42
42
|
*/
|
|
43
43
|
returnFocusOnEscape?: boolean;
|
|
44
44
|
};
|
|
45
|
-
declare const Popover: (props: Props) => JSX.Element | null;
|
|
45
|
+
declare const Popover: (props: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
46
46
|
export default Popover;
|
package/components/Tooltip.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamjanicki/ui-extended",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "More advanced UI components and hooks for React in TypeScript",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -11,34 +11,22 @@
|
|
|
11
11
|
"url": "git+https://github.com/adamjanicki2/ui-extended.git"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "tsc; cp src/style.css ./style.css",
|
|
15
14
|
"clean": "./clean.sh",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"prepare": "npm run
|
|
15
|
+
"lint": "eslint src --max-warnings=0",
|
|
16
|
+
"build": "npm run clean && npm run lint && tsc; cp src/style.css ./style.css",
|
|
17
|
+
"prepare": "npm run build"
|
|
19
18
|
},
|
|
20
19
|
"peerDependencies": {
|
|
21
20
|
"react": ">=18",
|
|
22
21
|
"react-dom": ">=18"
|
|
23
22
|
},
|
|
24
23
|
"dependencies": {
|
|
25
|
-
"@adamjanicki/ui": "
|
|
26
|
-
"@floating-ui/react": "
|
|
24
|
+
"@adamjanicki/ui": "^1.5.5",
|
|
25
|
+
"@floating-ui/react": "^0.26.17"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"
|
|
32
|
-
"eslint-config-prettier": "^9.0.0",
|
|
33
|
-
"eslint-plugin-react": "^7.33.2",
|
|
34
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
35
|
-
"nodemon": "^3.1.4",
|
|
36
|
-
"typescript": "^5.2.2"
|
|
37
|
-
},
|
|
38
|
-
"eslintConfig": {
|
|
39
|
-
"extends": [
|
|
40
|
-
"react-app",
|
|
41
|
-
"react-app/jest"
|
|
42
|
-
]
|
|
28
|
+
"@types/react": "^19.1.9",
|
|
29
|
+
"@types/react-dom": "^19.1.7",
|
|
30
|
+
"typescript": "^5.9.2"
|
|
43
31
|
}
|
|
44
32
|
}
|
package/style.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@media (hover: hover) {
|
|
2
2
|
.ajui-autocomplete-on-option,
|
|
3
3
|
.ajui-autocomplete-option:hover {
|
|
4
|
-
background-color:
|
|
4
|
+
background-color: #eee;
|
|
5
5
|
}
|
|
6
6
|
[data-theme="dark"] .ajui-autocomplete-on-option,
|
|
7
7
|
[data-theme="dark"] .ajui-autocomplete-option:hover {
|