shelving 1.264.0 → 1.264.2

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.
Files changed (210) hide show
  1. package/package.json +1 -1
  2. package/ui/README.md +2 -2
  3. package/ui/block/Blockquote.module.css +0 -3
  4. package/ui/block/Card.d.ts +1 -1
  5. package/ui/block/Card.js +1 -1
  6. package/ui/block/Card.md +3 -7
  7. package/ui/block/Card.module.css +0 -3
  8. package/ui/block/Card.tsx +1 -1
  9. package/ui/block/Heading.md +0 -1
  10. package/ui/block/Heading.module.css +0 -3
  11. package/ui/block/Image.d.ts +3 -3
  12. package/ui/block/Image.js +4 -4
  13. package/ui/block/Image.module.css +4 -1
  14. package/ui/block/Image.tsx +14 -4
  15. package/ui/block/Label.module.css +0 -3
  16. package/ui/block/List.md +1 -2
  17. package/ui/block/List.module.css +0 -3
  18. package/ui/block/Panel.md +1 -2
  19. package/ui/block/Panel.module.css +0 -3
  20. package/ui/block/Paragraph.md +1 -2
  21. package/ui/block/Paragraph.module.css +0 -3
  22. package/ui/block/Preformatted.module.css +0 -3
  23. package/ui/block/Subheading.md +0 -1
  24. package/ui/block/Subheading.module.css +0 -3
  25. package/ui/block/Title.md +0 -1
  26. package/ui/block/Title.module.css +0 -3
  27. package/ui/block/Video.d.ts +3 -58
  28. package/ui/block/Video.js +2 -52
  29. package/ui/block/Video.module.css +1 -51
  30. package/ui/block/Video.tsx +3 -99
  31. package/ui/{form → button}/Button.d.ts +6 -2
  32. package/ui/{form → button}/Button.md +1 -2
  33. package/ui/{form → button}/Button.module.css +0 -3
  34. package/ui/{form → button}/Button.tsx +6 -1
  35. package/ui/button/FullscreenButton.d.ts +31 -0
  36. package/ui/button/FullscreenButton.js +37 -0
  37. package/ui/button/FullscreenButton.tsx +58 -0
  38. package/ui/button/RetryButton.d.ts +29 -0
  39. package/ui/button/RetryButton.js +27 -0
  40. package/ui/button/RetryButton.tsx +48 -0
  41. package/ui/{form → button}/SubmitButton.d.ts +12 -8
  42. package/ui/{form → button}/SubmitButton.js +4 -4
  43. package/ui/{form → button}/SubmitButton.tsx +22 -18
  44. package/ui/button/index.d.ts +5 -0
  45. package/ui/button/index.js +5 -0
  46. package/ui/button/index.ts +5 -0
  47. package/ui/dialog/Dialog.d.ts +1 -1
  48. package/ui/dialog/Dialog.tsx +1 -1
  49. package/ui/docs/DocumentationPage.test.tsx +2 -4
  50. package/ui/docs/DocumentationParams.js +1 -1
  51. package/ui/docs/DocumentationParams.tsx +1 -1
  52. package/ui/docs/DocumentationProperties.js +1 -1
  53. package/ui/docs/DocumentationProperties.tsx +1 -1
  54. package/ui/docs/DocumentationReferences.js +1 -1
  55. package/ui/docs/DocumentationReferences.tsx +1 -1
  56. package/ui/docs/DocumentationReturns.js +1 -1
  57. package/ui/docs/DocumentationReturns.tsx +1 -1
  58. package/ui/docs/DocumentationSearchPage.js +2 -2
  59. package/ui/docs/DocumentationSearchPage.tsx +2 -2
  60. package/ui/docs/DocumentationThrows.js +1 -1
  61. package/ui/docs/DocumentationThrows.tsx +1 -1
  62. package/ui/form/Field.test.tsx +1 -1
  63. package/ui/form/FormContext.d.ts +1 -1
  64. package/ui/form/FormContext.js +1 -1
  65. package/ui/form/FormContext.tsx +1 -1
  66. package/ui/form/FormFields.d.ts +1 -1
  67. package/ui/form/FormFields.js +1 -1
  68. package/ui/form/FormFields.tsx +2 -2
  69. package/ui/form/FormFooter.js +1 -1
  70. package/ui/form/FormFooter.tsx +1 -1
  71. package/ui/form/FormInput.d.ts +1 -1
  72. package/ui/form/FormInput.js +1 -1
  73. package/ui/form/FormInput.tsx +2 -2
  74. package/ui/form/Progress.d.ts +6 -24
  75. package/ui/form/Progress.js +9 -20
  76. package/ui/form/Progress.module.css +13 -32
  77. package/ui/form/Progress.tsx +18 -51
  78. package/ui/form/index.d.ts +0 -23
  79. package/ui/form/index.js +0 -23
  80. package/ui/form/index.ts +0 -23
  81. package/ui/index.d.ts +2 -0
  82. package/ui/index.js +2 -0
  83. package/ui/index.ts +2 -0
  84. package/ui/inline/Deleted.md +4 -5
  85. package/ui/inline/Deleted.module.css +1 -3
  86. package/ui/inline/Inserted.md +4 -5
  87. package/ui/inline/Inserted.module.css +1 -3
  88. package/ui/inline/Link.d.ts +1 -1
  89. package/ui/inline/Link.js +1 -1
  90. package/ui/inline/Link.md +2 -3
  91. package/ui/inline/Link.module.css +1 -3
  92. package/ui/inline/Link.tsx +1 -1
  93. package/ui/inline/Mark.js +1 -2
  94. package/ui/inline/Mark.md +5 -5
  95. package/ui/inline/Mark.module.css +2 -3
  96. package/ui/inline/Mark.tsx +0 -2
  97. package/ui/{form → input}/ArrayInput.js +1 -1
  98. package/ui/{form → input}/ArrayInput.tsx +1 -1
  99. package/ui/{form → input}/ButtonInput.d.ts +1 -1
  100. package/ui/{form → input}/ButtonInput.js +1 -1
  101. package/ui/{form → input}/ButtonInput.tsx +1 -1
  102. package/ui/{form → input}/ButtonPopover.d.ts +1 -1
  103. package/ui/{form → input}/ButtonPopover.js +1 -1
  104. package/ui/{form → input}/ButtonPopover.tsx +1 -1
  105. package/ui/{form → input}/DictionaryInput.js +1 -1
  106. package/ui/{form → input}/DictionaryInput.tsx +1 -1
  107. package/ui/{form → input}/SchemaInput.js +1 -1
  108. package/ui/{form → input}/SchemaInput.test.tsx +3 -3
  109. package/ui/{form → input}/SchemaInput.tsx +1 -1
  110. package/ui/{form → input}/TextInput.d.ts +1 -1
  111. package/ui/{form → input}/TextInput.js +1 -1
  112. package/ui/{form → input}/TextInput.tsx +1 -1
  113. package/ui/input/index.d.ts +20 -0
  114. package/ui/input/index.js +20 -0
  115. package/ui/input/index.ts +20 -0
  116. package/ui/layout/CenteredLayout.d.ts +5 -7
  117. package/ui/layout/CenteredLayout.js +8 -4
  118. package/ui/layout/CenteredLayout.md +9 -2
  119. package/ui/layout/CenteredLayout.module.css +16 -22
  120. package/ui/layout/CenteredLayout.tsx +18 -12
  121. package/ui/layout/Layout.d.ts +1 -1
  122. package/ui/layout/Layout.js +4 -0
  123. package/ui/layout/Layout.ts +6 -0
  124. package/ui/layout/SidebarLayout.js +13 -6
  125. package/ui/layout/SidebarLayout.md +4 -4
  126. package/ui/layout/SidebarLayout.module.css +6 -9
  127. package/ui/layout/SidebarLayout.tsx +21 -18
  128. package/ui/menu/Menu.d.ts +1 -1
  129. package/ui/menu/Menu.js +1 -1
  130. package/ui/menu/Menu.tsx +1 -1
  131. package/ui/misc/Catcher.d.ts +2 -19
  132. package/ui/misc/Catcher.js +3 -22
  133. package/ui/misc/Catcher.tsx +4 -40
  134. package/ui/misc/MetaContext.test.tsx +2 -3
  135. package/ui/misc/Tag.d.ts +1 -1
  136. package/ui/misc/Tag.js +1 -1
  137. package/ui/misc/Tag.md +1 -2
  138. package/ui/misc/Tag.module.css +0 -3
  139. package/ui/misc/Tag.tsx +1 -1
  140. package/ui/notice/Message.module.css +0 -3
  141. package/ui/notice/Notice.md +1 -2
  142. package/ui/notice/Notice.module.css +0 -3
  143. package/ui/router/Router.test.tsx +1 -4
  144. package/ui/style/TINT_CLASS.md +1 -1
  145. package/ui/style/Width.d.ts +2 -1
  146. package/ui/style/Width.module.css +47 -17
  147. package/ui/style/Width.tsx +22 -1
  148. package/ui/style/getWidthClass.md +5 -9
  149. package/ui/table/Table.md +1 -1
  150. package/ui/tree/TreeButton.d.ts +1 -1
  151. package/ui/tree/TreeButton.js +1 -1
  152. package/ui/tree/TreeButton.test.tsx +2 -5
  153. package/ui/tree/TreeButton.tsx +1 -1
  154. package/ui/tree/TreeContext.test.tsx +2 -3
  155. package/ui/tree/TreeMarkup.test.tsx +2 -5
  156. package/ui/tree/TreeRouter.test.tsx +2 -5
  157. package/ui/tree/TreeSidebar.js +1 -1
  158. package/ui/tree/TreeSidebar.tsx +1 -1
  159. /package/ui/{form → button}/Button.js +0 -0
  160. /package/ui/{form → button}/Clickable.d.ts +0 -0
  161. /package/ui/{form → button}/Clickable.js +0 -0
  162. /package/ui/{form → button}/Clickable.tsx +0 -0
  163. /package/ui/{form → input}/ArrayInput.d.ts +0 -0
  164. /package/ui/{form → input}/ArrayRadioInputs.d.ts +0 -0
  165. /package/ui/{form → input}/ArrayRadioInputs.js +0 -0
  166. /package/ui/{form → input}/ArrayRadioInputs.tsx +0 -0
  167. /package/ui/{form → input}/ButtonInputPopover.d.ts +0 -0
  168. /package/ui/{form → input}/ButtonInputPopover.js +0 -0
  169. /package/ui/{form → input}/ButtonInputPopover.tsx +0 -0
  170. /package/ui/{form → input}/CheckboxInput.d.ts +0 -0
  171. /package/ui/{form → input}/CheckboxInput.js +0 -0
  172. /package/ui/{form → input}/CheckboxInput.tsx +0 -0
  173. /package/ui/{form → input}/ChoiceRadioInputs.d.ts +0 -0
  174. /package/ui/{form → input}/ChoiceRadioInputs.js +0 -0
  175. /package/ui/{form → input}/ChoiceRadioInputs.tsx +0 -0
  176. /package/ui/{form → input}/DataInput.d.ts +0 -0
  177. /package/ui/{form → input}/DataInput.js +0 -0
  178. /package/ui/{form → input}/DataInput.tsx +0 -0
  179. /package/ui/{form → input}/DateInput.d.ts +0 -0
  180. /package/ui/{form → input}/DateInput.js +0 -0
  181. /package/ui/{form → input}/DateInput.tsx +0 -0
  182. /package/ui/{form → input}/DictionaryInput.d.ts +0 -0
  183. /package/ui/{form → input}/FileInput.d.ts +0 -0
  184. /package/ui/{form → input}/FileInput.js +0 -0
  185. /package/ui/{form → input}/FileInput.tsx +0 -0
  186. /package/ui/{form → input}/Input.d.ts +0 -0
  187. /package/ui/{form → input}/Input.js +0 -0
  188. /package/ui/{form → input}/Input.module.css +0 -0
  189. /package/ui/{form → input}/Input.tsx +0 -0
  190. /package/ui/{form → input}/NumberInput.d.ts +0 -0
  191. /package/ui/{form → input}/NumberInput.js +0 -0
  192. /package/ui/{form → input}/NumberInput.tsx +0 -0
  193. /package/ui/{form → input}/OutputInput.d.ts +0 -0
  194. /package/ui/{form → input}/OutputInput.js +0 -0
  195. /package/ui/{form → input}/OutputInput.tsx +0 -0
  196. /package/ui/{form → input}/Popover.d.ts +0 -0
  197. /package/ui/{form → input}/Popover.js +0 -0
  198. /package/ui/{form → input}/Popover.module.css +0 -0
  199. /package/ui/{form → input}/Popover.tsx +0 -0
  200. /package/ui/{form → input}/QueryInput.d.ts +0 -0
  201. /package/ui/{form → input}/QueryInput.js +0 -0
  202. /package/ui/{form → input}/QueryInput.tsx +0 -0
  203. /package/ui/{form → input}/RadioInput.d.ts +0 -0
  204. /package/ui/{form → input}/RadioInput.js +0 -0
  205. /package/ui/{form → input}/RadioInput.tsx +0 -0
  206. /package/ui/{form → input}/SchemaInput.d.ts +0 -0
  207. /package/ui/{form → input}/SchemaInput.md +0 -0
  208. /package/ui/{form → input}/SelectInput.d.ts +0 -0
  209. /package/ui/{form → input}/SelectInput.js +0 -0
  210. /package/ui/{form → input}/SelectInput.tsx +0 -0
@@ -39,7 +39,7 @@ export function DocumentationReferences({ types }: DocumentationReferencesProps)
39
39
  <Cell header width="fit">
40
40
  Type
41
41
  </Cell>
42
- <Cell header width="xxnarrow" grow />
42
+ <Cell header width="16x" grow />
43
43
  </tr>
44
44
  </thead>
45
45
  <tbody>
@@ -21,5 +21,5 @@ export function DocumentationReturns({ returns }) {
21
21
  const map = useTreeMap();
22
22
  if (!returns?.length)
23
23
  return null;
24
- return (_jsx(Section, { children: _jsx(Scroll, { horizontal: true, children: _jsxs(Table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx(Cell, { header: true, width: "fit", children: "Return" }), _jsx(Cell, { header: true, width: "xxnarrow", grow: true })] }) }), _jsx("tbody", { children: returns.map(({ type = DEFAULT_TYPE, description }) => (_jsxs("tr", { children: [_jsx("td", { children: _jsx(TreeLink, { name: type, nowrap: true }) }), _jsx("td", { children: _jsx(DocumentationDescription, { description: description || getTreeElement(map, type)?.props.description }) })] }, `${type}-${description}`))) })] }) }) }));
24
+ return (_jsx(Section, { children: _jsx(Scroll, { horizontal: true, children: _jsxs(Table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx(Cell, { header: true, width: "fit", children: "Return" }), _jsx(Cell, { header: true, width: "16x", grow: true })] }) }), _jsx("tbody", { children: returns.map(({ type = DEFAULT_TYPE, description }) => (_jsxs("tr", { children: [_jsx("td", { children: _jsx(TreeLink, { name: type, nowrap: true }) }), _jsx("td", { children: _jsx(DocumentationDescription, { description: description || getTreeElement(map, type)?.props.description }) })] }, `${type}-${description}`))) })] }) }) }));
25
25
  }
@@ -43,7 +43,7 @@ export function DocumentationReturns({ returns }: DocumentationReturnsProps): Re
43
43
  <Cell header width="fit">
44
44
  Return
45
45
  </Cell>
46
- <Cell header width="xxnarrow" grow />
46
+ <Cell header width="16x" grow />
47
47
  </tr>
48
48
  </thead>
49
49
  <tbody>
@@ -7,8 +7,8 @@ import { Panel } from "../block/Panel.js";
7
7
  import { Row } from "../block/Row.js";
8
8
  import { Header, Section } from "../block/Section.js";
9
9
  import { Title } from "../block/Title.js";
10
- import { CheckboxInput } from "../form/CheckboxInput.js";
11
- import { TextInput } from "../form/TextInput.js";
10
+ import { CheckboxInput } from "../input/CheckboxInput.js";
11
+ import { TextInput } from "../input/TextInput.js";
12
12
  import { Page } from "../page/Page.js";
13
13
  import { TreeCards } from "../tree/TreeCards.js";
14
14
  import { useTreeMap } from "../tree/TreeContext.js";
@@ -8,8 +8,8 @@ import { Panel } from "../block/Panel.js";
8
8
  import { Row } from "../block/Row.js";
9
9
  import { Header, Section } from "../block/Section.js";
10
10
  import { Title } from "../block/Title.js";
11
- import { CheckboxInput } from "../form/CheckboxInput.js";
12
- import { TextInput } from "../form/TextInput.js";
11
+ import { CheckboxInput } from "../input/CheckboxInput.js";
12
+ import { TextInput } from "../input/TextInput.js";
13
13
  import { Page } from "../page/Page.js";
14
14
  import { TreeCards } from "../tree/TreeCards.js";
15
15
  import { useTreeMap } from "../tree/TreeContext.js";
@@ -21,5 +21,5 @@ export function DocumentationThrows({ throws }) {
21
21
  const map = useTreeMap();
22
22
  if (!throws?.length)
23
23
  return null;
24
- return (_jsx(Section, { children: _jsx(Scroll, { horizontal: true, children: _jsxs(Table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx(Cell, { header: true, width: "fit", children: "Throws" }), _jsx(Cell, { header: true, width: "xxnarrow", grow: true })] }) }), _jsx("tbody", { children: throws.map(({ type = DEFAULT_TYPE, description }) => (_jsxs("tr", { children: [_jsx("td", { children: _jsx(TreeLink, { name: type, nowrap: true }) }), _jsx("td", { children: _jsx(DocumentationDescription, { description: description || getTreeElement(map, type)?.props.description }) })] }, `${type}-${description}`))) })] }) }) }));
24
+ return (_jsx(Section, { children: _jsx(Scroll, { horizontal: true, children: _jsxs(Table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx(Cell, { header: true, width: "fit", children: "Throws" }), _jsx(Cell, { header: true, width: "16x", grow: true })] }) }), _jsx("tbody", { children: throws.map(({ type = DEFAULT_TYPE, description }) => (_jsxs("tr", { children: [_jsx("td", { children: _jsx(TreeLink, { name: type, nowrap: true }) }), _jsx("td", { children: _jsx(DocumentationDescription, { description: description || getTreeElement(map, type)?.props.description }) })] }, `${type}-${description}`))) })] }) }) }));
25
25
  }
@@ -43,7 +43,7 @@ export function DocumentationThrows({ throws }: DocumentationThrowsProps): React
43
43
  <Cell header width="fit">
44
44
  Throws
45
45
  </Cell>
46
- <Cell header width="xxnarrow" grow />
46
+ <Cell header width="16x" grow />
47
47
  </tr>
48
48
  </thead>
49
49
  <tbody>
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import { renderToStaticMarkup } from "react-dom/server";
3
- import { Field } from "./Field.js";
3
+ import { Field } from "shelving/ui";
4
4
 
5
5
  describe("Field", () => {
6
6
  test("does not render a message container when there is no message", () => {
@@ -1,8 +1,8 @@
1
1
  import type { Schema } from "../../schema/Schema.js";
2
2
  import type { Data } from "../../util/data.js";
3
3
  import type { AnyCaller } from "../../util/function.js";
4
+ import { type SchemaInputProps } from "../input/SchemaInput.js";
4
5
  import type { FormStore } from "./FormStore.js";
5
- import { type SchemaInputProps } from "./SchemaInput.js";
6
6
  /**
7
7
  * React context holding the current `FormStore`, provided by the `Form` component.
8
8
  *
@@ -1,7 +1,7 @@
1
1
  import { createContext } from "react";
2
2
  import { useStore } from "../../react/useStore.js";
3
+ import { isSchemaRequired } from "../input/SchemaInput.js";
3
4
  import { requireContext } from "../util/context.js";
4
- import { isSchemaRequired } from "./SchemaInput.js";
5
5
  /**
6
6
  * React context holding the current `FormStore`, provided by the `Form` component.
7
7
  *
@@ -3,9 +3,9 @@ import { useStore } from "../../react/useStore.js";
3
3
  import type { Schema } from "../../schema/Schema.js";
4
4
  import type { Data } from "../../util/data.js";
5
5
  import type { AnyCaller } from "../../util/function.js";
6
+ import { isSchemaRequired, type SchemaInputProps } from "../input/SchemaInput.js";
6
7
  import { requireContext } from "../util/context.js";
7
8
  import type { FormStore } from "./FormStore.js";
8
- import { isSchemaRequired, type SchemaInputProps } from "./SchemaInput.js";
9
9
 
10
10
  /**
11
11
  * React context holding the current `FormStore`, provided by the `Form` component.
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from "react";
2
- import type { InputProps } from "./Input.js";
2
+ import type { InputProps } from "../input/Input.js";
3
3
  /**
4
4
  * Show a `<Field>` (label, input, and message) for a single named property of the current form.
5
5
  *
@@ -1,8 +1,8 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useStore } from "../../react/useStore.js";
3
+ import { SchemaInput } from "../input/SchemaInput.js";
3
4
  import { Field } from "./Field.js";
4
5
  import { requireForm, useField } from "./FormContext.js";
5
- import { SchemaInput } from "./SchemaInput.js";
6
6
  /**
7
7
  * Show a `<Field>` (label, input, and message) for a single named property of the current form.
8
8
  *
@@ -1,9 +1,9 @@
1
1
  import type { ReactElement } from "react";
2
2
  import { useStore } from "../../react/useStore.js";
3
+ import type { InputProps } from "../input/Input.js";
4
+ import { SchemaInput } from "../input/SchemaInput.js";
3
5
  import { Field } from "./Field.js";
4
6
  import { requireForm, useField } from "./FormContext.js";
5
- import type { InputProps } from "./Input.js";
6
- import { SchemaInput } from "./SchemaInput.js";
7
7
 
8
8
  /**
9
9
  * Show a `<Field>` (label, input, and message) for a single named property of the current form.
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Row } from "../block/Row.js";
3
3
  import { Footer } from "../block/Section.js";
4
+ import { SubmitButton } from "../button/SubmitButton.js";
4
5
  import { FormMessage } from "./FormMessage.js";
5
- import { SubmitButton } from "./SubmitButton.js";
6
6
  /**
7
7
  * Show a form footer with a submit button and the form's error message.
8
8
  * - Renders a row containing a `SubmitButton` (and any extra buttons passed as `children`).
@@ -1,9 +1,9 @@
1
1
  import type { ReactElement, ReactNode } from "react";
2
2
  import { Row } from "../block/Row.js";
3
3
  import { Footer } from "../block/Section.js";
4
+ import { SubmitButton } from "../button/SubmitButton.js";
4
5
  import type { OptionalChildProps } from "../util/props.js";
5
6
  import { FormMessage } from "./FormMessage.js";
6
- import { SubmitButton } from "./SubmitButton.js";
7
7
 
8
8
  /**
9
9
  * Props for `FormFooter`, the submit-button-and-message footer for a form.
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from "react";
2
- import type { InputProps } from "./Input.js";
2
+ import type { InputProps } from "../input/Input.js";
3
3
  /**
4
4
  * Props for `FormInput`, a bare `SchemaInput` bound to a named form field.
5
5
  *
@@ -1,6 +1,6 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { SchemaInput } from "../input/SchemaInput.js";
2
3
  import { requireForm, useField } from "./FormContext.js";
3
- import { SchemaInput } from "./SchemaInput.js";
4
4
  /**
5
5
  * Show a `SchemaInput` for a single named property of the current form.
6
6
  * - Reads the field's value, schema, and message from the form context via `useField()`.
@@ -1,7 +1,7 @@
1
1
  import type { ReactElement } from "react";
2
+ import type { InputProps } from "../input/Input.js";
3
+ import { SchemaInput } from "../input/SchemaInput.js";
2
4
  import { requireForm, useField } from "./FormContext.js";
3
- import type { InputProps } from "./Input.js";
4
- import { SchemaInput } from "./SchemaInput.js";
5
5
 
6
6
  /**
7
7
  * Props for `FormInput`, a bare `SchemaInput` bound to a named form field.
@@ -6,37 +6,19 @@ import type { ReactElement } from "react";
6
6
  */
7
7
  export interface ProgressProps {
8
8
  value: number;
9
+ min?: number;
10
+ max?: number;
9
11
  success?: boolean;
10
12
  warning?: boolean;
11
13
  danger?: boolean;
12
14
  }
13
15
  /**
14
- * Show progress as a single continuous horizontal bar, filled to `value` clamped between `0` and `1`.
16
+ * Show progress as a single continuous horizontal bar, filled to `value` within the `min`–`max` range (matches `getPercent()` and `formatPercent()`).
17
+ * - The fill is allowed to overspill; CSS clamps it to the `0%`–`100%` range via `min-width`/`max-width`.
15
18
  *
16
19
  * @returns A progress bar element.
17
20
  * @kind component
18
- * @example <Progress value={0.5} />
21
+ * @example <Progress value={3} max={4} />
19
22
  * @see https://shelving.cc/ui/Progress
20
23
  */
21
- export declare function Progress({ value, success, warning, danger }: ProgressProps): ReactElement | null;
22
- /**
23
- * Props for `SegmentedProgress`, a stepped progress bar of discrete segments.
24
- *
25
- * @see https://shelving.cc/ui/SegmentedProgressProps
26
- */
27
- export interface SegmentedProgressProps {
28
- total: number;
29
- current: number;
30
- success?: boolean;
31
- warning?: boolean;
32
- danger?: boolean;
33
- }
34
- /**
35
- * Show step progress as a horizontal bar of `total` segments, of which `current + 1` are filled.
36
- *
37
- * @returns A segmented progress bar element, or `null` when `total` is not positive.
38
- * @kind component
39
- * @example <SegmentedProgress total={4} current={1} />
40
- * @see https://shelving.cc/ui/SegmentedProgress
41
- */
42
- export declare function SegmentedProgress({ total, current, success, warning, danger }: SegmentedProgressProps): ReactElement | null;
24
+ export declare function Progress({ value, min, max, success, warning, danger }: ProgressProps): ReactElement | null;
@@ -1,30 +1,19 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { formatPercent } from "../../util/format.js";
3
+ import { getPercent } from "../../util/number.js";
2
4
  import { getClass, getModuleClass } from "../util/css.js";
3
5
  import styles from "./Progress.module.css";
4
6
  /**
5
- * Show progress as a single continuous horizontal bar, filled to `value` clamped between `0` and `1`.
7
+ * Show progress as a single continuous horizontal bar, filled to `value` within the `min`–`max` range (matches `getPercent()` and `formatPercent()`).
8
+ * - The fill is allowed to overspill; CSS clamps it to the `0%`–`100%` range via `min-width`/`max-width`.
6
9
  *
7
10
  * @returns A progress bar element.
8
11
  * @kind component
9
- * @example <Progress value={0.5} />
12
+ * @example <Progress value={3} max={4} />
10
13
  * @see https://shelving.cc/ui/Progress
11
14
  */
12
- export function Progress({ value, success, warning, danger }) {
13
- const clamped = Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : 0;
14
- const progressStyle = { ["--progress-value"]: `${clamped * 100}%` };
15
- return (_jsx("div", { className: getClass(getModuleClass(styles, "track"), success && getModuleClass(styles, "success"), warning && getModuleClass(styles, "warning"), danger && getModuleClass(styles, "danger")), style: progressStyle, children: _jsx("span", { className: getModuleClass(styles, "fill") }) }));
16
- }
17
- /**
18
- * Show step progress as a horizontal bar of `total` segments, of which `current + 1` are filled.
19
- *
20
- * @returns A segmented progress bar element, or `null` when `total` is not positive.
21
- * @kind component
22
- * @example <SegmentedProgress total={4} current={1} />
23
- * @see https://shelving.cc/ui/SegmentedProgress
24
- */
25
- export function SegmentedProgress({ total, current, success, warning, danger }) {
26
- if (total <= 0)
27
- return null;
28
- const progressStyle = { ["--progress-steps"]: total };
29
- return (_jsx("div", { className: getClass(getModuleClass(styles, "segmented"), success && getModuleClass(styles, "success"), warning && getModuleClass(styles, "warning"), danger && getModuleClass(styles, "danger")), style: progressStyle, children: Array.from({ length: total }, (_, i) => (_jsx("span", { className: getClass(getModuleClass(styles, "item"), i <= current && getModuleClass(styles, "active")) }, i.toString()))) }));
15
+ export function Progress({ value, min = 0, max = 100, success, warning, danger }) {
16
+ const percent = getPercent(value - min, max - min);
17
+ const fillStyle = { width: `${Number.isFinite(percent) ? percent : 0}%` };
18
+ return (_jsx("figure", { className: getClass(getModuleClass(styles, "track"), success && getModuleClass(styles, "success"), warning && getModuleClass(styles, "warning"), danger && getModuleClass(styles, "danger")), role: "progressbar", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, "aria-valuetext": formatPercent(value - min, max - min), children: _jsx("span", { className: getModuleClass(styles, "fill"), style: fillStyle }) }));
30
19
  }
@@ -7,51 +7,32 @@
7
7
  /* Continuous progress bar — a single track that fills horizontally. */
8
8
  .track {
9
9
  position: relative;
10
+ margin: 0;
10
11
  inline-size: 100%;
11
12
  height: var(--progress-height, 0.375rem);
12
13
  border-radius: var(--progress-radius, 999px);
13
- background: var(--progress-color-bg, var(--tint-90));
14
+ background: var(--progress-background, var(--tint-90));
14
15
  overflow: hidden;
15
16
  }
16
17
 
17
18
  .fill {
18
19
  display: block;
19
20
  block-size: 100%;
20
- inline-size: var(--progress-value, 0%);
21
- background: var(--progress-color-active, var(--color-blue));
22
- transition:
23
- inline-size 160ms ease-out,
24
- background-color var(--duration-fast) ease-in-out;
25
- }
26
-
27
- /* Segmented progress — a grid of N items, of which some are `.active`. */
28
- .segmented {
29
- display: grid;
30
- grid-template-columns: repeat(var(--progress-steps), minmax(0, 1fr));
31
- gap: var(--progress-gap, 0.375rem);
32
- }
33
-
34
- .item {
35
- height: var(--progress-height, 0.375rem);
36
- border-radius: var(--progress-radius, 999px);
37
- background: var(--progress-color-bg, var(--tint-90));
38
- }
39
-
40
- .active {
41
- background: var(--progress-color-active, var(--color-blue));
21
+ /* Width is set inline; clamp overspill to the track here. */
22
+ min-width: 0px;
23
+ max-width: 100%;
24
+ background: var(--progress-color, var(--color-blue));
25
+ transition: all var(--duration-fast);
42
26
  }
43
27
 
44
28
  /* Status variants applied at the container level. */
45
- .success .fill,
46
- .success .active {
47
- background: var(--progress-success-color-active, var(--color-green));
29
+ .success .fill {
30
+ background: var(--progress-success, var(--color-green));
48
31
  }
49
- .warning .fill,
50
- .warning .active {
51
- background: var(--progress-warning-color-active, var(--color-orange));
32
+ .warning .fill {
33
+ background: var(--progress-warning, var(--color-orange));
52
34
  }
53
- .danger .fill,
54
- .danger .active {
55
- background: var(--progress-danger-color-active, var(--color-red));
35
+ .danger .fill {
36
+ background: var(--progress-danger, var(--color-red));
56
37
  }
57
38
  }
@@ -1,4 +1,6 @@
1
1
  import type { CSSProperties, ReactElement } from "react";
2
+ import { formatPercent } from "../../util/format.js";
3
+ import { getPercent } from "../../util/number.js";
2
4
  import { getClass, getModuleClass } from "../util/css.js";
3
5
  import styles from "./Progress.module.css";
4
6
 
@@ -9,76 +11,41 @@ import styles from "./Progress.module.css";
9
11
  */
10
12
  export interface ProgressProps {
11
13
  value: number;
14
+ min?: number;
15
+ max?: number;
12
16
  success?: boolean;
13
17
  warning?: boolean;
14
18
  danger?: boolean;
15
19
  }
16
20
 
17
21
  /**
18
- * Show progress as a single continuous horizontal bar, filled to `value` clamped between `0` and `1`.
22
+ * Show progress as a single continuous horizontal bar, filled to `value` within the `min`–`max` range (matches `getPercent()` and `formatPercent()`).
23
+ * - The fill is allowed to overspill; CSS clamps it to the `0%`–`100%` range via `min-width`/`max-width`.
19
24
  *
20
25
  * @returns A progress bar element.
21
26
  * @kind component
22
- * @example <Progress value={0.5} />
27
+ * @example <Progress value={3} max={4} />
23
28
  * @see https://shelving.cc/ui/Progress
24
29
  */
25
- export function Progress({ value, success, warning, danger }: ProgressProps): ReactElement | null {
26
- const clamped = Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : 0;
27
- const progressStyle = { ["--progress-value" as string]: `${clamped * 100}%` } as CSSProperties;
30
+ export function Progress({ value, min = 0, max = 100, success, warning, danger }: ProgressProps): ReactElement | null {
31
+ const percent = getPercent(value - min, max - min);
32
+ const fillStyle = { width: `${Number.isFinite(percent) ? percent : 0}%` } as CSSProperties;
28
33
 
29
34
  return (
30
- <div
35
+ <figure
31
36
  className={getClass(
32
37
  getModuleClass(styles, "track"),
33
38
  success && getModuleClass(styles, "success"),
34
39
  warning && getModuleClass(styles, "warning"),
35
40
  danger && getModuleClass(styles, "danger"),
36
41
  )}
37
- style={progressStyle}
42
+ role="progressbar"
43
+ aria-valuemin={min}
44
+ aria-valuemax={max}
45
+ aria-valuenow={value}
46
+ aria-valuetext={formatPercent(value - min, max - min)}
38
47
  >
39
- <span className={getModuleClass(styles, "fill")} />
40
- </div>
41
- );
42
- }
43
-
44
- /**
45
- * Props for `SegmentedProgress`, a stepped progress bar of discrete segments.
46
- *
47
- * @see https://shelving.cc/ui/SegmentedProgressProps
48
- */
49
- export interface SegmentedProgressProps {
50
- total: number;
51
- current: number;
52
- success?: boolean;
53
- warning?: boolean;
54
- danger?: boolean;
55
- }
56
-
57
- /**
58
- * Show step progress as a horizontal bar of `total` segments, of which `current + 1` are filled.
59
- *
60
- * @returns A segmented progress bar element, or `null` when `total` is not positive.
61
- * @kind component
62
- * @example <SegmentedProgress total={4} current={1} />
63
- * @see https://shelving.cc/ui/SegmentedProgress
64
- */
65
- export function SegmentedProgress({ total, current, success, warning, danger }: SegmentedProgressProps): ReactElement | null {
66
- if (total <= 0) return null;
67
- const progressStyle = { ["--progress-steps" as string]: total } as CSSProperties;
68
-
69
- return (
70
- <div
71
- className={getClass(
72
- getModuleClass(styles, "segmented"),
73
- success && getModuleClass(styles, "success"),
74
- warning && getModuleClass(styles, "warning"),
75
- danger && getModuleClass(styles, "danger"),
76
- )}
77
- style={progressStyle}
78
- >
79
- {Array.from({ length: total }, (_, i) => (
80
- <span key={i.toString()} className={getClass(getModuleClass(styles, "item"), i <= current && getModuleClass(styles, "active"))} />
81
- ))}
82
- </div>
48
+ <span className={getModuleClass(styles, "fill")} style={fillStyle} />
49
+ </figure>
83
50
  );
84
51
  }
@@ -1,17 +1,4 @@
1
- export * from "./ArrayInput.js";
2
- export * from "./ArrayRadioInputs.js";
3
- export * from "./Button.js";
4
- export * from "./ButtonInput.js";
5
- export * from "./ButtonInputPopover.js";
6
- export * from "./ButtonPopover.js";
7
- export * from "./CheckboxInput.js";
8
- export * from "./ChoiceRadioInputs.js";
9
- export * from "./Clickable.js";
10
- export * from "./DataInput.js";
11
- export * from "./DateInput.js";
12
- export * from "./DictionaryInput.js";
13
1
  export * from "./Field.js";
14
- export * from "./FileInput.js";
15
2
  export * from "./Form.js";
16
3
  export * from "./FormContext.js";
17
4
  export * from "./FormFields.js";
@@ -21,14 +8,4 @@ export * from "./FormMessage.js";
21
8
  export * from "./FormNotice.js";
22
9
  export * from "./FormNotify.js";
23
10
  export * from "./FormStore.js";
24
- export * from "./Input.js";
25
- export * from "./NumberInput.js";
26
- export * from "./OutputInput.js";
27
- export * from "./Popover.js";
28
11
  export * from "./Progress.js";
29
- export * from "./QueryInput.js";
30
- export * from "./RadioInput.js";
31
- export * from "./SchemaInput.js";
32
- export * from "./SelectInput.js";
33
- export * from "./SubmitButton.js";
34
- export * from "./TextInput.js";
package/ui/form/index.js CHANGED
@@ -1,17 +1,4 @@
1
- export * from "./ArrayInput.js";
2
- export * from "./ArrayRadioInputs.js";
3
- export * from "./Button.js";
4
- export * from "./ButtonInput.js";
5
- export * from "./ButtonInputPopover.js";
6
- export * from "./ButtonPopover.js";
7
- export * from "./CheckboxInput.js";
8
- export * from "./ChoiceRadioInputs.js";
9
- export * from "./Clickable.js";
10
- export * from "./DataInput.js";
11
- export * from "./DateInput.js";
12
- export * from "./DictionaryInput.js";
13
1
  export * from "./Field.js";
14
- export * from "./FileInput.js";
15
2
  export * from "./Form.js";
16
3
  export * from "./FormContext.js";
17
4
  export * from "./FormFields.js";
@@ -21,14 +8,4 @@ export * from "./FormMessage.js";
21
8
  export * from "./FormNotice.js";
22
9
  export * from "./FormNotify.js";
23
10
  export * from "./FormStore.js";
24
- export * from "./Input.js";
25
- export * from "./NumberInput.js";
26
- export * from "./OutputInput.js";
27
- export * from "./Popover.js";
28
11
  export * from "./Progress.js";
29
- export * from "./QueryInput.js";
30
- export * from "./RadioInput.js";
31
- export * from "./SchemaInput.js";
32
- export * from "./SelectInput.js";
33
- export * from "./SubmitButton.js";
34
- export * from "./TextInput.js";
package/ui/form/index.ts CHANGED
@@ -1,17 +1,4 @@
1
- export * from "./ArrayInput.js";
2
- export * from "./ArrayRadioInputs.js";
3
- export * from "./Button.js";
4
- export * from "./ButtonInput.js";
5
- export * from "./ButtonInputPopover.js";
6
- export * from "./ButtonPopover.js";
7
- export * from "./CheckboxInput.js";
8
- export * from "./ChoiceRadioInputs.js";
9
- export * from "./Clickable.js";
10
- export * from "./DataInput.js";
11
- export * from "./DateInput.js";
12
- export * from "./DictionaryInput.js";
13
1
  export * from "./Field.js";
14
- export * from "./FileInput.js";
15
2
  export * from "./Form.js";
16
3
  export * from "./FormContext.js";
17
4
  export * from "./FormFields.js";
@@ -21,14 +8,4 @@ export * from "./FormMessage.js";
21
8
  export * from "./FormNotice.js";
22
9
  export * from "./FormNotify.js";
23
10
  export * from "./FormStore.js";
24
- export * from "./Input.js";
25
- export * from "./NumberInput.js";
26
- export * from "./OutputInput.js";
27
- export * from "./Popover.js";
28
11
  export * from "./Progress.js";
29
- export * from "./QueryInput.js";
30
- export * from "./RadioInput.js";
31
- export * from "./SchemaInput.js";
32
- export * from "./SelectInput.js";
33
- export * from "./SubmitButton.js";
34
- export * from "./TextInput.js";
package/ui/index.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  export * from "./app/index.js";
2
2
  export * from "./block/index.js";
3
+ export * from "./button/index.js";
3
4
  export * from "./dialog/index.js";
4
5
  export * from "./docs/index.js";
5
6
  export * from "./form/index.js";
6
7
  export * from "./inline/index.js";
8
+ export * from "./input/index.js";
7
9
  export * from "./layout/index.js";
8
10
  export * from "./menu/index.js";
9
11
  export * from "./misc/index.js";
package/ui/index.js CHANGED
@@ -1,9 +1,11 @@
1
1
  export * from "./app/index.js";
2
2
  export * from "./block/index.js";
3
+ export * from "./button/index.js";
3
4
  export * from "./dialog/index.js";
4
5
  export * from "./docs/index.js";
5
6
  export * from "./form/index.js";
6
7
  export * from "./inline/index.js";
8
+ export * from "./input/index.js";
7
9
  export * from "./layout/index.js";
8
10
  export * from "./menu/index.js";
9
11
  export * from "./misc/index.js";
package/ui/index.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  export * from "./app/index.js";
2
2
  export * from "./block/index.js";
3
+ export * from "./button/index.js";
3
4
  export * from "./dialog/index.js";
4
5
  export * from "./docs/index.js";
5
6
  export * from "./form/index.js";
6
7
  export * from "./inline/index.js";
8
+ export * from "./input/index.js";
7
9
  export * from "./layout/index.js";
8
10
  export * from "./menu/index.js";
9
11
  export * from "./misc/index.js";
@@ -5,7 +5,7 @@ Deleted text — renders a `<del>` element to mark content that has been removed
5
5
  **Things to know:**
6
6
 
7
7
  - Use `Deleted` for content genuinely removed from a document (edits, diffs, retired prices), and `<Inserted>` for content added — they pair up.
8
- - It drives its colour through the [tint ladder](/ui/TINT_CLASS), so the `color` variant (`color="purple"`, `color="orange"`, …) recolours the strike-through. The base tint defaults to `--color-red`.
8
+ - It colours itself directly from `--color-red` rather than the tint ladder, so a deletion stays a consistent red even inside a tinted region; change it with `--deleted-color`.
9
9
  - Inside `<Prose>` a raw `<del>` picks up the same styling, so Markdown-rendered deletions match component ones.
10
10
 
11
11
  ## Usage
@@ -22,13 +22,12 @@ import { Paragraph, Deleted, Inserted } from "shelving/ui";
22
22
 
23
23
  ## Styling
24
24
 
25
- `Deleted` paints from the [tint ladder](/ui/TINT_CLASS): the `50` tint sets the text colour, defaulting to `--color-red`. Override `--deleted-tint` to recolour from the base, or set each property directly.
25
+ `Deleted` colours its text directly from `--color-red` (not the tint ladder), so deletions stay a consistent red regardless of the surrounding tint. Override `--deleted-color` to recolour.
26
26
 
27
27
  | Variable | Styles | Default |
28
28
  |---|---|---|
29
- | `--deleted-tint` | Base tint (`--tint-50`) the colour derives from | `var(--color-red)` |
30
- | `--deleted-color` | Text colour | `var(--tint-50)` |
29
+ | `--deleted-color` | Text colour | `var(--color-red)` |
31
30
  | `--deleted-decoration` | Text decoration | `line-through var(--stroke-normal)` |
32
31
  | `--deleted-weight` | Font weight | `var(--weight-strong)` |
33
32
 
34
- **Global tokens it reads:** `--color-red`, `--stroke-normal`, `--weight-strong`, and the tint-ladder step `--tint-50`.
33
+ **Global tokens it reads:** `--color-red`, `--stroke-normal`, and `--weight-strong`.
@@ -6,10 +6,8 @@
6
6
  @layer components {
7
7
  .deleted,
8
8
  .prose del {
9
- --tint-50: var(--deleted-tint, var(--color-red));
10
-
11
9
  /* Style */
12
- color: var(--deleted-color, var(--tint-50));
10
+ color: var(--deleted-color, var(--color-red));
13
11
  text-decoration: var(--deleted-decoration, line-through var(--stroke-normal));
14
12
 
15
13
  /* Text */