@navikt/ds-react 0.19.14 → 0.19.17
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/_docs.json +88 -10
- package/cjs/form/Select.js +2 -2
- package/cjs/form/search/Search.js +6 -4
- package/cjs/stepper/Step.js +8 -8
- package/cjs/stepper/Stepper.js +10 -5
- package/cjs/tooltip/Tooltip.js +1 -4
- package/esm/accordion/AccordionItem.js.map +1 -1
- package/esm/button/Button.js.map +1 -1
- package/esm/form/Select.d.ts +4 -0
- package/esm/form/Select.js +2 -2
- package/esm/form/Select.js.map +1 -1
- package/esm/form/radio/RadioGroup.js.map +1 -1
- package/esm/form/search/Search.d.ts +1 -1
- package/esm/form/search/Search.js +7 -5
- package/esm/form/search/Search.js.map +1 -1
- package/esm/link/Link.js.map +1 -1
- package/esm/stepper/Step.d.ts +2 -2
- package/esm/stepper/Step.js +8 -8
- package/esm/stepper/Step.js.map +1 -1
- package/esm/stepper/Stepper.d.ts +8 -4
- package/esm/stepper/Stepper.js +10 -5
- package/esm/stepper/Stepper.js.map +1 -1
- package/esm/tooltip/Tooltip.js +1 -4
- package/esm/tooltip/Tooltip.js.map +1 -1
- package/esm/typography/Heading.js.map +1 -1
- package/esm/typography/Ingress.js.map +1 -1
- package/esm/typography/Label.js.map +1 -1
- package/package.json +2 -2
- package/src/accordion/AccordionItem.tsx +2 -3
- package/src/button/Button.tsx +62 -62
- package/src/form/Select.tsx +6 -1
- package/src/form/radio/RadioGroup.tsx +2 -3
- package/src/form/search/Search.tsx +19 -6
- package/src/form/search/search.stories.tsx +21 -0
- package/src/link/Link.tsx +4 -6
- package/src/stepper/Step.tsx +16 -13
- package/src/stepper/Stepper.tsx +34 -8
- package/src/stepper/stepper.stories.tsx +133 -0
- package/src/tooltip/Tooltip.tsx +4 -4
- package/src/typography/Heading.tsx +15 -17
- package/src/typography/Ingress.tsx +10 -12
- package/src/typography/Label.tsx +16 -18
- package/cjs/form/search/useSearch.js +0 -31
- package/esm/form/search/useSearch.d.ts +0 -10
- package/esm/form/search/useSearch.js +0 -25
- package/esm/form/search/useSearch.js.map +0 -1
- package/src/form/search/useSearch.ts +0 -31
- package/src/stepper/stories/Example.tsx +0 -28
- package/src/stepper/stories/stepper.stories.mdx +0 -61
- package/src/stepper/stories/stepper.stories.tsx +0 -54
package/_docs.json
CHANGED
|
@@ -960,6 +960,25 @@
|
|
|
960
960
|
"name": "boolean"
|
|
961
961
|
}
|
|
962
962
|
},
|
|
963
|
+
"style": {
|
|
964
|
+
"defaultValue": null,
|
|
965
|
+
"description": "Sets inline-style on select wrapper",
|
|
966
|
+
"name": "style",
|
|
967
|
+
"parent": {
|
|
968
|
+
"fileName": "src/form/Select.tsx",
|
|
969
|
+
"name": "SelectProps"
|
|
970
|
+
},
|
|
971
|
+
"declarations": [
|
|
972
|
+
{
|
|
973
|
+
"fileName": "src/form/Select.tsx",
|
|
974
|
+
"name": "SelectProps"
|
|
975
|
+
}
|
|
976
|
+
],
|
|
977
|
+
"required": false,
|
|
978
|
+
"type": {
|
|
979
|
+
"name": "CSSProperties"
|
|
980
|
+
}
|
|
981
|
+
},
|
|
963
982
|
"error": {
|
|
964
983
|
"defaultValue": null,
|
|
965
984
|
"description": "Error message for element",
|
|
@@ -4884,12 +4903,12 @@
|
|
|
4884
4903
|
"name": "string"
|
|
4885
4904
|
}
|
|
4886
4905
|
},
|
|
4887
|
-
"
|
|
4906
|
+
"unsafe_index": {
|
|
4888
4907
|
"defaultValue": {
|
|
4889
4908
|
"value": "0"
|
|
4890
4909
|
},
|
|
4891
|
-
"description": "Handled by Stepper\n@private",
|
|
4892
|
-
"name": "
|
|
4910
|
+
"description": "Handled by Stepper, overwriting may break component logic\n@private",
|
|
4911
|
+
"name": "unsafe_index",
|
|
4893
4912
|
"parent": {
|
|
4894
4913
|
"fileName": "src/stepper/Step.tsx",
|
|
4895
4914
|
"name": "StepperStepProps"
|
|
@@ -4968,10 +4987,12 @@
|
|
|
4968
4987
|
"name": "ReactNode"
|
|
4969
4988
|
}
|
|
4970
4989
|
},
|
|
4971
|
-
"
|
|
4972
|
-
"defaultValue":
|
|
4973
|
-
|
|
4974
|
-
|
|
4990
|
+
"orientation": {
|
|
4991
|
+
"defaultValue": {
|
|
4992
|
+
"value": "\"vertical\""
|
|
4993
|
+
},
|
|
4994
|
+
"description": "The direction the component grows.",
|
|
4995
|
+
"name": "orientation",
|
|
4975
4996
|
"parent": {
|
|
4976
4997
|
"fileName": "src/stepper/Stepper.tsx",
|
|
4977
4998
|
"name": "StepperProps"
|
|
@@ -4984,12 +5005,12 @@
|
|
|
4984
5005
|
],
|
|
4985
5006
|
"required": false,
|
|
4986
5007
|
"type": {
|
|
4987
|
-
"name": "
|
|
5008
|
+
"name": "\"horizontal\" | \"vertical\""
|
|
4988
5009
|
}
|
|
4989
5010
|
},
|
|
4990
5011
|
"activeStep": {
|
|
4991
5012
|
"defaultValue": null,
|
|
4992
|
-
"description": "Current active step index",
|
|
5013
|
+
"description": "Current active step.\n@note Stepper index starts at 1, not 0",
|
|
4993
5014
|
"name": "activeStep",
|
|
4994
5015
|
"parent": {
|
|
4995
5016
|
"fileName": "src/stepper/Stepper.tsx",
|
|
@@ -5008,7 +5029,7 @@
|
|
|
5008
5029
|
},
|
|
5009
5030
|
"onStepChange": {
|
|
5010
5031
|
"defaultValue": null,
|
|
5011
|
-
"description": "Callback for
|
|
5032
|
+
"description": "Callback for next activeStep\n@note Stepper index starts at 1, not 0",
|
|
5012
5033
|
"name": "onStepChange",
|
|
5013
5034
|
"parent": {
|
|
5014
5035
|
"fileName": "src/stepper/Stepper.tsx",
|
|
@@ -5025,6 +5046,25 @@
|
|
|
5025
5046
|
"name": "((step: number) => void)"
|
|
5026
5047
|
}
|
|
5027
5048
|
},
|
|
5049
|
+
"className": {
|
|
5050
|
+
"defaultValue": null,
|
|
5051
|
+
"description": "",
|
|
5052
|
+
"name": "className",
|
|
5053
|
+
"parent": {
|
|
5054
|
+
"fileName": "Designsystemet/node_modules/@types/react/index.d.ts",
|
|
5055
|
+
"name": "HTMLAttributes"
|
|
5056
|
+
},
|
|
5057
|
+
"declarations": [
|
|
5058
|
+
{
|
|
5059
|
+
"fileName": "Designsystemet/node_modules/@types/react/index.d.ts",
|
|
5060
|
+
"name": "HTMLAttributes"
|
|
5061
|
+
}
|
|
5062
|
+
],
|
|
5063
|
+
"required": false,
|
|
5064
|
+
"type": {
|
|
5065
|
+
"name": "string"
|
|
5066
|
+
}
|
|
5067
|
+
},
|
|
5028
5068
|
"ref": {
|
|
5029
5069
|
"defaultValue": null,
|
|
5030
5070
|
"description": "",
|
|
@@ -8979,6 +9019,44 @@
|
|
|
8979
9019
|
"name": "\"primary\" | \"secondary\" | \"simple\""
|
|
8980
9020
|
}
|
|
8981
9021
|
},
|
|
9022
|
+
"error": {
|
|
9023
|
+
"defaultValue": null,
|
|
9024
|
+
"description": "Error message for element",
|
|
9025
|
+
"name": "error",
|
|
9026
|
+
"parent": {
|
|
9027
|
+
"fileName": "react/src/form/useFormField.ts",
|
|
9028
|
+
"name": "FormFieldProps"
|
|
9029
|
+
},
|
|
9030
|
+
"declarations": [
|
|
9031
|
+
{
|
|
9032
|
+
"fileName": "react/src/form/useFormField.ts",
|
|
9033
|
+
"name": "FormFieldProps"
|
|
9034
|
+
}
|
|
9035
|
+
],
|
|
9036
|
+
"required": false,
|
|
9037
|
+
"type": {
|
|
9038
|
+
"name": "ReactNode"
|
|
9039
|
+
}
|
|
9040
|
+
},
|
|
9041
|
+
"errorId": {
|
|
9042
|
+
"defaultValue": null,
|
|
9043
|
+
"description": "Override internal errorId",
|
|
9044
|
+
"name": "errorId",
|
|
9045
|
+
"parent": {
|
|
9046
|
+
"fileName": "react/src/form/useFormField.ts",
|
|
9047
|
+
"name": "FormFieldProps"
|
|
9048
|
+
},
|
|
9049
|
+
"declarations": [
|
|
9050
|
+
{
|
|
9051
|
+
"fileName": "react/src/form/useFormField.ts",
|
|
9052
|
+
"name": "FormFieldProps"
|
|
9053
|
+
}
|
|
9054
|
+
],
|
|
9055
|
+
"required": false,
|
|
9056
|
+
"type": {
|
|
9057
|
+
"name": "string"
|
|
9058
|
+
}
|
|
9059
|
+
},
|
|
8982
9060
|
"size": {
|
|
8983
9061
|
"defaultValue": null,
|
|
8984
9062
|
"description": "Changes font-size, padding and gaps",
|
package/cjs/form/Select.js
CHANGED
|
@@ -45,7 +45,7 @@ const __1 = require("..");
|
|
|
45
45
|
const useFormField_1 = require("./useFormField");
|
|
46
46
|
exports.Select = (0, react_1.forwardRef)((props, ref) => {
|
|
47
47
|
const { inputProps, errorId, showErrorMsg, hasError, size, inputDescriptionId, } = (0, useFormField_1.useFormField)(props, "textField");
|
|
48
|
-
const { children, label, className, description, htmlSize, hideLabel = false } = props, rest = __rest(props, ["children", "label", "className", "description", "htmlSize", "hideLabel"]);
|
|
48
|
+
const { children, label, className, description, htmlSize, hideLabel = false, style } = props, rest = __rest(props, ["children", "label", "className", "description", "htmlSize", "hideLabel", "style"]);
|
|
49
49
|
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(className, "navds-form-field", `navds-form-field--${size}`, {
|
|
50
50
|
"navds-form-field--disabled": !!inputProps.disabled,
|
|
51
51
|
"navds-select--error": hasError,
|
|
@@ -58,7 +58,7 @@ exports.Select = (0, react_1.forwardRef)((props, ref) => {
|
|
|
58
58
|
}), id: inputDescriptionId, size: "small", as: "div" }, description)) : (react_1.default.createElement(__1.Detail, { className: (0, classnames_1.default)("navds-form-field__description", {
|
|
59
59
|
"navds-sr-only": hideLabel,
|
|
60
60
|
}), id: inputDescriptionId, size: "small", as: "div" }, description)))),
|
|
61
|
-
react_1.default.createElement("div", { className: "navds-select__container" },
|
|
61
|
+
react_1.default.createElement("div", { className: "navds-select__container", style: style },
|
|
62
62
|
react_1.default.createElement("select", Object.assign({}, (0, __1.omit)(rest, ["error", "errorId", "size"]), inputProps, { ref: ref, className: (0, classnames_1.default)("navds-select__input", "navds-body-short", `navds-body--${size !== null && size !== void 0 ? size : "medium"}`), size: props.htmlSize }), children),
|
|
63
63
|
react_1.default.createElement(ds_icons_1.Expand, { className: "navds-select__chevron", "aria-hidden": true })),
|
|
64
64
|
react_1.default.createElement("div", { className: "navds-form-field__error", id: errorId, "aria-relevant": "additions removals", "aria-live": "polite" }, showErrorMsg && (react_1.default.createElement(__1.ErrorMessage, { size: size }, props.error)))));
|
|
@@ -43,11 +43,11 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
43
43
|
const react_1 = __importStar(require("react"));
|
|
44
44
|
const react_merge_refs_1 = __importDefault(require("react-merge-refs"));
|
|
45
45
|
const __1 = require("../..");
|
|
46
|
+
const useFormField_1 = require("../useFormField");
|
|
46
47
|
const SearchButton_1 = __importDefault(require("./SearchButton"));
|
|
47
|
-
const useSearch_1 = require("./useSearch");
|
|
48
48
|
exports.SearchContext = react_1.default.createContext(null);
|
|
49
49
|
exports.Search = (0, react_1.forwardRef)((props, ref) => {
|
|
50
|
-
const { inputProps, size = "medium", inputDescriptionId, } = (0,
|
|
50
|
+
const { inputProps, size = "medium", inputDescriptionId, errorId, showErrorMsg, hasError, } = (0, useFormField_1.useFormField)(props, "searchfield");
|
|
51
51
|
const { className, hideLabel = true, label, description, value, clearButtonLabel, onClear, clearButton = true, children, variant = "primary", defaultValue, onChange } = props, rest = __rest(props, ["className", "hideLabel", "label", "description", "value", "clearButtonLabel", "onClear", "clearButton", "children", "variant", "defaultValue", "onChange"]);
|
|
52
52
|
const searchRef = (0, react_1.useRef)(null);
|
|
53
53
|
const mergedRef = (0, react_merge_refs_1.default)([searchRef, ref]);
|
|
@@ -70,6 +70,7 @@ exports.Search = (0, react_1.forwardRef)((props, ref) => {
|
|
|
70
70
|
}
|
|
71
71
|
}, [handleClear]), wrapperRef);
|
|
72
72
|
return (react_1.default.createElement("div", { ref: setWrapperRef, className: (0, classnames_1.default)(className, "navds-form-field", `navds-form-field--${size}`, "navds-search", {
|
|
73
|
+
"navds-search--error": hasError,
|
|
73
74
|
"navds-search--disabled": !!inputProps.disabled,
|
|
74
75
|
}) },
|
|
75
76
|
react_1.default.createElement(__1.Label, { htmlFor: inputProps.id, size: size, as: "label", className: (0, classnames_1.default)("navds-form-field__label", {
|
|
@@ -81,7 +82,7 @@ exports.Search = (0, react_1.forwardRef)((props, ref) => {
|
|
|
81
82
|
react_1.default.createElement("div", { className: "navds-search__wrapper" },
|
|
82
83
|
react_1.default.createElement("div", { className: "navds-search__wrapper-inner" },
|
|
83
84
|
variant === "simple" && (react_1.default.createElement(ds_icons_1.Search, { "aria-hidden": true, className: "navds-search__search-icon" })),
|
|
84
|
-
react_1.default.createElement("input", Object.assign({ ref: mergedRef }, (0, __1.omit)(rest, ["size"]), inputProps, { value: value !== null && value !== void 0 ? value : internalValue, onChange: (e) => handleChange(e.target.value), type: "search", role: "searchbox", className: (0, classnames_1.default)(className, "navds-search__input", `navds-search__input--${variant}`, "navds-text-field__input", "navds-body-short", `navds-body-${size}`) })),
|
|
85
|
+
react_1.default.createElement("input", Object.assign({ ref: mergedRef }, (0, __1.omit)(rest, ["error", "errorId", "size"]), inputProps, { value: value !== null && value !== void 0 ? value : internalValue, onChange: (e) => handleChange(e.target.value), type: "search", role: "searchbox", className: (0, classnames_1.default)(className, "navds-search__input", `navds-search__input--${variant}`, "navds-text-field__input", "navds-body-short", `navds-body-${size}`) })),
|
|
85
86
|
(value !== null && value !== void 0 ? value : internalValue) && clearButton && (react_1.default.createElement("button", { type: "button", onClick: (e) => handleClear({ trigger: "Click", event: e }), className: "navds-search__button-clear" },
|
|
86
87
|
react_1.default.createElement("span", { className: "navds-sr-only" }, clearButtonLabel ? clearButtonLabel : "Tøm"),
|
|
87
88
|
react_1.default.createElement(ds_icons_1.Close, { "aria-hidden": true })))),
|
|
@@ -89,7 +90,8 @@ exports.Search = (0, react_1.forwardRef)((props, ref) => {
|
|
|
89
90
|
size,
|
|
90
91
|
disabled: inputProps.disabled,
|
|
91
92
|
variant,
|
|
92
|
-
} }, children ? children : variant !== "simple" && react_1.default.createElement(SearchButton_1.default, null)))
|
|
93
|
+
} }, children ? children : variant !== "simple" && react_1.default.createElement(SearchButton_1.default, null))),
|
|
94
|
+
react_1.default.createElement("div", { className: "navds-form-field__error", id: errorId, "aria-relevant": "additions removals", "aria-live": "polite" }, showErrorMsg && (react_1.default.createElement(__1.ErrorMessage, { size: size }, props.error)))));
|
|
93
95
|
});
|
|
94
96
|
exports.Search.Button = SearchButton_1.default;
|
|
95
97
|
exports.default = exports.Search;
|
package/cjs/stepper/Step.js
CHANGED
|
@@ -43,22 +43,22 @@ const react_1 = __importStar(require("react"));
|
|
|
43
43
|
const Stepper_1 = require("./Stepper");
|
|
44
44
|
const __1 = require("..");
|
|
45
45
|
exports.StepComponent = (0, react_1.forwardRef)((_a, ref) => {
|
|
46
|
-
var { className, children, as: Component = "a",
|
|
46
|
+
var { className, children, as: Component = "a", unsafe_index = 0 } = _a, rest = __rest(_a, ["className", "children", "as", "unsafe_index"]);
|
|
47
47
|
const context = (0, react_1.useContext)(Stepper_1.StepperContext);
|
|
48
48
|
if (context === null) {
|
|
49
|
-
console.error("<
|
|
49
|
+
console.error("<Stepper.Step> has to be used within <Stepper>");
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
|
-
const activeStep = context
|
|
53
|
-
return (react_1.default.createElement(Component, Object.assign({}, rest, { "aria-current":
|
|
54
|
-
"navds-stepper__step--active": activeStep,
|
|
52
|
+
const { activeStep } = context;
|
|
53
|
+
return (react_1.default.createElement(Component, Object.assign({}, rest, { "aria-current": activeStep === unsafe_index, ref: ref, className: (0, classnames_1.default)("navds-stepper__step", className, {
|
|
54
|
+
"navds-stepper__step--active": activeStep === unsafe_index,
|
|
55
55
|
}), onClick: (e) => {
|
|
56
56
|
var _a;
|
|
57
|
-
context.onStepChange(
|
|
57
|
+
context.onStepChange(unsafe_index + 1);
|
|
58
58
|
(_a = rest === null || rest === void 0 ? void 0 : rest.onClick) === null || _a === void 0 ? void 0 : _a.call(rest, e);
|
|
59
59
|
} }),
|
|
60
|
-
react_1.default.createElement(__1.Label, { className: "navds-
|
|
61
|
-
react_1.default.createElement(__1.Label, { className: "navds-
|
|
60
|
+
react_1.default.createElement(__1.Label, { className: "navds-stepper__circle", as: "span", "aria-hidden": "true" }, unsafe_index + 1),
|
|
61
|
+
react_1.default.createElement(__1.Label, { as: "span", className: "navds-stepper__content" }, children)));
|
|
62
62
|
});
|
|
63
63
|
const Step = exports.StepComponent;
|
|
64
64
|
exports.default = Step;
|
package/cjs/stepper/Stepper.js
CHANGED
|
@@ -43,17 +43,22 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
43
43
|
const Step_1 = __importDefault(require("./Step"));
|
|
44
44
|
exports.StepperContext = (0, react_1.createContext)(null);
|
|
45
45
|
exports.Stepper = (0, react_1.forwardRef)((_a, ref) => {
|
|
46
|
-
var { children, className, activeStep, onStepChange = () => { } } = _a, rest = __rest(_a, ["children", "className", "activeStep", "onStepChange"]);
|
|
47
|
-
|
|
46
|
+
var { children, className, activeStep, orientation = "vertical", onStepChange = () => { } } = _a, rest = __rest(_a, ["children", "className", "activeStep", "orientation", "onStepChange"]);
|
|
47
|
+
activeStep = activeStep - 1;
|
|
48
|
+
return (react_1.default.createElement("ol", Object.assign({}, rest, { ref: ref, className: (0, classnames_1.default)("navds-stepper", orientation === "horizontal" ? "navds-stepper--horizontal" : "", className) }),
|
|
48
49
|
react_1.default.createElement(exports.StepperContext.Provider, { value: {
|
|
49
50
|
activeStep,
|
|
50
51
|
onStepChange,
|
|
51
52
|
lastIndex: react_1.default.Children.count(children),
|
|
53
|
+
orientation,
|
|
52
54
|
} }, react_1.default.Children.map(children, (step, index) => {
|
|
53
55
|
var _a, _b;
|
|
54
|
-
return (react_1.default.createElement("li", { className: (0, classnames_1.default)("navds-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
return (react_1.default.createElement("li", { className: (0, classnames_1.default)("navds-stepper__item"), key: index + ((_b = (_a = children === null || children === void 0 ? void 0 : children.toString) === null || _a === void 0 ? void 0 : _a.call(children)) !== null && _b !== void 0 ? _b : "") },
|
|
57
|
+
react_1.default.createElement("span", { className: "navds-stepper__line navds-stepper__line--1" }),
|
|
58
|
+
react_1.default.isValidElement(step)
|
|
59
|
+
? react_1.default.cloneElement(step, Object.assign(Object.assign({}, step.props), { unsafe_index: index }))
|
|
60
|
+
: step,
|
|
61
|
+
react_1.default.createElement("span", { className: "navds-stepper__line navds-stepper__line--2" })));
|
|
57
62
|
}))));
|
|
58
63
|
});
|
|
59
64
|
exports.Stepper.Step = Step_1.default;
|
package/cjs/tooltip/Tooltip.js
CHANGED
|
@@ -98,10 +98,7 @@ exports.Tooltip = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
98
98
|
}, [handleMouseUp]);
|
|
99
99
|
(0, __1.useEventListener)("keydown", (0, react_1.useCallback)((e) => e.key === "Escape" && handleClose(), [handleClose]));
|
|
100
100
|
/* https://floating-ui.com/docs/react-dom#stable-ref-prop */
|
|
101
|
-
const stableRef = (0, react_1.useMemo)(() => (0, react_merge_refs_1.default)([ref, refs.floating]), [
|
|
102
|
-
ref,
|
|
103
|
-
refs.floating,
|
|
104
|
-
]);
|
|
101
|
+
const stableRef = (0, react_1.useMemo)(() => (0, react_merge_refs_1.default)([ref, refs.floating]), [ref, refs.floating]);
|
|
105
102
|
if (!children ||
|
|
106
103
|
(children === null || children === void 0 ? void 0 : children.type) === react_1.default.Fragment ||
|
|
107
104
|
children === react_1.default.Fragment) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionItem.js","sourceRoot":"","sources":["../../src/accordion/AccordionItem.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAsCnE,MAAM,CAAC,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"AccordionItem.js","sourceRoot":"","sources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.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAwB,MAAM,EAAE,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA8BhD,MAAM,CAAC,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAwB,MAAM,EAAE,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA8BhD,MAAM,CAAC,MAAM,MAAM,GACjB,UAAU,CACR,CACE,EAUC,EACD,GAAG,EACH,EAAE;QAZF,EACE,EAAE,EAAE,SAAS,GAAG,QAAQ,EACxB,OAAO,GAAG,SAAS,EACnB,SAAS,EACT,QAAQ,EACR,IAAI,GAAG,QAAQ,EACf,OAAO,GAAG,KAAK,EACf,QAAQ,EACR,KAAK,OAEN,EADI,IAAI,cATT,kFAUC,CADQ;IAIT,MAAM,SAAS,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACzD,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC;IAC9C,MAAM,CAAC,aAAa,EAA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GED
|
@@ -17,6 +17,10 @@ export interface SelectProps extends FormFieldProps, Omit<SelectHTMLAttributes<H
|
|
|
17
17
|
* If enabled shows the label and description for screenreaders only
|
|
18
18
|
*/
|
|
19
19
|
hideLabel?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Sets inline-style on select wrapper
|
|
22
|
+
*/
|
|
23
|
+
style?: React.CSSProperties;
|
|
20
24
|
}
|
|
21
25
|
export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
22
26
|
export default Select;
|
package/esm/form/Select.js
CHANGED
|
@@ -16,7 +16,7 @@ import { BodyShort, Label, ErrorMessage, omit, Detail } from "..";
|
|
|
16
16
|
import { useFormField } from "./useFormField";
|
|
17
17
|
export const Select = forwardRef((props, ref) => {
|
|
18
18
|
const { inputProps, errorId, showErrorMsg, hasError, size, inputDescriptionId, } = useFormField(props, "textField");
|
|
19
|
-
const { children, label, className, description, htmlSize, hideLabel = false } = props, rest = __rest(props, ["children", "label", "className", "description", "htmlSize", "hideLabel"]);
|
|
19
|
+
const { children, label, className, description, htmlSize, hideLabel = false, style } = props, rest = __rest(props, ["children", "label", "className", "description", "htmlSize", "hideLabel", "style"]);
|
|
20
20
|
return (React.createElement("div", { className: cl(className, "navds-form-field", `navds-form-field--${size}`, {
|
|
21
21
|
"navds-form-field--disabled": !!inputProps.disabled,
|
|
22
22
|
"navds-select--error": hasError,
|
|
@@ -29,7 +29,7 @@ export const Select = forwardRef((props, ref) => {
|
|
|
29
29
|
}), id: inputDescriptionId, size: "small", as: "div" }, description)) : (React.createElement(Detail, { className: cl("navds-form-field__description", {
|
|
30
30
|
"navds-sr-only": hideLabel,
|
|
31
31
|
}), id: inputDescriptionId, size: "small", as: "div" }, description)))),
|
|
32
|
-
React.createElement("div", { className: "navds-select__container" },
|
|
32
|
+
React.createElement("div", { className: "navds-select__container", style: style },
|
|
33
33
|
React.createElement("select", Object.assign({}, omit(rest, ["error", "errorId", "size"]), inputProps, { ref: ref, className: cl("navds-select__input", "navds-body-short", `navds-body--${size !== null && size !== void 0 ? size : "medium"}`), size: props.htmlSize }), children),
|
|
34
34
|
React.createElement(Expand, { className: "navds-select__chevron", "aria-hidden": true })),
|
|
35
35
|
React.createElement("div", { className: "navds-form-field__error", id: errorId, "aria-relevant": "additions removals", "aria-live": "polite" }, showErrorMsg && (React.createElement(ErrorMessage, { size: size }, props.error)))));
|
package/esm/form/Select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../src/form/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAwB,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAClE,OAAO,EAAkB,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../src/form/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAwB,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAClE,OAAO,EAAkB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA2B9D,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAC9B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EACJ,UAAU,EACV,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,IAA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SAAS,EAAE,MAAM,CAAC,CAAC,EACxC,UAAU,IACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,QAAQ,EAAE,CAClC,EACD,IAAI,EAAE,KAAK,CAAC,QAAQ,KAEnB,QAAQ,CACF;YACT,oBAAC,MAAM,IAAC,SAAS,EAAC,uBAAuB,wBAAe,CACpD;QACN,6BACE,SAAS,EAAC,yBAAyB,EACnC,EAAE,EAAE,OAAO,mBACG,oBAAoB,eACxB,QAAQ,IAEjB,YAAY,IAAI,CACf,oBAAC,YAAY,IAAC,IAAI,EAAE,IAAI,IAAG,KAAK,CAAC,KAAK,CAAgB,CACvD,CACG,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../src/form/radio/RadioGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAiB,MAAM,IAAI,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAU9B,MAAM,CAAC,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../src/form/radio/RadioGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAiB,MAAM,IAAI,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAU9B,MAAM,CAAC,MAAM,iBAAiB,GAC5B,KAAK,CAAC,aAAa,CAAgC,IAAI,CAAC,CAAC;AAiC3D,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAClC,CACE,EASC,EACD,GAAG,EACH,EAAE;;QAXF,EACE,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,QAAQ,OAET,EADI,IAAI,cART,kFASC,CADQ;IAIT,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAE7C,MAAM,MAAM,GAAG,KAAK,EAAE,CAAC;IAEvB,OAAO,CACL,oBAAC,QAAQ,oBACH,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,SAAS,EACT,mBAAmB,EACnB,sBAAsB,MAAA,MAAA,IAAI,CAAC,IAAI,mCAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,mCAAI,QAAQ,EAAE,CAChE;QAED,oBAAC,iBAAiB,CAAC,QAAQ,IACzB,KAAK,EAAE;gBACL,IAAI,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,kBAAkB,MAAM,EAAE;gBACxC,YAAY;gBACZ,KAAK;gBACL,QAAQ;gBACR,QAAQ;aACT;YAED,6BAAK,SAAS,EAAC,qBAAqB,IAAE,QAAQ,CAAO,CAC1B,CACpB,CACZ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -8,7 +8,7 @@ export declare type SearchClearEvent = {
|
|
|
8
8
|
trigger: "Escape";
|
|
9
9
|
event: React.KeyboardEvent<HTMLDivElement>;
|
|
10
10
|
};
|
|
11
|
-
export interface SearchProps extends
|
|
11
|
+
export interface SearchProps extends FormFieldProps, Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "onChange"> {
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
/**
|
|
14
14
|
* Search label
|
|
@@ -13,12 +13,12 @@ import { Close, Search as SearchIcon } from "@navikt/ds-icons";
|
|
|
13
13
|
import cl from "classnames";
|
|
14
14
|
import React, { forwardRef, useCallback, useRef, useState, } from "react";
|
|
15
15
|
import mergeRefs from "react-merge-refs";
|
|
16
|
-
import { BodyShort, Label, omit, useEventListener } from "../..";
|
|
16
|
+
import { BodyShort, ErrorMessage, Label, omit, useEventListener } from "../..";
|
|
17
|
+
import { useFormField } from "../useFormField";
|
|
17
18
|
import SearchButton from "./SearchButton";
|
|
18
|
-
import { useSearch } from "./useSearch";
|
|
19
19
|
export const SearchContext = React.createContext(null);
|
|
20
20
|
export const Search = forwardRef((props, ref) => {
|
|
21
|
-
const { inputProps, size = "medium", inputDescriptionId, } =
|
|
21
|
+
const { inputProps, size = "medium", inputDescriptionId, errorId, showErrorMsg, hasError, } = useFormField(props, "searchfield");
|
|
22
22
|
const { className, hideLabel = true, label, description, value, clearButtonLabel, onClear, clearButton = true, children, variant = "primary", defaultValue, onChange } = props, rest = __rest(props, ["className", "hideLabel", "label", "description", "value", "clearButtonLabel", "onClear", "clearButton", "children", "variant", "defaultValue", "onChange"]);
|
|
23
23
|
const searchRef = useRef(null);
|
|
24
24
|
const mergedRef = mergeRefs([searchRef, ref]);
|
|
@@ -41,6 +41,7 @@ export const Search = forwardRef((props, ref) => {
|
|
|
41
41
|
}
|
|
42
42
|
}, [handleClear]), wrapperRef);
|
|
43
43
|
return (React.createElement("div", { ref: setWrapperRef, className: cl(className, "navds-form-field", `navds-form-field--${size}`, "navds-search", {
|
|
44
|
+
"navds-search--error": hasError,
|
|
44
45
|
"navds-search--disabled": !!inputProps.disabled,
|
|
45
46
|
}) },
|
|
46
47
|
React.createElement(Label, { htmlFor: inputProps.id, size: size, as: "label", className: cl("navds-form-field__label", {
|
|
@@ -52,7 +53,7 @@ export const Search = forwardRef((props, ref) => {
|
|
|
52
53
|
React.createElement("div", { className: "navds-search__wrapper" },
|
|
53
54
|
React.createElement("div", { className: "navds-search__wrapper-inner" },
|
|
54
55
|
variant === "simple" && (React.createElement(SearchIcon, { "aria-hidden": true, className: "navds-search__search-icon" })),
|
|
55
|
-
React.createElement("input", Object.assign({ ref: mergedRef }, omit(rest, ["size"]), inputProps, { value: value !== null && value !== void 0 ? value : internalValue, onChange: (e) => handleChange(e.target.value), type: "search", role: "searchbox", className: cl(className, "navds-search__input", `navds-search__input--${variant}`, "navds-text-field__input", "navds-body-short", `navds-body-${size}`) })),
|
|
56
|
+
React.createElement("input", Object.assign({ ref: mergedRef }, omit(rest, ["error", "errorId", "size"]), inputProps, { value: value !== null && value !== void 0 ? value : internalValue, onChange: (e) => handleChange(e.target.value), type: "search", role: "searchbox", className: cl(className, "navds-search__input", `navds-search__input--${variant}`, "navds-text-field__input", "navds-body-short", `navds-body-${size}`) })),
|
|
56
57
|
(value !== null && value !== void 0 ? value : internalValue) && clearButton && (React.createElement("button", { type: "button", onClick: (e) => handleClear({ trigger: "Click", event: e }), className: "navds-search__button-clear" },
|
|
57
58
|
React.createElement("span", { className: "navds-sr-only" }, clearButtonLabel ? clearButtonLabel : "Tøm"),
|
|
58
59
|
React.createElement(Close, { "aria-hidden": true })))),
|
|
@@ -60,7 +61,8 @@ export const Search = forwardRef((props, ref) => {
|
|
|
60
61
|
size,
|
|
61
62
|
disabled: inputProps.disabled,
|
|
62
63
|
variant,
|
|
63
|
-
} }, children ? children : variant !== "simple" && React.createElement(SearchButton, null)))
|
|
64
|
+
} }, children ? children : variant !== "simple" && React.createElement(SearchButton, null))),
|
|
65
|
+
React.createElement("div", { className: "navds-form-field__error", id: errorId, "aria-relevant": "additions removals", "aria-live": "polite" }, showErrorMsg && (React.createElement(ErrorMessage, { size: size }, props.error)))));
|
|
64
66
|
});
|
|
65
67
|
Search.Button = SearchButton;
|
|
66
68
|
export default Search;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../src/form/search/Search.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,EACZ,UAAU,EAEV,WAAW,EACX,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;
|
|
1
|
+
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../src/form/search/Search.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,EACZ,UAAU,EAEV,WAAW,EACX,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAkB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,YAAkC,MAAM,gBAAgB,CAAC;AA6DhE,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAC9C,IAAI,CACL,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAC9B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EACJ,UAAU,EACV,IAAI,GAAG,QAAQ,EACf,kBAAkB,EAClB,OAAO,EACP,YAAY,EACZ,QAAQ,GACT,GAAG,YAAY,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAEvC,M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|
|
|
1
|
-
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAC;AAW5B,MAAM,CAAC,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAC;AAW5B,MAAM,CAAC,MAAM,IAAI,GACf,UAAU,CAAC,CAAC,EAA2C,EAAE,GAAG,EAAE,EAAE;QAApD,EAAE,EAAE,EAAE,SAAS,GAAG,GAAG,EAAE,SAAS,OAAW,EAAN,IAAI,cAAzC,mBAA2C,CAAF;IAAY,OAAA,CAC/D,oBAAC,SAAS,oBAAK,IAAI,IAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,IAAI,CAC1E,CAAA;CAAA,CAAC,CAAC;AAEL,eAAe,IAAI,CAAC"}
|
package/esm/stepper/Step.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ export interface StepperStepProps extends React.AnchorHTMLAttributes<HTMLAnchorE
|
|
|
6
6
|
*/
|
|
7
7
|
children: string;
|
|
8
8
|
/**
|
|
9
|
-
* Handled by Stepper
|
|
9
|
+
* Handled by Stepper, overwriting may break component logic
|
|
10
10
|
* @private
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
unsafe_index?: number;
|
|
13
13
|
}
|
|
14
14
|
export interface StepperStepType extends OverridableComponent<StepperStepProps, HTMLAnchorElement> {
|
|
15
15
|
}
|
package/esm/stepper/Step.js
CHANGED
|
@@ -14,22 +14,22 @@ import React, { forwardRef, useContext } from "react";
|
|
|
14
14
|
import { StepperContext } from "./Stepper";
|
|
15
15
|
import { Label } from "..";
|
|
16
16
|
export const StepComponent = forwardRef((_a, ref) => {
|
|
17
|
-
var { className, children, as: Component = "a",
|
|
17
|
+
var { className, children, as: Component = "a", unsafe_index = 0 } = _a, rest = __rest(_a, ["className", "children", "as", "unsafe_index"]);
|
|
18
18
|
const context = useContext(StepperContext);
|
|
19
19
|
if (context === null) {
|
|
20
|
-
console.error("<
|
|
20
|
+
console.error("<Stepper.Step> has to be used within <Stepper>");
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
|
-
const activeStep = context
|
|
24
|
-
return (React.createElement(Component, Object.assign({}, rest, { "aria-current":
|
|
25
|
-
"navds-stepper__step--active": activeStep,
|
|
23
|
+
const { activeStep } = context;
|
|
24
|
+
return (React.createElement(Component, Object.assign({}, rest, { "aria-current": activeStep === unsafe_index, ref: ref, className: cl("navds-stepper__step", className, {
|
|
25
|
+
"navds-stepper__step--active": activeStep === unsafe_index,
|
|
26
26
|
}), onClick: (e) => {
|
|
27
27
|
var _a;
|
|
28
|
-
context.onStepChange(
|
|
28
|
+
context.onStepChange(unsafe_index + 1);
|
|
29
29
|
(_a = rest === null || rest === void 0 ? void 0 : rest.onClick) === null || _a === void 0 ? void 0 : _a.call(rest, e);
|
|
30
30
|
} }),
|
|
31
|
-
React.createElement(Label, { className: "navds-
|
|
32
|
-
React.createElement(Label, { className: "navds-
|
|
31
|
+
React.createElement(Label, { className: "navds-stepper__circle", as: "span", "aria-hidden": "true" }, unsafe_index + 1),
|
|
32
|
+
React.createElement(Label, { as: "span", className: "navds-stepper__content" }, children)));
|
|
33
33
|
});
|
|
34
34
|
const Step = StepComponent;
|
|
35
35
|
export default Step;
|
package/esm/stepper/Step.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Step.js","sourceRoot":"","sources":["../../src/stepper/Step.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OA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,CAAC,CAAC,CAAC;YACvC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,qDAAG,CAAC,CAAC,CAAC;QACrB,CAAC;QAED,oBAAC,KAAK,IAAC,SAAS,EAAC,uBAAuB,EAAC,EAAE,EAAC,MAAM,iBAAa,MAAM,IAClE,YAAY,GAAG,CAAC,CACX;QACR,oBAAC,KAAK,IAAC,EAAE,EAAC,MAAM,EAAC,SAAS,EAAC,wBAAwB,IAChD,QAAQ,CACH,CACE,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,IAAI,GAAG,aAAgC,CAAC;AAE9C,eAAe,IAAI,CAAC"}
|
package/esm/stepper/Stepper.d.ts
CHANGED
|
@@ -6,15 +6,18 @@ export interface StepperProps extends React.HTMLAttributes<HTMLOListElement> {
|
|
|
6
6
|
*/
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* The direction the component grows.
|
|
10
|
+
* @default "vertical"
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
orientation?: "horizontal" | "vertical";
|
|
12
13
|
/**
|
|
13
|
-
* Current active step
|
|
14
|
+
* Current active step.
|
|
15
|
+
* @note Stepper index starts at 1, not 0
|
|
14
16
|
*/
|
|
15
17
|
activeStep: number;
|
|
16
18
|
/**
|
|
17
|
-
* Callback for
|
|
19
|
+
* Callback for next activeStep
|
|
20
|
+
* @note Stepper index starts at 1, not 0
|
|
18
21
|
*/
|
|
19
22
|
onStepChange?: (step: number) => void;
|
|
20
23
|
}
|
|
@@ -25,6 +28,7 @@ interface StepperContextProps {
|
|
|
25
28
|
activeStep: number;
|
|
26
29
|
onStepChange: (step: number) => void;
|
|
27
30
|
lastIndex: number;
|
|
31
|
+
orientation: "horizontal" | "vertical";
|
|
28
32
|
}
|
|
29
33
|
export declare const StepperContext: React.Context<StepperContextProps | null>;
|
|
30
34
|
export declare const Stepper: StepperComponent;
|
package/esm/stepper/Stepper.js
CHANGED
|
@@ -14,17 +14,22 @@ import cl from "classnames";
|
|
|
14
14
|
import Step from "./Step";
|
|
15
15
|
export const StepperContext = createContext(null);
|
|
16
16
|
export const Stepper = forwardRef((_a, ref) => {
|
|
17
|
-
var { children, className, activeStep, onStepChange = () => { } } = _a, rest = __rest(_a, ["children", "className", "activeStep", "onStepChange"]);
|
|
18
|
-
|
|
17
|
+
var { children, className, activeStep, orientation = "vertical", onStepChange = () => { } } = _a, rest = __rest(_a, ["children", "className", "activeStep", "orientation", "onStepChange"]);
|
|
18
|
+
activeStep = activeStep - 1;
|
|
19
|
+
return (React.createElement("ol", Object.assign({}, rest, { ref: ref, className: cl("navds-stepper", orientation === "horizontal" ? "navds-stepper--horizontal" : "", className) }),
|
|
19
20
|
React.createElement(StepperContext.Provider, { value: {
|
|
20
21
|
activeStep,
|
|
21
22
|
onStepChange,
|
|
22
23
|
lastIndex: React.Children.count(children),
|
|
24
|
+
orientation,
|
|
23
25
|
} }, React.Children.map(children, (step, index) => {
|
|
24
26
|
var _a, _b;
|
|
25
|
-
return (React.createElement("li", { className: cl("navds-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
return (React.createElement("li", { className: cl("navds-stepper__item"), key: index + ((_b = (_a = children === null || children === void 0 ? void 0 : children.toString) === null || _a === void 0 ? void 0 : _a.call(children)) !== null && _b !== void 0 ? _b : "") },
|
|
28
|
+
React.createElement("span", { className: "navds-stepper__line navds-stepper__line--1" }),
|
|
29
|
+
React.isValidElement(step)
|
|
30
|
+
? React.cloneElement(step, Object.assign(Object.assign({}, step.props), { unsafe_index: index }))
|
|
31
|
+
: step,
|
|
32
|
+
React.createElement("span", { className: "navds-stepper__line navds-stepper__line--2" })));
|
|
28
33
|
}))));
|
|
29
34
|
});
|
|
30
35
|
Stepper.Step = Step;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.js","sourceRoot":"","sources":["../../src/stepper/Stepper.tsx"],"names":[],"mappings":";;;;;;;;;;;AAA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EAAE,KAAK,GAAG,CAAC,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,QAAQ,wDAAI,mCAAI,EAAE,CAAC;gBAE3C,8BAAM,SAAS,EAAC,4CAA4C,GAAG;gBAC9D,KAAK,CAAC,cAAc,CAAmB,IAAI,CAAC;oBAC3C,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,kCAClB,IAAI,CAAC,KAAK,KACb,YAAY,EAAE,KAAK,IACnB;oBACJ,CAAC,CAAC,IAAI;gBACR,8BAAM,SAAS,EAAC,4CAA4C,GAAG,CAC5D,CACN,CAAC;QACJ,CAAC,CAAC,CACsB,CACvB,CACN,CAAC;AACJ,CAAC,CACkB,CAAC;AAEtB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AAEpB,eAAe,OAAO,CAAC"}
|
package/esm/tooltip/Tooltip.js
CHANGED
|
@@ -69,10 +69,7 @@ export const Tooltip = forwardRef((_a, ref) => {
|
|
|
69
69
|
}, [handleMouseUp]);
|
|
70
70
|
useEventListener("keydown", useCallback((e) => e.key === "Escape" && handleClose(), [handleClose]));
|
|
71
71
|
/* https://floating-ui.com/docs/react-dom#stable-ref-prop */
|
|
72
|
-
const stableRef = useMemo(() => mergeRefs([ref, refs.floating]), [
|
|
73
|
-
ref,
|
|
74
|
-
refs.floating,
|
|
75
|
-
]);
|
|
72
|
+
const stableRef = useMemo(() => mergeRefs([ref, refs.floating]), [ref, refs.floating]);
|
|
76
73
|
if (!children ||
|
|
77
74
|
(children === null || children === void 0 ? void 0 : children.type) === React.Fragment ||
|
|
78
75
|
children === React.Fragment) {
|