@motifx-community/ui 0.1.0-beta.1 → 0.1.0-beta.3

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.

Potentially problematic release.


This version of @motifx-community/ui might be problematic. Click here for more details.

Files changed (259) hide show
  1. package/CHANGELOG.md +147 -8
  2. package/README.md +19 -13
  3. package/dist/components/accordion/Accordion.d.ts +3 -3
  4. package/dist/components/accordion/AccordionItem.d.ts +1 -1
  5. package/dist/components/calendar/Calendar.d.ts +12 -0
  6. package/dist/components/calendar/calendar-props.d.ts +5 -0
  7. package/dist/components/card/Card.d.ts +1 -1
  8. package/dist/components/contextmenu/ContextMenu.d.ts +1 -1
  9. package/dist/components/datagrid/DataGrid.d.ts +5 -5
  10. package/dist/components/datagrid/data-grid-props.d.ts +2 -2
  11. package/dist/components/datagrid/grid-adaptive-row-expanded-event-args.d.ts +1 -1
  12. package/dist/components/datagrid/grid-adaptive-row-expanding-event-args.d.ts +1 -1
  13. package/dist/components/datagrid/grid-grouping-changed-event-args.d.ts +1 -1
  14. package/dist/components/datagrid/grid-grouping-changing-event-args.d.ts +2 -2
  15. package/dist/components/datagrid/grid-master-detail.d.ts +1 -1
  16. package/dist/components/datagrid/grid-row-expanded-event-args.d.ts +1 -1
  17. package/dist/components/datagrid/grid-row-expanding-event-args.d.ts +1 -1
  18. package/dist/components/datagrid/grid-search-text-changed-event-args.d.ts +1 -1
  19. package/dist/components/datagrid/grid-search-text-changing-event-args.d.ts +1 -1
  20. package/dist/components/datagrid/grid-sort-changing-event-args.d.ts +1 -1
  21. package/dist/components/datagrid/model/GridSearch.d.ts +1 -1
  22. package/dist/components/daterangebox/DateRangeBox.d.ts +121 -0
  23. package/dist/components/daterangebox/date-range-box-props.d.ts +35 -0
  24. package/dist/components/daterangebox/date-range-preset.d.ts +6 -0
  25. package/dist/components/daterangebox/date-range.d.ts +2 -0
  26. package/dist/components/daterangebox/index.d.ts +4 -0
  27. package/dist/components/draggable/Draggable.d.ts +99 -0
  28. package/dist/components/draggable/DropTarget.d.ts +38 -0
  29. package/dist/components/draggable/draggable-event-args.d.ts +17 -0
  30. package/dist/components/draggable/draggable-props.d.ts +37 -0
  31. package/dist/components/draggable/drop-event-args.d.ts +11 -0
  32. package/dist/components/draggable/drop-target-props.d.ts +13 -0
  33. package/dist/components/draggable/index.d.ts +6 -0
  34. package/dist/components/fileuploader/FileUploader.d.ts +133 -0
  35. package/dist/components/fileuploader/file-uploader-props.d.ts +46 -0
  36. package/dist/components/fileuploader/files-added-event-args.d.ts +9 -0
  37. package/dist/components/fileuploader/index.d.ts +7 -0
  38. package/dist/components/fileuploader/upload-event-args.d.ts +10 -0
  39. package/dist/components/fileuploader/upload-item.d.ts +12 -0
  40. package/dist/components/fileuploader/upload-mode.d.ts +2 -0
  41. package/dist/components/fileuploader/upload-status.d.ts +2 -0
  42. package/dist/components/filterbuilder/FilterBuilder.d.ts +1 -1
  43. package/dist/components/gallery/Gallery.d.ts +132 -0
  44. package/dist/components/gallery/gallery-item-click-event-args.d.ts +9 -0
  45. package/dist/components/gallery/gallery-item.d.ts +18 -0
  46. package/dist/components/gallery/gallery-props.d.ts +38 -0
  47. package/dist/components/gallery/index.d.ts +6 -0
  48. package/dist/components/gallery/slide-changed-event-args.d.ts +11 -0
  49. package/dist/components/gallery/slide-changing-event-args.d.ts +14 -0
  50. package/dist/components/layout/ChildSettings.d.ts +1 -1
  51. package/dist/components/layout/DockPanel.d.ts +2 -2
  52. package/dist/components/layout/Grid.d.ts +1 -1
  53. package/dist/components/layout/SplitContainer.d.ts +1 -1
  54. package/dist/components/layout/Stack.d.ts +1 -1
  55. package/dist/components/loadpanel/LoadPanel.d.ts +70 -0
  56. package/dist/components/loadpanel/index.d.ts +3 -0
  57. package/dist/components/loadpanel/load-panel-props.d.ts +29 -0
  58. package/dist/components/loadpanel/load-panel-target.d.ts +3 -0
  59. package/dist/components/multiview/MultiView.d.ts +87 -0
  60. package/dist/components/multiview/View.d.ts +41 -0
  61. package/dist/components/multiview/index.d.ts +6 -0
  62. package/dist/components/multiview/multi-view-props.d.ts +24 -0
  63. package/dist/components/multiview/view-props.d.ts +15 -0
  64. package/dist/components/multiview/view-selecting-event-args.d.ts +15 -0
  65. package/dist/components/multiview/view-selection-changed-event-args.d.ts +12 -0
  66. package/dist/components/numberbox/number-box-props.d.ts +1 -1
  67. package/dist/components/popover/Popover.d.ts +98 -0
  68. package/dist/components/popover/index.d.ts +5 -0
  69. package/dist/components/popover/popover-close-reason.d.ts +2 -0
  70. package/dist/components/popover/popover-closing-event-args.d.ts +8 -0
  71. package/dist/components/popover/popover-props.d.ts +39 -0
  72. package/dist/components/popover/popover-show-on.d.ts +2 -0
  73. package/dist/components/resizable/Resizable.d.ts +84 -0
  74. package/dist/components/resizable/index.d.ts +3 -0
  75. package/dist/components/resizable/resizable-props.d.ts +41 -0
  76. package/dist/components/resizable/resize-event-args.d.ts +13 -0
  77. package/dist/components/scheduler/AppointmentEditor.d.ts +1 -1
  78. package/dist/components/scheduler/scheduler-props.d.ts +1 -1
  79. package/dist/components/scrollview/ScrollView.d.ts +109 -0
  80. package/dist/components/scrollview/index.d.ts +7 -0
  81. package/dist/components/scrollview/pull-down-event-args.d.ts +9 -0
  82. package/dist/components/scrollview/reach-bottom-event-args.d.ts +9 -0
  83. package/dist/components/scrollview/scroll-event-args.d.ts +7 -0
  84. package/dist/components/scrollview/scroll-view-bars.d.ts +2 -0
  85. package/dist/components/scrollview/scroll-view-direction.d.ts +2 -0
  86. package/dist/components/scrollview/scroll-view-props.d.ts +31 -0
  87. package/dist/components/skeleton/Skeleton.d.ts +1 -1
  88. package/dist/components/sortable/Sortable.d.ts +106 -0
  89. package/dist/components/sortable/index.d.ts +5 -0
  90. package/dist/components/sortable/sortable-drag-event-args.d.ts +15 -0
  91. package/dist/components/sortable/sortable-drop-event-args.d.ts +11 -0
  92. package/dist/components/sortable/sortable-orientation.d.ts +2 -0
  93. package/dist/components/sortable/sortable-props.d.ts +34 -0
  94. package/dist/components/speeddial/SpeedDial.d.ts +129 -0
  95. package/dist/components/speeddial/index.d.ts +6 -0
  96. package/dist/components/speeddial/speed-dial-action-click-event-args.d.ts +9 -0
  97. package/dist/components/speeddial/speed-dial-action.d.ts +25 -0
  98. package/dist/components/speeddial/speed-dial-event-args.d.ts +8 -0
  99. package/dist/components/speeddial/speed-dial-props.d.ts +49 -0
  100. package/dist/components/speeddial/speed-dial-tooltip.d.ts +3 -0
  101. package/dist/components/splitter/SplitPane.d.ts +45 -0
  102. package/dist/components/splitter/Splitter.d.ts +116 -0
  103. package/dist/components/splitter/index.d.ts +6 -0
  104. package/dist/components/splitter/split-pane-props.d.ts +21 -0
  105. package/dist/components/splitter/splitter-collapse-event-args.d.ts +13 -0
  106. package/dist/components/splitter/splitter-props.d.ts +25 -0
  107. package/dist/components/splitter/splitter-resize-event-args.d.ts +10 -0
  108. package/dist/components/stepper/Stepper.d.ts +121 -0
  109. package/dist/components/stepper/Wizard.d.ts +112 -0
  110. package/dist/components/stepper/WizardStep.d.ts +44 -0
  111. package/dist/components/stepper/index.d.ts +13 -0
  112. package/dist/components/stepper/step-changed-event-args.d.ts +11 -0
  113. package/dist/components/stepper/step-changing-event-args.d.ts +18 -0
  114. package/dist/components/stepper/stepper-item.d.ts +20 -0
  115. package/dist/components/stepper/stepper-label-position.d.ts +2 -0
  116. package/dist/components/stepper/stepper-orientation.d.ts +1 -0
  117. package/dist/components/stepper/stepper-props.d.ts +32 -0
  118. package/dist/components/stepper/stepper-status.d.ts +2 -0
  119. package/dist/components/stepper/wizard-finishing-event-args.d.ts +7 -0
  120. package/dist/components/stepper/wizard-props.d.ts +48 -0
  121. package/dist/components/stepper/wizard-step-props.d.ts +32 -0
  122. package/dist/components/tabdocs/TabDocumentManager.d.ts +1 -1
  123. package/dist/components/tabs/Tabs.d.ts +2 -2
  124. package/dist/components/tileview/TileView.d.ts +128 -0
  125. package/dist/components/tileview/index.d.ts +6 -0
  126. package/dist/components/tileview/tile-click-event-args.d.ts +9 -0
  127. package/dist/components/tileview/tile-reorder-event-args.d.ts +11 -0
  128. package/dist/components/tileview/tile-selection-changed-event-args.d.ts +11 -0
  129. package/dist/components/tileview/tile-view-item.d.ts +18 -0
  130. package/dist/components/tileview/tile-view-props.d.ts +38 -0
  131. package/dist/components/timeline/Timeline.d.ts +113 -0
  132. package/dist/components/timeline/index.d.ts +5 -0
  133. package/dist/components/timeline/timeline-item-click-event-args.d.ts +9 -0
  134. package/dist/components/timeline/timeline-item.d.ts +24 -0
  135. package/dist/components/timeline/timeline-props.d.ts +30 -0
  136. package/dist/components/timeline/timeline-selection-changed-event-args.d.ts +11 -0
  137. package/dist/components/tooltip/Tooltip.d.ts +1 -1
  138. package/dist/components/treeview/TreeView.d.ts +1 -1
  139. package/dist/components/validationsummary/ValidationSummary.d.ts +56 -0
  140. package/dist/components/validationsummary/index.d.ts +3 -0
  141. package/dist/components/validationsummary/summary-item-click-event-args.d.ts +11 -0
  142. package/dist/components/validationsummary/validation-summary-props.d.ts +17 -0
  143. package/dist/core/control.d.ts +4 -4
  144. package/dist/core/flow-home.d.ts +6 -0
  145. package/dist/core/fold-text.d.ts +6 -0
  146. package/dist/core/ui-locale.d.ts +0 -2
  147. package/dist/core/ui-strings.d.ts +67 -0
  148. package/dist/generated/tokens.d.ts +7270 -4490
  149. package/dist/index.d.ts +17 -1
  150. package/dist/index.js +27131 -20490
  151. package/dist/index.js.map +1 -1
  152. package/dist/locales/en.json +59 -1
  153. package/dist/locales/tr.json +59 -1
  154. package/dist/parts/slide/slide-track-host.d.ts +19 -0
  155. package/dist/parts/slide/slide-track.d.ts +45 -0
  156. package/dist/styles.css +4916 -206
  157. package/dist/tokens/index.d.ts +7270 -4490
  158. package/dist/tokens/index.js +7270 -4490
  159. package/dist/tokens/index.js.map +1 -1
  160. package/dist/tr-C5IXRzAH.js +1233 -0
  161. package/dist/tr-C5IXRzAH.js.map +1 -0
  162. package/docs/accordion.md +9 -9
  163. package/docs/actionsheet.md +2 -2
  164. package/docs/avatar.md +5 -5
  165. package/docs/badge.md +6 -6
  166. package/docs/bottomsheet.md +6 -6
  167. package/docs/breadcrumb.md +4 -4
  168. package/docs/button.md +10 -10
  169. package/docs/buttongroup.md +5 -5
  170. package/docs/calendar.md +6 -6
  171. package/docs/card.md +6 -6
  172. package/docs/checkbox.md +9 -9
  173. package/docs/chip.md +5 -5
  174. package/docs/colorbox.md +3 -3
  175. package/docs/combobox.md +7 -7
  176. package/docs/control.md +12 -12
  177. package/docs/datagrid-api.md +7 -7
  178. package/docs/datagrid-bands.md +1 -1
  179. package/docs/datagrid-drag-select.md +2 -2
  180. package/docs/datagrid-drag.md +1 -1
  181. package/docs/datagrid-editing.md +2 -2
  182. package/docs/datagrid-filtering.md +3 -3
  183. package/docs/datagrid-forms.md +1 -1
  184. package/docs/datagrid-grouping.md +1 -1
  185. package/docs/datagrid-layout.md +4 -4
  186. package/docs/datagrid-lookups.md +1 -1
  187. package/docs/datagrid-master-detail.md +3 -3
  188. package/docs/datagrid-scrolling.md +1 -1
  189. package/docs/datagrid-selection.md +3 -3
  190. package/docs/datagrid.md +8 -8
  191. package/docs/datebox.md +8 -8
  192. package/docs/daterangebox.md +192 -0
  193. package/docs/draggable.md +194 -0
  194. package/docs/drawer.md +1 -1
  195. package/docs/dropdown.md +10 -10
  196. package/docs/fileuploader.md +201 -0
  197. package/docs/filterbuilder.md +9 -9
  198. package/docs/formlayout.md +1 -1
  199. package/docs/gallery.md +244 -0
  200. package/docs/home.md +11 -7
  201. package/docs/keyboard.md +1 -1
  202. package/docs/language.md +229 -0
  203. package/docs/layout.md +15 -15
  204. package/docs/listbox.md +10 -10
  205. package/docs/loadpanel.md +184 -0
  206. package/docs/lookup.md +1 -1
  207. package/docs/menus.md +2 -2
  208. package/docs/multiview.md +202 -0
  209. package/docs/numberbox.md +9 -9
  210. package/docs/pagination.md +4 -4
  211. package/docs/popover.md +221 -0
  212. package/docs/progress.md +9 -9
  213. package/docs/radiogroup.md +7 -7
  214. package/docs/rating.md +4 -4
  215. package/docs/resizable.md +139 -0
  216. package/docs/scheduler-agenda.md +1 -1
  217. package/docs/scheduler-big-data.md +1 -1
  218. package/docs/scheduler-editing.md +5 -5
  219. package/docs/scheduler-form.md +1 -1
  220. package/docs/scheduler-icalendar.md +1 -1
  221. package/docs/scheduler-mobile.md +1 -1
  222. package/docs/scheduler-recurrence.md +2 -2
  223. package/docs/scheduler-resources.md +1 -1
  224. package/docs/scheduler-timeline.md +1 -1
  225. package/docs/scheduler.md +4 -4
  226. package/docs/scrollview.md +185 -0
  227. package/docs/showcase.md +1 -1
  228. package/docs/skeleton.md +2 -2
  229. package/docs/slider.md +9 -9
  230. package/docs/sortable.md +213 -0
  231. package/docs/speeddial.md +290 -0
  232. package/docs/splitter.md +204 -0
  233. package/docs/stepper.md +238 -0
  234. package/docs/switch.md +7 -7
  235. package/docs/tabdocs-dock.md +3 -3
  236. package/docs/tabdocs-drag.md +1 -1
  237. package/docs/tabdocs-menus.md +1 -1
  238. package/docs/tabdocs-mobile.md +1 -1
  239. package/docs/tabdocs-tabs.md +1 -1
  240. package/docs/tabdocs-windows.md +1 -1
  241. package/docs/tabdocs-workspace.md +1 -1
  242. package/docs/tabdocs.md +5 -5
  243. package/docs/tabs.md +11 -11
  244. package/docs/tagbox.md +10 -10
  245. package/docs/textarea.md +9 -9
  246. package/docs/textbox.md +10 -10
  247. package/docs/tileview.md +206 -0
  248. package/docs/timeline.md +174 -0
  249. package/docs/toast.md +7 -7
  250. package/docs/tokens.md +678 -122
  251. package/docs/toolbar.md +8 -8
  252. package/docs/tooltip.md +12 -12
  253. package/docs/treeview.md +11 -11
  254. package/docs/validationsummary.md +115 -0
  255. package/docs/window.md +7 -7
  256. package/docs/wizard.md +240 -0
  257. package/llms-full.txt +4813 -492
  258. package/llms.txt +21 -3
  259. package/package.json +9 -3
package/docs/textbox.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # TextBox
2
2
 
3
- > Editors · @motifx-community/ui 0.1.0-beta.1
3
+ > Editors · @motifx-community/ui 0.1.0-beta.3
4
4
 
5
5
  A one-line text field with its label, help text and error: placeholder, prefix and suffix, buttons in the box, a clear button, a password that can be shown, a character counter, an input mask and validation — alone, in a group, or every field in a panel.
6
6
 
@@ -10,21 +10,21 @@ A one-line text field with its label, help text and error: placeholder, prefix a
10
10
  import { TextBox, ValidationGroup, validateFields, type ValidationRule } from '@motifx-community/ui';
11
11
  ```
12
12
 
13
- ## From JSX and from code
13
+ ## Declarative and programmatic
14
14
 
15
- Every prop takes a value or a function; a function of a reactive object keeps the field in step with it. `x-model` binds the value two-way. Created with `new`, the same properties are set from code.
15
+ Every prop takes a value or a function; a function of a reactive object keeps the field in step with it. `x-model` binds the value two-way. Created with `new`, the same properties are set programmatically.
16
16
 
17
17
  ```tsx
18
18
  import { reactive } from '@motifx/core';
19
19
  import { Button, Stack, TextBox } from '@motifx-community/ui';
20
20
 
21
- /** A field bound to state with x-model, and fields created with `new` and added from code. */
22
- export default function FromCode() {
21
+ /** A field bound to state with x-model, and fields created with `new` and added programmatically. */
22
+ export default function Programmatic() {
23
23
  const form = reactive({ name: 'Ada', result: '' });
24
24
  let added = 0;
25
25
  let host: Stack | null = null;
26
26
 
27
- const addFromCode = () => {
27
+ const addProgrammatic = () => {
28
28
  const box = new TextBox({ label: `Field ${++added}`, clearButton: true, placeholder: 'Created with new' });
29
29
  box.onValueChanged((e) => (form.result = `${box.label}: ${e.value}`));
30
30
  host?.controls.add(box);
@@ -35,7 +35,7 @@ export default function FromCode() {
35
35
  <>
36
36
  <TextBox label="&Name" x-model={() => form.name} clearButton helpText={() => `Hello, ${form.name || 'stranger'}.`} />
37
37
  <Stack orientation="horizontal" wrap align="center">
38
- <Button text="Add a field from code" variant="outline" onclick={addFromCode} />
38
+ <Button text="Add a field programmatically" variant="outline" onclick={addProgrammatic} />
39
39
  <output class="tb-result">{() => form.result}</output>
40
40
  </Stack>
41
41
  <Stack orientation="horizontal" wrap align="center" ref={(c: Stack) => (host = c)} />
@@ -316,7 +316,7 @@ The names of the clear and password buttons and every validation message come fr
316
316
 
317
317
  ```tsx
318
318
  import { reactive } from '@motifx/core';
319
- import { Button, enStrings, trStrings, uiLocale } from '@motifx-community/ui';
319
+ import { Button, uiLocale } from '@motifx-community/ui';
320
320
  import { kitTexts } from '../../../shared/kit-texts';
321
321
 
322
322
  /** Switches the texts of every field on the page; errors already shown follow too. */
@@ -324,7 +324,7 @@ export default function Localization() {
324
324
  const s = reactive({ lang: 'en' });
325
325
  const toggle = () => {
326
326
  s.lang = s.lang === 'en' ? 'tr' : 'en';
327
- uiLocale.strings = s.lang === 'en' ? enStrings : trStrings;
327
+ void uiLocale.use(s.lang);
328
328
  };
329
329
  return (
330
330
  <>
@@ -428,7 +428,7 @@ export default function Localization() {
428
428
 
429
429
  | Event | When |
430
430
  | --- | --- |
431
- | `onValueChanged(e)` | The value changed. `e`: `{ value, previousValue, byUser, source, event? }`; `byUser` tells the user from code. |
431
+ | `onValueChanged(e)` | The value changed. `e`: `{ value, previousValue, byUser, source, event? }`; `byUser` tells the user programmatically. |
432
432
  | `onValidated(e)` | A check ended. `e`: `{ valid, message, source }`. |
433
433
  | `onEnter(e)` | Enter was pressed. `e`: `{ value, source, event }`. |
434
434
  | `oninput, onchange, onkeydown, onfocusin, onfocusout` | The DOM events of the input reach the field. |
@@ -0,0 +1,206 @@
1
+ # TileView
2
+
3
+ > Display · @motifx-community/ui 0.1.0-beta.3
4
+
5
+ Tiles of different sizes packed on a grid of base cells: a tile is so many cells wide and tall. They fill the height in columns and scroll sideways, or fill the width in rows; they can be chosen, and put in another order by dragging.
6
+
7
+ ## Import
8
+
9
+ ```tsx
10
+ import { TileView } from '@motifx-community/ui';
11
+ ```
12
+
13
+ ## Tiles on a grid
14
+
15
+ `baseItemWidth` and `baseItemHeight` are one cell; a tile’s `widthRatio` and `heightRatio` say how many it takes. Down the columns (`horizontal`, the default) the view needs a `height` and scrolls sideways; the tiles are packed so no cell stays empty where a later tile fits.
16
+
17
+ ```tsx
18
+ import { TileView } from '@motifx-community/ui';
19
+
20
+ /** Tiles of one, two and four base cells packed down the columns; the view scrolls sideways when they do not fit. */
21
+ export default function Basic() {
22
+ return (
23
+ <TileView
24
+ class="tv-board"
25
+ label="Board"
26
+ height={330}
27
+ baseItemWidth={120}
28
+ baseItemHeight={100}
29
+ items={[
30
+ { text: 'Sales today', widthRatio: 2 },
31
+ { text: 'Orders' },
32
+ { text: 'Returns' },
33
+ { text: 'Visitors this week', widthRatio: 2, heightRatio: 2 },
34
+ { text: 'Stock' },
35
+ { text: 'Staff on duty', heightRatio: 2 },
36
+ { text: 'Tickets' },
37
+ { text: 'Deliveries', widthRatio: 2 },
38
+ { text: 'Reviews' },
39
+ { text: 'Costs' }
40
+ ]}
41
+ />
42
+ );
43
+ }
44
+ ```
45
+
46
+ ## Choosing tiles
47
+
48
+ `selectionMode` makes the tiles options: `single` keeps one, `multiple` any number (Ctrl and a press, or Space, adds and takes away). `value` is the chosen tile’s `key`, else its index, or a list of them; `x-model` binds it two-way. The arrow keys walk the grid by where the tiles lie.
49
+
50
+ ```tsx
51
+ import { reactive } from '@motifx/core';
52
+ import { Stack, TileView } from '@motifx-community/ui';
53
+
54
+ /** Tiles along the rows, any number of them chosen: a press, Ctrl and a press, Space; the keys walk the grid. */
55
+ export default function Selection() {
56
+ const s = reactive({ chosen: ['tea'] as string | number | null | readonly (string | number)[] });
57
+ return (
58
+ <Stack gap="sm" style="inline-size: 100%">
59
+ <TileView
60
+ class="tv-pick"
61
+ label="Snacks"
62
+ direction="vertical"
63
+ selectionMode="multiple"
64
+ baseItemWidth={110}
65
+ baseItemHeight={70}
66
+ x-model={() => s.chosen}
67
+ items={[
68
+ { key: 'tea', text: 'Tea' },
69
+ { key: 'coffee', text: 'Coffee' },
70
+ { key: 'water', text: 'Water', enabled: false },
71
+ { key: 'cake', text: 'Cake', widthRatio: 2 },
72
+ { key: 'fruit', text: 'Fruit' },
73
+ { key: 'nuts', text: 'Nuts' }
74
+ ]}
75
+ />
76
+ <output class="tv-pick-told">{() => `chosen: ${JSON.stringify(s.chosen)}`}</output>
77
+ </Stack>
78
+ );
79
+ }
80
+ ```
81
+
82
+ ## Another order
83
+
84
+ With `allowReorder` a tile is dragged to its new place (a long press on a touch screen) or moved with Ctrl and an arrow key. The tile moves and `onReordered` tells the indexes: reorder your data there, as the example does, so the next draw agrees.
85
+
86
+ ```tsx
87
+ import { reactive } from '@motifx/core';
88
+ import { Stack, TileView } from '@motifx-community/ui';
89
+
90
+ /** Drag a tile to another place, or move it with Ctrl and an arrow key; the data is reordered in `onReordered`. */
91
+ export default function Reorder() {
92
+ const s = reactive({ tiles: [{ text: 'Plan' }, { text: 'Design', widthRatio: 2 }, { text: 'Build' }, { text: 'Test' }, { text: 'Ship', heightRatio: 2 }, { text: 'Rest' }] });
93
+ return (
94
+ <Stack gap="sm" style="inline-size: 100%">
95
+ <TileView
96
+ class="tv-order"
97
+ label="Steps"
98
+ direction="vertical"
99
+ allowReorder
100
+ baseItemWidth={100}
101
+ baseItemHeight={70}
102
+ items={() => s.tiles}
103
+ onReordered={e => s.tiles.splice(e.toIndex, 0, ...s.tiles.splice(e.fromIndex, 1))}
104
+ />
105
+ <output class="tv-order-told">{() => s.tiles.map(t => t.text).join(', ')}</output>
106
+ </Stack>
107
+ );
108
+ }
109
+ ```
110
+
111
+ ## Any content
112
+
113
+ An item’s `content` makes the tile’s content when the tile is made; what is in it works as anywhere else, and a press on a button inside is that button’s. `onItemClick` tells a press on the tile itself.
114
+
115
+ ```tsx
116
+ import { reactive } from '@motifx/core';
117
+ import { Button, Stack, TileView } from '@motifx-community/ui';
118
+
119
+ const ROOMS = [
120
+ { name: 'Kitchen', temp: 21 },
121
+ { name: 'Lounge', temp: 23 },
122
+ { name: 'Study', temp: 19 },
123
+ { name: 'Bedroom', temp: 18 }
124
+ ];
125
+
126
+ /** Any content on a tile: a room each, with its own button; a press on the tile itself is told too. */
127
+ export default function Content() {
128
+ const s = reactive({ told: '' });
129
+ const room = (r: (typeof ROOMS)[number]) => (
130
+ <Stack class="tv-room" gap="xs" justify="center" style="block-size: 100%">
131
+ <strong>{r.name}</strong>
132
+ <span class="tv-room-temp">{r.temp} °C</span>
133
+ <Button text="Warmer" variant="outline" size="sm" onclick={() => (s.told = `${r.name}: warmer`)} />
134
+ </Stack>
135
+ );
136
+ return (
137
+ <Stack gap="sm" style="inline-size: 100%">
138
+ <TileView class="tv-rooms" label="Rooms" direction="vertical" baseItemWidth={150} baseItemHeight={120} items={ROOMS.map(r => ({ key: r.name, content: () => room(r) }))} onItemClick={e => (s.told = `${(e.item as { key: string }).key} pressed`)} />
139
+ <output class="tv-rooms-told">{() => s.told}</output>
140
+ </Stack>
141
+ );
142
+ }
143
+ ```
144
+
145
+ ## Keyboard
146
+
147
+ | Key | What it does |
148
+ | --- | --- |
149
+ | `Tab` | One stop: the tile focused last, else the first chosen, else the first. |
150
+ | `Arrow keys` | The nearest tile that way, by where the tiles lie; Home and End the first and the last. |
151
+ | `Space` | Chooses the tile (`single`), or chooses it or lets it go (`multiple`). |
152
+ | `Enter` | A press on the tile: `onItemClick`, and the choice as a press makes it. |
153
+ | `Ctrl + Arrow keys` | With `allowReorder`: moves the tile a place back or on; Ctrl + Home and End to the ends. The move is read out. |
154
+
155
+ ## Accessibility
156
+
157
+ | Topic | How |
158
+ | --- | --- |
159
+ | `Roles` | A `list` of `listitem`s without selection; a `listbox` of `option`s with it (`aria-multiselectable` for `multiple`), each `aria-selected`. |
160
+ | `Disabled tiles` | `aria-disabled`, skipped by the keys, not chosen by a press. |
161
+ | `Dragging` | A copy of the tile follows the pointer; the tile where the drop would land is marked; Escape lets go. On a touch screen a long press lifts the tile. |
162
+
163
+ ## Styling
164
+
165
+ | Hook | What it is |
166
+ | --- | --- |
167
+ | `.mx-tile-view` | The view. `data-direction`, `data-reorder`, `data-dragging` while a tile is dragged. |
168
+ | `.mx-tile-view__tile` | A tile. `aria-selected`, `aria-disabled`, `data-dragging` (left faint in its place), `data-drop="before\|after"` where the drop would land. |
169
+ | `.mx-tile-view__text, .mx-tile-view__ghost` | A tile’s text; the copy after the pointer. |
170
+
171
+ ### Component tokens
172
+
173
+ | Token | What it sets |
174
+ | --- | --- |
175
+ | `tile-view.tile, .text, .ghost, .view` | Units: a tile (`hover`, `pressed`, `focus`, `selected`, `disabled`, `dragging`, `target`), its text, the copy after the pointer, the view. |
176
+ | `tile-view.gap` | Between the tiles. |
177
+
178
+ ## API reference
179
+
180
+ ### Props
181
+
182
+ | Prop | Type | Default | Description |
183
+ | --- | --- | --- | --- |
184
+ | `items` | `Bind<readonly (TileViewItem \| string)[]>` | `[]` | The tiles in order: `TileViewItem`s (`text`, `widthRatio`, `heightRatio`, `key`, `content`, `enabled`, `data`) or plain texts. |
185
+ | `baseItemWidth, baseItemHeight` | `Bind<number>` | `100` | A base cell in pixels; a tile is `widthRatio` × `heightRatio` of them. |
186
+ | `direction` | `Bind<TileViewDirection>` | `'horizontal'` | `horizontal`: the tiles fill the height in columns and the view scrolls sideways (give it a `height`); `vertical`: they fill the width in rows. |
187
+ | `selectionMode` | `Bind<TileViewSelectionMode>` | `'none'` | `none`, `single` or `multiple`. |
188
+ | `value` | `Bind<string \| number \| null \| (string \| number)[]>` | `null` | The chosen tile (`single`): its `key`, else its index; the chosen tiles (`multiple`) as a list. `x-model` binds it two-way. |
189
+ | `allowReorder` | `Bind<boolean>` | `false` | The tiles can be put in another order by dragging, or with Ctrl and an arrow key. |
190
+ | `height` | `Bind<string \| number \| null>` | `null` | A CSS length or pixels. |
191
+ | `label` | `Bind<string>` | the kit’s “Tiles” | What screen readers call it. |
192
+
193
+ ### Events, properties and methods
194
+
195
+ | Member | Kind | Description |
196
+ | --- | --- | --- |
197
+ | `onItemClick` | event | A press on a tile that was not a drag (`index`, `item`, `event`); Enter on a focused tile too. |
198
+ | `onSelectionChanged` | event | The chosen tiles changed (`indexes`, `items`, `byUser`). |
199
+ | `onReordering` | event | A tile is about to be dragged or moved with the keys (`fromIndex`, `toIndex`); `cancel = true` keeps it. |
200
+ | `onReordered` | event | A tile was dropped or moved to a new place (`item`, `fromIndex`, `toIndex`): your data is yours to reorder. |
201
+ | `selectedIndexes` | read-only | The chosen tiles’ indexes, in tile order. |
202
+ | `count` | read-only | How many tiles there are. |
203
+ | `isDragging` | read-only | A tile is being dragged. |
204
+ | `select(index)` | `void` | Chooses a tile programmatically: the only one (`single`), or one more (`multiple`). |
205
+ | `indexOf(value), valueAt(index)` | `number`, `string \| number` | Between a value (a key or an index) and a tile’s index. |
206
+ | `refresh()` | `void` | Reads the items again after they were changed in place. |
@@ -0,0 +1,174 @@
1
+ # Timeline
2
+
3
+ > Display · @motifx-community/ui 0.1.0-beta.3
4
+
5
+ Events in time order: down the page, each a card beside a line with a dot; or along a line of dates, where a press on a date shows that event’s card under the line. The dates are written in the kit’s language. For hours on a calendar, see the [Scheduler](scheduler.md).
6
+
7
+ ## Import
8
+
9
+ ```tsx
10
+ import { Timeline } from '@motifx-community/ui';
11
+ ```
12
+
13
+ ## Down the page
14
+
15
+ `items` are the events: a `date`, a `title`, a `description`, a `tone` for the dot and a `glyph` in it. `alternate` puts the cards on either side of the line in turn; `collapsible` folds the descriptions until a card is pressed. `onItemClick` tells a press.
16
+
17
+ ```tsx
18
+ import { reactive } from '@motifx/core';
19
+ import { Button, Stack, Timeline } from '@motifx-community/ui';
20
+
21
+ /** A project down the page: a dot per event on the line, coloured by its tone; the cards take turns or fold when told. */
22
+ export default function Vertical() {
23
+ const s = reactive({ alternate: false, collapsible: false, told: '' });
24
+ return (
25
+ <Stack gap="md" style="inline-size: 100%">
26
+ <Stack orientation="horizontal" wrap align="center">
27
+ <Button text="Take turns" variant="outline" toggle x-model={() => s.alternate} />
28
+ <Button text="Fold the cards" variant="outline" toggle x-model={() => s.collapsible} />
29
+ <output class="tl-told">{() => s.told}</output>
30
+ </Stack>
31
+ <Timeline
32
+ class="tl-project"
33
+ label="The project"
34
+ alternate={() => s.alternate}
35
+ collapsible={() => s.collapsible}
36
+ onItemClick={e => (s.told = `pressed: ${(e.item as { title: string }).title}`)}
37
+ items={[
38
+ { date: '2026-01-12', title: 'Kick-off', description: 'The team met and the scope was agreed.', glyph: 'calendar' },
39
+ { date: '2026-02-20', title: 'Design signed off', description: 'Five languages, every state measured.', tone: 'info', glyph: 'pencil' },
40
+ { date: '2026-04-03', title: 'Beta', description: 'The first users came in; two slow screens were found.', tone: 'accent', glyph: 'person' },
41
+ { date: '2026-05-15', title: 'Slow screens fixed', description: 'The grid draws only what is in view.', tone: 'caution' },
42
+ { date: '2026-06-30', title: 'Shipped', description: 'Version one, on time.', tone: 'success', glyph: 'check' }
43
+ ]}
44
+ />
45
+ </Stack>
46
+ );
47
+ }
48
+ ```
49
+
50
+ ## Along a line of dates
51
+
52
+ `orientation='horizontal'` puts the dates on a line that scrolls with the buttons at its ends; the shown event (`value`, `x-model`) has its card under the line. The arrow keys move along the dates. `dateFormat` takes the options of `Intl.DateTimeFormat`.
53
+
54
+ ```tsx
55
+ import { reactive } from '@motifx/core';
56
+ import { Stack, Timeline } from '@motifx-community/ui';
57
+
58
+ const MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
59
+
60
+ /** Releases along a line of dates: a press on a date, or the arrow keys, shows that release under the line; the buttons scroll the track. */
61
+ export default function Horizontal() {
62
+ const s = reactive({ shown: 'r3' as string | number | null });
63
+ const releases = MONTHS.map((month, i) => ({
64
+ key: `r${i + 1}`,
65
+ date: new Date(2026, i, 15),
66
+ title: `Release ${i + 1}`,
67
+ description: `What ${month} brought: ${i % 3 === 0 ? 'new components' : i % 3 === 1 ? 'fixes and speed' : 'the docs and the languages'}.`,
68
+ tone: i % 3 === 0 ? ('accent' as const) : ('default' as const),
69
+ glyph: i % 3 === 0 ? 'star' : ''
70
+ }));
71
+ return (
72
+ <Stack gap="sm" style="inline-size: 100%">
73
+ <Timeline class="tl-releases" label="Releases" orientation="horizontal" dateFormat={{ month: 'short', year: 'numeric' }} items={releases} x-model={() => s.shown} />
74
+ <output class="tl-releases-told">{() => `shown: ${s.shown}`}</output>
75
+ </Stack>
76
+ );
77
+ }
78
+ ```
79
+
80
+ ## Any content
81
+
82
+ An item’s `content` makes what goes in its card besides the texts; `icon` puts an icon of your own in the dot. A date with a time is written with it when `dateFormat` says so.
83
+
84
+ ```tsx
85
+ import { reactive } from '@motifx/core';
86
+ import { Button, Stack, Timeline } from '@motifx-community/ui';
87
+
88
+ /** Any content in a card: a button to act on the event, an icon of your own in the dot. */
89
+ export default function Content() {
90
+ const s = reactive({ told: '' });
91
+ const act = (what: string) => (
92
+ <Stack orientation="horizontal" gap="sm">
93
+ <Button text={what} variant="outline" size="sm" onclick={() => (s.told = `${what} pressed`)} />
94
+ </Stack>
95
+ );
96
+ return (
97
+ <Stack gap="sm" style="inline-size: 100%">
98
+ <Timeline
99
+ class="tl-orders"
100
+ label="An order"
101
+ items={[
102
+ { date: '2026-11-02T09:15:00', title: 'Order placed', description: 'Three items, paid by card.', tone: 'info', content: () => act('See the invoice') },
103
+ { date: '2026-11-03T14:40:00', title: 'Packed', tone: 'accent', glyph: 'columns' },
104
+ { date: '2026-11-04T08:00:00', title: 'On its way', description: 'Handed to the courier.', content: () => act('Track it') },
105
+ { date: '2026-11-05T16:25:00', title: 'Delivered', tone: 'success', glyph: 'check', content: () => act('Rate it') }
106
+ ]}
107
+ dateFormat={{ dateStyle: 'medium', timeStyle: 'short' }}
108
+ />
109
+ <output class="tl-orders-told">{() => s.told}</output>
110
+ </Stack>
111
+ );
112
+ }
113
+ ```
114
+
115
+ ## Keyboard
116
+
117
+ | Key | What it does |
118
+ | --- | --- |
119
+ | `Tab` | Vertical: the cards that fold are stops, one each. Horizontal: the shown date is the one stop; the track’s buttons are stops too. |
120
+ | `Arrow keys` | Horizontal: Left and Right (the other way round in a right-to-left page) show the event before or after; Home and End the first and the last. |
121
+ | `Enter, Space` | On a folding card: unfolds or folds it. On a date: shows it. |
122
+
123
+ ## Accessibility
124
+
125
+ | Topic | How |
126
+ | --- | --- |
127
+ | `Down the page` | A `list` named by `label`, one item per event; a date is a `time` element with its ISO value; a folding card is a button with `aria-expanded` over its description. |
128
+ | `Along the line` | The dates are tabs (`tablist`, `tab`, `aria-selected`) and the card under them the `tabpanel` they control; the buttons at the ends are named “Earlier” and “Later”. |
129
+ | `Dots and glyphs` | Decorative; the tone shows in colour only, so put what matters in the title. |
130
+
131
+ ## Styling
132
+
133
+ | Hook | What it is |
134
+ | --- | --- |
135
+ | `.mx-timeline` | The timeline. `data-orientation`, `data-alternate`. |
136
+ | `.mx-timeline__list, .mx-timeline__item` | The list (the line is its `::before`) and an event (`data-tone`, `data-side`, `data-expanded`, `data-selected`). |
137
+ | `.mx-timeline__dot, .mx-timeline__dot-glyph, .mx-timeline__dot-icon` | The dot and what is in it. |
138
+ | `.mx-timeline__card, .mx-timeline__flag, .mx-timeline__detail` | A card down the page, a date along the line, the card under the line. |
139
+ | `.mx-timeline__date, .mx-timeline__title, .mx-timeline__description, .mx-timeline__content` | The texts and the content of your own. |
140
+ | `.mx-timeline__track, .mx-timeline__nav, .mx-timeline__nav-glyph` | The track that scrolls, its buttons and their arrows. |
141
+
142
+ ### Component tokens
143
+
144
+ | Token | What it sets |
145
+ | --- | --- |
146
+ | `timeline.line, .dot, .dot-glyph, .card, .flag, .date, .title, .description, .detail, .nav, .nav-glyph` | Units: the line, a dot and its glyph (by tone), a card (`pressable`, `hover`, `pressed`, `focus`, `expanded`), a flag (`hover`, `pressed`, `focus`, `selected`), the texts, the detail, the track buttons. |
147
+ | `timeline.gap, .dot-gap, .track-gap, .row-gap, .mark-size, .line-thickness` | Between events, between a dot and its card, between flags, between the track and the detail; the dot’s size; the line’s thickness. |
148
+
149
+ ## API reference
150
+
151
+ ### Props
152
+
153
+ | Prop | Type | Default | Description |
154
+ | --- | --- | --- | --- |
155
+ | `items` | `Bind<readonly TimelineItem[]>` | `[]` | The events in order: `date` (a `Date`, an ISO text or milliseconds), `title`, `description`, `glyph` or `icon`, `tone`, `content`, `key`, `data`. |
156
+ | `orientation` | `Bind<TimelineOrientation>` | `'vertical'` | `vertical`: down the page, a card per event; `horizontal`: along a line of dates, the shown event’s card under it. |
157
+ | `alternate` | `Bind<boolean>` | `false` | Vertical: the cards take turns on either side of the line. |
158
+ | `collapsible` | `Bind<boolean>` | `false` | Vertical: a card shows its description only when pressed. |
159
+ | `dateFormat` | `Bind<TimelineDateFormat>` | `'medium'` | `short`, `medium`, `long`, or the options of `Intl.DateTimeFormat`; written in the kit’s language. |
160
+ | `value` | `Bind<string \| number \| null>` | `0` | Horizontal: the event whose card is shown, its `key` else its index. `x-model` binds it two-way. |
161
+ | `label` | `Bind<string>` | the kit’s “Timeline” | What screen readers call it. |
162
+
163
+ ### Events, properties and methods
164
+
165
+ | Member | Kind | Description |
166
+ | --- | --- | --- |
167
+ | `onItemClick` | event | A press on an event’s card or flag (`index`, `item`). |
168
+ | `onSelectionChanged` | event | Horizontal: the shown event changed (`index`, `item`, `previous`, `byUser`). |
169
+ | `selectedIndex` | read-only | Horizontal: the index of the shown event; -1 when there is none. |
170
+ | `count` | read-only | How many events there are. |
171
+ | `goTo(event)` | `boolean` | Horizontal: shows an event by index or key; vertical: unfolds its card. |
172
+ | `unfold(event, on), isUnfolded(event)` | `void`, `boolean` | Vertical, `collapsible`: unfolds or folds a card; whether it is unfolded. |
173
+ | `formatDate(date)` | `string` | A date as the timeline writes it. |
174
+ | `refresh()` | `void` | Reads the items again after they were changed in place. |
package/docs/toast.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Toast
2
2
 
3
- > Feedback · @motifx-community/ui 0.1.0-beta.1
3
+ > Feedback · @motifx-community/ui 0.1.0-beta.3
4
4
 
5
- Short notifications at an edge of the window: four tones, an action such as Undo, a time of their own or none, six positions and a limit on how many show at once. Called from code; a region of your own can sit in JSX.
5
+ Short notifications at an edge of the window: four tones, an action such as Undo, a time of their own or none, six positions and a limit on how many show at once. Called programmatically; a region of your own can sit in JSX.
6
6
 
7
7
  ## Import
8
8
 
@@ -10,7 +10,7 @@ Short notifications at an edge of the window: four tones, an action such as Undo
10
10
  import { toast, Toast, Toaster, type ToastTone, type ToastPosition } from '@motifx-community/ui';
11
11
  ```
12
12
 
13
- ## From code and from JSX
13
+ ## Programmatic and declarative
14
14
 
15
15
  `toast.show()` and its tone shortcuts return the `Toast`, an object you can `close()`, `update()` or await. They use `Toaster.default`, made in `document.body` the first time; an app can put a `Toaster` of its own where it wants it in JSX and make it the default.
16
16
 
@@ -18,8 +18,8 @@ import { toast, Toast, Toaster, type ToastTone, type ToastPosition } from '@moti
18
18
  import { reactive } from '@motifx/core';
19
19
  import { Button, toast, type Toast } from '@motifx-community/ui';
20
20
 
21
- /** Toasts shown from code: the Toast that comes back can be closed and awaited. */
22
- export default function FromCode() {
21
+ /** Toasts shown programmatically: the Toast that comes back can be closed and awaited. */
22
+ export default function Programmatic() {
23
23
  const s = reactive({ reason: '' });
24
24
 
25
25
  const exportFile = () => {
@@ -219,7 +219,7 @@ The name of the region and of the close button come from `uiLocale.strings` (`no
219
219
 
220
220
  ```tsx
221
221
  import { reactive } from '@motifx/core';
222
- import { Button, enStrings, toast, trStrings, uiLocale } from '@motifx-community/ui';
222
+ import { Button, toast, uiLocale } from '@motifx-community/ui';
223
223
 
224
224
  /** Switches the names of the region and the close button. */
225
225
  export default function Localization() {
@@ -227,7 +227,7 @@ export default function Localization() {
227
227
 
228
228
  const toggle = () => {
229
229
  s.lang = s.lang === 'en' ? 'tr' : 'en';
230
- uiLocale.strings = s.lang === 'en' ? enStrings : trStrings;
230
+ void uiLocale.use(s.lang);
231
231
  };
232
232
 
233
233
  return (