math-main-components 0.0.218 → 0.0.221
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.
@@ -2,8 +2,9 @@
|
|
2
2
|
import type { StoryObj } from '@storybook/react';
|
3
3
|
declare const meta: {
|
4
4
|
title: string;
|
5
|
-
component: <Type extends string>({ options, unit, onChangeDropdown, onChangeInput, ...props }: {
|
5
|
+
component: <Type extends string>({ options, unit, defaultValue, onChangeDropdown, onChangeInput, ...props }: {
|
6
6
|
options: import("./").NumberDropdownOption<Type>[];
|
7
|
+
defaultValue: Type;
|
7
8
|
onChangeDropdown?: ((oldValue: Type, newValue: Type) => void) | undefined;
|
8
9
|
onChangeInput?: ((value: number) => void) | undefined;
|
9
10
|
unit?: string | undefined;
|
@@ -3,8 +3,9 @@ export type NumberDropdownOption<Type> = {
|
|
3
3
|
value: Type;
|
4
4
|
label: string;
|
5
5
|
};
|
6
|
-
export declare const NumberDropdown: <Type extends string>({ options, unit, onChangeDropdown, onChangeInput, ...props }: {
|
6
|
+
export declare const NumberDropdown: <Type extends string>({ options, unit, defaultValue, onChangeDropdown, onChangeInput, ...props }: {
|
7
7
|
options: NumberDropdownOption<Type>[];
|
8
|
+
defaultValue: Type;
|
8
9
|
onChangeDropdown?: ((oldValue: Type, newValue: Type) => void) | undefined;
|
9
10
|
onChangeInput?: ((value: number) => void) | undefined;
|
10
11
|
unit?: string | undefined;
|
package/dist/index.cjs.js
CHANGED
@@ -9430,7 +9430,7 @@ function Accordeon({ title, children }) {
|
|
9430
9430
|
React__default["default"].createElement("div", { className: styles$y.content }, children)));
|
9431
9431
|
}
|
9432
9432
|
|
9433
|
-
var css_248z$x = ".styles-module_container__TP0rp {\n max-width: 100%;\n}\n\n.styles-module_button__Sh-fr {\n padding: 10px 18px;\n border-radius: 40px;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n gap: 10px;\n font-size: 15px;\n font-weight: 400;\n align-items: center;\n border: none;\n transition: 0.2s ease-in-out;\n font-family: \"Space Grotesk\", sans-serif;\n border: 1px solid transparent;\n}\n.styles-module_button__Sh-fr:hover {\n filter: brightness(0.9);\n}\n.styles-module_button__Sh-fr:focus {\n border: var(--focus-border);\n box-shadow: var(--focus-shadow);\n}\n.styles-module_button__Sh-fr.styles-module_blue__DRdbo {\n background: var(--primary-1);\n color: white;\n}\n.styles-module_button__Sh-fr.styles-module_lightBlue__7EKfp {\n background: var(--primary-2);\n color: var(--primary-1);\n}\n.styles-module_button__Sh-fr.styles-module_red__EhImH {\n background: var(--red-1);\n color: white;\n}\n.styles-module_button__Sh-fr.styles-module_grey__kAVD1 {\n background: var(--background-1);\n color: var(--foreground-2);\n}\n.styles-module_button__Sh-fr.styles-module_onlyIcon__bNVnI {\n width: 44px;\n height: 44px;\n padding: 0;\n align-items: center;\n justify-content: center;\n}\n.styles-module_button__Sh-fr.styles-module_onlyIcon__bNVnI span {\n font-size: 22px !important;\n}";
|
9433
|
+
var css_248z$x = ".styles-module_container__TP0rp {\n max-width: 100%;\n}\n\n.styles-module_button__Sh-fr {\n padding: 10px 18px;\n border-radius: 40px;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n gap: 10px;\n font-size: 15px;\n font-weight: 400;\n align-items: center;\n justify-content: center;\n border: none;\n transition: 0.2s ease-in-out;\n font-family: \"Space Grotesk\", sans-serif;\n border: 1px solid transparent;\n}\n.styles-module_button__Sh-fr:hover {\n filter: brightness(0.9);\n}\n.styles-module_button__Sh-fr:focus {\n border: var(--focus-border);\n box-shadow: var(--focus-shadow);\n}\n.styles-module_button__Sh-fr.styles-module_blue__DRdbo {\n background: var(--primary-1);\n color: white;\n}\n.styles-module_button__Sh-fr.styles-module_lightBlue__7EKfp {\n background: var(--primary-2);\n color: var(--primary-1);\n}\n.styles-module_button__Sh-fr.styles-module_red__EhImH {\n background: var(--red-1);\n color: white;\n}\n.styles-module_button__Sh-fr.styles-module_grey__kAVD1 {\n background: var(--background-1);\n color: var(--foreground-2);\n}\n.styles-module_button__Sh-fr.styles-module_onlyIcon__bNVnI {\n width: 44px;\n height: 44px;\n padding: 0;\n align-items: center;\n justify-content: center;\n}\n.styles-module_button__Sh-fr.styles-module_onlyIcon__bNVnI span {\n font-size: 22px !important;\n}";
|
9434
9434
|
var styles$x = {"container":"styles-module_container__TP0rp","button":"styles-module_button__Sh-fr","blue":"styles-module_blue__DRdbo","lightBlue":"styles-module_lightBlue__7EKfp","red":"styles-module_red__EhImH","grey":"styles-module_grey__kAVD1","onlyIcon":"styles-module_onlyIcon__bNVnI"};
|
9435
9435
|
styleInject(css_248z$x);
|
9436
9436
|
|
@@ -9797,8 +9797,9 @@ var css_248z$f = ".styles-module_container__kkDKN {\n display: flex;\n align-i
|
|
9797
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
|
-
const NumberDropdown = ({ options = [], unit = "", onChangeDropdown = () => { }, onChangeInput = () => { }, ...props }) => {
|
9801
|
-
const [selected, setSelected] = React.useState();
|
9800
|
+
const NumberDropdown = ({ options = [], unit = "", defaultValue, onChangeDropdown = () => { }, onChangeInput = () => { }, ...props }) => {
|
9801
|
+
const [selected, setSelected] = React.useState(defaultValue);
|
9802
|
+
React.useEffect(() => setSelected(defaultValue), [defaultValue]);
|
9802
9803
|
const onDropdownChange = (event) => {
|
9803
9804
|
onChangeDropdown(selected, event.target.value);
|
9804
9805
|
setSelected(event.target.value);
|
@@ -9809,7 +9810,7 @@ const NumberDropdown = ({ options = [], unit = "", onChangeDropdown = () => { },
|
|
9809
9810
|
return (React__default["default"].createElement("div", { className: styles$f.container },
|
9810
9811
|
React__default["default"].createElement("div", { className: styles$f.select_container },
|
9811
9812
|
React__default["default"].createElement(SvgIcon, { iconName: "expand_more" }),
|
9812
|
-
React__default["default"].createElement("select", { className: styles$f.select, onChange: onDropdownChange },
|
9813
|
+
React__default["default"].createElement("select", { className: styles$f.select, onChange: onDropdownChange, value: selected },
|
9813
9814
|
React__default["default"].createElement("option", { value: "none" }, "Ausw\u00E4hlen"),
|
9814
9815
|
options.map((option, index) => (React__default["default"].createElement("option", { key: index, value: option.value }, option.label))))),
|
9815
9816
|
React__default["default"].createElement("div", { className: styles$f.input_container },
|
package/dist/index.esm.js
CHANGED
@@ -9404,7 +9404,7 @@ function Accordeon({ title, children }) {
|
|
9404
9404
|
React__default.createElement("div", { className: styles$y.content }, children)));
|
9405
9405
|
}
|
9406
9406
|
|
9407
|
-
var css_248z$x = ".styles-module_container__TP0rp {\n max-width: 100%;\n}\n\n.styles-module_button__Sh-fr {\n padding: 10px 18px;\n border-radius: 40px;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n gap: 10px;\n font-size: 15px;\n font-weight: 400;\n align-items: center;\n border: none;\n transition: 0.2s ease-in-out;\n font-family: \"Space Grotesk\", sans-serif;\n border: 1px solid transparent;\n}\n.styles-module_button__Sh-fr:hover {\n filter: brightness(0.9);\n}\n.styles-module_button__Sh-fr:focus {\n border: var(--focus-border);\n box-shadow: var(--focus-shadow);\n}\n.styles-module_button__Sh-fr.styles-module_blue__DRdbo {\n background: var(--primary-1);\n color: white;\n}\n.styles-module_button__Sh-fr.styles-module_lightBlue__7EKfp {\n background: var(--primary-2);\n color: var(--primary-1);\n}\n.styles-module_button__Sh-fr.styles-module_red__EhImH {\n background: var(--red-1);\n color: white;\n}\n.styles-module_button__Sh-fr.styles-module_grey__kAVD1 {\n background: var(--background-1);\n color: var(--foreground-2);\n}\n.styles-module_button__Sh-fr.styles-module_onlyIcon__bNVnI {\n width: 44px;\n height: 44px;\n padding: 0;\n align-items: center;\n justify-content: center;\n}\n.styles-module_button__Sh-fr.styles-module_onlyIcon__bNVnI span {\n font-size: 22px !important;\n}";
|
9407
|
+
var css_248z$x = ".styles-module_container__TP0rp {\n max-width: 100%;\n}\n\n.styles-module_button__Sh-fr {\n padding: 10px 18px;\n border-radius: 40px;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n gap: 10px;\n font-size: 15px;\n font-weight: 400;\n align-items: center;\n justify-content: center;\n border: none;\n transition: 0.2s ease-in-out;\n font-family: \"Space Grotesk\", sans-serif;\n border: 1px solid transparent;\n}\n.styles-module_button__Sh-fr:hover {\n filter: brightness(0.9);\n}\n.styles-module_button__Sh-fr:focus {\n border: var(--focus-border);\n box-shadow: var(--focus-shadow);\n}\n.styles-module_button__Sh-fr.styles-module_blue__DRdbo {\n background: var(--primary-1);\n color: white;\n}\n.styles-module_button__Sh-fr.styles-module_lightBlue__7EKfp {\n background: var(--primary-2);\n color: var(--primary-1);\n}\n.styles-module_button__Sh-fr.styles-module_red__EhImH {\n background: var(--red-1);\n color: white;\n}\n.styles-module_button__Sh-fr.styles-module_grey__kAVD1 {\n background: var(--background-1);\n color: var(--foreground-2);\n}\n.styles-module_button__Sh-fr.styles-module_onlyIcon__bNVnI {\n width: 44px;\n height: 44px;\n padding: 0;\n align-items: center;\n justify-content: center;\n}\n.styles-module_button__Sh-fr.styles-module_onlyIcon__bNVnI span {\n font-size: 22px !important;\n}";
|
9408
9408
|
var styles$x = {"container":"styles-module_container__TP0rp","button":"styles-module_button__Sh-fr","blue":"styles-module_blue__DRdbo","lightBlue":"styles-module_lightBlue__7EKfp","red":"styles-module_red__EhImH","grey":"styles-module_grey__kAVD1","onlyIcon":"styles-module_onlyIcon__bNVnI"};
|
9409
9409
|
styleInject(css_248z$x);
|
9410
9410
|
|
@@ -9771,8 +9771,9 @@ var css_248z$f = ".styles-module_container__kkDKN {\n display: flex;\n align-i
|
|
9771
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
|
-
const NumberDropdown = ({ options = [], unit = "", onChangeDropdown = () => { }, onChangeInput = () => { }, ...props }) => {
|
9775
|
-
const [selected, setSelected] = useState();
|
9774
|
+
const NumberDropdown = ({ options = [], unit = "", defaultValue, onChangeDropdown = () => { }, onChangeInput = () => { }, ...props }) => {
|
9775
|
+
const [selected, setSelected] = useState(defaultValue);
|
9776
|
+
useEffect(() => setSelected(defaultValue), [defaultValue]);
|
9776
9777
|
const onDropdownChange = (event) => {
|
9777
9778
|
onChangeDropdown(selected, event.target.value);
|
9778
9779
|
setSelected(event.target.value);
|
@@ -9783,7 +9784,7 @@ const NumberDropdown = ({ options = [], unit = "", onChangeDropdown = () => { },
|
|
9783
9784
|
return (React__default.createElement("div", { className: styles$f.container },
|
9784
9785
|
React__default.createElement("div", { className: styles$f.select_container },
|
9785
9786
|
React__default.createElement(SvgIcon, { iconName: "expand_more" }),
|
9786
|
-
React__default.createElement("select", { className: styles$f.select, onChange: onDropdownChange },
|
9787
|
+
React__default.createElement("select", { className: styles$f.select, onChange: onDropdownChange, value: selected },
|
9787
9788
|
React__default.createElement("option", { value: "none" }, "Ausw\u00E4hlen"),
|
9788
9789
|
options.map((option, index) => (React__default.createElement("option", { key: index, value: option.value }, option.label))))),
|
9789
9790
|
React__default.createElement("div", { className: styles$f.input_container },
|