react-miui 0.17.2 → 0.17.3

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.
Files changed (176) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/components/form/Checkbox.d.ts +1 -0
  3. package/dist/components/form/Checkbox.d.ts.map +1 -1
  4. package/dist/components/form/Checkbox.js +1 -1
  5. package/dist/components/form/Checkbox.js.map +1 -1
  6. package/dist/components/form/Label.d.ts +1 -0
  7. package/dist/components/form/Label.d.ts.map +1 -1
  8. package/dist/components/form/Label.js +2 -1
  9. package/dist/components/form/Label.js.map +1 -1
  10. package/dist/components/form/Toggle.d.ts +1 -0
  11. package/dist/components/form/Toggle.d.ts.map +1 -1
  12. package/dist/components/form/Toggle.js +1 -1
  13. package/dist/components/form/Toggle.js.map +1 -1
  14. package/dist/components/layout/card/Card.d.ts +1 -0
  15. package/dist/components/layout/card/Card.d.ts.map +1 -1
  16. package/dist/components/layout/card/Card.js +1 -1
  17. package/dist/components/layout/card/Card.js.map +1 -1
  18. package/dist/components/layout/header/HeaderIconAction.d.ts +1 -0
  19. package/dist/components/layout/header/HeaderIconAction.d.ts.map +1 -1
  20. package/dist/components/layout/header/HeaderIconAction.js +8 -4
  21. package/dist/components/layout/header/HeaderIconAction.js.map +1 -1
  22. package/dist/components/layout/section/SearchContainer.d.ts +4 -1
  23. package/dist/components/layout/section/SearchContainer.d.ts.map +1 -1
  24. package/dist/components/layout/section/SearchContainer.js +2 -1
  25. package/dist/components/layout/section/SearchContainer.js.map +1 -1
  26. package/dist/components/layout/section/Section.d.ts +1 -0
  27. package/dist/components/layout/section/Section.d.ts.map +1 -1
  28. package/dist/components/layout/section/Section.js +1 -1
  29. package/dist/components/layout/section/Section.js.map +1 -1
  30. package/dist/components/ui/directionPad/Pad.d.ts +1 -0
  31. package/dist/components/ui/directionPad/Pad.d.ts.map +1 -1
  32. package/dist/components/ui/directionPad/Pad.js +2 -1
  33. package/dist/components/ui/directionPad/Pad.js.map +1 -1
  34. package/dist/components/ui/drawer/Drawer.d.ts +1 -0
  35. package/dist/components/ui/drawer/Drawer.d.ts.map +1 -1
  36. package/dist/components/ui/drawer/Drawer.js +3 -1
  37. package/dist/components/ui/drawer/Drawer.js.map +1 -1
  38. package/dist/components/ui/pop/Pop.d.ts +1 -0
  39. package/dist/components/ui/pop/Pop.d.ts.map +1 -1
  40. package/dist/components/ui/pop/Pop.js +3 -1
  41. package/dist/components/ui/pop/Pop.js.map +1 -1
  42. package/dist/components/ui/pop/PopOption.d.ts +1 -0
  43. package/dist/components/ui/pop/PopOption.d.ts.map +1 -1
  44. package/dist/components/ui/pop/PopOption.js +2 -1
  45. package/dist/components/ui/pop/PopOption.js.map +1 -1
  46. package/dist/components/ui/stats/Stats.d.ts +1 -0
  47. package/dist/components/ui/stats/Stats.d.ts.map +1 -1
  48. package/dist/components/ui/stats/Stats.js +1 -1
  49. package/dist/components/ui/stats/Stats.js.map +1 -1
  50. package/dist/components/ui/tabs/Selector.d.ts +1 -0
  51. package/dist/components/ui/tabs/Selector.d.ts.map +1 -1
  52. package/dist/components/ui/tabs/Selector.js +2 -1
  53. package/dist/components/ui/tabs/Selector.js.map +1 -1
  54. package/docs/assets/main.js +57 -53
  55. package/docs/assets/search.js +1 -1
  56. package/docs/assets/style.css +58 -2
  57. package/docs/classes/Drawer.html +43 -41
  58. package/docs/classes/Pop.html +47 -45
  59. package/docs/classes/ToasterProvider.html +45 -43
  60. package/docs/enums/ICON.html +18 -16
  61. package/docs/functions/Action.html +8 -6
  62. package/docs/functions/Button.html +8 -6
  63. package/docs/functions/Card.html +8 -6
  64. package/docs/functions/Checkbox.html +8 -6
  65. package/docs/functions/Choice.html +12 -10
  66. package/docs/functions/DirectionPad.html +8 -6
  67. package/docs/functions/EqualActions.html +8 -6
  68. package/docs/functions/HandleEsc.html +8 -6
  69. package/docs/functions/Header.html +8 -6
  70. package/docs/functions/HeaderIconAction.html +8 -6
  71. package/docs/functions/Icon-1.html +8 -6
  72. package/docs/functions/If.html +8 -6
  73. package/docs/functions/Input.html +12 -10
  74. package/docs/functions/Item-1.html +8 -6
  75. package/docs/functions/KeyValue.html +8 -6
  76. package/docs/functions/Label.html +8 -6
  77. package/docs/functions/List-1.html +8 -6
  78. package/docs/functions/Message.html +8 -6
  79. package/docs/functions/Modal-1.html +8 -6
  80. package/docs/functions/ModalButtons-1.html +8 -6
  81. package/docs/functions/PopOption.html +8 -6
  82. package/docs/functions/SearchContainer.html +10 -11
  83. package/docs/functions/Section-1.html +8 -6
  84. package/docs/functions/Select.html +8 -6
  85. package/docs/functions/Selector.html +12 -10
  86. package/docs/functions/Spacer.html +8 -6
  87. package/docs/functions/Stats.html +8 -6
  88. package/docs/functions/StickyHeader-1.html +8 -6
  89. package/docs/functions/StickyHeader.Content.html +9 -7
  90. package/docs/functions/Table.html +8 -6
  91. package/docs/functions/TextArea.html +8 -6
  92. package/docs/functions/Toggle.html +8 -6
  93. package/docs/functions/useToaster.html +9 -7
  94. package/docs/index.html +8 -6
  95. package/docs/modules/Item.html +11 -9
  96. package/docs/modules/List.html +10 -8
  97. package/docs/modules/Modal.html +10 -8
  98. package/docs/modules/ModalButtons.html +10 -8
  99. package/docs/modules/Section.html +10 -8
  100. package/docs/modules/StickyHeader.html +10 -8
  101. package/docs/modules.html +8 -6
  102. package/docs/pages/tutorials/Test.html +8 -6
  103. package/docs/variables/Item.Label.html +9 -7
  104. package/docs/variables/Item.Value.html +9 -7
  105. package/docs/variables/List.Header.html +9 -7
  106. package/docs/variables/Modal.NegateMargin.html +9 -7
  107. package/docs/variables/ModalButtons.Button.html +9 -7
  108. package/docs/variables/Section.Container.html +9 -7
  109. package/esm/components/form/Checkbox.d.ts +1 -0
  110. package/esm/components/form/Checkbox.d.ts.map +1 -1
  111. package/esm/components/form/Checkbox.js +1 -1
  112. package/esm/components/form/Checkbox.js.map +1 -1
  113. package/esm/components/form/Label.d.ts +1 -0
  114. package/esm/components/form/Label.d.ts.map +1 -1
  115. package/esm/components/form/Label.js +2 -1
  116. package/esm/components/form/Label.js.map +1 -1
  117. package/esm/components/form/Toggle.d.ts +1 -0
  118. package/esm/components/form/Toggle.d.ts.map +1 -1
  119. package/esm/components/form/Toggle.js +1 -1
  120. package/esm/components/form/Toggle.js.map +1 -1
  121. package/esm/components/layout/card/Card.d.ts +1 -0
  122. package/esm/components/layout/card/Card.d.ts.map +1 -1
  123. package/esm/components/layout/card/Card.js +1 -1
  124. package/esm/components/layout/card/Card.js.map +1 -1
  125. package/esm/components/layout/header/HeaderIconAction.d.ts +1 -0
  126. package/esm/components/layout/header/HeaderIconAction.d.ts.map +1 -1
  127. package/esm/components/layout/header/HeaderIconAction.js +8 -4
  128. package/esm/components/layout/header/HeaderIconAction.js.map +1 -1
  129. package/esm/components/layout/section/SearchContainer.d.ts +4 -1
  130. package/esm/components/layout/section/SearchContainer.d.ts.map +1 -1
  131. package/esm/components/layout/section/SearchContainer.js +2 -1
  132. package/esm/components/layout/section/SearchContainer.js.map +1 -1
  133. package/esm/components/layout/section/Section.d.ts +1 -0
  134. package/esm/components/layout/section/Section.d.ts.map +1 -1
  135. package/esm/components/layout/section/Section.js +1 -1
  136. package/esm/components/layout/section/Section.js.map +1 -1
  137. package/esm/components/ui/directionPad/Pad.d.ts +1 -0
  138. package/esm/components/ui/directionPad/Pad.d.ts.map +1 -1
  139. package/esm/components/ui/directionPad/Pad.js +2 -1
  140. package/esm/components/ui/directionPad/Pad.js.map +1 -1
  141. package/esm/components/ui/drawer/Drawer.d.ts +1 -0
  142. package/esm/components/ui/drawer/Drawer.d.ts.map +1 -1
  143. package/esm/components/ui/drawer/Drawer.js +3 -1
  144. package/esm/components/ui/drawer/Drawer.js.map +1 -1
  145. package/esm/components/ui/pop/Pop.d.ts +1 -0
  146. package/esm/components/ui/pop/Pop.d.ts.map +1 -1
  147. package/esm/components/ui/pop/Pop.js +3 -1
  148. package/esm/components/ui/pop/Pop.js.map +1 -1
  149. package/esm/components/ui/pop/PopOption.d.ts +1 -0
  150. package/esm/components/ui/pop/PopOption.d.ts.map +1 -1
  151. package/esm/components/ui/pop/PopOption.js +2 -1
  152. package/esm/components/ui/pop/PopOption.js.map +1 -1
  153. package/esm/components/ui/stats/Stats.d.ts +1 -0
  154. package/esm/components/ui/stats/Stats.d.ts.map +1 -1
  155. package/esm/components/ui/stats/Stats.js +1 -1
  156. package/esm/components/ui/stats/Stats.js.map +1 -1
  157. package/esm/components/ui/tabs/Selector.d.ts +1 -0
  158. package/esm/components/ui/tabs/Selector.d.ts.map +1 -1
  159. package/esm/components/ui/tabs/Selector.js +2 -1
  160. package/esm/components/ui/tabs/Selector.js.map +1 -1
  161. package/package.json +19 -16
  162. package/src/components/form/Checkbox.tsx +2 -1
  163. package/src/components/form/Label.tsx +4 -1
  164. package/src/components/form/Toggle.tsx +2 -1
  165. package/src/components/layout/card/Card.tsx +2 -1
  166. package/src/components/layout/header/HeaderIconAction.tsx +10 -5
  167. package/src/components/layout/section/SearchContainer.tsx +8 -2
  168. package/src/components/layout/section/Section.tsx +2 -1
  169. package/src/components/ui/directionPad/Pad.tsx +4 -1
  170. package/src/components/ui/drawer/Drawer.tsx +5 -1
  171. package/src/components/ui/pop/Pop.tsx +6 -1
  172. package/src/components/ui/pop/PopOption.tsx +4 -1
  173. package/src/components/ui/stats/Stats.tsx +2 -1
  174. package/src/components/ui/tabs/Selector.tsx +4 -1
  175. package/docs/assets/widgets.png +0 -0
  176. package/docs/assets/widgets@2x.png +0 -0
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "react-miui",
3
- "version": "0.17.2",
3
+ "version": "0.17.3",
4
4
  "author": "Jacek Nowacki",
5
5
  "license": "MIT",
6
6
  "scripts": {
7
7
  "test": "NODE_ENV=test jest",
8
- "docs": "typedoc src/index.ts --out docs --includeVersion --pluginPages ./pagesconfig.json",
8
+ "docs": "typedoc src/index.ts --skipErrorChecking --out docs --includeVersion --pluginPages ./pagesconfig.json",
9
9
  "compile": "yarn compile:esm && yarn compile:cjs",
10
10
  "compile:esm": "rm -rf esm && tsc --project tsconfig.esm.json && node ./build-scripts/compile.esm.after.mjs",
11
11
  "compile:cjs": "rm -rf dist && tsc --project tsconfig.cjs.json && node ./build-scripts/compile.cjs.after.mjs",
@@ -16,7 +16,10 @@
16
16
  "prepublishOnly": "yarn audit && yarn lint && yarn test && yarn docs",
17
17
  "start:dev": "next dev",
18
18
  "deploy:dev": "next build && next export && netlify deploy --dir out",
19
- "prepare": "husky install"
19
+ "prepare": "husky install",
20
+ "updates": "npx --yes npm-check-updates --dep prod",
21
+ "updates:dev": "npx --yes npm-check-updates --dep dev",
22
+ "updates:all": "npx --yes npm-check-updates"
20
23
  },
21
24
  "exports": {
22
25
  "./global.scss": "./src/global.scss",
@@ -30,31 +33,31 @@
30
33
  "module": "./esm/index.js",
31
34
  "dependencies": {
32
35
  "classnames": "^2.3.1",
33
- "nodemon": "^2.0.19",
36
+ "nodemon": "^2.0.20",
34
37
  "oop-timers": "^4.0.1"
35
38
  },
36
39
  "devDependencies": {
37
- "@babel/core": "^7.12.10",
38
- "@babel/preset-env": "^7.12.11",
39
- "@babel/preset-typescript": "^7.12.7",
40
- "@dzek69/eslint-config-base": "^2.2.0",
40
+ "@babel/core": "^7.19.3",
41
+ "@babel/preset-env": "^7.19.3",
42
+ "@babel/preset-typescript": "^7.18.6",
43
+ "@dzek69/eslint-config-base": "^2.3.0",
41
44
  "@dzek69/eslint-config-import": "^1.0.0",
42
45
  "@dzek69/eslint-config-import-typescript": "^1.0.0",
43
46
  "@dzek69/eslint-config-react": "^1.2.2",
44
- "@dzek69/eslint-config-typescript": "^1.0.1",
47
+ "@dzek69/eslint-config-typescript": "^1.0.2",
45
48
  "@knodes/typedoc-plugin-pages": "^0.23.1",
46
49
  "@types/jest": "^29.2.0",
47
50
  "@types/react": "^17.0.4",
48
51
  "@types/react-dom": "^17.0.3",
49
- "@typescript-eslint/eslint-plugin": "^5.30.3",
50
- "@typescript-eslint/parser": "^5.30.3",
52
+ "@typescript-eslint/eslint-plugin": "^5.38.1",
53
+ "@typescript-eslint/parser": "^5.38.1",
51
54
  "babel-plugin-module-extension": "^0.1.3",
52
- "babel-plugin-module-resolver": "^4.1.0",
53
- "eslint": "^8.18.0",
55
+ "babel-plugin-module-resolver": "^5.0.0",
56
+ "eslint": "^8.24.0",
54
57
  "eslint-plugin-import": "^2.26.0",
55
58
  "eslint-plugin-react": "^7.24.0",
56
59
  "fast-glob": "^3.2.7",
57
- "fs-extra": "^9.0.1",
60
+ "fs-extra": "^10.1.0",
58
61
  "husky": "^8.0.1",
59
62
  "jest": "^29.2.2",
60
63
  "must": "^0.13.4",
@@ -64,7 +67,7 @@
64
67
  "react-use": "^17.2.4",
65
68
  "sass": "^1.35.2",
66
69
  "ts-node": "^10.9.1",
67
- "typedoc": "^0.23.8",
70
+ "typedoc": "^0.23.15",
68
71
  "typescript": "^4.7.4"
69
72
  },
70
73
  "peerDependencies": {
@@ -77,7 +80,7 @@
77
80
  }
78
81
  },
79
82
  "libraryTemplate": {
80
- "version": "3.5.3",
83
+ "version": "3.6.0",
81
84
  "language": "typescript",
82
85
  "fixDefaultForCommonJS": true,
83
86
  "jsx": true
@@ -13,13 +13,14 @@ interface Props {
13
13
  checked?: boolean;
14
14
  disabled?: boolean;
15
15
  readOnly?: boolean;
16
+ className?: string;
16
17
  }
17
18
 
18
19
  const Checkbox: React.FC<Props> = (props) => {
19
20
  const style: React.CSSProperties = {};
20
21
  props.color && (style.color = props.color);
21
22
 
22
- const cls = classnames(styles.checkbox, {
23
+ const cls = classnames(props.className, styles.checkbox, {
23
24
  [styles.disabled]: props.disabled,
24
25
  [styles.readOnly]: props.readOnly,
25
26
  });
@@ -9,6 +9,7 @@ import styles from "./Label.module.scss";
9
9
  interface Props {
10
10
  label?: React.ReactNode;
11
11
  variant?: "big";
12
+ className?: string;
12
13
  }
13
14
 
14
15
  const Label: React.FC<Props> = (props) => {
@@ -20,8 +21,10 @@ const Label: React.FC<Props> = (props) => {
20
21
 
21
22
  const label = props.label ? <div className={labelCls}>{props.label}</div> : null;
22
23
 
24
+ const rootCls = classnames(props.className, styles.label);
25
+
23
26
  return (
24
- <label className={styles.label}>
27
+ <label className={rootCls}>
25
28
  {label}
26
29
  {props.children}
27
30
  </label>
@@ -11,6 +11,7 @@ interface Props {
11
11
  undeterminedClickValue?: boolean;
12
12
  disabled?: boolean;
13
13
  value: boolean | null;
14
+ className?: string;
14
15
  }
15
16
 
16
17
  const Toggle: React.FC<Props> = (props) => {
@@ -24,7 +25,7 @@ const Toggle: React.FC<Props> = (props) => {
24
25
  props.onChange(e.target.checked);
25
26
  }, [props.onChange, props.value]);
26
27
 
27
- const cls = classnames(styles.container, {
28
+ const cls = classnames(props.className, styles.container, {
28
29
  [styles.disabled]: props.disabled,
29
30
  });
30
31
 
@@ -10,11 +10,12 @@ type Variants = "margin";
10
10
 
11
11
  interface Props {
12
12
  variant?: Variants;
13
+ className?: string;
13
14
  }
14
15
 
15
16
  const Card: React.FC<Props> = (props) => {
16
17
  const v = makeVariants(props.variant);
17
- const cls = classnames(styles.card, {
18
+ const cls = classnames(props.className, styles.card, {
18
19
  [styles.margin]: v.includes("margin"),
19
20
  });
20
21
 
@@ -1,6 +1,8 @@
1
1
  import React from "react";
2
2
  import type { ReactNode } from "react";
3
3
 
4
+ import classnames from "classnames";
5
+
4
6
  import type { ICON } from "../../icons/Icon";
5
7
 
6
8
  import { Icon } from "../../icons/Icon.js";
@@ -18,11 +20,11 @@ interface Props {
18
20
  to?: string;
19
21
  Link?: React.ComponentClass<LinkProps> | React.FC<LinkProps>;
20
22
  label?: ReactNode;
21
- // if className ever goes here make sure that `a` gets classnames merged
23
+ className?: string;
22
24
  }
23
25
 
24
26
  const HeaderIconAction: React.FC<Props> = (props) => {
25
- const { icon, label, href, to, Link, ...restProps } = props;
27
+ const { icon, label, href, to, Link, className, ...restProps } = props;
26
28
 
27
29
  let content: ReactNode = icon;
28
30
  if (typeof icon === "string") {
@@ -34,15 +36,18 @@ const HeaderIconAction: React.FC<Props> = (props) => {
34
36
  throw new TypeError("`to` prop given without `Link` component");
35
37
  }
36
38
 
37
- return <Link href={to} {...restProps}><a className={styles.a}>{content}</a></Link>;
39
+ const aCls = classnames(props.className, styles.a);
40
+ return <Link href={to} {...restProps}><a className={aCls}>{content}</a></Link>;
38
41
  }
39
42
 
40
43
  if (href) {
41
- return <a href={href} className={styles.a} {...restProps}>{content}</a>;
44
+ const aCls = classnames(props.className, styles.a);
45
+ return <a href={href} className={aCls} {...restProps}>{content}</a>;
42
46
  }
43
47
 
48
+ const btnCls = classnames(props.className, styles.btn);
44
49
  return (
45
- <button className={styles.btn} onClick={props.onClick}>
50
+ <button className={btnCls} onClick={props.onClick}>
46
51
  {content}
47
52
  </button>
48
53
  );
@@ -1,10 +1,16 @@
1
1
  import React from "react";
2
2
 
3
+ import classnames from "classnames";
4
+
3
5
  import styles from "./SearchContainer.module.scss";
4
6
 
5
- const SearchContainer: React.FC = (props) => {
7
+ interface Props {
8
+ className?: string;
9
+ }
10
+
11
+ const SearchContainer: React.FC<Props> = (props) => {
6
12
  return (
7
- <section className={styles.section}>{props.children}</section>
13
+ <section className={classnames(props.className, styles.section)}>{props.children}</section>
8
14
  );
9
15
  };
10
16
 
@@ -15,12 +15,13 @@ type Variant = "horizontal" | "vertical";
15
15
 
16
16
  interface Props {
17
17
  variant?: Variant | Variant[];
18
+ className?: string;
18
19
  }
19
20
 
20
21
  const Section: React.FC<Props> & SubComponents = (props) => {
21
22
  const v = makeVariants(props.variant);
22
23
 
23
- const cls = classnames(styles.section, {
24
+ const cls = classnames(props.className, styles.section, {
24
25
  [styles.vertical]: v.includes("vertical"),
25
26
  [styles.horizontal]: v.includes("horizontal"),
26
27
  });
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
2
 
3
+ import classnames from "classnames";
4
+
3
5
  import { PadButton as Button } from "./Button.js";
4
6
  import { PadMiddle as Middle } from "./Middle.js";
5
7
  import styles from "./Pad.module.scss";
@@ -11,11 +13,12 @@ interface Props {
11
13
  onRightPress?: () => void;
12
14
  onMiddlePress?: () => void;
13
15
  middleLabel?: string;
16
+ className?: string;
14
17
  }
15
18
 
16
19
  const Pad: React.FC<Props> = (props) => {
17
20
  return (
18
- <div className={styles.pad}>
21
+ <div className={classnames(props.className, styles.pad)}>
19
22
  <div className={styles.pad__line}>
20
23
  <Button onClick={props.onUpPress} />
21
24
  </div>
@@ -1,6 +1,7 @@
1
1
  import React, { Component } from "react";
2
2
 
3
3
  import { Timeout } from "oop-timers";
4
+ import classnames from "classnames";
4
5
 
5
6
  import { HandleEsc } from "../../utils/HandleEsc.js";
6
7
 
@@ -12,6 +13,7 @@ interface Props {
12
13
  isOpen: boolean;
13
14
  closeOnEsc?: boolean;
14
15
  onClose: () => void;
16
+ className?: string;
15
17
  }
16
18
 
17
19
  interface State {
@@ -76,8 +78,10 @@ class Drawer extends Component<Props, State> {
76
78
  const closeOnEsc = this.props.closeOnEsc ?? true;
77
79
  const esc = closeOnEsc && <HandleEsc onPress={this.handleEsc} />;
78
80
 
81
+ const cls = classnames(this.props.className, styles.drawer);
82
+
79
83
  return (
80
- <div className={styles.drawer} style={style}>
84
+ <div className={cls} style={style}>
81
85
  {esc}
82
86
  <div className={styles.content}>
83
87
  {shouldRender && this.props.children}
@@ -1,5 +1,7 @@
1
1
  import React, { Component, createRef } from "react";
2
2
 
3
+ import classnames from "classnames";
4
+
3
5
  import { HandleEsc } from "../../utils/HandleEsc.js";
4
6
 
5
7
  import { OnButtonClick } from "./OnButtonClick.js";
@@ -11,6 +13,7 @@ interface Props {
11
13
  onClose: () => void;
12
14
  anchor?: HTMLElement | "prev" | "next";
13
15
  closeOnEsc?: boolean;
16
+ className?: string;
14
17
  }
15
18
 
16
19
  interface State {
@@ -143,8 +146,10 @@ class Pop extends Component<Props, State> {
143
146
  const closeOnEsc = this.props.closeOnEsc ?? true;
144
147
  const esc = closeOnEsc && <HandleEsc onPress={this.handleEsc} />;
145
148
 
149
+ const cls = classnames(this.props.className, styles.overlay);
150
+
146
151
  return (
147
- <div className={styles.overlay} ref={this.rootRef} onClick={this.handleOverlayClick}>
152
+ <div className={cls} ref={this.rootRef} onClick={this.handleOverlayClick}>
148
153
  {esc}
149
154
  <OnButtonClick onClick={this.handleEsc}>
150
155
  <ul className={styles.pop} style={style}>
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
2
 
3
+ import classnames from "classnames";
4
+
3
5
  import type { ICON } from "../../icons/Icon";
4
6
 
5
7
  import { Icon } from "../../icons/Icon.js";
@@ -10,6 +12,7 @@ interface Props {
10
12
  icon?: ICON;
11
13
  forceEmptyIcon?: boolean;
12
14
  onClick: () => void;
15
+ className?: string;
13
16
  }
14
17
 
15
18
  const PopOption: React.FC<Props> = (props) => {
@@ -18,7 +21,7 @@ const PopOption: React.FC<Props> = (props) => {
18
21
  : ((props.forceEmptyIcon ?? true) ? <span className={styles.fakeIcon} /> : null);
19
22
 
20
23
  return (
21
- <li className={styles.li}>
24
+ <li className={classnames(props.className, styles.li)}>
22
25
  <button onClick={props.onClick} className={styles.button}>{ic}{props.children}</button>
23
26
  </li>
24
27
  );
@@ -12,6 +12,7 @@ interface Stat {
12
12
  interface Props {
13
13
  stats: Stat[];
14
14
  variant?: "dark";
15
+ className?: string;
15
16
  }
16
17
 
17
18
  const Stats: React.FC<Props> = (props) => {
@@ -31,7 +32,7 @@ const Stats: React.FC<Props> = (props) => {
31
32
 
32
33
  const cls = classnames(styles.stats, {
33
34
  [styles["stats-dark"]]: props.variant === "dark",
34
- });
35
+ }, props.className);
35
36
 
36
37
  return (
37
38
  <ul className={cls}>
@@ -1,5 +1,7 @@
1
1
  import React, { useCallback, useState } from "react";
2
2
 
3
+ import classnames from "classnames";
4
+
3
5
  import type { Value } from "../../../types/form";
4
6
 
5
7
  import { toObjectValue } from "../../../utils/index.js";
@@ -11,6 +13,7 @@ interface Props<T extends string> {
11
13
  values: Value<T>[];
12
14
  value?: string;
13
15
  onChange?: (value: string) => void;
16
+ className?: string;
14
17
  }
15
18
 
16
19
  const Selector = <T extends string>(props: Props<T>): ReturnType<React.FC<Props<T>>> => {
@@ -27,7 +30,7 @@ const Selector = <T extends string>(props: Props<T>): ReturnType<React.FC<Props<
27
30
  const ov = toObjectValue(v);
28
31
  return <Item key={ov.value} value={ov} onClick={handleCurrent} active={crr === ov.value} />;
29
32
  });
30
- return <div className={styles.selector}>{vals}</div>;
33
+ return <div className={classnames(props.className, styles.selector)}>{vals}</div>;
31
34
  };
32
35
 
33
36
  export { Selector };
Binary file
Binary file