@navikt/ds-react 7.8.0 → 7.8.1
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/form/combobox/ComboboxWrapper.js +0 -1
- package/cjs/form/combobox/ComboboxWrapper.js.map +1 -1
- package/cjs/form/combobox/Input/Input.js +9 -9
- package/cjs/form/combobox/Input/Input.js.map +1 -1
- package/cjs/form/combobox/Input/InputController.js +8 -2
- package/cjs/form/combobox/Input/InputController.js.map +1 -1
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js +5 -0
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
- package/cjs/form/search/Search.d.ts +1 -1
- package/cjs/form/search/Search.js +1 -1
- package/cjs/layout/box/Box.d.ts +3 -2
- package/cjs/layout/box/Box.darkside.d.ts +10 -6
- package/cjs/layout/box/Box.darkside.js.map +1 -1
- package/cjs/layout/box/Box.js.map +1 -1
- package/cjs/layout/utilities/types.d.ts +7 -23
- package/cjs/tag/Tag.d.ts +1 -1
- package/cjs/tag/Tag.js +4 -1
- package/cjs/tag/Tag.js.map +1 -1
- package/cjs/timeline/Pin.js +5 -2
- package/cjs/timeline/Pin.js.map +1 -1
- package/cjs/timeline/hooks/useTimelineRows.d.ts +5 -1
- package/cjs/timeline/hooks/useTimelineRows.js +14 -3
- package/cjs/timeline/hooks/useTimelineRows.js.map +1 -1
- package/cjs/timeline/period/ClickablePeriod.js +5 -2
- package/cjs/timeline/period/ClickablePeriod.js.map +1 -1
- package/cjs/tooltip/Tooltip.js +6 -3
- package/cjs/tooltip/Tooltip.js.map +1 -1
- package/esm/form/combobox/ComboboxWrapper.js +0 -1
- package/esm/form/combobox/ComboboxWrapper.js.map +1 -1
- package/esm/form/combobox/Input/Input.js +9 -9
- package/esm/form/combobox/Input/Input.js.map +1 -1
- package/esm/form/combobox/Input/InputController.js +8 -2
- package/esm/form/combobox/Input/InputController.js.map +1 -1
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js +5 -0
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
- package/esm/form/search/Search.d.ts +1 -1
- package/esm/form/search/Search.js +1 -1
- package/esm/layout/box/Box.d.ts +3 -2
- package/esm/layout/box/Box.darkside.d.ts +10 -6
- package/esm/layout/box/Box.darkside.js.map +1 -1
- package/esm/layout/box/Box.js.map +1 -1
- package/esm/layout/utilities/types.d.ts +7 -23
- package/esm/tag/Tag.d.ts +1 -1
- package/esm/tag/Tag.js +4 -1
- package/esm/tag/Tag.js.map +1 -1
- package/esm/timeline/Pin.js +5 -2
- package/esm/timeline/Pin.js.map +1 -1
- package/esm/timeline/hooks/useTimelineRows.d.ts +5 -1
- package/esm/timeline/hooks/useTimelineRows.js +14 -3
- package/esm/timeline/hooks/useTimelineRows.js.map +1 -1
- package/esm/timeline/period/ClickablePeriod.js +5 -2
- package/esm/timeline/period/ClickablePeriod.js.map +1 -1
- package/esm/tooltip/Tooltip.js +6 -3
- package/esm/tooltip/Tooltip.js.map +1 -1
- package/package.json +4 -4
- package/src/form/combobox/ComboboxWrapper.tsx +0 -1
- package/src/form/combobox/Input/Input.tsx +9 -9
- package/src/form/combobox/Input/InputController.tsx +10 -2
- package/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx +4 -0
- package/src/form/search/Search.tsx +1 -1
- package/src/layout/box/Box.darkside.tsx +19 -14
- package/src/layout/box/Box.tsx +4 -2
- package/src/layout/utilities/types.ts +20 -42
- package/src/tag/Tag.tsx +32 -18
- package/src/timeline/Pin.tsx +16 -10
- package/src/timeline/hooks/useTimelineRows.ts +25 -9
- package/src/timeline/period/ClickablePeriod.tsx +16 -10
- package/src/timeline/tests/useTimelineRows.test.ts +131 -0
- package/src/tooltip/Tooltip.tsx +7 -2
package/esm/tooltip/Tooltip.js
CHANGED
|
@@ -14,6 +14,7 @@ import cl from "clsx";
|
|
|
14
14
|
import React, { forwardRef, useRef } from "react";
|
|
15
15
|
import { useModalContext } from "../modal/Modal.context.js";
|
|
16
16
|
import { Portal } from "../portal/index.js";
|
|
17
|
+
import { UNSAFE_useAkselTheme } from "../provider/index.js";
|
|
17
18
|
import { Slot } from "../slot/Slot.js";
|
|
18
19
|
import { Detail } from "../typography/index.js";
|
|
19
20
|
import { useId } from "../util/hooks/index.js";
|
|
@@ -34,6 +35,8 @@ import { useMergeRefs } from "../util/hooks/useMergeRefs.js";
|
|
|
34
35
|
*/
|
|
35
36
|
export const Tooltip = forwardRef((_a, ref) => {
|
|
36
37
|
var { children, className, arrow: _arrow = true, placement: _placement = "top", open, defaultOpen = false, onOpenChange, offset: _offset, content, delay = 150, id, keys, maxChar = 80, describesChild = false } = _a, rest = __rest(_a, ["children", "className", "arrow", "placement", "open", "defaultOpen", "onOpenChange", "offset", "content", "delay", "id", "keys", "maxChar", "describesChild"]);
|
|
38
|
+
const themeContext = UNSAFE_useAkselTheme(false);
|
|
39
|
+
const showArrow = _arrow && !themeContext;
|
|
37
40
|
const [_open, _setOpen] = useControllableState({
|
|
38
41
|
defaultValue: defaultOpen,
|
|
39
42
|
value: open,
|
|
@@ -47,7 +50,7 @@ export const Tooltip = forwardRef((_a, ref) => {
|
|
|
47
50
|
open: _open,
|
|
48
51
|
onOpenChange: (newState) => _setOpen(newState),
|
|
49
52
|
middleware: [
|
|
50
|
-
offset(_offset ? _offset : _arrow ?
|
|
53
|
+
offset(_offset !== null && _offset !== void 0 ? _offset : (themeContext ? 8 : _arrow ? 16 : 4)),
|
|
51
54
|
shift(),
|
|
52
55
|
flip({ padding: 5, fallbackPlacements: ["bottom", "top"] }),
|
|
53
56
|
flArrow({ element: arrowRef, padding: 5 }),
|
|
@@ -89,10 +92,10 @@ export const Tooltip = forwardRef((_a, ref) => {
|
|
|
89
92
|
top: y !== null && y !== void 0 ? y : 0,
|
|
90
93
|
left: x !== null && x !== void 0 ? x : 0,
|
|
91
94
|
visibility: referenceHidden ? "hidden" : "visible",
|
|
92
|
-
}, role: "tooltip", id: ariaId, className: cl("navds-tooltip", "navds-detail navds-detail--small", className) })), { "data-side": placement }),
|
|
95
|
+
}, role: "tooltip", id: ariaId, className: cl("navds-tooltip", "navds-detail navds-detail--small", className) })), { "data-side": placement, "data-state": "open" }),
|
|
93
96
|
content,
|
|
94
97
|
keys && (React.createElement("span", { className: "navds-tooltip__keys", "aria-hidden": true }, keys.map((key) => (React.createElement(Detail, { as: "kbd", key: key, className: "navds-tooltip__key" }, key))))),
|
|
95
|
-
|
|
98
|
+
showArrow && (React.createElement("div", { ref: (node) => {
|
|
96
99
|
arrowRef.current = node;
|
|
97
100
|
}, className: "navds-tooltip__arrow", style: {
|
|
98
101
|
left: arrowX != null ? `${arrowX}px` : "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../src/tooltip/Tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,UAAU,EACV,KAAK,IAAI,OAAO,EAChB,IAAI,EACJ,MAAM,EACN,WAAW,EACX,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAkB,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAsE1D;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,O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AAE;oBACL,IAAI,EAAE,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE;oBACzC,GAAG,EAAE,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE;oBACxC,KAAK,EAAE,EAAE;oBACT,MAAM,EAAE,EAAE;oBACV,CAAC;wBACC,GAAG,EAAE,QAAQ;wBACb,KAAK,EAAE,MAAM;wBACb,MAAM,EAAE,KAAK;wBACb,IAAI,EAAE,OAAO;qBACd,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ;iBACxB,GACD,CACH,CACG,CACP,CACM,CACR,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/ds-react",
|
|
3
|
-
"version": "7.8.
|
|
3
|
+
"version": "7.8.1",
|
|
4
4
|
"description": "React components from the Norwegian Labour and Welfare Administration.",
|
|
5
5
|
"author": "Aksel, a team part of the Norwegian Labour and Welfare Administration.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"react",
|
|
9
9
|
"typescript",
|
|
10
10
|
"javascript",
|
|
11
|
-
"
|
|
11
|
+
"Nav"
|
|
12
12
|
],
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
@@ -614,8 +614,8 @@
|
|
|
614
614
|
"dependencies": {
|
|
615
615
|
"@floating-ui/react": "0.25.4",
|
|
616
616
|
"@floating-ui/react-dom": "^2.0.9",
|
|
617
|
-
"@navikt/aksel-icons": "^7.8.
|
|
618
|
-
"@navikt/ds-tokens": "^7.8.
|
|
617
|
+
"@navikt/aksel-icons": "^7.8.1",
|
|
618
|
+
"@navikt/ds-tokens": "^7.8.1",
|
|
619
619
|
"clsx": "^2.1.0",
|
|
620
620
|
"date-fns": "^3.0.0",
|
|
621
621
|
"react-day-picker": "8.10.1"
|
|
@@ -75,7 +75,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
|
75
75
|
|
|
76
76
|
const onEnter = useCallback(
|
|
77
77
|
(event: React.KeyboardEvent) => {
|
|
78
|
-
const
|
|
78
|
+
const isSelected = (text: string) =>
|
|
79
79
|
selectedOptions.some(
|
|
80
80
|
(option) =>
|
|
81
81
|
option.label.toLocaleLowerCase() === text.toLocaleLowerCase(),
|
|
@@ -85,10 +85,10 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
|
85
85
|
event.preventDefault();
|
|
86
86
|
// Selecting a value from the dropdown / FilteredOptions
|
|
87
87
|
toggleOption(currentOption, event);
|
|
88
|
-
if (!isMultiSelect && !
|
|
88
|
+
if (!isMultiSelect && !isSelected(currentOption.label)) {
|
|
89
89
|
toggleIsListOpen(false);
|
|
90
90
|
}
|
|
91
|
-
} else if (
|
|
91
|
+
} else if (isSelected(value)) {
|
|
92
92
|
event.preventDefault();
|
|
93
93
|
// Trying to set the same value that is already set, so just clearing the input
|
|
94
94
|
clearInput(event);
|
|
@@ -109,23 +109,23 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
|
109
109
|
filteredOptionsUtil.normalizeText(value) ===
|
|
110
110
|
filteredOptionsUtil.normalizeText(autoCompletedOption?.label ?? "");
|
|
111
111
|
|
|
112
|
-
let
|
|
112
|
+
let optionToToggle: ComboboxOption | undefined;
|
|
113
113
|
|
|
114
114
|
if (
|
|
115
115
|
shouldAutocomplete &&
|
|
116
116
|
autoCompletedOption &&
|
|
117
117
|
autoCompleteMatchesValue
|
|
118
118
|
) {
|
|
119
|
-
|
|
119
|
+
optionToToggle = autoCompletedOption;
|
|
120
120
|
} else if (allowNewValues && isValueNew) {
|
|
121
|
-
|
|
121
|
+
optionToToggle = { label: value, value };
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
if (!
|
|
124
|
+
if (!optionToToggle) {
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
|
-
toggleOption(
|
|
128
|
-
if (!isMultiSelect && !
|
|
127
|
+
toggleOption(optionToToggle, event);
|
|
128
|
+
if (!isMultiSelect && !isSelected(optionToToggle.label)) {
|
|
129
129
|
toggleIsListOpen(false);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
@@ -33,6 +33,7 @@ export const InputController = forwardRef<
|
|
|
33
33
|
toggleListButton = true,
|
|
34
34
|
inputClassName,
|
|
35
35
|
shouldShowSelectedOptions = true,
|
|
36
|
+
|
|
36
37
|
...rest
|
|
37
38
|
} = props;
|
|
38
39
|
|
|
@@ -45,7 +46,7 @@ export const InputController = forwardRef<
|
|
|
45
46
|
readOnly,
|
|
46
47
|
} = useInputContext();
|
|
47
48
|
|
|
48
|
-
const { activeDecendantId } = useFilteredOptionsContext();
|
|
49
|
+
const { activeDecendantId, toggleIsListOpen } = useFilteredOptionsContext();
|
|
49
50
|
const { selectedOptions } = useSelectedOptionsContext();
|
|
50
51
|
|
|
51
52
|
const mergedInputRef = useMergeRefs(inputRef, ref);
|
|
@@ -57,7 +58,14 @@ export const InputController = forwardRef<
|
|
|
57
58
|
"navds-combobox__wrapper-inner--virtually-unfocused":
|
|
58
59
|
activeDecendantId !== undefined,
|
|
59
60
|
})}
|
|
60
|
-
onClick={
|
|
61
|
+
onClick={() => {
|
|
62
|
+
if (inputProps.disabled || readOnly) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
toggleIsListOpen(true);
|
|
67
|
+
focusInput();
|
|
68
|
+
}}
|
|
61
69
|
>
|
|
62
70
|
{!shouldShowSelectedOptions ? (
|
|
63
71
|
<Input
|
|
@@ -120,6 +120,8 @@ const SelectedOptionsProvider = ({
|
|
|
120
120
|
) => {
|
|
121
121
|
if (isInList(option.value, selectedOptions)) {
|
|
122
122
|
removeSelectedOption(option);
|
|
123
|
+
} else if (isMultiSelect && isLimitReached) {
|
|
124
|
+
return;
|
|
123
125
|
} else {
|
|
124
126
|
addSelectedOption(option);
|
|
125
127
|
}
|
|
@@ -132,6 +134,8 @@ const SelectedOptionsProvider = ({
|
|
|
132
134
|
focusInput,
|
|
133
135
|
removeSelectedOption,
|
|
134
136
|
selectedOptions,
|
|
137
|
+
isLimitReached,
|
|
138
|
+
isMultiSelect,
|
|
135
139
|
],
|
|
136
140
|
);
|
|
137
141
|
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import type {
|
|
4
|
+
BorderColorKeys,
|
|
5
|
+
BorderColorWithRoleKeys,
|
|
6
|
+
BorderRadiusKeys,
|
|
7
|
+
DefaultBgKeys,
|
|
8
|
+
ShadowKeys,
|
|
9
|
+
StaticBgKeys,
|
|
10
|
+
} from "@navikt/ds-tokens/types";
|
|
4
11
|
import { Slot } from "../../slot/Slot";
|
|
5
12
|
import { omit } from "../../util";
|
|
6
13
|
import { OverridableComponent } from "../../util/types";
|
|
@@ -10,27 +17,21 @@ import BasePrimitive, {
|
|
|
10
17
|
} from "../base/BasePrimitive";
|
|
11
18
|
import { PrimitiveAsChildProps } from "../base/PrimitiveAsChildProps";
|
|
12
19
|
import { getResponsiveProps } from "../utilities/css";
|
|
13
|
-
import {
|
|
14
|
-
BorderRadiiToken,
|
|
15
|
-
ResponsiveProp,
|
|
16
|
-
SemanticRoleBgDarkside,
|
|
17
|
-
SemanticShadowTokens,
|
|
18
|
-
SemanticStaticBgDarkside,
|
|
19
|
-
SemanticStaticBorderDarkside,
|
|
20
|
-
SpaceDelimitedAttribute,
|
|
21
|
-
} from "../utilities/types";
|
|
20
|
+
import { ResponsiveProp, SpaceDelimitedAttribute } from "../utilities/types";
|
|
22
21
|
|
|
23
22
|
export type BoxNewProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
24
23
|
/**
|
|
25
24
|
* CSS `background-color` property.
|
|
26
25
|
* Accepts a [background/surface color token](https://aksel.nav.no/grunnleggende/styling/design-tokens#afff774dad80).
|
|
26
|
+
* @see {@link DefaultBgKeys} and {@link StaticBgKeys}
|
|
27
27
|
*/
|
|
28
|
-
background?:
|
|
28
|
+
background?: DefaultBgKeys | StaticBgKeys;
|
|
29
29
|
/**
|
|
30
30
|
* CSS `border-color` property.
|
|
31
31
|
* Accepts a [border color token](https://aksel.nav.no/grunnleggende/styling/design-tokens#adb1767e2f87).
|
|
32
|
+
* @see {@link BorderColorKeys} and {@link BorderColorWithRoleKeys}
|
|
32
33
|
*/
|
|
33
|
-
borderColor?:
|
|
34
|
+
borderColor?: Exclude<BorderColorKeys, "focus"> | BorderColorWithRoleKeys;
|
|
34
35
|
/**
|
|
35
36
|
* CSS `border-radius` property.
|
|
36
37
|
* Accepts a [radius token](https://aksel.nav.no/grunnleggende/styling/design-tokens#6d79c5605d31)
|
|
@@ -39,8 +40,11 @@ export type BoxNewProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
39
40
|
* borderRadius='full'
|
|
40
41
|
* borderRadius='0 full large small'
|
|
41
42
|
* borderRadius={{xs: 'small large', sm: '0', md: 'large', lg: 'full'}}
|
|
43
|
+
* @see {@link BorderRadiusKeys}
|
|
42
44
|
*/
|
|
43
|
-
borderRadius?: ResponsiveProp<
|
|
45
|
+
borderRadius?: ResponsiveProp<
|
|
46
|
+
SpaceDelimitedAttribute<BorderRadiusKeys | "0">
|
|
47
|
+
>;
|
|
44
48
|
/**
|
|
45
49
|
* CSS `border-width` property. If this is not set there will be no border.
|
|
46
50
|
* @example
|
|
@@ -51,8 +55,9 @@ export type BoxNewProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
51
55
|
/** Shadow on box. Accepts a shadow token.
|
|
52
56
|
* @example
|
|
53
57
|
* shadow='small'
|
|
58
|
+
* @see {@link ShadowKeys}
|
|
54
59
|
*/
|
|
55
|
-
shadow?:
|
|
60
|
+
shadow?: ShadowKeys;
|
|
56
61
|
} & PrimitiveProps &
|
|
57
62
|
PrimitiveAsChildProps;
|
|
58
63
|
|
package/src/layout/box/Box.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
|
+
import { type BorderRadiusKeys } from "@navikt/ds-tokens/types";
|
|
3
4
|
import { UNSAFE_useAkselTheme } from "../../provider";
|
|
4
5
|
import { Slot } from "../../slot/Slot";
|
|
5
6
|
import { omit } from "../../util";
|
|
@@ -13,7 +14,6 @@ import { getResponsiveProps } from "../utilities/css";
|
|
|
13
14
|
import {
|
|
14
15
|
BackgroundColorToken,
|
|
15
16
|
BorderColorToken,
|
|
16
|
-
BorderRadiiToken,
|
|
17
17
|
ResponsiveProp,
|
|
18
18
|
ShadowToken,
|
|
19
19
|
SpaceDelimitedAttribute,
|
|
@@ -41,7 +41,9 @@ export type BoxProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
41
41
|
* borderRadius='0 full large small'
|
|
42
42
|
* borderRadius={{xs: 'small large', sm: '0', md: 'large', lg: 'full'}}
|
|
43
43
|
*/
|
|
44
|
-
borderRadius?: ResponsiveProp<
|
|
44
|
+
borderRadius?: ResponsiveProp<
|
|
45
|
+
SpaceDelimitedAttribute<BorderRadiusKeys | "0">
|
|
46
|
+
>;
|
|
45
47
|
/**
|
|
46
48
|
* CSS `border-width` property. If this is not set there will be no border.
|
|
47
49
|
* @example
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export type
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export type
|
|
21
|
-
|
|
22
|
-
export type BreakpointsAlias = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
23
|
-
|
|
24
|
-
export type SpacingScale = keyof (typeof Spacing)["a"]["spacing"];
|
|
1
|
+
import type {
|
|
2
|
+
BreakPointKeys,
|
|
3
|
+
LegacyBgColorKeys,
|
|
4
|
+
LegacyBorderColorKeys,
|
|
5
|
+
LegacyShadowKeys,
|
|
6
|
+
LegacySurfaceColorKeys,
|
|
7
|
+
SpacingKeys,
|
|
8
|
+
} from "@navikt/ds-tokens/types";
|
|
9
|
+
|
|
10
|
+
export type BackgroundColorToken = LegacyBgColorKeys;
|
|
11
|
+
export type SurfaceColorToken = LegacySurfaceColorKeys;
|
|
12
|
+
export type BorderColorToken = LegacyBorderColorKeys;
|
|
13
|
+
export type ShadowToken = LegacyShadowKeys;
|
|
14
|
+
|
|
15
|
+
export type BreakpointsAlias = Extract<
|
|
16
|
+
BreakPointKeys,
|
|
17
|
+
"xs" | "sm" | "md" | "lg" | "xl" | "2xl"
|
|
18
|
+
>;
|
|
19
|
+
|
|
20
|
+
export type SpacingScale = SpacingKeys;
|
|
25
21
|
|
|
26
22
|
export type SpaceDelimitedAttribute<T extends string> =
|
|
27
23
|
| T
|
|
@@ -33,21 +29,3 @@ type FixedResponsiveT<T> = {
|
|
|
33
29
|
};
|
|
34
30
|
|
|
35
31
|
export type ResponsiveProp<T> = T | FixedResponsiveT<T>;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Darkside tokens
|
|
39
|
-
*/
|
|
40
|
-
export type SemanticShadowTokens = keyof ReturnType<
|
|
41
|
-
typeof shadowTokenConfig
|
|
42
|
-
>["shadow"];
|
|
43
|
-
|
|
44
|
-
export type SemanticStaticBgDarkside = keyof ReturnType<
|
|
45
|
-
typeof semanticTokenConfig
|
|
46
|
-
>["bg"];
|
|
47
|
-
|
|
48
|
-
export type SemanticRoleBgDarkside =
|
|
49
|
-
keyof SemanticTokensForAllRolesConfigT<"color">["bg"];
|
|
50
|
-
|
|
51
|
-
export type SemanticStaticBorderDarkside = keyof ReturnType<
|
|
52
|
-
typeof semanticTokenConfig
|
|
53
|
-
>["border"];
|
package/src/tag/Tag.tsx
CHANGED
|
@@ -31,7 +31,13 @@ export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
31
31
|
| "alt2-moderate"
|
|
32
32
|
| "alt3"
|
|
33
33
|
| "alt3-filled"
|
|
34
|
-
| "alt3-moderate"
|
|
34
|
+
| "alt3-moderate"
|
|
35
|
+
| "meta-purple"
|
|
36
|
+
| "meta-purple-filled"
|
|
37
|
+
| "meta-purple-moderate"
|
|
38
|
+
| "meta-lime"
|
|
39
|
+
| "meta-lime-filled"
|
|
40
|
+
| "meta-lime-moderate";
|
|
35
41
|
/**
|
|
36
42
|
* @default "medium"
|
|
37
43
|
*/
|
|
@@ -54,23 +60,31 @@ export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
54
60
|
* ```
|
|
55
61
|
*/
|
|
56
62
|
export const Tag = forwardRef<HTMLSpanElement, TagProps>(
|
|
57
|
-
({ children, className, variant, size = "medium", icon, ...rest }, ref) =>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
({ children, className, variant, size = "medium", icon, ...rest }, ref) => {
|
|
64
|
+
const filledVariant = variant?.endsWith("-filled") && "strong";
|
|
65
|
+
const moderateVariant = variant?.endsWith("-moderate") && "moderate";
|
|
66
|
+
const color = variant?.replace("-filled", "").replace("-moderate", "");
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<BodyShort
|
|
70
|
+
{...rest}
|
|
71
|
+
ref={ref}
|
|
72
|
+
as="span"
|
|
73
|
+
size={size === "medium" ? "medium" : "small"}
|
|
74
|
+
className={cl(
|
|
75
|
+
"navds-tag",
|
|
76
|
+
className,
|
|
77
|
+
`navds-tag--${variant}`,
|
|
78
|
+
`navds-tag--${size}`,
|
|
79
|
+
`navds-tag--${filledVariant || moderateVariant || "outline"}`,
|
|
80
|
+
`navds-tag--${color}`,
|
|
81
|
+
)}
|
|
82
|
+
>
|
|
83
|
+
{icon && <span className="navds-tag__icon--left">{icon}</span>}
|
|
84
|
+
{children}
|
|
85
|
+
</BodyShort>
|
|
86
|
+
);
|
|
87
|
+
},
|
|
74
88
|
);
|
|
75
89
|
|
|
76
90
|
export default Tag;
|
package/src/timeline/Pin.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
} from "@floating-ui/react";
|
|
16
16
|
import { format } from "date-fns";
|
|
17
17
|
import React, { forwardRef, useRef, useState } from "react";
|
|
18
|
+
import { UNSAFE_useAkselTheme } from "../provider";
|
|
18
19
|
import { useMergeRefs } from "../util/hooks/useMergeRefs";
|
|
19
20
|
import { useI18n } from "../util/i18n/i18n.context";
|
|
20
21
|
import { useTimelineContext } from "./hooks/useTimelineContext";
|
|
@@ -47,6 +48,9 @@ export const Pin = forwardRef<HTMLButtonElement, TimelinePinProps>(
|
|
|
47
48
|
const arrowRef = useRef<HTMLDivElement | null>(null);
|
|
48
49
|
const translate = useI18n("Timeline");
|
|
49
50
|
|
|
51
|
+
const themeContext = UNSAFE_useAkselTheme(false);
|
|
52
|
+
const showArrow = !themeContext;
|
|
53
|
+
|
|
50
54
|
const {
|
|
51
55
|
context,
|
|
52
56
|
placement,
|
|
@@ -59,7 +63,7 @@ export const Pin = forwardRef<HTMLButtonElement, TimelinePinProps>(
|
|
|
59
63
|
onOpenChange: (_open) => setOpen(_open),
|
|
60
64
|
whileElementsMounted: autoUpdate,
|
|
61
65
|
middleware: [
|
|
62
|
-
offset(16),
|
|
66
|
+
offset(showArrow ? 16 : 8),
|
|
63
67
|
shift(),
|
|
64
68
|
flip({ padding: 5, fallbackPlacements: ["bottom", "top"] }),
|
|
65
69
|
flArrow({ element: arrowRef, padding: 5 }),
|
|
@@ -135,15 +139,17 @@ export const Pin = forwardRef<HTMLButtonElement, TimelinePinProps>(
|
|
|
135
139
|
style={floatingStyles}
|
|
136
140
|
>
|
|
137
141
|
{children}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
{showArrow && (
|
|
143
|
+
<div
|
|
144
|
+
ref={arrowRef}
|
|
145
|
+
style={{
|
|
146
|
+
...(arrowX != null ? { left: arrowX } : {}),
|
|
147
|
+
...(arrowY != null ? { top: arrowY } : {}),
|
|
148
|
+
...(staticSide ? { [staticSide]: "-0.5rem" } : {}),
|
|
149
|
+
}}
|
|
150
|
+
className="navds-timeline__popover-arrow"
|
|
151
|
+
/>
|
|
152
|
+
)}
|
|
147
153
|
</div>
|
|
148
154
|
</FloatingFocusManager>
|
|
149
155
|
)}
|
|
@@ -134,17 +134,33 @@ export const useTimelineRows = (
|
|
|
134
134
|
[rows, startDate, endDate, direction],
|
|
135
135
|
);
|
|
136
136
|
|
|
137
|
-
const
|
|
138
|
-
|
|
137
|
+
export const useEarliestDate = ({
|
|
138
|
+
startDate,
|
|
139
|
+
rows,
|
|
140
|
+
}: {
|
|
141
|
+
startDate?: Date;
|
|
142
|
+
rows: Pick<Period, "start">[][];
|
|
143
|
+
}) =>
|
|
144
|
+
useMemo(() => {
|
|
145
|
+
if (startDate) {
|
|
146
|
+
return startDate;
|
|
147
|
+
}
|
|
139
148
|
|
|
140
|
-
const
|
|
141
|
-
|
|
149
|
+
const startDates = rows
|
|
150
|
+
.flat()
|
|
151
|
+
.filter((period) => period.start)
|
|
152
|
+
.map((period) => period.start);
|
|
142
153
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
154
|
+
if (startDates.length === 0) {
|
|
155
|
+
return new Date();
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const earliestDate = startDates.reduce((earliest, current) =>
|
|
159
|
+
current < earliest ? current : earliest,
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
return earliestDate;
|
|
163
|
+
}, [startDate, rows]);
|
|
148
164
|
|
|
149
165
|
const latestDate = (latest: Date, period: Period) =>
|
|
150
166
|
period.end > latest ? period.end : latest;
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
} from "@floating-ui/react";
|
|
16
16
|
import cl from "clsx";
|
|
17
17
|
import React, { useRef, useState } from "react";
|
|
18
|
+
import { UNSAFE_useAkselTheme } from "../../provider";
|
|
18
19
|
import { useMergeRefs } from "../../util/hooks/useMergeRefs";
|
|
19
20
|
import { useI18n } from "../../util/i18n/i18n.context";
|
|
20
21
|
import { usePeriodContext } from "../hooks/usePeriodContext";
|
|
@@ -55,6 +56,9 @@ const ClickablePeriod = React.memo(
|
|
|
55
56
|
const arrowRef = useRef<HTMLDivElement | null>(null);
|
|
56
57
|
const translate = useI18n("Timeline");
|
|
57
58
|
|
|
59
|
+
const themeContext = UNSAFE_useAkselTheme(false);
|
|
60
|
+
const showArrow = !themeContext;
|
|
61
|
+
|
|
58
62
|
const {
|
|
59
63
|
context,
|
|
60
64
|
placement,
|
|
@@ -67,7 +71,7 @@ const ClickablePeriod = React.memo(
|
|
|
67
71
|
onOpenChange: (_open) => setOpen(_open),
|
|
68
72
|
whileElementsMounted: autoUpdate,
|
|
69
73
|
middleware: [
|
|
70
|
-
offset(16),
|
|
74
|
+
offset(showArrow ? 16 : 8),
|
|
71
75
|
shift(),
|
|
72
76
|
flip({ padding: 5, fallbackPlacements: ["bottom", "top"] }),
|
|
73
77
|
flArrow({ element: arrowRef, padding: 5 }),
|
|
@@ -164,15 +168,17 @@ const ClickablePeriod = React.memo(
|
|
|
164
168
|
style={floatingStyles}
|
|
165
169
|
>
|
|
166
170
|
{children}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
171
|
+
{showArrow && (
|
|
172
|
+
<div
|
|
173
|
+
ref={arrowRef}
|
|
174
|
+
style={{
|
|
175
|
+
...(arrowX != null ? { left: arrowX } : {}),
|
|
176
|
+
...(arrowY != null ? { top: arrowY } : {}),
|
|
177
|
+
...(staticSide ? { [staticSide]: "-0.5rem" } : {}),
|
|
178
|
+
}}
|
|
179
|
+
className="navds-timeline__popover-arrow"
|
|
180
|
+
/>
|
|
181
|
+
)}
|
|
176
182
|
</div>
|
|
177
183
|
</FloatingFocusManager>
|
|
178
184
|
)}
|