@vincentgraul/react-components 1.0.23 → 1.0.24

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.
@@ -1 +1 @@
1
- {"version":3,"file":"LanguageSelector.d.ts","sourceRoot":"","sources":["../../src/language-selector/LanguageSelector.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAI9D,UAAU,KAAK;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE,KAAK,2CA2BpD"}
1
+ {"version":3,"file":"LanguageSelector.d.ts","sourceRoot":"","sources":["../../src/language-selector/LanguageSelector.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAI9D,UAAU,KAAK;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE,KAAK,2CAgCpD"}
@@ -10,14 +10,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  import { useEffect, useState } from "react";
12
12
  import Select from "../select/Select";
13
- import { fetchIcon } from "./utils";
13
+ import { capitalize } from "@vincentgraul/utils/word";
14
14
  export default function LanguageSelector(props) {
15
15
  const { languages, onChange } = props;
16
16
  const [options, setOptions] = useState(null);
17
17
  useEffect(() => {
18
+ const fetchIcon = (name) => __awaiter(this, void 0, void 0, function* () {
19
+ const { default: Flag } = yield import(`./icons/${capitalize(name)}.js`);
20
+ return Flag;
21
+ });
18
22
  const prepareOptions = () => __awaiter(this, void 0, void 0, function* () {
19
23
  setOptions(yield Promise.all(languages.map((language) => __awaiter(this, void 0, void 0, function* () {
20
- const { default: Flag } = yield fetchIcon(language);
24
+ const Flag = yield fetchIcon(language);
21
25
  return {
22
26
  value: language,
23
27
  label: _jsx(Flag, { style: Object.assign({}, FlagStyle) }),
@@ -85,7 +85,7 @@ declare const Option: import("styled-components").IStyledComponent<"web", {
85
85
  'aria-expanded'?: boolean | "true" | "false";
86
86
  'aria-flowto'?: string;
87
87
  'aria-grabbed'?: boolean | "true" | "false";
88
- 'aria-haspopup'?: boolean | "dialog" | "menu" | "grid" | "true" | "false" | "listbox" | "tree";
88
+ 'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree";
89
89
  'aria-hidden'?: boolean | "true" | "false";
90
90
  'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling";
91
91
  'aria-keyshortcuts'?: string;
@@ -98,7 +98,7 @@ export declare const Th: import("styled-components").IStyledComponent<"web", {
98
98
  'aria-expanded'?: boolean | "true" | "false";
99
99
  'aria-flowto'?: string;
100
100
  'aria-grabbed'?: boolean | "true" | "false";
101
- 'aria-haspopup'?: boolean | "dialog" | "menu" | "grid" | "true" | "false" | "listbox" | "tree";
101
+ 'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree";
102
102
  'aria-hidden'?: boolean | "true" | "false";
103
103
  'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling";
104
104
  'aria-keyshortcuts'?: string;
@@ -370,7 +370,7 @@ export declare const Tr: import("styled-components").IStyledComponent<"web", {
370
370
  'aria-expanded'?: boolean | "true" | "false";
371
371
  'aria-flowto'?: string;
372
372
  'aria-grabbed'?: boolean | "true" | "false";
373
- 'aria-haspopup'?: boolean | "dialog" | "menu" | "grid" | "true" | "false" | "listbox" | "tree";
373
+ 'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree";
374
374
  'aria-hidden'?: boolean | "true" | "false";
375
375
  'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling";
376
376
  'aria-keyshortcuts'?: string;
@@ -651,7 +651,7 @@ export declare const Td: import("styled-components").IStyledComponent<"web", {
651
651
  'aria-expanded'?: boolean | "true" | "false";
652
652
  'aria-flowto'?: string;
653
653
  'aria-grabbed'?: boolean | "true" | "false";
654
- 'aria-haspopup'?: boolean | "dialog" | "menu" | "grid" | "true" | "false" | "listbox" | "tree";
654
+ 'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree";
655
655
  'aria-hidden'?: boolean | "true" | "false";
656
656
  'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling";
657
657
  'aria-keyshortcuts'?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincentgraul/react-components",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "main": "build/index.js",
5
5
  "exports": {
6
6
  "./match-device": {