diff --git a/packages/react-components/theme-designer/src/components/Demo/Demo.tsx b/packages/react-components/theme-designer/src/components/Demo/Demo.tsx
index ef485f4c16147..61ca57cccdeb6 100644
--- a/packages/react-components/theme-designer/src/components/Demo/Demo.tsx
+++ b/packages/react-components/theme-designer/src/components/Demo/Demo.tsx
@@ -90,34 +90,101 @@ const useStyles = makeStyles({
3) Note that the spinner was removed since it was causing confusing with the loading state of the page
*/
-export const Column1 = () => {
+const AvatarSection = () => {
const styles = useStyles();
- const dropdownId = useId('dropdown-default');
return (
-
-
+
+ );
+};
+
+const TabSection = () => {
+ const tabValues = ['Home', 'Pages', 'Documents'];
+ return (
- Home
- Pages
- Documents
+ {tabValues.map((tab, index) => (
+ {tab}
+ ))}
-
- } size="small" />}
- />
+ );
+};
+
+const InputSection = () => {
+ const dropdownId = useId('dropdown-default');
+ const optionValues = ['Option 1', 'Option 2', 'Option 3'];
+ return (
+ <>
+
+ } size="small" />}
+ />
+
+
+ {optionValues.map((option, index) => (
+
+ {option}
+
+ ))}
+
+ >
+ )
+};
+
+const ControlRow = () => {
+ const styles = useStyles();
+ return (
+
+ );
+};
+
+const CheckboxSection = () => {
+ const styles = useStyles();
+ return (
+
+ );
+};
+
+const DescriptionSection = () => {
+ const styles = useStyles();
+ return (
+
+
+
-
- Action 1
- Action 2
- Action 3
-
+
+ );
+};
+
+export const Column1 = () => {
+ const styles = useStyles();
+ return (
+
);
};
@@ -126,26 +193,9 @@ export const Column2 = () => {
const styles = useStyles();
return (
);
};
@@ -170,12 +220,8 @@ export const Column3 = () => {
return (
-
-
-
-
-
-
Example link - www.microsoft.com
+
+
Example link - www.microsoft.com
);
};
diff --git a/packages/react-components/theme-designer/src/components/Export/ExportPanel.tsx b/packages/react-components/theme-designer/src/components/Export/ExportPanel.tsx
index 4cf65bc0bdc2d..a6ff9d63aa03c 100644
--- a/packages/react-components/theme-designer/src/components/Export/ExportPanel.tsx
+++ b/packages/react-components/theme-designer/src/components/Export/ExportPanel.tsx
@@ -46,26 +46,85 @@ const useStyles = makeStyles({
height: '100%',
boxSizing: 'border-box',
},
+ panelContainer: {
+ zIndex: 100,
+ position: 'absolute',
+ top: '0px',
+ right: '0px',
+ width: '400px',
+ border: `1px solid ${tokens.colorNeutralStroke1}`,
+ borderRadius: tokens.borderRadiusXLarge,
+ backgroundColor: tokens.colorNeutralBackground1,
+ boxShadow: tokens.shadow64,
+ padding: '16px',
+ }
});
+const ExportPanelHeader = ({ onClose }: { onClose: () => void }) => {
+ const styles = useStyles();
+ return (
+
+
+ Export Theme
+
+ } onClick={onClose} />
+
+ );
+};
+
+const ExportPanelContent = ({
+ selectedValue,
+ onTabSelect,
+ exportedValue,
+ onClickCopyToClipboard,
+}: {
+ selectedValue: TabValue;
+ onTabSelect: (event: SelectTabEvent, data: SelectTabData) => void;
+ exportedValue: string;
+ onClickCopyToClipboard: () => void;
+}) => {
+ const styles = useStyles();
+ return (
+ <>
+
+ Passing this theme to a FluentProvider will automatically apply it to any Fluent components below it. You can
+ also export this to CodeSandbox with a few component examples below.
+
+
+
+ Code
+ JSON (light)
+ JSON (dark)
+
+
+
+
+
+
+ Copy to clipboard
+
+ >
+ );
+};
+
export const ExportPanel = () => {
const {
dispatch,
state: { showExportPanel, themeName, brand, lightThemeOverrides, darkThemeOverrides },
} = useThemeDesigner();
+ const [selectedValue, setSelectedValue] = React.useState('Code');
+
const onCloseExportPanel = () => {
dispatch({ type: 'showExportPanel', payload: false });
};
- const styles = useStyles();
-
- const [selectedValue, setSelectedValue] = React.useState('Code');
-
const onTabSelect = (event: SelectTabEvent, data: SelectTabData) => {
setSelectedValue(data.value);
};
+ const styles = useStyles();
+
const codeValue = dedent`
const ${themeName}: BrandVariants = { ${objectToString(brand, '\u00A0\u00A0')} };
@@ -75,24 +134,31 @@ export const ExportPanel = () => {
const darkTheme: Theme = {
...createDarkTheme(${themeName}), ${getBrandValues(brand, darkThemeOverrides, themeName, '\u00A0\u00A0')} };
-
darkTheme.colorBrandForeground1 = ${themeName}[110];
darkTheme.colorBrandForeground2 = ${themeName}[120];
`;
const jsonLightValue = dedent`
- ${JSON.stringify({ ...createLightTheme(brand), ...lightThemeOverrides }, null, '\t')}`;
+ ${JSON.stringify(
+ {
+ ...createLightTheme(brand),
+ ...lightThemeOverrides
+ },
+ null,
+ '\t'
+ )}
+ `;
const jsonDarkValue = dedent`
- ${JSON.stringify(
- {
- ...createDarkTheme(brand),
- ...{ colorBrandForeground1: brand[110], colorBrandForeground2: brand[120] },
- ...darkThemeOverrides,
- },
- null,
- '\t',
- )}
+ ${JSON.stringify(
+ {
+ ...createDarkTheme(brand),
+ ...{ colorBrandForeground1: brand[110], colorBrandForeground2: brand[120] },
+ ...darkThemeOverrides,
+ },
+ null,
+ '\t',
+ )}
`;
const exportedValue = React.useMemo(() => {
@@ -116,67 +182,15 @@ export const ExportPanel = () => {
<>
{showExportPanel && (
-
-
-
-
- Export Theme
-
- }
- // eslint-disable-next-line react/jsx-no-bind
- onClick={onCloseExportPanel}
- />
-
-
-
-
- Passing this theme to a FluentProvider will automatically apply it to any Fluent components below it.
- You can also export this to CodeSandbox with a few component examples below.
-
-
-
- Code
- JSON (light)
- JSON (dark)
-
-
-
-
-
-
- Copy to clipboard
-
-
+
+
+
+
)}
diff --git a/packages/react-components/theme-designer/src/components/Sidebar/Form.tsx b/packages/react-components/theme-designer/src/components/Sidebar/Form.tsx
index b6a71e81e2732..79d3fb04f8225 100644
--- a/packages/react-components/theme-designer/src/components/Sidebar/Form.tsx
+++ b/packages/react-components/theme-designer/src/components/Sidebar/Form.tsx
@@ -224,22 +224,6 @@ export const Form: React.FC = () => {
- {/*
- The accessibility check is not adequate for the theme designer.
- Removing it for now because we don't want people proceeding with a false sense of security.
-
-
- Step 2 - Accessibility checks
-
-
-
-
-
- */}
Step 2 - Export