@navikt/ds-react 7.29.0 → 7.30.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/cjs/date/datepicker/parts/DatePicker.WeekNumber.js +1 -1
- package/cjs/date/datepicker/parts/DatePicker.WeekNumber.js.map +1 -1
- package/cjs/form/checkbox/Checkbox.js +1 -1
- package/cjs/form/checkbox/Checkbox.js.map +1 -1
- package/cjs/form/form-summary/FormSummary.d.ts +11 -17
- package/cjs/form/form-summary/FormSummary.js +5 -1
- package/cjs/form/form-summary/FormSummary.js.map +1 -1
- package/cjs/form/form-summary/FormSummaryEditLink.js +6 -1
- package/cjs/form/form-summary/FormSummaryEditLink.js.map +1 -1
- package/cjs/form/form-summary/FormSummaryFooter.d.ts +12 -0
- package/cjs/form/form-summary/FormSummaryFooter.js +56 -0
- package/cjs/form/form-summary/FormSummaryFooter.js.map +1 -0
- package/cjs/form/form-summary/FormSummaryHeader.d.ts +1 -1
- package/cjs/form/form-summary/FormSummaryHeader.js +3 -1
- package/cjs/form/form-summary/FormSummaryHeader.js.map +1 -1
- package/cjs/form/form-summary/index.d.ts +1 -0
- package/cjs/form/form-summary/index.js +3 -1
- package/cjs/form/form-summary/index.js.map +1 -1
- package/cjs/list/List.Item.js +1 -1
- package/cjs/list/List.Item.js.map +1 -1
- package/cjs/overlays/floating-menu/parts/FocusScope.d.ts +1 -1
- package/cjs/overlays/floating-menu/parts/FocusScope.js +2 -3
- package/cjs/overlays/floating-menu/parts/FocusScope.js.map +1 -1
- package/cjs/slot/Slot.d.ts +1 -1
- package/cjs/slot/Slot.js +8 -38
- package/cjs/slot/Slot.js.map +1 -1
- package/cjs/timeline/period/index.d.ts +1 -1
- package/cjs/timeline/period/index.js.map +1 -1
- package/cjs/timeline/utils/timeline.d.ts +7 -6
- package/cjs/timeline/utils/timeline.js +39 -62
- package/cjs/timeline/utils/timeline.js.map +1 -1
- package/cjs/timeline/utils/types.external.d.ts +2 -3
- package/cjs/timeline/utils/types.internal.d.ts +1 -1
- package/cjs/util/composition-warning/CompositionWarning.d.ts +37 -0
- package/cjs/util/composition-warning/CompositionWarning.js +71 -0
- package/cjs/util/composition-warning/CompositionWarning.js.map +1 -0
- package/cjs/util/composition-warning/index.d.ts +1 -0
- package/cjs/util/composition-warning/index.js +38 -0
- package/cjs/util/composition-warning/index.js.map +1 -0
- package/cjs/util/getChildRef.d.ts +1 -0
- package/cjs/util/getChildRef.js +8 -0
- package/cjs/util/getChildRef.js.map +1 -0
- package/cjs/util/renderStoriesForChromatic.d.ts +2 -10
- package/cjs/util/renderStoriesForChromatic.js +2 -2
- package/cjs/util/renderStoriesForChromatic.js.map +1 -1
- package/esm/date/datepicker/parts/DatePicker.WeekNumber.js +1 -1
- package/esm/date/datepicker/parts/DatePicker.WeekNumber.js.map +1 -1
- package/esm/form/checkbox/Checkbox.js +1 -1
- package/esm/form/checkbox/Checkbox.js.map +1 -1
- package/esm/form/form-summary/FormSummary.d.ts +11 -17
- package/esm/form/form-summary/FormSummary.js +5 -1
- package/esm/form/form-summary/FormSummary.js.map +1 -1
- package/esm/form/form-summary/FormSummaryEditLink.js +6 -1
- package/esm/form/form-summary/FormSummaryEditLink.js.map +1 -1
- package/esm/form/form-summary/FormSummaryFooter.d.ts +12 -0
- package/esm/form/form-summary/FormSummaryFooter.js +20 -0
- package/esm/form/form-summary/FormSummaryFooter.js.map +1 -0
- package/esm/form/form-summary/FormSummaryHeader.d.ts +1 -1
- package/esm/form/form-summary/FormSummaryHeader.js +3 -1
- package/esm/form/form-summary/FormSummaryHeader.js.map +1 -1
- package/esm/form/form-summary/index.d.ts +1 -0
- package/esm/form/form-summary/index.js +1 -0
- package/esm/form/form-summary/index.js.map +1 -1
- package/esm/list/List.Item.js +1 -1
- package/esm/list/List.Item.js.map +1 -1
- package/esm/overlays/floating-menu/parts/FocusScope.d.ts +1 -1
- package/esm/overlays/floating-menu/parts/FocusScope.js +1 -2
- package/esm/overlays/floating-menu/parts/FocusScope.js.map +1 -1
- package/esm/slot/Slot.d.ts +1 -1
- package/esm/slot/Slot.js +1 -1
- package/esm/slot/Slot.js.map +1 -1
- package/esm/timeline/period/index.d.ts +1 -1
- package/esm/timeline/period/index.js.map +1 -1
- package/esm/timeline/utils/timeline.d.ts +7 -6
- package/esm/timeline/utils/timeline.js +39 -62
- package/esm/timeline/utils/timeline.js.map +1 -1
- package/esm/timeline/utils/types.external.d.ts +2 -3
- package/esm/timeline/utils/types.internal.d.ts +1 -1
- package/esm/util/composition-warning/CompositionWarning.d.ts +37 -0
- package/esm/util/composition-warning/CompositionWarning.js +34 -0
- package/esm/util/composition-warning/CompositionWarning.js.map +1 -0
- package/esm/util/composition-warning/index.d.ts +1 -0
- package/esm/util/composition-warning/index.js +2 -0
- package/esm/util/composition-warning/index.js.map +1 -0
- package/esm/util/getChildRef.d.ts +1 -0
- package/esm/util/getChildRef.js +4 -0
- package/esm/util/getChildRef.js.map +1 -0
- package/esm/util/renderStoriesForChromatic.d.ts +2 -10
- package/esm/util/renderStoriesForChromatic.js +2 -2
- package/esm/util/renderStoriesForChromatic.js.map +1 -1
- package/package.json +3 -3
- package/src/date/datepicker/parts/DatePicker.WeekNumber.tsx +3 -1
- package/src/form/checkbox/Checkbox.tsx +0 -2
- package/src/form/combobox/__tests__/combobox.test.tsx +2 -1
- package/src/form/form-summary/FormSummary.tsx +12 -17
- package/src/form/form-summary/FormSummaryEditLink.tsx +16 -7
- package/src/form/form-summary/FormSummaryFooter.tsx +33 -0
- package/src/form/form-summary/FormSummaryHeader.tsx +12 -9
- package/src/form/form-summary/index.ts +4 -0
- package/src/list/List.Item.tsx +0 -2
- package/src/overlays/floating-menu/parts/FocusScope.tsx +1 -2
- package/src/slot/Slot.tsx +1 -1
- package/src/timeline/period/index.tsx +3 -1
- package/src/timeline/utils/timeline.ts +56 -67
- package/src/timeline/utils/types.external.ts +4 -3
- package/src/timeline/utils/types.internal.ts +3 -1
- package/src/util/composition-warning/CompositionWarning.tsx +67 -0
- package/src/util/composition-warning/index.ts +1 -0
- package/src/util/getChildRef.ts +6 -0
- package/src/util/renderStoriesForChromatic.tsx +12 -9
|
@@ -6,73 +6,50 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.parseRows = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const util_1 = require("../../util");
|
|
9
|
+
const getChildRef_1 = require("../../util/getChildRef");
|
|
9
10
|
const parseRows = (rowChildren) => {
|
|
10
11
|
const parsedChildren = [];
|
|
11
|
-
rowChildren === null || rowChildren === void 0 ? void 0 : rowChildren.forEach((
|
|
12
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
12
|
+
rowChildren === null || rowChildren === void 0 ? void 0 : rowChildren.forEach((row) => {
|
|
13
13
|
const periods = [];
|
|
14
|
-
if (react_1.default.isValidElement(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
status: ((_d = p === null || p === void 0 ? void 0 : p.props) === null || _d === void 0 ? void 0 : _d.status) || "neutral",
|
|
22
|
-
onSelectPeriod: (_e = p.props) === null || _e === void 0 ? void 0 : _e.onSelectPeriod,
|
|
23
|
-
label: r.props.label,
|
|
24
|
-
icon: p.props.icon,
|
|
25
|
-
children: p.props.children,
|
|
26
|
-
isActive: p.props.isActive,
|
|
27
|
-
statusLabel: p.props.statusLabel,
|
|
28
|
-
restProps: (0, util_1.omit)(p.props, [
|
|
29
|
-
"start",
|
|
30
|
-
"end",
|
|
31
|
-
"status",
|
|
32
|
-
"onSelectPeriod",
|
|
33
|
-
"label",
|
|
34
|
-
"icon",
|
|
35
|
-
"children",
|
|
36
|
-
"isActive",
|
|
37
|
-
"statusLabel",
|
|
38
|
-
]),
|
|
39
|
-
ref: p === null || p === void 0 ? void 0 : p.ref,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
periods.push({
|
|
45
|
-
start: r.props.children.props.start,
|
|
46
|
-
end: r.props.children.props.end,
|
|
47
|
-
status: ((_f = r.props.children.props) === null || _f === void 0 ? void 0 : _f.status) || "neutral",
|
|
48
|
-
onSelectPeriod: (_g = r.props.children.props) === null || _g === void 0 ? void 0 : _g.onSelectPeriod,
|
|
49
|
-
label: r.props.label,
|
|
50
|
-
icon: (_h = r.props.children.props) === null || _h === void 0 ? void 0 : _h.icon,
|
|
51
|
-
children: (_j = r.props.children.props) === null || _j === void 0 ? void 0 : _j.children,
|
|
52
|
-
statusLabel: (_k = r.props.children.props) === null || _k === void 0 ? void 0 : _k.statusLabel,
|
|
53
|
-
restProps: (0, util_1.omit)(r.props.children.props, [
|
|
54
|
-
"start",
|
|
55
|
-
"end",
|
|
56
|
-
"status",
|
|
57
|
-
"onSelectPeriod",
|
|
58
|
-
"label",
|
|
59
|
-
"icon",
|
|
60
|
-
"children",
|
|
61
|
-
"isActive",
|
|
62
|
-
"statusLabel",
|
|
63
|
-
]),
|
|
64
|
-
ref: (_m = (_l = r.props) === null || _l === void 0 ? void 0 : _l.children) === null || _m === void 0 ? void 0 : _m.ref,
|
|
65
|
-
});
|
|
14
|
+
if (!react_1.default.isValidElement(row) ||
|
|
15
|
+
!row.props.children) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
react_1.default.Children.toArray(row.props.children).forEach((period) => {
|
|
19
|
+
if (!react_1.default.isValidElement(period)) {
|
|
20
|
+
return;
|
|
66
21
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
22
|
+
periods.push({
|
|
23
|
+
start: period.props.start,
|
|
24
|
+
end: period.props.end,
|
|
25
|
+
status: period.props.status || "neutral",
|
|
26
|
+
onSelectPeriod: period.props.onSelectPeriod,
|
|
27
|
+
icon: period.props.icon,
|
|
28
|
+
children: period.props.children,
|
|
29
|
+
isActive: period.props.isActive,
|
|
30
|
+
statusLabel: period.props.statusLabel,
|
|
31
|
+
restProps: (0, util_1.omit)(period.props, [
|
|
32
|
+
"start",
|
|
33
|
+
"end",
|
|
34
|
+
"status",
|
|
35
|
+
"onSelectPeriod",
|
|
36
|
+
"icon",
|
|
37
|
+
"children",
|
|
38
|
+
"isActive",
|
|
39
|
+
"statusLabel",
|
|
40
|
+
"placement",
|
|
41
|
+
]),
|
|
42
|
+
ref: (0, getChildRef_1.getChildRef)(period),
|
|
74
43
|
});
|
|
75
|
-
}
|
|
44
|
+
});
|
|
45
|
+
parsedChildren.push({
|
|
46
|
+
label: row.props.label,
|
|
47
|
+
icon: row.props.icon,
|
|
48
|
+
headingTag: row.props.headingTag,
|
|
49
|
+
periods,
|
|
50
|
+
restProps: (0, util_1.omit)(row.props, ["label", "icon", "headingTag"]),
|
|
51
|
+
ref: (0, getChildRef_1.getChildRef)(row),
|
|
52
|
+
});
|
|
76
53
|
});
|
|
77
54
|
return parsedChildren;
|
|
78
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../../src/timeline/utils/timeline.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyC;
|
|
1
|
+
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../../src/timeline/utils/timeline.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyC;AAEzC,qCAAkC;AAClC,wDAAqD;AAe9C,MAAM,SAAS,GAAG,CAAC,WAAwB,EAAE,EAAE;IACpD,MAAM,cAAc,GAAgB,EAAE,CAAC;IAEvC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,CAAC,CAAC,GAAoB,EAAE,EAAE;QAC5C,MAAM,OAAO,GAAyB,EAAE,CAAC;QAEzC,IACE,CAAC,eAAK,CAAC,cAAc,CAA0B,GAAG,CAAC;YACnD,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EACnB,CAAC;YACD,OAAO;QACT,CAAC;QAED,eA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GAAG,EAAE,IAAA,yBAAW,EAAC,GAAG,CAAC;SACtB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AArDW,QAAA,SAAS,aAqDpB"}
|
|
@@ -7,18 +7,17 @@ export interface Positioned {
|
|
|
7
7
|
}
|
|
8
8
|
export interface Period {
|
|
9
9
|
id: string;
|
|
10
|
-
label?: string;
|
|
11
10
|
start: Date;
|
|
12
11
|
endInclusive: Date;
|
|
13
12
|
status?: PeriodStatus;
|
|
14
|
-
onSelectPeriod?: () => void;
|
|
13
|
+
onSelectPeriod?: (e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void;
|
|
15
14
|
icon?: React.ReactNode;
|
|
16
15
|
children?: React.ReactNode;
|
|
17
16
|
end: Date;
|
|
18
17
|
isActive?: boolean;
|
|
19
18
|
statusLabel?: string;
|
|
20
19
|
restProps?: any;
|
|
21
|
-
ref?:
|
|
20
|
+
ref?: React.Ref<HTMLDivElement | HTMLButtonElement>;
|
|
22
21
|
}
|
|
23
22
|
export interface PositionedPeriod extends Period, Positioned {
|
|
24
23
|
width: number;
|
|
@@ -11,7 +11,7 @@ export interface Period {
|
|
|
11
11
|
start: Date;
|
|
12
12
|
endInclusive: Date;
|
|
13
13
|
status?: PeriodStatus;
|
|
14
|
-
onSelectPeriod?: () => void;
|
|
14
|
+
onSelectPeriod?: (e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void;
|
|
15
15
|
icon?: React.ReactNode;
|
|
16
16
|
children?: React.ReactNode;
|
|
17
17
|
isActive?: boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Give warnings based on component composition (which slot/parent a child is rendered in).
|
|
3
|
+
*
|
|
4
|
+
* Used when child components need to know which slot/parent they are rendered in
|
|
5
|
+
* (e.g. `FormSummary.Header` vs `FormSummary.Footer`) and should warn or error in development
|
|
6
|
+
* if placed in a discouraged or forbidden slot.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* - Wrap slot components with <CompositionWarning.Root name="FormSummary.Header">...</CompositionWarning.Root>
|
|
10
|
+
* - In child: `<CompositionWarning.Forbidden name="FormSummary.Header" />` to forbid slot.
|
|
11
|
+
*
|
|
12
|
+
* This is guidance only: warnings are logged to the console in development, never enforced at runtime.
|
|
13
|
+
*/
|
|
14
|
+
import React from "react";
|
|
15
|
+
type CompositionName = string;
|
|
16
|
+
type CompositionWarningContextType = {
|
|
17
|
+
/**
|
|
18
|
+
* Name of the slot component we want to check.
|
|
19
|
+
*/
|
|
20
|
+
name: CompositionName;
|
|
21
|
+
};
|
|
22
|
+
declare const CompositionWarning: React.ForwardRefExoticComponent<CompositionWarningContextType & {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
} & React.RefAttributes<unknown>>;
|
|
25
|
+
type CompositionWarningForbiddenProps = {
|
|
26
|
+
children?: React.ReactElement;
|
|
27
|
+
/**
|
|
28
|
+
* Name of the parent slot component where the child is not allowed.
|
|
29
|
+
*/
|
|
30
|
+
name: CompositionName;
|
|
31
|
+
/**
|
|
32
|
+
* Warning message to display if the child is found.
|
|
33
|
+
*/
|
|
34
|
+
message: string;
|
|
35
|
+
};
|
|
36
|
+
declare function CompositionWarningForbidden({ children, name, message, }: CompositionWarningForbiddenProps): React.JSX.Element;
|
|
37
|
+
export { CompositionWarningForbidden as Forbidden, CompositionWarning as Root };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Root = void 0;
|
|
37
|
+
exports.Forbidden = CompositionWarningForbidden;
|
|
38
|
+
/**
|
|
39
|
+
* Give warnings based on component composition (which slot/parent a child is rendered in).
|
|
40
|
+
*
|
|
41
|
+
* Used when child components need to know which slot/parent they are rendered in
|
|
42
|
+
* (e.g. `FormSummary.Header` vs `FormSummary.Footer`) and should warn or error in development
|
|
43
|
+
* if placed in a discouraged or forbidden slot.
|
|
44
|
+
*
|
|
45
|
+
* Usage:
|
|
46
|
+
* - Wrap slot components with <CompositionWarning.Root name="FormSummary.Header">...</CompositionWarning.Root>
|
|
47
|
+
* - In child: `<CompositionWarning.Forbidden name="FormSummary.Header" />` to forbid slot.
|
|
48
|
+
*
|
|
49
|
+
* This is guidance only: warnings are logged to the console in development, never enforced at runtime.
|
|
50
|
+
*/
|
|
51
|
+
const react_1 = __importStar(require("react"));
|
|
52
|
+
const Slot_1 = require("../../slot/Slot");
|
|
53
|
+
const create_context_1 = require("../create-context");
|
|
54
|
+
const isDev = process.env.NODE_ENV !== "production";
|
|
55
|
+
const [CompositionWarning, useCompositionWarning] = (0, create_context_1.createContext)({
|
|
56
|
+
errorMessage: "useCompositionWarning() must be used within <CompositionWarning />",
|
|
57
|
+
});
|
|
58
|
+
exports.Root = CompositionWarning;
|
|
59
|
+
function CompositionWarningForbidden({ children, name, message, }) {
|
|
60
|
+
var _a;
|
|
61
|
+
const compositionName = (_a = useCompositionWarning(false)) === null || _a === void 0 ? void 0 : _a.name;
|
|
62
|
+
const elementRef = (0, react_1.useRef)(null);
|
|
63
|
+
(0, react_1.useEffect)(() => {
|
|
64
|
+
if (!isDev || !compositionName || name !== compositionName) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
console.warn(`[Aksel] ${message}\nElement: `, elementRef.current);
|
|
68
|
+
}, [compositionName, name, message]);
|
|
69
|
+
return react_1.default.createElement(Slot_1.Slot, { ref: elementRef }, children);
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=CompositionWarning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompositionWarning.js","sourceRoot":"","sources":["../../../src/util/composition-warning/CompositionWarning.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEwC,gDAAS;AAlEjD;;;;;;;;;;;;GAYG;AACH,+CAAiD;AACjD,0CAAuC;AACvC,sDAAkD;AAIlD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC;AASpD,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAC/C,IAAA,8BAAa,EAAgC;IAC3C,YAAY,EACV,oEAAoE;CACvE,CAAC,CAAC;AAkCoE,kCAAI;AApB7E,SAAS,2BAA2B,CAAC,EACnC,QAAQ,EACR,IAAI,EACJ,OAAO,GAC0B;;IACjC,MAAM,eAAe,GAAG,MAAA,qBAAqB,CAAC,KAAK,CAAC,0CAAE,IAAI,CAAC;IAE3D,MAAM,UAAU,GAAG,IAAA,cAAM,EAAc,IAAI,CAAC,CAAC;IAE7C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,KAAK,IAAI,CAAC,eAAe,IAAI,IAAI,KAAK,eAAe,EAAE,CAAC;YAC3D,OAAO;QACT,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,WAAW,OAAO,aAAa,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IACpE,CAAC,EAAE,CAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAErC,OAAO,8BAAC,WAAI,IAAC,GAAG,EAAE,UAAU,IAAG,QAAQ,CAAQ,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as CompositionWarning from "./CompositionWarning";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.CompositionWarning = void 0;
|
|
37
|
+
exports.CompositionWarning = __importStar(require("./CompositionWarning"));
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/util/composition-warning/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2EAA2D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getChildRef: <T>(children: React.ReactElement<React.RefAttributes<T>>) => React.Ref<T> | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getChildRef = void 0;
|
|
4
|
+
const getChildRef = (children) => Object.prototype.propertyIsEnumerable.call(children.props, "ref")
|
|
5
|
+
? children.props.ref // React 19 (children.ref still works, but gives a warning)
|
|
6
|
+
: children.ref; // React <19
|
|
7
|
+
exports.getChildRef = getChildRef;
|
|
8
|
+
//# sourceMappingURL=getChildRef.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getChildRef.js","sourceRoot":"","sources":["../../src/util/getChildRef.ts"],"names":[],"mappings":";;;AAAO,MAAM,WAAW,GAAG,CACzB,QAAoD,EAC1B,EAAE,CAC5B,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAC/D,CAAC,CAAE,QAAQ,CAAC,KAAa,CAAC,GAAG,CAAC,2DAA2D;IACzF,CAAC,CAAE,QAAgB,CAAC,GAAG,CAAC,CAAC,YAAY;AAL5B,QAAA,WAAW,eAKI"}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryObj } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { Renderer, StoryContext } from "storybook/internal/types";
|
|
4
3
|
export declare function renderStoriesForChromatic(stories: Record<string, {
|
|
5
4
|
render?: (...args: any[]) => React.ReactNode;
|
|
6
|
-
} | React.FunctionComponent<void>>):
|
|
7
|
-
render: (args_0: Args, args_1: StoryContext<Renderer, Args>) => React.JSX.Element[];
|
|
8
|
-
parameters: {
|
|
9
|
-
chromatic: {
|
|
10
|
-
disable: boolean;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
5
|
+
} | React.FunctionComponent<void>>): StoryObj;
|
|
@@ -7,12 +7,12 @@ exports.renderStoriesForChromatic = renderStoriesForChromatic;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
function renderStoriesForChromatic(stories) {
|
|
9
9
|
return {
|
|
10
|
-
render: (...args) => Object.entries(stories).map(([storyName, story]) => {
|
|
10
|
+
render: (...args) => (react_1.default.createElement(react_1.default.Fragment, null, Object.entries(stories).map(([storyName, story]) => {
|
|
11
11
|
var _a;
|
|
12
12
|
return (react_1.default.createElement("div", { key: storyName },
|
|
13
13
|
react_1.default.createElement("h2", { className: "storyheading" }, storyName),
|
|
14
14
|
typeof story === "function" ? story() : (_a = story.render) === null || _a === void 0 ? void 0 : _a.call(story, ...args)));
|
|
15
|
-
}),
|
|
15
|
+
}))),
|
|
16
16
|
parameters: {
|
|
17
17
|
chromatic: { disable: false },
|
|
18
18
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderStoriesForChromatic.js","sourceRoot":"","sources":["../../src/util/renderStoriesForChromatic.tsx"],"names":[],"mappings":";;;;;AAIA,
|
|
1
|
+
{"version":3,"file":"renderStoriesForChromatic.js","sourceRoot":"","sources":["../../src/util/renderStoriesForChromatic.tsx"],"names":[],"mappings":";;;;;AAIA,8DAsBC;AAzBD,kDAA0B;AAG1B,SAAgB,yBAAyB,CACvC,OAIC;IAED,OAAO;QACL,MAAM,EAAE,CAAC,GAAG,IAA0C,EAAE,EAAE,CAAC,CACzD,8DACG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE;;YAAC,OAAA,CACnD,uCAAK,GAAG,EAAE,SAAS;gBACjB,sCAAI,SAAS,EAAC,cAAc,IAAE,SAAS,CAAM;gBAC5C,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,MAAA,KAAK,CAAC,MAAM,sDAAG,GAAG,IAAI,CAAC,CAC5D,CACP,CAAA;SAAA,CAAC,CACD,CACJ;QACD,UAAU,EAAE;YACV,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;SAC9B;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -30,7 +30,7 @@ const DatePickerWeekNumber = ({ week: { weekNumber, days }, onWeekNumberClick, c
|
|
|
30
30
|
}) },
|
|
31
31
|
React.createElement(Button, { variant: "secondary-neutral", size: "small", name: "week-number", "aria-label": translate("selectWeekNumber", { week: weekNumber }), style: style, className: cn("navds-date__weeknumber", "rdp-weeknumber"), onClick: () => {
|
|
32
32
|
onWeekNumberClick(weekNumber, days.map((day) => day.date));
|
|
33
|
-
}, icon: React.createElement("span", { className: "navds-date__weeknumber-number" }, weekNumber) }))));
|
|
33
|
+
}, icon: React.createElement("span", { className: cn("navds-date__weeknumber-number") }, weekNumber) }))));
|
|
34
34
|
};
|
|
35
35
|
export { DatePickerWeekNumber };
|
|
36
36
|
//# sourceMappingURL=DatePicker.WeekNumber.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.WeekNumber.js","sourceRoot":"","sources":["../../../../src/date/datepicker/parts/DatePicker.WeekNumber.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAgB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAG9D,MAAM,oBAAoB,GAAG,CAAC,EAC5B,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAC1B,iBAAiB,EACjB,SAAS,EACT,KAAK,EACL,aAAa,GAKiC,EAAE,EAAE;IAClD,MAAM,SAAS,GAAG,yBAAyB,EAAE,CAAC,SAAS,CAAC;IACxD,MAAM,EAAE,EAAE,EAAE,GAAG,YAAY,EAAE,CAAC;IAE9B,MAAM,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAAC;IAExC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,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AAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAC5B,CAAC;gBACJ,CAAC,EACD,IAAI,EACF,8BAAM,SAAS,EAAE,EAAE,CAAC,+BAA+B,CAAC,IACjD,UAAU,CACN,GAET,CACC,CACO,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -35,7 +35,7 @@ export const Checkbox = forwardRef((props, ref) => {
|
|
|
35
35
|
} })),
|
|
36
36
|
React.createElement("label", { htmlFor: inputProps.id, className: cn("navds-checkbox__label") },
|
|
37
37
|
React.createElement("span", { className: cn("navds-checkbox__icon") },
|
|
38
|
-
React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg",
|
|
38
|
+
React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 13 10", fill: "none", focusable: false, role: "img", "aria-hidden": true },
|
|
39
39
|
React.createElement("path", { d: "M4.03524 6.41478L10.4752 0.404669C11.0792 -0.160351 12.029 -0.130672 12.5955 0.47478C13.162 1.08027 13.1296 2.03007 12.5245 2.59621L5.02111 9.59934C4.74099 9.85904 4.37559 10 4.00025 10C3.60651 10 3.22717 9.84621 2.93914 9.56111L0.439143 7.06111C-0.146381 6.47558 -0.146381 5.52542 0.439143 4.93989C1.02467 4.35437 1.97483 4.35437 2.56036 4.93989L4.03524 6.41478Z", fill: "currentColor" }))),
|
|
40
40
|
React.createElement("span", { className: cn("navds-checkbox__icon-indeterminate") }),
|
|
41
41
|
React.createElement("span", { className: cn("navds-checkbox__content", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/form/checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;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MAAM,IAAI,QAAQ,IAAI,oBAAC,qBAAqB,OAAG;oBAChD,KAAK,CAAC,QAAQ,CACL;gBACX,KAAK,CAAC,WAAW,IAAI,CACpB,oBAAC,SAAS,IACR,EAAE,EAAC,MAAM,EACT,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CACX,8DAA8D,CAC/D,IAEA,KAAK,CAAC,WAAW,CACR,CACb,CACI,CACD,CACJ,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -2,13 +2,14 @@ import React, { HTMLAttributes } from "react";
|
|
|
2
2
|
import FormSummaryAnswer from "./FormSummaryAnswer.js";
|
|
3
3
|
import FormSummaryAnswers from "./FormSummaryAnswers.js";
|
|
4
4
|
import FormSummaryEditLink from "./FormSummaryEditLink.js";
|
|
5
|
+
import FormSummaryFooter from "./FormSummaryFooter.js";
|
|
5
6
|
import FormSummaryHeader from "./FormSummaryHeader.js";
|
|
6
7
|
import FormSummaryHeading from "./FormSummaryHeading.js";
|
|
7
8
|
import FormSummaryLabel from "./FormSummaryLabel.js";
|
|
8
9
|
import FormSummaryValue from "./FormSummaryValue.js";
|
|
9
10
|
interface FormSummaryComponent extends React.ForwardRefExoticComponent<FormSummaryProps & React.RefAttributes<HTMLDivElement>> {
|
|
10
11
|
/**
|
|
11
|
-
* Must include `<FormSummary.Heading
|
|
12
|
+
* Must include `<FormSummary.Heading>`.
|
|
12
13
|
*/
|
|
13
14
|
Header: typeof FormSummaryHeader;
|
|
14
15
|
/**
|
|
@@ -16,7 +17,7 @@ interface FormSummaryComponent extends React.ForwardRefExoticComponent<FormSumma
|
|
|
16
17
|
*/
|
|
17
18
|
Heading: typeof FormSummaryHeading;
|
|
18
19
|
/**
|
|
19
|
-
* Link to edit the answers to use in the `FormSummary.
|
|
20
|
+
* Link to edit the answers to use in the `FormSummary.Footer` component. Should link to the relevant part of the form.
|
|
20
21
|
*/
|
|
21
22
|
EditLink: typeof FormSummaryEditLink;
|
|
22
23
|
/**
|
|
@@ -35,6 +36,10 @@ interface FormSummaryComponent extends React.ForwardRefExoticComponent<FormSumma
|
|
|
35
36
|
* Corresponds to the answer in the form. To be used in the `FormSummary.Answer` component.
|
|
36
37
|
*/
|
|
37
38
|
Value: typeof FormSummaryValue;
|
|
39
|
+
/**
|
|
40
|
+
* Footer component for the form summary, if applicable this is a good place for `<FormSummary.EditLink>`.
|
|
41
|
+
*/
|
|
42
|
+
Footer: typeof FormSummaryFooter;
|
|
38
43
|
}
|
|
39
44
|
export interface FormSummaryProps extends HTMLAttributes<HTMLDivElement> {
|
|
40
45
|
/**
|
|
@@ -42,20 +47,7 @@ export interface FormSummaryProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
42
47
|
*
|
|
43
48
|
* - `<FormSummary.Header>`
|
|
44
49
|
* - `<FormSummary.Answers>`
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* <FormSummary>
|
|
48
|
-
* <FormSummary.Header>
|
|
49
|
-
* <FormSummary.Heading level="2">HeadingTekst</FormSummary.Heading>
|
|
50
|
-
* <FormSummary.EditLink href="#" />
|
|
51
|
-
* </FormSummary.Header>
|
|
52
|
-
* <FormSummary.Answers>
|
|
53
|
-
* <FormSummary.Answer>
|
|
54
|
-
* <FormSummary.Label>Navn</FormSummary.Label>
|
|
55
|
-
* <FormSummary.Value>Ola Nordmann</FormSummary.Value>
|
|
56
|
-
* </FormSummary.Answer>
|
|
57
|
-
* </FormSummary.Answers>
|
|
58
|
-
* </FormSummary>
|
|
50
|
+
* - `<FormSummary.Footer>` (optional)
|
|
59
51
|
*/
|
|
60
52
|
children: React.ReactNode;
|
|
61
53
|
}
|
|
@@ -68,7 +60,6 @@ export interface FormSummaryProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
68
60
|
* <FormSummary>
|
|
69
61
|
* <FormSummary.Header>
|
|
70
62
|
* <FormSummary.Heading level="2">HeadingTekst</FormSummary.Heading>
|
|
71
|
-
* <FormSummary.EditLink href="#" />
|
|
72
63
|
* </FormSummary.Header>
|
|
73
64
|
* <FormSummary.Answers>
|
|
74
65
|
* <FormSummary.Answer>
|
|
@@ -76,6 +67,9 @@ export interface FormSummaryProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
76
67
|
* <FormSummary.Value>Ola Nordmann</FormSummary.Value>
|
|
77
68
|
* </FormSummary.Answer>
|
|
78
69
|
* </FormSummary.Answers>
|
|
70
|
+
* <FormSummary.Footer>
|
|
71
|
+
* <FormSummary.EditLink href="#" />
|
|
72
|
+
* </FormSummary.Footer>
|
|
79
73
|
* </FormSummary>
|
|
80
74
|
*/
|
|
81
75
|
export declare const FormSummary: FormSummaryComponent;
|
|
@@ -14,6 +14,7 @@ import { useRenameCSS } from "../../theme/Theme.js";
|
|
|
14
14
|
import FormSummaryAnswer from "./FormSummaryAnswer.js";
|
|
15
15
|
import FormSummaryAnswers from "./FormSummaryAnswers.js";
|
|
16
16
|
import FormSummaryEditLink from "./FormSummaryEditLink.js";
|
|
17
|
+
import FormSummaryFooter from "./FormSummaryFooter.js";
|
|
17
18
|
import FormSummaryHeader from "./FormSummaryHeader.js";
|
|
18
19
|
import FormSummaryHeading from "./FormSummaryHeading.js";
|
|
19
20
|
import FormSummaryLabel from "./FormSummaryLabel.js";
|
|
@@ -27,7 +28,6 @@ import FormSummaryValue from "./FormSummaryValue.js";
|
|
|
27
28
|
* <FormSummary>
|
|
28
29
|
* <FormSummary.Header>
|
|
29
30
|
* <FormSummary.Heading level="2">HeadingTekst</FormSummary.Heading>
|
|
30
|
-
* <FormSummary.EditLink href="#" />
|
|
31
31
|
* </FormSummary.Header>
|
|
32
32
|
* <FormSummary.Answers>
|
|
33
33
|
* <FormSummary.Answer>
|
|
@@ -35,6 +35,9 @@ import FormSummaryValue from "./FormSummaryValue.js";
|
|
|
35
35
|
* <FormSummary.Value>Ola Nordmann</FormSummary.Value>
|
|
36
36
|
* </FormSummary.Answer>
|
|
37
37
|
* </FormSummary.Answers>
|
|
38
|
+
* <FormSummary.Footer>
|
|
39
|
+
* <FormSummary.EditLink href="#" />
|
|
40
|
+
* </FormSummary.Footer>
|
|
38
41
|
* </FormSummary>
|
|
39
42
|
*/
|
|
40
43
|
export const FormSummary = forwardRef((_a, ref) => {
|
|
@@ -49,5 +52,6 @@ FormSummary.Answers = FormSummaryAnswers;
|
|
|
49
52
|
FormSummary.Answer = FormSummaryAnswer;
|
|
50
53
|
FormSummary.Label = FormSummaryLabel;
|
|
51
54
|
FormSummary.Value = FormSummaryValue;
|
|
55
|
+
FormSummary.Footer = FormSummaryFooter;
|
|
52
56
|
export default FormSummary;
|
|
53
57
|
//# sourceMappingURL=FormSummary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSummary.js","sourceRoot":"","sources":["../../../src/form/form-summary/FormSummary.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"FormSummary.js","sourceRoot":"","sources":["../../../src/form/form-summary/FormSummary.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAmDlD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,CAAC,EAAgC,EAAE,GAAG,EAAE,EAAE;QAAzC,EAAE,QAAQ,EAAE,SAAS,OAAW,EAAN,IAAI,cAA9B,yBAAgC,CAAF;IAC7B,MAAM,EAAE,EAAE,EAAE,GAAG,YAAY,EAAE,CAAC;IAE9B,OAAO,CACL,2CAAK,GAAG,EAAE,GAAG,IAAM,IAAI,IAAE,SAAS,EAAE,EAAE,CAAC,oBAAoB,EAAE,SAAS,CAAC,KACpE,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CACsB,CAAC;AAE1B,WAAW,CAAC,MAAM,GAAG,iBAAiB,CAAC;AACvC,WAAW,CAAC,OAAO,GAAG,kBAAkB,CAAC;AACzC,WAAW,CAAC,QAAQ,GAAG,mBAAmB,CAAC;AAC3C,WAAW,CAAC,OAAO,GAAG,kBAAkB,CAAC;AACzC,WAAW,CAAC,MAAM,GAAG,iBAAiB,CAAC;AACvC,WAAW,CAAC,KAAK,GAAG,gBAAgB,CAAC;AACrC,WAAW,CAAC,KAAK,GAAG,gBAAgB,CAAC;AACrC,WAAW,CAAC,MAAM,GAAG,iBAAiB,CAAC;AAEvC,eAAe,WAAW,CAAC"}
|
|
@@ -10,14 +10,19 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import React, { forwardRef } from "react";
|
|
13
|
+
import { PencilIcon } from "@navikt/aksel-icons";
|
|
13
14
|
import { Link } from "../../link/index.js";
|
|
14
15
|
import { useRenameCSS } from "../../theme/Theme.js";
|
|
16
|
+
import { CompositionWarning } from "../../util/composition-warning/index.js";
|
|
15
17
|
import { useI18n } from "../../util/i18n/i18n.hooks.js";
|
|
16
18
|
export const FormSummaryEditLink = forwardRef((_a, ref) => {
|
|
17
19
|
var { children, className, as = "a" } = _a, rest = __rest(_a, ["children", "className", "as"]);
|
|
18
20
|
const { cn } = useRenameCSS();
|
|
19
21
|
const translate = useI18n("FormSummary");
|
|
20
|
-
return (React.createElement(
|
|
22
|
+
return (React.createElement(CompositionWarning.Forbidden, { name: "FormSummary.Header", message: "<FormSummary.EditLink> should not be placed in <FormSummary.Header> anymore. See https://aksel.nav.no/komponenter/core/formsummary" },
|
|
23
|
+
React.createElement(Link, Object.assign({ ref: ref, as: as }, rest, { className: cn("navds-form-summary__edit", className) }),
|
|
24
|
+
React.createElement(PencilIcon, { "aria-hidden": true, fontSize: "1.5rem" }),
|
|
25
|
+
children || translate("editAnswer"))));
|
|
21
26
|
});
|
|
22
27
|
export default FormSummaryEditLink;
|
|
23
28
|
//# sourceMappingURL=FormSummaryEditLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSummaryEditLink.js","sourceRoot":"","sources":["../../../src/form/form-summary/FormSummaryEditLink.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAkBrD,MAAM,CAAC,MAAM,mBAAmB,GAG5B,UAAU,CAAC,CAAC,EAA0C,EAAE,GAAG,EAAE,EAAE;QAAnD,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,GAAG,GAAG,OAAW,EAAN,IAAI,cAAxC,+BA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
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Footer slot for actions in `FormSummary`.
|
|
4
|
+
*/
|
|
5
|
+
export interface FormSummaryFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/**
|
|
7
|
+
* Should include `<FormSummary.EditLink>`.
|
|
8
|
+
*/
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const FormSummaryFooter: React.ForwardRefExoticComponent<FormSummaryFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export default FormSummaryFooter;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { forwardRef } from "react";
|
|
13
|
+
import { useRenameCSS } from "../../theme/Theme.js";
|
|
14
|
+
export const FormSummaryFooter = forwardRef((_a, ref) => {
|
|
15
|
+
var { children, className } = _a, rest = __rest(_a, ["children", "className"]);
|
|
16
|
+
const { cn } = useRenameCSS();
|
|
17
|
+
return (React.createElement("div", Object.assign({ ref: ref, "data-color": "info" }, rest, { className: cn("navds-form-summary__footer", className) }), children));
|
|
18
|
+
});
|
|
19
|
+
export default FormSummaryFooter;
|
|
20
|
+
//# sourceMappingURL=FormSummaryFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormSummaryFooter.js","sourceRoot":"","sources":["../../../src/form/form-summary/FormSummaryFooter.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAajD,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAGzC,CAAC,EAAgC,EAAE,GAAG,EAAE,EAAE;QAAzC,EAAE,QAAQ,EAAE,SAAS,OAAW,EAAN,IAAI,cAA9B,yBAAgC,CAAF;IAC/B,MAAM,EAAE,EAAE,EAAE,GAAG,YAAY,EAAE,CAAC;IAE9B,OAAO,CACL,2CACE,GAAG,EAAE,GAAG,gBACG,MAAM,IACb,IAAI,IACR,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE,SAAS,CAAC,KAErD,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface FormSummaryHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
/**
|
|
4
|
-
* Must include `<FormSummary.Heading
|
|
4
|
+
* Must include `<FormSummary.Heading>`.
|
|
5
5
|
*/
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
}
|