@navikt/ds-react 5.6.0-beta.0 → 5.6.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/_docs.json +1495 -652
- package/cjs/accordion/Accordion.js +1 -0
- package/cjs/accordion/AccordionContext.js +1 -1
- package/cjs/accordion/AccordionHeader.js +2 -2
- package/cjs/accordion/AccordionItem.js +3 -0
- package/cjs/date/datepicker/DatePicker.js +30 -34
- package/cjs/date/datepicker/DatePickerStandalone.js +23 -26
- package/cjs/date/datepicker/parts/Caption.js +28 -0
- package/cjs/date/datepicker/{DayButton.js → parts/DayButton.js} +1 -2
- package/cjs/date/datepicker/{caption → parts}/DropdownCaption.js +13 -7
- package/cjs/date/datepicker/parts/HeadRow.js +36 -0
- package/cjs/date/datepicker/parts/Row.js +23 -0
- package/cjs/date/datepicker/{TableHead.js → parts/TableHead.js} +4 -3
- package/cjs/date/datepicker/parts/WeekNumber.js +35 -0
- package/cjs/date/datepicker/parts/WeekRow.js +34 -0
- package/cjs/date/utils/get-month-weeks.js +46 -0
- package/cjs/date/utils/labels.js +40 -1
- package/cjs/index.js +1 -0
- package/cjs/layout/bleed/Bleed.js +25 -5
- package/cjs/layout/bleed/index.js +1 -4
- package/cjs/layout/box/Box.js +1 -1
- package/cjs/layout/responsive/Responsive.js +8 -6
- package/cjs/layout/utilities/css.js +37 -14
- package/esm/accordion/Accordion.js +1 -0
- package/esm/accordion/Accordion.js.map +1 -1
- package/esm/accordion/AccordionContext.d.ts +1 -0
- package/esm/accordion/AccordionContext.js +1 -1
- package/esm/accordion/AccordionContext.js.map +1 -1
- package/esm/accordion/AccordionHeader.js +2 -2
- package/esm/accordion/AccordionHeader.js.map +1 -1
- package/esm/accordion/AccordionItem.js +3 -0
- package/esm/accordion/AccordionItem.js.map +1 -1
- package/esm/date/datepicker/DatePicker.d.ts +14 -5
- package/esm/date/datepicker/DatePicker.js +29 -33
- package/esm/date/datepicker/DatePicker.js.map +1 -1
- package/esm/date/datepicker/DatePickerStandalone.d.ts +3 -2
- package/esm/date/datepicker/DatePickerStandalone.js +22 -25
- package/esm/date/datepicker/DatePickerStandalone.js.map +1 -1
- package/esm/date/datepicker/{caption → parts}/Caption.d.ts +3 -0
- package/esm/date/datepicker/parts/Caption.js +22 -0
- package/esm/date/datepicker/parts/Caption.js.map +1 -0
- package/esm/date/datepicker/parts/DayButton.d.ts +4 -0
- package/esm/date/datepicker/{DayButton.js → parts/DayButton.js} +2 -1
- package/esm/date/datepicker/parts/DayButton.js.map +1 -0
- package/esm/date/datepicker/{caption → parts}/DropdownCaption.d.ts +3 -0
- package/esm/date/datepicker/parts/DropdownCaption.js +44 -0
- package/esm/date/datepicker/parts/DropdownCaption.js.map +1 -0
- package/esm/date/datepicker/parts/HeadRow.d.ts +11 -0
- package/esm/date/datepicker/parts/HeadRow.js +29 -0
- package/esm/date/datepicker/parts/HeadRow.js.map +1 -0
- package/esm/date/datepicker/parts/Row.d.ts +17 -0
- package/esm/date/datepicker/parts/Row.js +19 -0
- package/esm/date/datepicker/parts/Row.js.map +1 -0
- package/esm/date/datepicker/parts/TableHead.d.ts +6 -0
- package/esm/date/datepicker/{TableHead.js → parts/TableHead.js} +5 -2
- package/esm/date/datepicker/parts/TableHead.js.map +1 -0
- package/esm/date/datepicker/parts/WeekNumber.d.ts +13 -0
- package/esm/date/datepicker/parts/WeekNumber.js +31 -0
- package/esm/date/datepicker/parts/WeekNumber.js.map +1 -0
- package/esm/date/datepicker/parts/WeekRow.d.ts +5 -0
- package/esm/date/datepicker/parts/WeekRow.js +30 -0
- package/esm/date/datepicker/parts/WeekRow.js.map +1 -0
- package/esm/date/utils/get-month-weeks.d.ts +16 -0
- package/esm/date/utils/get-month-weeks.js +42 -0
- package/esm/date/utils/get-month-weeks.js.map +1 -0
- package/esm/date/utils/labels.d.ts +9 -0
- package/esm/date/utils/labels.js +36 -0
- package/esm/date/utils/labels.js.map +1 -1
- package/esm/form/Fieldset/useFieldset.d.ts +1 -1
- package/esm/form/checkbox/useCheckbox.d.ts +1 -1
- package/esm/form/combobox/Combobox.d.ts +1 -1
- package/esm/form/radio/useRadio.d.ts +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/esm/layout/bleed/Bleed.d.ts +46 -7
- package/esm/layout/bleed/Bleed.js +25 -5
- package/esm/layout/bleed/Bleed.js.map +1 -1
- package/esm/layout/bleed/index.d.ts +1 -1
- package/esm/layout/bleed/index.js +1 -1
- package/esm/layout/bleed/index.js.map +1 -1
- package/esm/layout/box/Box.js +1 -1
- package/esm/layout/box/Box.js.map +1 -1
- package/esm/layout/responsive/Responsive.d.ts +8 -4
- package/esm/layout/responsive/Responsive.js +8 -6
- package/esm/layout/responsive/Responsive.js.map +1 -1
- package/esm/layout/utilities/css.d.ts +1 -1
- package/esm/layout/utilities/css.js +37 -14
- package/esm/layout/utilities/css.js.map +1 -1
- package/package.json +5 -4
- package/src/accordion/Accordion.tsx +1 -0
- package/src/accordion/AccordionContext.tsx +2 -1
- package/src/accordion/AccordionHeader.tsx +2 -2
- package/src/accordion/AccordionItem.tsx +4 -0
- package/src/date/datepicker/DatePicker.tsx +63 -58
- package/src/date/datepicker/DatePickerStandalone.tsx +36 -37
- package/src/date/datepicker/datepicker.stories.tsx +66 -1
- package/src/date/datepicker/{caption → parts}/Caption.tsx +19 -17
- package/src/date/datepicker/{DayButton.tsx → parts/DayButton.tsx} +3 -1
- package/src/date/datepicker/parts/DropdownCaption.tsx +113 -0
- package/src/date/datepicker/parts/HeadRow.tsx +56 -0
- package/src/date/datepicker/parts/Row.tsx +47 -0
- package/src/date/datepicker/{TableHead.tsx → parts/TableHead.tsx} +6 -2
- package/src/date/datepicker/parts/WeekNumber.tsx +79 -0
- package/src/date/datepicker/parts/WeekRow.tsx +60 -0
- package/src/date/utils/__tests__/get-month-weeks.test.ts +113 -0
- package/src/date/utils/get-month-weeks.ts +93 -0
- package/src/date/utils/labels.ts +51 -0
- package/src/index.ts +1 -0
- package/src/layout/bleed/Bleed.stories.tsx +381 -0
- package/src/layout/bleed/Bleed.tsx +130 -0
- package/src/layout/bleed/index.ts +1 -0
- package/src/layout/box/Box.tsx +1 -0
- package/src/layout/responsive/Responsive.tsx +21 -6
- package/src/layout/responsive/hide.stories.tsx +35 -0
- package/src/layout/responsive/show.stories.tsx +35 -0
- package/src/layout/utilities/css.ts +59 -19
- package/cjs/date/datepicker/caption/Caption.js +0 -23
- package/cjs/date/datepicker/caption/index.js +0 -10
- package/cjs/date/datepicker/caption/package.json +0 -6
- package/cjs/layout/content-box/ContentBox.js +0 -56
- package/cjs/layout/content-box/index.js +0 -8
- package/cjs/layout/content-box/package.json +0 -6
- package/cjs/layout/page-demo/AvatarPanel.js +0 -18
- package/cjs/layout/page-demo/Filter.js +0 -21
- package/cjs/layout/page-demo/Header.js +0 -48
- package/cjs/layout/page-demo/Intro.js +0 -36
- package/cjs/layout/page-demo/Sidebar.js +0 -49
- package/esm/date/datepicker/DayButton.d.ts +0 -3
- package/esm/date/datepicker/DayButton.js.map +0 -1
- package/esm/date/datepicker/TableHead.d.ts +0 -3
- package/esm/date/datepicker/TableHead.js.map +0 -1
- package/esm/date/datepicker/caption/Caption.js +0 -17
- package/esm/date/datepicker/caption/Caption.js.map +0 -1
- package/esm/date/datepicker/caption/DropdownCaption.js +0 -38
- package/esm/date/datepicker/caption/DropdownCaption.js.map +0 -1
- package/esm/date/datepicker/caption/index.d.ts +0 -2
- package/esm/date/datepicker/caption/index.js +0 -3
- package/esm/date/datepicker/caption/index.js.map +0 -1
- package/esm/layout/content-box/ContentBox.d.ts +0 -8
- package/esm/layout/content-box/ContentBox.js +0 -28
- package/esm/layout/content-box/ContentBox.js.map +0 -1
- package/esm/layout/content-box/index.d.ts +0 -1
- package/esm/layout/content-box/index.js +0 -2
- package/esm/layout/content-box/index.js.map +0 -1
- package/esm/layout/page-demo/AvatarPanel.d.ts +0 -4
- package/esm/layout/page-demo/AvatarPanel.js +0 -12
- package/esm/layout/page-demo/AvatarPanel.js.map +0 -1
- package/esm/layout/page-demo/Filter.d.ts +0 -2
- package/esm/layout/page-demo/Filter.js +0 -15
- package/esm/layout/page-demo/Filter.js.map +0 -1
- package/esm/layout/page-demo/Header.d.ts +0 -2
- package/esm/layout/page-demo/Header.js +0 -42
- package/esm/layout/page-demo/Header.js.map +0 -1
- package/esm/layout/page-demo/Intro.d.ts +0 -2
- package/esm/layout/page-demo/Intro.js +0 -30
- package/esm/layout/page-demo/Intro.js.map +0 -1
- package/esm/layout/page-demo/Sidebar.d.ts +0 -4
- package/esm/layout/page-demo/Sidebar.js +0 -41
- package/esm/layout/page-demo/Sidebar.js.map +0 -1
- package/src/date/datepicker/caption/DropdownCaption.tsx +0 -108
- package/src/date/datepicker/caption/index.ts +0 -2
|
@@ -11,11 +11,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef } from "react";
|
|
14
|
+
import { Slot } from "../../util/Slot";
|
|
14
15
|
const Responsive = forwardRef((_a, ref) => {
|
|
15
|
-
var { as: Component = "div", className, above, below, variant } = _a, rest = __rest(_a, ["as", "className", "above", "below", "variant"]);
|
|
16
|
+
var { as: Component = "div", className, above, below, variant, asChild } = _a, rest = __rest(_a, ["as", "className", "above", "below", "variant", "asChild"]);
|
|
16
17
|
const aboveProp = variant === "show" ? above : below;
|
|
17
18
|
const belowProp = variant === "show" ? below : above;
|
|
18
|
-
|
|
19
|
+
const Comp = asChild ? Slot : Component;
|
|
20
|
+
return (React.createElement(Comp, Object.assign({}, rest, { ref: ref, className: cl("navds-responsive", className, {
|
|
19
21
|
[`navds-responsive__above--${aboveProp}`]: aboveProp,
|
|
20
22
|
[`navds-responsive__below--${belowProp}`]: belowProp,
|
|
21
23
|
}) })));
|
|
@@ -29,14 +31,14 @@ const Responsive = forwardRef((_a, ref) => {
|
|
|
29
31
|
* @example
|
|
30
32
|
* <HGrid columns={{ xs: 1, md: 2 }} gap="4">
|
|
31
33
|
* <div/>
|
|
32
|
-
* <Hide below="md">
|
|
34
|
+
* <Hide below="md" asChild>
|
|
33
35
|
* // Only visible above "md"
|
|
34
36
|
* </Hide>
|
|
35
37
|
* </HGrid>
|
|
36
38
|
* @example
|
|
37
39
|
* <HGrid columns={{ xs: 1, md: 2 }} gap="4">
|
|
38
40
|
* <div/>
|
|
39
|
-
* <Hide above="md">
|
|
41
|
+
* <Hide above="md" asChild>
|
|
40
42
|
* // Only visible below "md"
|
|
41
43
|
* </Hide>
|
|
42
44
|
* </HGrid>
|
|
@@ -51,14 +53,14 @@ export const Hide = forwardRef((props, ref) => React.createElement(Responsive, O
|
|
|
51
53
|
* @example
|
|
52
54
|
* <HGrid columns={{ xs: 1, md: 2 }} gap="4">
|
|
53
55
|
* <div/>
|
|
54
|
-
* <Show below="md">
|
|
56
|
+
* <Show below="md" asChild>
|
|
55
57
|
* // Only visible below "md"
|
|
56
58
|
* </Show>
|
|
57
59
|
* </HGrid>
|
|
58
60
|
* @example
|
|
59
61
|
* <HGrid columns={{ xs: 1, md: 2 }} gap="4">
|
|
60
62
|
* <div/>
|
|
61
|
-
* <Show above="md">
|
|
63
|
+
* <Show above="md" asChild>
|
|
62
64
|
* // Only visible above "md"
|
|
63
65
|
* </Show>
|
|
64
66
|
* </HGrid>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Responsive.js","sourceRoot":"","sources":["../../../src/layout/responsive/Responsive.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Responsive.js","sourceRoot":"","sources":["../../../src/layout/responsive/Responsive.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAE,UAAU,EAAk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,EAAC,MAAM,IAAG,CACnE,CAAC"}
|
|
@@ -8,7 +8,7 @@ export type ResponsiveProp<T> = T | FixedResponsiveT<T>;
|
|
|
8
8
|
export declare function getResponsiveValue<T = string>(componentName: string, componentProp: string, responsiveProp?: ResponsiveProp<T>): {
|
|
9
9
|
[k: string]: T;
|
|
10
10
|
};
|
|
11
|
-
export declare function getResponsiveProps<T extends string>(componentName: string, componentProp: string, tokenSubgroup: string, responsiveProp?: ResponsiveProp<T>, tokenExceptions?: string[]): {
|
|
11
|
+
export declare function getResponsiveProps<T extends string>(componentName: string, componentProp: string, tokenSubgroup: string, responsiveProp?: ResponsiveProp<T>, invert?: boolean, tokenExceptions?: string[]): {
|
|
12
12
|
[x: string]: string;
|
|
13
13
|
};
|
|
14
14
|
export {};
|
|
@@ -12,26 +12,49 @@ export function getResponsiveValue(componentName, componentProp, responsiveProp)
|
|
|
12
12
|
responsiveValue,
|
|
13
13
|
]));
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
const translateExceptionToCSS = (exception) => {
|
|
16
|
+
switch (exception) {
|
|
17
|
+
case "px":
|
|
18
|
+
return "1px";
|
|
19
|
+
}
|
|
20
|
+
return exception;
|
|
21
|
+
};
|
|
22
|
+
const translateTokenStringToCSS = (componentProp, tokenString, tokenSubgroup, tokenExceptions, invert) => {
|
|
23
|
+
return tokenString
|
|
24
|
+
.split(" ")
|
|
25
|
+
.map((x, _, arr) => {
|
|
26
|
+
if (componentProp === "margin-inline" && x === "full") {
|
|
27
|
+
const width = 100 / arr.length;
|
|
28
|
+
return `calc((100vw - ${width}%)/-2)`;
|
|
29
|
+
}
|
|
30
|
+
let output = `var(--a-${tokenSubgroup}-${x})`;
|
|
31
|
+
if (tokenExceptions.includes(x)) {
|
|
32
|
+
output = translateExceptionToCSS(x);
|
|
33
|
+
}
|
|
34
|
+
if (invert) {
|
|
35
|
+
if (x === "0") {
|
|
36
|
+
return `0`;
|
|
37
|
+
}
|
|
38
|
+
return `calc(-1 * ${output})`;
|
|
39
|
+
}
|
|
40
|
+
return output;
|
|
41
|
+
})
|
|
42
|
+
.join(" ");
|
|
43
|
+
};
|
|
44
|
+
export function getResponsiveProps(componentName, componentProp, tokenSubgroup, responsiveProp, invert = false, tokenExceptions = []) {
|
|
16
45
|
if (!responsiveProp) {
|
|
17
46
|
return {};
|
|
18
47
|
}
|
|
19
48
|
if (typeof responsiveProp === "string") {
|
|
20
49
|
return {
|
|
21
|
-
[`--__ac-${componentName}-${componentProp}-xs`]: responsiveProp
|
|
22
|
-
.split(" ")
|
|
23
|
-
.map((x) => tokenExceptions.includes(x) ? x : `var(--a-${tokenSubgroup}-${x})`)
|
|
24
|
-
.join(" "),
|
|
50
|
+
[`--__ac-${componentName}-${componentProp}-xs`]: translateTokenStringToCSS(componentProp, responsiveProp, tokenSubgroup, tokenExceptions, invert),
|
|
25
51
|
};
|
|
26
52
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
aliasOrScale
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
.join(" "),
|
|
34
|
-
];
|
|
35
|
-
}));
|
|
53
|
+
const styleProps = {};
|
|
54
|
+
Object.entries(responsiveProp).forEach(([breakpointAlias, aliasOrScale]) => {
|
|
55
|
+
styleProps[`--__ac-${componentName}-${componentProp}-${breakpointAlias}`] =
|
|
56
|
+
translateTokenStringToCSS(componentProp, aliasOrScale, tokenSubgroup, tokenExceptions, invert);
|
|
57
|
+
});
|
|
58
|
+
return styleProps;
|
|
36
59
|
}
|
|
37
60
|
//# sourceMappingURL=css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","sourceRoot":"","sources":["../../../src/layout/utilities/css.ts"],"names":[],"mappings":"AAoCA,MAAM,UAAU,kBAAkB,CAChC,aAAqB,EACrB,aAAqB,EACrB,cAAkC;IAElC,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,EAAE,CAAC;KACX;IAED,IAAI,OAAO,cAAc,KAAK,QAAQ,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B,aAAa,EACb,YAAY,EACZ,aAAa,EACb,eAAe,EACf,MAAM,CACP,CAAC;IACN,CAAC,CAAC,CAAC;IACH,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/ds-react",
|
|
3
|
-
"version": "5.6.0
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"description": "Aksel react-components for NAV designsystem",
|
|
5
5
|
"author": "Aksel | NAV designsystem team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"module": "./esm/index.js",
|
|
19
19
|
"typings": "./esm/index.d.ts",
|
|
20
20
|
"publishConfig": {
|
|
21
|
-
"access": "public"
|
|
21
|
+
"access": "public",
|
|
22
|
+
"provenance": true
|
|
22
23
|
},
|
|
23
24
|
"files": [
|
|
24
25
|
"/cjs",
|
|
@@ -37,8 +38,8 @@
|
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
40
|
"@floating-ui/react": "0.25.4",
|
|
40
|
-
"@navikt/aksel-icons": "^5.
|
|
41
|
-
"@navikt/ds-tokens": "^5.
|
|
41
|
+
"@navikt/aksel-icons": "^5.6.0",
|
|
42
|
+
"@navikt/ds-tokens": "^5.6.0",
|
|
42
43
|
"@radix-ui/react-tabs": "1.0.0",
|
|
43
44
|
"@radix-ui/react-toggle-group": "1.0.0",
|
|
44
45
|
"clsx": "^1.2.1",
|
|
@@ -5,11 +5,12 @@ export type AccordionContextProps = {
|
|
|
5
5
|
headingSize?: "large" | "medium" | "small" | "xsmall";
|
|
6
6
|
size?: "large" | "medium" | "small";
|
|
7
7
|
openItems?: number[];
|
|
8
|
+
mounted: boolean;
|
|
8
9
|
};
|
|
9
10
|
|
|
10
11
|
export const AccordionContext = createContext<AccordionContextProps | null>({
|
|
11
|
-
variant: "default",
|
|
12
12
|
headingSize: "small",
|
|
13
13
|
size: "medium",
|
|
14
14
|
openItems: [],
|
|
15
|
+
mounted: false,
|
|
15
16
|
});
|
|
@@ -18,7 +18,7 @@ const AccordionHeader = forwardRef<HTMLButtonElement, AccordionHeaderProps>(
|
|
|
18
18
|
const itemContext = useContext(AccordionItemContext);
|
|
19
19
|
const accordionContext = useContext(AccordionContext);
|
|
20
20
|
|
|
21
|
-
if (
|
|
21
|
+
if (itemContext === null) {
|
|
22
22
|
console.error(
|
|
23
23
|
"<Accordion.Header> has to be used within an <Accordion.Item>, which in turn must be within an <Accordion>"
|
|
24
24
|
);
|
|
@@ -45,7 +45,7 @@ const AccordionHeader = forwardRef<HTMLButtonElement, AccordionHeaderProps>(
|
|
|
45
45
|
/>
|
|
46
46
|
</div>
|
|
47
47
|
<Heading
|
|
48
|
-
size={accordionContext
|
|
48
|
+
size={accordionContext?.headingSize ?? "small"}
|
|
49
49
|
as="span"
|
|
50
50
|
className="navds-accordion__header-content"
|
|
51
51
|
>
|
|
@@ -54,6 +54,10 @@ const AccordionItem = forwardRef<HTMLDivElement, AccordionItemProps>(
|
|
|
54
54
|
shouldAnimate.current = true;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
if (!context?.mounted) {
|
|
58
|
+
console.error("<Accordion.Item> has to be used within an <Accordion>");
|
|
59
|
+
}
|
|
60
|
+
|
|
57
61
|
return (
|
|
58
62
|
<div
|
|
59
63
|
className={cl("navds-accordion__item", className, {
|
|
@@ -5,46 +5,56 @@ import {
|
|
|
5
5
|
DateRange,
|
|
6
6
|
DayPicker,
|
|
7
7
|
DayPickerBase,
|
|
8
|
-
isMatch,
|
|
9
8
|
Matcher,
|
|
10
|
-
|
|
11
|
-
SelectRangeEventHandler,
|
|
12
|
-
SelectSingleEventHandler,
|
|
9
|
+
isMatch,
|
|
13
10
|
} from "react-day-picker";
|
|
14
|
-
import {
|
|
11
|
+
import { Popover, omit, useId } from "../..";
|
|
15
12
|
import { DateInputProps, DatePickerInput } from "../DateInput";
|
|
16
13
|
import { DateContext } from "../context";
|
|
17
14
|
import { getLocaleFromString, labels } from "../utils";
|
|
18
|
-
import { Caption, DropdownCaption } from "./caption";
|
|
19
15
|
import DatePickerStandalone, {
|
|
20
16
|
DatePickerStandaloneType,
|
|
21
17
|
} from "./DatePickerStandalone";
|
|
22
|
-
import
|
|
23
|
-
import
|
|
18
|
+
import Caption from "./parts/Caption";
|
|
19
|
+
import DayButton from "./parts/DayButton";
|
|
20
|
+
import DropdownCaption from "./parts/DropdownCaption";
|
|
21
|
+
import { HeadRow } from "./parts/HeadRow";
|
|
22
|
+
import Row from "./parts/Row";
|
|
23
|
+
import TableHead from "./parts/TableHead";
|
|
24
|
+
import WeekNumber from "./parts/WeekNumber";
|
|
24
25
|
|
|
25
|
-
export type
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
export type SingleMode = {
|
|
27
|
+
mode?: "single";
|
|
28
|
+
onSelect?: (val?: Date) => void;
|
|
29
|
+
selected?: Date;
|
|
30
|
+
defaultSelected?: Date;
|
|
31
|
+
onWeekNumberClick?: never;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type MultipleMode = {
|
|
35
|
+
mode: "multiple";
|
|
36
|
+
onSelect?: (val?: Date[]) => void;
|
|
37
|
+
selected?: Date[];
|
|
38
|
+
defaultSelected?: Date[];
|
|
39
|
+
min?: number;
|
|
40
|
+
max?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Allows selecting a week at a time. Only used with mode="multiple".
|
|
43
|
+
*/
|
|
44
|
+
onWeekNumberClick?: DayPickerBase["onWeekNumberClick"];
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type RangeMode = {
|
|
48
|
+
mode: "range";
|
|
49
|
+
onSelect?: (val?: DateRange) => void;
|
|
50
|
+
selected?: DateRange;
|
|
51
|
+
defaultSelected?: DateRange;
|
|
52
|
+
min?: number;
|
|
53
|
+
max?: number;
|
|
54
|
+
onWeekNumberClick?: never;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
type ConditionalModeProps = SingleMode | MultipleMode | RangeMode;
|
|
48
58
|
|
|
49
59
|
//github.com/gpbl/react-day-picker/blob/50b6dba/packages/react-day-picker/src/types/DayPickerBase.ts#L139
|
|
50
60
|
export interface DatePickerDefaultProps
|
|
@@ -186,6 +196,7 @@ export const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(
|
|
|
186
196
|
onOpenToggle,
|
|
187
197
|
strategy,
|
|
188
198
|
bubbleEscape = false,
|
|
199
|
+
onWeekNumberClick,
|
|
189
200
|
...rest
|
|
190
201
|
},
|
|
191
202
|
ref
|
|
@@ -199,33 +210,20 @@ export const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(
|
|
|
199
210
|
Date | Date[] | DateRange | undefined
|
|
200
211
|
>(defaultSelected);
|
|
201
212
|
|
|
202
|
-
const
|
|
203
|
-
setSelectedDates(selectedDay);
|
|
204
|
-
selectedDay && (onClose?.() ?? setOpen(false));
|
|
205
|
-
rest?.onSelect && (rest?.onSelect as (val?: Date) => void)(selectedDay);
|
|
206
|
-
};
|
|
213
|
+
const mode = rest.mode ?? ("single" as any);
|
|
207
214
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
215
|
+
/**
|
|
216
|
+
* @param selected Date | Date[] | DateRange | undefined
|
|
217
|
+
*/
|
|
218
|
+
const handleSelect = (selected) => {
|
|
219
|
+
setSelectedDates(selected);
|
|
213
220
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
const overrideProps = {
|
|
222
|
-
mode: rest.mode ?? ("single" as any),
|
|
223
|
-
onSelect:
|
|
224
|
-
rest?.mode === "single"
|
|
225
|
-
? handleSingleSelect
|
|
226
|
-
: rest?.mode === "multiple"
|
|
227
|
-
? handleMultipleSelect
|
|
228
|
-
: handleRangeSelect,
|
|
221
|
+
if (rest.mode === "single") {
|
|
222
|
+
selected && (onClose?.() ?? setOpen(false));
|
|
223
|
+
} else if (rest.mode === "range") {
|
|
224
|
+
selected?.from && selected?.to && (onClose?.() ?? setOpen(false));
|
|
225
|
+
}
|
|
226
|
+
rest?.onSelect?.(selected);
|
|
229
227
|
};
|
|
230
228
|
|
|
231
229
|
return (
|
|
@@ -262,12 +260,16 @@ export const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(
|
|
|
262
260
|
>
|
|
263
261
|
<DayPicker
|
|
264
262
|
locale={getLocaleFromString(locale)}
|
|
265
|
-
{
|
|
263
|
+
mode={mode}
|
|
264
|
+
onSelect={handleSelect}
|
|
266
265
|
selected={selected ?? selectedDates}
|
|
267
266
|
components={{
|
|
268
267
|
Caption: dropdownCaption ? DropdownCaption : Caption,
|
|
269
|
-
Day: DayButton,
|
|
270
268
|
Head: TableHead,
|
|
269
|
+
HeadRow,
|
|
270
|
+
WeekNumber,
|
|
271
|
+
Row,
|
|
272
|
+
Day: DayButton,
|
|
271
273
|
}}
|
|
272
274
|
className={cl("navds-date", className)}
|
|
273
275
|
classNames={{
|
|
@@ -289,6 +291,9 @@ export const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(
|
|
|
289
291
|
weekend: "rdp-day__weekend",
|
|
290
292
|
}}
|
|
291
293
|
showWeekNumber={showWeekNumber}
|
|
294
|
+
onWeekNumberClick={
|
|
295
|
+
mode === "multiple" ? onWeekNumberClick : undefined
|
|
296
|
+
}
|
|
292
297
|
fixedWeeks
|
|
293
298
|
showOutsideDays
|
|
294
299
|
{...omit(rest, ["onSelect"])}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import isWeekend from "date-fns/isWeekend";
|
|
3
3
|
import React, { forwardRef } from "react";
|
|
4
|
-
import {
|
|
5
|
-
DateRange,
|
|
6
|
-
DayPicker,
|
|
7
|
-
isMatch,
|
|
8
|
-
SelectMultipleEventHandler,
|
|
9
|
-
SelectRangeEventHandler,
|
|
10
|
-
SelectSingleEventHandler,
|
|
11
|
-
} from "react-day-picker";
|
|
4
|
+
import { DateRange, DayPicker, isMatch } from "react-day-picker";
|
|
12
5
|
import { omit } from "../..";
|
|
13
6
|
import { getLocaleFromString, labels } from "../utils";
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
import {
|
|
8
|
+
DatePickerDefaultProps,
|
|
9
|
+
MultipleMode,
|
|
10
|
+
RangeMode,
|
|
11
|
+
SingleMode,
|
|
12
|
+
} from "./DatePicker";
|
|
13
|
+
import TableHead from "./parts/TableHead";
|
|
14
|
+
import WeekNumber from "./parts/WeekNumber";
|
|
15
|
+
import Caption from "./parts/Caption";
|
|
16
|
+
import DropdownCaption from "./parts/DropdownCaption";
|
|
17
|
+
import Row from "./parts/Row";
|
|
18
|
+
import { HeadRow } from "./parts/HeadRow";
|
|
19
|
+
import DayButton from "./parts/DayButton";
|
|
17
20
|
|
|
18
21
|
interface DatePickerStandaloneDefaultProps
|
|
19
22
|
extends Omit<
|
|
@@ -31,8 +34,10 @@ interface DatePickerStandaloneDefaultProps
|
|
|
31
34
|
fixedWeeks?: boolean;
|
|
32
35
|
}
|
|
33
36
|
|
|
37
|
+
type StandaloneConditionalModeProps = SingleMode | MultipleMode | RangeMode;
|
|
38
|
+
|
|
34
39
|
export type DatePickerStandaloneProps = DatePickerStandaloneDefaultProps &
|
|
35
|
-
|
|
40
|
+
StandaloneConditionalModeProps;
|
|
36
41
|
|
|
37
42
|
export type DatePickerStandaloneType = React.ForwardRefExoticComponent<
|
|
38
43
|
DatePickerStandaloneProps & React.RefAttributes<HTMLDivElement>
|
|
@@ -53,7 +58,8 @@ export const DatePickerStandalone: DatePickerStandaloneType = forwardRef<
|
|
|
53
58
|
selected,
|
|
54
59
|
defaultSelected,
|
|
55
60
|
onSelect,
|
|
56
|
-
fixedWeeks =
|
|
61
|
+
fixedWeeks = false,
|
|
62
|
+
onWeekNumberClick,
|
|
57
63
|
...rest
|
|
58
64
|
},
|
|
59
65
|
ref
|
|
@@ -62,29 +68,14 @@ export const DatePickerStandalone: DatePickerStandaloneType = forwardRef<
|
|
|
62
68
|
Date | Date[] | DateRange | undefined
|
|
63
69
|
>(defaultSelected);
|
|
64
70
|
|
|
65
|
-
const
|
|
66
|
-
setSelectedDates(selectedDay);
|
|
67
|
-
onSelect && (onSelect as (val?: Date) => void)(selectedDay);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const handleMultipleSelect: SelectMultipleEventHandler = (selectedDays) => {
|
|
71
|
-
setSelectedDates(selectedDays);
|
|
72
|
-
onSelect && (onSelect as (val?: Date[]) => void)(selectedDays);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const handleRangeSelect: SelectRangeEventHandler = (selectedDays) => {
|
|
76
|
-
setSelectedDates(selectedDays);
|
|
77
|
-
onSelect && (onSelect as (val?: DateRange) => void)(selectedDays);
|
|
78
|
-
};
|
|
71
|
+
const mode = rest.mode ?? ("single" as any);
|
|
79
72
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
? handleMultipleSelect
|
|
87
|
-
: handleRangeSelect,
|
|
73
|
+
/**
|
|
74
|
+
* @param selected Date | Date[] | DateRange | undefined
|
|
75
|
+
*/
|
|
76
|
+
const handleSelect = (selected) => {
|
|
77
|
+
setSelectedDates(selected);
|
|
78
|
+
onSelect?.(selected);
|
|
88
79
|
};
|
|
89
80
|
|
|
90
81
|
return (
|
|
@@ -94,11 +85,16 @@ export const DatePickerStandalone: DatePickerStandaloneType = forwardRef<
|
|
|
94
85
|
>
|
|
95
86
|
<DayPicker
|
|
96
87
|
locale={getLocaleFromString(locale)}
|
|
97
|
-
{
|
|
88
|
+
mode={mode}
|
|
89
|
+
onSelect={handleSelect}
|
|
98
90
|
selected={selected ?? selectedDates}
|
|
99
91
|
components={{
|
|
100
92
|
Caption: dropdownCaption ? DropdownCaption : Caption,
|
|
101
93
|
Head: TableHead,
|
|
94
|
+
HeadRow,
|
|
95
|
+
WeekNumber,
|
|
96
|
+
Row,
|
|
97
|
+
Day: DayButton,
|
|
102
98
|
}}
|
|
103
99
|
className="navds-date"
|
|
104
100
|
classNames={{ vhidden: "navds-sr-only" }}
|
|
@@ -117,9 +113,12 @@ export const DatePickerStandalone: DatePickerStandaloneType = forwardRef<
|
|
|
117
113
|
weekend: "rdp-day__weekend",
|
|
118
114
|
}}
|
|
119
115
|
showWeekNumber={showWeekNumber}
|
|
116
|
+
onWeekNumberClick={
|
|
117
|
+
mode === "multiple" ? onWeekNumberClick : undefined
|
|
118
|
+
}
|
|
120
119
|
fixedWeeks={fixedWeeks}
|
|
121
120
|
showOutsideDays
|
|
122
|
-
{...omit(rest, ["
|
|
121
|
+
{...omit(rest, ["children", "id"])}
|
|
123
122
|
/>
|
|
124
123
|
</div>
|
|
125
124
|
);
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react";
|
|
3
3
|
import React, { useId, useState } from "react";
|
|
4
4
|
import { useDatepicker, useRangeDatepicker } from "..";
|
|
5
|
-
import { Button } from "../..";
|
|
5
|
+
import { Button, HGrid, VStack } from "../..";
|
|
6
6
|
import DatePicker, { DatePickerProps } from "./DatePicker";
|
|
7
|
+
import isSameDay from "date-fns/isSameDay";
|
|
7
8
|
|
|
8
9
|
const disabledDays = [
|
|
9
10
|
new Date("Oct 10 2022"),
|
|
@@ -367,3 +368,67 @@ export const Readonly = () => {
|
|
|
367
368
|
</div>
|
|
368
369
|
);
|
|
369
370
|
};
|
|
371
|
+
|
|
372
|
+
export const StandaloneOptions = () => {
|
|
373
|
+
return (
|
|
374
|
+
<HGrid columns={{ xs: 1, md: 2 }} gap="8">
|
|
375
|
+
<DatePicker.Standalone today={new Date("Nov 23 2022")} />
|
|
376
|
+
<DatePicker.Standalone
|
|
377
|
+
dropdownCaption
|
|
378
|
+
fromDate={new Date("Aug 23 2019")}
|
|
379
|
+
toDate={new Date("Feb 23 2024")}
|
|
380
|
+
today={new Date("Nov 23 2022")}
|
|
381
|
+
/>
|
|
382
|
+
<DatePicker.Standalone showWeekNumber today={new Date("Nov 23 2022")} />
|
|
383
|
+
<DatePicker.Standalone
|
|
384
|
+
showWeekNumber
|
|
385
|
+
mode="multiple"
|
|
386
|
+
onWeekNumberClick={console.log}
|
|
387
|
+
today={new Date("Nov 23 2022")}
|
|
388
|
+
disableWeekends
|
|
389
|
+
/>
|
|
390
|
+
<DatePicker.Standalone
|
|
391
|
+
mode="range"
|
|
392
|
+
today={new Date("Nov 23 2022")}
|
|
393
|
+
disableWeekends
|
|
394
|
+
/>
|
|
395
|
+
</HGrid>
|
|
396
|
+
);
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
export const WeekDayClick = () => {
|
|
400
|
+
const [days, setDays] = useState<Date[]>([]);
|
|
401
|
+
|
|
402
|
+
const handleWeekClick = (dates: Date[]) => {
|
|
403
|
+
const hasDayInWeek = !!days.find((x) => dates.find((y) => isSameDay(x, y)));
|
|
404
|
+
|
|
405
|
+
const cleanup = days.filter((y) => !dates.find((z) => isSameDay(y, z)));
|
|
406
|
+
if (hasDayInWeek) {
|
|
407
|
+
setDays(cleanup);
|
|
408
|
+
} else {
|
|
409
|
+
setDays([...dates, ...cleanup]);
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
return (
|
|
414
|
+
<VStack gap="8">
|
|
415
|
+
<DatePicker.Standalone
|
|
416
|
+
showWeekNumber
|
|
417
|
+
mode="multiple"
|
|
418
|
+
onWeekNumberClick={(_, dates) => handleWeekClick(dates)}
|
|
419
|
+
onSelect={(dates) => dates && setDays(dates)}
|
|
420
|
+
selected={days}
|
|
421
|
+
today={new Date("Nov 23 2022")}
|
|
422
|
+
/>
|
|
423
|
+
<DatePicker.Standalone
|
|
424
|
+
showWeekNumber
|
|
425
|
+
mode="multiple"
|
|
426
|
+
onWeekNumberClick={(_, dates) => handleWeekClick(dates)}
|
|
427
|
+
onSelect={(dates) => dates && setDays(dates)}
|
|
428
|
+
selected={days}
|
|
429
|
+
today={new Date("Nov 23 2022")}
|
|
430
|
+
disableWeekends
|
|
431
|
+
/>
|
|
432
|
+
</VStack>
|
|
433
|
+
);
|
|
434
|
+
};
|