@babylonjs/shared-ui-components 8.18.0 → 8.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fluent/hoc/propertyLines/booleanBadgePropertyLine.d.ts +2 -3
- package/fluent/hoc/propertyLines/booleanBadgePropertyLine.js.map +1 -1
- package/fluent/hoc/propertyLines/checkboxPropertyLine.d.ts +2 -2
- package/fluent/hoc/propertyLines/checkboxPropertyLine.js.map +1 -1
- package/fluent/hoc/propertyLines/colorPropertyLine.d.ts +3 -3
- package/fluent/hoc/propertyLines/colorPropertyLine.js.map +1 -1
- package/fluent/hoc/propertyLines/dropdownPropertyLine.d.ts +3 -24
- package/fluent/hoc/propertyLines/dropdownPropertyLine.js +2 -24
- package/fluent/hoc/propertyLines/dropdownPropertyLine.js.map +1 -1
- package/fluent/hoc/propertyLines/hexPropertyLine.d.ts +2 -1
- package/fluent/hoc/propertyLines/hexPropertyLine.js.map +1 -1
- package/fluent/hoc/propertyLines/inputPropertyLine.d.ts +2 -2
- package/fluent/hoc/propertyLines/inputPropertyLine.js.map +1 -1
- package/fluent/hoc/propertyLines/linkPropertyLine.d.ts +3 -4
- package/fluent/hoc/propertyLines/linkPropertyLine.js +1 -1
- package/fluent/hoc/propertyLines/linkPropertyLine.js.map +1 -1
- package/fluent/hoc/propertyLines/propertyLine.d.ts +21 -26
- package/fluent/hoc/propertyLines/propertyLine.js +31 -9
- package/fluent/hoc/propertyLines/propertyLine.js.map +1 -1
- package/fluent/hoc/propertyLines/spinButtonPropertyLine.d.ts +4 -0
- package/fluent/hoc/propertyLines/spinButtonPropertyLine.js +5 -0
- package/fluent/hoc/propertyLines/spinButtonPropertyLine.js.map +1 -0
- package/fluent/hoc/propertyLines/switchPropertyLine.d.ts +1 -1
- package/fluent/hoc/propertyLines/switchPropertyLine.js.map +1 -1
- package/fluent/hoc/propertyLines/syncedSliderPropertyLine.d.ts +1 -1
- package/fluent/hoc/propertyLines/syncedSliderPropertyLine.js +1 -1
- package/fluent/hoc/propertyLines/syncedSliderPropertyLine.js.map +1 -1
- package/fluent/hoc/propertyLines/textAreaPropertyLine.d.ts +9 -0
- package/fluent/hoc/propertyLines/textAreaPropertyLine.js +12 -0
- package/fluent/hoc/propertyLines/textAreaPropertyLine.js.map +1 -0
- package/fluent/hoc/propertyLines/textPropertyLine.d.ts +2 -6
- package/fluent/hoc/propertyLines/textPropertyLine.js +2 -1
- package/fluent/hoc/propertyLines/textPropertyLine.js.map +1 -1
- package/fluent/hoc/propertyLines/vectorPropertyLine.d.ts +3 -2
- package/fluent/hoc/propertyLines/vectorPropertyLine.js +3 -1
- package/fluent/hoc/propertyLines/vectorPropertyLine.js.map +1 -1
- package/fluent/primitives/checkbox.d.ts +2 -3
- package/fluent/primitives/checkbox.js.map +1 -1
- package/fluent/primitives/colorPicker.d.ts +3 -3
- package/fluent/primitives/colorPicker.js.map +1 -1
- package/fluent/primitives/dropdown.d.ts +2 -2
- package/fluent/primitives/dropdown.js.map +1 -1
- package/fluent/primitives/gradient.d.ts +5 -5
- package/fluent/primitives/gradient.js.map +1 -1
- package/fluent/primitives/input.d.ts +2 -2
- package/fluent/primitives/input.js.map +1 -1
- package/fluent/primitives/positionedPopover.js +1 -4
- package/fluent/primitives/positionedPopover.js.map +1 -1
- package/fluent/primitives/primitive.d.ts +24 -0
- package/fluent/primitives/primitive.js +2 -0
- package/fluent/primitives/primitive.js.map +1 -0
- package/fluent/primitives/spinButton.d.ts +2 -3
- package/fluent/primitives/spinButton.js +0 -2
- package/fluent/primitives/spinButton.js.map +1 -1
- package/fluent/primitives/switch.d.ts +2 -2
- package/fluent/primitives/switch.js.map +1 -1
- package/fluent/primitives/syncedSlider.d.ts +2 -2
- package/fluent/primitives/syncedSlider.js.map +1 -1
- package/fluent/primitives/textarea.d.ts +3 -4
- package/fluent/primitives/textarea.js +2 -5
- package/fluent/primitives/textarea.js.map +1 -1
- package/lines/floatLineComponent.js +1 -1
- package/lines/floatLineComponent.js.map +1 -1
- package/lines/textInputLineComponent.js +1 -1
- package/lines/textInputLineComponent.js.map +1 -1
- package/lines/vector3LineComponent.js.map +1 -1
- package/package.json +1 -1
@@ -1,10 +1,9 @@
|
|
1
1
|
import type { FunctionComponent } from "react";
|
2
|
+
import type { ImmutablePrimitiveProps } from "../../primitives/primitive.js";
|
2
3
|
import type { PropertyLineProps } from "./propertyLine.js";
|
3
4
|
/**
|
4
5
|
* Displays an icon indicating enabled (green check) or disabled (red cross) state
|
5
6
|
* @param props - The properties for the PropertyLine, including the boolean value to display.
|
6
7
|
* @returns A PropertyLine component with a PresenceBadge indicating the boolean state.
|
7
8
|
*/
|
8
|
-
export declare const BooleanBadgePropertyLine: FunctionComponent<PropertyLineProps &
|
9
|
-
value: boolean;
|
10
|
-
}>;
|
9
|
+
export declare const BooleanBadgePropertyLine: FunctionComponent<PropertyLineProps<boolean> & ImmutablePrimitiveProps<boolean>>;
|
@@ -1 +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,
|
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,GAAqF,CAAC,KAAK,EAAE,EAAE,CAAC,CACjI,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 { ImmutablePrimitiveProps } from \"../../primitives/primitive\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\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<boolean> & ImmutablePrimitiveProps<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,9 +1,9 @@
|
|
1
|
+
import type { PrimitiveProps } from "../../primitives/primitive.js";
|
1
2
|
import type { PropertyLineProps } from "./propertyLine.js";
|
2
3
|
import type { FunctionComponent } from "react";
|
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
|
7
7
|
* @returns property-line wrapped checkbox
|
8
8
|
*/
|
9
|
-
export declare const CheckboxPropertyLine: FunctionComponent<PropertyLineProps &
|
9
|
+
export declare const CheckboxPropertyLine: FunctionComponent<PropertyLineProps<boolean> & PrimitiveProps<boolean>>;
|
@@ -1 +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;
|
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;AAI9C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA4E,CAAC,KAAK,EAAE,EAAE;IACnH,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 { PrimitiveProps } from \"../../primitives/primitive\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { Checkbox } 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<boolean> & PrimitiveProps<boolean>> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <Checkbox {...props} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
|
@@ -3,6 +3,6 @@ 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
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
|
6
|
+
export type ColorPropertyLineProps = ColorPickerProps<Color3 | Color4> & PropertyLineProps<Color3 | Color4>;
|
7
|
+
export declare const Color3PropertyLine: FunctionComponent<ColorPickerProps<Color3> & PropertyLineProps<Color3>>;
|
8
|
+
export declare const Color4PropertyLine: FunctionComponent<ColorPickerProps<Color4> & PropertyLineProps<Color4>>;
|
@@ -1 +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,CAAC;AAG7C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAKhE;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,UAAU,CAAyC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACxF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAEhD,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,GAA0B,EAAE,EAAE;QACjE,IAAI,QAAyB,CAAC;QAC9B,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;YACd,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACJ,QAAQ,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;YACzB,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC;QAChC,CAAC;QAED,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,2CAA2C;QAC/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AI,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,iBAA4F,CAAC;AAC/H,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAA4F,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<Color3 | Color4>;\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<Color3>>;\r\nexport const Color4PropertyLine = ColorPropertyLine as FunctionComponent<ColorPickerProps<Color4> & PropertyLineProps<Color4>>;\r\n"]}
|
@@ -1,34 +1,13 @@
|
|
1
|
-
import type { Nullable } from "@babylonjs/core/types.js";
|
2
1
|
import type { AcceptedDropdownValue, DropdownProps } from "../../primitives/dropdown.js";
|
3
2
|
import type { PropertyLineProps } from "./propertyLine.js";
|
4
3
|
import type { FunctionComponent } from "react";
|
5
|
-
type DropdownPropertyLineProps<V extends AcceptedDropdownValue> = Omit<DropdownProps<V>, "includeNullAs"> & PropertyLineProps
|
4
|
+
type DropdownPropertyLineProps<V extends AcceptedDropdownValue> = Omit<DropdownProps<V>, "includeNullAs"> & PropertyLineProps<AcceptedDropdownValue>;
|
6
5
|
/**
|
7
|
-
* Dropdown component for
|
8
|
-
* If value can be undefined, use OptionalNumberDropdownPropertyLine instead.
|
9
|
-
* If value can be null, use NullableNumberDropdownPropertyLine instead.
|
6
|
+
* Dropdown component for number values.
|
10
7
|
*/
|
11
8
|
export declare const NumberDropdownPropertyLine: FunctionComponent<DropdownPropertyLineProps<number>>;
|
12
9
|
/**
|
13
|
-
* Dropdown component for
|
14
|
-
* If value can be undefined, use OptionalStringDropdownPropertyLine instead.
|
15
|
-
* If value can be null, use NullableStringDropdownPropertyLine instead.
|
10
|
+
* Dropdown component for string values
|
16
11
|
*/
|
17
12
|
export declare const StringDropdownPropertyLine: FunctionComponent<DropdownPropertyLineProps<string>>;
|
18
|
-
/**
|
19
|
-
* Dropdown component for Nullable<number> values.
|
20
|
-
*/
|
21
|
-
export declare const NullableNumberDropdownPropertyLine: FunctionComponent<DropdownPropertyLineProps<Nullable<number>>>;
|
22
|
-
/**
|
23
|
-
* Dropdown component for Nullable<string> values.
|
24
|
-
*/
|
25
|
-
export declare const NullableStringDropdownPropertyLine: FunctionComponent<DropdownPropertyLineProps<Nullable<string>>>;
|
26
|
-
/**
|
27
|
-
* Dropdown component for number | undefined values
|
28
|
-
*/
|
29
|
-
export declare const OptionalNumberDropdownPropertyLine: FunctionComponent<DropdownPropertyLineProps<number | undefined>>;
|
30
|
-
/**
|
31
|
-
* Dropdown component for string | undefined values
|
32
|
-
*/
|
33
|
-
export declare const OptionalStringDropdownPropertyLine: FunctionComponent<DropdownPropertyLineProps<string | undefined>>;
|
34
13
|
export {};
|
@@ -9,34 +9,12 @@ import { PropertyLine } from "./propertyLine.js";
|
|
9
9
|
const DropdownPropertyLine = (props) => {
|
10
10
|
return (_jsx(PropertyLine, { ...props, children: _jsx(Dropdown, { ...props }) }));
|
11
11
|
};
|
12
|
-
const NullableDropdownPropertyLine = (props) => _jsx(DropdownPropertyLine, { ...props, includeNullAs: "null" });
|
13
|
-
const OptionalDropdownPropertyLine = (props) => _jsx(DropdownPropertyLine, { ...props, includeNullAs: "undefined" });
|
14
12
|
/**
|
15
|
-
* Dropdown component for
|
16
|
-
* If value can be undefined, use OptionalNumberDropdownPropertyLine instead.
|
17
|
-
* If value can be null, use NullableNumberDropdownPropertyLine instead.
|
13
|
+
* Dropdown component for number values.
|
18
14
|
*/
|
19
15
|
export const NumberDropdownPropertyLine = DropdownPropertyLine;
|
20
16
|
/**
|
21
|
-
* Dropdown component for
|
22
|
-
* If value can be undefined, use OptionalStringDropdownPropertyLine instead.
|
23
|
-
* If value can be null, use NullableStringDropdownPropertyLine instead.
|
17
|
+
* Dropdown component for string values
|
24
18
|
*/
|
25
19
|
export const StringDropdownPropertyLine = DropdownPropertyLine;
|
26
|
-
/**
|
27
|
-
* Dropdown component for Nullable<number> values.
|
28
|
-
*/
|
29
|
-
export const NullableNumberDropdownPropertyLine = NullableDropdownPropertyLine;
|
30
|
-
/**
|
31
|
-
* Dropdown component for Nullable<string> values.
|
32
|
-
*/
|
33
|
-
export const NullableStringDropdownPropertyLine = NullableDropdownPropertyLine;
|
34
|
-
/**
|
35
|
-
* Dropdown component for number | undefined values
|
36
|
-
*/
|
37
|
-
export const OptionalNumberDropdownPropertyLine = OptionalDropdownPropertyLine;
|
38
|
-
/**
|
39
|
-
* Dropdown component for string | undefined values
|
40
|
-
*/
|
41
|
-
export const OptionalStringDropdownPropertyLine = OptionalDropdownPropertyLine;
|
42
20
|
//# sourceMappingURL=dropdownPropertyLine.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dropdownPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/dropdownPropertyLine.tsx"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"dropdownPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/dropdownPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C;;;;GAIG;AACH,MAAM,oBAAoB,GAAuG,CAAC,KAAK,EAAE,EAAE;IACvI,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,QAAQ,OAAK,KAAK,GAAI,GACZ,CAClB,CAAC;AACN,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAA4E,CAAC;AACvH;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAA4E,CAAC","sourcesContent":["import { 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\n// In a follow-up PR i will remove the nullAs concept from dropdown\r\ntype DropdownPropertyLineProps<V extends AcceptedDropdownValue> = Omit<DropdownProps<V>, \"includeNullAs\"> & PropertyLineProps<AcceptedDropdownValue>;\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<AcceptedDropdownValue>> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <Dropdown {...props} />\r\n </PropertyLine>\r\n );\r\n};\r\n\r\n/**\r\n * Dropdown component for number values.\r\n */\r\nexport const NumberDropdownPropertyLine = DropdownPropertyLine as FunctionComponent<DropdownPropertyLineProps<number>>;\r\n/**\r\n * Dropdown component for string values\r\n */\r\nexport const StringDropdownPropertyLine = DropdownPropertyLine as FunctionComponent<DropdownPropertyLineProps<string>>;\r\n"]}
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import type { PropertyLineProps } from "./propertyLine.js";
|
2
2
|
import type { FunctionComponent } from "react";
|
3
3
|
import type { InputHexProps } from "../../primitives/colorPicker.js";
|
4
|
+
import type { Color3, Color4 } from "@babylonjs/core/Maths/math.color.js";
|
4
5
|
/**
|
5
6
|
* Wraps a hex input in a property line
|
6
7
|
* @param props - PropertyLineProps and InputHexProps
|
7
8
|
* @returns property-line wrapped input hex component
|
8
9
|
*/
|
9
|
-
export declare const HexPropertyLine: FunctionComponent<InputHexProps & PropertyLineProps
|
10
|
+
export declare const HexPropertyLine: FunctionComponent<InputHexProps & PropertyLineProps<Color3 | Color4>>;
|
@@ -1 +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;
|
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;AAI7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAA0E,CAAC,KAAK,EAAE,EAAE;IAC5G,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\nimport type { Color3, Color4 } from \"core/Maths/math.color\";\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<Color3 | Color4>> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <InputHexField {...props} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
|
@@ -6,10 +6,10 @@ import type { InputProps } from "../../primitives/input.js";
|
|
6
6
|
* @param props - PropertyLineProps and InputProps
|
7
7
|
* @returns property-line wrapped input component
|
8
8
|
*/
|
9
|
-
export declare const TextInputPropertyLine: FunctionComponent<InputProps<string> & PropertyLineProps
|
9
|
+
export declare const TextInputPropertyLine: FunctionComponent<InputProps<string> & PropertyLineProps<string>>;
|
10
10
|
/**
|
11
11
|
* Wraps a number input in a property line
|
12
12
|
* @param props - PropertyLineProps and InputProps
|
13
13
|
* @returns property-line wrapped input component
|
14
14
|
*/
|
15
|
-
export declare const NumberInputPropertyLine: FunctionComponent<InputProps<number> & PropertyLineProps
|
15
|
+
export declare const NumberInputPropertyLine: FunctionComponent<InputProps<number> & PropertyLineProps<number>>;
|
@@ -1 +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,
|
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,GAAsE,CAAC,KAAK,EAAE,EAAE,CAAC,CAC/G,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,SAAS,OAAK,KAAK,GAAI,GACb,CAClB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsE,CAAC,KAAK,EAAE,EAAE,CAAC,CACjH,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<string>> = (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<number>> = (props) => (\r\n <PropertyLine {...props}>\r\n <NumberInput {...props} />\r\n </PropertyLine>\r\n);\r\n"]}
|
@@ -1,8 +1,7 @@
|
|
1
|
+
import type { ImmutablePrimitiveProps } from "../../primitives/primitive.js";
|
1
2
|
import type { PropertyLineProps } from "./propertyLine.js";
|
2
3
|
import type { FunctionComponent } from "react";
|
3
|
-
type LinkProps = {
|
4
|
-
value: string;
|
5
|
-
tooltip?: string;
|
4
|
+
type LinkProps = ImmutablePrimitiveProps<string> & {
|
6
5
|
onLink?: () => void;
|
7
6
|
url?: string;
|
8
7
|
};
|
@@ -11,5 +10,5 @@ type LinkProps = {
|
|
11
10
|
* @param props - PropertyLineProps and LinkProps
|
12
11
|
* @returns property-line wrapped link
|
13
12
|
*/
|
14
|
-
export declare const LinkPropertyLine: FunctionComponent<PropertyLineProps & LinkProps>;
|
13
|
+
export declare const LinkPropertyLine: FunctionComponent<PropertyLineProps<string> & LinkProps>;
|
15
14
|
export {};
|
@@ -8,6 +8,6 @@ import { Link } from "../../primitives/link.js";
|
|
8
8
|
* @returns property-line wrapped link
|
9
9
|
*/
|
10
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.
|
11
|
+
return (_jsx(PropertyLine, { ...props, children: _jsx(Link, { inline: true, appearance: "subtle", onClick: () => props.onLink?.(), href: props.url, title: props.title, children: _jsx(Body1, { children: props.value }) }) }));
|
12
12
|
};
|
13
13
|
//# sourceMappingURL=linkPropertyLine.js.map
|
@@ -1 +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;
|
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;AAU7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA6D,CAAC,KAAK,EAAE,EAAE;IAChG,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,KAAK,YACjG,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 { ImmutablePrimitiveProps } from \"../../primitives/primitive\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\n\r\ntype LinkProps = ImmutablePrimitiveProps<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<string> & LinkProps> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <Link inline appearance=\"subtle\" onClick={() => props.onLink?.()} href={props.url} title={props.title}>\r\n <Body1>{props.value}</Body1>\r\n </Link>\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { FunctionComponent, HTMLProps, PropsWithChildren } from "react";
|
2
|
-
|
2
|
+
import type { PrimitiveProps } from "../../primitives/primitive.js";
|
3
|
+
type BasePropertyLineProps = {
|
3
4
|
/**
|
4
5
|
* The name of the property to display in the property line.
|
5
6
|
*/
|
@@ -16,10 +17,17 @@ export type PropertyLineProps = {
|
|
16
17
|
* Link to the documentation for this property, available from the info icon either linked from the description (if provided) or default 'docs' text
|
17
18
|
*/
|
18
19
|
docLink?: string;
|
19
|
-
}
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
};
|
21
|
+
type NullableProperty<ValueT> = {
|
22
|
+
nullable: true;
|
23
|
+
value: ValueT;
|
24
|
+
onChange: (value: ValueT) => void;
|
25
|
+
defaultValue?: ValueT;
|
26
|
+
};
|
27
|
+
type NonNullableProperty = {
|
28
|
+
nullable?: false;
|
29
|
+
};
|
30
|
+
type ExpandableProperty = {
|
23
31
|
/**
|
24
32
|
* If supplied, an 'expand' icon will be shown which, when clicked, renders this component within the property line.
|
25
33
|
*/
|
@@ -28,26 +36,11 @@ export type PropertyLineProps = {
|
|
28
36
|
* If true, the expanded content will be shown by default.
|
29
37
|
*/
|
30
38
|
expandByDefault?: boolean;
|
31
|
-
});
|
32
|
-
export declare const LineContainer: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<HTMLProps<HTMLDivElement>>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
33
|
-
export type BaseComponentProps<T> = {
|
34
|
-
/**
|
35
|
-
* The value of the property to be displayed and modified.
|
36
|
-
*/
|
37
|
-
value: T;
|
38
|
-
/**
|
39
|
-
* Callback function to handle changes to the value
|
40
|
-
*/
|
41
|
-
onChange: (value: T) => void;
|
42
|
-
/**
|
43
|
-
* Optional flag to disable the component, preventing any interaction.
|
44
|
-
*/
|
45
|
-
disabled?: boolean;
|
46
|
-
/**
|
47
|
-
* Optional class name to apply custom styles to the component.
|
48
|
-
*/
|
49
|
-
className?: string;
|
50
39
|
};
|
40
|
+
type NonExpandableProperty = {
|
41
|
+
expandedContent?: undefined;
|
42
|
+
};
|
43
|
+
export type PropertyLineProps<ValueT> = BasePropertyLineProps & (NullableProperty<ValueT> | NonNullableProperty) & (ExpandableProperty | NonExpandableProperty);
|
51
44
|
/**
|
52
45
|
* A reusable component that renders a property line with a label and child content, and an optional description, copy button, and expandable section.
|
53
46
|
*
|
@@ -55,5 +48,7 @@ export type BaseComponentProps<T> = {
|
|
55
48
|
* @returns A React element representing the property line.
|
56
49
|
*
|
57
50
|
*/
|
58
|
-
export declare const PropertyLine: import("react").ForwardRefExoticComponent<PropsWithChildren<PropertyLineProps
|
59
|
-
export declare const
|
51
|
+
export declare const PropertyLine: import("react").ForwardRefExoticComponent<PropsWithChildren<PropertyLineProps<any>> & import("react").RefAttributes<HTMLDivElement>>;
|
52
|
+
export declare const LineContainer: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<HTMLProps<HTMLDivElement>>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
53
|
+
export declare const PlaceholderPropertyLine: FunctionComponent<PrimitiveProps<any> & PropertyLineProps<any>>;
|
54
|
+
export {};
|
@@ -1,8 +1,8 @@
|
|
1
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";
|
2
|
+
import { Body1, Body1Strong, Button, InfoLabel, Link, ToggleButton, Checkbox, makeStyles, tokens } from "@fluentui/react-components";
|
3
3
|
import { Collapse } from "@fluentui/react-motion-components-preview";
|
4
4
|
import { AddFilled, CopyRegular, SubtractFilled } from "@fluentui/react-icons";
|
5
|
-
import { useContext, useState, forwardRef } from "react";
|
5
|
+
import { useContext, useState, forwardRef, cloneElement, isValidElement, useRef } from "react";
|
6
6
|
import { copyCommandToClipboard } from "../../../copyCommandToClipboard.js";
|
7
7
|
import { ToolContext } from "../fluentToolWrapper.js";
|
8
8
|
const usePropertyLineStyles = makeStyles({
|
@@ -55,10 +55,6 @@ const usePropertyLineStyles = makeStyles({
|
|
55
55
|
},
|
56
56
|
expandedContent: {},
|
57
57
|
});
|
58
|
-
export const LineContainer = forwardRef((props, ref) => {
|
59
|
-
const classes = usePropertyLineStyles();
|
60
|
-
return (_jsx("div", { ref: ref, className: classes.container, ...props, children: props.children }));
|
61
|
-
});
|
62
58
|
/**
|
63
59
|
* A reusable component that renders a property line with a label and child content, and an optional description, copy button, and expandable section.
|
64
60
|
*
|
@@ -68,15 +64,41 @@ export const LineContainer = forwardRef((props, ref) => {
|
|
68
64
|
*/
|
69
65
|
export const PropertyLine = forwardRef((props, ref) => {
|
70
66
|
const classes = usePropertyLineStyles();
|
71
|
-
const
|
72
|
-
const
|
67
|
+
const { label, onCopy, expandedContent, children, nullable } = props;
|
68
|
+
const [expanded, setExpanded] = useState("expandByDefault" in props ? props.expandByDefault : false);
|
69
|
+
const cachedVal = useRef(nullable ? props.value : null);
|
73
70
|
const { disableCopy } = useContext(ToolContext);
|
74
71
|
const description = props.description ?? (props.docLink ? _jsx(Link, { href: props.docLink, children: props.description ?? "Docs" }) : props.description);
|
75
|
-
|
72
|
+
// Process children to handle nullable state -- creating component in disabled state with default value in lieu of null value
|
73
|
+
const processedChildren = nullable && isValidElement(children)
|
74
|
+
? cloneElement(children, {
|
75
|
+
...children.props,
|
76
|
+
disabled: props.value == null || children.props.disabled,
|
77
|
+
value: props.value ?? props.defaultValue,
|
78
|
+
defaultValue: undefined, // Don't pass defaultValue to children as there is no guarantee how this will be used and we can't mix controlled + uncontrolled state
|
79
|
+
})
|
80
|
+
: children;
|
81
|
+
return (_jsxs(LineContainer, { ref: ref, children: [_jsxs("div", { className: classes.line, children: [_jsx(InfoLabel, { className: classes.label, info: description, title: label, children: _jsx(Body1Strong, { className: classes.labelText, children: label }) }), _jsxs("div", { className: classes.rightContent, children: [nullable && (
|
82
|
+
// Since this checkbox is used to toggle null, 'checked' means 'non null'
|
83
|
+
_jsx(Checkbox, { checked: !(props.value == null), onChange: (_, data) => {
|
84
|
+
if (data.checked) {
|
85
|
+
// if checked this means we are returning to non-null, use cached value if exists. If no cached value, use default value
|
86
|
+
cachedVal.current != null ? props.onChange(cachedVal.current) : props.onChange(props.defaultValue);
|
87
|
+
}
|
88
|
+
else {
|
89
|
+
// if moving to un-checked state, this means moving to null value. Cache the old value and tell props.onChange(null)
|
90
|
+
cachedVal.current = props.value;
|
91
|
+
props.onChange(null);
|
92
|
+
}
|
93
|
+
}, title: "Toggle null state" })), _jsx("div", { className: classes.fillRestOfRightContentWidth, children: processedChildren }), expandedContent && (_jsx(ToggleButton, { appearance: "transparent", icon: expanded ? _jsx(SubtractFilled, {}) : _jsx(AddFilled, {}), className: classes.button, checked: expanded, onClick: (e) => {
|
76
94
|
e.stopPropagation();
|
77
95
|
setExpanded((expanded) => !expanded);
|
78
96
|
} })), 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
97
|
});
|
98
|
+
export const LineContainer = forwardRef((props, ref) => {
|
99
|
+
const classes = usePropertyLineStyles();
|
100
|
+
return (_jsx("div", { ref: ref, className: classes.container, ...props, children: props.children }));
|
101
|
+
});
|
80
102
|
export const PlaceholderPropertyLine = (props) => {
|
81
103
|
return (_jsx(PropertyLine, { ...props, children: _jsx(Body1, { children: props.value }) }));
|
82
104
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"propertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/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,iCAAiC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,qBAAqB,GAAG,UAAU,CAAC;IACrC,SAAS,EAAE;QACP,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,QAAQ,EAAE,gCAAgC;QACzD,OAAO,EAAE,GAAG,MAAM,CAAC,iBAAiB,MAAM;QAC1C,YAAY,EAAE,G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,CAAC,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, 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 * Link to the documentation for this property, available from the info icon either linked from the description (if provided) or default 'docs' text\r\n */\r\n docLink?: string;\r\n} & (\r\n | {\r\n expandedContent?: undefined;\r\n expandByDefault?: never;\r\n }\r\n | {\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 * If true, the expanded content will be shown by default.\r\n */\r\n expandByDefault?: boolean;\r\n }\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(props.expandByDefault ?? 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
|
+
{"version":3,"file":"propertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/propertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACrI,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,YAAY,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/F,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,MAAM,qBAAqB,GAAG,UAAU,CAAC;IACrC,SAAS,EAAE;QACP,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,QAAQ,EAAE,gCAAgC;QACzD,OAAO,EAAE,GAAG,MAAM,CAAC,iBAAiB,MAAM;QAC1C,YAAY,EAAE,GAAG,MAAM,CAAC,eAAe,UAAU,MAAM,CAAC,mBAAmB,EAAE;KAChF;IACD,IAAI,EAAE;QACF,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,YAAY;QAC5B,KAAK,EAAE,M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cAAK,SAAS,EAAE,OAAO,CAAC,eAAe,YAAG,eAAe,GAAO,GACzD,IACC,CACnB,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAA+D,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACjH,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,OAAO,CACH,cAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,KAAM,KAAK,YACjD,KAAK,CAAC,QAAQ,GACb,CACT,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAoE,CAAC,KAAK,EAAE,EAAE;IAC9G,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, Checkbox, 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, cloneElement, isValidElement, useRef } from \"react\";\r\nimport { copyCommandToClipboard } from \"../../../copyCommandToClipboard\";\r\nimport { ToolContext } from \"../fluentToolWrapper\";\r\nimport type { PrimitiveProps } from \"../../primitives/primitive\";\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\ntype BasePropertyLineProps = {\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 * Link to the documentation for this property, available from the info icon either linked from the description (if provided) or default 'docs' text\r\n */\r\n docLink?: string;\r\n};\r\n\r\n// Only require value/onChange/defaultValue props if nullable is true\r\ntype NullableProperty<ValueT> = {\r\n nullable: true;\r\n value: ValueT;\r\n onChange: (value: ValueT) => void;\r\n defaultValue?: ValueT;\r\n};\r\n\r\ntype NonNullableProperty = {\r\n nullable?: false;\r\n};\r\n\r\n// Only expect optional expandByDefault prop if expandedContent is defined\r\ntype ExpandableProperty = {\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 * If true, the expanded content will be shown by default.\r\n */\r\n expandByDefault?: boolean;\r\n};\r\n\r\n// If expanded content is undefined, don't expect expandByDefault prop\r\ntype NonExpandableProperty = {\r\n expandedContent?: undefined;\r\n};\r\n\r\nexport type PropertyLineProps<ValueT> = BasePropertyLineProps & (NullableProperty<ValueT> | NonNullableProperty) & (ExpandableProperty | NonExpandableProperty);\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<any>>>((props, ref) => {\r\n const classes = usePropertyLineStyles();\r\n const { label, onCopy, expandedContent, children, nullable } = props;\r\n\r\n const [expanded, setExpanded] = useState(\"expandByDefault\" in props ? props.expandByDefault : false);\r\n const cachedVal = useRef(nullable ? props.value : null);\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 // Process children to handle nullable state -- creating component in disabled state with default value in lieu of null value\r\n const processedChildren =\r\n nullable && isValidElement(children)\r\n ? cloneElement(children, {\r\n ...children.props,\r\n disabled: props.value == null || children.props.disabled,\r\n value: props.value ?? props.defaultValue,\r\n defaultValue: undefined, // Don't pass defaultValue to children as there is no guarantee how this will be used and we can't mix controlled + uncontrolled state\r\n })\r\n : children;\r\n\r\n return (\r\n <LineContainer ref={ref}>\r\n <div className={classes.line}>\r\n <InfoLabel className={classes.label} info={description} title={label}>\r\n <Body1Strong className={classes.labelText}>{label}</Body1Strong>\r\n </InfoLabel>\r\n <div className={classes.rightContent}>\r\n {nullable && (\r\n // Since this checkbox is used to toggle null, 'checked' means 'non null'\r\n <Checkbox\r\n checked={!(props.value == null)}\r\n onChange={(_, data) => {\r\n if (data.checked) {\r\n // if checked this means we are returning to non-null, use cached value if exists. If no cached value, use default value\r\n cachedVal.current != null ? props.onChange(cachedVal.current) : props.onChange(props.defaultValue);\r\n } else {\r\n // if moving to un-checked state, this means moving to null value. Cache the old value and tell props.onChange(null)\r\n cachedVal.current = props.value;\r\n props.onChange(null);\r\n }\r\n }}\r\n title=\"Toggle null state\"\r\n />\r\n )}\r\n <div className={classes.fillRestOfRightContentWidth}>{processedChildren}</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 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 const PlaceholderPropertyLine: FunctionComponent<PrimitiveProps<any> & PropertyLineProps<any>> = (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,4 @@
|
|
1
|
+
import type { PropertyLineProps } from "./propertyLine.js";
|
2
|
+
import type { FunctionComponent } from "react";
|
3
|
+
import type { SpinButtonProps } from "../../primitives/spinButton.js";
|
4
|
+
export declare const SpinButtonPropertyLine: FunctionComponent<PropertyLineProps<number> & SpinButtonProps>;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { PropertyLine } from "./propertyLine.js";
|
3
|
+
import { SpinButton } from "../../primitives/spinButton.js";
|
4
|
+
export const SpinButtonPropertyLine = (props) => (_jsx(PropertyLine, { ...props, children: _jsx(SpinButton, { ...props }) }));
|
5
|
+
//# sourceMappingURL=spinButtonPropertyLine.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"spinButtonPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/spinButtonPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGzD,MAAM,CAAC,MAAM,sBAAsB,GAAmE,CAAC,KAAK,EAAE,EAAE,CAAC,CAC7G,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,UAAU,OAAK,KAAK,GAAI,GACd,CAClB,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { SpinButton } from \"../../primitives/spinButton\";\r\nimport type { SpinButtonProps } from \"../../primitives/spinButton\";\r\n\r\nexport const SpinButtonPropertyLine: FunctionComponent<PropertyLineProps<number> & SpinButtonProps> = (props) => (\r\n <PropertyLine {...props}>\r\n <SpinButton {...props} />\r\n </PropertyLine>\r\n);\r\n"]}
|
@@ -6,4 +6,4 @@ import type { SwitchProps } from "../../primitives/switch.js";
|
|
6
6
|
* @param props - The properties for the switch and property line
|
7
7
|
* @returns A React element representing the property line with a switch
|
8
8
|
*/
|
9
|
-
export declare const SwitchPropertyLine: FunctionComponent<PropertyLineProps & SwitchProps>;
|
9
|
+
export declare const SwitchPropertyLine: FunctionComponent<PropertyLineProps<boolean> & SwitchProps>;
|
@@ -1 +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;
|
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;AAGjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAgE,CAAC,KAAK,EAAE,EAAE;IACrG,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/**\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<boolean> & 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"]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { PropertyLineProps } from "./propertyLine.js";
|
2
2
|
import type { SyncedSliderProps } from "../../primitives/syncedSlider.js";
|
3
|
-
type SyncedSliderPropertyProps = SyncedSliderProps & PropertyLineProps
|
3
|
+
type SyncedSliderPropertyProps = SyncedSliderProps & PropertyLineProps<number>;
|
4
4
|
/**
|
5
5
|
* Renders a simple wrapper around the SyncedSliderInput
|
6
6
|
* @param props
|
@@ -9,6 +9,6 @@ import { forwardRef } from "react";
|
|
9
9
|
*/
|
10
10
|
export const SyncedSliderPropertyLine = forwardRef((props, ref) => {
|
11
11
|
const { label, description, ...sliderProps } = props;
|
12
|
-
return (_jsx(PropertyLine, { ref: ref,
|
12
|
+
return (_jsx(PropertyLine, { ref: ref, ...props, children: _jsx(SyncedSliderInput, { ...sliderProps }) }));
|
13
13
|
});
|
14
14
|
//# sourceMappingURL=syncedSliderPropertyLine.js.map
|
@@ -1 +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;AAElE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAA4C,CAAC,KAAK,EAAE,GAAG,EAAsB,EAAE;IAC7H,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IACrD,OAAO,CACH,KAAC,YAAY,IAAC,GAAG,EAAE,GAAG,
|
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;AAElE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAA4C,CAAC,KAAK,EAAE,GAAG,EAAsB,EAAE;IAC7H,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IACrD,OAAO,CACH,KAAC,YAAY,IAAC,GAAG,EAAE,GAAG,KAAM,KAAK,YAC7B,KAAC,iBAAiB,OAAK,WAAW,GAAI,GAC3B,CAClB,CAAC;AACN,CAAC,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 { forwardRef } from \"react\";\r\n\r\ntype SyncedSliderPropertyProps = SyncedSliderProps & PropertyLineProps<number>;\r\n/**\r\n * Renders a simple wrapper around the SyncedSliderInput\r\n * @param props\r\n * @returns\r\n */\r\nexport const SyncedSliderPropertyLine = forwardRef<HTMLDivElement, SyncedSliderPropertyProps>((props, ref): React.ReactElement => {\r\n const { label, description, ...sliderProps } = props;\r\n return (\r\n <PropertyLine ref={ref} {...props}>\r\n <SyncedSliderInput {...sliderProps} />\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 { TextareaProps } from "../../primitives/textarea.js";
|
4
|
+
/**
|
5
|
+
* Wraps textarea in a property line
|
6
|
+
* @param props - PropertyLineProps and TextProps
|
7
|
+
* @returns property-line wrapped text
|
8
|
+
*/
|
9
|
+
export declare const TextAreaPropertyLine: FunctionComponent<PropertyLineProps<string> & TextareaProps>;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { PropertyLine } from "./propertyLine.js";
|
3
|
+
import { Textarea } from "../../primitives/textarea.js";
|
4
|
+
/**
|
5
|
+
* Wraps textarea in a property line
|
6
|
+
* @param props - PropertyLineProps and TextProps
|
7
|
+
* @returns property-line wrapped text
|
8
|
+
*/
|
9
|
+
export const TextAreaPropertyLine = (props) => {
|
10
|
+
return (_jsx(PropertyLine, { ...props, children: _jsx(Textarea, { ...props }) }));
|
11
|
+
};
|
12
|
+
//# sourceMappingURL=textAreaPropertyLine.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"textAreaPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/textAreaPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAiE,CAAC,KAAK,EAAE,EAAE;IACxG,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 { Textarea } from \"../../primitives/textarea\";\r\nimport type { TextareaProps } from \"../../primitives/textarea\";\r\n/**\r\n * Wraps textarea in a property line\r\n * @param props - PropertyLineProps and TextProps\r\n * @returns property-line wrapped text\r\n */\r\nexport const TextAreaPropertyLine: FunctionComponent<PropertyLineProps<string> & TextareaProps> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <Textarea {...props} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
|
@@ -1,13 +1,9 @@
|
|
1
|
+
import type { ImmutablePrimitiveProps } from "../../primitives/primitive.js";
|
1
2
|
import type { PropertyLineProps } from "./propertyLine.js";
|
2
3
|
import type { FunctionComponent } from "react";
|
3
|
-
type TextProps = {
|
4
|
-
value: string;
|
5
|
-
tooltip?: string;
|
6
|
-
};
|
7
4
|
/**
|
8
5
|
* Wraps text in a property line
|
9
6
|
* @param props - PropertyLineProps and TextProps
|
10
7
|
* @returns property-line wrapped text
|
11
8
|
*/
|
12
|
-
export declare const TextPropertyLine: FunctionComponent<PropertyLineProps &
|
13
|
-
export {};
|
9
|
+
export declare const TextPropertyLine: FunctionComponent<PropertyLineProps<string> & ImmutablePrimitiveProps<string>>;
|