@babylonjs/shared-ui-components 8.16.1 → 8.16.2
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/components/Button.d.ts +2 -2
- package/components/Button.js +1 -1
- package/components/Button.js.map +1 -1
- package/components/TextInputWithSubmit.js +2 -2
- package/components/TextInputWithSubmit.js.map +1 -1
- package/fluent/hoc/buttonLine.d.ts +2 -8
- package/fluent/hoc/buttonLine.js +3 -9
- package/fluent/hoc/buttonLine.js.map +1 -1
- package/fluent/hoc/fileUploadLine.d.ts +2 -2
- package/fluent/hoc/fileUploadLine.js +2 -1
- package/fluent/hoc/fileUploadLine.js.map +1 -1
- package/fluent/hoc/{readonlyBooleanLine.d.ts → propertyLines/booleanBadgePropertyLine.d.ts} +1 -1
- package/fluent/hoc/{readonlyBooleanLine.js → propertyLines/booleanBadgePropertyLine.js} +2 -2
- package/fluent/hoc/propertyLines/booleanBadgePropertyLine.js.map +1 -0
- package/fluent/hoc/{checkboxPropertyLine.d.ts → propertyLines/checkboxPropertyLine.d.ts} +1 -1
- package/fluent/hoc/{checkboxPropertyLine.js → propertyLines/checkboxPropertyLine.js} +1 -1
- package/fluent/hoc/propertyLines/checkboxPropertyLine.js.map +1 -0
- package/fluent/hoc/{colorPropertyLine.d.ts → propertyLines/colorPropertyLine.d.ts} +1 -1
- package/fluent/hoc/{colorPropertyLine.js → propertyLines/colorPropertyLine.js} +3 -3
- package/fluent/hoc/propertyLines/colorPropertyLine.js.map +1 -0
- package/fluent/hoc/{dropdownPropertyLine.d.ts → propertyLines/dropdownPropertyLine.d.ts} +1 -1
- package/fluent/hoc/{dropdownPropertyLine.js → propertyLines/dropdownPropertyLine.js} +1 -1
- package/fluent/hoc/propertyLines/dropdownPropertyLine.js.map +1 -0
- package/fluent/hoc/{hexLineComponent.d.ts → propertyLines/hexPropertyLine.d.ts} +1 -1
- package/fluent/hoc/{hexLineComponent.js → propertyLines/hexPropertyLine.js} +2 -2
- package/fluent/hoc/propertyLines/hexPropertyLine.js.map +1 -0
- package/fluent/hoc/{inputPropertyLine.d.ts → propertyLines/inputPropertyLine.d.ts} +1 -1
- package/fluent/hoc/{inputPropertyLine.js → propertyLines/inputPropertyLine.js} +1 -1
- package/fluent/hoc/propertyLines/inputPropertyLine.js.map +1 -0
- package/fluent/hoc/{linkPropertyLine.js → propertyLines/linkPropertyLine.js} +1 -1
- package/fluent/hoc/propertyLines/linkPropertyLine.js.map +1 -0
- package/fluent/hoc/{propertyLine.js → propertyLines/propertyLine.js} +3 -3
- package/fluent/hoc/propertyLines/propertyLine.js.map +1 -0
- package/fluent/hoc/{switchPropertyLine.d.ts → propertyLines/switchPropertyLine.d.ts} +1 -1
- package/fluent/hoc/{switchPropertyLine.js → propertyLines/switchPropertyLine.js} +1 -1
- package/fluent/hoc/propertyLines/switchPropertyLine.js.map +1 -0
- package/fluent/hoc/propertyLines/syncedSliderPropertyLine.d.ts +11 -0
- package/fluent/hoc/{syncedSliderLine.js → propertyLines/syncedSliderPropertyLine.js} +3 -3
- package/fluent/hoc/propertyLines/syncedSliderPropertyLine.js.map +1 -0
- package/fluent/hoc/propertyLines/textPropertyLine.js.map +1 -0
- package/fluent/hoc/{vectorPropertyLine.js → propertyLines/vectorPropertyLine.js} +2 -2
- package/fluent/hoc/propertyLines/vectorPropertyLine.js.map +1 -0
- package/fluent/primitives/button.d.ts +9 -0
- package/fluent/primitives/button.js +14 -0
- package/fluent/primitives/button.js.map +1 -0
- package/fluent/primitives/checkbox.d.ts +1 -1
- package/fluent/primitives/checkbox.js.map +1 -1
- package/fluent/primitives/colorPicker.d.ts +1 -1
- package/fluent/primitives/colorPicker.js.map +1 -1
- package/fluent/primitives/draggable.d.ts +8 -0
- package/fluent/primitives/draggable.js +33 -0
- package/fluent/primitives/draggable.js.map +1 -0
- package/fluent/primitives/dropdown.d.ts +1 -1
- package/fluent/primitives/dropdown.js.map +1 -1
- package/fluent/primitives/gradient.d.ts +1 -1
- package/fluent/primitives/gradient.js.map +1 -1
- package/fluent/primitives/input.d.ts +1 -1
- package/fluent/primitives/input.js.map +1 -1
- package/fluent/primitives/spinButton.d.ts +8 -2
- package/fluent/primitives/spinButton.js +4 -2
- package/fluent/primitives/spinButton.js.map +1 -1
- package/fluent/primitives/switch.d.ts +1 -1
- package/fluent/primitives/switch.js.map +1 -1
- package/fluent/primitives/syncedSlider.d.ts +1 -1
- package/fluent/primitives/syncedSlider.js.map +1 -1
- package/fluent/primitives/textarea.d.ts +1 -1
- package/fluent/primitives/textarea.js.map +1 -1
- package/lines/booleanLineComponent.js +2 -2
- package/lines/booleanLineComponent.js.map +1 -1
- package/lines/buttonLineComponent.js +3 -1
- package/lines/buttonLineComponent.js.map +1 -1
- package/lines/checkBoxLineComponent.js +1 -1
- package/lines/checkBoxLineComponent.js.map +1 -1
- package/lines/colorLineComponent.js +2 -2
- package/lines/colorLineComponent.js.map +1 -1
- package/lines/draggableLineComponent.d.ts +4 -10
- package/lines/draggableLineComponent.js +12 -10
- package/lines/draggableLineComponent.js.map +1 -1
- package/lines/draggableLineWithButtonComponent.d.ts +3 -7
- package/lines/draggableLineWithButtonComponent.js +14 -12
- package/lines/draggableLineWithButtonComponent.js.map +1 -1
- package/lines/fileButtonLineComponent.js +2 -1
- package/lines/fileButtonLineComponent.js.map +1 -1
- package/lines/floatLineComponent.d.ts +2 -0
- package/lines/floatLineComponent.js +23 -1
- package/lines/floatLineComponent.js.map +1 -1
- package/lines/messageLineComponent.d.ts +2 -0
- package/lines/messageLineComponent.js +9 -1
- package/lines/messageLineComponent.js.map +1 -1
- package/lines/optionsLineComponent.js +1 -1
- package/lines/optionsLineComponent.js.map +1 -1
- package/lines/sliderLineComponent.js +2 -2
- package/lines/sliderLineComponent.js.map +1 -1
- package/lines/textInputLineComponent.js +1 -1
- package/lines/textInputLineComponent.js.map +1 -1
- package/lines/textLineComponent.js +4 -4
- package/lines/textLineComponent.js.map +1 -1
- package/lines/vector3LineComponent.js +1 -1
- package/lines/vector3LineComponent.js.map +1 -1
- package/package.json +1 -1
- package/split/splitContainer.js +4 -2
- package/split/splitContainer.js.map +1 -1
- package/fluent/hoc/checkboxPropertyLine.js.map +0 -1
- package/fluent/hoc/colorPropertyLine.js.map +0 -1
- package/fluent/hoc/dropdownPropertyLine.js.map +0 -1
- package/fluent/hoc/hexLineComponent.js.map +0 -1
- package/fluent/hoc/inputPropertyLine.js.map +0 -1
- package/fluent/hoc/linkPropertyLine.js.map +0 -1
- package/fluent/hoc/propertyLine.js.map +0 -1
- package/fluent/hoc/readonlyBooleanLine.js.map +0 -1
- package/fluent/hoc/switchPropertyLine.js.map +0 -1
- package/fluent/hoc/syncedSliderLine.d.ts +0 -11
- package/fluent/hoc/syncedSliderLine.js.map +0 -1
- package/fluent/hoc/textPropertyLine.js.map +0 -1
- package/fluent/hoc/vectorPropertyLine.js.map +0 -1
- /package/fluent/hoc/{linkPropertyLine.d.ts → propertyLines/linkPropertyLine.d.ts} +0 -0
- /package/fluent/hoc/{propertyLine.d.ts → propertyLines/propertyLine.d.ts} +0 -0
- /package/fluent/hoc/{textPropertyLine.d.ts → propertyLines/textPropertyLine.d.ts} +0 -0
- /package/fluent/hoc/{textPropertyLine.js → propertyLines/textPropertyLine.js} +0 -0
- /package/fluent/hoc/{vectorPropertyLine.d.ts → propertyLines/vectorPropertyLine.d.ts} +0 -0
package/components/Button.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { PropsWithChildren } from "react";
|
2
|
-
export type
|
2
|
+
export type ButtonComponentProps = {
|
3
3
|
disabled?: boolean;
|
4
4
|
active?: boolean;
|
5
5
|
onClick?: () => void;
|
@@ -8,4 +8,4 @@ export type ButtonProps = {
|
|
8
8
|
title?: string;
|
9
9
|
backgroundColor?: string;
|
10
10
|
};
|
11
|
-
export declare const
|
11
|
+
export declare const ButtonComponent: React.FC<PropsWithChildren<ButtonComponentProps>>;
|
package/components/Button.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import * as styles from "./Button.module.scss";
|
3
3
|
import { ClassNames } from "./classNames.js";
|
4
|
-
export const
|
4
|
+
export const ButtonComponent = ({ disabled, active, onClick, children, color, size, title, backgroundColor }) => {
|
5
5
|
return (_jsx("button", { className: ClassNames({ button: true, active, wide: size === "wide", small: size === "small", smaller: size === "smaller", light: color === "light", dark: color === "dark" }, styles), disabled: disabled, onClick: onClick, title: title, style: { backgroundColor }, children: children }));
|
6
6
|
};
|
7
7
|
//# sourceMappingURL=Button.js.map
|
package/components/Button.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/components/Button.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/components/Button.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,MAAM,CAAC,MAAM,eAAe,GAAsD,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE;IAC/J,OAAO,CACH,iBACI,SAAS,EAAE,UAAU,CACjB,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,KAAK,MAAM,EAAE,KAAK,EAAE,IAAI,KAAK,OAAO,EAAE,OAAO,EAAE,IAAI,KAAK,SAAS,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,EAAE,IAAI,EAAE,KAAK,KAAK,MAAM,EAAE,EACvJ,MAAM,CACT,EACD,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,EAAE,eAAe,EAAE,YAEzB,QAAQ,GACJ,CACZ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type { PropsWithChildren } from \"react\";\r\nimport * as styles from \"./Button.module.scss\";\r\nimport { ClassNames } from \"./classNames\";\r\n\r\n// Will be deleted after fluent work complete\r\nexport type ButtonComponentProps = {\r\n disabled?: boolean;\r\n active?: boolean;\r\n onClick?: () => void;\r\n color: \"light\" | \"dark\";\r\n size: \"default\" | \"small\" | \"wide\" | \"smaller\";\r\n title?: string;\r\n backgroundColor?: string;\r\n};\r\n\r\nexport const ButtonComponent: React.FC<PropsWithChildren<ButtonComponentProps>> = ({ disabled, active, onClick, children, color, size, title, backgroundColor }) => {\r\n return (\r\n <button\r\n className={ClassNames(\r\n { button: true, active, wide: size === \"wide\", small: size === \"small\", smaller: size === \"smaller\", light: color === \"light\", dark: color === \"dark\" },\r\n styles\r\n )}\r\n disabled={disabled}\r\n onClick={onClick}\r\n title={title}\r\n style={{ backgroundColor }}\r\n >\r\n {children}\r\n </button>\r\n );\r\n};\r\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { useEffect, useState } from "react";
|
3
|
-
import {
|
3
|
+
import { ButtonComponent } from "./Button.js";
|
4
4
|
import { Icon } from "./Icon.js";
|
5
5
|
import * as style from "./TextInputWithSubmit.module.scss";
|
6
6
|
import submitIcon from "../imgs/confirmGridElementDark.svg";
|
@@ -27,6 +27,6 @@ export const TextInputWithSubmit = (props) => {
|
|
27
27
|
props.cancelSubmit?.();
|
28
28
|
setValue("");
|
29
29
|
};
|
30
|
-
return (_jsxs("div", { className: ClassNames({ line: true, valid, invalid: !valid }, style), children: [props.label && _jsx("label", { children: props.label }), _jsx("input", { className: style.input, type: "text", placeholder: props.placeholder, value: value, onChange: onChange }), _jsxs("div", { children: [_jsx(
|
30
|
+
return (_jsxs("div", { className: ClassNames({ line: true, valid, invalid: !valid }, style), children: [props.label && _jsx("label", { children: props.label }), _jsx("input", { className: style.input, type: "text", placeholder: props.placeholder, value: value, onChange: onChange }), _jsxs("div", { children: [_jsx(ButtonComponent, { color: "light", size: "smaller", backgroundColor: "inherit", onClick: onClickSubmit, disabled: !valid, children: _jsx(Icon, { icon: submitIcon, color: "dark" }) }), _jsx(ButtonComponent, { color: "light", size: "smaller", backgroundColor: "inherit", onClick: onClickCancel, children: _jsx(Icon, { icon: cancelIcon, color: "dark" }) })] })] }));
|
31
31
|
};
|
32
32
|
//# sourceMappingURL=TextInputWithSubmit.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextInputWithSubmit.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/components/TextInputWithSubmit.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"TextInputWithSubmit.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/components/TextInputWithSubmit.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAE3D,OAAO,UAAU,MAAM,oCAAoC,CAAC;AAC5D,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAU1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAsB,EAAE,EAAE;IAC1D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvC,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Q,EAAE,CAAC,KAAK,YAC5G,KAAC,IAAI,IAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,GAAQ,GAC9B,EAClB,KAAC,eAAe,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,SAAS,EAAC,eAAe,EAAC,SAAS,EAAC,OAAO,EAAE,aAAa,YAC1F,KAAC,IAAI,IAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,GAAQ,GAC9B,IAChB,IACJ,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from \"react\";\r\nimport { ButtonComponent } from \"./Button\";\r\nimport { Icon } from \"./Icon\";\r\nimport * as style from \"./TextInputWithSubmit.module.scss\";\r\n\r\nimport submitIcon from \"../imgs/confirmGridElementDark.svg\";\r\nimport cancelIcon from \"../imgs/deleteGridElementDark.svg\";\r\nimport { ClassNames } from \"./classNames\";\r\n\r\nexport interface ITextInputProps {\r\n label?: string;\r\n placeholder?: string;\r\n submitValue: (newValue: string) => void; // Function to call when the value is updated\r\n validateValue?: (value: string) => boolean; // Function to call to validate the value\r\n cancelSubmit?: () => void; // Function to call when the user cancels the submit\r\n}\r\n\r\n/**\r\n * This component represents a text input that can be submitted or cancelled on buttons\r\n * @param props properties\r\n * @returns TextInputWithSubmit element\r\n */\r\nexport const TextInputWithSubmit = (props: ITextInputProps) => {\r\n const [value, setValue] = useState(\"\");\r\n const [valid, setValid] = useState(props.validateValue ? props.validateValue(value) : true);\r\n\r\n useEffect(() => {\r\n setValid(props.validateValue ? props.validateValue(value) : true);\r\n }, [value]);\r\n\r\n const onChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n setValue(event.target.value);\r\n };\r\n\r\n const onClickSubmit = () => {\r\n props.submitValue(value);\r\n };\r\n\r\n const onClickCancel = () => {\r\n props.cancelSubmit?.();\r\n setValue(\"\");\r\n };\r\n\r\n return (\r\n <div className={ClassNames({ line: true, valid, invalid: !valid }, style)}>\r\n {props.label && <label>{props.label}</label>}\r\n <input className={style.input} type=\"text\" placeholder={props.placeholder} value={value} onChange={onChange} />\r\n <div>\r\n <ButtonComponent color=\"light\" size=\"smaller\" backgroundColor=\"inherit\" onClick={onClickSubmit} disabled={!valid}>\r\n <Icon icon={submitIcon} color=\"dark\"></Icon>\r\n </ButtonComponent>\r\n <ButtonComponent color=\"light\" size=\"smaller\" backgroundColor=\"inherit\" onClick={onClickCancel}>\r\n <Icon icon={cancelIcon} color=\"dark\"></Icon>\r\n </ButtonComponent>\r\n </div>\r\n </div>\r\n );\r\n};\r\n"]}
|
@@ -1,14 +1,8 @@
|
|
1
1
|
import type { FunctionComponent } from "react";
|
2
|
-
|
3
|
-
label: string;
|
4
|
-
onClick: () => void;
|
5
|
-
disabled?: boolean;
|
6
|
-
icon?: string;
|
7
|
-
title?: string;
|
8
|
-
};
|
2
|
+
import type { ButtonProps } from "../primitives/button.js";
|
9
3
|
/**
|
10
4
|
* Wraps a button with a label in a line container
|
11
5
|
* @param props Button props plus a label
|
12
6
|
* @returns A button inside a line
|
13
7
|
*/
|
14
|
-
export declare const ButtonLine: FunctionComponent<
|
8
|
+
export declare const ButtonLine: FunctionComponent<ButtonProps>;
|
package/fluent/hoc/buttonLine.js
CHANGED
@@ -1,18 +1,12 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
const useButtonLineStyles = makeStyles({
|
5
|
-
button: {
|
6
|
-
border: `1px solid ${tokens.colorBrandBackground}`,
|
7
|
-
},
|
8
|
-
});
|
2
|
+
import { LineContainer } from "./propertyLines/propertyLine.js";
|
3
|
+
import { Button } from "../primitives/button.js";
|
9
4
|
/**
|
10
5
|
* Wraps a button with a label in a line container
|
11
6
|
* @param props Button props plus a label
|
12
7
|
* @returns A button inside a line
|
13
8
|
*/
|
14
9
|
export const ButtonLine = (props) => {
|
15
|
-
|
16
|
-
return (_jsx(LineContainer, { children: _jsx(Button, { className: classes.button, ...props, children: _jsx(Body1, { children: props.label }) }) }));
|
10
|
+
return (_jsx(LineContainer, { children: _jsx(Button, { ...props }) }));
|
17
11
|
};
|
18
12
|
//# sourceMappingURL=buttonLine.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"buttonLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/buttonLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"buttonLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/buttonLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAmC,CAAC,KAAK,EAAE,EAAE;IAChE,OAAO,CACH,KAAC,aAAa,cACV,KAAC,MAAM,OAAK,KAAK,GAAI,GACT,CACnB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { LineContainer } from \"./propertyLines/propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { Button } from \"../primitives/button\";\r\nimport type { ButtonProps } from \"../primitives/button\";\r\n\r\n/**\r\n * Wraps a button with a label in a line container\r\n * @param props Button props plus a label\r\n * @returns A button inside a line\r\n */\r\nexport const ButtonLine: FunctionComponent<ButtonProps> = (props) => {\r\n return (\r\n <LineContainer>\r\n <Button {...props} />\r\n </LineContainer>\r\n );\r\n};\r\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { FunctionComponent } from "react";
|
2
|
-
import type {
|
3
|
-
type FileUploadLineProps = Omit<
|
2
|
+
import type { ButtonProps } from "../primitives/button.js";
|
3
|
+
type FileUploadLineProps = Omit<ButtonProps, "onClick"> & {
|
4
4
|
onClick: (files: FileList) => void;
|
5
5
|
accept: string;
|
6
6
|
};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { useRef } from "react";
|
3
3
|
import { ButtonLine } from "./buttonLine.js";
|
4
|
+
import { ArrowUploadRegular } from "@fluentui/react-icons";
|
4
5
|
export const FileUploadLine = (props) => {
|
5
6
|
const inputRef = useRef(null);
|
6
7
|
const handleButtonClick = () => {
|
@@ -13,6 +14,6 @@ export const FileUploadLine = (props) => {
|
|
13
14
|
}
|
14
15
|
evt.target.value = "";
|
15
16
|
};
|
16
|
-
return (_jsxs(_Fragment, { children: [_jsx(ButtonLine, { onClick: handleButtonClick, label: props.label }), _jsx("input", { ref: inputRef, type: "file", accept: props.accept, style: { display: "none" }, onChange: handleChange })] }));
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx(ButtonLine, { onClick: handleButtonClick, icon: ArrowUploadRegular, label: props.label }), _jsx("input", { ref: inputRef, type: "file", accept: props.accept, style: { display: "none" }, onChange: handleChange })] }));
|
17
18
|
};
|
18
19
|
//# sourceMappingURL=fileUploadLine.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fileUploadLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/fileUploadLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"fileUploadLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/fileUploadLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAO3D,MAAM,CAAC,MAAM,cAAc,GAA2C,CAAC,KAAK,EAAE,EAAE;IAC5E,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAEhD,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC3B,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAC9B,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,CAAC,GAAwC,EAAE,EAAE;QAC9D,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/B,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACxB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;QACD,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,CACH,8BACI,KAAC,UAAU,IAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,GAAe,EACnG,gBAAO,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAC,MAAM,EAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,YAAY,GAAI,IAC/G,CACN,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { useRef } from \"react\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { ButtonLine } from \"./buttonLine\";\r\nimport type { ButtonProps } from \"../primitives/button\";\r\nimport { ArrowUploadRegular } from \"@fluentui/react-icons\";\r\n\r\ntype FileUploadLineProps = Omit<ButtonProps, \"onClick\"> & {\r\n onClick: (files: FileList) => void;\r\n accept: string;\r\n};\r\n\r\nexport const FileUploadLine: FunctionComponent<FileUploadLineProps> = (props) => {\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n\r\n const handleButtonClick = () => {\r\n inputRef.current?.click();\r\n };\r\n\r\n const handleChange = (evt: React.ChangeEvent<HTMLInputElement>) => {\r\n const files = evt.target.files;\r\n if (files && files.length) {\r\n props.onClick(files);\r\n }\r\n evt.target.value = \"\";\r\n };\r\n\r\n return (\r\n <>\r\n <ButtonLine onClick={handleButtonClick} icon={ArrowUploadRegular} label={props.label}></ButtonLine>\r\n <input ref={inputRef} type=\"file\" accept={props.accept} style={{ display: \"none\" }} onChange={handleChange} />\r\n </>\r\n );\r\n};\r\n"]}
|
@@ -5,6 +5,6 @@ import type { PropertyLineProps } from "./propertyLine.js";
|
|
5
5
|
* @param props - The properties for the PropertyLine, including the boolean value to display.
|
6
6
|
* @returns A PropertyLine component with a PresenceBadge indicating the boolean state.
|
7
7
|
*/
|
8
|
-
export declare const
|
8
|
+
export declare const BooleanBadgePropertyLine: FunctionComponent<PropertyLineProps & {
|
9
9
|
value: boolean;
|
10
10
|
}>;
|
@@ -6,5 +6,5 @@ import { PropertyLine } from "./propertyLine.js";
|
|
6
6
|
* @param props - The properties for the PropertyLine, including the boolean value to display.
|
7
7
|
* @returns A PropertyLine component with a PresenceBadge indicating the boolean state.
|
8
8
|
*/
|
9
|
-
export const
|
10
|
-
//# sourceMappingURL=
|
9
|
+
export const BooleanBadgePropertyLine = (props) => (_jsx(PropertyLine, { label: props.label, children: _jsx(PresenceBadge, { status: props.value ? "available" : "do-not-disturb", outOfOffice: true }) }));
|
10
|
+
//# sourceMappingURL=booleanBadgePropertyLine.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"booleanBadgePropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/booleanBadgePropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAA8D,CAAC,KAAK,EAAE,EAAE,CAAC,CAC1G,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,YAC5B,KAAC,aAAa,IAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,EAAE,WAAW,EAAE,IAAI,GAAI,GAC/E,CAClB,CAAC","sourcesContent":["import { PresenceBadge } from \"@fluentui/react-components\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\n\r\n/**\r\n * Displays an icon indicating enabled (green check) or disabled (red cross) state\r\n * @param props - The properties for the PropertyLine, including the boolean value to display.\r\n * @returns A PropertyLine component with a PresenceBadge indicating the boolean state.\r\n */\r\nexport const BooleanBadgePropertyLine: FunctionComponent<PropertyLineProps & { value: boolean }> = (props) => (\r\n <PropertyLine label={props.label}>\r\n <PresenceBadge status={props.value ? \"available\" : \"do-not-disturb\"} outOfOffice={true} />\r\n </PropertyLine>\r\n);\r\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { PropertyLineProps } from "./propertyLine.js";
|
2
2
|
import type { FunctionComponent } from "react";
|
3
|
-
import type { CheckboxProps } from "
|
3
|
+
import type { CheckboxProps } from "../../primitives/checkbox.js";
|
4
4
|
/**
|
5
5
|
* Wraps a checkbox in a property line
|
6
6
|
* @param props - PropertyLineProps and CheckboxProps
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { PropertyLine } from "./propertyLine.js";
|
3
|
-
import { Checkbox } from "
|
3
|
+
import { Checkbox } from "../../primitives/checkbox.js";
|
4
4
|
/**
|
5
5
|
* Wraps a checkbox in a property line
|
6
6
|
* @param props - PropertyLineProps and CheckboxProps
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"checkboxPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/checkboxPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAyD,CAAC,KAAK,EAAE,EAAE;IAChG,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,QAAQ,OAAK,KAAK,GAAI,GACZ,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { Checkbox } from \"../../primitives/checkbox\";\r\nimport type { CheckboxProps } from \"../../primitives/checkbox\";\r\n\r\n/**\r\n * Wraps a checkbox in a property line\r\n * @param props - PropertyLineProps and CheckboxProps\r\n * @returns property-line wrapped checkbox\r\n */\r\nexport const CheckboxPropertyLine: FunctionComponent<PropertyLineProps & CheckboxProps> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <Checkbox {...props} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
|
@@ -2,7 +2,7 @@ import type { FunctionComponent } from "react";
|
|
2
2
|
import type { PropertyLineProps } from "./propertyLine.js";
|
3
3
|
import type { Color3 } from "@babylonjs/core/Maths/math.color.js";
|
4
4
|
import { Color4 } from "@babylonjs/core/Maths/math.color.js";
|
5
|
-
import type { ColorPickerProps } from "
|
5
|
+
import type { ColorPickerProps } from "../../primitives/colorPicker.js";
|
6
6
|
export type ColorPropertyLineProps = ColorPickerProps<Color3 | Color4> & PropertyLineProps;
|
7
7
|
export declare const Color3PropertyLine: FunctionComponent<ColorPickerProps<Color3> & PropertyLineProps>;
|
8
8
|
export declare const Color4PropertyLine: FunctionComponent<ColorPickerProps<Color4> & PropertyLineProps>;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { forwardRef, useState } from "react";
|
3
3
|
import { PropertyLine } from "./propertyLine.js";
|
4
|
-
import {
|
4
|
+
import { SyncedSliderPropertyLine } from "./syncedSliderPropertyLine.js";
|
5
5
|
import { Color4 } from "@babylonjs/core/Maths/math.color.js";
|
6
|
-
import { ColorPickerPopup } from "
|
6
|
+
import { ColorPickerPopup } from "../../primitives/colorPicker.js";
|
7
7
|
/**
|
8
8
|
* Reusable component which renders a color property line containing a label, colorPicker popout, and expandable RGBA values
|
9
9
|
* The expandable RGBA values are synced sliders that allow the user to modify the color's RGBA values directly
|
@@ -28,7 +28,7 @@ const ColorPropertyLine = forwardRef((props, ref) => {
|
|
28
28
|
setColor(newColor);
|
29
29
|
props.onChange(newColor);
|
30
30
|
};
|
31
|
-
return (_jsx(PropertyLine, { ref: ref, ...props, expandedContent: _jsxs(_Fragment, { children: [_jsx(
|
31
|
+
return (_jsx(PropertyLine, { ref: ref, ...props, expandedContent: _jsxs(_Fragment, { children: [_jsx(SyncedSliderPropertyLine, { label: "R", value: color.r * 255, min: 0, max: 255, onChange: (value) => onSliderChange(value, "r") }), _jsx(SyncedSliderPropertyLine, { label: "G", value: color.g * 255, min: 0, max: 255, onChange: (value) => onSliderChange(value, "g") }), _jsx(SyncedSliderPropertyLine, { label: "B", value: color.b * 255, min: 0, max: 255, onChange: (value) => onSliderChange(value, "b") }), color instanceof Color4 && _jsx(SyncedSliderPropertyLine, { label: "A", value: color.a, min: 0, max: 1, step: 0.01, onChange: (value) => onSliderChange(value, "a") })] }), children: _jsx(ColorPickerPopup, { ...props, onChange: onColorPickerChange, value: color }) }));
|
32
32
|
});
|
33
33
|
export const Color3PropertyLine = ColorPropertyLine;
|
34
34
|
export const Color4PropertyLine = ColorPropertyLine;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"colorPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/colorPropertyLine.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CA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AAE,GAAG,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,GAAI,EAC/H,KAAC,wBAAwB,IAAC,KAAK,EAAC,GAAG,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,GAAI,EAC/H,KAAC,wBAAwB,IAAC,KAAK,EAAC,GAAG,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,GAAI,EAC9H,KAAK,YAAY,MAAM,IAAI,KAAC,wBAAwB,IAAC,KAAK,EAAC,GAAG,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,GAAI,IAChK,YAGP,KAAC,gBAAgB,OAAK,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,KAAK,EAAE,KAAK,GAAI,GACjE,CAClB,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAoF,CAAC;AACvH,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAoF,CAAC","sourcesContent":["import type { FunctionComponent } from \"react\";\r\nimport { forwardRef, useState } from \"react\";\r\n\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport { PropertyLine } from \"./propertyLine\";\r\nimport { SyncedSliderPropertyLine } from \"./syncedSliderPropertyLine\";\r\n\r\nimport type { Color3 } from \"core/Maths/math.color\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { ColorPickerPopup } from \"../../primitives/colorPicker\";\r\nimport type { ColorPickerProps } from \"../../primitives/colorPicker\";\r\n\r\nexport type ColorPropertyLineProps = ColorPickerProps<Color3 | Color4> & PropertyLineProps;\r\n\r\n/**\r\n * Reusable component which renders a color property line containing a label, colorPicker popout, and expandable RGBA values\r\n * The expandable RGBA values are synced sliders that allow the user to modify the color's RGBA values directly\r\n * @param props - PropertyLine props, replacing children with a color object so that we can properly display the color\r\n * @returns Component wrapping a colorPicker component with a property line\r\n */\r\nconst ColorPropertyLine = forwardRef<HTMLDivElement, ColorPropertyLineProps>((props, ref) => {\r\n const [color, setColor] = useState(props.value);\r\n\r\n const onSliderChange = (value: number, key: \"r\" | \"g\" | \"b\" | \"a\") => {\r\n let newColor: Color3 | Color4;\r\n if (key === \"a\") {\r\n newColor = Color4.FromColor3(color, value);\r\n } else {\r\n newColor = color.clone();\r\n newColor[key] = value / 255;\r\n }\r\n\r\n setColor(newColor); // Create a new object to trigger re-render\r\n props.onChange(newColor);\r\n };\r\n\r\n const onColorPickerChange = (newColor: Color3 | Color4) => {\r\n setColor(newColor);\r\n props.onChange(newColor);\r\n };\r\n\r\n return (\r\n <PropertyLine\r\n ref={ref}\r\n {...props}\r\n expandedContent={\r\n <>\r\n <SyncedSliderPropertyLine label=\"R\" value={color.r * 255} min={0} max={255} onChange={(value) => onSliderChange(value, \"r\")} />\r\n <SyncedSliderPropertyLine label=\"G\" value={color.g * 255} min={0} max={255} onChange={(value) => onSliderChange(value, \"g\")} />\r\n <SyncedSliderPropertyLine label=\"B\" value={color.b * 255} min={0} max={255} onChange={(value) => onSliderChange(value, \"b\")} />\r\n {color instanceof Color4 && <SyncedSliderPropertyLine label=\"A\" value={color.a} min={0} max={1} step={0.01} onChange={(value) => onSliderChange(value, \"a\")} />}\r\n </>\r\n }\r\n >\r\n <ColorPickerPopup {...props} onChange={onColorPickerChange} value={color} />\r\n </PropertyLine>\r\n );\r\n});\r\n\r\nexport const Color3PropertyLine = ColorPropertyLine as FunctionComponent<ColorPickerProps<Color3> & PropertyLineProps>;\r\nexport const Color4PropertyLine = ColorPropertyLine as FunctionComponent<ColorPickerProps<Color4> & PropertyLineProps>;\r\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { Nullable } from "@babylonjs/core/types.js";
|
2
|
-
import type { AcceptedDropdownValue, DropdownProps } from "
|
2
|
+
import type { AcceptedDropdownValue, DropdownProps } from "../../primitives/dropdown.js";
|
3
3
|
import type { PropertyLineProps } from "./propertyLine.js";
|
4
4
|
import type { FunctionComponent } from "react";
|
5
5
|
type DropdownPropertyLineProps<V extends AcceptedDropdownValue> = Omit<DropdownProps<V>, "includeNullAs"> & PropertyLineProps;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dropdownPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/dropdownPropertyLine.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C;;;;GAIG;AACH,MAAM,oBAAoB,GAAgF,CAAC,KAAK,EAAE,EAAE;IAChH,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,QAAQ,OAAK,KAAK,GAAI,GACZ,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,4BAA4B,GAAwE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAC,oBAAoB,OAAK,KAAK,EAAE,aAAa,EAAC,MAAM,GAAG,CAAC;AAC9K,MAAM,4BAA4B,GAAwE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAC,oBAAoB,OAAK,KAAK,EAAE,aAAa,EAAC,WAAW,GAAG,CAAC;AAEnL;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAA4E,CAAC;AACvH;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAA4E,CAAC;AAEvH;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,4BAA8F,CAAC;AACjJ;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,4BAA8F,CAAC;AAEjJ;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,4BAAgG,CAAC;AACnJ;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,4BAAgG,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { Dropdown } from \"../../primitives/dropdown\";\r\nimport type { AcceptedDropdownValue, DropdownProps } from \"../../primitives/dropdown\";\r\nimport { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\n\r\ntype DropdownPropertyLineProps<V extends AcceptedDropdownValue> = Omit<DropdownProps<V>, \"includeNullAs\"> & PropertyLineProps;\r\n\r\n/**\r\n * Wraps a dropdown in a property line\r\n * @param props - PropertyLineProps and DropdownProps\r\n * @returns property-line wrapped dropdown\r\n */\r\nconst DropdownPropertyLine: FunctionComponent<DropdownProps<AcceptedDropdownValue> & PropertyLineProps> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <Dropdown {...props} />\r\n </PropertyLine>\r\n );\r\n};\r\n\r\nconst NullableDropdownPropertyLine: FunctionComponent<DropdownPropertyLineProps<AcceptedDropdownValue>> = (props) => <DropdownPropertyLine {...props} includeNullAs=\"null\" />;\r\nconst OptionalDropdownPropertyLine: FunctionComponent<DropdownPropertyLineProps<AcceptedDropdownValue>> = (props) => <DropdownPropertyLine {...props} includeNullAs=\"undefined\" />;\r\n\r\n/**\r\n * Dropdown component for explicitly defined number values.\r\n * If value can be undefined, use OptionalNumberDropdownPropertyLine instead.\r\n * If value can be null, use NullableNumberDropdownPropertyLine instead.\r\n */\r\nexport const NumberDropdownPropertyLine = DropdownPropertyLine as FunctionComponent<DropdownPropertyLineProps<number>>;\r\n/**\r\n * Dropdown component for explicitly defined string values.\r\n * If value can be undefined, use OptionalStringDropdownPropertyLine instead.\r\n * If value can be null, use NullableStringDropdownPropertyLine instead.\r\n */\r\nexport const StringDropdownPropertyLine = DropdownPropertyLine as FunctionComponent<DropdownPropertyLineProps<string>>;\r\n\r\n/**\r\n * Dropdown component for Nullable<number> values.\r\n */\r\nexport const NullableNumberDropdownPropertyLine = NullableDropdownPropertyLine as FunctionComponent<DropdownPropertyLineProps<Nullable<number>>>;\r\n/**\r\n * Dropdown component for Nullable<string> values.\r\n */\r\nexport const NullableStringDropdownPropertyLine = NullableDropdownPropertyLine as FunctionComponent<DropdownPropertyLineProps<Nullable<string>>>;\r\n\r\n/**\r\n * Dropdown component for number | undefined values\r\n */\r\nexport const OptionalNumberDropdownPropertyLine = OptionalDropdownPropertyLine as FunctionComponent<DropdownPropertyLineProps<number | undefined>>;\r\n/**\r\n * Dropdown component for string | undefined values\r\n */\r\nexport const OptionalStringDropdownPropertyLine = OptionalDropdownPropertyLine as FunctionComponent<DropdownPropertyLineProps<string | undefined>>;\r\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { PropertyLineProps } from "./propertyLine.js";
|
2
2
|
import type { FunctionComponent } from "react";
|
3
|
-
import type { InputHexProps } from "
|
3
|
+
import type { InputHexProps } from "../../primitives/colorPicker.js";
|
4
4
|
/**
|
5
5
|
* Wraps a hex input in a property line
|
6
6
|
* @param props - PropertyLineProps and InputHexProps
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { PropertyLine } from "./propertyLine.js";
|
3
|
-
import { InputHexField } from "
|
3
|
+
import { InputHexField } from "../../primitives/colorPicker.js";
|
4
4
|
/**
|
5
5
|
* Wraps a hex input in a property line
|
6
6
|
* @param props - PropertyLineProps and InputHexProps
|
@@ -9,4 +9,4 @@ import { InputHexField } from "../primitives/colorPicker.js";
|
|
9
9
|
export const HexPropertyLine = (props) => {
|
10
10
|
return (_jsx(PropertyLine, { ...props, children: _jsx(InputHexField, { ...props }) }));
|
11
11
|
};
|
12
|
-
//# sourceMappingURL=
|
12
|
+
//# sourceMappingURL=hexPropertyLine.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hexPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/hexPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAyD,CAAC,KAAK,EAAE,EAAE;IAC3F,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,aAAa,OAAK,KAAK,GAAI,GACjB,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { InputHexField } from \"../../primitives/colorPicker\";\r\nimport type { InputHexProps } from \"../../primitives/colorPicker\";\r\n\r\n/**\r\n * Wraps a hex input in a property line\r\n * @param props - PropertyLineProps and InputHexProps\r\n * @returns property-line wrapped input hex component\r\n */\r\nexport const HexPropertyLine: FunctionComponent<InputHexProps & PropertyLineProps> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <InputHexField {...props} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { PropertyLineProps } from "./propertyLine.js";
|
2
2
|
import type { FunctionComponent } from "react";
|
3
|
-
import type { InputProps } from "
|
3
|
+
import type { InputProps } from "../../primitives/input.js";
|
4
4
|
/**
|
5
5
|
* Wraps a text input in a property line
|
6
6
|
* @param props - PropertyLineProps and InputProps
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { PropertyLine } from "./propertyLine.js";
|
3
|
-
import { NumberInput, TextInput } from "
|
3
|
+
import { NumberInput, TextInput } from "../../primitives/input.js";
|
4
4
|
/**
|
5
5
|
* Wraps a text input in a property line
|
6
6
|
* @param props - PropertyLineProps and InputProps
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"inputPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/inputPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA8D,CAAC,KAAK,EAAE,EAAE,CAAC,CACvG,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,SAAS,OAAK,KAAK,GAAI,GACb,CAClB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA8D,CAAC,KAAK,EAAE,EAAE,CAAC,CACzG,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,WAAW,OAAK,KAAK,GAAI,GACf,CAClB,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { NumberInput, TextInput } from \"../../primitives/input\";\r\nimport type { InputProps } from \"../../primitives/input\";\r\n\r\n/**\r\n * Wraps a text input in a property line\r\n * @param props - PropertyLineProps and InputProps\r\n * @returns property-line wrapped input component\r\n */\r\nexport const TextInputPropertyLine: FunctionComponent<InputProps<string> & PropertyLineProps> = (props) => (\r\n <PropertyLine {...props}>\r\n <TextInput {...props} />\r\n </PropertyLine>\r\n);\r\n\r\n/**\r\n * Wraps a number input in a property line\r\n * @param props - PropertyLineProps and InputProps\r\n * @returns property-line wrapped input component\r\n */\r\nexport const NumberInputPropertyLine: FunctionComponent<InputProps<number> & PropertyLineProps> = (props) => (\r\n <PropertyLine {...props}>\r\n <NumberInput {...props} />\r\n </PropertyLine>\r\n);\r\n"]}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { Body1 } from "@fluentui/react-components";
|
3
3
|
import { PropertyLine } from "./propertyLine.js";
|
4
|
-
import { Link } from "
|
4
|
+
import { Link } from "../../primitives/link.js";
|
5
5
|
/**
|
6
6
|
* Wraps a link in a property line
|
7
7
|
* @param props - PropertyLineProps and LinkProps
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"linkPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/linkPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAW7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAqD,CAAC,KAAK,EAAE,EAAE;IACxF,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,IAAI,IAAC,MAAM,QAAC,UAAU,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,YACnG,KAAC,KAAK,cAAE,KAAK,CAAC,KAAK,GAAS,GACzB,GACI,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Body1 } from \"@fluentui/react-components\";\r\nimport { PropertyLine } from \"./propertyLine\";\r\nimport { Link } from \"../../primitives/link\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\n\r\ntype LinkProps = {\r\n value: string;\r\n tooltip?: string;\r\n onLink?: () => void;\r\n url?: string;\r\n};\r\n\r\n/**\r\n * Wraps a link in a property line\r\n * @param props - PropertyLineProps and LinkProps\r\n * @returns property-line wrapped link\r\n */\r\nexport const LinkPropertyLine: FunctionComponent<PropertyLineProps & LinkProps> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <Link inline appearance=\"subtle\" onClick={() => props.onLink?.()} href={props.url} title={props.tooltip}>\r\n <Body1>{props.value}</Body1>\r\n </Link>\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
|
@@ -3,20 +3,20 @@ import { Body1, Body1Strong, Button, InfoLabel, Link, ToggleButton, makeStyles,
|
|
3
3
|
import { Collapse } from "@fluentui/react-motion-components-preview";
|
4
4
|
import { AddFilled, CopyRegular, SubtractFilled } from "@fluentui/react-icons";
|
5
5
|
import { useContext, useState, forwardRef } from "react";
|
6
|
-
import { copyCommandToClipboard } from "
|
7
|
-
import { ToolContext } from "
|
6
|
+
import { copyCommandToClipboard } from "../../../copyCommandToClipboard.js";
|
7
|
+
import { ToolContext } from "../fluentToolWrapper.js";
|
8
8
|
const usePropertyLineStyles = makeStyles({
|
9
9
|
container: {
|
10
10
|
width: "100%",
|
11
11
|
display: "flex",
|
12
12
|
flexDirection: "column", // Stack line + expanded content
|
13
|
+
padding: `${tokens.spacingVerticalXS} 0px`,
|
13
14
|
borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,
|
14
15
|
},
|
15
16
|
line: {
|
16
17
|
display: "flex",
|
17
18
|
alignItems: "center",
|
18
19
|
justifyContent: "flex-start",
|
19
|
-
padding: `${tokens.spacingVerticalXS} 0px`,
|
20
20
|
width: "100%",
|
21
21
|
},
|
22
22
|
label: {
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"propertyLine.js","sourceRoot":"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ACzD,IACC,CACnB,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAmE,CAAC,KAAK,EAAE,EAAE;IAC7G,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,KAAK,cAAE,KAAK,CAAC,KAAK,GAAS,GACjB,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Body1, Body1Strong, Button, InfoLabel, Link, ToggleButton, makeStyles, tokens } from \"@fluentui/react-components\";\r\nimport { Collapse } from \"@fluentui/react-motion-components-preview\";\r\nimport { AddFilled, CopyRegular, SubtractFilled } from \"@fluentui/react-icons\";\r\nimport type { FunctionComponent, HTMLProps, PropsWithChildren } from \"react\";\r\nimport { useContext, useState, forwardRef } from \"react\";\r\nimport { copyCommandToClipboard } from \"../../../copyCommandToClipboard\";\r\nimport { ToolContext } from \"../fluentToolWrapper\";\r\n\r\nconst usePropertyLineStyles = makeStyles({\r\n container: {\r\n width: \"100%\",\r\n display: \"flex\",\r\n flexDirection: \"column\", // Stack line + expanded content\r\n padding: `${tokens.spacingVerticalXS} 0px`,\r\n borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\r\n },\r\n line: {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"flex-start\",\r\n width: \"100%\",\r\n },\r\n label: {\r\n flex: \"1 1 0\",\r\n minWidth: \"50px\",\r\n textAlign: \"left\",\r\n whiteSpace: \"nowrap\",\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n },\r\n labelText: {\r\n whiteSpace: \"nowrap\",\r\n },\r\n rightContent: {\r\n flex: \"0 1 auto\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"flex-end\",\r\n gap: tokens.spacingHorizontalS,\r\n },\r\n button: {\r\n marginLeft: tokens.spacingHorizontalXXS,\r\n margin: 0,\r\n padding: 0,\r\n border: 0,\r\n minWidth: 0,\r\n },\r\n fillRestOfRightContentWidth: {\r\n flex: 1,\r\n display: \"flex\",\r\n justifyContent: \"flex-end\",\r\n alignItems: \"center\",\r\n },\r\n expandButton: {\r\n margin: 0,\r\n },\r\n expandedContent: {},\r\n});\r\n\r\nexport type PropertyLineProps = {\r\n /**\r\n * The name of the property to display in the property line.\r\n */\r\n label: string;\r\n /**\r\n * Optional description for the property, shown on hover of the info icon\r\n */\r\n description?: string;\r\n /**\r\n * Optional function returning a string to copy to clipboard.\r\n */\r\n onCopy?: () => string;\r\n /**\r\n * If supplied, an 'expand' icon will be shown which, when clicked, renders this component within the property line.\r\n */\r\n expandedContent?: JSX.Element;\r\n\r\n /**\r\n * Link to the documentation for this property, available from the info icon either linked from the description (if provided) or defalt 'docs' text\r\n */\r\n docLink?: string;\r\n};\r\n\r\nexport const LineContainer = forwardRef<HTMLDivElement, PropsWithChildren<HTMLProps<HTMLDivElement>>>((props, ref) => {\r\n const classes = usePropertyLineStyles();\r\n return (\r\n <div ref={ref} className={classes.container} {...props}>\r\n {props.children}\r\n </div>\r\n );\r\n});\r\n\r\nexport type BaseComponentProps<T> = {\r\n /**\r\n * The value of the property to be displayed and modified.\r\n */\r\n value: T;\r\n /**\r\n * Callback function to handle changes to the value\r\n */\r\n onChange: (value: T) => void;\r\n /**\r\n * Optional flag to disable the component, preventing any interaction.\r\n */\r\n disabled?: boolean;\r\n /**\r\n * Optional class name to apply custom styles to the component.\r\n */\r\n className?: string;\r\n};\r\n\r\n/**\r\n * A reusable component that renders a property line with a label and child content, and an optional description, copy button, and expandable section.\r\n *\r\n * @param props - The properties for the PropertyLine component.\r\n * @returns A React element representing the property line.\r\n *\r\n */\r\nexport const PropertyLine = forwardRef<HTMLDivElement, PropsWithChildren<PropertyLineProps>>((props, ref) => {\r\n const classes = usePropertyLineStyles();\r\n const [expanded, setExpanded] = useState(false);\r\n\r\n const { label, onCopy, expandedContent, children } = props;\r\n\r\n const { disableCopy } = useContext(ToolContext);\r\n\r\n const description = props.description ?? (props.docLink ? <Link href={props.docLink}>{props.description ?? \"Docs\"}</Link> : props.description);\r\n\r\n return (\r\n <LineContainer ref={ref}>\r\n <div className={classes.line}>\r\n <InfoLabel className={classes.label} info={description}>\r\n <Body1Strong className={classes.labelText}>{label}</Body1Strong>\r\n </InfoLabel>\r\n <div className={classes.rightContent}>\r\n <div className={classes.fillRestOfRightContentWidth}>{children}</div>\r\n\r\n {expandedContent && (\r\n <ToggleButton\r\n appearance=\"transparent\"\r\n icon={expanded ? <SubtractFilled /> : <AddFilled />}\r\n className={classes.button}\r\n checked={expanded}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n setExpanded((expanded) => !expanded);\r\n }}\r\n />\r\n )}\r\n\r\n {onCopy && !disableCopy && (\r\n <Button className={classes.button} id=\"copyProperty\" icon={<CopyRegular />} onClick={() => copyCommandToClipboard(onCopy())} title=\"Copy to clipboard\" />\r\n )}\r\n </div>\r\n </div>\r\n <Collapse visible={expanded && !!expandedContent}>\r\n <div className={classes.expandedContent}>{expandedContent}</div>\r\n </Collapse>\r\n </LineContainer>\r\n );\r\n});\r\n\r\nexport const PlaceholderPropertyLine: FunctionComponent<BaseComponentProps<any> & PropertyLineProps> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <Body1>{props.value}</Body1>\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { PropertyLineProps } from "./propertyLine.js";
|
2
2
|
import type { FunctionComponent } from "react";
|
3
|
-
import type { SwitchProps } from "
|
3
|
+
import type { SwitchProps } from "../../primitives/switch.js";
|
4
4
|
/**
|
5
5
|
* Wraps a switch in a property line
|
6
6
|
* @param props - The properties for the switch and property line
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { PropertyLine } from "./propertyLine.js";
|
3
|
-
import { Switch } from "
|
3
|
+
import { Switch } from "../../primitives/switch.js";
|
4
4
|
/**
|
5
5
|
* Wraps a switch in a property line
|
6
6
|
* @param props - The properties for the switch and property line
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"switchPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/switchPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAuD,CAAC,KAAK,EAAE,EAAE;IAC5F,6DAA6D;IAC7D,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IACxC,8FAA8F;IAC9F,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,MAAM,OAAK,WAAW,GAAI,GAChB,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { Switch } from \"../../primitives/switch\";\r\nimport type { SwitchProps } from \"../../primitives/switch\";\r\n/**\r\n * Wraps a switch in a property line\r\n * @param props - The properties for the switch and property line\r\n * @returns A React element representing the property line with a switch\r\n */\r\nexport const SwitchPropertyLine: FunctionComponent<PropertyLineProps & SwitchProps> = (props) => {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { label, ...switchProps } = props;\r\n // Ensure the label gets passed to the PropertyLine component and not to the underlying switch\r\n return (\r\n <PropertyLine {...props}>\r\n <Switch {...switchProps} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { PropertyLineProps } from "./propertyLine.js";
|
2
|
+
import type { SyncedSliderProps } from "../../primitives/syncedSlider.js";
|
3
|
+
import type { FunctionComponent } from "react";
|
4
|
+
type SyncedSliderPropertyProps = SyncedSliderProps & PropertyLineProps;
|
5
|
+
/**
|
6
|
+
* Renders a simple wrapper around the SyncedSliderInput
|
7
|
+
* @param props
|
8
|
+
* @returns
|
9
|
+
*/
|
10
|
+
export declare const SyncedSliderPropertyLine: FunctionComponent<SyncedSliderPropertyProps>;
|
11
|
+
export {};
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { PropertyLine } from "./propertyLine.js";
|
3
|
-
import { SyncedSliderInput } from "
|
3
|
+
import { SyncedSliderInput } from "../../primitives/syncedSlider.js";
|
4
4
|
/**
|
5
5
|
* Renders a simple wrapper around the SyncedSliderInput
|
6
6
|
* @param props
|
7
7
|
* @returns
|
8
8
|
*/
|
9
|
-
export const
|
9
|
+
export const SyncedSliderPropertyLine = (props) => {
|
10
10
|
const { label, description, ...sliderProps } = props;
|
11
11
|
return (_jsx(PropertyLine, { label: label, description: description, children: _jsx(SyncedSliderInput, { ...sliderProps }) }));
|
12
12
|
};
|
13
|
-
//# sourceMappingURL=
|
13
|
+
//# sourceMappingURL=syncedSliderPropertyLine.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"syncedSliderPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/syncedSliderPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAKlE;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAiD,CAAC,KAAK,EAAsB,EAAE;IAChH,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IACrD,OAAO,CACH,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,YAChD,KAAC,iBAAiB,OAAK,WAAW,GAAI,GAC3B,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport { SyncedSliderInput } from \"../../primitives/syncedSlider\";\r\nimport type { SyncedSliderProps } from \"../../primitives/syncedSlider\";\r\nimport type { FunctionComponent } from \"react\";\r\n\r\ntype SyncedSliderPropertyProps = SyncedSliderProps & PropertyLineProps;\r\n/**\r\n * Renders a simple wrapper around the SyncedSliderInput\r\n * @param props\r\n * @returns\r\n */\r\nexport const SyncedSliderPropertyLine: FunctionComponent<SyncedSliderPropertyProps> = (props): React.ReactElement => {\r\n const { label, description, ...sliderProps } = props;\r\n return (\r\n <PropertyLine label={label} description={description}>\r\n <SyncedSliderInput {...sliderProps} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"textPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/textPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAS9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAqD,CAAC,KAAK,EAAE,EAAE;IACxF,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,CAAC,OAAO,YAAG,KAAK,CAAC,KAAK,GAAS,GACvC,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Body1 } from \"@fluentui/react-components\";\r\nimport { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\n\r\ntype TextProps = {\r\n value: string;\r\n tooltip?: string;\r\n};\r\n\r\n/**\r\n * Wraps text in a property line\r\n * @param props - PropertyLineProps and TextProps\r\n * @returns property-line wrapped text\r\n */\r\nexport const TextPropertyLine: FunctionComponent<PropertyLineProps & TextProps> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <Body1 title={props.tooltip}>{props.value}</Body1>\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
2
2
|
import { useState } from "react";
|
3
3
|
import { Body1 } from "@fluentui/react-components";
|
4
4
|
import { PropertyLine } from "./propertyLine.js";
|
5
|
-
import {
|
5
|
+
import { SyncedSliderPropertyLine } from "./syncedSliderPropertyLine.js";
|
6
6
|
import { Quaternion, Vector4 } from "@babylonjs/core/Maths/math.vector.js";
|
7
7
|
import { Tools } from "@babylonjs/core/Misc/tools.js";
|
8
8
|
/**
|
@@ -23,7 +23,7 @@ const TensorPropertyLine = (props) => {
|
|
23
23
|
setVector(newVector);
|
24
24
|
props.onChange(newVector);
|
25
25
|
};
|
26
|
-
return (_jsx(PropertyLine, { ...props, expandedContent: _jsxs(_Fragment, { children: [_jsx(
|
26
|
+
return (_jsx(PropertyLine, { ...props, expandedContent: _jsxs(_Fragment, { children: [_jsx(SyncedSliderPropertyLine, { label: "X", value: converted(vector.x), min: min, max: max, onChange: (val) => onChange(val, "x") }), _jsx(SyncedSliderPropertyLine, { label: "Y", value: converted(vector.y), min: min, max: max, onChange: (val) => onChange(val, "y") }), _jsx(SyncedSliderPropertyLine, { label: "Z", value: converted(vector.z), min: min, max: max, onChange: (val) => onChange(val, "z") }), vector instanceof Vector4 && _jsx(SyncedSliderPropertyLine, { label: "W", value: vector.w, min: min, max: max, onChange: (val) => onChange(val, "w") })] }), children: _jsx(Body1, { children: `X: ${formatted(props.value.x)} | Y: ${formatted(props.value.y)} | Z: ${formatted(props.value.z)}${props.value instanceof Vector4 ? ` | W: ${formatted(props.value.w)}` : ""}` }) }));
|
27
27
|
};
|
28
28
|
const ToDegreesConverter = { from: Tools.ToDegrees, to: Tools.ToRadians };
|
29
29
|
export const RotationVectorPropertyLine = (props) => {
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"vectorPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/vectorPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,6CAA+B;AAE7D,OAAO,EAAE,KAAK,EAAE,sCAAwB;AA2BxC;;;;;GAKG;AACH,MAAM,kBAAkB,GAA+E,CAAC,KAAK,EAAE,EAAE;IAC7G,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjG,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAE7D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;IAE3B,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,GAA0B,EAAE,EAAE;QACzD,MAAM,KAAK,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QACxE,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;QAChC,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AE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,YAAY,GAAG,CAAC,GAAe,EAAE,EAAE;QACrC,OAAO,CAAC,GAAG,CAAC,CAAC;QACb,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,GAAY,EAAE,EAAE;QACnC,MAAM,IAAI,GAAG,UAAU,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC;QACd,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC;IACF,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CACtB,KAAC,mBAAmB,OAAK,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,aAAa,GAAI,CACnJ,CAAC,CAAC,CAAC,CACA,KAAC,8BAA8B,OAAK,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,GAAI,CACzG,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAyE,CAAC;AAC7G,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAyE,CAAC","sourcesContent":["import { useState } from \"react\";\r\nimport type { FunctionComponent } from \"react\";\r\n\r\nimport { Body1 } from \"@fluentui/react-components\";\r\nimport { PropertyLine } from \"./propertyLine\";\r\nimport type { BaseComponentProps, PropertyLineProps } from \"./propertyLine\";\r\n\r\nimport { SyncedSliderPropertyLine } from \"./syncedSliderPropertyLine\";\r\n\r\nimport { Quaternion, Vector4 } from \"core/Maths/math.vector\";\r\nimport type { Vector3 } from \"core/Maths/math.vector\";\r\nimport { Tools } from \"core/Misc/tools\";\r\n\r\nexport type TensorPropertyLineProps<V extends Vector3 | Vector4 | Quaternion> = BaseComponentProps<V> &\r\n PropertyLineProps & {\r\n /**\r\n * If passed, all sliders will use this for the min value\r\n */\r\n min?: number;\r\n /**\r\n * If passed, all sliders will use this for the max value\r\n */\r\n max?: number;\r\n /**\r\n * If passed, the UX will use the conversion functions to display/update values\r\n */\r\n valueConverter?: {\r\n /**\r\n * Will call from(val) before displaying in the UX\r\n */\r\n from: (val: number) => number;\r\n /**\r\n * Will call to(val) before calling onChange\r\n */\r\n to: (val: number) => number;\r\n };\r\n };\r\n\r\n/**\r\n * Reusable component which renders a vector property line containing a label, vector value, and expandable XYZW values\r\n * The expanded section contains a slider/input box for each component of the vector (x, y, z, w)\r\n * @param props\r\n * @returns\r\n */\r\nconst TensorPropertyLine: FunctionComponent<TensorPropertyLineProps<Vector3 | Vector4 | Quaternion>> = (props) => {\r\n const converted = (val: number) => (props.valueConverter ? props.valueConverter.from(val) : val);\r\n const formatted = (val: number) => converted(val).toFixed(2);\r\n\r\n const [vector, setVector] = useState(props.value);\r\n const { min, max } = props;\r\n\r\n const onChange = (val: number, key: \"x\" | \"y\" | \"z\" | \"w\") => {\r\n const value = props.valueConverter ? props.valueConverter.to(val) : val;\r\n const newVector = vector.clone();\r\n (newVector as Vector4)[key] = value; // The syncedSlider for 'w' is only rendered when vector is a Vector4, so this is safe\r\n\r\n setVector(newVector);\r\n props.onChange(newVector);\r\n };\r\n\r\n return (\r\n <PropertyLine\r\n {...props}\r\n expandedContent={\r\n <>\r\n <SyncedSliderPropertyLine label=\"X\" value={converted(vector.x)} min={min} max={max} onChange={(val) => onChange(val, \"x\")} />\r\n <SyncedSliderPropertyLine label=\"Y\" value={converted(vector.y)} min={min} max={max} onChange={(val) => onChange(val, \"y\")} />\r\n <SyncedSliderPropertyLine label=\"Z\" value={converted(vector.z)} min={min} max={max} onChange={(val) => onChange(val, \"z\")} />\r\n {vector instanceof Vector4 && <SyncedSliderPropertyLine label=\"W\" value={vector.w} min={min} max={max} onChange={(val) => onChange(val, \"w\")} />}\r\n </>\r\n }\r\n >\r\n <Body1>{`X: ${formatted(props.value.x)} | Y: ${formatted(props.value.y)} | Z: ${formatted(props.value.z)}${props.value instanceof Vector4 ? ` | W: ${formatted(props.value.w)}` : \"\"}`}</Body1>\r\n </PropertyLine>\r\n );\r\n};\r\n\r\ntype RotationVectorPropertyLineProps = TensorPropertyLineProps<Vector3> & {\r\n /**\r\n * Display angles as degrees instead of radians\r\n */\r\n useDegrees?: boolean;\r\n};\r\n\r\nconst ToDegreesConverter = { from: Tools.ToDegrees, to: Tools.ToRadians };\r\nexport const RotationVectorPropertyLine: FunctionComponent<RotationVectorPropertyLineProps> = (props) => {\r\n const min = props.useDegrees ? 0 : undefined;\r\n const max = props.useDegrees ? 360 : undefined;\r\n return <Vector3PropertyLine {...props} valueConverter={props.useDegrees ? ToDegreesConverter : undefined} min={min} max={max} />;\r\n};\r\n\r\ntype QuaternionPropertyLineProps = TensorPropertyLineProps<Quaternion> & {\r\n /**\r\n * Display angles as degrees instead of radians\r\n */\r\n useDegrees?: boolean;\r\n};\r\n\r\nconst QuaternionPropertyLineInternal = TensorPropertyLine as FunctionComponent<TensorPropertyLineProps<Quaternion>>;\r\nexport const QuaternionPropertyLine: FunctionComponent<QuaternionPropertyLineProps> = (props) => {\r\n const min = props.useDegrees ? 0 : undefined;\r\n const max = props.useDegrees ? 360 : undefined;\r\n const [quat, setQuat] = useState(props.value);\r\n const onQuatChange = (val: Quaternion) => {\r\n setQuat(val);\r\n props.onChange(val);\r\n };\r\n\r\n const onEulerChange = (val: Vector3) => {\r\n const quat = Quaternion.FromEulerAngles(val.x, val.y, val.z);\r\n setQuat(quat);\r\n props.onChange(quat);\r\n };\r\n return props.useDegrees ? (\r\n <Vector3PropertyLine {...props} value={quat.toEulerAngles()} valueConverter={ToDegreesConverter} min={min} max={max} onChange={onEulerChange} />\r\n ) : (\r\n <QuaternionPropertyLineInternal {...props} value={quat} min={min} max={max} onChange={onQuatChange} />\r\n );\r\n};\r\n\r\nexport const Vector3PropertyLine = TensorPropertyLine as FunctionComponent<TensorPropertyLineProps<Vector3>>;\r\nexport const Vector4PropertyLine = TensorPropertyLine as FunctionComponent<TensorPropertyLineProps<Vector4>>;\r\n"]}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import type { FunctionComponent } from "react";
|
2
|
+
import type { FluentIcon } from "@fluentui/react-icons";
|
3
|
+
export type ButtonProps = {
|
4
|
+
onClick: () => void;
|
5
|
+
icon?: FluentIcon;
|
6
|
+
label: string;
|
7
|
+
disabled?: boolean;
|
8
|
+
};
|
9
|
+
export declare const Button: FunctionComponent<ButtonProps>;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { Body1, Button as FluentButton, makeStyles, tokens } from "@fluentui/react-components";
|
3
|
+
const useButtonLineStyles = makeStyles({
|
4
|
+
button: {
|
5
|
+
border: `1px solid ${tokens.colorBrandBackground}`,
|
6
|
+
},
|
7
|
+
});
|
8
|
+
export const Button = (props) => {
|
9
|
+
const classes = useButtonLineStyles();
|
10
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
11
|
+
const { icon: Icon, ...buttonProps } = props;
|
12
|
+
return (_jsx(FluentButton, { iconPosition: "after", className: classes.button, ...buttonProps, icon: Icon && _jsx(Icon, {}), children: _jsx(Body1, { children: props.label }) }));
|
13
|
+
};
|
14
|
+
//# sourceMappingURL=button.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/primitives/button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAI/F,MAAM,mBAAmB,GAAG,UAAU,CAAC;IACnC,MAAM,EAAE;QACJ,MAAM,EAAE,aAAa,MAAM,CAAC,oBAAoB,EAAE;KACrD;CACJ,CAAC,CAAC;AASH,MAAM,CAAC,MAAM,MAAM,GAAmC,CAAC,KAAK,EAAE,EAAE;IAC5D,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IACtC,gEAAgE;IAChE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IAE7C,OAAO,CACH,KAAC,YAAY,IAAC,YAAY,EAAC,OAAO,EAAC,SAAS,EAAE,OAAO,CAAC,MAAM,KAAM,WAAW,EAAE,IAAI,EAAE,IAAI,IAAI,KAAC,IAAI,KAAG,YACjG,KAAC,KAAK,cAAE,KAAK,CAAC,KAAK,GAAS,GACjB,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Body1, Button as FluentButton, makeStyles, tokens } from \"@fluentui/react-components\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport type { FluentIcon } from \"@fluentui/react-icons\";\r\n\r\nconst useButtonLineStyles = makeStyles({\r\n button: {\r\n border: `1px solid ${tokens.colorBrandBackground}`,\r\n },\r\n});\r\n\r\nexport type ButtonProps = {\r\n onClick: () => void;\r\n icon?: FluentIcon;\r\n label: string;\r\n disabled?: boolean;\r\n};\r\n\r\nexport const Button: FunctionComponent<ButtonProps> = (props) => {\r\n const classes = useButtonLineStyles();\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const { icon: Icon, ...buttonProps } = props;\r\n\r\n return (\r\n <FluentButton iconPosition=\"after\" className={classes.button} {...buttonProps} icon={Icon && <Icon />}>\r\n <Body1>{props.label}</Body1>\r\n </FluentButton>\r\n );\r\n};\r\n"]}
|