@jonmilner/ui 0.23.5 → 0.23.6

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/docs/Flex.md CHANGED
@@ -21,6 +21,7 @@ The flex primitive `Stack` and `Inline` are built from: a `Box` with `display="f
21
21
  ## Rules
22
22
 
23
23
  - `display` defaults to `flex`; set it to override, such as `display={{ base: "none", med: "flex" }}`. `null` or `false` drops it, as on `Box`.
24
+ - A component built on `Flex` spaces its children with `gap`, never with margins or outer padding on them: a component owns no whitespace outside its visible edge (Rules for every screen).
24
25
  - There are no shorthand props such as `direction` or `align`: use the style props `flexDirection`, `alignItems`, `justifyContent`, `flexWrap` and `gap`.
25
26
  - Polymorphic with `as`; the consumer's `className` and `style` pass through, and `ref` is a plain prop typed for the `as` element.
26
27
 
@@ -21,7 +21,7 @@ A horizontal row of children that wraps onto new lines, with even space between
21
21
  ## Rules
22
22
 
23
23
  - `gap` is required and takes spacing tokens only: px keys (`"8"`) or a responsive object (`{ base: "4", med: "8" }`). The same gap applies between items and between wrapped lines.
24
- - Space comes from `gap`, never from margins on the children.
24
+ - Space comes from `gap`, never from margins or outer padding on the children: a component owns no whitespace outside its visible edge (Rules for every screen).
25
25
  - It takes every `Box` prop, and the layout defaults are style props, so `flexWrap`, `alignItems` and `justifyContent` override them.
26
26
  - Children are not wrapped, so each child is a flex item.
27
27
  - The consumer's `className` comes last and `style` is passed through; `ref` is a plain prop typed for the `as` element.
@@ -16,12 +16,12 @@ A vertical column of children with even space between them. `Stack` is a `Flex`
16
16
  - A two-dimensional layout: use `Box` with `display="grid"`.
17
17
  - A page with a sidebar beside its main content that stacks when narrow: use `SidebarLayout`, not a column that turns into a row at a breakpoint.
18
18
  - Records that share named columns, to compare row by row: use `Table`.
19
- - One child, or spacing only on one side: use `Box` with padding or margin.
19
+ - One child, or spacing only on one side: space it with the `gap` of the layout it sits in, or the padding of the surface around it (a `Box` with a background or border), never a margin or a padded wrapper that draws nothing.
20
20
 
21
21
  ## Rules
22
22
 
23
23
  - `gap` is required and takes spacing tokens only: px keys (`"16"`) or a responsive object (`{ base: "8", med: "16" }`). No raw lengths, no `md`.
24
- - Space comes from `gap`, never from margins on the children.
24
+ - Space comes from `gap`, never from margins or outer padding on the children: a component owns no whitespace outside its visible edge (Rules for every screen).
25
25
  - It takes every `Box` prop, and the layout defaults are style props, so `display`, `flexDirection` and `alignItems` override them.
26
26
  - Children are not wrapped, so each child is a flex item: it stretches to the column's width unless `alignItems` says otherwise.
27
27
  - A list needs no `className` or stylesheet. `paddingInlineStart="0"` drops the `ul` indent, and a row that is an `Inline as="li"` (or a `Stack as="li"`) is a flex container, so it draws no marker.
@@ -6,6 +6,7 @@
6
6
 
7
7
  - `Text` is the primitive the typography components are built from, so rendering it directly is a code smell: use `Heading`, `Body`, `Label`, `Caption` or `Code`. Text stays for a run inside one of them (`as="time"`, `strong`) and what none covers, as Text's docs say.
8
8
  - Lay out with `Stack` (a column) and `Inline` (a row that wraps), both built from `Flex`, spaced by their `gap`. `Flex` in an app, or `display: flex` in a stylesheet, is a code smell, and so is a `Box` with `display`, `flexDirection` and `gap`.
9
+ - A component's box ends at its visible edge: it puts no margin or padding outside that edge to space itself from its neighbours. Space components with `Stack`, `Inline` or `gap`, or the padding of a surface they sit in (one with a background, border or shadow). A surface padding its own content is fine, and so are an `auto` margin that aligns a part and a negative margin that bleeds past its parent's padding.
9
10
  - `Box` is for a surface (padding, background, radius, shadow) or a semantic element that needs style props.
10
11
  - A raw HTML element with a `className` (`<ul className={css.list}>`) is a code smell: use the polymorphic `Box` at least (`<Box as="ul">`), with style props.
11
12
  - A `*.css.ts` file is the exception, not the rule: never write a property/value pair there that a style prop covers, unless the style prop cannot work in that case. No `className`, `style` or other stylesheet for what a style prop or a component covers either. Style props take token keys, so no raw colors or lengths.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "./manifest.schema.json",
3
3
  "package": "@jonmilner/ui",
4
- "version": "0.23.5",
4
+ "version": "0.23.6",
5
5
  "components": [
6
6
  {
7
7
  "name": "Alert",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jonmilner/ui",
3
- "version": "0.23.5",
3
+ "version": "0.23.6",
4
4
  "bin": {
5
5
  "ui-doctor": "./dist/cli/ui-doctor.mjs"
6
6
  },