@jobber/components 4.47.0 → 4.48.1-ensure-dat.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.
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { SetStateAction } from "react";
|
|
2
2
|
import { ComboboxOption } from "../../Combobox.types";
|
|
3
3
|
interface ComboboxListProps {
|
|
4
|
-
options: ComboboxOption[];
|
|
5
|
-
showEmptyState: boolean;
|
|
6
|
-
selected: ComboboxOption[];
|
|
7
|
-
optionsListRef: React.RefObject<HTMLUListElement>;
|
|
8
|
-
setFirstSelectedElement: React.Dispatch<SetStateAction<HTMLElement | null>>;
|
|
9
|
-
selectionHandler: (option: ComboboxOption) => void;
|
|
10
|
-
searchValue: string;
|
|
11
|
-
multiselect: boolean;
|
|
12
|
-
subjectNoun?: string;
|
|
4
|
+
readonly options: ComboboxOption[];
|
|
5
|
+
readonly showEmptyState: boolean;
|
|
6
|
+
readonly selected: ComboboxOption[];
|
|
7
|
+
readonly optionsListRef: React.RefObject<HTMLUListElement>;
|
|
8
|
+
readonly setFirstSelectedElement: React.Dispatch<SetStateAction<HTMLElement | null>>;
|
|
9
|
+
readonly selectionHandler: (option: ComboboxOption) => void;
|
|
10
|
+
readonly searchValue: string;
|
|
11
|
+
readonly multiselect: boolean;
|
|
12
|
+
readonly subjectNoun?: string;
|
|
13
13
|
}
|
|
14
14
|
export declare function ComboboxList(props: ComboboxListProps): JSX.Element;
|
|
15
15
|
export {};
|
package/dist/Combobox/index.js
CHANGED
|
@@ -56,8 +56,8 @@ function ComboboxSearch(props) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
var css_248z$3 = "._5n7VvEn39-Y- {\n position: relative;\n padding: calc(16px / 2) 0;\n padding: var(--space-small) 0;\n}\n\n.KhX5VfZjAog- {\n display: -ms-flexbox;\n display: flex;\n max-height: calc((16px / 2) * 33.33);\n max-height: calc(calc(16px / 2) * 33.33);\n max-height: calc(var(--space-small) * 33.33);\n margin: 0;\n padding: 0;\n overflow: scroll;\n list-style: none;\n -ms-flex-direction: column;\n flex-direction: column;\n gap: calc(16px / 4);\n gap: var(--space-smaller);\n}\n\n.NNCJVHYx6lc- {\n display: -ms-flexbox;\n display: flex;\n min-height: calc((calc(16px * 3) - calc(16px / 4)));\n min-height: calc((var(--space-largest) - var(--space-smaller)));\n box-sizing: border-box;\n margin: 0 calc(16px / 2);\n margin: 0 var(--space-small);\n padding: calc(16px / 2);\n padding: var(--space-small);\n border-radius: calc(16px / 4);\n border-radius: var(--radius-large);\n color: rgb(1, 41, 57);\n color: var(--color-heading);\n font-weight: 500;\n cursor: pointer;\n transition: all 200ms;\n transition: all var(--timing-base);\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: center;\n align-items: center;\n}\n\n.
|
|
60
|
-
var styles$3 = {"container":"_5n7VvEn39-Y-","optionsList":"KhX5VfZjAog-","option":"NNCJVHYx6lc-","
|
|
59
|
+
var css_248z$3 = "._5n7VvEn39-Y- {\n position: relative;\n padding: calc(16px / 2) 0;\n padding: var(--space-small) 0;\n}\n\n.KhX5VfZjAog- {\n display: -ms-flexbox;\n display: flex;\n max-height: calc((16px / 2) * 33.33);\n max-height: calc(calc(16px / 2) * 33.33);\n max-height: calc(var(--space-small) * 33.33);\n margin: 0;\n padding: 0;\n overflow: scroll;\n list-style: none;\n -ms-flex-direction: column;\n flex-direction: column;\n gap: calc(16px / 4);\n gap: var(--space-smaller);\n}\n\n.NNCJVHYx6lc- {\n display: -ms-flexbox;\n display: flex;\n min-height: calc((calc(16px * 3) - calc(16px / 4)));\n min-height: calc((var(--space-largest) - var(--space-smaller)));\n box-sizing: border-box;\n margin: 0 calc(16px / 2);\n margin: 0 var(--space-small);\n padding: calc(16px / 2);\n padding: var(--space-small);\n border-radius: calc(16px / 4);\n border-radius: var(--radius-large);\n color: rgb(1, 41, 57);\n color: var(--color-heading);\n font-weight: 500;\n cursor: pointer;\n transition: all 200ms;\n transition: all var(--timing-base);\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: center;\n align-items: center;\n}\n\n.NNCJVHYx6lc-:hover,\n.NNCJVHYx6lc-:focus {\n background-color: rgb(244, 244, 244);\n background-color: var(--color-surface--background);\n}\n\n.NNCJVHYx6lc-:focus {\n box-shadow: 0px 0px calc(16px / 4) calc(16px / 8)\n rgb(231, 213, 87);\n box-shadow: var(--shadow-focus);\n}\n\n._2IRm1sf-TUU-,\n.DTuoA8WPNzc- {\n padding: calc(16px / 2) calc(16px * 1);\n padding: var(--space-small) var(--space-base);\n}\n\n._5n7VvEn39-Y-::after {\n content: \"\";\n display: block;\n position: absolute;\n right: 0;\n bottom: calc(16px / 2);\n bottom: var(--space-small);\n left: 0;\n height: calc(16px * 1);\n height: var(--space-base);\n background: linear-gradient(\n 180deg,\n rgba(255, 255, 255, 0) 0%,\n rgb(255, 255, 255) 100%\n );\n}\n\n._5n7VvEn39-Y-::before {\n content: \"\";\n display: block;\n position: absolute;\n top: calc(16px / 2);\n top: var(--space-small);\n right: 0;\n left: 0;\n height: calc(16px * 1);\n height: var(--space-base);\n background: linear-gradient(\n to bottom,\n rgba(255, 255, 255, 1),\n rgba(255, 255, 255, 0)\n );\n}\n";
|
|
60
|
+
var styles$3 = {"container":"_5n7VvEn39-Y-","optionsList":"KhX5VfZjAog-","option":"NNCJVHYx6lc-","filterMessage":"_2IRm1sf-TUU-","emptyStateMessage":"DTuoA8WPNzc-"};
|
|
61
61
|
styleInject_es.styleInject(css_248z$3);
|
|
62
62
|
|
|
63
63
|
function ComboboxList(props) {
|
|
@@ -71,9 +71,7 @@ function ComboboxList(props) {
|
|
|
71
71
|
props.setFirstSelectedElement(listItem);
|
|
72
72
|
hasSeenFirstSelected = true;
|
|
73
73
|
}
|
|
74
|
-
}, key: option.id, tabIndex: -1, role: "option", "aria-selected": isSelected, onClick: () => props.selectionHandler(option), className: classnames__default["default"](styles$3.option,
|
|
75
|
-
[styles$3.selectedOption]: isSelected,
|
|
76
|
-
}) },
|
|
74
|
+
}, key: option.id, tabIndex: -1, role: "option", "aria-selected": isSelected, onClick: () => props.selectionHandler(option), className: classnames__default["default"](styles$3.option) },
|
|
77
75
|
option.label,
|
|
78
76
|
isSelected && React__default["default"].createElement(Icon.Icon, { name: "checkmark", color: "blue" })));
|
|
79
77
|
}))),
|
package/dist/DataList/index.js
CHANGED
|
@@ -101,6 +101,19 @@ function useDataListContext() {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
function useMediaQuery(CSSMediaQuery) {
|
|
104
|
+
/**
|
|
105
|
+
* matchMedia have had full support for browsers since 2012 but jest, being a
|
|
106
|
+
* lite version of a DOM, doesn't support it.
|
|
107
|
+
*
|
|
108
|
+
* Instead of the consumers mocking matchMedia on every usage of DataList,
|
|
109
|
+
* we can just return true to mimic the largest screen we support.
|
|
110
|
+
*
|
|
111
|
+
* In the event that the consumer wants to test the DataList on different
|
|
112
|
+
* screen sizes, they can use the `mockViewportWidth` function from
|
|
113
|
+
* `@jobber/components/useBreakpoints`.
|
|
114
|
+
*/
|
|
115
|
+
if (window.matchMedia === undefined)
|
|
116
|
+
return true;
|
|
104
117
|
const [matches, setMatches] = React.useState(window.matchMedia(CSSMediaQuery).matches);
|
|
105
118
|
React.useEffect(() => {
|
|
106
119
|
const media = window.matchMedia(CSSMediaQuery);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.48.1-ensure-dat.0+c9f6721e",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@jobber/design": "^0.46.0",
|
|
23
|
-
"@jobber/formatters": "
|
|
23
|
+
"@jobber/formatters": "^0.2.2",
|
|
24
24
|
"@jobber/hooks": "^2.5.0",
|
|
25
25
|
"@popperjs/core": "^2.0.6",
|
|
26
26
|
"@std-proposal/temporal": "0.0.1",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"> 1%",
|
|
85
85
|
"IE 10"
|
|
86
86
|
],
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "c9f6721e67913bd843936eb879ae82ecc66bee00"
|
|
88
88
|
}
|