react-miui 0.17.2 → 0.18.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/CHANGELOG.md +10 -0
- package/dist/components/form/Checkbox.d.ts +2 -0
- package/dist/components/form/Checkbox.d.ts.map +1 -1
- package/dist/components/form/Checkbox.js +1 -1
- package/dist/components/form/Checkbox.js.map +1 -1
- package/dist/components/form/Input.d.ts +1 -1
- package/dist/components/form/Input.d.ts.map +1 -1
- package/dist/components/form/Label.d.ts +2 -0
- package/dist/components/form/Label.d.ts.map +1 -1
- package/dist/components/form/Label.js +2 -1
- package/dist/components/form/Label.js.map +1 -1
- package/dist/components/form/Toggle.d.ts +1 -0
- package/dist/components/form/Toggle.d.ts.map +1 -1
- package/dist/components/form/Toggle.js +1 -1
- package/dist/components/form/Toggle.js.map +1 -1
- package/dist/components/form/choice/Choice.d.ts +1 -1
- package/dist/components/form/choice/Choice.d.ts.map +1 -1
- package/dist/components/icons/Icon.js.map +1 -1
- package/dist/components/layout/card/Card.d.ts +3 -1
- package/dist/components/layout/card/Card.d.ts.map +1 -1
- package/dist/components/layout/card/Card.js +1 -1
- package/dist/components/layout/card/Card.js.map +1 -1
- package/dist/components/layout/header/Header.d.ts +1 -0
- package/dist/components/layout/header/Header.d.ts.map +1 -1
- package/dist/components/layout/header/Header.js.map +1 -1
- package/dist/components/layout/header/HeaderIconAction.d.ts +2 -0
- package/dist/components/layout/header/HeaderIconAction.d.ts.map +1 -1
- package/dist/components/layout/header/HeaderIconAction.js +8 -4
- package/dist/components/layout/header/HeaderIconAction.js.map +1 -1
- package/dist/components/layout/header/StickyHeader.d.ts +2 -0
- package/dist/components/layout/header/StickyHeader.d.ts.map +1 -1
- package/dist/components/layout/header/StickyHeader.js.map +1 -1
- package/dist/components/layout/list/Header.d.ts +2 -1
- package/dist/components/layout/list/Header.d.ts.map +1 -1
- package/dist/components/layout/list/Header.js.map +1 -1
- package/dist/components/layout/list/Item.d.ts +3 -1
- package/dist/components/layout/list/Item.d.ts.map +1 -1
- package/dist/components/layout/list/Item.js.map +1 -1
- package/dist/components/layout/list/Label.d.ts +1 -0
- package/dist/components/layout/list/Label.d.ts.map +1 -1
- package/dist/components/layout/list/Label.js.map +1 -1
- package/dist/components/layout/list/List.d.ts +2 -1
- package/dist/components/layout/list/List.d.ts.map +1 -1
- package/dist/components/layout/list/List.js.map +1 -1
- package/dist/components/layout/list/Value.d.ts +1 -0
- package/dist/components/layout/list/Value.d.ts.map +1 -1
- package/dist/components/layout/list/Value.js.map +1 -1
- package/dist/components/layout/section/SearchContainer.d.ts +5 -1
- package/dist/components/layout/section/SearchContainer.d.ts.map +1 -1
- package/dist/components/layout/section/SearchContainer.js +2 -1
- package/dist/components/layout/section/SearchContainer.js.map +1 -1
- package/dist/components/layout/section/Section.d.ts +3 -1
- package/dist/components/layout/section/Section.d.ts.map +1 -1
- package/dist/components/layout/section/Section.js +1 -1
- package/dist/components/layout/section/Section.js.map +1 -1
- package/dist/components/layout/section/SectionContainer.d.ts +4 -1
- package/dist/components/layout/section/SectionContainer.d.ts.map +1 -1
- package/dist/components/layout/section/SectionContainer.js.map +1 -1
- package/dist/components/layout/table/Table.d.ts +1 -1
- package/dist/components/layout/table/Table.d.ts.map +1 -1
- package/dist/components/ui/action/Action.d.ts +1 -0
- package/dist/components/ui/action/Action.d.ts.map +1 -1
- package/dist/components/ui/action/Action.js.map +1 -1
- package/dist/components/ui/action/EqualActions.d.ts +1 -0
- package/dist/components/ui/action/EqualActions.d.ts.map +1 -1
- package/dist/components/ui/action/EqualActions.js.map +1 -1
- package/dist/components/ui/button/Button.d.ts +1 -1
- package/dist/components/ui/button/Button.d.ts.map +1 -1
- package/dist/components/ui/directionPad/Pad.d.ts +1 -0
- package/dist/components/ui/directionPad/Pad.d.ts.map +1 -1
- package/dist/components/ui/directionPad/Pad.js +2 -1
- package/dist/components/ui/directionPad/Pad.js.map +1 -1
- package/dist/components/ui/drawer/Drawer.d.ts +3 -1
- package/dist/components/ui/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer/Drawer.js +3 -1
- package/dist/components/ui/drawer/Drawer.js.map +1 -1
- package/dist/components/ui/message/Message.d.ts +1 -0
- package/dist/components/ui/message/Message.d.ts.map +1 -1
- package/dist/components/ui/message/Message.js.map +1 -1
- package/dist/components/ui/modal/Modal.d.ts +2 -1
- package/dist/components/ui/modal/Modal.d.ts.map +1 -1
- package/dist/components/ui/modal/Modal.js.map +1 -1
- package/dist/components/ui/modal/ModalButton.d.ts +1 -1
- package/dist/components/ui/modal/ModalButton.d.ts.map +1 -1
- package/dist/components/ui/modal/ModalButtons.d.ts +1 -0
- package/dist/components/ui/modal/ModalButtons.d.ts.map +1 -1
- package/dist/components/ui/modal/ModalButtons.js.map +1 -1
- package/dist/components/ui/modal/ModalNoMargin.d.ts +1 -0
- package/dist/components/ui/modal/ModalNoMargin.d.ts.map +1 -1
- package/dist/components/ui/modal/ModalNoMargin.js.map +1 -1
- package/dist/components/ui/pop/OnButtonClick.d.ts +1 -0
- package/dist/components/ui/pop/OnButtonClick.d.ts.map +1 -1
- package/dist/components/ui/pop/OnButtonClick.js.map +1 -1
- package/dist/components/ui/pop/Pop.d.ts +3 -1
- package/dist/components/ui/pop/Pop.d.ts.map +1 -1
- package/dist/components/ui/pop/Pop.js +3 -1
- package/dist/components/ui/pop/Pop.js.map +1 -1
- package/dist/components/ui/pop/PopOption.d.ts +2 -0
- package/dist/components/ui/pop/PopOption.d.ts.map +1 -1
- package/dist/components/ui/pop/PopOption.js +2 -1
- package/dist/components/ui/pop/PopOption.js.map +1 -1
- package/dist/components/ui/stats/Stats.d.ts +1 -0
- package/dist/components/ui/stats/Stats.d.ts.map +1 -1
- package/dist/components/ui/stats/Stats.js +1 -1
- package/dist/components/ui/stats/Stats.js.map +1 -1
- package/dist/components/ui/tabs/Selector.d.ts +1 -0
- package/dist/components/ui/tabs/Selector.d.ts.map +1 -1
- package/dist/components/ui/tabs/Selector.js +2 -1
- package/dist/components/ui/tabs/Selector.js.map +1 -1
- package/dist/components/ui/toaster/Toaster.d.ts +2 -1
- package/dist/components/ui/toaster/Toaster.d.ts.map +1 -1
- package/dist/components/ui/toaster/Toaster.js.map +1 -1
- package/dist/components/utils/If.d.ts +1 -0
- package/dist/components/utils/If.d.ts.map +1 -1
- package/dist/components/utils/If.js.map +1 -1
- package/dist/types/form.d.ts +1 -1
- package/dist/types/form.d.ts.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/docs/assets/main.js +57 -53
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +58 -2
- package/docs/classes/Drawer.html +60 -58
- package/docs/classes/Pop.html +66 -64
- package/docs/classes/ToasterProvider.html +65 -63
- package/docs/enums/ICON.html +18 -16
- package/docs/functions/Action.html +11 -9
- package/docs/functions/Button.html +11 -9
- package/docs/functions/Card.html +11 -9
- package/docs/functions/Checkbox.html +11 -9
- package/docs/functions/Choice.html +12 -10
- package/docs/functions/DirectionPad.html +11 -9
- package/docs/functions/EqualActions.html +11 -9
- package/docs/functions/HandleEsc.html +11 -9
- package/docs/functions/Header.html +11 -9
- package/docs/functions/HeaderIconAction.html +11 -9
- package/docs/functions/Icon-1.html +11 -9
- package/docs/functions/If.html +11 -9
- package/docs/functions/Input.html +12 -10
- package/docs/functions/Item-1.html +11 -9
- package/docs/functions/KeyValue.html +11 -9
- package/docs/functions/Label.html +11 -9
- package/docs/functions/List-1.html +11 -9
- package/docs/functions/Message.html +11 -9
- package/docs/functions/Modal-1.html +11 -9
- package/docs/functions/ModalButtons-1.html +11 -9
- package/docs/functions/PopOption.html +11 -9
- package/docs/functions/SearchContainer.html +11 -12
- package/docs/functions/Section-1.html +11 -9
- package/docs/functions/Select.html +11 -9
- package/docs/functions/Selector.html +12 -10
- package/docs/functions/Spacer.html +11 -9
- package/docs/functions/Stats.html +11 -9
- package/docs/functions/StickyHeader-1.html +11 -9
- package/docs/functions/StickyHeader.Content.html +11 -9
- package/docs/functions/Table.html +11 -9
- package/docs/functions/TextArea.html +11 -9
- package/docs/functions/Toggle.html +11 -9
- package/docs/functions/useToaster.html +9 -7
- package/docs/index.html +8 -6
- package/docs/modules/Item.html +11 -9
- package/docs/modules/List.html +10 -8
- package/docs/modules/Modal.html +10 -8
- package/docs/modules/ModalButtons.html +10 -8
- package/docs/modules/Section.html +10 -8
- package/docs/modules/StickyHeader.html +10 -8
- package/docs/modules.html +8 -6
- package/docs/pages/tutorials/Test.html +8 -6
- package/docs/variables/Item.Label.html +9 -7
- package/docs/variables/Item.Value.html +9 -7
- package/docs/variables/List.Header.html +9 -7
- package/docs/variables/Modal.NegateMargin.html +9 -7
- package/docs/variables/ModalButtons.Button.html +9 -7
- package/docs/variables/Section.Container.html +10 -8
- package/esm/components/form/Checkbox.d.ts +2 -0
- package/esm/components/form/Checkbox.d.ts.map +1 -1
- package/esm/components/form/Checkbox.js +1 -1
- package/esm/components/form/Checkbox.js.map +1 -1
- package/esm/components/form/Input.d.ts +1 -1
- package/esm/components/form/Input.d.ts.map +1 -1
- package/esm/components/form/Label.d.ts +2 -0
- package/esm/components/form/Label.d.ts.map +1 -1
- package/esm/components/form/Label.js +2 -1
- package/esm/components/form/Label.js.map +1 -1
- package/esm/components/form/Toggle.d.ts +1 -0
- package/esm/components/form/Toggle.d.ts.map +1 -1
- package/esm/components/form/Toggle.js +1 -1
- package/esm/components/form/Toggle.js.map +1 -1
- package/esm/components/form/choice/Choice.d.ts +1 -1
- package/esm/components/form/choice/Choice.d.ts.map +1 -1
- package/esm/components/icons/Icon.js.map +1 -1
- package/esm/components/layout/card/Card.d.ts +3 -1
- package/esm/components/layout/card/Card.d.ts.map +1 -1
- package/esm/components/layout/card/Card.js +1 -1
- package/esm/components/layout/card/Card.js.map +1 -1
- package/esm/components/layout/header/Header.d.ts +1 -0
- package/esm/components/layout/header/Header.d.ts.map +1 -1
- package/esm/components/layout/header/Header.js.map +1 -1
- package/esm/components/layout/header/HeaderIconAction.d.ts +2 -0
- package/esm/components/layout/header/HeaderIconAction.d.ts.map +1 -1
- package/esm/components/layout/header/HeaderIconAction.js +8 -4
- package/esm/components/layout/header/HeaderIconAction.js.map +1 -1
- package/esm/components/layout/header/StickyHeader.d.ts +2 -0
- package/esm/components/layout/header/StickyHeader.d.ts.map +1 -1
- package/esm/components/layout/header/StickyHeader.js.map +1 -1
- package/esm/components/layout/list/Header.d.ts +2 -1
- package/esm/components/layout/list/Header.d.ts.map +1 -1
- package/esm/components/layout/list/Header.js.map +1 -1
- package/esm/components/layout/list/Item.d.ts +3 -1
- package/esm/components/layout/list/Item.d.ts.map +1 -1
- package/esm/components/layout/list/Item.js.map +1 -1
- package/esm/components/layout/list/Label.d.ts +1 -0
- package/esm/components/layout/list/Label.d.ts.map +1 -1
- package/esm/components/layout/list/Label.js.map +1 -1
- package/esm/components/layout/list/List.d.ts +2 -1
- package/esm/components/layout/list/List.d.ts.map +1 -1
- package/esm/components/layout/list/List.js.map +1 -1
- package/esm/components/layout/list/Value.d.ts +1 -0
- package/esm/components/layout/list/Value.d.ts.map +1 -1
- package/esm/components/layout/list/Value.js.map +1 -1
- package/esm/components/layout/section/SearchContainer.d.ts +5 -1
- package/esm/components/layout/section/SearchContainer.d.ts.map +1 -1
- package/esm/components/layout/section/SearchContainer.js +2 -1
- package/esm/components/layout/section/SearchContainer.js.map +1 -1
- package/esm/components/layout/section/Section.d.ts +3 -1
- package/esm/components/layout/section/Section.d.ts.map +1 -1
- package/esm/components/layout/section/Section.js +1 -1
- package/esm/components/layout/section/Section.js.map +1 -1
- package/esm/components/layout/section/SectionContainer.d.ts +4 -1
- package/esm/components/layout/section/SectionContainer.d.ts.map +1 -1
- package/esm/components/layout/section/SectionContainer.js.map +1 -1
- package/esm/components/layout/table/Table.d.ts +1 -1
- package/esm/components/layout/table/Table.d.ts.map +1 -1
- package/esm/components/ui/action/Action.d.ts +1 -0
- package/esm/components/ui/action/Action.d.ts.map +1 -1
- package/esm/components/ui/action/Action.js.map +1 -1
- package/esm/components/ui/action/EqualActions.d.ts +1 -0
- package/esm/components/ui/action/EqualActions.d.ts.map +1 -1
- package/esm/components/ui/action/EqualActions.js.map +1 -1
- package/esm/components/ui/button/Button.d.ts +1 -1
- package/esm/components/ui/button/Button.d.ts.map +1 -1
- package/esm/components/ui/directionPad/Pad.d.ts +1 -0
- package/esm/components/ui/directionPad/Pad.d.ts.map +1 -1
- package/esm/components/ui/directionPad/Pad.js +2 -1
- package/esm/components/ui/directionPad/Pad.js.map +1 -1
- package/esm/components/ui/drawer/Drawer.d.ts +3 -1
- package/esm/components/ui/drawer/Drawer.d.ts.map +1 -1
- package/esm/components/ui/drawer/Drawer.js +3 -1
- package/esm/components/ui/drawer/Drawer.js.map +1 -1
- package/esm/components/ui/message/Message.d.ts +1 -0
- package/esm/components/ui/message/Message.d.ts.map +1 -1
- package/esm/components/ui/message/Message.js.map +1 -1
- package/esm/components/ui/modal/Modal.d.ts +2 -1
- package/esm/components/ui/modal/Modal.d.ts.map +1 -1
- package/esm/components/ui/modal/Modal.js.map +1 -1
- package/esm/components/ui/modal/ModalButton.d.ts +1 -1
- package/esm/components/ui/modal/ModalButton.d.ts.map +1 -1
- package/esm/components/ui/modal/ModalButtons.d.ts +1 -0
- package/esm/components/ui/modal/ModalButtons.d.ts.map +1 -1
- package/esm/components/ui/modal/ModalButtons.js.map +1 -1
- package/esm/components/ui/modal/ModalNoMargin.d.ts +1 -0
- package/esm/components/ui/modal/ModalNoMargin.d.ts.map +1 -1
- package/esm/components/ui/modal/ModalNoMargin.js.map +1 -1
- package/esm/components/ui/pop/OnButtonClick.d.ts +1 -0
- package/esm/components/ui/pop/OnButtonClick.d.ts.map +1 -1
- package/esm/components/ui/pop/OnButtonClick.js.map +1 -1
- package/esm/components/ui/pop/Pop.d.ts +3 -1
- package/esm/components/ui/pop/Pop.d.ts.map +1 -1
- package/esm/components/ui/pop/Pop.js +3 -1
- package/esm/components/ui/pop/Pop.js.map +1 -1
- package/esm/components/ui/pop/PopOption.d.ts +2 -0
- package/esm/components/ui/pop/PopOption.d.ts.map +1 -1
- package/esm/components/ui/pop/PopOption.js +2 -1
- package/esm/components/ui/pop/PopOption.js.map +1 -1
- package/esm/components/ui/stats/Stats.d.ts +1 -0
- package/esm/components/ui/stats/Stats.d.ts.map +1 -1
- package/esm/components/ui/stats/Stats.js +1 -1
- package/esm/components/ui/stats/Stats.js.map +1 -1
- package/esm/components/ui/tabs/Selector.d.ts +1 -0
- package/esm/components/ui/tabs/Selector.d.ts.map +1 -1
- package/esm/components/ui/tabs/Selector.js +2 -1
- package/esm/components/ui/tabs/Selector.js.map +1 -1
- package/esm/components/ui/toaster/Toaster.d.ts +2 -1
- package/esm/components/ui/toaster/Toaster.d.ts.map +1 -1
- package/esm/components/ui/toaster/Toaster.js.map +1 -1
- package/esm/components/utils/If.d.ts +1 -0
- package/esm/components/utils/If.d.ts.map +1 -1
- package/esm/components/utils/If.js.map +1 -1
- package/esm/types/form.d.ts +1 -1
- package/esm/types/form.d.ts.map +1 -1
- package/esm/types.d.ts +1 -1
- package/esm/types.d.ts.map +1 -1
- package/package.json +32 -27
- package/src/components/form/Checkbox.tsx +3 -1
- package/src/components/form/Label.tsx +5 -1
- package/src/components/form/Toggle.tsx +2 -1
- package/src/components/icons/Icon.tsx +1 -1
- package/src/components/layout/card/Card.tsx +3 -1
- package/src/components/layout/header/Header.tsx +1 -0
- package/src/components/layout/header/HeaderIconAction.tsx +11 -5
- package/src/components/layout/header/StickyHeader.tsx +2 -0
- package/src/components/layout/list/Header.tsx +1 -0
- package/src/components/layout/list/Item.tsx +2 -0
- package/src/components/layout/list/Label.tsx +1 -0
- package/src/components/layout/list/List.tsx +1 -0
- package/src/components/layout/list/Value.tsx +1 -0
- package/src/components/layout/section/SearchContainer.tsx +9 -2
- package/src/components/layout/section/Section.tsx +3 -1
- package/src/components/layout/section/SectionContainer.tsx +5 -1
- package/src/components/ui/action/Action.tsx +1 -0
- package/src/components/ui/action/EqualActions.tsx +1 -0
- package/src/components/ui/directionPad/Pad.tsx +4 -1
- package/src/components/ui/drawer/Drawer.tsx +6 -1
- package/src/components/ui/message/Message.tsx +1 -0
- package/src/components/ui/modal/Modal.tsx +1 -0
- package/src/components/ui/modal/ModalButtons.tsx +1 -0
- package/src/components/ui/modal/ModalNoMargin.tsx +3 -1
- package/src/components/ui/pop/OnButtonClick.tsx +1 -0
- package/src/components/ui/pop/Pop.tsx +7 -1
- package/src/components/ui/pop/PopOption.tsx +5 -1
- package/src/components/ui/stats/Stats.tsx +2 -1
- package/src/components/ui/tabs/Selector.tsx +4 -1
- package/src/components/ui/toaster/Toaster.tsx +3 -1
- package/src/components/utils/If.tsx +1 -0
- package/src/demo/Main.tsx +1 -1
- package/src/demo/NextLink.tsx +11 -0
- package/src/demo/components/layout/header/Header.tsx +2 -3
- package/src/demo/components/layout/list/List.Item.tsx +2 -3
- package/src/demo/components/ui/action/Action.tsx +2 -3
- package/src/demo/componentsMap.ts +1 -1
- package/src/types.ts +1 -1
- package/template/.prettierignore +3 -0
- package/template/.prettierrc.json +1 -0
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
|
@@ -4,7 +4,9 @@ import { List } from "../../layout/list/List.js";
|
|
|
4
4
|
|
|
5
5
|
import styles from "./Modal.module.scss";
|
|
6
6
|
|
|
7
|
-
interface Props {
|
|
7
|
+
interface Props {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
8
10
|
|
|
9
11
|
const ModalNegateMargin: React.FC<Props> = (props) => {
|
|
10
12
|
const chld = React.Children.map(props.children, (child, index) => {
|
|
@@ -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,8 @@ interface Props {
|
|
|
11
13
|
onClose: () => void;
|
|
12
14
|
anchor?: HTMLElement | "prev" | "next";
|
|
13
15
|
closeOnEsc?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
children: React.ReactNode;
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
interface State {
|
|
@@ -143,8 +147,10 @@ class Pop extends Component<Props, State> {
|
|
|
143
147
|
const closeOnEsc = this.props.closeOnEsc ?? true;
|
|
144
148
|
const esc = closeOnEsc && <HandleEsc onPress={this.handleEsc} />;
|
|
145
149
|
|
|
150
|
+
const cls = classnames(this.props.className, styles.overlay);
|
|
151
|
+
|
|
146
152
|
return (
|
|
147
|
-
<div className={
|
|
153
|
+
<div className={cls} ref={this.rootRef} onClick={this.handleOverlayClick}>
|
|
148
154
|
{esc}
|
|
149
155
|
<OnButtonClick onClick={this.handleEsc}>
|
|
150
156
|
<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,8 @@ interface Props {
|
|
|
10
12
|
icon?: ICON;
|
|
11
13
|
forceEmptyIcon?: boolean;
|
|
12
14
|
onClick: () => void;
|
|
15
|
+
className?: string;
|
|
16
|
+
children: React.ReactNode;
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
const PopOption: React.FC<Props> = (props) => {
|
|
@@ -18,7 +22,7 @@ const PopOption: React.FC<Props> = (props) => {
|
|
|
18
22
|
: ((props.forceEmptyIcon ?? true) ? <span className={styles.fakeIcon} /> : null);
|
|
19
23
|
|
|
20
24
|
return (
|
|
21
|
-
<li className={styles.li}>
|
|
25
|
+
<li className={classnames(props.className, styles.li)}>
|
|
22
26
|
<button onClick={props.onClick} className={styles.button}>{ic}{props.children}</button>
|
|
23
27
|
</li>
|
|
24
28
|
);
|
|
@@ -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 };
|
package/src/demo/Main.tsx
CHANGED
|
@@ -14,7 +14,7 @@ import { componentsMap } from "./componentsMap.js";
|
|
|
14
14
|
type BG = "white" | "transparent" | "mobile";
|
|
15
15
|
|
|
16
16
|
interface ComponentInfo {
|
|
17
|
-
Component: AnyComponent
|
|
17
|
+
Component: AnyComponent<any>; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
18
18
|
name: string;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import Link from "next/link";
|
|
4
|
-
|
|
5
3
|
import { Header, ICON, StickyHeader, HeaderIconAction } from "../../../../index.js";
|
|
4
|
+
import { NextLink } from "../../../NextLink.js";
|
|
6
5
|
|
|
7
6
|
const HeaderDemo = () => {
|
|
8
7
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers,react/no-array-index-key
|
|
@@ -65,7 +64,7 @@ const HeaderWithButtonsDemo = () => {
|
|
|
65
64
|
Some button icons are added on the left to centered aligned title
|
|
66
65
|
</div>
|
|
67
66
|
<Header
|
|
68
|
-
before={<HeaderIconAction icon={ICON.back} to={"/react-miui"} Link={
|
|
67
|
+
before={<HeaderIconAction icon={ICON.back} to={"/react-miui"} Link={NextLink} />}
|
|
69
68
|
center={true}
|
|
70
69
|
>Messages
|
|
71
70
|
</Header>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { useCallback } from "react";
|
|
2
2
|
|
|
3
|
-
import Link from "next/link";
|
|
4
|
-
|
|
5
3
|
import { Item, List } from "../../../../index.js";
|
|
4
|
+
import { NextLink } from "../../../NextLink.js";
|
|
6
5
|
|
|
7
6
|
import styles from "./List.Item.module.scss";
|
|
8
7
|
|
|
@@ -14,7 +13,7 @@ const ListItemDemo = () => {
|
|
|
14
13
|
<Item>I am an item</Item>
|
|
15
14
|
<Item>I am an item</Item>
|
|
16
15
|
<Item href={"https://www.npmjs.com/package/react-miui"}>I am clickable item</Item>
|
|
17
|
-
<Item to={"/react-miui"} Link={
|
|
16
|
+
<Item to={"/react-miui"} Link={NextLink}>I am local link item</Item>
|
|
18
17
|
<Item onClick={handleClick}>Click me to see my action</Item>
|
|
19
18
|
<Item className={styles.custom}>I'm a custom item</Item>
|
|
20
19
|
<Item>I am an item</Item>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import Link from "next/link";
|
|
4
|
-
|
|
5
3
|
import { Action, ICON, StickyHeader, Header, EqualActions } from "../../../../index.js";
|
|
4
|
+
import { NextLink } from "../../../NextLink.js";
|
|
6
5
|
|
|
7
6
|
import styles from "./ActionDemo.module.scss";
|
|
8
7
|
|
|
@@ -15,7 +14,7 @@ const ActionDemo: React.FC = () => {
|
|
|
15
14
|
<Action icon={ICON.checkmark} /> - action without action
|
|
16
15
|
</div>
|
|
17
16
|
<div>
|
|
18
|
-
<Action icon={ICON.checkmark} Link={
|
|
17
|
+
<Action icon={ICON.checkmark} Link={NextLink} to={"react-miui"} /> - internal link action
|
|
19
18
|
</div>
|
|
20
19
|
<div>
|
|
21
20
|
<Action icon={ICON.checkmark} href={"https://www.npmjs.com/package/react-miui"} /> - external link action
|
package/src/types.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/docs/assets/widgets.png
DELETED
|
Binary file
|
|
Binary file
|