@navikt/ds-react 7.0.0 → 7.0.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.
@@ -7,9 +7,7 @@ const getFirstValueStartingWith = (text, list) => {
7
7
  return list.find((listItem) => normalizeText(listItem.label).startsWith(text.toLocaleLowerCase()));
8
8
  };
9
9
  const getFilteredOptionsId = (comboboxId) => `${comboboxId}-filtered-options`;
10
- const getOptionId = (comboboxId, option) => `${comboboxId.toLocaleLowerCase()}-option-${option
11
- .replace(" ", "-")
12
- .toLocaleLowerCase()}`;
10
+ const getOptionId = (comboboxId, option) => `${comboboxId}-option-${option}`.replace(/\s/g, "-").toLocaleLowerCase();
13
11
  const getAddNewOptionId = (comboboxId) => `${comboboxId}-combobox-new-option`;
14
12
  const getIsLoadingId = (comboboxId) => `${comboboxId}-is-loading`;
15
13
  const getNoHitsId = (comboboxId) => `${comboboxId}-no-hits`;
@@ -1 +1 @@
1
- {"version":3,"file":"filtered-options-util.js","sourceRoot":"","sources":["../../../../src/form/combobox/FilteredOptions/filtered-options-util.ts"],"names":[],"mappings":";;AAEA,MAAM,aAAa,GAAG,CAAC,IAAY,EAAU,EAAE,CAC7C,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAElE,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE,CACnD,aAAa,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAC,CAAC;AAE3D,MAAM,yBAAyB,GAAG,CAAC,KAAa,EAAE,IAAsB,EAAE,EAAE,CAC1E,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAEjE,MAAM,yBAAyB,GAAG,CAAC,IAAY,EAAE,IAAsB,EAAE,EAAE;IACzE,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAC5B,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CACnE,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,UAAkB,EAAE,EAAE,CAClD,GAAG,UAAU,mBAAmB,CAAC;AAEnC,MAAM,WAAW,GAAG,CAAC,UAAkB,EAAE,MAAc,EAAE,EAAE,CACzD,GAAG,UAAU,CAAC,iBAAiB,EAAE,WAAW,MAAM;KAC/C,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;KACjB,iBAAiB,EAAE,EAAE,CAAC;AAE3B,MAAM,iBAAiB,GAAG,CAAC,UAAkB,EAAE,EAAE,CAC/C,GAAG,UAAU,sBAAsB,CAAC;AAEtC,MAAM,cAAc,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,GAAG,UAAU,aAAa,CAAC;AAE1E,MAAM,WAAW,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,GAAG,UAAU,UAAU,CAAC;AAEpE,MAAM,uBAAuB,GAAG,CAAC,UAAkB,EAAE,EAAE,CACrD,GAAG,UAAU,uBAAuB,CAAC;AAEvC,kBAAe;IACb,aAAa;IACb,YAAY;IACZ,yBAAyB;IACzB,oBAAoB;IACpB,iBAAiB;IACjB,WAAW;IACX,cAAc;IACd,WAAW;IACX,uBAAuB;IACvB,yBAAyB;CAC1B,CAAC"}
1
+ {"version":3,"file":"filtered-options-util.js","sourceRoot":"","sources":["../../../../src/form/combobox/FilteredOptions/filtered-options-util.ts"],"names":[],"mappings":";;AAEA,MAAM,aAAa,GAAG,CAAC,IAAY,EAAU,EAAE,CAC7C,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,iB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E,CACrD,GAAG,UAAU,uBAAuB,CAAC;AAEvC,kBAAe;IACb,aAAa;IACb,YAAY;IACZ,yBAAyB;IACzB,oBAAoB;IACpB,iBAAiB;IACjB,WAAW;IACX,cAAc;IACd,WAAW;IACX,uBAAuB;IACvB,yBAAyB;CAC1B,CAAC"}
@@ -22,5 +22,5 @@ export declare const useProvider: () => LanguageProviderContextType;
22
22
  * </UNSAFE_AkselLanguageProvider>
23
23
  * ```
24
24
  */
25
- export declare const UNSAFE_AkselLanguageProvider: ({ children, translations, ...rest }: LanguageProviderProps) => React.JSX.Element;
25
+ export declare const UNSAFE_AkselLanguageProvider: ({ children, translations, }: LanguageProviderProps) => React.JSX.Element;
26
26
  export default UNSAFE_AkselLanguageProvider;
@@ -22,17 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
37
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
27
  };
@@ -55,9 +44,10 @@ exports.useProvider = useProvider;
55
44
  * </UNSAFE_AkselLanguageProvider>
56
45
  * ```
57
46
  */
58
- const UNSAFE_AkselLanguageProvider = (_a) => {
59
- var { children, translations } = _a, rest = __rest(_a, ["children", "translations"]);
60
- return (react_1.default.createElement(exports.LanguageProviderContext.Provider, { value: Object.assign({ translations: translations !== null && translations !== void 0 ? translations : nb_1.default }, rest) }, children));
47
+ const UNSAFE_AkselLanguageProvider = ({ children, translations, }) => {
48
+ return (react_1.default.createElement(exports.LanguageProviderContext.Provider, { value: {
49
+ translations: translations !== null && translations !== void 0 ? translations : nb_1.default,
50
+ } }, children));
61
51
  };
62
52
  exports.UNSAFE_AkselLanguageProvider = UNSAFE_AkselLanguageProvider;
63
53
  exports.default = exports.UNSAFE_AkselLanguageProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"LanguageProvider.js","sourceRoot":"","sources":["../../../src/provider/i18n/LanguageProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyD;AAEzD,oEAA4C;AAS/B,QAAA,uBAAuB,GAClC,IAAA,qBAAa,EAA8B;IACzC,YAAY,EAAE,YAAE;CACjB,CAAC,CAAC;AAOE,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,IAAA,kBAAU,EAAC,+BAAuB,CAAC,CAAC;AAAxD,QAAA,WAAW,eAA6C;AAErE;;;;;;;;;GASG;AACI,MAAM,4BAA4B,GAAG,CAAC,EAIrB,EAAE,EAAE;QAJiB,EAC3C,QAAQ,EACR,YAAY,OAEU,EADnB,IAAI,cAHoC,4BAI5C,CADQ;IAEP,OAAO,CACL,8BAAC,+BAAuB,CAAC,QAAQ,IAC/B,KAAK,kBACH,YAAY,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,YAAE,IAC7B,IAAI,KAGR,QAAQ,CACwB,CACpC,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,4BAA4B,gCAevC;AAEF,kBAAe,oCAA4B,CAAC"}
1
+ {"version":3,"file":"LanguageProvider.js","sourceRoot":"","sources":["../../../src/provider/i18n/LanguageProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyD;AAEzD,oEAA4C;AAS/B,QAAA,uBAAuB,GAClC,IAAA,qBAAa,EAA8B;IACzC,YAAY,EAAE,YAAE;CACjB,CAAC,CAAC;AAOE,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,IAAA,kBAAU,EAAC,+BAAuB,CAAC,CAAC;AAAxD,QAAA,WAAW,eAA6C;AAErE;;;;;;;;;GASG;AACI,MAAM,4BAA4B,GAAG,CAAC,EAC3C,QAAQ,EACR,YAAY,GACU,EAAE,EAAE;IAC1B,OAAO,CACL,8BAAC,+BAAuB,CAAC,QAAQ,IAC/B,KAAK,EAAE;YACL,YAAY,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,YAAE;SACjC,IAEA,QAAQ,CACwB,CACpC,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,4BAA4B,gCAavC;AAEF,kBAAe,oCAA4B,CAAC"}
@@ -5,9 +5,7 @@ const getFirstValueStartingWith = (text, list) => {
5
5
  return list.find((listItem) => normalizeText(listItem.label).startsWith(text.toLocaleLowerCase()));
6
6
  };
7
7
  const getFilteredOptionsId = (comboboxId) => `${comboboxId}-filtered-options`;
8
- const getOptionId = (comboboxId, option) => `${comboboxId.toLocaleLowerCase()}-option-${option
9
- .replace(" ", "-")
10
- .toLocaleLowerCase()}`;
8
+ const getOptionId = (comboboxId, option) => `${comboboxId}-option-${option}`.replace(/\s/g, "-").toLocaleLowerCase();
11
9
  const getAddNewOptionId = (comboboxId) => `${comboboxId}-combobox-new-option`;
12
10
  const getIsLoadingId = (comboboxId) => `${comboboxId}-is-loading`;
13
11
  const getNoHitsId = (comboboxId) => `${comboboxId}-no-hits`;
@@ -1 +1 @@
1
- {"version":3,"file":"filtered-options-util.js","sourceRoot":"","sources":["../../../../src/form/combobox/FilteredOptions/filtered-options-util.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,CAAC,IAAY,EAAU,EAAE,CAC7C,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAElE,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,IAAY,E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,EAAE,CAAC;AAE3E,MAAM,iBAAiB,GAAG,CAAC,UAAkB,EAAE,EAAE,CAC/C,GAAG,UAAU,sBAAsB,CAAC;AAEtC,MAAM,cAAc,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,GAAG,UAAU,aAAa,CAAC;AAE1E,MAAM,WAAW,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,GAAG,UAAU,UAAU,CAAC;AAEpE,MAAM,uBAAuB,GAAG,CAAC,UAAkB,EAAE,EAAE,CACrD,GAAG,UAAU,uBAAuB,CAAC;AAEvC,eAAe;IACb,aAAa;IACb,YAAY;IACZ,yBAAyB;IACzB,oBAAoB;IACpB,iBAAiB;IACjB,WAAW;IACX,cAAc;IACd,WAAW;IACX,uBAAuB;IACvB,yBAAyB;CAC1B,CAAC"}
@@ -22,5 +22,5 @@ export declare const useProvider: () => LanguageProviderContextType;
22
22
  * </UNSAFE_AkselLanguageProvider>
23
23
  * ```
24
24
  */
25
- export declare const UNSAFE_AkselLanguageProvider: ({ children, translations, ...rest }: LanguageProviderProps) => React.JSX.Element;
25
+ export declare const UNSAFE_AkselLanguageProvider: ({ children, translations, }: LanguageProviderProps) => React.JSX.Element;
26
26
  export default UNSAFE_AkselLanguageProvider;
@@ -1,14 +1,3 @@
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
1
  import React, { createContext, useContext } from "react";
13
2
  import nb from "../../util/i18n/locales/nb.js";
14
3
  export const LanguageProviderContext = createContext({
@@ -25,9 +14,10 @@ export const useProvider = () => useContext(LanguageProviderContext);
25
14
  * </UNSAFE_AkselLanguageProvider>
26
15
  * ```
27
16
  */
28
- export const UNSAFE_AkselLanguageProvider = (_a) => {
29
- var { children, translations } = _a, rest = __rest(_a, ["children", "translations"]);
30
- return (React.createElement(LanguageProviderContext.Provider, { value: Object.assign({ translations: translations !== null && translations !== void 0 ? translations : nb }, rest) }, children));
17
+ export const UNSAFE_AkselLanguageProvider = ({ children, translations, }) => {
18
+ return (React.createElement(LanguageProviderContext.Provider, { value: {
19
+ translations: translations !== null && translations !== void 0 ? translations : nb,
20
+ } }, children));
31
21
  };
32
22
  export default UNSAFE_AkselLanguageProvider;
33
23
  //# sourceMappingURL=LanguageProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LanguageProvider.js","sourceRoot":"","sources":["../../../src/provider/i18n/LanguageProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAS5C,MAAM,CAAC,MAAM,uBAAuB,GAClC,aAAa,CAA8B;IACzC,YAAY,EAAE,EAAE;CACjB,CAAC,CAAC;AAOL,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAErE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,EAIrB,EAAE,EAAE;QAJiB,EAC3C,QAAQ,EACR,YAAY,OAEU,EADnB,IAAI,cAHoC,4BAI5C,CADQ;IAEP,OAAO,CACL,oBAAC,uBAAuB,CAAC,QAAQ,IAC/B,KAAK,kBACH,YAAY,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,EAAE,IAC7B,IAAI,KAGR,QAAQ,CACwB,CACpC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
1
+ {"version":3,"file":"LanguageProvider.js","sourceRoot":"","sources":["../../../src/provider/i18n/LanguageProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAS5C,MAAM,CAAC,MAAM,uBAAuB,GAClC,aAAa,CAA8B;IACzC,YAAY,EAAE,EAAE;CACjB,CAAC,CAAC;AAOL,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAErE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,EAC3C,QAAQ,EACR,YAAY,GACU,EAAE,EAAE;IAC1B,OAAO,CACL,oBAAC,uBAAuB,CAAC,QAAQ,IAC/B,KAAK,EAAE;YACL,YAAY,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,EAAE;SACjC,IAEA,QAAQ,CACwB,CACpC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navikt/ds-react",
3
- "version": "7.0.0",
3
+ "version": "7.0.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",
@@ -594,8 +594,8 @@
594
594
  "dependencies": {
595
595
  "@floating-ui/react": "0.25.4",
596
596
  "@floating-ui/react-dom": "^2.0.9",
597
- "@navikt/aksel-icons": "^7.0.0",
598
- "@navikt/ds-tokens": "^7.0.0",
597
+ "@navikt/aksel-icons": "^7.0.1",
598
+ "@navikt/ds-tokens": "^7.0.1",
599
599
  "clsx": "^2.1.0",
600
600
  "date-fns": "^3.0.0",
601
601
  "react-day-picker": "8.10.0"
@@ -0,0 +1,18 @@
1
+ import { describe } from "vitest";
2
+ import filteredOptionsUtil from "./filtered-options-util";
3
+
4
+ describe("filtered options util", () => {
5
+ describe("getOptionId", () => {
6
+ it("should return the correct id", () => {
7
+ expect(filteredOptionsUtil.getOptionId("combobox", "option")).toBe(
8
+ "combobox-option-option",
9
+ );
10
+ });
11
+
12
+ it("should return the correct id with spaces", () => {
13
+ expect(
14
+ filteredOptionsUtil.getOptionId("combobox", "option with spaces"),
15
+ ).toBe("combobox-option-option-with-spaces");
16
+ });
17
+ });
18
+ });
@@ -19,9 +19,7 @@ const getFilteredOptionsId = (comboboxId: string) =>
19
19
  `${comboboxId}-filtered-options`;
20
20
 
21
21
  const getOptionId = (comboboxId: string, option: string) =>
22
- `${comboboxId.toLocaleLowerCase()}-option-${option
23
- .replace(" ", "-")
24
- .toLocaleLowerCase()}`;
22
+ `${comboboxId}-option-${option}`.replace(/\s/g, "-").toLocaleLowerCase();
25
23
 
26
24
  const getAddNewOptionId = (comboboxId: string) =>
27
25
  `${comboboxId}-combobox-new-option`;
@@ -34,13 +34,11 @@ export const useProvider = () => useContext(LanguageProviderContext);
34
34
  export const UNSAFE_AkselLanguageProvider = ({
35
35
  children,
36
36
  translations,
37
- ...rest
38
37
  }: LanguageProviderProps) => {
39
38
  return (
40
39
  <LanguageProviderContext.Provider
41
40
  value={{
42
41
  translations: translations ?? nb,
43
- ...rest,
44
42
  }}
45
43
  >
46
44
  {children}