timvir 0.1.42
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/blocks/Arbitrary/Arbitrary.d.ts +11 -0
- package/blocks/Arbitrary/context.d.ts +7 -0
- package/blocks/Arbitrary/docs/index.mdx +36 -0
- package/blocks/Arbitrary/index.d.ts +2 -0
- package/blocks/Arbitrary/index.js +117 -0
- package/blocks/Arbitrary/samples/basic.d.ts +5 -0
- package/blocks/Arbitrary/styles.css +6 -0
- package/blocks/Code/Code.d.ts +35 -0
- package/blocks/Code/docs/api.mdx +76 -0
- package/blocks/Code/docs/index.mdx +39 -0
- package/blocks/Code/index.d.ts +1 -0
- package/blocks/Code/index.js +154 -0
- package/blocks/Code/samples/basic.d.ts +5 -0
- package/blocks/Code/samples/toggle.d.ts +2 -0
- package/blocks/Code/styles.css +14 -0
- package/blocks/Code/theme.d.ts +2 -0
- package/blocks/ColorBar/ColorBar.d.ts +18 -0
- package/blocks/ColorBar/docs/api.mdx +76 -0
- package/blocks/ColorBar/docs/index.mdx +128 -0
- package/blocks/ColorBar/index.d.ts +1 -0
- package/blocks/ColorBar/index.js +90 -0
- package/blocks/ColorBar/samples/basic.d.ts +2 -0
- package/blocks/ColorBar/styles.css +5 -0
- package/blocks/ColorBook/ColorBook.d.ts +16 -0
- package/blocks/ColorBook/docs/api.mdx +76 -0
- package/blocks/ColorBook/docs/index.mdx +12 -0
- package/blocks/ColorBook/index.d.ts +1 -0
- package/blocks/ColorBook/index.js +77 -0
- package/blocks/ColorBook/samples/basic.d.ts +2 -0
- package/blocks/ColorBook/styles.css +6 -0
- package/blocks/Cover/Cover.d.ts +20 -0
- package/blocks/Cover/docs/api.mdx +76 -0
- package/blocks/Cover/docs/index.mdx +20 -0
- package/blocks/Cover/index.d.ts +1 -0
- package/blocks/Cover/index.js +64 -0
- package/blocks/Cover/samples/basic.d.ts +2 -0
- package/blocks/Exhibit/Exhibit.d.ts +19 -0
- package/blocks/Exhibit/docs/api.mdx +76 -0
- package/blocks/Exhibit/docs/index.mdx +56 -0
- package/blocks/Exhibit/index.d.ts +1 -0
- package/blocks/Exhibit/index.js +83 -0
- package/blocks/Exhibit/samples/basic.d.ts +2 -0
- package/blocks/Exhibit/styles.css +3 -0
- package/blocks/Font/Font.d.ts +15 -0
- package/blocks/Font/docs/api.mdx +76 -0
- package/blocks/Font/docs/index.mdx +23 -0
- package/blocks/Font/index.d.ts +1 -0
- package/blocks/Font/index.js +131 -0
- package/blocks/Font/samples/basic.d.ts +5 -0
- package/blocks/Font/samples/system.d.ts +2 -0
- package/blocks/Font/styles.css +9 -0
- package/blocks/Grid/Grid.d.ts +9 -0
- package/blocks/Grid/docs/api.mdx +76 -0
- package/blocks/Grid/docs/index.mdx +82 -0
- package/blocks/Grid/index.d.ts +1 -0
- package/blocks/Grid/index.js +53 -0
- package/blocks/Grid/samples/basic.d.ts +2 -0
- package/blocks/Grid/styles.css +1 -0
- package/blocks/Icon/Icon.d.ts +11 -0
- package/blocks/Icon/docs/api.mdx +76 -0
- package/blocks/Icon/docs/index.mdx +218 -0
- package/blocks/Icon/index.d.ts +1 -0
- package/blocks/Icon/index.js +155 -0
- package/blocks/Icon/internal/Canvas.d.ts +9 -0
- package/blocks/Icon/internal/index.d.ts +1 -0
- package/blocks/Icon/samples/basic.d.ts +2 -0
- package/blocks/Icon/styles.css +5 -0
- package/blocks/Icon/types.d.ts +10 -0
- package/blocks/Message/Message.d.ts +10 -0
- package/blocks/Message/docs/api.mdx +76 -0
- package/blocks/Message/docs/index.mdx +63 -0
- package/blocks/Message/index.d.ts +1 -0
- package/blocks/Message/index.js +72 -0
- package/blocks/Message/samples/basic.d.ts +5 -0
- package/blocks/Message/styles.css +6 -0
- package/blocks/Swatch/Swatch.d.ts +33 -0
- package/blocks/Swatch/docs/api.mdx +76 -0
- package/blocks/Swatch/docs/index.mdx +39 -0
- package/blocks/Swatch/index.d.ts +1 -0
- package/blocks/Swatch/index.js +84 -0
- package/blocks/Swatch/samples/basic.d.ts +2 -0
- package/blocks/Swatch/styles.css +4 -0
- package/blocks/Viewport/Viewport.d.ts +17 -0
- package/blocks/Viewport/docs/api.mdx +76 -0
- package/blocks/Viewport/docs/index.mdx +34 -0
- package/blocks/Viewport/index.d.ts +1 -0
- package/blocks/Viewport/index.js +322 -0
- package/blocks/Viewport/internal/Caption.d.ts +8 -0
- package/blocks/Viewport/internal/Handle.d.ts +10 -0
- package/blocks/Viewport/internal/Ruler.d.ts +7 -0
- package/blocks/Viewport/internal/index.d.ts +3 -0
- package/blocks/Viewport/samples/basic.d.ts +2 -0
- package/blocks/Viewport/styles.css +14 -0
- package/blocks/WebLink/WebLink.d.ts +10 -0
- package/blocks/WebLink/docs/api.mdx +76 -0
- package/blocks/WebLink/docs/index.mdx +13 -0
- package/blocks/WebLink/index.d.ts +1 -0
- package/blocks/WebLink/index.js +97 -0
- package/blocks/WebLink/samples/basic.d.ts +5 -0
- package/blocks/WebLink/styles.css +8 -0
- package/blocks/index.d.ts +13 -0
- package/blocks/index.js +13 -0
- package/blocks/styles.css +81 -0
- package/bus/index.d.ts +12 -0
- package/bus/index.js +22 -0
- package/bus/messages.d.ts +15 -0
- package/context/index.d.ts +20 -0
- package/context/index.js +15 -0
- package/core/components/Footer/Footer.d.ts +16 -0
- package/core/components/Footer/docs/api.mdx +76 -0
- package/core/components/Footer/docs/index.mdx +27 -0
- package/core/components/Footer/index.d.ts +1 -0
- package/core/components/Footer/samples/basic.d.ts +5 -0
- package/core/components/NavigationFooter/NavigationFooter.d.ts +19 -0
- package/core/components/NavigationFooter/docs/api.mdx +76 -0
- package/core/components/NavigationFooter/docs/index.mdx +10 -0
- package/core/components/NavigationFooter/index.d.ts +1 -0
- package/core/components/NavigationFooter/samples/basic.d.ts +5 -0
- package/core/components/Page/Page.d.ts +60 -0
- package/core/components/Page/components.d.ts +46 -0
- package/core/components/Page/docs/api.mdx +76 -0
- package/core/components/Page/docs/index.mdx +37 -0
- package/core/components/Page/index.d.ts +2 -0
- package/core/components/Page/internal/Section.d.ts +7 -0
- package/core/components/Page/internal/Sidebar.d.ts +15 -0
- package/core/components/Page/internal/index.d.ts +2 -0
- package/core/components/Page/samples/basic.d.ts +2 -0
- package/core/components/Page/samples/layout.d.ts +2 -0
- package/core/components/Page/types.d.ts +5 -0
- package/core/index.d.ts +22 -0
- package/core/index.js +708 -0
- package/core/layout.d.ts +4 -0
- package/core/styles.css +47 -0
- package/core/theme/colors.d.ts +36 -0
- package/core/theme/index.d.ts +1 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +72 -0
- package/hooks/useResizeObserver/index.d.ts +56 -0
- package/package.json +27 -0
- package/std/base58/index.d.ts +2 -0
- package/std/base58/index.js +71 -0
- package/styles.css +128 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Page, extendedWidth, fullWidth } from "timvir/core";
|
|
2
|
+
|
|
3
|
+
# Page
|
|
4
|
+
|
|
5
|
+
The `<Page>` component establishes the page layout (sidebar, center), and wraps the content in a `<MDXProvider>` so
|
|
6
|
+
that the page MDX elements are correctly styled.
|
|
7
|
+
|
|
8
|
+
The layout is currently based on CSS grid. The content can be placed into the following columns:
|
|
9
|
+
|
|
10
|
+
* A center column for the main content. It has a maximum width (up to 48rem) that is suited for regular text.
|
|
11
|
+
* An extended colum that is slightly wider than the main content (up to 72rem), giving a reasonable amount of space for text next to another block.
|
|
12
|
+
TODO: Document how to subdivide this space.
|
|
13
|
+
* A full-width column which spans across the whole page.
|
|
14
|
+
|
|
15
|
+
Content placed into the full-width column extends to the very edges of the content area. Content placed into the center or extended column always has an appropriate amount of margin to the edges.
|
|
16
|
+
|
|
17
|
+
All children are by default placed in the center column. In order to place an element into different columns, import one of the predefined class namess from the `timvir/page` package and apply them to your element:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
import { extendedWidth, fullWidth } from "timvir/page"
|
|
21
|
+
|
|
22
|
+
<div className={fullWidth}>
|
|
23
|
+
This element will span across all columns.
|
|
24
|
+
</div>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
<div style={{ marginTop: 20, display: "flex", alignItems: "center", justifyContent: "center", height: 40, background: "teal", color: "white" }}>
|
|
28
|
+
default
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div className={extendedWidth} style={{ marginTop: 20, display: "flex", alignItems: "center", justifyContent: "center", height: 40, background: "teal", color: "white" }}>
|
|
32
|
+
extendedWidth
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div className={fullWidth} style={{ marginTop: 20, display: "flex", alignItems: "center", justifyContent: "center", height: 40, background: "teal", color: "white" }}>
|
|
36
|
+
fullWidth
|
|
37
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Node } from "../types";
|
|
3
|
+
interface Props {
|
|
4
|
+
toc: readonly Node[];
|
|
5
|
+
search?: {
|
|
6
|
+
open: () => void;
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
Component: React.ComponentType<{
|
|
9
|
+
open: boolean;
|
|
10
|
+
onClose: (ev: React.SyntheticEvent<HTMLElement>) => void;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
declare function Sidebar(props: Props): JSX.Element;
|
|
15
|
+
export default Sidebar;
|
package/core/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Source } from "wonka";
|
|
2
|
+
import { Message } from "timvir/bus";
|
|
3
|
+
export * from "./components/Footer";
|
|
4
|
+
export * from "./components/Page";
|
|
5
|
+
export { useContext } from "timvir/context";
|
|
6
|
+
export { extendedWidth, fullWidth, grid } from "./layout";
|
|
7
|
+
export { theme } from "timvir/core/theme";
|
|
8
|
+
/**
|
|
9
|
+
* A mailbox is a wonka source which receives messages for one specific block (identified by its id).
|
|
10
|
+
*/
|
|
11
|
+
export declare function useMailbox(id?: string): Source<Message>;
|
|
12
|
+
export declare function useBlock<P extends {
|
|
13
|
+
id?: string;
|
|
14
|
+
}>(props: P): {
|
|
15
|
+
bus: import("timvir/bus").Bus;
|
|
16
|
+
mailbox: Source<Message>;
|
|
17
|
+
props: P & {
|
|
18
|
+
id?: P["id"] | undefined;
|
|
19
|
+
};
|
|
20
|
+
hasOverrides: boolean;
|
|
21
|
+
reset: () => void;
|
|
22
|
+
};
|