math-main-components 0.0.216 → 0.0.218
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/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.stories.d.ts +1 -0
- package/dist/components/NumberDropdown/NumberDropdown.stories.d.ts +1 -1
- package/dist/components/NumberDropdown/index.d.ts +1 -1
- package/dist/index.cjs.js +6 -3
- package/dist/index.esm.js +6 -3
- package/package.json +1 -1
@@ -5,7 +5,7 @@ export declare function Button({ id, children, iconName, iconFill, type, onClick
|
|
5
5
|
iconName?: string;
|
6
6
|
iconFill?: string;
|
7
7
|
type?: ButtonType;
|
8
|
-
children
|
8
|
+
children?: ReactNode;
|
9
9
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
10
10
|
} & React.HTMLAttributes<HTMLButtonElement>): React.JSX.Element;
|
11
11
|
export {};
|
@@ -4,7 +4,7 @@ declare const meta: {
|
|
4
4
|
title: string;
|
5
5
|
component: <Type extends string>({ options, unit, onChangeDropdown, onChangeInput, ...props }: {
|
6
6
|
options: import("./").NumberDropdownOption<Type>[];
|
7
|
-
onChangeDropdown?: ((
|
7
|
+
onChangeDropdown?: ((oldValue: Type, newValue: Type) => void) | undefined;
|
8
8
|
onChangeInput?: ((value: number) => void) | undefined;
|
9
9
|
unit?: string | undefined;
|
10
10
|
} & import("react").InputHTMLAttributes<HTMLInputElement>) => import("react").JSX.Element;
|
@@ -5,7 +5,7 @@ export type NumberDropdownOption<Type> = {
|
|
5
5
|
};
|
6
6
|
export declare const NumberDropdown: <Type extends string>({ options, unit, onChangeDropdown, onChangeInput, ...props }: {
|
7
7
|
options: NumberDropdownOption<Type>[];
|
8
|
-
onChangeDropdown?: ((
|
8
|
+
onChangeDropdown?: ((oldValue: Type, newValue: Type) => void) | undefined;
|
9
9
|
onChangeInput?: ((value: number) => void) | undefined;
|
10
10
|
unit?: string | undefined;
|
11
11
|
} & React.InputHTMLAttributes<HTMLInputElement>) => React.JSX.Element;
|
package/dist/index.cjs.js
CHANGED
@@ -9793,19 +9793,22 @@ function InputText({ id, title, name, placeholder = "", defaultValue = "", autoF
|
|
9793
9793
|
React__default["default"].createElement("span", { className: styles$g.label_text }, title)))));
|
9794
9794
|
}
|
9795
9795
|
|
9796
|
-
var css_248z$f = ".styles-module_container__kkDKN {\n display: flex;\n align-items: center;\n gap: 10px;\n font-family: \"Playfair\", serif;\n border-radius: 18px;\n transition: 0.2s ease-in-out;\n padding-left: 4px;\n background: var(--background-1);\n padding: 6px;\n border: 1px solid var(--border-1);\n margin-bottom: 20px;\n font-family: var(--font-1);\n}\n\n.styles-module_select_container__nqgUF {\n border: 1px solid var(--border-1);\n padding: 0px 20px;\n gap: 10px;\n display: flex;\n align-items: center;\n border-radius: 12px;\n cursor: pointer;\n background: var(--background-1);\n transition: 0.2s ease-in-out;\n height: 55px;\n}\n.styles-module_select_container__nqgUF:hover {\n border-color: var(--primary-2);\n}\n.styles-module_select_container__nqgUF:focus-within {\n border: var(--focus-border);\n box-shadow: var(--focus-shadow);\n background: var(--background-2);\n}\n.styles-module_select_container__nqgUF
|
9797
|
-
var styles$f = {"container":"styles-module_container__kkDKN","select_container":"styles-module_select_container__nqgUF","input":"styles-module_input__pUgcS","input_container":"styles-module_input_container__oRJ75","unit_label":"styles-module_unit_label__bLQWy"};
|
9796
|
+
var css_248z$f = ".styles-module_container__kkDKN {\n display: flex;\n align-items: center;\n gap: 10px;\n font-family: \"Playfair\", serif;\n border-radius: 18px;\n transition: 0.2s ease-in-out;\n padding-left: 4px;\n background: var(--background-1);\n padding: 6px;\n border: 1px solid var(--border-1);\n margin-bottom: 20px;\n font-family: var(--font-1);\n}\n\n.styles-module_select_container__nqgUF {\n border: 1px solid var(--border-1);\n padding: 0px 20px;\n gap: 10px;\n display: flex;\n align-items: center;\n border-radius: 12px;\n cursor: pointer;\n background: var(--background-1);\n transition: 0.2s ease-in-out;\n height: 55px;\n}\n.styles-module_select_container__nqgUF:hover {\n border-color: var(--primary-2);\n}\n.styles-module_select_container__nqgUF:focus-within {\n border: var(--focus-border);\n box-shadow: var(--focus-shadow);\n background: var(--background-2);\n}\n.styles-module_select_container__nqgUF .styles-module_select__27FqK {\n border: none;\n outline: none;\n background: none;\n cursor: pointer;\n font-size: 16px;\n min-width: 64px;\n height: 100%;\n font-family: var(--font-1);\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\n.styles-module_input__pUgcS::-webkit-outer-spin-button,\n.styles-module_input__pUgcS::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.styles-module_input_container__oRJ75 {\n padding: 0px 20px;\n font-size: 16px;\n border-radius: 12px;\n border: 1px solid transparent;\n transition: 0.2s ease;\n flex: 1;\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n background: var(--background-1);\n border-color: var(--border-1);\n height: 55px;\n}\n.styles-module_input_container__oRJ75:hover {\n border-color: var(--primary-2);\n}\n.styles-module_input_container__oRJ75 .styles-module_unit_label__bLQWy {\n font-size: 16px;\n text-align: right;\n}\n.styles-module_input_container__oRJ75:focus-within {\n border: var(--focus-border);\n box-shadow: var(--focus-shadow);\n background: var(--background-2);\n}\n.styles-module_input_container__oRJ75 .styles-module_input__pUgcS {\n width: 0px;\n min-width: 64px;\n outline: none;\n border: none;\n -moz-appearance: textfield;\n appearance: textfield;\n font-size: 16px;\n text-align: right;\n background: transparent;\n font-family: var(--font-1);\n}\n.styles-module_input_container__oRJ75 .styles-module_input__pUgcS[type=number] {\n cursor: pointer;\n flex: 1;\n}\n.styles-module_input_container__oRJ75 .styles-module_input__pUgcS[type=range] {\n width: 100%;\n}\n.styles-module_input_container__oRJ75 .styles-module_input__pUgcS[type=number]:disabled {\n background: transparent;\n color: var(--foreground-3);\n}";
|
9797
|
+
var styles$f = {"container":"styles-module_container__kkDKN","select_container":"styles-module_select_container__nqgUF","select":"styles-module_select__27FqK","input":"styles-module_input__pUgcS","input_container":"styles-module_input_container__oRJ75","unit_label":"styles-module_unit_label__bLQWy"};
|
9798
9798
|
styleInject(css_248z$f);
|
9799
9799
|
|
9800
9800
|
const NumberDropdown = ({ options = [], unit = "", onChangeDropdown = () => { }, onChangeInput = () => { }, ...props }) => {
|
9801
|
+
const [selected, setSelected] = React.useState();
|
9801
9802
|
const onDropdownChange = (event) => {
|
9802
|
-
onChangeDropdown(event.target.value);
|
9803
|
+
onChangeDropdown(selected, event.target.value);
|
9804
|
+
setSelected(event.target.value);
|
9803
9805
|
};
|
9804
9806
|
const onInputChange = (event) => {
|
9805
9807
|
onChangeInput(Number(event.target.value));
|
9806
9808
|
};
|
9807
9809
|
return (React__default["default"].createElement("div", { className: styles$f.container },
|
9808
9810
|
React__default["default"].createElement("div", { className: styles$f.select_container },
|
9811
|
+
React__default["default"].createElement(SvgIcon, { iconName: "expand_more" }),
|
9809
9812
|
React__default["default"].createElement("select", { className: styles$f.select, onChange: onDropdownChange },
|
9810
9813
|
React__default["default"].createElement("option", { value: "none" }, "Ausw\u00E4hlen"),
|
9811
9814
|
options.map((option, index) => (React__default["default"].createElement("option", { key: index, value: option.value }, option.label))))),
|
package/dist/index.esm.js
CHANGED
@@ -9767,19 +9767,22 @@ function InputText({ id, title, name, placeholder = "", defaultValue = "", autoF
|
|
9767
9767
|
React__default.createElement("span", { className: styles$g.label_text }, title)))));
|
9768
9768
|
}
|
9769
9769
|
|
9770
|
-
var css_248z$f = ".styles-module_container__kkDKN {\n display: flex;\n align-items: center;\n gap: 10px;\n font-family: \"Playfair\", serif;\n border-radius: 18px;\n transition: 0.2s ease-in-out;\n padding-left: 4px;\n background: var(--background-1);\n padding: 6px;\n border: 1px solid var(--border-1);\n margin-bottom: 20px;\n font-family: var(--font-1);\n}\n\n.styles-module_select_container__nqgUF {\n border: 1px solid var(--border-1);\n padding: 0px 20px;\n gap: 10px;\n display: flex;\n align-items: center;\n border-radius: 12px;\n cursor: pointer;\n background: var(--background-1);\n transition: 0.2s ease-in-out;\n height: 55px;\n}\n.styles-module_select_container__nqgUF:hover {\n border-color: var(--primary-2);\n}\n.styles-module_select_container__nqgUF:focus-within {\n border: var(--focus-border);\n box-shadow: var(--focus-shadow);\n background: var(--background-2);\n}\n.styles-module_select_container__nqgUF
|
9771
|
-
var styles$f = {"container":"styles-module_container__kkDKN","select_container":"styles-module_select_container__nqgUF","input":"styles-module_input__pUgcS","input_container":"styles-module_input_container__oRJ75","unit_label":"styles-module_unit_label__bLQWy"};
|
9770
|
+
var css_248z$f = ".styles-module_container__kkDKN {\n display: flex;\n align-items: center;\n gap: 10px;\n font-family: \"Playfair\", serif;\n border-radius: 18px;\n transition: 0.2s ease-in-out;\n padding-left: 4px;\n background: var(--background-1);\n padding: 6px;\n border: 1px solid var(--border-1);\n margin-bottom: 20px;\n font-family: var(--font-1);\n}\n\n.styles-module_select_container__nqgUF {\n border: 1px solid var(--border-1);\n padding: 0px 20px;\n gap: 10px;\n display: flex;\n align-items: center;\n border-radius: 12px;\n cursor: pointer;\n background: var(--background-1);\n transition: 0.2s ease-in-out;\n height: 55px;\n}\n.styles-module_select_container__nqgUF:hover {\n border-color: var(--primary-2);\n}\n.styles-module_select_container__nqgUF:focus-within {\n border: var(--focus-border);\n box-shadow: var(--focus-shadow);\n background: var(--background-2);\n}\n.styles-module_select_container__nqgUF .styles-module_select__27FqK {\n border: none;\n outline: none;\n background: none;\n cursor: pointer;\n font-size: 16px;\n min-width: 64px;\n height: 100%;\n font-family: var(--font-1);\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\n.styles-module_input__pUgcS::-webkit-outer-spin-button,\n.styles-module_input__pUgcS::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.styles-module_input_container__oRJ75 {\n padding: 0px 20px;\n font-size: 16px;\n border-radius: 12px;\n border: 1px solid transparent;\n transition: 0.2s ease;\n flex: 1;\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n background: var(--background-1);\n border-color: var(--border-1);\n height: 55px;\n}\n.styles-module_input_container__oRJ75:hover {\n border-color: var(--primary-2);\n}\n.styles-module_input_container__oRJ75 .styles-module_unit_label__bLQWy {\n font-size: 16px;\n text-align: right;\n}\n.styles-module_input_container__oRJ75:focus-within {\n border: var(--focus-border);\n box-shadow: var(--focus-shadow);\n background: var(--background-2);\n}\n.styles-module_input_container__oRJ75 .styles-module_input__pUgcS {\n width: 0px;\n min-width: 64px;\n outline: none;\n border: none;\n -moz-appearance: textfield;\n appearance: textfield;\n font-size: 16px;\n text-align: right;\n background: transparent;\n font-family: var(--font-1);\n}\n.styles-module_input_container__oRJ75 .styles-module_input__pUgcS[type=number] {\n cursor: pointer;\n flex: 1;\n}\n.styles-module_input_container__oRJ75 .styles-module_input__pUgcS[type=range] {\n width: 100%;\n}\n.styles-module_input_container__oRJ75 .styles-module_input__pUgcS[type=number]:disabled {\n background: transparent;\n color: var(--foreground-3);\n}";
|
9771
|
+
var styles$f = {"container":"styles-module_container__kkDKN","select_container":"styles-module_select_container__nqgUF","select":"styles-module_select__27FqK","input":"styles-module_input__pUgcS","input_container":"styles-module_input_container__oRJ75","unit_label":"styles-module_unit_label__bLQWy"};
|
9772
9772
|
styleInject(css_248z$f);
|
9773
9773
|
|
9774
9774
|
const NumberDropdown = ({ options = [], unit = "", onChangeDropdown = () => { }, onChangeInput = () => { }, ...props }) => {
|
9775
|
+
const [selected, setSelected] = useState();
|
9775
9776
|
const onDropdownChange = (event) => {
|
9776
|
-
onChangeDropdown(event.target.value);
|
9777
|
+
onChangeDropdown(selected, event.target.value);
|
9778
|
+
setSelected(event.target.value);
|
9777
9779
|
};
|
9778
9780
|
const onInputChange = (event) => {
|
9779
9781
|
onChangeInput(Number(event.target.value));
|
9780
9782
|
};
|
9781
9783
|
return (React__default.createElement("div", { className: styles$f.container },
|
9782
9784
|
React__default.createElement("div", { className: styles$f.select_container },
|
9785
|
+
React__default.createElement(SvgIcon, { iconName: "expand_more" }),
|
9783
9786
|
React__default.createElement("select", { className: styles$f.select, onChange: onDropdownChange },
|
9784
9787
|
React__default.createElement("option", { value: "none" }, "Ausw\u00E4hlen"),
|
9785
9788
|
options.map((option, index) => (React__default.createElement("option", { key: index, value: option.value }, option.label))))),
|