@navikt/ds-react 0.17.2-beta.0 → 0.17.4
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/LICENCE +31 -0
- package/cjs/form/search/Search.js +3 -5
- package/cjs/form/search/SearchButton.js +5 -2
- package/cjs/help-text/HelpText.js +9 -17
- package/esm/form/search/Search.d.ts +1 -0
- package/esm/form/search/Search.js +3 -5
- package/esm/form/search/Search.js.map +1 -1
- package/esm/form/search/SearchButton.js +5 -2
- package/esm/form/search/SearchButton.js.map +1 -1
- package/esm/help-text/HelpText.js +10 -18
- package/esm/help-text/HelpText.js.map +1 -1
- package/package.json +4 -3
- package/src/form/search/Search.tsx +5 -8
- package/src/form/search/SearchButton.tsx +5 -2
- package/src/form/search/search.stories.tsx +16 -13
- package/src/help-text/HelpText.tsx +11 -22
- package/src/help-text/help-text.stories.tsx +28 -0
- package/src/help-text/stories/help-text.stories.mdx +0 -35
- package/src/help-text/stories/help-text.stories.tsx +0 -32
package/LICENCE
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Font License
|
|
2
|
+
|
|
3
|
+
The Source Sans Pro font files in packages/node_modules/nav-frontend-typografi-style/assets are a subset of Source Sans Pro, licensed under the SIL Open Font License, and copyright Adobe Systems Incorporated, with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
|
|
4
|
+
|
|
5
|
+
Icon License
|
|
6
|
+
|
|
7
|
+
This project uses Streamline Icons. If you use nav-frontend-moduler in your project please adhere to the Streamline Icons license agreement found here: https://streamlineicons.com/ux/extended-license.html
|
|
8
|
+
|
|
9
|
+
The rest of the codebase (excluding 3rd party dependencies):
|
|
10
|
+
|
|
11
|
+
# The MIT License
|
|
12
|
+
|
|
13
|
+
Copyright 2019 NAV (Arbeids- og velferdsdirektoratet) - The Norwegian Labour and Welfare Administration
|
|
14
|
+
|
|
15
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
16
|
+
a copy of this software and associated documentation files (the "Software"),
|
|
17
|
+
to deal in the Software without restriction, including without limitation
|
|
18
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
19
|
+
and/or sell copies of the Software, and to permit persons to whom the
|
|
20
|
+
Software is furnished to do so, subject to the following conditions:
|
|
21
|
+
|
|
22
|
+
The above copyright notice and this permission notice shall be included
|
|
23
|
+
in all copies or substantial portions of the Software.
|
|
24
|
+
|
|
25
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
26
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
27
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
28
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
29
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
30
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
31
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -76,12 +76,9 @@ const Search = (0, react_1.forwardRef)((props, ref) => {
|
|
|
76
76
|
(0, react_1.useEffect)(() => {
|
|
77
77
|
value !== undefined && setControlledValue(value);
|
|
78
78
|
}, [value]);
|
|
79
|
-
return (react_1.default.createElement("
|
|
79
|
+
return (react_1.default.createElement("div", { ref: setWrapperRef, className: (0, classnames_1.default)(className, "navds-form-field", `navds-form-field--${size}`, "navds-search", {
|
|
80
80
|
"navds-search--disabled": !!inputProps.disabled,
|
|
81
|
-
}),
|
|
82
|
-
e.preventDefault();
|
|
83
|
-
onSearch === null || onSearch === void 0 ? void 0 : onSearch(controlledValue);
|
|
84
|
-
} },
|
|
81
|
+
}) },
|
|
85
82
|
react_1.default.createElement(__1.Label, { htmlFor: inputProps.id, size: size, as: "label", className: (0, classnames_1.default)("navds-text-field__label", {
|
|
86
83
|
"navds-sr-only": hideLabel,
|
|
87
84
|
}) }, label),
|
|
@@ -98,6 +95,7 @@ const Search = (0, react_1.forwardRef)((props, ref) => {
|
|
|
98
95
|
size,
|
|
99
96
|
disabled: inputProps.disabled,
|
|
100
97
|
variant,
|
|
98
|
+
onSearch: () => onSearch === null || onSearch === void 0 ? void 0 : onSearch(controlledValue),
|
|
101
99
|
} }, children ? children : react_1.default.createElement(SearchButton_1.default, null)))));
|
|
102
100
|
});
|
|
103
101
|
Search.Button = SearchButton_1.default;
|
|
@@ -50,8 +50,11 @@ const SearchButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
50
50
|
console.warn("<Search.Button> has to be wrapped in <Search />");
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
|
-
const { size, variant } = context;
|
|
54
|
-
return (react_1.default.createElement(__1.Button, Object.assign({ type: "submit" }, rest, { ref: ref, size: size, variant: variant, className: (0, classnames_1.default)("navds-search__button-search", className), disabled: (_b = context === null || context === void 0 ? void 0 : context.disabled) !== null && _b !== void 0 ? _b : disabled, onClick: (e) =>
|
|
53
|
+
const { size, variant, onSearch } = context;
|
|
54
|
+
return (react_1.default.createElement(__1.Button, Object.assign({ type: "submit" }, rest, { ref: ref, size: size, variant: variant, className: (0, classnames_1.default)("navds-search__button-search", className), disabled: (_b = context === null || context === void 0 ? void 0 : context.disabled) !== null && _b !== void 0 ? _b : disabled, onClick: (e) => {
|
|
55
|
+
onSearch === null || onSearch === void 0 ? void 0 : onSearch();
|
|
56
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
57
|
+
} }),
|
|
55
58
|
react_1.default.createElement(ds_icons_1.Search, { "aria-hidden": true }),
|
|
56
59
|
children ? children : react_1.default.createElement("span", { className: "navds-sr-only" }, "S\u00F8k")));
|
|
57
60
|
});
|
|
@@ -43,25 +43,17 @@ const react_1 = __importStar(require("react"));
|
|
|
43
43
|
const react_merge_refs_1 = __importDefault(require("react-merge-refs"));
|
|
44
44
|
const __1 = require("..");
|
|
45
45
|
const HelpText = (0, react_1.forwardRef)((_a, ref) => {
|
|
46
|
-
var { className, children, placement = "top", strategy = "absolute", title = "hjelp" } = _a, rest = __rest(_a, ["className", "children", "placement", "strategy", "title"]);
|
|
46
|
+
var { className, children, placement = "top", strategy = "absolute", title = "hjelp", onClick } = _a, rest = __rest(_a, ["className", "children", "placement", "strategy", "title", "onClick"]);
|
|
47
47
|
const buttonRef = (0, react_1.useRef)(null);
|
|
48
48
|
const mergedRef = (0, react_merge_refs_1.default)([buttonRef, ref]);
|
|
49
|
-
const [popoverRef, setPopoverRef] = (0, react_1.useState)(null);
|
|
50
|
-
const wrapperRef = (0, react_1.useRef)(null);
|
|
51
49
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
52
|
-
(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return (react_1.default.createElement("div", { className: "navds-help-text", ref: wrapperRef },
|
|
61
|
-
react_1.default.createElement("button", Object.assign({}, rest, { ref: mergedRef, onClick: (e) => handleClick(e), className: (0, classnames_1.default)(className, "navds-help-text__button"), type: "button", "aria-expanded": open, "aria-haspopup": "dialog", title: title }),
|
|
62
|
-
react_1.default.createElement(ds_icons_1.Helptext, { className: "navds-help-text__icon" }),
|
|
63
|
-
react_1.default.createElement("span", { className: "navds-sr-only" }, title)),
|
|
64
|
-
react_1.default.createElement(__1.Popover, { ref: setPopoverRef, onClose: () => setOpen(false), className: "navds-help-text__popover", open: open, role: "tooltip", anchorEl: buttonRef.current, placement: placement, strategy: strategy },
|
|
65
|
-
react_1.default.createElement(__1.Popover.Content, null, children))));
|
|
50
|
+
return (react_1.default.createElement("div", { className: "navds-help-text" },
|
|
51
|
+
react_1.default.createElement("button", Object.assign({}, rest, { ref: mergedRef, onClick: (e) => {
|
|
52
|
+
setOpen((x) => !x);
|
|
53
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
54
|
+
}, className: (0, classnames_1.default)(className, "navds-help-text__button"), type: "button", "aria-expanded": open, title: title }),
|
|
55
|
+
react_1.default.createElement(ds_icons_1.Helptext, { className: "navds-help-text__icon", "aria-hidden": true })),
|
|
56
|
+
react_1.default.createElement(__1.Popover, { onClose: () => setOpen(false), className: "navds-help-text__popover", open: open, anchorEl: buttonRef.current, placement: placement, strategy: strategy },
|
|
57
|
+
react_1.default.createElement(__1.Popover.Content, { className: "navds-body-short" }, children))));
|
|
66
58
|
});
|
|
67
59
|
exports.default = HelpText;
|
|
@@ -55,6 +55,7 @@ export interface SearchContextProps {
|
|
|
55
55
|
disabled?: boolean;
|
|
56
56
|
size: "medium" | "small";
|
|
57
57
|
variant?: "tertiary" | "primary";
|
|
58
|
+
onSearch?: () => void;
|
|
58
59
|
}
|
|
59
60
|
export declare const SearchContext: React.Context<SearchContextProps | null>;
|
|
60
61
|
declare const Search: SearchComponent;
|
|
@@ -47,12 +47,9 @@ const Search = forwardRef((props, ref) => {
|
|
|
47
47
|
useEffect(() => {
|
|
48
48
|
value !== undefined && setControlledValue(value);
|
|
49
49
|
}, [value]);
|
|
50
|
-
return (React.createElement("
|
|
50
|
+
return (React.createElement("div", { ref: setWrapperRef, className: cl(className, "navds-form-field", `navds-form-field--${size}`, "navds-search", {
|
|
51
51
|
"navds-search--disabled": !!inputProps.disabled,
|
|
52
|
-
}),
|
|
53
|
-
e.preventDefault();
|
|
54
|
-
onSearch === null || onSearch === void 0 ? void 0 : onSearch(controlledValue);
|
|
55
|
-
} },
|
|
52
|
+
}) },
|
|
56
53
|
React.createElement(Label, { htmlFor: inputProps.id, size: size, as: "label", className: cl("navds-text-field__label", {
|
|
57
54
|
"navds-sr-only": hideLabel,
|
|
58
55
|
}) }, label),
|
|
@@ -69,6 +66,7 @@ const Search = forwardRef((props, ref) => {
|
|
|
69
66
|
size,
|
|
70
67
|
disabled: inputProps.disabled,
|
|
71
68
|
variant,
|
|
69
|
+
onSearch: () => onSearch === null || onSearch === void 0 ? void 0 : onSearch(controlledValue),
|
|
72
70
|
} }, children ? children : React.createElement(SearchButton, null)))));
|
|
73
71
|
});
|
|
74
72
|
Search.Button = SearchButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../src/form/search/Search.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,EACZ,UAAU,EAEV,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,YAAkC,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../src/form/search/Search.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,EACZ,UAAU,EAEV,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,YAAkC,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAkExC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAC9C,IA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AC5C,IAEA,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,oBAAC,YAAY,OAAG,CAChB,CACrB,CACF,CACP,CAAC;AACJ,CAAC,CAAoB,CAAC;AAEtB,MAAM,CAAC,MAAM,GAAG,YAAY,CAAC;AAE7B,eAAe,MAAM,CAAC"}
|
|
@@ -22,8 +22,11 @@ const SearchButton = forwardRef((_a, ref) => {
|
|
|
22
22
|
console.warn("<Search.Button> has to be wrapped in <Search />");
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
const { size, variant } = context;
|
|
26
|
-
return (React.createElement(Button, Object.assign({ type: "submit" }, rest, { ref: ref, size: size, variant: variant, className: cl("navds-search__button-search", className), disabled: (_b = context === null || context === void 0 ? void 0 : context.disabled) !== null && _b !== void 0 ? _b : disabled, onClick: (e) =>
|
|
25
|
+
const { size, variant, onSearch } = context;
|
|
26
|
+
return (React.createElement(Button, Object.assign({ type: "submit" }, rest, { ref: ref, size: size, variant: variant, className: cl("navds-search__button-search", className), disabled: (_b = context === null || context === void 0 ? void 0 : context.disabled) !== null && _b !== void 0 ? _b : disabled, onClick: (e) => {
|
|
27
|
+
onSearch === null || onSearch === void 0 ? void 0 : onSearch();
|
|
28
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
29
|
+
} }),
|
|
27
30
|
React.createElement(Search, { "aria-hidden": true }),
|
|
28
31
|
children ? children : React.createElement("span", { className: "navds-sr-only" }, "S\u00F8k")));
|
|
29
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchButton.js","sourceRoot":"","sources":["../../../src/form/search/SearchButton.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,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Q,EAAE,GAAG,OAAO,CAAC;IAE5C,OAAO,CACL,oBAAC,MAAM,kBACL,IAAI,EAAC,QAAQ,IACT,IAAI,IACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,EAAE,CAAC,6BAA6B,EAAE,SAAS,CAAC,EACvD,QAAQ,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,mCAAI,QAAQ,EACvC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,EAAI,CAAC;YACb,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,CAAC,CAAC,CAAC;QACf,CAAC;QAED,oBAAC,MAAM,0BAAe;QACrB,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,8BAAM,SAAS,EAAC,eAAe,eAAW,CAC1D,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -11,30 +11,22 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { Helptext as HelpTextIcon } from "@navikt/ds-icons";
|
|
13
13
|
import cl from "classnames";
|
|
14
|
-
import React, { forwardRef,
|
|
14
|
+
import React, { forwardRef, useRef, useState } from "react";
|
|
15
15
|
import mergeRefs from "react-merge-refs";
|
|
16
16
|
import { Popover } from "..";
|
|
17
17
|
const HelpText = forwardRef((_a, ref) => {
|
|
18
|
-
var { className, children, placement = "top", strategy = "absolute", title = "hjelp" } = _a, rest = __rest(_a, ["className", "children", "placement", "strategy", "title"]);
|
|
18
|
+
var { className, children, placement = "top", strategy = "absolute", title = "hjelp", onClick } = _a, rest = __rest(_a, ["className", "children", "placement", "strategy", "title", "onClick"]);
|
|
19
19
|
const buttonRef = useRef(null);
|
|
20
20
|
const mergedRef = mergeRefs([buttonRef, ref]);
|
|
21
|
-
const [popoverRef, setPopoverRef] = useState(null);
|
|
22
|
-
const wrapperRef = useRef(null);
|
|
23
21
|
const [open, setOpen] = useState(false);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return (React.createElement("div", { className: "navds-help-text", ref: wrapperRef },
|
|
33
|
-
React.createElement("button", Object.assign({}, rest, { ref: mergedRef, onClick: (e) => handleClick(e), className: cl(className, "navds-help-text__button"), type: "button", "aria-expanded": open, "aria-haspopup": "dialog", title: title }),
|
|
34
|
-
React.createElement(HelpTextIcon, { className: "navds-help-text__icon" }),
|
|
35
|
-
React.createElement("span", { className: "navds-sr-only" }, title)),
|
|
36
|
-
React.createElement(Popover, { ref: setPopoverRef, onClose: () => setOpen(false), className: "navds-help-text__popover", open: open, role: "tooltip", anchorEl: buttonRef.current, placement: placement, strategy: strategy },
|
|
37
|
-
React.createElement(Popover.Content, null, children))));
|
|
22
|
+
return (React.createElement("div", { className: "navds-help-text" },
|
|
23
|
+
React.createElement("button", Object.assign({}, rest, { ref: mergedRef, onClick: (e) => {
|
|
24
|
+
setOpen((x) => !x);
|
|
25
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
26
|
+
}, className: cl(className, "navds-help-text__button"), type: "button", "aria-expanded": open, title: title }),
|
|
27
|
+
React.createElement(HelpTextIcon, { className: "navds-help-text__icon", "aria-hidden": true })),
|
|
28
|
+
React.createElement(Popover, { onClose: () => setOpen(false), className: "navds-help-text__popover", open: open, anchorEl: buttonRef.current, placement: placement, strategy: strategy },
|
|
29
|
+
React.createElement(Popover.Content, { className: "navds-body-short" }, children))));
|
|
38
30
|
});
|
|
39
31
|
export default HelpText;
|
|
40
32
|
//# sourceMappingURL=HelpText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelpText.js","sourceRoot":"","sources":["../../src/help-text/HelpText.tsx"],"names":[],"mappings":";;;;;;;;;;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S,EAAE,EAAE,CAAC,SAAS,EAAE,yBAAyB,CAAC,EACnD,IAAI,EAAC,QAAQ,mBACE,IAAI,EACnB,KAAK,EAAE,KAAK;YAEZ,oBAAC,YAAY,IAAC,SAAS,EAAC,uBAAuB,wBAAc,CACtD;QACT,oBAAC,OAAO,IACN,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAC7B,SAAS,EAAC,0BAA0B,EACpC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,SAAS,CAAC,OAAO,EAC3B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ;YAElB,oBAAC,OAAO,CAAC,OAAO,IAAC,SAAS,EAAC,kBAAkB,IAC1C,QAAQ,CACO,CACV,CACN,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/ds-react",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "NAV designsystem react components",
|
|
6
6
|
"author": "NAV Designsystem team",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@material-ui/core": "^4.12.3",
|
|
38
|
-
"@navikt/ds-icons": "^0.8.4
|
|
38
|
+
"@navikt/ds-icons": "^0.8.4",
|
|
39
39
|
"@popperjs/core": "^2.10.1",
|
|
40
40
|
"@radix-ui/react-toggle-group": "0.1.5",
|
|
41
41
|
"classnames": "^2.2.6",
|
|
@@ -65,5 +65,6 @@
|
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@types/react": "^17.0.30",
|
|
67
67
|
"react": "^17.0.0"
|
|
68
|
-
}
|
|
68
|
+
},
|
|
69
|
+
"gitHead": "ddc0db1905160264958fcff8d59420b74740a5ac"
|
|
69
70
|
}
|
|
@@ -75,6 +75,7 @@ export interface SearchContextProps {
|
|
|
75
75
|
disabled?: boolean;
|
|
76
76
|
size: "medium" | "small";
|
|
77
77
|
variant?: "tertiary" | "primary";
|
|
78
|
+
onSearch?: () => void;
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
export const SearchContext = React.createContext<SearchContextProps | null>(
|
|
@@ -104,7 +105,7 @@ const Search = forwardRef<HTMLInputElement, SearchProps>((props, ref) => {
|
|
|
104
105
|
|
|
105
106
|
const searchRef = useRef<HTMLInputElement | null>(null);
|
|
106
107
|
const mergedRef = mergeRefs([searchRef, ref]);
|
|
107
|
-
const [wrapperRef, setWrapperRef] = useState<
|
|
108
|
+
const [wrapperRef, setWrapperRef] = useState<HTMLDivElement | null>(null);
|
|
108
109
|
|
|
109
110
|
const [controlledValue, setControlledValue] = useState(value ?? "");
|
|
110
111
|
|
|
@@ -147,8 +148,7 @@ const Search = forwardRef<HTMLInputElement, SearchProps>((props, ref) => {
|
|
|
147
148
|
}, [value]);
|
|
148
149
|
|
|
149
150
|
return (
|
|
150
|
-
<
|
|
151
|
-
role="search"
|
|
151
|
+
<div
|
|
152
152
|
ref={setWrapperRef}
|
|
153
153
|
className={cl(
|
|
154
154
|
className,
|
|
@@ -159,10 +159,6 @@ const Search = forwardRef<HTMLInputElement, SearchProps>((props, ref) => {
|
|
|
159
159
|
"navds-search--disabled": !!inputProps.disabled,
|
|
160
160
|
}
|
|
161
161
|
)}
|
|
162
|
-
onSubmit={(e) => {
|
|
163
|
-
e.preventDefault();
|
|
164
|
-
onSearch?.(controlledValue);
|
|
165
|
-
}}
|
|
166
162
|
>
|
|
167
163
|
<Label
|
|
168
164
|
htmlFor={inputProps.id}
|
|
@@ -222,12 +218,13 @@ const Search = forwardRef<HTMLInputElement, SearchProps>((props, ref) => {
|
|
|
222
218
|
size,
|
|
223
219
|
disabled: inputProps.disabled,
|
|
224
220
|
variant,
|
|
221
|
+
onSearch: () => onSearch?.(controlledValue),
|
|
225
222
|
}}
|
|
226
223
|
>
|
|
227
224
|
{children ? children : <SearchButton />}
|
|
228
225
|
</SearchContext.Provider>
|
|
229
226
|
</div>
|
|
230
|
-
</
|
|
227
|
+
</div>
|
|
231
228
|
);
|
|
232
229
|
}) as SearchComponent;
|
|
233
230
|
|
|
@@ -25,7 +25,7 @@ const SearchButton: SearchButtonType = forwardRef(
|
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const { size, variant } = context;
|
|
28
|
+
const { size, variant, onSearch } = context;
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
31
|
<Button
|
|
@@ -36,7 +36,10 @@ const SearchButton: SearchButtonType = forwardRef(
|
|
|
36
36
|
variant={variant}
|
|
37
37
|
className={cl("navds-search__button-search", className)}
|
|
38
38
|
disabled={context?.disabled ?? disabled}
|
|
39
|
-
onClick={(e) =>
|
|
39
|
+
onClick={(e) => {
|
|
40
|
+
onSearch?.();
|
|
41
|
+
onClick?.(e);
|
|
42
|
+
}}
|
|
40
43
|
>
|
|
41
44
|
<Search aria-hidden />
|
|
42
45
|
{children ? children : <span className="navds-sr-only">Søk</span>}
|
|
@@ -10,20 +10,23 @@ export default {
|
|
|
10
10
|
export const All = () => {
|
|
11
11
|
const [value, setValue] = useState("");
|
|
12
12
|
return (
|
|
13
|
-
<div
|
|
13
|
+
<div
|
|
14
|
+
style={{
|
|
15
|
+
display: "flex",
|
|
16
|
+
alignItems: "center",
|
|
17
|
+
flexDirection: "column",
|
|
18
|
+
maxWidth: 400,
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
14
21
|
<h1>Search</h1>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
onSearch={console.log}
|
|
24
|
-
variant="primary"
|
|
25
|
-
></Search>
|
|
26
|
-
</div>
|
|
22
|
+
|
|
23
|
+
<Search label="Søk alle sider om X og Y" onSearch={console.log}></Search>
|
|
24
|
+
<h2>Primary search</h2>
|
|
25
|
+
<Search
|
|
26
|
+
label="Søk alle sider om X og Y"
|
|
27
|
+
onSearch={console.log}
|
|
28
|
+
variant="primary"
|
|
29
|
+
></Search>
|
|
27
30
|
|
|
28
31
|
<h2>Search small</h2>
|
|
29
32
|
<Search
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Helptext as HelpTextIcon } from "@navikt/ds-icons";
|
|
2
2
|
import cl from "classnames";
|
|
3
|
-
import React, { forwardRef,
|
|
3
|
+
import React, { forwardRef, useRef, useState } from "react";
|
|
4
4
|
import mergeRefs from "react-merge-refs";
|
|
5
5
|
import { Popover, PopoverProps } from "..";
|
|
6
6
|
|
|
@@ -21,53 +21,42 @@ const HelpText = forwardRef<HTMLButtonElement, HelpTextProps>(
|
|
|
21
21
|
placement = "top",
|
|
22
22
|
strategy = "absolute",
|
|
23
23
|
title = "hjelp",
|
|
24
|
+
onClick,
|
|
24
25
|
...rest
|
|
25
26
|
},
|
|
26
27
|
ref
|
|
27
28
|
) => {
|
|
28
29
|
const buttonRef = useRef<HTMLButtonElement | null>(null);
|
|
29
30
|
const mergedRef = mergeRefs([buttonRef, ref]);
|
|
30
|
-
const [popoverRef, setPopoverRef] = useState<HTMLDivElement | null>(null);
|
|
31
|
-
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
|
32
|
-
|
|
33
31
|
const [open, setOpen] = useState(false);
|
|
34
32
|
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
open && popoverRef?.focus?.();
|
|
37
|
-
}, [open, popoverRef]);
|
|
38
|
-
|
|
39
|
-
const handleClick = (
|
|
40
|
-
e: React.MouseEvent<HTMLButtonElement, MouseEvent>
|
|
41
|
-
) => {
|
|
42
|
-
setOpen((x) => !x);
|
|
43
|
-
rest.onClick && rest.onClick(e);
|
|
44
|
-
};
|
|
45
33
|
return (
|
|
46
|
-
<div className="navds-help-text"
|
|
34
|
+
<div className="navds-help-text">
|
|
47
35
|
<button
|
|
48
36
|
{...rest}
|
|
49
37
|
ref={mergedRef}
|
|
50
|
-
onClick={(e) =>
|
|
38
|
+
onClick={(e) => {
|
|
39
|
+
setOpen((x) => !x);
|
|
40
|
+
onClick?.(e);
|
|
41
|
+
}}
|
|
51
42
|
className={cl(className, "navds-help-text__button")}
|
|
52
43
|
type="button"
|
|
53
44
|
aria-expanded={open}
|
|
54
|
-
aria-haspopup="dialog"
|
|
55
45
|
title={title}
|
|
56
46
|
>
|
|
57
|
-
<HelpTextIcon className="navds-help-text__icon" />
|
|
58
|
-
<span className="navds-sr-only">{title}</span>
|
|
47
|
+
<HelpTextIcon className="navds-help-text__icon" aria-hidden/>
|
|
59
48
|
</button>
|
|
60
49
|
<Popover
|
|
61
|
-
ref={setPopoverRef}
|
|
62
50
|
onClose={() => setOpen(false)}
|
|
63
51
|
className="navds-help-text__popover"
|
|
64
52
|
open={open}
|
|
65
|
-
role="tooltip"
|
|
66
53
|
anchorEl={buttonRef.current}
|
|
67
54
|
placement={placement}
|
|
68
55
|
strategy={strategy}
|
|
69
56
|
>
|
|
70
|
-
<Popover.Content>
|
|
57
|
+
<Popover.Content className="navds-body-short">
|
|
58
|
+
{children}
|
|
59
|
+
</Popover.Content>
|
|
71
60
|
</Popover>
|
|
72
61
|
</div>
|
|
73
62
|
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TextField, HelpText } from "..";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "ds-react/help-text",
|
|
6
|
+
component: HelpText,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const All = () => {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<h1>HelpText</h1>
|
|
13
|
+
<HelpText title="show tooltip">
|
|
14
|
+
Id ullamco excepteur elit fugiat labore.
|
|
15
|
+
</HelpText>
|
|
16
|
+
<TextField
|
|
17
|
+
label={
|
|
18
|
+
<div style={{ display: "flex", gap: 8 }}>
|
|
19
|
+
Text field label
|
|
20
|
+
<HelpText title="show tooltip">
|
|
21
|
+
Id ullamco excepteur elit fugiat labore.
|
|
22
|
+
</HelpText>
|
|
23
|
+
</div>
|
|
24
|
+
}
|
|
25
|
+
></TextField>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Meta, Canvas } from "@storybook/addon-docs";
|
|
2
|
-
import { HelpText } from "../../index";
|
|
3
|
-
import { Success } from "@navikt/ds-react";
|
|
4
|
-
|
|
5
|
-
<Meta title="ds-react/help-text/intro" />
|
|
6
|
-
|
|
7
|
-
# Hvordan ta i bruk HelpText
|
|
8
|
-
|
|
9
|
-
```jsx
|
|
10
|
-
<HelpText>Exercitation esse minim esse mollit ex magna.</HelpText>
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
<Canvas>
|
|
14
|
-
<div style={{ padding: "5rem" }}>
|
|
15
|
-
<HelpText>Exercitation esse minim esse mollit ex magna.</HelpText>
|
|
16
|
-
</div>
|
|
17
|
-
</Canvas>
|
|
18
|
-
|
|
19
|
-
# Egen title
|
|
20
|
-
|
|
21
|
-
Husk å endre på "title" slik at skjermlesere får tydeligere informasjon
|
|
22
|
-
|
|
23
|
-
```jsx
|
|
24
|
-
<HelpText title="vis hjelpetekst angående søknad">
|
|
25
|
-
Exercitation esse minim esse mollit ex magna.
|
|
26
|
-
</HelpText>
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
<Canvas>
|
|
30
|
-
<div style={{ padding: "5rem" }}>
|
|
31
|
-
<HelpText title="vis hjelpetekst angående søknad">
|
|
32
|
-
Exercitation esse minim esse mollit ex magna.
|
|
33
|
-
</HelpText>
|
|
34
|
-
</div>
|
|
35
|
-
</Canvas>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { BodyLong } from "../../typography";
|
|
3
|
-
import { HelpText } from "../index";
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: "ds-react/help-text",
|
|
7
|
-
component: HelpText,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const All = () => {
|
|
11
|
-
return (
|
|
12
|
-
<>
|
|
13
|
-
<h1>HelpText</h1>
|
|
14
|
-
<BodyLong style={{ display: "flex" }}>
|
|
15
|
-
Quis tempor incididunt sint sit veniam ad dolore cillum ut.
|
|
16
|
-
<HelpText title="show tooltip">
|
|
17
|
-
Id ullamco excepteur elit fugiat labore.
|
|
18
|
-
</HelpText>
|
|
19
|
-
</BodyLong>
|
|
20
|
-
|
|
21
|
-
<BodyLong>
|
|
22
|
-
Incididunt pariatur laborum dolor sint qui eiusmod exercitation non
|
|
23
|
-
cupidatat amet.
|
|
24
|
-
</BodyLong>
|
|
25
|
-
|
|
26
|
-
<h2>HelpText defaultOpen</h2>
|
|
27
|
-
<HelpText title="show tooltip">
|
|
28
|
-
Id ullamco excepteur elit fugiat labore.
|
|
29
|
-
</HelpText>
|
|
30
|
-
</>
|
|
31
|
-
);
|
|
32
|
-
};
|