Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE: Mw/f UI 1814 live docs examples #1504

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/04_web/10_dynamic-layout/10_foundation-layout.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ tags:
- golden layout
---

import FoundationLayoutDemo from './layout-example.js';


# Genesis Foundation UI App Layout

[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](https://www.typescriptlang.org/)

### [API Docs](./docs/api/index.md)

## Example

<FoundationLayoutDemo />

## Declarative HTML API

The following example shows the usage of the declarative API with `zero-charts` and the output that it produces.
Expand Down
57 changes: 57 additions & 0 deletions docs/04_web/10_dynamic-layout/layout-example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React from "react";

function loadFuiFallback() {
return import(
/* webpackMode: "lazy" */
"@genesislcap/foundation-ui"
);
}

function loadFoundationLayoutFallback() {
return import(
/* webpackMode: "lazy" */
"@genesislcap/foundation-layout"
);
}

async function loadRemotes(options) {
const { registerFoundationDesignSystem } = await loadFuiFallback();

const { foundationLayoutComponents } = await loadFoundationLayoutFallback();

return {
FoundationDesignSystem: registerFoundationDesignSystem().register(
foundationLayoutComponents,
),
};
}

loadRemotes({});

/**
* Ensure tree shaking doesn't remove these
* Perhaps we keep these MFs style free, ie. they need to get wrapped to have style applied. Keeping it simple for now.
*/
export { LoadRemotesOptions, loadRemotes };

export default function FoundationLayoutDemo({ children, color }) {
return (
<div style={{ width: "600px", height: "500px" }}>
<foundation-layout>
<foundation-layout-region>
<foundation-layout-region type="vertical">
<foundation-layout-item title="Button">
<button>Click me!</button>
</foundation-layout-item>
<foundation-layout-item title="Checkbox">
<input type="checkbox" />
</foundation-layout-item>
</foundation-layout-region>
<foundation-layout-item title="Test P">
<p>Test p tag</p>
</foundation-layout-item>
</foundation-layout-region>
</foundation-layout>
</div>
);
}
Loading