@openwarelabs/ui 0.10.1 → 0.11.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/dist/components/Container/Container.d.cts +7 -0
- package/dist/components/Container/Container.d.ts +7 -0
- package/dist/components/Container/Container.types.d.cts +12 -0
- package/dist/components/Container/Container.types.d.ts +12 -0
- package/dist/components/Section/Section.d.cts +7 -0
- package/dist/components/Section/Section.d.ts +7 -0
- package/dist/components/Section/Section.types.d.cts +16 -0
- package/dist/components/Section/Section.types.d.ts +16 -0
- package/dist/components.css +67 -0
- package/dist/index.cjs +299 -285
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +217 -203
- package/dist/index.js.map +4 -4
- package/dist/openware-ui.iife.js +6 -6
- package/dist/styles.css +70 -0
- package/dist/tokens.css +3 -0
- package/dist/tokens.json +15 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ContainerProps } from "./Container.types.cjs";
|
|
2
|
+
export type { ContainerProps, ContainerSize } from "./Container.types.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* Centres content at a set width with the page's side margins: 32px, and the phone gutter under 760px. Every block
|
|
5
|
+
* lines its content up the same way, so whatever sits in a Container lines up with the blocks above and below it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Container({ size, as: Element, className, ...props }: ContainerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ContainerProps } from "./Container.types.js";
|
|
2
|
+
export type { ContainerProps, ContainerSize } from "./Container.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Centres content at a set width with the page's side margins: 32px, and the phone gutter under 760px. Every block
|
|
5
|
+
* lines its content up the same way, so whatever sits in a Container lines up with the blocks above and below it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Container({ size, as: Element, className, ...props }: ContainerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ElementType, HTMLAttributes } from "react";
|
|
2
|
+
export type ContainerSize = "narrow" | "page" | "wide" | "full";
|
|
3
|
+
export interface ContainerProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* How wide the content can get: `page` is the blocks' width (1200px), `narrow` a reading width for an article or
|
|
6
|
+
* a form (720px), `wide` room for a dashboard or a big table (1440px), `full` no cap, only the side margins.
|
|
7
|
+
* @default "page"
|
|
8
|
+
*/
|
|
9
|
+
size?: ContainerSize;
|
|
10
|
+
/** The element to render, such as `main` or `section`. @default "div" */
|
|
11
|
+
as?: ElementType;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ElementType, HTMLAttributes } from "react";
|
|
2
|
+
export type ContainerSize = "narrow" | "page" | "wide" | "full";
|
|
3
|
+
export interface ContainerProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* How wide the content can get: `page` is the blocks' width (1200px), `narrow` a reading width for an article or
|
|
6
|
+
* a form (720px), `wide` room for a dashboard or a big table (1440px), `full` no cap, only the side margins.
|
|
7
|
+
* @default "page"
|
|
8
|
+
*/
|
|
9
|
+
size?: ContainerSize;
|
|
10
|
+
/** The element to render, such as `main` or `section`. @default "div" */
|
|
11
|
+
as?: ElementType;
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SectionProps } from "./Section.types.cjs";
|
|
2
|
+
export type { SectionProps } from "./Section.types.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* A full-width band of a page, with the blocks' space above and below and their width and side margins inside (a
|
|
5
|
+
* Container). Your own sections then sit in line with the blocks around them.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Section({ tone, spacing, size, as: Element, className, children, ...props }: SectionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SectionProps } from "./Section.types.js";
|
|
2
|
+
export type { SectionProps } from "./Section.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* A full-width band of a page, with the blocks' space above and below and their width and side margins inside (a
|
|
5
|
+
* Container). Your own sections then sit in line with the blocks around them.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Section({ tone, spacing, size, as: Element, className, children, ...props }: SectionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ElementType, HTMLAttributes } from "react";
|
|
2
|
+
import type { ContainerSize } from "../Container/Container.types.cjs";
|
|
3
|
+
export interface SectionProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* The band's ground: `paper` for marketing pages, as the blocks use; `canvas` for the app's grey; `surface` for a
|
|
6
|
+
* white band that stands out from the paper; `none` to show what's behind it.
|
|
7
|
+
* @default "paper"
|
|
8
|
+
*/
|
|
9
|
+
tone?: "paper" | "canvas" | "surface" | "none";
|
|
10
|
+
/** The space above and below: `md` is a block's (96px, 72px on phones), `sm` half that. @default "md" */
|
|
11
|
+
spacing?: "sm" | "md" | "none";
|
|
12
|
+
/** How wide the content inside can get, as for Container. `false` leaves the content full width, without one. @default "page" */
|
|
13
|
+
size?: ContainerSize | false;
|
|
14
|
+
/** The element to render. @default "section" */
|
|
15
|
+
as?: ElementType;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ElementType, HTMLAttributes } from "react";
|
|
2
|
+
import type { ContainerSize } from "../Container/Container.types.js";
|
|
3
|
+
export interface SectionProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* The band's ground: `paper` for marketing pages, as the blocks use; `canvas` for the app's grey; `surface` for a
|
|
6
|
+
* white band that stands out from the paper; `none` to show what's behind it.
|
|
7
|
+
* @default "paper"
|
|
8
|
+
*/
|
|
9
|
+
tone?: "paper" | "canvas" | "surface" | "none";
|
|
10
|
+
/** The space above and below: `md` is a block's (96px, 72px on phones), `sm` half that. @default "md" */
|
|
11
|
+
spacing?: "sm" | "md" | "none";
|
|
12
|
+
/** How wide the content inside can get, as for Container. `false` leaves the content full width, without one. @default "page" */
|
|
13
|
+
size?: ContainerSize | false;
|
|
14
|
+
/** The element to render. @default "section" */
|
|
15
|
+
as?: ElementType;
|
|
16
|
+
}
|
package/dist/components.css
CHANGED
|
@@ -6208,6 +6208,73 @@
|
|
|
6208
6208
|
outline-offset: 2px;
|
|
6209
6209
|
}
|
|
6210
6210
|
|
|
6211
|
+
/* components/Container/Container.css */
|
|
6212
|
+
/* The page's width and side margins, the same as every block's: the content is at most the size's width, inside a
|
|
6213
|
+
32px gutter (the phone gutter under 760px). */
|
|
6214
|
+
|
|
6215
|
+
.ow-container {
|
|
6216
|
+
box-sizing: border-box;
|
|
6217
|
+
width: 100%;
|
|
6218
|
+
margin-inline: auto;
|
|
6219
|
+
padding-inline: var(--ow-page-gutter-wide);
|
|
6220
|
+
}
|
|
6221
|
+
|
|
6222
|
+
.ow-container--page {
|
|
6223
|
+
max-width: calc(var(--ow-page-max) + 2 * var(--ow-page-gutter-wide));
|
|
6224
|
+
}
|
|
6225
|
+
|
|
6226
|
+
.ow-container--narrow {
|
|
6227
|
+
max-width: calc(var(--ow-page-narrow) + 2 * var(--ow-page-gutter-wide));
|
|
6228
|
+
}
|
|
6229
|
+
|
|
6230
|
+
.ow-container--wide {
|
|
6231
|
+
max-width: calc(var(--ow-page-wide) + 2 * var(--ow-page-gutter-wide));
|
|
6232
|
+
}
|
|
6233
|
+
|
|
6234
|
+
@media (max-width: 760px) {
|
|
6235
|
+
.ow-container {
|
|
6236
|
+
padding-inline: var(--ow-page-gutter);
|
|
6237
|
+
}
|
|
6238
|
+
}
|
|
6239
|
+
|
|
6240
|
+
/* components/Section/Section.css */
|
|
6241
|
+
/* A band of the page: a block's vertical space and ground, full width. Its Container sets the width inside. */
|
|
6242
|
+
|
|
6243
|
+
.ow-section {
|
|
6244
|
+
box-sizing: border-box;
|
|
6245
|
+
width: 100%;
|
|
6246
|
+
color: var(--ow-text);
|
|
6247
|
+
}
|
|
6248
|
+
|
|
6249
|
+
.ow-section--paper {
|
|
6250
|
+
background: var(--ow-paper);
|
|
6251
|
+
}
|
|
6252
|
+
|
|
6253
|
+
.ow-section--canvas {
|
|
6254
|
+
background: var(--ow-canvas);
|
|
6255
|
+
}
|
|
6256
|
+
|
|
6257
|
+
.ow-section--surface {
|
|
6258
|
+
background: var(--ow-surface);
|
|
6259
|
+
}
|
|
6260
|
+
|
|
6261
|
+
.ow-section--space-md {
|
|
6262
|
+
padding-block: var(--ow-section-y);
|
|
6263
|
+
}
|
|
6264
|
+
|
|
6265
|
+
.ow-section--space-sm {
|
|
6266
|
+
padding-block: calc(var(--ow-section-y) / 2);
|
|
6267
|
+
}
|
|
6268
|
+
|
|
6269
|
+
@media (max-width: 760px) {
|
|
6270
|
+
.ow-section--space-md {
|
|
6271
|
+
padding-block: 72px;
|
|
6272
|
+
}
|
|
6273
|
+
.ow-section--space-sm {
|
|
6274
|
+
padding-block: 36px;
|
|
6275
|
+
}
|
|
6276
|
+
}
|
|
6277
|
+
|
|
6211
6278
|
/* components/Marketing/Marketing.css */
|
|
6212
6279
|
/* Marketing patterns from the site: Chip, SectionHeading, SiteHeader and the dot grid. */
|
|
6213
6280
|
.ow-chip {
|