@babylonjs/shared-ui-components 8.12.1 → 8.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/fluent/hoc/buttonLine.d.ts +14 -0
  2. package/fluent/hoc/buttonLine.js +18 -0
  3. package/fluent/hoc/buttonLine.js.map +1 -0
  4. package/fluent/hoc/checkboxPropertyLine.d.ts +9 -0
  5. package/fluent/hoc/checkboxPropertyLine.js +12 -0
  6. package/fluent/hoc/checkboxPropertyLine.js.map +1 -0
  7. package/fluent/hoc/colorPropertyLine.d.ts +8 -0
  8. package/fluent/hoc/colorPropertyLine.js +35 -0
  9. package/fluent/hoc/colorPropertyLine.js.map +1 -0
  10. package/fluent/hoc/dropdownPropertyLine.d.ts +9 -0
  11. package/fluent/hoc/dropdownPropertyLine.js +12 -0
  12. package/fluent/hoc/dropdownPropertyLine.js.map +1 -0
  13. package/fluent/hoc/fileUploadLine.d.ts +8 -0
  14. package/fluent/hoc/fileUploadLine.js +18 -0
  15. package/fluent/hoc/fileUploadLine.js.map +1 -0
  16. package/fluent/hoc/fluentToolWrapper.d.ts +23 -0
  17. package/fluent/hoc/fluentToolWrapper.js +16 -0
  18. package/fluent/hoc/fluentToolWrapper.js.map +1 -0
  19. package/fluent/hoc/hexLineComponent.d.ts +9 -0
  20. package/fluent/hoc/hexLineComponent.js +12 -0
  21. package/fluent/hoc/hexLineComponent.js.map +1 -0
  22. package/fluent/hoc/inputPropertyLine.d.ts +5 -0
  23. package/fluent/hoc/inputPropertyLine.js +14 -0
  24. package/fluent/hoc/inputPropertyLine.js.map +1 -0
  25. package/fluent/hoc/linkPropertyLine.d.ts +15 -0
  26. package/fluent/hoc/linkPropertyLine.js +13 -0
  27. package/fluent/hoc/linkPropertyLine.js.map +1 -0
  28. package/fluent/hoc/propertyLine.d.ts +55 -0
  29. package/fluent/hoc/propertyLine.js +83 -0
  30. package/fluent/hoc/propertyLine.js.map +1 -0
  31. package/fluent/hoc/switchPropertyLine.d.ts +9 -0
  32. package/fluent/hoc/switchPropertyLine.js +15 -0
  33. package/fluent/hoc/switchPropertyLine.js.map +1 -0
  34. package/fluent/hoc/syncedSliderLine.d.ts +11 -0
  35. package/fluent/hoc/syncedSliderLine.js +13 -0
  36. package/fluent/hoc/syncedSliderLine.js.map +1 -0
  37. package/fluent/hoc/textPropertyLine.d.ts +13 -0
  38. package/fluent/hoc/textPropertyLine.js +12 -0
  39. package/fluent/hoc/textPropertyLine.js.map +1 -0
  40. package/fluent/hoc/vectorPropertyLine.d.ts +37 -0
  41. package/fluent/hoc/vectorPropertyLine.js +36 -0
  42. package/fluent/hoc/vectorPropertyLine.js.map +1 -0
  43. package/fluent/primitives/accordion.d.ts +6 -0
  44. package/fluent/primitives/accordion.js +32 -0
  45. package/fluent/primitives/accordion.js.map +1 -0
  46. package/fluent/primitives/checkbox.d.ts +9 -0
  47. package/fluent/primitives/checkbox.js +22 -0
  48. package/fluent/primitives/checkbox.js.map +1 -0
  49. package/fluent/primitives/colorPicker.d.ts +38 -0
  50. package/fluent/primitives/colorPicker.js +174 -0
  51. package/fluent/primitives/colorPicker.js.map +1 -0
  52. package/fluent/primitives/dropdown.d.ts +23 -0
  53. package/fluent/primitives/dropdown.js +32 -0
  54. package/fluent/primitives/dropdown.js.map +1 -0
  55. package/fluent/primitives/input.d.ts +14 -0
  56. package/fluent/primitives/input.js +36 -0
  57. package/fluent/primitives/input.js.map +1 -0
  58. package/fluent/primitives/link.d.ts +1 -0
  59. package/fluent/primitives/link.js +3 -0
  60. package/fluent/primitives/link.js.map +1 -0
  61. package/fluent/primitives/spinButton.d.ts +4 -0
  62. package/fluent/primitives/spinButton.js +28 -0
  63. package/fluent/primitives/spinButton.js.map +1 -0
  64. package/fluent/primitives/switch.d.ts +9 -0
  65. package/fluent/primitives/switch.js +31 -0
  66. package/fluent/primitives/switch.js.map +1 -0
  67. package/fluent/primitives/syncedSlider.d.ts +13 -0
  68. package/fluent/primitives/syncedSlider.js +46 -0
  69. package/fluent/primitives/syncedSlider.js.map +1 -0
  70. package/fluent/primitives/textarea.d.ts +12 -0
  71. package/fluent/primitives/textarea.js +27 -0
  72. package/fluent/primitives/textarea.js.map +1 -0
  73. package/lines/buttonLineComponent.d.ts +2 -0
  74. package/lines/buttonLineComponent.js +9 -1
  75. package/lines/buttonLineComponent.js.map +1 -1
  76. package/lines/checkBoxLineComponent.d.ts +2 -0
  77. package/lines/checkBoxLineComponent.js +14 -1
  78. package/lines/checkBoxLineComponent.js.map +1 -1
  79. package/lines/colorLineComponent.d.ts +2 -0
  80. package/lines/colorLineComponent.js +14 -1
  81. package/lines/colorLineComponent.js.map +1 -1
  82. package/lines/fileButtonLineComponent.d.ts +2 -0
  83. package/lines/fileButtonLineComponent.js +9 -1
  84. package/lines/fileButtonLineComponent.js.map +1 -1
  85. package/lines/optionsLineComponent.d.ts +3 -1
  86. package/lines/optionsLineComponent.js +16 -5
  87. package/lines/optionsLineComponent.js.map +1 -1
  88. package/lines/sliderLineComponent.d.ts +2 -0
  89. package/lines/sliderLineComponent.js +9 -1
  90. package/lines/sliderLineComponent.js.map +1 -1
  91. package/lines/textInputLineComponent.d.ts +7 -4
  92. package/lines/textInputLineComponent.js +16 -6
  93. package/lines/textInputLineComponent.js.map +1 -1
  94. package/lines/textLineComponent.d.ts +4 -1
  95. package/lines/textLineComponent.js +41 -13
  96. package/lines/textLineComponent.js.map +1 -1
  97. package/lines/vector3LineComponent.d.ts +3 -1
  98. package/lines/vector3LineComponent.js +12 -6
  99. package/lines/vector3LineComponent.js.map +1 -1
  100. package/package.json +1 -1
@@ -0,0 +1,14 @@
1
+ import type { FunctionComponent } from "react";
2
+ export type ButtonLineProps = {
3
+ label: string;
4
+ onClick: () => void;
5
+ disabled?: boolean;
6
+ icon?: string;
7
+ title?: string;
8
+ };
9
+ /**
10
+ * Wraps a button with a label in a line container
11
+ * @param props Button props plus a label
12
+ * @returns A button inside a line
13
+ */
14
+ export declare const ButtonLine: FunctionComponent<ButtonLineProps>;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Body1, Button, makeStyles, tokens } from "@fluentui/react-components";
3
+ import { LineContainer } from "./propertyLine.js";
4
+ const useButtonLineStyles = makeStyles({
5
+ button: {
6
+ border: `1px solid ${tokens.colorBrandBackground}`,
7
+ },
8
+ });
9
+ /**
10
+ * Wraps a button with a label in a line container
11
+ * @param props Button props plus a label
12
+ * @returns A button inside a line
13
+ */
14
+ export const ButtonLine = (props) => {
15
+ const classes = useButtonLineStyles();
16
+ return (_jsx(LineContainer, { children: _jsx(Button, { className: classes.button, ...props, children: _jsx(Body1, { children: props.label }) }) }));
17
+ };
18
+ //# sourceMappingURL=buttonLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buttonLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/buttonLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,MAAM,mBAAmB,GAAG,UAAU,CAAC;IACnC,MAAM,EAAE;QACJ,MAAM,EAAE,aAAa,MAAM,CAAC,oBAAoB,EAAE;KACrD;CACJ,CAAC,CAAC;AAUH;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAuC,CAAC,KAAK,EAAE,EAAE;IACpE,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IACtC,OAAO,CACH,KAAC,aAAa,cACV,KAAC,MAAM,IAAC,SAAS,EAAE,OAAO,CAAC,MAAM,KAAM,KAAK,YACxC,KAAC,KAAK,cAAE,KAAK,CAAC,KAAK,GAAS,GACvB,GACG,CACnB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Body1, Button, makeStyles, tokens } from \"@fluentui/react-components\";\r\nimport { LineContainer } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\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 ButtonLineProps = {\r\n label: string;\r\n onClick: () => void;\r\n disabled?: boolean;\r\n icon?: string;\r\n title?: string;\r\n};\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<ButtonLineProps> = (props) => {\r\n const classes = useButtonLineStyles();\r\n return (\r\n <LineContainer>\r\n <Button className={classes.button} {...props}>\r\n <Body1>{props.label}</Body1>\r\n </Button>\r\n </LineContainer>\r\n );\r\n};\r\n"]}
@@ -0,0 +1,9 @@
1
+ import type { PropertyLineProps } from "./propertyLine.js";
2
+ import type { FunctionComponent } from "react";
3
+ import type { CheckboxProps } from "../primitives/checkbox.js";
4
+ /**
5
+ * Wraps a checkbox in a property line
6
+ * @param props - PropertyLineProps and CheckboxProps
7
+ * @returns property-line wrapped checkbox
8
+ */
9
+ export declare const CheckboxPropertyLine: FunctionComponent<PropertyLineProps & CheckboxProps>;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PropertyLine } from "./propertyLine.js";
3
+ import { Checkbox } from "../primitives/checkbox.js";
4
+ /**
5
+ * Wraps a checkbox in a property line
6
+ * @param props - PropertyLineProps and CheckboxProps
7
+ * @returns property-line wrapped checkbox
8
+ */
9
+ export const CheckboxPropertyLine = (props) => {
10
+ return (_jsx(PropertyLine, { ...props, children: _jsx(Checkbox, { ...props }) }));
11
+ };
12
+ //# sourceMappingURL=checkboxPropertyLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkboxPropertyLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/checkboxPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD;;;;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"]}
@@ -0,0 +1,8 @@
1
+ import type { FunctionComponent } from "react";
2
+ import type { PropertyLineProps } from "./propertyLine.js";
3
+ import type { Color3 } from "@babylonjs/core/Maths/math.color.js";
4
+ import { Color4 } from "@babylonjs/core/Maths/math.color.js";
5
+ import type { ColorPickerProps } from "../primitives/colorPicker.js";
6
+ export type ColorPropertyLineProps = ColorPickerProps<Color3 | Color4> & PropertyLineProps;
7
+ export declare const Color3PropertyLine: FunctionComponent<ColorPickerProps<Color3> & PropertyLineProps>;
8
+ export declare const Color4PropertyLine: FunctionComponent<ColorPickerProps<Color4> & PropertyLineProps>;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useState } from "react";
3
+ import { PropertyLine } from "./propertyLine.js";
4
+ import { SyncedSliderLine } from "./syncedSliderLine.js";
5
+ import { Color4 } from "@babylonjs/core/Maths/math.color.js";
6
+ import { ColorPickerPopup } from "../primitives/colorPicker.js";
7
+ /**
8
+ * Reusable component which renders a color property line containing a label, colorPicker popout, and expandable RGBA values
9
+ * The expandable RGBA values are synced sliders that allow the user to modify the color's RGBA values directly
10
+ * @param props - PropertyLine props, replacing children with a color object so that we can properly display the color
11
+ * @returns Component wrapping a colorPicker component with a property line
12
+ */
13
+ const ColorPropertyLine = forwardRef((props, ref) => {
14
+ const [color, setColor] = useState(props.value);
15
+ const onSliderChange = (value, key) => {
16
+ let newColor;
17
+ if (key === "a") {
18
+ newColor = Color4.FromColor3(color, value);
19
+ }
20
+ else {
21
+ newColor = color.clone();
22
+ newColor[key] = value / 255.0;
23
+ }
24
+ setColor(newColor); // Create a new object to trigger re-render
25
+ props.onChange(newColor);
26
+ };
27
+ const onColorPickerChange = (newColor) => {
28
+ setColor(newColor);
29
+ props.onChange(newColor);
30
+ };
31
+ return (_jsx(PropertyLine, { ref: ref, ...props, expandedContent: _jsxs(_Fragment, { children: [_jsx(SyncedSliderLine, { label: "R", value: color.r * 255.0, min: 0, max: 255, step: 1, onChange: (value) => onSliderChange(value, "r") }), _jsx(SyncedSliderLine, { label: "G", value: color.g * 255.0, min: 0, max: 255, step: 1, onChange: (value) => onSliderChange(value, "g") }), _jsx(SyncedSliderLine, { label: "B", value: color.b * 255.0, min: 0, max: 255, step: 1, onChange: (value) => onSliderChange(value, "b") }), color instanceof Color4 && _jsx(SyncedSliderLine, { 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
+ });
33
+ export const Color3PropertyLine = ColorPropertyLine;
34
+ export const Color4PropertyLine = ColorPropertyLine;
35
+ //# sourceMappingURL=colorPropertyLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colorPropertyLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/colorPropertyLine.tsx"],"names":[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Component } from \"react\";\r\nimport { forwardRef, useState } from \"react\";\r\n\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport { PropertyLine } from \"./propertyLine\";\r\nimport { SyncedSliderLine } from \"./syncedSliderLine\";\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;\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.0;\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 <SyncedSliderLine label=\"R\" value={color.r * 255.0} min={0} max={255} step={1} onChange={(value) => onSliderChange(value, \"r\")} />\r\n <SyncedSliderLine label=\"G\" value={color.g * 255.0} min={0} max={255} step={1} onChange={(value) => onSliderChange(value, \"g\")} />\r\n <SyncedSliderLine label=\"B\" value={color.b * 255.0} min={0} max={255} step={1} onChange={(value) => onSliderChange(value, \"b\")} />\r\n {color instanceof Color4 && <SyncedSliderLine 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"]}
@@ -0,0 +1,9 @@
1
+ import type { DropdownProps } from "../primitives/dropdown.js";
2
+ import type { PropertyLineProps } from "./propertyLine.js";
3
+ import type { FunctionComponent } from "react";
4
+ /**
5
+ * Wraps a dropdown in a property line
6
+ * @param props - PropertyLineProps and DropdownProps
7
+ * @returns property-line wrapped dropdown
8
+ */
9
+ export declare const DropdownPropertyLine: FunctionComponent<PropertyLineProps & DropdownProps>;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Dropdown } from "../primitives/dropdown.js";
3
+ import { PropertyLine } from "./propertyLine.js";
4
+ /**
5
+ * Wraps a dropdown in a property line
6
+ * @param props - PropertyLineProps and DropdownProps
7
+ * @returns property-line wrapped dropdown
8
+ */
9
+ export const DropdownPropertyLine = (props) => {
10
+ return (_jsx(PropertyLine, { ...props, children: _jsx(Dropdown, { ...props }) }));
11
+ };
12
+ //# sourceMappingURL=dropdownPropertyLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdownPropertyLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/dropdownPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C;;;;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 { Dropdown } from \"../primitives/dropdown\";\r\nimport type { DropdownProps } from \"../primitives/dropdown\";\r\nimport { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\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\nexport const DropdownPropertyLine: FunctionComponent<PropertyLineProps & DropdownProps> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <Dropdown {...props} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
@@ -0,0 +1,8 @@
1
+ import type { FunctionComponent } from "react";
2
+ import type { ButtonLineProps } from "./buttonLine.js";
3
+ type FileUploadLineProps = Omit<ButtonLineProps, "onClick"> & {
4
+ onClick: (file: File) => void;
5
+ accept: string;
6
+ };
7
+ export declare const FileUploadLine: FunctionComponent<FileUploadLineProps>;
8
+ export {};
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef } from "react";
3
+ import { ButtonLine } from "./buttonLine.js";
4
+ export const FileUploadLine = (props) => {
5
+ const inputRef = useRef(null);
6
+ const handleButtonClick = () => {
7
+ inputRef.current?.click();
8
+ };
9
+ const handleChange = (evt) => {
10
+ const files = evt.target.files;
11
+ if (files && files.length) {
12
+ props.onClick(files[0]);
13
+ }
14
+ evt.target.value = "";
15
+ };
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
+ };
18
+ //# sourceMappingURL=fileUploadLine.js.map
@@ -0,0 +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;AAQ1C,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,CAAC,CAAC,CAAC;QAC5B,CAAC;QACD,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,CACH,8BACI,KAAC,UAAU,IAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,GAAe,EACzE,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 { ButtonLineProps } from \"./buttonLine\";\r\n\r\ntype FileUploadLineProps = Omit<ButtonLineProps, \"onClick\"> & {\r\n onClick: (file: File) => 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[0]);\r\n }\r\n evt.target.value = \"\";\r\n };\r\n\r\n return (\r\n <>\r\n <ButtonLine onClick={handleButtonClick} 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"]}
@@ -0,0 +1,23 @@
1
+ import type { PropsWithChildren, FunctionComponent } from "react";
2
+ import type { Theme } from "@fluentui/react-components";
3
+ export type ToolHostProps = {
4
+ /**
5
+ * Allows host to pass in a theme
6
+ */
7
+ customTheme?: Theme;
8
+ /**
9
+ * Can be set to true to disable the copy button in the tool's property lines. Default is false (copy enabled)
10
+ */
11
+ disableCopy?: boolean;
12
+ };
13
+ export declare const ToolContext: import("react").Context<{
14
+ readonly useFluent: boolean;
15
+ readonly disableCopy: boolean;
16
+ }>;
17
+ /**
18
+ * For tools which are ready to move over the fluent, wrap the root of the tool (or the panel which you want fluentized) with this component
19
+ * Today we will only enable fluent if the URL has the `newUX` query parameter is truthy
20
+ * @param props
21
+ * @returns
22
+ */
23
+ export declare const FluentToolWrapper: FunctionComponent<PropsWithChildren<ToolHostProps>>;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext } from "react";
3
+ import { FluentProvider, webDarkTheme } from "@fluentui/react-components";
4
+ export const ToolContext = createContext({ useFluent: false, disableCopy: false });
5
+ /**
6
+ * For tools which are ready to move over the fluent, wrap the root of the tool (or the panel which you want fluentized) with this component
7
+ * Today we will only enable fluent if the URL has the `newUX` query parameter is truthy
8
+ * @param props
9
+ * @returns
10
+ */
11
+ export const FluentToolWrapper = (props) => {
12
+ const url = new URL(window.location.href);
13
+ const enableFluent = url.searchParams.has("newUX") || url.hash.includes("newUX");
14
+ return enableFluent ? (_jsx(FluentProvider, { theme: props.customTheme || webDarkTheme, children: _jsx(ToolContext.Provider, { value: { useFluent: true, disableCopy: !!props.disableCopy }, children: props.children }) })) : (props.children);
15
+ };
16
+ //# sourceMappingURL=fluentToolWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluentToolWrapper.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/fluentToolWrapper.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAc1E,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC,EAAE,SAAS,EAAE,KAAgB,EAAE,WAAW,EAAE,KAAgB,EAAW,CAAC,CAAC;AAElH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAwD,CAAC,KAAK,EAAE,EAAE;IAC5F,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAEjF,OAAO,YAAY,CAAC,CAAC,CAAC,CAClB,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,CAAC,WAAW,IAAI,YAAY,YACpD,KAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,YAAG,KAAK,CAAC,QAAQ,GAAwB,GAC9G,CACpB,CAAC,CAAC,CAAC,CACA,KAAK,CAAC,QAAQ,CACjB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type { PropsWithChildren, FunctionComponent } from \"react\";\r\nimport { createContext } from \"react\";\r\nimport type { Theme } from \"@fluentui/react-components\";\r\nimport { FluentProvider, webDarkTheme } from \"@fluentui/react-components\";\r\n\r\nexport type ToolHostProps = {\r\n /**\r\n * Allows host to pass in a theme\r\n */\r\n customTheme?: Theme;\r\n\r\n /**\r\n * Can be set to true to disable the copy button in the tool's property lines. Default is false (copy enabled)\r\n */\r\n disableCopy?: boolean;\r\n};\r\n\r\nexport const ToolContext = createContext({ useFluent: false as boolean, disableCopy: false as boolean } as const);\r\n\r\n/**\r\n * For tools which are ready to move over the fluent, wrap the root of the tool (or the panel which you want fluentized) with this component\r\n * Today we will only enable fluent if the URL has the `newUX` query parameter is truthy\r\n * @param props\r\n * @returns\r\n */\r\nexport const FluentToolWrapper: FunctionComponent<PropsWithChildren<ToolHostProps>> = (props) => {\r\n const url = new URL(window.location.href);\r\n const enableFluent = url.searchParams.has(\"newUX\") || url.hash.includes(\"newUX\");\r\n\r\n return enableFluent ? (\r\n <FluentProvider theme={props.customTheme || webDarkTheme}>\r\n <ToolContext.Provider value={{ useFluent: true, disableCopy: !!props.disableCopy }}>{props.children}</ToolContext.Provider>\r\n </FluentProvider>\r\n ) : (\r\n props.children\r\n );\r\n};\r\n"]}
@@ -0,0 +1,9 @@
1
+ import type { PropertyLineProps } from "./propertyLine.js";
2
+ import type { FunctionComponent } from "react";
3
+ import type { InputHexProps } from "../primitives/colorPicker.js";
4
+ /**
5
+ * Wraps a hex input in a property line
6
+ * @param props - PropertyLineProps and InputHexProps
7
+ * @returns property-line wrapped input hex component
8
+ */
9
+ export declare const HexPropertyLine: FunctionComponent<InputHexProps & PropertyLineProps>;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PropertyLine } from "./propertyLine.js";
3
+ import { InputHexField } from "../primitives/colorPicker.js";
4
+ /**
5
+ * Wraps a hex input in a property line
6
+ * @param props - PropertyLineProps and InputHexProps
7
+ * @returns property-line wrapped input hex component
8
+ */
9
+ export const HexPropertyLine = (props) => {
10
+ return (_jsx(PropertyLine, { ...props, children: _jsx(InputHexField, { ...props }) }));
11
+ };
12
+ //# sourceMappingURL=hexLineComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hexLineComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/hexLineComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D;;;;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"]}
@@ -0,0 +1,5 @@
1
+ import type { PropertyLineProps } from "./propertyLine.js";
2
+ import type { FunctionComponent } from "react";
3
+ import type { InputProps } from "../primitives/input.js";
4
+ export declare const TextInputPropertyLine: FunctionComponent<InputProps<string> & PropertyLineProps>;
5
+ export declare const FloatInputPropertyLine: FunctionComponent<InputProps<number> & PropertyLineProps>;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PropertyLine } from "./propertyLine.js";
3
+ import { Input } from "../primitives/input.js";
4
+ /**
5
+ * Wraps an input in a property line
6
+ * @param props - PropertyLineProps and InputProps
7
+ * @returns property-line wrapped input component
8
+ */
9
+ const InputPropertyLine = (props) => {
10
+ return (_jsx(PropertyLine, { ...props, children: _jsx(Input, { ...props }) }));
11
+ };
12
+ export const TextInputPropertyLine = InputPropertyLine;
13
+ export const FloatInputPropertyLine = InputPropertyLine;
14
+ //# sourceMappingURL=inputPropertyLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputPropertyLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/inputPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAK5C;;;;GAIG;AACH,MAAM,iBAAiB,GAA8C,CAAC,KAAK,EAAE,EAAE;IAC3E,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,KAAK,OAAK,KAAK,GAAI,GACT,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAA8E,CAAC;AACpH,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAA8E,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { Input } from \"../primitives/input\";\r\nimport type { InputProps } from \"../primitives/input\";\r\n\r\ntype InputPropertyLineProps = InputProps<string | number> & PropertyLineProps;\r\n\r\n/**\r\n * Wraps an input in a property line\r\n * @param props - PropertyLineProps and InputProps\r\n * @returns property-line wrapped input component\r\n */\r\nconst InputPropertyLine: FunctionComponent<InputPropertyLineProps> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <Input {...props} />\r\n </PropertyLine>\r\n );\r\n};\r\n\r\nexport const TextInputPropertyLine = InputPropertyLine as FunctionComponent<InputProps<string> & PropertyLineProps>;\r\nexport const FloatInputPropertyLine = InputPropertyLine as FunctionComponent<InputProps<number> & PropertyLineProps>;\r\n"]}
@@ -0,0 +1,15 @@
1
+ import type { PropertyLineProps } from "./propertyLine.js";
2
+ import type { FunctionComponent } from "react";
3
+ type LinkProps = {
4
+ value: string;
5
+ tooltip?: string;
6
+ onLink?: () => void;
7
+ url?: string;
8
+ };
9
+ /**
10
+ * Wraps a link in a property line
11
+ * @param props - PropertyLineProps and LinkProps
12
+ * @returns property-line wrapped link
13
+ */
14
+ export declare const LinkPropertyLine: FunctionComponent<PropertyLineProps & LinkProps>;
15
+ export {};
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Body1 } from "@fluentui/react-components";
3
+ import { PropertyLine } from "./propertyLine.js";
4
+ import { Link } from "../primitives/link.js";
5
+ /**
6
+ * Wraps a link in a property line
7
+ * @param props - PropertyLineProps and LinkProps
8
+ * @returns property-line wrapped link
9
+ */
10
+ export const LinkPropertyLine = (props) => {
11
+ return (_jsx(PropertyLine, { ...props, children: _jsx(Link, { inline: true, appearance: "subtle", onClick: () => props.onLink?.(), href: props.url, title: props.tooltip, children: _jsx(Body1, { children: props.value }) }) }));
12
+ };
13
+ //# sourceMappingURL=linkPropertyLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkPropertyLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/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,oBAAoB,CAAC;AAW1C;;;;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"]}
@@ -0,0 +1,55 @@
1
+ import type { FunctionComponent } from "react";
2
+ export type PropertyLineProps = {
3
+ /**
4
+ * The name of the property to display in the property line.
5
+ */
6
+ label: string;
7
+ /**
8
+ * Optional description for the property, shown on hover of the info icon
9
+ */
10
+ description?: string;
11
+ /**
12
+ * Optional function returning a string to copy to clipboard.
13
+ */
14
+ onCopy?: () => string;
15
+ /**
16
+ * If supplied, an 'expand' icon will be shown which, when clicked, renders this component within the property line.
17
+ */
18
+ expandedContent?: JSX.Element;
19
+ /**
20
+ * Link to the documentation for this property, available from the info icon either linked from the description (if provided) or defalt 'docs' text
21
+ */
22
+ docLink?: string;
23
+ };
24
+ export declare const LineContainer: import("react").ForwardRefExoticComponent<{
25
+ children?: import("react").ReactNode | undefined;
26
+ } & import("react").RefAttributes<HTMLDivElement>>;
27
+ export type BaseComponentProps<T> = {
28
+ /**
29
+ * The value of the property to be displayed and modified.
30
+ */
31
+ value: T;
32
+ /**
33
+ * Callback function to handle changes to the value
34
+ */
35
+ onChange: (value: T) => void;
36
+ /**
37
+ * Optional flag to disable the component, preventing any interaction.
38
+ */
39
+ disabled?: boolean;
40
+ /**
41
+ * Optional class name to apply custom styles to the component.
42
+ */
43
+ className?: string;
44
+ };
45
+ /**
46
+ * A reusable component that renders a property line with a label and child content, and an optional description, copy button, and expandable section.
47
+ *
48
+ * @param props - The properties for the PropertyLine component.
49
+ * @returns A React element representing the property line.
50
+ *
51
+ */
52
+ export declare const PropertyLine: import("react").ForwardRefExoticComponent<PropertyLineProps & {
53
+ children?: import("react").ReactNode | undefined;
54
+ } & import("react").RefAttributes<HTMLDivElement>>;
55
+ export declare const PlaceholderPropertyLine: FunctionComponent<BaseComponentProps<any> & PropertyLineProps>;
@@ -0,0 +1,83 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Body1, Body1Strong, Button, InfoLabel, Link, ToggleButton, makeStyles, tokens } from "@fluentui/react-components";
3
+ import { Collapse } from "@fluentui/react-motion-components-preview";
4
+ import { AddFilled, CopyRegular, SubtractFilled } from "@fluentui/react-icons";
5
+ import { useContext, useState, forwardRef } from "react";
6
+ import { copyCommandToClipboard } from "../../copyCommandToClipboard.js";
7
+ import { ToolContext } from "./fluentToolWrapper.js";
8
+ const usePropertyLineStyles = makeStyles({
9
+ container: {
10
+ width: "100%",
11
+ display: "flex",
12
+ flexDirection: "column", // Stack line + expanded content
13
+ borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,
14
+ },
15
+ line: {
16
+ display: "flex",
17
+ alignItems: "center",
18
+ justifyContent: "flex-start",
19
+ padding: `${tokens.spacingVerticalXS} 0px`,
20
+ width: "100%",
21
+ },
22
+ label: {
23
+ flex: "1 1 0",
24
+ minWidth: "50px",
25
+ textAlign: "left",
26
+ whiteSpace: "nowrap",
27
+ overflow: "hidden",
28
+ textOverflow: "ellipsis",
29
+ },
30
+ labelText: {
31
+ whiteSpace: "nowrap",
32
+ },
33
+ rightContent: {
34
+ flex: "0 1 auto",
35
+ display: "flex",
36
+ alignItems: "center",
37
+ justifyContent: "flex-end",
38
+ gap: tokens.spacingHorizontalS,
39
+ },
40
+ button: {
41
+ marginLeft: tokens.spacingHorizontalXXS,
42
+ margin: 0,
43
+ padding: 0,
44
+ border: 0,
45
+ minWidth: 0,
46
+ },
47
+ fillRestOfRightContentWidth: {
48
+ flex: 1,
49
+ display: "flex",
50
+ justifyContent: "flex-end",
51
+ alignItems: "center",
52
+ },
53
+ expandButton: {
54
+ margin: 0,
55
+ },
56
+ expandedContent: {},
57
+ });
58
+ export const LineContainer = forwardRef((props, ref) => {
59
+ const classes = usePropertyLineStyles();
60
+ return (_jsx("div", { ref: ref, className: classes.container, children: props.children }));
61
+ });
62
+ /**
63
+ * A reusable component that renders a property line with a label and child content, and an optional description, copy button, and expandable section.
64
+ *
65
+ * @param props - The properties for the PropertyLine component.
66
+ * @returns A React element representing the property line.
67
+ *
68
+ */
69
+ export const PropertyLine = forwardRef((props, ref) => {
70
+ const classes = usePropertyLineStyles();
71
+ const [expanded, setExpanded] = useState(false);
72
+ const { label, onCopy, expandedContent, children } = props;
73
+ const { disableCopy } = useContext(ToolContext);
74
+ const description = props.description ?? (props.docLink ? _jsx(Link, { href: props.docLink, children: props.description ?? "Docs" }) : props.description);
75
+ return (_jsxs(LineContainer, { ref: ref, children: [_jsxs("div", { className: classes.line, children: [_jsx(InfoLabel, { className: classes.label, info: description, children: _jsx(Body1Strong, { className: classes.labelText, children: label }) }), _jsxs("div", { className: classes.rightContent, children: [_jsx("div", { className: classes.fillRestOfRightContentWidth, children: children }), expandedContent && (_jsx(ToggleButton, { appearance: "transparent", icon: expanded ? _jsx(SubtractFilled, {}) : _jsx(AddFilled, {}), className: classes.button, checked: expanded, onClick: (e) => {
76
+ e.stopPropagation();
77
+ setExpanded((expanded) => !expanded);
78
+ } })), onCopy && !disableCopy && (_jsx(Button, { className: classes.button, id: "copyProperty", icon: _jsx(CopyRegular, {}), onClick: () => copyCommandToClipboard(onCopy()), title: "Copy to clipboard" }))] })] }), _jsx(Collapse, { visible: expanded && !!expandedContent, children: _jsx("div", { className: classes.expandedContent, children: expandedContent }) })] }));
79
+ });
80
+ export const PlaceholderPropertyLine = (props) => {
81
+ return (_jsx(PropertyLine, { ...props, children: _jsx(Body1, { children: props.value }) }));
82
+ };
83
+ //# sourceMappingURL=propertyLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propertyLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC3H,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,qBAAqB,GAAG,UAAU,CAAC;IACrC,SAAS,EAAE;QACP,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,QAAQ,EAAE,gCAAgC;QACzD,YAAY,EAAE,GAAG,MAAM,CAAC,eAAe,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CAAC,eAAe,EAAE,CAAC;oCACpB,WAAW,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;gCACzC,CAAC,GACH,CACL,EAEA,MAAM,IAAI,CAAC,WAAW,IAAI,CACvB,KAAC,MAAM,IAAC,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,EAAC,cAAc,EAAC,IAAI,EAAE,KAAC,WAAW,KAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAC,mBAAmB,GAAG,CAC5J,IACC,IACJ,EACN,KAAC,QAAQ,IAAC,OAAO,EAAE,QAAQ,IAAI,CAAC,CAAC,eAAe,YAC5C,cAAK,SAAS,EAAE,OAAO,CAAC,eAAe,YAAG,eAAe,GAAO,GACzD,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, 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 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 padding: `${tokens.spacingVerticalXS} 0px`,\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>((props, ref) => {\r\n const classes = usePropertyLineStyles();\r\n return (\r\n <div ref={ref} className={classes.container}>\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"]}
@@ -0,0 +1,9 @@
1
+ import type { PropertyLineProps } from "./propertyLine.js";
2
+ import type { FunctionComponent } from "react";
3
+ import type { SwitchProps } from "../primitives/switch.js";
4
+ /**
5
+ * Wraps a switch in a property line
6
+ * @param props - The properties for the switch and property line
7
+ * @returns A React element representing the property line with a switch
8
+ */
9
+ export declare const SwitchPropertyLine: FunctionComponent<PropertyLineProps & SwitchProps>;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PropertyLine } from "./propertyLine.js";
3
+ import { Switch } from "../primitives/switch.js";
4
+ /**
5
+ * Wraps a switch in a property line
6
+ * @param props - The properties for the switch and property line
7
+ * @returns A React element representing the property line with a switch
8
+ */
9
+ export const SwitchPropertyLine = (props) => {
10
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+ const { label, ...switchProps } = props;
12
+ // Ensure the label gets passed to the PropertyLine component and not to the underlying switch
13
+ return (_jsx(PropertyLine, { ...props, children: _jsx(Switch, { ...switchProps }) }));
14
+ };
15
+ //# sourceMappingURL=switchPropertyLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switchPropertyLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/switchPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C;;;;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 SyncedSliderLineProps = SyncedSliderProps & PropertyLineProps;
5
+ /**
6
+ * Renders a simple wrapper around the SyncedSliderInput
7
+ * @param props
8
+ * @returns
9
+ */
10
+ export declare const SyncedSliderLine: FunctionComponent<SyncedSliderLineProps>;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PropertyLine } from "./propertyLine.js";
3
+ import { SyncedSliderInput } from "../primitives/syncedSlider.js";
4
+ /**
5
+ * Renders a simple wrapper around the SyncedSliderInput
6
+ * @param props
7
+ * @returns
8
+ */
9
+ export const SyncedSliderLine = (props) => {
10
+ const { label, ...sliderProps } = props;
11
+ return (_jsx(PropertyLine, { label: label, children: _jsx(SyncedSliderInput, { ...sliderProps }) }));
12
+ };
13
+ //# sourceMappingURL=syncedSliderLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syncedSliderLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/syncedSliderLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAK/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA6C,CAAC,KAAK,EAAsB,EAAE;IACpG,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IACxC,OAAO,CACH,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,YACtB,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 SyncedSliderLineProps = 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 SyncedSliderLine: FunctionComponent<SyncedSliderLineProps> = (props): React.ReactElement => {\r\n const { label, ...sliderProps } = props;\r\n return (\r\n <PropertyLine label={label}>\r\n <SyncedSliderInput {...sliderProps} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
@@ -0,0 +1,13 @@
1
+ import type { PropertyLineProps } from "./propertyLine.js";
2
+ import type { FunctionComponent } from "react";
3
+ type TextProps = {
4
+ value: string;
5
+ tooltip?: string;
6
+ };
7
+ /**
8
+ * Wraps text in a property line
9
+ * @param props - PropertyLineProps and TextProps
10
+ * @returns property-line wrapped text
11
+ */
12
+ export declare const TextPropertyLine: FunctionComponent<PropertyLineProps & TextProps>;
13
+ export {};
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Body1 } from "@fluentui/react-components";
3
+ import { PropertyLine } from "./propertyLine.js";
4
+ /**
5
+ * Wraps text in a property line
6
+ * @param props - PropertyLineProps and TextProps
7
+ * @returns property-line wrapped text
8
+ */
9
+ export const TextPropertyLine = (props) => {
10
+ return (_jsx(PropertyLine, { ...props, children: _jsx(Body1, { title: props.tooltip, children: props.value }) }));
11
+ };
12
+ //# sourceMappingURL=textPropertyLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textPropertyLine.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/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"]}