@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
@@ -0,0 +1,290 @@
1
+ # SpeedDial
2
+
3
+ > Buttons · @motifx-community/ui 0.1.0-beta.3
4
+
5
+ A round button in a corner of the page, on an edge or in the flow, that opens its actions when pressed: round buttons in a line with a label beside each, or on a circle, a half or a quarter of one around it with a tooltip each. With one action, the main button does it itself.
6
+
7
+ ## Import
8
+
9
+ ```tsx
10
+ import { SpeedDial } from '@motifx-community/ui';
11
+ ```
12
+
13
+ ## In a line
14
+
15
+ `actions` are the buttons that go out in `direction`; each has a `glyph` of the kit’s set or an `icon` of your own, a `text` shown as its label, and a `click`. `open` and `x-model` say whether the fan is out. Here in the flow of the page (`position='inline'`).
16
+
17
+ ```tsx
18
+ import { reactive } from '@motifx/core';
19
+ import { SpeedDial, Stack } from '@motifx-community/ui';
20
+
21
+ /** Two speed dials in the flow of the page: one fans up, one fans to the end; a press on an action tells. */
22
+ export default function Inline() {
23
+ const s = reactive({ told: '', open: false });
24
+ const actions = [
25
+ { key: 'note', text: 'New note', glyph: 'pencil', click: () => (s.told = 'a new note') },
26
+ { key: 'event', text: 'New event', glyph: 'calendar', click: () => (s.told = 'a new event') },
27
+ { key: 'file', text: 'Upload a file', glyph: 'upload', click: () => (s.told = 'a file to upload') },
28
+ { key: 'locked', text: 'Not yet', glyph: 'lock', enabled: false }
29
+ ];
30
+ return (
31
+ <Stack gap="md" style="inline-size: 100%">
32
+ <div class="sd-row" style="display: flex; align-items: flex-end; gap: 48px; min-block-size: 260px; padding-inline-start: 140px">
33
+ <SpeedDial class="sd-up" position="inline" direction="up" text="New" actions={actions} x-model={() => s.open} />
34
+ <SpeedDial class="sd-end" position="inline" direction="end" text="Share" glyph="person" actions={[{ text: 'Mail', glyph: 'file', click: () => (s.told = 'shared by mail') }, { text: 'Link', glyph: 'pin', click: () => (s.told = 'a link to share') }]} />
35
+ </div>
36
+ <output class="sd-told">{() => `${s.told || 'nothing yet'}${s.open ? ' (open)' : ''}`}</output>
37
+ </Stack>
38
+ );
39
+ }
40
+ ```
41
+
42
+ ## On a circle
43
+
44
+ `layout='circle'` lays the actions evenly around the main button, the first in `direction`. They come out from under the button and go back there. `radius` sets how far out; by itself it is just enough to keep the actions `gap` apart and clear of the button. Around the button the labels are off and the actions have tooltips, because labels would run into each other; `showLabels` and `tooltip` say otherwise. Here it is in the centre of its box: `relativeTo='parent'` measures `position` in the nearest positioned parent.
45
+
46
+ ```tsx
47
+ import { reactive } from '@motifx/core';
48
+ import { Button, SpeedDial, Stack } from '@motifx-community/ui';
49
+
50
+ /** The actions on a whole circle around the button, in the centre of a box; by default just far enough out to keep them apart. */
51
+ export default function Circle() {
52
+ const s = reactive({ radius: null as number | null, told: '' });
53
+ const actions = [
54
+ { text: 'Edit', glyph: 'pencil', click: () => (s.told = 'edit') },
55
+ { text: 'Refresh', glyph: 'repeat', click: () => (s.told = 'refresh') },
56
+ { text: 'Delete', glyph: 'trash', click: () => (s.told = 'delete') },
57
+ { text: 'Upload', glyph: 'upload', click: () => (s.told = 'upload') },
58
+ { text: 'Download', glyph: 'download', click: () => (s.told = 'download') }
59
+ ];
60
+ return (
61
+ <Stack gap="sm" style="inline-size: 100%">
62
+ <Stack orientation="horizontal" wrap align="center">
63
+ <Button text="Radius by itself" variant="outline" onclick={() => (s.radius = null)} />
64
+ <Button text="Radius 120" variant="outline" onclick={() => (s.radius = 120)} />
65
+ <output class="sd-circle-told">{() => s.told}</output>
66
+ </Stack>
67
+ <div style="position: relative; inline-size: 100%; block-size: 22rem">
68
+ <SpeedDial class="sd-circle" layout="circle" position="center" relativeTo="parent" radius={() => s.radius} text="Tools" actions={actions} />
69
+ </div>
70
+ </Stack>
71
+ );
72
+ }
73
+ ```
74
+
75
+ ## On a half circle
76
+
77
+ `layout='semi-circle'` lays them on half a circle with `direction` in its middle, which suits the middle of an edge: `position` takes `top`, `bottom`, `start` and `end`, and `direction` follows from it, into the page.
78
+
79
+ ```tsx
80
+ import { SpeedDial } from '@motifx-community/ui';
81
+
82
+ const ACTIONS = [
83
+ { text: 'Edit', glyph: 'pencil' },
84
+ { text: 'Refresh', glyph: 'repeat' },
85
+ { text: 'Delete', glyph: 'trash' },
86
+ { text: 'Upload', glyph: 'upload' },
87
+ { text: 'Download', glyph: 'download' }
88
+ ];
89
+
90
+ /** A half circle on the middle of each edge of a box: `direction` follows from `position`, into the box. */
91
+ export default function SemiCircle() {
92
+ return (
93
+ <div class="sd-semi" style="position: relative; inline-size: 100%; block-size: 26rem">
94
+ <SpeedDial class="sd-semi-top" layout="semi-circle" position="top" relativeTo="parent" text="Tools at the top" actions={ACTIONS} />
95
+ <SpeedDial class="sd-semi-start" layout="semi-circle" position="start" relativeTo="parent" text="Tools at the start" actions={ACTIONS} />
96
+ <SpeedDial class="sd-semi-end" layout="semi-circle" position="end" relativeTo="parent" text="Tools at the end" actions={ACTIONS} />
97
+ <SpeedDial class="sd-semi-bottom" layout="semi-circle" position="bottom" relativeTo="parent" text="Tools at the bottom" actions={ACTIONS} />
98
+ </div>
99
+ );
100
+ }
101
+ ```
102
+
103
+ ## On a quarter circle
104
+
105
+ `layout='quarter-circle'` lays them on a quarter of a circle, which suits a corner: `direction` follows from `position` again, and is a diagonal such as `up-start` when you set it.
106
+
107
+ ```tsx
108
+ import { SpeedDial } from '@motifx-community/ui';
109
+
110
+ const ACTIONS = [
111
+ { text: 'Edit', glyph: 'pencil' },
112
+ { text: 'Refresh', glyph: 'repeat' },
113
+ { text: 'Delete', glyph: 'trash' },
114
+ { text: 'Upload', glyph: 'upload' },
115
+ { text: 'Download', glyph: 'download' }
116
+ ];
117
+
118
+ /** A quarter circle in each corner of a box: `direction` follows from `position`, into the box. */
119
+ export default function QuarterCircle() {
120
+ return (
121
+ <div class="sd-quarter" style="position: relative; inline-size: 100%; block-size: 26rem">
122
+ <SpeedDial class="sd-quarter-top-start" layout="quarter-circle" position="top-start" relativeTo="parent" text="Tools, top start" actions={ACTIONS} />
123
+ <SpeedDial class="sd-quarter-top-end" layout="quarter-circle" position="top-end" relativeTo="parent" text="Tools, top end" actions={ACTIONS} />
124
+ <SpeedDial class="sd-quarter-bottom-start" layout="quarter-circle" position="bottom-start" relativeTo="parent" text="Tools, bottom start" actions={ACTIONS} />
125
+ <SpeedDial class="sd-quarter-bottom-end" layout="quarter-circle" position="bottom-end" relativeTo="parent" text="Tools, bottom end" actions={ACTIONS} />
126
+ </div>
127
+ );
128
+ }
129
+ ```
130
+
131
+ ## Tooltips
132
+
133
+ `tooltip` on the speed dial turns tooltips on or off for all its actions and passes options to each; `tooltip` on an action wins, with a text of its own, options, or `false`. Each is the kit’s `Tooltip`, on the outer side of the action unless `placement` says another. With one action, the main button carries its tooltip.
134
+
135
+ ```tsx
136
+ import { reactive } from '@motifx/core';
137
+ import { Button, SpeedDial, Stack } from '@motifx-community/ui';
138
+
139
+ /** Tooltips on the actions: the speed dial's options for all, a text or options of an action's own, none on one. */
140
+ export default function Tooltips() {
141
+ const s = reactive({ on: true });
142
+ return (
143
+ <Stack gap="md" style="inline-size: 100%">
144
+ <Button class="sd-tips-toggle" text="Tooltips" variant="outline" toggle x-model={() => s.on} />
145
+ <div style="min-block-size: 5rem; padding-block-start: 2rem">
146
+ <SpeedDial
147
+ class="sd-tips"
148
+ position="inline"
149
+ direction="end"
150
+ text="Edit"
151
+ closeOnAction={false}
152
+ showLabels={false}
153
+ tooltip={() => (s.on ? { placement: 'top', delay: 100 } : false)}
154
+ actions={[
155
+ { text: 'Edit', glyph: 'pencil' },
156
+ { text: 'Upload', glyph: 'upload', tooltip: 'Upload a new version, up to 20 MB' },
157
+ { text: 'Delete', glyph: 'trash', tooltip: { text: 'Kept in the bin for 30 days', placement: 'bottom' } },
158
+ { text: 'Save', glyph: 'save', tooltip: false }
159
+ ]}
160
+ />
161
+ </div>
162
+ </Stack>
163
+ );
164
+ }
165
+ ```
166
+
167
+ ## In a corner of the viewport
168
+
169
+ By default it is fixed to the bottom end corner of the viewport, `inset` away from the edges; `position` names another place. Switch it on here to see it over the page.
170
+
171
+ ```tsx
172
+ import { reactive } from '@motifx/core';
173
+ import { Button, SpeedDial, Stack } from '@motifx-community/ui';
174
+
175
+ /** A speed dial fixed to a corner of the viewport, shown while the switch is on; the corner and the fan's way can change. */
176
+ export default function Corner() {
177
+ const s = reactive({ on: false, position: 'bottom-end' as 'bottom-end' | 'bottom-start' | 'top-end' | 'top-start', told: '' });
178
+ return (
179
+ <Stack gap="sm" style="inline-size: 100%">
180
+ <Stack orientation="horizontal" wrap align="center">
181
+ <Button class="sd-corner-toggle" text="In the corner" variant="outline" toggle x-model={() => s.on} />
182
+ <Button text="Bottom end" variant="outline" onclick={() => (s.position = 'bottom-end')} />
183
+ <Button text="Bottom start" variant="outline" onclick={() => (s.position = 'bottom-start')} />
184
+ <Button text="Top end" variant="outline" onclick={() => (s.position = 'top-end')} />
185
+ <output class="sd-corner-told">{() => s.told}</output>
186
+ </Stack>
187
+ <SpeedDial
188
+ class="sd-corner"
189
+ visible={() => s.on}
190
+ position={() => s.position}
191
+ text="Create"
192
+ actions={[
193
+ { text: 'Document', glyph: 'file', click: () => (s.told = 'a document') },
194
+ { text: 'Folder', glyph: 'columns', click: () => (s.told = 'a folder') },
195
+ { text: 'Upload', glyph: 'upload', click: () => (s.told = 'an upload') }
196
+ ]}
197
+ />
198
+ </Stack>
199
+ );
200
+ }
201
+ ```
202
+
203
+ ## One action
204
+
205
+ With exactly one action shown, there is nothing to fan out: the main button takes the action’s glyph and name and does it itself. `extended` shows the name beside the glyph.
206
+
207
+ ```tsx
208
+ import { reactive } from '@motifx/core';
209
+ import { SpeedDial, Stack } from '@motifx-community/ui';
210
+
211
+ /** With one action shown, the main button does it itself and takes its glyph and name; `extended` shows the name beside the glyph. */
212
+ export default function Single() {
213
+ const s = reactive({ saved: 0 });
214
+ return (
215
+ <Stack gap="sm" style="inline-size: 100%">
216
+ <Stack orientation="horizontal" gap="lg" align="center">
217
+ <SpeedDial class="sd-single" position="inline" actions={[{ text: 'Save', glyph: 'save', click: () => s.saved++ }]} />
218
+ <SpeedDial class="sd-extended" position="inline" extended actions={[{ text: 'Save a copy', glyph: 'save', click: () => s.saved++ }]} />
219
+ </Stack>
220
+ <output class="sd-single-told">{() => `saved ${s.saved} times`}</output>
221
+ </Stack>
222
+ );
223
+ }
224
+ ```
225
+
226
+ ## Keyboard
227
+
228
+ | Key | What it does |
229
+ | --- | --- |
230
+ | `Tab` | The main button is the one stop; the actions are reached with the arrow keys. |
231
+ | `Arrow keys` | On the main button, the key along the actions opens them on the first (the other way, on the last); on the actions they move, around the ends. Up and Down for a line that stands, Left and Right for one that lies; around the button either pair, Down and Right forward along the circle. |
232
+ | `Home, End` | The first and the last action. |
233
+ | `Enter, Space` | Press the main button or the focused action. |
234
+ | `Escape` | Closes the actions and puts the focus back on the main button; so does a press outside, and Tab. While a tooltip is shown, the first Escape hides the tooltip. |
235
+
236
+ ## Accessibility
237
+
238
+ | Topic | How |
239
+ | --- | --- |
240
+ | `The main button` | A button named by `text` (“Actions” in the kit language) with `aria-haspopup="menu"` and `aria-expanded`; with one action shown it is that action, named by it. |
241
+ | `The actions` | A `menu` of `menuitem`s named by their labels; out of sight they are hidden from readers and keys (`inert`). |
242
+ | `Labels and glyphs` | The labels are shown beside the actions while open; the name is on the action either way. The glyphs are decorative. |
243
+ | `Tooltips` | The kit’s `Tooltip`: on keyboard focus too, dismissed with Escape, described with `aria-describedby`. A touch does not show one, so where the glyph alone does not say it on a touch screen, keep the labels on. |
244
+
245
+ ## Styling
246
+
247
+ | Hook | What it is |
248
+ | --- | --- |
249
+ | `.mx-speed-dial` | The speed dial. `data-layout`, `data-position`, `data-relative`, `data-direction`, `data-open`, `data-labels`, `data-extended`, `data-single`. |
250
+ | `.mx-speed-dial__main, .mx-speed-dial__main-glyph, .mx-speed-dial__main-text` | The main button, its glyph and its text. |
251
+ | `.mx-speed-dial__fan, .mx-speed-dial__action, .mx-speed-dial__action-icon, .mx-speed-dial__label` | The fan, an action (`aria-disabled`, `data-side`: where its label and tooltip go), its glyph or icon, its label. |
252
+
253
+ ### Component tokens
254
+
255
+ | Token | What it sets |
256
+ | --- | --- |
257
+ | `speed-dial.main, .main-glyph, .main-text, .action, .action-icon, .label, .fan` | Units: the main button (`hover`, `pressed`, `focus`, `open`, `extended`, `disabled`), its glyph (`open`) and text, an action (`hover`, `pressed`, `focus`, `disabled`), its glyph, the label, the fan. |
258
+ | `speed-dial.inset, .gap, .label-gap` | From the edges, between the buttons (around the button too: the radius keeps this gap), between an action and its label. |
259
+
260
+ ## API reference
261
+
262
+ ### Props
263
+
264
+ | Prop | Type | Default | Description |
265
+ | --- | --- | --- | --- |
266
+ | `actions` | `Bind<readonly SpeedDialAction[]>` | `[]` | The actions in order: `text`, `glyph` (of the kit’s set) or `icon` (yours), `tooltip`, `enabled`, `visible`, `click`, `key`, `data`. With one shown, the main button does it itself. |
267
+ | `glyph, openGlyph` | `Bind<string>` | `'plus'`, `'dismiss'` | The main button’s glyph, and its glyph while the actions are open. |
268
+ | `text` | `Bind<string>` | the kit’s “Actions” | What screen readers call the main button, and its text when `extended`. |
269
+ | `extended` | `Bind<boolean>` | `false` | The main button shows its `text` beside the glyph. |
270
+ | `layout` | `Bind<SpeedDialLayout>` | `'linear'` | `linear`, `circle`, `semi-circle` or `quarter-circle`: in a line from the main button, or around it. |
271
+ | `radius` | `Bind<number \| null>` | by itself | Around the button: pixels from its centre to the actions’ centres. By itself it is just enough to keep them apart. An `extended` main button is wider than this reckons with, so give it one. |
272
+ | `direction` | `Bind<SpeedDialDirection>` | into the page | `up`, `down`, `start`, `end` or a diagonal such as `up-start`: where the actions go, the middle of the arc around the button. A line takes the first word of a diagonal. By itself it is away from the edges `position` names, and `up` in the centre and inline. |
273
+ | `position` | `Bind<SpeedDialPosition>` | `'bottom-end'` | A corner (`bottom-end`, `bottom-start`, `top-end`, `top-start`), the middle of an edge (`top`, `bottom`, `start`, `end`), `center`, or `inline` in the flow. |
274
+ | `relativeTo` | `Bind<SpeedDialRelativeTo>` | `'viewport'` | What `position` is measured in: `viewport`, or `parent`, the nearest positioned parent. |
275
+ | `open` | `Bind<boolean>` | `false` | The actions are open. `x-model` binds it two-way. |
276
+ | `closeOnAction` | `Bind<boolean>` | `true` | A press on an action closes the fan. |
277
+ | `showLabels` | `Bind<boolean>` | in a line yes, around no | The actions’ labels are shown beside them while open. |
278
+ | `tooltip` | `Bind<boolean \| SpeedDialTooltip>` | while the labels are off | Tooltips on the actions, with their `text`. Options go to each `Tooltip` (`placement`, `delay`, `hideDelay`, `showOn`, `content`…). By default they open on the outer side after 200 ms. An action’s own `tooltip` wins: a text, options, or `false` for none. |
279
+
280
+ ### Events, properties and methods
281
+
282
+ | Member | Kind | Description |
283
+ | --- | --- | --- |
284
+ | `onOpened, onClosed` | event | The actions opened or closed (`byUser`). |
285
+ | `onActionClick` | event | An action was pressed (`index`, `action`); its own `click` runs first. |
286
+ | `isOpen` | read-only | The actions are open. |
287
+ | `single` | read-only | The one action shown, when there is exactly one; `null` otherwise. |
288
+ | `mainElement` | read-only | The main button. |
289
+ | `show(), close(), toggle()` | `void` | Opens or closes the actions. |
290
+ | `refresh()` | `void` | Reads the actions again after they were changed in place. |
@@ -0,0 +1,204 @@
1
+ # Splitter
2
+
3
+ > Navigation · @motifx-community/ui 0.1.0-beta.3
4
+
5
+ Panes side by side or one under the other, as many as needed, with a handle between each two that the pointer drags and the keys move. A handle resizes the two panes beside it; a pane may be hidden from its handle, and may hold another splitter. For two panes with one fixed, see [SplitContainer](layout.md).
6
+
7
+ ## Import
8
+
9
+ ```tsx
10
+ import { Splitter, SplitPane } from '@motifx-community/ui';
11
+ ```
12
+
13
+ ## Pixels, shares and the rest
14
+
15
+ Each `SplitPane` says its `size`: pixels stay pixels when the splitter changes size, a share (`'30%'`) divides the room the shares get, and a pane without a size takes an equal part of what is left. `minSize` and `maxSize` hold the handles. Drag a handle, or focus it and use the arrow keys, Home and End.
16
+
17
+ ```tsx
18
+ import { SplitPane, Splitter } from '@motifx-community/ui';
19
+
20
+ /** Three panes: a fixed one in pixels with a least size, one that takes what is left, and a share. */
21
+ export default function Basic() {
22
+ return (
23
+ <Splitter class="sp-basic" style="block-size: 240px">
24
+ <SplitPane size={220} minSize={140} padding="md" text="Folders">
25
+ <p class="sp-note">Folders, 220 px to start, never under 140.</p>
26
+ </SplitPane>
27
+ <SplitPane minSize={120} padding="md" text="Messages">
28
+ <p class="sp-note">Messages take what the others leave.</p>
29
+ </SplitPane>
30
+ <SplitPane size="30%" minSize={100} padding="md" text="Preview">
31
+ <p class="sp-note">Preview, three tenths of the room the shares divide.</p>
32
+ </SplitPane>
33
+ </Splitter>
34
+ );
35
+ }
36
+ ```
37
+
38
+ ## Hiding a pane
39
+
40
+ A `collapsible` pane gets a button on the handle next to it; Enter on the handle and a double press do the same. The neighbours take its room, and it comes back where it was. `onCollapsing` may refuse, `onCollapsed` tells.
41
+
42
+ ```tsx
43
+ import { reactive } from '@motifx/core';
44
+ import { SplitPane, Splitter, Stack } from '@motifx-community/ui';
45
+
46
+ /** The side panes can be hidden: a button on the handle, Enter on it, or a double press; the middle one cannot. */
47
+ export default function Collapsible() {
48
+ const s = reactive({ told: '' });
49
+ return (
50
+ <Stack gap="sm" style="inline-size: 100%">
51
+ <Splitter class="sp-fold" style="block-size: 200px" onCollapsed={e => (s.told = `${e.pane.text} ${e.collapsed ? 'hidden' : 'shown'}`)}>
52
+ <SplitPane size={180} minSize={120} collapsible padding="md" text="Tree">
53
+ <p class="sp-note">Tree</p>
54
+ </SplitPane>
55
+ <SplitPane minSize={160} padding="md" text="Page">
56
+ <p class="sp-note">Page</p>
57
+ </SplitPane>
58
+ <SplitPane size={200} minSize={120} collapsible padding="md" text="Properties">
59
+ <p class="sp-note">Properties</p>
60
+ </SplitPane>
61
+ </Splitter>
62
+ <output class="sp-fold-told">{() => s.told}</output>
63
+ </Stack>
64
+ );
65
+ }
66
+ ```
67
+
68
+ ## One inside another
69
+
70
+ A pane is a `Panel`: put a `Splitter` of the other `orientation` in it for an editor over an output, next to a tree.
71
+
72
+ ```tsx
73
+ import { SplitPane, Splitter } from '@motifx-community/ui';
74
+
75
+ /** A pane may hold another splitter: here the right pane is split the other way. */
76
+ export default function Nested() {
77
+ return (
78
+ <Splitter class="sp-nested" style="block-size: 260px">
79
+ <SplitPane size={200} minSize={120} padding="md" text="Navigation">
80
+ <p class="sp-note">Navigation</p>
81
+ </SplitPane>
82
+ <SplitPane minSize={200}>
83
+ <Splitter class="sp-inner" orientation="vertical">
84
+ <SplitPane minSize={80} padding="md" text="Editor">
85
+ <p class="sp-note">Editor</p>
86
+ </SplitPane>
87
+ <SplitPane size={90} minSize={60} collapsible padding="md" text="Output">
88
+ <p class="sp-note">Output</p>
89
+ </SplitPane>
90
+ </Splitter>
91
+ </SplitPane>
92
+ </Splitter>
93
+ );
94
+ }
95
+ ```
96
+
97
+ ## Keeping the layout
98
+
99
+ After every move the panes’ pixels are written to `x-model` (and `onResized` tells). Give them back as `sizes` to restore a layout; `null` starts from the panes’ own sizes again.
100
+
101
+ ```tsx
102
+ import { reactive } from '@motifx/core';
103
+ import { Button, SplitPane, Splitter, Stack } from '@motifx-community/ui';
104
+
105
+ /** The sizes go out to x-model as pixels after every move, and come back: a layout kept and restored. */
106
+ export default function Sizes() {
107
+ const s = reactive({ sizes: null as readonly (number | string | null)[] | null, kept: null as readonly number[] | null, moved: 0 });
108
+ return (
109
+ <Stack gap="sm" style="inline-size: 100%">
110
+ <Splitter class="sp-sizes" style="block-size: 180px" x-model={() => s.sizes} onResized={() => s.moved++}>
111
+ <SplitPane size={160} minSize={80} padding="md" text="Left">
112
+ <p class="sp-note">Left</p>
113
+ </SplitPane>
114
+ <SplitPane minSize={80} padding="md" text="Middle">
115
+ <p class="sp-note">Middle</p>
116
+ </SplitPane>
117
+ <SplitPane size={160} minSize={80} padding="md" text="Right">
118
+ <p class="sp-note">Right</p>
119
+ </SplitPane>
120
+ </Splitter>
121
+ <Stack orientation="horizontal" wrap align="center">
122
+ <Button text="Keep this layout" variant="outline" onclick={() => (s.kept = (s.sizes as number[] | null)?.slice() ?? null)} />
123
+ <Button text="Restore it" variant="outline" enabled={() => !!s.kept} onclick={() => (s.sizes = s.kept)} />
124
+ <Button text="Start again" variant="outline" onclick={() => (s.sizes = null)} />
125
+ <output class="sp-sizes-told">{() => `sizes: ${JSON.stringify(s.sizes)}, moved ${s.moved} times`}</output>
126
+ </Stack>
127
+ </Stack>
128
+ );
129
+ }
130
+ ```
131
+
132
+ ## Keyboard
133
+
134
+ | Key | What it does |
135
+ | --- | --- |
136
+ | `Tab` | Each handle that can move or hide a pane is a stop, between the panes it lies between. |
137
+ | `Arrow keys` | Left and Right (Up and Down one under the other) move the handle by `step` pixels, within the panes’ least and most sizes; the other way round in a right-to-left page. |
138
+ | `Home, End` | Give the pane before the handle its least, or its most. |
139
+ | `Enter` | Hides the pane before the handle, or shows it again; when that pane cannot be hidden, the one after. |
140
+
141
+ ## Accessibility
142
+
143
+ | Topic | How |
144
+ | --- | --- |
145
+ | `A handle` | A `separator` named “Resize” in the kit language, with `aria-controls` on the pane before it, `aria-orientation`, and `aria-valuenow` as that pane’s share of the two beside the handle. |
146
+ | `Fold buttons` | Buttons named “Hide the pane” and “Show the pane”, out of the Tab order: Enter on the handle does the same. |
147
+ | `A hidden pane` | Out of sight and `inert`; focus inside it moves to the handle. |
148
+ | `Panes` | A pane with a `text` is a `region` of that name. |
149
+
150
+ ## Styling
151
+
152
+ | Hook | What it is |
153
+ | --- | --- |
154
+ | `.mx-splitter` | The splitter. `data-orientation`, `data-dragging` while a handle is dragged. |
155
+ | `.mx-splitter__pane` | A pane (a `Panel`). `data-collapsed` while hidden. |
156
+ | `.mx-splitter__handle` | A handle. `data-resizable`, `data-dragging`. |
157
+ | `.mx-splitter__grip, .mx-splitter__fold, .mx-splitter__fold-glyph` | The grip in the middle of a handle, the fold buttons at either end of it (`data-side`), their arrows. |
158
+
159
+ ### Component tokens
160
+
161
+ | Token | What it sets |
162
+ | --- | --- |
163
+ | `splitter.handle, .line, .grip, .fold, .fold-glyph, .pane` | Units: the handle (`focus`), the line along it (`active`, `disabled`), the grip (`active`, `disabled`), the fold buttons (`hover`, `pressed`, `focus`) and their arrows, a pane (`collapsed`). |
164
+ | `splitter.size, .line-width, .active-width, .grip-length, .grip-thickness` | The handle’s thickness, the line’s, the line’s under the pointer, the grip’s size. |
165
+
166
+ ## API reference
167
+
168
+ ### Splitter props
169
+
170
+ | Prop | Type | Default | Description |
171
+ | --- | --- | --- | --- |
172
+ | `orientation` | `Bind<LayoutOrientation>` | `'horizontal'` | `horizontal`: the panes side by side; `vertical`: one under the other. |
173
+ | `resizable` | `Bind<boolean>` | `true` | The handles can be dragged and moved with the keys (a pane’s own `resizable` wins). |
174
+ | `collapsible` | `Bind<boolean>` | `false` | Every pane can be hidden from the handle next to it (a pane’s own `collapsible` wins). |
175
+ | `step` | `Bind<number>` | `10` | Pixels an arrow key moves a handle. |
176
+ | `sizes` | `Bind<readonly (number \| string \| null)[] \| null>` | `null` | The panes’ sizes in pane order (pixels, a share or `null`); given, they take the place of the panes’ own `size`. After a drag or a key the pixels are written to `x-model`. |
177
+
178
+ ### SplitPane props
179
+
180
+ | Prop | Type | Default | Description |
181
+ | --- | --- | --- | --- |
182
+ | `size` | `Bind<number \| string \| null>` | `null` | Pixels, a share (`'30%'`) of the room the shares divide, or `null` for an equal share of what is left. |
183
+ | `minSize, maxSize` | `Bind<number>`, `Bind<number \| null>` | `0`, `null` | The least and the most it gets, in pixels. |
184
+ | `collapsible` | `Bind<boolean \| undefined>` | `undefined` | The handles next to it can hide it; `undefined` follows the splitter. |
185
+ | `collapsed` | `Bind<boolean>` | `false` | Hidden, the neighbours taking its room. |
186
+ | `resizable` | `Bind<boolean>` | `true` | The handles next to it can change its size. |
187
+ | `key` | `Bind<string>` | `''` | Names the pane; the JSX `key` is read too. |
188
+ | `content` | `() => ComponentBase \| ComponentBase[]` | — | Content made with the pane, besides the JSX children. |
189
+ | `padding, scrollable, variant, text` | as `Panel` | | A pane is a `Panel`: its padding, its own scrolling, a frame, a name (a region). |
190
+
191
+ ### Events, properties and methods
192
+
193
+ | Member | Kind | Description |
194
+ | --- | --- | --- |
195
+ | `onResizing` | event | A handle is being dragged (`handle`, `sizes` in pixels). |
196
+ | `onResized` | event | A drag ended or a key moved a handle (`handle`, `sizes`). |
197
+ | `onCollapsing` | event | A pane is about to be hidden or shown again (`pane`, `index`, `collapsed`, `byUser`); `cancel = true` leaves it. |
198
+ | `onCollapsed` | event | A pane was hidden or shown again. |
199
+ | `panes` | read-only | The panes in order, hidden ones too. |
200
+ | `currentSizes` | read-only | The panes’ pixels along the split now; 0 for a hidden pane. |
201
+ | `count` | read-only | How many panes there are. |
202
+ | `add(pane), insert(index, pane)` | `SplitPane` | Adds a pane at the end or at an index. |
203
+ | `remove(pane)` | `boolean` | Removes a pane and disposes it. |
204
+ | `collapse(pane), expand(pane)` | `boolean` | Hides a pane (by index or the pane itself), or shows it again; `onCollapsing` is asked first. A pane’s own `collapse()` and `expand()` do the same. |