@openwarelabs/ui 0.10.1 → 0.11.1

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.
@@ -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
+ }
@@ -1999,7 +1999,8 @@
1999
1999
 
2000
2000
  .ow-slider__control {
2001
2001
  position: relative;
2002
- height: 20px;
2002
+ /* 24px tall so each handle's input is a big enough target to tap (WCAG 2.2 target size). */
2003
+ height: 24px;
2003
2004
  }
2004
2005
 
2005
2006
  /* The track runs between the thumb's centre at each end (9px in), so the fill meets the thumb exactly. */
@@ -2045,12 +2046,12 @@
2045
2046
  }
2046
2047
 
2047
2048
  .ow-slider__input::-webkit-slider-runnable-track {
2048
- height: 20px;
2049
+ height: 24px;
2049
2050
  background: transparent;
2050
2051
  }
2051
2052
 
2052
2053
  .ow-slider__input::-moz-range-track {
2053
- height: 20px;
2054
+ height: 24px;
2054
2055
  background: transparent;
2055
2056
  }
2056
2057
 
@@ -2058,7 +2059,7 @@
2058
2059
  box-sizing: border-box;
2059
2060
  width: 18px;
2060
2061
  height: 18px;
2061
- margin-top: 1px;
2062
+ margin-top: 3px;
2062
2063
  appearance: none;
2063
2064
  border: 1px solid var(--ow-border-strong);
2064
2065
  border-radius: 50%;
@@ -6208,6 +6209,73 @@
6208
6209
  outline-offset: 2px;
6209
6210
  }
6210
6211
 
6212
+ /* components/Container/Container.css */
6213
+ /* The page's width and side margins, the same as every block's: the content is at most the size's width, inside a
6214
+ 32px gutter (the phone gutter under 760px). */
6215
+
6216
+ .ow-container {
6217
+ box-sizing: border-box;
6218
+ width: 100%;
6219
+ margin-inline: auto;
6220
+ padding-inline: var(--ow-page-gutter-wide);
6221
+ }
6222
+
6223
+ .ow-container--page {
6224
+ max-width: calc(var(--ow-page-max) + 2 * var(--ow-page-gutter-wide));
6225
+ }
6226
+
6227
+ .ow-container--narrow {
6228
+ max-width: calc(var(--ow-page-narrow) + 2 * var(--ow-page-gutter-wide));
6229
+ }
6230
+
6231
+ .ow-container--wide {
6232
+ max-width: calc(var(--ow-page-wide) + 2 * var(--ow-page-gutter-wide));
6233
+ }
6234
+
6235
+ @media (max-width: 760px) {
6236
+ .ow-container {
6237
+ padding-inline: var(--ow-page-gutter);
6238
+ }
6239
+ }
6240
+
6241
+ /* components/Section/Section.css */
6242
+ /* A band of the page: a block's vertical space and ground, full width. Its Container sets the width inside. */
6243
+
6244
+ .ow-section {
6245
+ box-sizing: border-box;
6246
+ width: 100%;
6247
+ color: var(--ow-text);
6248
+ }
6249
+
6250
+ .ow-section--paper {
6251
+ background: var(--ow-paper);
6252
+ }
6253
+
6254
+ .ow-section--canvas {
6255
+ background: var(--ow-canvas);
6256
+ }
6257
+
6258
+ .ow-section--surface {
6259
+ background: var(--ow-surface);
6260
+ }
6261
+
6262
+ .ow-section--space-md {
6263
+ padding-block: var(--ow-section-y);
6264
+ }
6265
+
6266
+ .ow-section--space-sm {
6267
+ padding-block: calc(var(--ow-section-y) / 2);
6268
+ }
6269
+
6270
+ @media (max-width: 760px) {
6271
+ .ow-section--space-md {
6272
+ padding-block: 72px;
6273
+ }
6274
+ .ow-section--space-sm {
6275
+ padding-block: 36px;
6276
+ }
6277
+ }
6278
+
6211
6279
  /* components/Marketing/Marketing.css */
6212
6280
  /* Marketing patterns from the site: Chip, SectionHeading, SiteHeader and the dot grid. */
6213
6281
  .ow-chip {