@motifx-community/ui 0.1.0-beta.5 → 0.1.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/README.md +7 -4
  3. package/dist/components/appbar/AppBar.d.ts +88 -0
  4. package/dist/components/appbar/app-bar-navigation-click-event-args.d.ts +9 -0
  5. package/dist/components/appbar/app-bar-navigation.d.ts +2 -0
  6. package/dist/components/appbar/app-bar-position.d.ts +2 -0
  7. package/dist/components/appbar/app-bar-props.d.ts +49 -0
  8. package/dist/components/appbar/app-bar-scroll-behavior.d.ts +2 -0
  9. package/dist/components/appbar/app-bar-title-align.d.ts +2 -0
  10. package/dist/components/appbar/app-bar-tone.d.ts +2 -0
  11. package/dist/components/appbar/index.d.ts +8 -0
  12. package/dist/components/barcode/Barcode.d.ts +62 -0
  13. package/dist/components/barcode/barcode-export-options.d.ts +9 -0
  14. package/dist/components/barcode/barcode-failed-event-args.d.ts +9 -0
  15. package/dist/components/barcode/barcode-props.d.ts +25 -0
  16. package/dist/components/barcode/index.d.ts +5 -0
  17. package/dist/components/bargauge/BarGauge.d.ts +120 -0
  18. package/dist/components/bargauge/bar-gauge-props.d.ts +38 -0
  19. package/dist/components/bargauge/index.d.ts +2 -0
  20. package/dist/components/bottomnavigation/BottomNavigation.d.ts +101 -0
  21. package/dist/components/bottomnavigation/bottom-navigation-item-click-event-args.d.ts +9 -0
  22. package/dist/components/bottomnavigation/bottom-navigation-item.d.ts +35 -0
  23. package/dist/components/bottomnavigation/bottom-navigation-label-mode.d.ts +2 -0
  24. package/dist/components/bottomnavigation/bottom-navigation-position.d.ts +2 -0
  25. package/dist/components/bottomnavigation/bottom-navigation-props.d.ts +31 -0
  26. package/dist/components/bottomnavigation/bottom-navigation-selecting-event-args.d.ts +5 -0
  27. package/dist/components/bottomnavigation/bottom-navigation-selection-changed-event-args.d.ts +11 -0
  28. package/dist/components/bottomnavigation/index.d.ts +8 -0
  29. package/dist/components/chart/Chart.d.ts +229 -0
  30. package/dist/components/chart/ChartLegend.d.ts +24 -0
  31. package/dist/components/chart/ChartPlot.d.ts +161 -0
  32. package/dist/components/chart/ChartTable.d.ts +68 -0
  33. package/dist/components/chart/ChartTooltip.d.ts +22 -0
  34. package/dist/components/chart/PartsPlot.d.ts +39 -0
  35. package/dist/components/chart/RadarPlot.d.ts +34 -0
  36. package/dist/components/chart/chart-axis-kind.d.ts +2 -0
  37. package/dist/components/chart/chart-axis.d.ts +31 -0
  38. package/dist/components/chart/chart-data-error-event-args.d.ts +7 -0
  39. package/dist/components/chart/chart-export-options.d.ts +7 -0
  40. package/dist/components/chart/chart-export.d.ts +12 -0
  41. package/dist/components/chart/chart-field.d.ts +2 -0
  42. package/dist/components/chart/chart-labels.d.ts +2 -0
  43. package/dist/components/chart/chart-legend-options.d.ts +10 -0
  44. package/dist/components/chart/chart-legend-position.d.ts +2 -0
  45. package/dist/components/chart/chart-look.d.ts +25 -0
  46. package/dist/components/chart/chart-mode-changed-event-args.d.ts +7 -0
  47. package/dist/components/chart/chart-mode.d.ts +2 -0
  48. package/dist/components/chart/chart-model.d.ts +105 -0
  49. package/dist/components/chart/chart-point-event-args.d.ts +9 -0
  50. package/dist/components/chart/chart-point-selection.d.ts +2 -0
  51. package/dist/components/chart/chart-point.d.ts +23 -0
  52. package/dist/components/chart/chart-props.d.ts +76 -0
  53. package/dist/components/chart/chart-reference.d.ts +12 -0
  54. package/dist/components/chart/chart-selection-changed-event-args.d.ts +8 -0
  55. package/dist/components/chart/chart-series-toggled-event-args.d.ts +10 -0
  56. package/dist/components/chart/chart-series-type.d.ts +6 -0
  57. package/dist/components/chart/chart-series.d.ts +55 -0
  58. package/dist/components/chart/chart-stacked.d.ts +2 -0
  59. package/dist/components/chart/chart-tooltip-context.d.ts +10 -0
  60. package/dist/components/chart/chart-tooltip-options.d.ts +10 -0
  61. package/dist/components/chart/chart-zoom-changed-event-args.d.ts +8 -0
  62. package/dist/components/chart/index.d.ts +21 -0
  63. package/dist/components/chart/legend-entry.d.ts +13 -0
  64. package/dist/components/chart/plot-text.d.ts +10 -0
  65. package/dist/components/chart/plot-view.d.ts +61 -0
  66. package/dist/components/datagrid/grid-settings.d.ts +3 -3
  67. package/dist/components/datagrid/model/GridData.d.ts +22 -3
  68. package/dist/components/gauge/Gauge.d.ts +179 -0
  69. package/dist/components/gauge/gauge-mark.d.ts +9 -0
  70. package/dist/components/gauge/gauge-marker.d.ts +2 -0
  71. package/dist/components/gauge/gauge-needle-shape.d.ts +2 -0
  72. package/dist/components/gauge/gauge-orientation.d.ts +2 -0
  73. package/dist/components/gauge/gauge-props.d.ts +58 -0
  74. package/dist/components/gauge/gauge-range.d.ts +11 -0
  75. package/dist/components/gauge/gauge-scale.d.ts +2 -0
  76. package/dist/components/gauge/gauge-shape.d.ts +43 -0
  77. package/dist/components/gauge/gauge-type.d.ts +2 -0
  78. package/dist/components/gauge/index.d.ts +9 -0
  79. package/dist/components/otpinput/OtpInput.d.ts +73 -0
  80. package/dist/components/otpinput/index.d.ts +4 -0
  81. package/dist/components/otpinput/otp-charset.d.ts +2 -0
  82. package/dist/components/otpinput/otp-completed-event-args.d.ts +8 -0
  83. package/dist/components/otpinput/otp-input-props.d.ts +32 -0
  84. package/dist/components/qrcode/QRCode.d.ts +58 -0
  85. package/dist/components/qrcode/index.d.ts +5 -0
  86. package/dist/components/qrcode/qr-code-export-options.d.ts +9 -0
  87. package/dist/components/qrcode/qr-code-failed-event-args.d.ts +7 -0
  88. package/dist/components/qrcode/qr-code-props.d.ts +23 -0
  89. package/dist/components/signature/Signature.d.ts +100 -0
  90. package/dist/components/signature/index.d.ts +5 -0
  91. package/dist/components/signature/signature-draw.d.ts +15 -0
  92. package/dist/components/signature/signature-export-options.d.ts +11 -0
  93. package/dist/components/signature/signature-props.d.ts +30 -0
  94. package/dist/components/signature/signature-stroke-event-args.d.ts +9 -0
  95. package/dist/components/signature/signature-stroke.d.ts +11 -0
  96. package/dist/components/sparkline/Sparkline.d.ts +85 -0
  97. package/dist/components/sparkline/index.d.ts +4 -0
  98. package/dist/components/sparkline/sparkline-highlight.d.ts +2 -0
  99. package/dist/components/sparkline/sparkline-props.d.ts +34 -0
  100. package/dist/components/sparkline/sparkline-type.d.ts +2 -0
  101. package/dist/components/validationsummary/ValidationSummary.d.ts +1 -0
  102. package/dist/core/fonts-loaded.d.ts +2 -0
  103. package/dist/core/scroll-watch.d.ts +13 -0
  104. package/dist/core/ui-strings.d.ts +38 -0
  105. package/dist/generated/tokens.d.ts +3023 -863
  106. package/dist/index.d.ts +10 -0
  107. package/dist/index.js +55999 -47313
  108. package/dist/index.js.map +1 -1
  109. package/dist/locales/en.json +37 -1
  110. package/dist/locales/tr.json +37 -1
  111. package/dist/parts/chart/chart-paths.d.ts +30 -0
  112. package/dist/parts/chart/chart-scale.d.ts +13 -0
  113. package/dist/parts/chart/chart-text.d.ts +12 -0
  114. package/dist/parts/chart/nice-ticks.d.ts +6 -0
  115. package/dist/parts/chart/svg-parts.d.ts +12 -0
  116. package/dist/parts/chart/thin-out.d.ts +6 -0
  117. package/dist/parts/chart/time-ticks.d.ts +7 -0
  118. package/dist/parts/chart/token-lengths.d.ts +16 -0
  119. package/dist/parts/chart/value-motion.d.ts +16 -0
  120. package/dist/parts/code/barcode-encode.d.ts +23 -0
  121. package/dist/parts/code/code-image.d.ts +35 -0
  122. package/dist/parts/code/qr-encode.d.ts +10 -0
  123. package/dist/parts/field/Field.d.ts +2 -0
  124. package/dist/styles.css +3043 -9
  125. package/dist/tokens/index.d.ts +3212 -967
  126. package/dist/tokens/index.js +3023 -863
  127. package/dist/tokens/index.js.map +1 -1
  128. package/dist/{tr-C5IXRzAH.js → tr-DhIFcH3c.js} +75 -3
  129. package/dist/{tr-C5IXRzAH.js.map → tr-DhIFcH3c.js.map} +1 -1
  130. package/docs/accordion.md +1 -1
  131. package/docs/actionsheet.md +1 -1
  132. package/docs/appbar.md +194 -0
  133. package/docs/avatar.md +1 -1
  134. package/docs/badge.md +1 -1
  135. package/docs/bar-gauge-angles.md +87 -0
  136. package/docs/bar-gauge-data.md +122 -0
  137. package/docs/bar-gauge-labels.md +78 -0
  138. package/docs/bar-gauge.md +98 -0
  139. package/docs/barcode.md +193 -0
  140. package/docs/bottomnavigation.md +258 -0
  141. package/docs/bottomsheet.md +1 -1
  142. package/docs/breadcrumb.md +1 -1
  143. package/docs/button.md +1 -1
  144. package/docs/buttongroup.md +1 -1
  145. package/docs/buttons.md +169 -0
  146. package/docs/calendar.md +1 -1
  147. package/docs/card.md +1 -1
  148. package/docs/chart-bars.md +142 -0
  149. package/docs/chart-candles.md +164 -0
  150. package/docs/chart-funnel.md +115 -0
  151. package/docs/chart-heatmap.md +93 -0
  152. package/docs/chart-lines.md +128 -0
  153. package/docs/chart-live.md +62 -0
  154. package/docs/chart-pie.md +125 -0
  155. package/docs/chart-radar.md +124 -0
  156. package/docs/chart-ranges.md +127 -0
  157. package/docs/chart-references.md +126 -0
  158. package/docs/chart-scatter.md +139 -0
  159. package/docs/chart-waterfall.md +111 -0
  160. package/docs/chart-zoom.md +95 -0
  161. package/docs/chart.md +427 -0
  162. package/docs/checkbox.md +1 -1
  163. package/docs/chip.md +1 -1
  164. package/docs/choice.md +151 -0
  165. package/docs/colorbox.md +1 -1
  166. package/docs/combobox.md +1 -1
  167. package/docs/control.md +1 -1
  168. package/docs/data.md +127 -0
  169. package/docs/datagrid-api.md +1 -1
  170. package/docs/datagrid-bands.md +1 -1
  171. package/docs/datagrid-drag-select.md +1 -1
  172. package/docs/datagrid-drag.md +1 -1
  173. package/docs/datagrid-editing.md +1 -1
  174. package/docs/datagrid-filtering.md +1 -1
  175. package/docs/datagrid-forms.md +1 -1
  176. package/docs/datagrid-grouping.md +62 -2
  177. package/docs/datagrid-layout.md +2 -2
  178. package/docs/datagrid-lookups.md +1 -1
  179. package/docs/datagrid-master-detail.md +1 -1
  180. package/docs/datagrid-scrolling.md +1 -1
  181. package/docs/datagrid-selection.md +1 -1
  182. package/docs/datagrid.md +1 -1
  183. package/docs/datebox.md +1 -1
  184. package/docs/daterangebox.md +1 -1
  185. package/docs/display.md +148 -0
  186. package/docs/draggable.md +1 -1
  187. package/docs/drawer.md +1 -1
  188. package/docs/dropdown.md +1 -1
  189. package/docs/editors.md +157 -0
  190. package/docs/feedback.md +138 -0
  191. package/docs/fileuploader.md +1 -1
  192. package/docs/filterbuilder.md +1 -1
  193. package/docs/formlayout.md +1 -1
  194. package/docs/foundations.md +79 -0
  195. package/docs/gallery.md +1 -1
  196. package/docs/gauge-base.md +78 -0
  197. package/docs/gauge-circular.md +101 -0
  198. package/docs/gauge-dashboards.md +134 -0
  199. package/docs/gauge-linear.md +84 -0
  200. package/docs/gauge-markers.md +135 -0
  201. package/docs/gauge-marks.md +108 -0
  202. package/docs/gauge-ranges.md +133 -0
  203. package/docs/gauge-scales.md +117 -0
  204. package/docs/gauge.md +152 -0
  205. package/docs/home.md +1 -1
  206. package/docs/keyboard.md +1 -1
  207. package/docs/language.md +1 -1
  208. package/docs/layout.md +1 -1
  209. package/docs/listbox.md +1 -1
  210. package/docs/loadpanel.md +1 -1
  211. package/docs/lookup.md +1 -1
  212. package/docs/menus.md +1 -1
  213. package/docs/multiview.md +1 -1
  214. package/docs/navigation.md +143 -0
  215. package/docs/numberbox.md +1 -1
  216. package/docs/otpinput.md +197 -0
  217. package/docs/pagination.md +1 -1
  218. package/docs/popover.md +1 -1
  219. package/docs/progress.md +1 -1
  220. package/docs/qrcode.md +179 -0
  221. package/docs/radiogroup.md +1 -1
  222. package/docs/rating.md +1 -1
  223. package/docs/resizable.md +1 -1
  224. package/docs/scheduler-agenda.md +1 -1
  225. package/docs/scheduler-big-data.md +1 -1
  226. package/docs/scheduler-editing.md +1 -1
  227. package/docs/scheduler-form.md +1 -1
  228. package/docs/scheduler-icalendar.md +1 -1
  229. package/docs/scheduler-mobile.md +1 -1
  230. package/docs/scheduler-recurrence.md +1 -1
  231. package/docs/scheduler-resources.md +1 -1
  232. package/docs/scheduler-timeline.md +1 -1
  233. package/docs/scheduler.md +1 -1
  234. package/docs/scrollview.md +1 -1
  235. package/docs/showcase-home.md +31 -0
  236. package/docs/showcase.md +1 -1
  237. package/docs/signature.md +208 -0
  238. package/docs/skeleton.md +1 -1
  239. package/docs/slider.md +1 -1
  240. package/docs/sortable.md +1 -1
  241. package/docs/sparkline.md +119 -0
  242. package/docs/speeddial.md +1 -1
  243. package/docs/splitter.md +1 -1
  244. package/docs/stepper.md +1 -1
  245. package/docs/switch.md +1 -1
  246. package/docs/tabdocs-dock.md +1 -1
  247. package/docs/tabdocs-drag.md +1 -1
  248. package/docs/tabdocs-menus.md +1 -1
  249. package/docs/tabdocs-mobile.md +1 -1
  250. package/docs/tabdocs-tabs.md +1 -1
  251. package/docs/tabdocs-windows.md +1 -1
  252. package/docs/tabdocs-workspace.md +1 -1
  253. package/docs/tabdocs.md +1 -1
  254. package/docs/tabs.md +1 -1
  255. package/docs/tagbox.md +1 -1
  256. package/docs/textarea.md +1 -1
  257. package/docs/textbox.md +1 -1
  258. package/docs/tileview.md +1 -1
  259. package/docs/timeline.md +1 -1
  260. package/docs/toast.md +1 -1
  261. package/docs/tokens.md +450 -1
  262. package/docs/toolbar.md +1 -1
  263. package/docs/tooltip.md +1 -1
  264. package/docs/treeview.md +1 -1
  265. package/docs/validationsummary.md +1 -1
  266. package/docs/window.md +1 -1
  267. package/docs/wizard.md +1 -1
  268. package/llms-full.txt +6724 -98
  269. package/llms.txt +50 -1
  270. package/package.json +5 -5
@@ -0,0 +1,208 @@
1
+ # Signature
2
+
3
+ > Editors · @motifx-community/ui 0.1.0-beta.6
4
+
5
+ A pad to sign on with a pen, a finger or a mouse. The value is the strokes themselves, so a signature can be stored as data, drawn again at any size and exported as an image.
6
+
7
+ ## Import
8
+
9
+ ```tsx
10
+ import { Signature } from '@motifx-community/ui';
11
+ ```
12
+
13
+ ## Signing
14
+
15
+ `x-model` binds the strokes. A pen that reports pressure sets the width of the line, and otherwise it follows the speed. The buttons in the corner remove the last stroke and the whole signature.
16
+
17
+ ```tsx
18
+ import { reactive } from '@motifx/core';
19
+ import { Signature, Stack, type SignatureStroke } from '@motifx-community/ui';
20
+
21
+ /** A pad bound to a value. The value is the strokes themselves, so it can be stored and drawn again. */
22
+ export default function Basic() {
23
+ const s = reactive({ strokes: [] as readonly SignatureStroke[] });
24
+ return (
25
+ <Stack gap="md" style="inline-size: 100%">
26
+ <Signature class="sig-basic" label="Your signature" helpText="Sign with a pen, a finger or the mouse." x-model={() => s.strokes} />
27
+ <output class="sig-told">{() => `Strokes: ${s.strokes.length}`}</output>
28
+ </Stack>
29
+ );
30
+ }
31
+ ```
32
+
33
+ ## Creating an image
34
+
35
+ `toDataURL()`, `toBlob()` and `toSVG()` give an image. It is drawn in black so that it does not depend on the theme, and the background is transparent unless you set one.
36
+
37
+ ```tsx
38
+ import { reactive } from '@motifx/core';
39
+ import { Button, Signature, Stack } from '@motifx-community/ui';
40
+
41
+ /** An image of the signature. It is drawn in black on a transparent background unless told otherwise. */
42
+ export default function Export() {
43
+ const s = reactive({ image: '' });
44
+ let pad!: Signature;
45
+ return (
46
+ <Stack gap="md" style="inline-size: 100%">
47
+ <Signature ref={(x: Signature) => (pad = x)} class="sig-export" label="Sign to create an image" />
48
+ <Button text="Create the image" variant="outline" onclick={() => (s.image = pad.toDataURL('image/png', { background: '#ffffff', width: 420 }))} />
49
+ {s.image && <img class="sig-image" alt="The signature as an image" src={() => s.image} style="max-inline-size: 100%; border: 1px solid var(--mx-color-stroke-divider)" />}
50
+ </Stack>
51
+ );
52
+ }
53
+ ```
54
+
55
+ ## The pen and the pad
56
+
57
+ `penColor`, `minWidth` and `maxWidth` set the pen, and `height` the pad. `showGuide`, `showClear`, `showUndo` and `placeholder` turn its parts on and off.
58
+
59
+ ```tsx
60
+ import { Signature, Stack } from '@motifx-community/ui';
61
+
62
+ /** The pen, the size of the pad and which parts it shows. */
63
+ export default function Options() {
64
+ return (
65
+ <Stack gap="lg" style="inline-size: 100%">
66
+ <Signature class="sig-pen" label="A thick blue pen" penColor="#1d4ed8" minWidth={2} maxWidth={6} height={120} />
67
+ <Signature class="sig-plain" label="Only the pad" showGuide={false} showClear={false} showUndo={false} placeholder="" height={120} />
68
+ </Stack>
69
+ );
70
+ }
71
+ ```
72
+
73
+ ## Saved signatures and states
74
+
75
+ Giving the stored strokes as `value` draws the signature again. `required`, `readOnly` and `enabled` work as in every field.
76
+
77
+ ```tsx
78
+ import { Button, Signature, Stack, type SignatureStroke } from '@motifx-community/ui';
79
+
80
+ const SAVED: readonly SignatureStroke[] = [
81
+ {
82
+ points: Array.from({ length: 40 }, (_, i) => ({
83
+ x: 0.12 + (i / 39) * 0.76,
84
+ y: 0.5 + Math.sin(i / 3) * 0.2 * (1 - i / 60),
85
+ pressure: 0.3 + (i % 8) / 12
86
+ }))
87
+ }
88
+ ];
89
+
90
+ /** A saved signature drawn again, a required field, and a pad that cannot be changed. */
91
+ export default function States() {
92
+ let pad!: Signature;
93
+ return (
94
+ <Stack gap="lg" style="inline-size: 100%">
95
+ <Signature class="sig-saved" label="Saved signature" value={SAVED} height={120} readOnly />
96
+ <Signature ref={(x: Signature) => (pad = x)} class="sig-required" label="Required" required height={120} />
97
+ <Button text="Validate" variant="outline" onclick={() => void pad.validate()} />
98
+ <Signature class="sig-disabled" label="Disabled" enabled={false} height={100} />
99
+ </Stack>
100
+ );
101
+ }
102
+ ```
103
+
104
+ ## Programmatic use
105
+
106
+ `new Signature(props)` creates the pad without JSX. Each prop is also a property.
107
+
108
+ ```tsx
109
+ import { Component } from '@motifx/core';
110
+ import { Button, Signature, Stack } from '@motifx-community/ui';
111
+
112
+ /** A pad created programmatically. `undo()` and `clear()` do what its buttons do. */
113
+ export default class Programmatic extends Component<HTMLDivElement> {
114
+ constructor() {
115
+ super('div');
116
+ const pad = new Signature({ label: 'Programmatic signature', height: 120, showUndo: false, showClear: false });
117
+ const clear = new Button({ text: 'Clear', variant: 'outline', onclick: () => pad.clear() });
118
+ const stack = new Stack({ gap: 'md' });
119
+ stack.controls.add(pad, clear);
120
+ this.controls.add(stack);
121
+ }
122
+ }
123
+ ```
124
+
125
+ ## API reference
126
+
127
+ ### Props
128
+
129
+ | Prop | Type | Default | Description |
130
+ | --- | --- | --- | --- |
131
+ | `height` | `Bind<number \| null>` | From the design language | The height of the pad in pixels. |
132
+ | `penColor` | `Bind<string \| null>` | From the design language | The color of the lines. |
133
+ | `minWidth, maxWidth` | `Bind<number>` | `1`, `3` | The width of a line at its thinnest and thickest, in pixels. |
134
+ | `placeholder` | `Bind<string>` | The kit string “Sign here” | The text of the empty pad. `''` removes it. |
135
+ | `showGuide` | `Bind<boolean>` | `true` | Draws the line to sign on. |
136
+ | `showClear, showUndo` | `Bind<boolean>` | `true` | Show the buttons that remove the signature and the last stroke. |
137
+ | `label, helpText, readOnly, required, rules, error, validateOn` | | | Same as `TextBox`. |
138
+
139
+ ### Properties and methods
140
+
141
+ | Member | Type | Description |
142
+ | --- | --- | --- |
143
+ | `value` | `readonly SignatureStroke[]` | The strokes. `x-model` provides two-way binding. |
144
+ | `isEmpty` | `boolean` | Indicates that nothing has been signed. |
145
+ | `clear()` | `void` | Removes the signature. |
146
+ | `undo()` | `void` | Removes the last stroke. |
147
+ | `toDataURL(type?, options?)` | `string` | The signature as a data URL, a PNG by default. |
148
+ | `toBlob(type?, options?)` | `Promise<Blob \| null>` | The signature as an image file, a PNG by default. |
149
+ | `toSVG(options?)` | `string` | The signature as an SVG document. |
150
+
151
+ ### Image options
152
+
153
+ | Prop | Type | Default | Description |
154
+ | --- | --- | --- | --- |
155
+ | `width, height` | `number` | Twice the pad | The size of the image in pixels. The height keeps the shape of the pad. |
156
+ | `color` | `string` | `'#000000'` | The color of the lines, which does not depend on the theme. |
157
+ | `background` | `string` | Transparent | The background. |
158
+
159
+ ### Types
160
+
161
+ | Member | Type | Description |
162
+ | --- | --- | --- |
163
+ | `SignatureStroke` | `{ points: readonly SignaturePoint[] }` | One line drawn without lifting the pen. |
164
+ | `SignaturePoint` | `{ x, y, pressure }` | `x` and `y` run from `0` to `1` across the pad, so a signature fits a pad of any size. `pressure` runs from `0` to `1`. |
165
+
166
+ ### Events
167
+
168
+ | Event | Type | Description |
169
+ | --- | --- | --- |
170
+ | `onStrokeBegan` | `{ stroke, originalEvent, source }` | Occurs when the pen touches the pad. |
171
+ | `onStrokeEnded` | `{ stroke, originalEvent, source }` | Occurs when the pen leaves the pad, after the value has changed. |
172
+ | `onValueChanged` | `{ value, previousValue, byUser, source, event }` | Same as `TextBox`. |
173
+
174
+ ### Keyboard
175
+
176
+ | Key | Description |
177
+ | --- | --- |
178
+ | `Delete` | Removes the signature. |
179
+ | `Ctrl+Z` | Removes the last stroke. |
180
+ | `Tab` | Moves focus to the pad, and then to its buttons. |
181
+
182
+ ### Accessibility
183
+
184
+ | Topic | Details |
185
+ | --- | --- |
186
+ | `Pad` | The pad has the role `img`, the name of its label, and says whether it is signed. |
187
+ | `Signing` | A signature is drawn with a pointer. Where a person may not be able to draw, offer another way, such as typing the name in a `TextBox`. |
188
+ | `Touch` | The pad takes every touch, so signing does not scroll the page. |
189
+
190
+ ### Styling hooks
191
+
192
+ | Hook | Description |
193
+ | --- | --- |
194
+ | `.mx-signature` | The field. `data-invalid`, `data-readonly` and `data-disabled` describe its state. |
195
+ | `.mx-signature__pad, .mx-signature__canvas, .mx-signature__guide, .mx-signature__placeholder` | The pad, the canvas, the line to sign on and the text. |
196
+ | `.mx-signature__actions` | The buttons in the corner of the pad. |
197
+
198
+ ### Design tokens
199
+
200
+ | Token | Description |
201
+ | --- | --- |
202
+ | `signature.width, .height, .guide-inset, .actions-inset` | The size of the field and of the pad, and the distances of the line and the buttons. |
203
+ | `signature.pad, .guide, .placeholder` | Units: the pad, whose `color` is the color of the ink (`focus`, `invalid`, `readonly`, `disabled`), the line and the text. |
204
+ | `signature.field` | Place: the field under the pad, without a box of its own. |
205
+
206
+ ## Feedback
207
+
208
+ Loading issues…
package/docs/skeleton.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Skeleton
2
2
 
3
- > Display · @motifx-community/ui 0.1.0-beta.5
3
+ > Display · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  A placeholder that matches the shape of content that is loading, so the page keeps its layout while data arrives. If you provide content, it replaces the placeholder in the same place when loading ends.
6
6
 
package/docs/slider.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Slider
2
2
 
3
- > Editors · @motifx-community/ui 0.1.0-beta.5
3
+ > Editors · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  Selects a value on a track by dragging a thumb or using the keyboard. It supports a single number or a range with two thumbs, steps, labeled tick marks, a value tooltip, a vertical orientation and number formatting, along with the label, help text and validation common to all fields.
6
6
 
package/docs/sortable.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Sortable
2
2
 
3
- > Navigation · @motifx-community/ui 0.1.0-beta.5
3
+ > Navigation · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  Lets users reorder items by dragging them with the pointer or a finger, or with the keyboard. Lists in the same group can exchange items. A drop moves the element and reports the indexes, while your data stays under your control.
6
6
 
@@ -0,0 +1,119 @@
1
+ # Sparkline
2
+
3
+ > Charts · @motifx-community/ui 0.1.0-beta.6
4
+
5
+ A chart the size of a word, for a trend beside a number, in a sentence or in a row of a table. It draws a line, an area, bars, or wins and losses, and marks the values that matter.
6
+
7
+ ## Import
8
+
9
+ ```tsx
10
+ import { Sparkline } from '@motifx-community/ui';
11
+ ```
12
+
13
+ ## Trends beside numbers
14
+
15
+ `data` takes numbers, or rows with `yField`. The last value is marked by default, and the accessible name sums the values up.
16
+
17
+ ```tsx
18
+ import { Sparkline } from '@motifx-community/ui';
19
+
20
+ const ROWS = [
21
+ { name: 'Visits', now: '12,480', week: [9.1, 9.8, 10.2, 9.7, 11.3, 11.9, 12.5] },
22
+ { name: 'Orders', now: '1,184', week: [1320, 1290, 1250, 1270, 1210, 1190, 1184] },
23
+ { name: 'Returns', now: '38', week: [41, 39, 44, 37, 40, 36, 38] }
24
+ ];
25
+
26
+ /** A trend beside each number, in a row of text. The last value is marked. */
27
+ export default function Trends() {
28
+ return (
29
+ <table class="sp-table">
30
+ <tbody>
31
+ {ROWS.map((row) => (
32
+ <tr>
33
+ <th scope="row">{row.name}</th>
34
+ <td>{row.now}</td>
35
+ <td>
36
+ <Sparkline data={row.week} label={`${row.name} this week`} />
37
+ </td>
38
+ </tr>
39
+ ))}
40
+ </tbody>
41
+ </table>
42
+ );
43
+ }
44
+ ```
45
+
46
+ ## Kinds
47
+
48
+ `type` draws a line, an area, bars, or wins and losses, which show only whether each value went up or down.
49
+
50
+ ```tsx
51
+ import { Sparkline, Stack } from '@motifx-community/ui';
52
+
53
+ const VALUES = [4, 6, 5, 8, 7, 9, 6, 10, 9, 12, 11, 13];
54
+ const RESULTS = [1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1];
55
+
56
+ /** A line, an area, bars, and wins and losses. */
57
+ export default function Kinds() {
58
+ return (
59
+ <Stack gap="md">
60
+ <span class="sp-line">Line <Sparkline data={VALUES} label="Line" /></span>
61
+ <span class="sp-area">Area <Sparkline type="area" data={VALUES} label="Area" /></span>
62
+ <span class="sp-bar">Bars <Sparkline type="bar" data={VALUES} label="Bars" /></span>
63
+ <span class="sp-winloss">Wins and losses <Sparkline type="winloss" data={RESULTS} label="Results" /></span>
64
+ </Stack>
65
+ );
66
+ }
67
+ ```
68
+
69
+ ## Marked values and an average
70
+
71
+ `highlight` marks the first, last, lowest or highest value, and `reference` draws a line at a value or at the average. The value under the pointer shows above it.
72
+
73
+ ```tsx
74
+ import { Sparkline, Stack } from '@motifx-community/ui';
75
+
76
+ const TEMPERATURE = [12, 14, 13, 17, 21, 19, 16, 15, 18, 22, 20, 17];
77
+
78
+ /** The lowest and the highest value marked, and a line at the average. */
79
+ export default function Marks() {
80
+ return (
81
+ <Stack gap="md">
82
+ <span class="sp-marks">
83
+ Temperature <Sparkline data={TEMPERATURE} highlight={['min', 'max', 'last']} reference="average" format={{ style: 'unit', unit: 'celsius' }} label="Temperature" height={32} />
84
+ </span>
85
+ </Stack>
86
+ );
87
+ }
88
+ ```
89
+
90
+ ## API reference
91
+
92
+ ### Props
93
+
94
+ | Prop | Type | Default | Description |
95
+ | --- | --- | --- | --- |
96
+ | `data` | `Bind<number[] \| T[] \| null>` | `null` | The values: numbers, or rows with `yField`. They are read and never changed. |
97
+ | `yField` | `Bind<string \| (row) => unknown>` | `null` | The field of a row that holds its value. |
98
+ | `type` | `Bind<'line' \| 'area' \| 'bar' \| 'winloss'>` | `'line'` | How it draws. |
99
+ | `highlight` | `Bind<('first' \| 'last' \| 'min' \| 'max')[]>` | `['last']` for a line or an area | The values marked with a dot. |
100
+ | `reference` | `Bind<number \| 'average' \| null>` | `null` | A line across at a value, or at the average. |
101
+ | `min, max` | `Bind<number \| null>` | From the values | The ends of its scale. |
102
+ | `smooth` | `Bind<boolean>` | `false` | Curves the line, never past the values it joins. |
103
+ | `color` | `Bind<string \| null>` | The first chart color | A color of your own. |
104
+ | `label` | `Bind<string>` | A kit string | What the values are, for the accessible name. |
105
+ | `format` | `Bind<ChartFormat \| null>` | The language's numbers | How a value reads. |
106
+ | `tooltip` | `Bind<boolean>` | `true` | The value under the pointer shows above it. |
107
+ | `height` | `Bind<number \| null>` | From the design language | The height in pixels. |
108
+
109
+ ### Accessibility
110
+
111
+ | Topic | Details |
112
+ | --- | --- |
113
+ | `Name` | It has the role `img`, and its name gives the number of values, the first and the last, the lowest and the highest. |
114
+ | `Pointer` | The value under the pointer is a reading aid only: the name already holds the values that matter. |
115
+ | `Wins and losses` | Up and down differ in direction as well as in color. |
116
+
117
+ ## Feedback
118
+
119
+ Loading issues…
package/docs/speeddial.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SpeedDial
2
2
 
3
- > Buttons · @motifx-community/ui 0.1.0-beta.5
3
+ > Buttons · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  A floating action button that opens a set of related actions. Place it in a corner, on an edge or inline. Actions appear in a line with labels, or on a full, half or quarter circle around the button with tooltips. If there is only one action, the main button performs it directly.
6
6
 
package/docs/splitter.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Splitter
2
2
 
3
- > Navigation · @motifx-community/ui 0.1.0-beta.5
3
+ > Navigation · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  Divides space into any number of resizable panes, arranged side by side or stacked. A handle between each pair of panes can be dragged or moved with the keyboard, and it resizes the two panes next to it. Panes can be collapsed from their handle and can contain another splitter. For two panes where one has a fixed size, see [SplitContainer](layout.md).
6
6
 
package/docs/stepper.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Stepper
2
2
 
3
- > Navigation · @motifx-community/ui 0.1.0-beta.5
3
+ > Navigation · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  Shows the steps of a longer task and the user's progress through them. Each step has an indicator and text, with a line between steps, and steps before the current one are marked complete. [Wizard](wizard.md) adds a page and navigation buttons to each step.
6
6
 
package/docs/switch.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Switch
2
2
 
3
- > Choice · @motifx-community/ui 0.1.0-beta.5
3
+ > Choice · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  An on/off switch with a label. It has a track with a sliding thumb, optional on/off text inside or next to the track, and read-only and required states. It is a native check box with the switch role.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # TabDocumentManager: Dock and floating windows
2
2
 
3
- > TabDocumentManager · @motifx-community/ui 0.1.0-beta.5
3
+ > TabDocumentManager · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  Documents and whole groups can float in their own windows within the page, and dock again into document groups or into dock areas around them, which can collapse to the edge of the manager. The mouse, the keyboard and the API all perform the same actions through the same events.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # TabDocumentManager: Drag and drop
2
2
 
3
- > TabDocumentManager · @motifx-community/ui 0.1.0-beta.5
3
+ > TabDocumentManager · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  Drag tabs and whole groups as you would in a code editor: along a strip, to another group, beside a group, along an edge of the layout, or between two managers. The same moves are available from the keyboard, and every drop goes through the methods and events of the action it performs.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # TabDocumentManager: Menus and keys
2
2
 
3
- > TabDocumentManager · @motifx-community/ui 0.1.0-beta.5
3
+ > TabDocumentManager · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  The commands around tabs: context menus on tabs and on the empty strip, a searchable list of a group's documents, application toolbar buttons, the recently used list, back and forward, reopening closed documents, locked groups, and keyboard shortcuts for all of them.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # TabDocumentManager: Tablet and phone
2
2
 
3
- > TabDocumentManager · @motifx-community/ui 0.1.0-beta.5
3
+ > TabDocumentManager · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  On tablets and phones, a layout of groups, splits and dock areas does not fit as designed. The manager keeps the layout and changes how it is presented: the documents, groups, areas and saved JSON stay the same, and content is moved rather than recreated. The presentation depends on the manager's own width rather than the device, and on touch screens its tabs and buttons are larger.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # TabDocumentManager: Tabs
2
2
 
3
- > TabDocumentManager · @motifx-community/ui 0.1.0-beta.5
3
+ > TabDocumentManager · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  Tabs that behave as they do in code editors: preview tabs replaced by the next preview, pinned tabs that stay at the start, tabs that shrink, wrap or scroll, counts and colors, and the same document open in two groups.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # TabDocumentManager: New windows
2
2
 
3
- > TabDocumentManager · @motifx-community/ui 0.1.0-beta.5
3
+ > TabDocumentManager · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  A document, a group or a floating window can move into its own browser window and back. Its content moves with it without being recreated, and the new window is part of the same manager, so its tabs, menus, keys and dragging work the same way.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # TabDocumentManager: A whole workspace
2
2
 
3
- > TabDocumentManager · @motifx-community/ui 0.1.0-beta.5
3
+ > TabDocumentManager · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  A complete screen built from kit components: a menu bar, the manager, a DataGrid with every feature enabled, forms, and a tool docked at the bottom. Each part is the same component documented on its own page, and the manager simply hosts them.
6
6
 
package/docs/tabdocs.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # TabDocumentManager
2
2
 
3
- > TabDocumentManager · @motifx-community/ui 0.1.0-beta.5
3
+ > TabDocumentManager · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  A document manager that arranges content the way code editors arrange files: documents in tabs, tabs in groups, and groups split side by side or one above the other. A document's content can be any component, such as a form, a grid or plain text, and it is moved rather than recreated when its tab goes to another group. Every user action is also a method, with a cancelable event before it and a notification after it, and the whole layout can be saved to JSON and restored. Preview and pinned tabs, sizes and copies are covered in [Tabs](tabdocs-tabs.md), and context menus, lists and keyboard shortcuts in [Menus and keys](tabdocs-menus.md).
6
6
 
package/docs/tabs.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Tabs
2
2
 
3
- > Navigation · @motifx-community/ui 0.1.0-beta.5
3
+ > Navigation · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  Tabs display one panel at a time below a tab strip. You can define them in JSX or programmatically, and they support closable tabs, icons and badges, scroll buttons when tabs overflow, four placements, and panels that are created on first display.
6
6
 
package/docs/tagbox.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # TagBox
2
2
 
3
- > Data · @motifx-community/ui 0.1.0-beta.5
3
+ > Data · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  Selects multiple items. Selected items appear as tags in the field, followed by a text input that searches the list. Items can come from memory or from a data source, and typed text can become a custom tag.
6
6
 
package/docs/textarea.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # TextArea
2
2
 
3
- > Editors · @motifx-community/ui 0.1.0-beta.5
3
+ > Editors · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  A multi-line text input. The box can grow with its content or be resized by the user, and it supports a character counter, a clear button and Ctrl+Enter to submit, along with the label, help text and validation common to all fields.
6
6
 
package/docs/textbox.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # TextBox
2
2
 
3
- > Editors · @motifx-community/ui 0.1.0-beta.5
3
+ > Editors · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  A single-line text input with a label, help text and error display. It supports a placeholder, a prefix and suffix, buttons inside the box, a clear button, a password reveal button, a character counter, an input mask and validation, either on its own, in a group, or across all fields in a panel.
6
6
 
package/docs/tileview.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # TileView
2
2
 
3
- > Display · @motifx-community/ui 0.1.0-beta.5
3
+ > Display · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  Arranges tiles of different sizes on a grid of base cells, where each tile spans a set number of cells. Tiles fill the height in columns and scroll horizontally, or fill the width in rows. They can be selected and reordered by dragging.
6
6
 
package/docs/timeline.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Timeline
2
2
 
3
- > Display · @motifx-community/ui 0.1.0-beta.5
3
+ > Display · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  Displays events in chronological order. In the vertical layout, each event is a card next to a line with a marker. In the horizontal layout, events appear along a line of dates, and selecting a date shows that event's card below the line. Dates are formatted in the kit language. For scheduling by the hour, see [Scheduler](scheduler.md).
6
6
 
package/docs/toast.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Toast
2
2
 
3
- > Feedback · @motifx-community/ui 0.1.0-beta.5
3
+ > Feedback · @motifx-community/ui 0.1.0-beta.6
4
4
 
5
5
  Brief notifications at the edge of the window, with four tones, an optional action such as Undo, a custom duration or none, six positions and a limit on how many appear at once. Show them programmatically, or place a custom region in JSX.
6
6