@motifx-community/ui 0.1.0-beta.2 → 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.
- package/CHANGELOG.md +87 -12
- package/README.md +6 -6
- package/dist/components/accordion/Accordion.d.ts +3 -3
- package/dist/components/accordion/AccordionItem.d.ts +1 -1
- package/dist/components/card/Card.d.ts +1 -1
- package/dist/components/contextmenu/ContextMenu.d.ts +1 -1
- package/dist/components/datagrid/DataGrid.d.ts +5 -5
- package/dist/components/datagrid/data-grid-props.d.ts +2 -2
- package/dist/components/datagrid/grid-adaptive-row-expanded-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-adaptive-row-expanding-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-grouping-changed-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-grouping-changing-event-args.d.ts +2 -2
- package/dist/components/datagrid/grid-master-detail.d.ts +1 -1
- package/dist/components/datagrid/grid-row-expanded-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-row-expanding-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-search-text-changed-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-search-text-changing-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-sort-changing-event-args.d.ts +1 -1
- package/dist/components/datagrid/model/GridSearch.d.ts +1 -1
- package/dist/components/draggable/Draggable.d.ts +99 -0
- package/dist/components/draggable/DropTarget.d.ts +38 -0
- package/dist/components/draggable/draggable-event-args.d.ts +17 -0
- package/dist/components/draggable/draggable-props.d.ts +37 -0
- package/dist/components/draggable/drop-event-args.d.ts +11 -0
- package/dist/components/draggable/drop-target-props.d.ts +13 -0
- package/dist/components/draggable/index.d.ts +6 -0
- package/dist/components/fileuploader/FileUploader.d.ts +1 -1
- package/dist/components/fileuploader/file-uploader-props.d.ts +1 -1
- package/dist/components/fileuploader/upload-mode.d.ts +1 -1
- package/dist/components/filterbuilder/FilterBuilder.d.ts +1 -1
- package/dist/components/gallery/Gallery.d.ts +132 -0
- package/dist/components/gallery/gallery-item-click-event-args.d.ts +9 -0
- package/dist/components/gallery/gallery-item.d.ts +18 -0
- package/dist/components/gallery/gallery-props.d.ts +38 -0
- package/dist/components/gallery/index.d.ts +6 -0
- package/dist/components/gallery/slide-changed-event-args.d.ts +11 -0
- package/dist/components/gallery/slide-changing-event-args.d.ts +14 -0
- package/dist/components/layout/ChildSettings.d.ts +1 -1
- package/dist/components/layout/DockPanel.d.ts +2 -2
- package/dist/components/layout/Grid.d.ts +1 -1
- package/dist/components/layout/SplitContainer.d.ts +1 -1
- package/dist/components/layout/Stack.d.ts +1 -1
- package/dist/components/multiview/MultiView.d.ts +87 -0
- package/dist/components/multiview/View.d.ts +41 -0
- package/dist/components/multiview/index.d.ts +6 -0
- package/dist/components/multiview/multi-view-props.d.ts +24 -0
- package/dist/components/multiview/view-props.d.ts +15 -0
- package/dist/components/multiview/view-selecting-event-args.d.ts +15 -0
- package/dist/components/multiview/view-selection-changed-event-args.d.ts +12 -0
- package/dist/components/numberbox/number-box-props.d.ts +1 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/popover-props.d.ts +1 -1
- package/dist/components/resizable/Resizable.d.ts +84 -0
- package/dist/components/resizable/index.d.ts +3 -0
- package/dist/components/resizable/resizable-props.d.ts +41 -0
- package/dist/components/resizable/resize-event-args.d.ts +13 -0
- package/dist/components/scheduler/AppointmentEditor.d.ts +1 -1
- package/dist/components/scheduler/scheduler-props.d.ts +1 -1
- package/dist/components/scrollview/ScrollView.d.ts +1 -1
- package/dist/components/skeleton/Skeleton.d.ts +1 -1
- package/dist/components/speeddial/SpeedDial.d.ts +129 -0
- package/dist/components/speeddial/index.d.ts +6 -0
- package/dist/components/speeddial/speed-dial-action-click-event-args.d.ts +9 -0
- package/dist/components/speeddial/speed-dial-action.d.ts +25 -0
- package/dist/components/speeddial/speed-dial-event-args.d.ts +8 -0
- package/dist/components/speeddial/speed-dial-props.d.ts +49 -0
- package/dist/components/speeddial/speed-dial-tooltip.d.ts +3 -0
- package/dist/components/splitter/SplitPane.d.ts +45 -0
- package/dist/components/splitter/Splitter.d.ts +116 -0
- package/dist/components/splitter/index.d.ts +6 -0
- package/dist/components/splitter/split-pane-props.d.ts +21 -0
- package/dist/components/splitter/splitter-collapse-event-args.d.ts +13 -0
- package/dist/components/splitter/splitter-props.d.ts +25 -0
- package/dist/components/splitter/splitter-resize-event-args.d.ts +10 -0
- package/dist/components/stepper/Stepper.d.ts +1 -1
- package/dist/components/stepper/WizardStep.d.ts +1 -1
- package/dist/components/stepper/step-changed-event-args.d.ts +1 -1
- package/dist/components/stepper/step-changing-event-args.d.ts +1 -1
- package/dist/components/stepper/wizard-props.d.ts +1 -1
- package/dist/components/tabdocs/TabDocumentManager.d.ts +1 -1
- package/dist/components/tabs/Tabs.d.ts +2 -2
- package/dist/components/tileview/TileView.d.ts +128 -0
- package/dist/components/tileview/index.d.ts +6 -0
- package/dist/components/tileview/tile-click-event-args.d.ts +9 -0
- package/dist/components/tileview/tile-reorder-event-args.d.ts +11 -0
- package/dist/components/tileview/tile-selection-changed-event-args.d.ts +11 -0
- package/dist/components/tileview/tile-view-item.d.ts +18 -0
- package/dist/components/tileview/tile-view-props.d.ts +38 -0
- package/dist/components/timeline/Timeline.d.ts +113 -0
- package/dist/components/timeline/index.d.ts +5 -0
- package/dist/components/timeline/timeline-item-click-event-args.d.ts +9 -0
- package/dist/components/timeline/timeline-item.d.ts +24 -0
- package/dist/components/timeline/timeline-props.d.ts +30 -0
- package/dist/components/timeline/timeline-selection-changed-event-args.d.ts +11 -0
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/treeview/TreeView.d.ts +1 -1
- package/dist/components/validationsummary/ValidationSummary.d.ts +56 -0
- package/dist/components/validationsummary/index.d.ts +3 -0
- package/dist/components/validationsummary/summary-item-click-event-args.d.ts +11 -0
- package/dist/components/validationsummary/validation-summary-props.d.ts +17 -0
- package/dist/core/control.d.ts +4 -4
- package/dist/core/flow-home.d.ts +1 -1
- package/dist/core/ui-strings.d.ts +26 -0
- package/dist/generated/tokens.d.ts +6390 -4745
- package/dist/index.d.ts +9 -0
- package/dist/index.js +5119 -759
- package/dist/index.js.map +1 -1
- package/dist/locales/en.json +22 -1
- package/dist/locales/tr.json +22 -1
- package/dist/parts/slide/slide-track-host.d.ts +19 -0
- package/dist/parts/slide/slide-track.d.ts +45 -0
- package/dist/styles.css +3072 -182
- package/dist/tokens/index.d.ts +6390 -4745
- package/dist/tokens/index.js +6390 -4745
- package/dist/tokens/index.js.map +1 -1
- package/dist/{tr-B218zMtu.js → tr-C5IXRzAH.js} +45 -3
- package/dist/{tr-B218zMtu.js.map → tr-C5IXRzAH.js.map} +1 -1
- package/docs/accordion.md +9 -9
- package/docs/actionsheet.md +2 -2
- package/docs/avatar.md +5 -5
- package/docs/badge.md +6 -6
- package/docs/bottomsheet.md +4 -4
- package/docs/breadcrumb.md +3 -3
- package/docs/button.md +8 -8
- package/docs/buttongroup.md +5 -5
- package/docs/calendar.md +6 -6
- package/docs/card.md +6 -6
- package/docs/checkbox.md +7 -7
- package/docs/chip.md +5 -5
- package/docs/colorbox.md +3 -3
- package/docs/combobox.md +7 -7
- package/docs/control.md +12 -12
- package/docs/datagrid-api.md +5 -5
- package/docs/datagrid-bands.md +1 -1
- package/docs/datagrid-drag-select.md +2 -2
- package/docs/datagrid-drag.md +1 -1
- package/docs/datagrid-editing.md +2 -2
- package/docs/datagrid-filtering.md +3 -3
- package/docs/datagrid-forms.md +1 -1
- package/docs/datagrid-grouping.md +1 -1
- package/docs/datagrid-layout.md +4 -4
- package/docs/datagrid-lookups.md +1 -1
- package/docs/datagrid-master-detail.md +3 -3
- package/docs/datagrid-scrolling.md +1 -1
- package/docs/datagrid-selection.md +3 -3
- package/docs/datagrid.md +8 -8
- package/docs/datebox.md +6 -6
- package/docs/daterangebox.md +4 -4
- package/docs/draggable.md +194 -0
- package/docs/drawer.md +1 -1
- package/docs/dropdown.md +8 -8
- package/docs/fileuploader.md +4 -4
- package/docs/filterbuilder.md +7 -7
- package/docs/formlayout.md +1 -1
- package/docs/gallery.md +244 -0
- package/docs/home.md +11 -7
- package/docs/keyboard.md +1 -1
- package/docs/language.md +1 -1
- package/docs/layout.md +13 -13
- package/docs/listbox.md +8 -8
- package/docs/loadpanel.md +4 -4
- package/docs/lookup.md +1 -1
- package/docs/menus.md +2 -2
- package/docs/multiview.md +202 -0
- package/docs/numberbox.md +7 -7
- package/docs/pagination.md +4 -4
- package/docs/popover.md +11 -11
- package/docs/progress.md +7 -7
- package/docs/radiogroup.md +7 -7
- package/docs/rating.md +4 -4
- package/docs/resizable.md +139 -0
- package/docs/scheduler-agenda.md +1 -1
- package/docs/scheduler-big-data.md +1 -1
- package/docs/scheduler-editing.md +5 -5
- package/docs/scheduler-form.md +1 -1
- package/docs/scheduler-icalendar.md +1 -1
- package/docs/scheduler-mobile.md +1 -1
- package/docs/scheduler-recurrence.md +2 -2
- package/docs/scheduler-resources.md +1 -1
- package/docs/scheduler-timeline.md +1 -1
- package/docs/scheduler.md +4 -4
- package/docs/scrollview.md +5 -5
- package/docs/showcase.md +1 -1
- package/docs/skeleton.md +2 -2
- package/docs/slider.md +7 -7
- package/docs/sortable.md +2 -2
- package/docs/speeddial.md +290 -0
- package/docs/splitter.md +204 -0
- package/docs/stepper.md +5 -5
- package/docs/switch.md +7 -7
- package/docs/tabdocs-dock.md +3 -3
- package/docs/tabdocs-drag.md +1 -1
- package/docs/tabdocs-menus.md +1 -1
- package/docs/tabdocs-mobile.md +1 -1
- package/docs/tabdocs-tabs.md +1 -1
- package/docs/tabdocs-windows.md +1 -1
- package/docs/tabdocs-workspace.md +1 -1
- package/docs/tabdocs.md +5 -5
- package/docs/tabs.md +9 -9
- package/docs/tagbox.md +8 -8
- package/docs/textarea.md +7 -7
- package/docs/textbox.md +8 -8
- package/docs/tileview.md +206 -0
- package/docs/timeline.md +174 -0
- package/docs/toast.md +5 -5
- package/docs/tokens.md +333 -4
- package/docs/toolbar.md +6 -6
- package/docs/tooltip.md +12 -12
- package/docs/treeview.md +9 -9
- package/docs/validationsummary.md +115 -0
- package/docs/window.md +5 -5
- package/docs/wizard.md +9 -9
- package/llms-full.txt +2525 -379
- package/llms.txt +13 -4
- package/package.json +1 -1
package/docs/gallery.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# Gallery
|
|
2
|
+
|
|
3
|
+
> Display · @motifx-community/ui 0.1.0-beta.3
|
|
4
|
+
|
|
5
|
+
Panes side by side, one in view or several, moved by the buttons at the sides, the dots under them, a swipe or the arrow keys; a slideshow when told. A pane is an image with a caption, or any content.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Gallery } from '@motifx-community/ui';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Pictures with captions
|
|
14
|
+
|
|
15
|
+
`items` are the panes: an address, or an item with `image`, `alt`, `text` and `description`. The pane in view is `value` (a pane’s `key`, else its index), `x-model` binds it two-way. Drag a pane with a finger or the mouse, press an arrow or a dot, or use the keys on the panes.
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { Gallery } from '@motifx-community/ui';
|
|
19
|
+
import { scene } from './scenes';
|
|
20
|
+
|
|
21
|
+
/** Five pictures with captions: the buttons at the sides, the dots under them, a swipe or the arrow keys move them. */
|
|
22
|
+
export default function Basic() {
|
|
23
|
+
return (
|
|
24
|
+
<Gallery
|
|
25
|
+
class="ga-trip"
|
|
26
|
+
label="A trip"
|
|
27
|
+
height={300}
|
|
28
|
+
items={[
|
|
29
|
+
{ image: scene(205), alt: 'Boats in a harbour', text: 'Harbour', description: 'Early morning' },
|
|
30
|
+
{ image: scene(30), alt: 'Market stalls', text: 'Market' },
|
|
31
|
+
{ image: scene(120), alt: 'Hills under cloud', text: 'Hills', description: 'After the rain' },
|
|
32
|
+
{ image: scene(280), alt: 'The town at night', text: 'Night' },
|
|
33
|
+
{ image: scene(345), alt: 'The way home', text: 'Home', description: 'Last day' }
|
|
34
|
+
]}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Loop and slideshow
|
|
41
|
+
|
|
42
|
+
`loop` goes around the ends: the pane on the other side is brought next to the one leaving, so the move never runs back across the panes between. `slideInterval` makes a slideshow; it waits while the pointer rests on the gallery, while focus is inside, while the page is out of sight and under reduced motion, and the button in the bar pauses it. `stretchImages` fills the panes.
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { reactive } from '@motifx/core';
|
|
46
|
+
import { Gallery, Stack } from '@motifx-community/ui';
|
|
47
|
+
import { scene } from './scenes';
|
|
48
|
+
|
|
49
|
+
/** A slideshow around the ends: it moves on every 2.5 s, waits while the pointer or focus is on it, and its button pauses it. */
|
|
50
|
+
export default function Slideshow() {
|
|
51
|
+
const s = reactive({ shown: 0 as string | number | null, told: '' });
|
|
52
|
+
return (
|
|
53
|
+
<Stack gap="sm" style="inline-size: 100%">
|
|
54
|
+
<Gallery
|
|
55
|
+
class="ga-show"
|
|
56
|
+
label="Slideshow"
|
|
57
|
+
height={240}
|
|
58
|
+
loop
|
|
59
|
+
stretchImages
|
|
60
|
+
slideInterval={2500}
|
|
61
|
+
x-model={() => s.shown}
|
|
62
|
+
onSlideChanged={e => (s.told = e.byUser ? 'moved by you' : 'moved by the slideshow')}
|
|
63
|
+
items={[
|
|
64
|
+
{ image: scene(190), alt: 'Dawn over the sea', text: 'Dawn' },
|
|
65
|
+
{ image: scene(50), alt: 'Noon in the square', text: 'Noon' },
|
|
66
|
+
{ image: scene(260), alt: 'Dusk on the hill', text: 'Dusk' }
|
|
67
|
+
]}
|
|
68
|
+
/>
|
|
69
|
+
<output class="ga-show-told">{() => `in view: ${s.shown}${s.told ? `, ${s.told}` : ''}`}</output>
|
|
70
|
+
</Stack>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Several panes side by side
|
|
76
|
+
|
|
77
|
+
`itemsPerPage` puts that many panes in the width, the `gap` token between them. The buttons and the keys move one pane at a time and stop when the last pane is in view; the pane in view is the first of them.
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import { Gallery } from '@motifx-community/ui';
|
|
81
|
+
import { scene } from './scenes';
|
|
82
|
+
|
|
83
|
+
/** Three panes share the width; next and previous move one pane at a time and stop when the last is in view. */
|
|
84
|
+
export default function PerPage() {
|
|
85
|
+
const places = ['Pier', 'Lane', 'Roof', 'Park', 'Bridge', 'Shore', 'Tower'];
|
|
86
|
+
return (
|
|
87
|
+
<Gallery
|
|
88
|
+
class="ga-wide"
|
|
89
|
+
label="Places"
|
|
90
|
+
height={150}
|
|
91
|
+
itemsPerPage={3}
|
|
92
|
+
stretchImages
|
|
93
|
+
items={places.map((place, i) => ({ image: scene(i * 48), alt: `The ${i + 1}. picture of the walk`, text: place }))}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Any content
|
|
100
|
+
|
|
101
|
+
An item’s `content` makes the pane’s content when the pane is made; what is in it works as anywhere else. `onItemClick` tells a press on the pane that was not a drag.
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
import { reactive } from '@motifx/core';
|
|
105
|
+
import { Button, Gallery, Stack } from '@motifx-community/ui';
|
|
106
|
+
|
|
107
|
+
const PLANS = [
|
|
108
|
+
{ name: 'Starter', price: '€9', line: 'One project, two people' },
|
|
109
|
+
{ name: 'Team', price: '€29', line: 'Ten projects, your whole team' },
|
|
110
|
+
{ name: 'Company', price: '€79', line: 'No limits, a person to call' }
|
|
111
|
+
];
|
|
112
|
+
|
|
113
|
+
/** Any content in a pane: a plan each, with its own button; a press on the pane itself is told too. */
|
|
114
|
+
export default function Content() {
|
|
115
|
+
const s = reactive({ told: '' });
|
|
116
|
+
const plan = (p: (typeof PLANS)[number]) => (
|
|
117
|
+
<Stack class="ga-plan" gap="xs" align="center" justify="center" style="block-size: 100%">
|
|
118
|
+
<strong>{p.name}</strong>
|
|
119
|
+
<span class="ga-plan-price">{p.price} a month</span>
|
|
120
|
+
<span>{p.line}</span>
|
|
121
|
+
<Button text="Choose" variant="outline" onclick={() => (s.told = `${p.name} chosen`)} />
|
|
122
|
+
</Stack>
|
|
123
|
+
);
|
|
124
|
+
return (
|
|
125
|
+
<Stack gap="sm" style="inline-size: 100%">
|
|
126
|
+
<Gallery class="ga-plans" label="Plans" height={200} swipeEnabled={false} items={PLANS.map(p => ({ key: p.name, content: () => plan(p) }))} onItemClick={e => (s.told = `pane ${e.index + 1} pressed`)} />
|
|
127
|
+
<output class="ga-plans-told">{() => s.told}</output>
|
|
128
|
+
</Stack>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Programmatic use
|
|
134
|
+
|
|
135
|
+
Made with `new`, moved with `next()`, `previous()` and `goTo()`; `showNavButtons` and `showIndicator` off leave the moving to your own buttons, `onSlideChanged` tells where it stands.
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
import { reactive } from '@motifx/core';
|
|
139
|
+
import { Button, Gallery, Stack } from '@motifx-community/ui';
|
|
140
|
+
import { scene } from './scenes';
|
|
141
|
+
|
|
142
|
+
/** A gallery made programmatically without its own buttons or dots: yours move it, and `onSlideChanged` tells where it is. */
|
|
143
|
+
export default function Programmatic() {
|
|
144
|
+
const s = reactive({ at: 0, told: '' });
|
|
145
|
+
const coded = new Gallery({
|
|
146
|
+
label: 'Rooms',
|
|
147
|
+
height: 200,
|
|
148
|
+
showNavButtons: false,
|
|
149
|
+
showIndicator: false,
|
|
150
|
+
swipeEnabled: false,
|
|
151
|
+
items: [
|
|
152
|
+
{ key: 'hall', image: scene(20), alt: 'The hall', text: 'Hall' },
|
|
153
|
+
{ key: 'study', image: scene(200), alt: 'The study', text: 'Study' },
|
|
154
|
+
{ key: 'garden', image: scene(110), alt: 'The garden', text: 'Garden' }
|
|
155
|
+
],
|
|
156
|
+
onSlideChanged: e => {
|
|
157
|
+
s.at = e.index;
|
|
158
|
+
s.told = `slide ${e.index + 1} of ${coded.count}`;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
return (
|
|
162
|
+
<Stack gap="sm" style="inline-size: 100%">
|
|
163
|
+
<span class="ga-rooms" onConfig={c => c.controls.add(coded)} />
|
|
164
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
165
|
+
<Button text="Previous" variant="outline" enabled={() => s.at > 0} onclick={() => void coded.previous()} />
|
|
166
|
+
<Button text="Next" variant="outline" enabled={() => s.at < 2} onclick={() => void coded.next()} />
|
|
167
|
+
<Button text="Garden" variant="outline" onclick={() => void coded.goTo('garden')} />
|
|
168
|
+
<output class="ga-rooms-told">{() => s.told}</output>
|
|
169
|
+
</Stack>
|
|
170
|
+
</Stack>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Keyboard
|
|
176
|
+
|
|
177
|
+
| Key | What it does |
|
|
178
|
+
| --- | --- |
|
|
179
|
+
| `Tab` | The slideshow button, the dots (one stop: the dot of the pane in view), the previous button, the panes, the next button; what is in the pane in view after it. |
|
|
180
|
+
| `Arrow keys` | On the panes or the dots: Left and Right (the other way round in a right-to-left page) move to the previous and the next pane, Home and End to the first and the last. |
|
|
181
|
+
| `Enter, Space` | On a button or a dot: press it. |
|
|
182
|
+
|
|
183
|
+
## Accessibility
|
|
184
|
+
|
|
185
|
+
| Topic | How |
|
|
186
|
+
| --- | --- |
|
|
187
|
+
| `Landmark` | A `region` with `aria-roledescription="carousel"`, named “Gallery” in the kit language; several on one page: give each its own `label`. |
|
|
188
|
+
| `A pane` | A `group` with `aria-roledescription="slide"` named “Slide 2 of 5”; the panes out of view are hidden from readers and from the keys (`inert`). |
|
|
189
|
+
| `Images` | Give each an `alt`; an empty one is a decorative image. The caption is read as the pane’s content. |
|
|
190
|
+
| `Slideshow` | The panes are a live region while it is stopped (`polite`), silent while it runs (`off`), as the carousel pattern asks; the button to stop it comes first in the Tab order. |
|
|
191
|
+
| `Dots and arrows` | Buttons named “Slide 2 of 5”, “Previous slide” and “Next slide”; the dot of the pane in view is `aria-current`; an arrow at an end is `aria-disabled`. |
|
|
192
|
+
|
|
193
|
+
## Styling
|
|
194
|
+
|
|
195
|
+
| Hook | What it is |
|
|
196
|
+
| --- | --- |
|
|
197
|
+
| `.mx-gallery` | The gallery. `data-swipe` when a drag moves it, `data-dragging` while one does, `data-playing` while the slideshow is on, `data-stretch`. |
|
|
198
|
+
| `.mx-gallery__viewport, .mx-gallery__track` | The frame that clips the panes and the track that slides in it (`data-dragging`, `data-no-motion`). |
|
|
199
|
+
| `.mx-gallery__item, .mx-gallery__figure, .mx-gallery__image` | A pane (`data-current`, `aria-hidden`), what it shows, the image. |
|
|
200
|
+
| `.mx-gallery__caption, .mx-gallery__title, .mx-gallery__description` | The band over the bottom of a pane and its two lines. |
|
|
201
|
+
| `.mx-gallery__nav, .mx-gallery__arrow` | The previous and next buttons (`data-direction`, `aria-disabled`) and the glyph in them. |
|
|
202
|
+
| `.mx-gallery__bar, .mx-gallery__indicator, .mx-gallery__dot, .mx-gallery__play, .mx-gallery__play-glyph` | The bar over the bottom, the dots (`aria-current`), the slideshow button and its glyph. |
|
|
203
|
+
|
|
204
|
+
### Component tokens
|
|
205
|
+
|
|
206
|
+
| Token | What it sets |
|
|
207
|
+
| --- | --- |
|
|
208
|
+
| `gallery.frame, .item, .caption, .title, .description` | Units: the frame (`focus`, `swipeable`, `dragging`), a pane (`current`), the caption and its texts. |
|
|
209
|
+
| `gallery.nav, .arrow, .dot, .play, .play-glyph, .bar` | Units: the side buttons (`hover`, `pressed`, `focus`, `disabled`), their glyph (`icon` per direction), the dots (`current`, `hover`, `pressed`, `focus`), the slideshow button and its glyph (`icon` while `playing`), the bar. |
|
|
210
|
+
| `gallery.gap, .nav-inset, .bar-inset, .indicator-gap, .caption-padding` | Between panes side by side, from the sides and the bottom to what lies over them, between the dots, inside a caption. |
|
|
211
|
+
|
|
212
|
+
## API reference
|
|
213
|
+
|
|
214
|
+
### Props
|
|
215
|
+
|
|
216
|
+
| Prop | Type | Default | Description |
|
|
217
|
+
| --- | --- | --- | --- |
|
|
218
|
+
| `items` | `Bind<readonly (GalleryItem \| string)[]>` | `[]` | The panes in order: `GalleryItem`s (`image`, `alt`, `text`, `description`, `key`, `content`, `data`) or image addresses. |
|
|
219
|
+
| `value` | `Bind<string \| number \| null>` | `0` | The pane in view: its `key`, else its index. `x-model` binds it two-way. |
|
|
220
|
+
| `loop` | `Bind<boolean>` | `false` | After the last pane comes the first; the move goes around the ends, not back across the panes between. |
|
|
221
|
+
| `showNavButtons` | `Bind<boolean>` | `true` | The previous and next buttons over the sides. |
|
|
222
|
+
| `showIndicator` | `Bind<boolean>` | `true` | The dots under the panes, one per pane. |
|
|
223
|
+
| `slideInterval` | `Bind<number>` | `0` | Milliseconds a pane stays in a slideshow; `0` for none. It pauses under the pointer, while focus is inside, out of sight and under reduced motion. |
|
|
224
|
+
| `pauseOnHover` | `Bind<boolean>` | `true` | The slideshow waits while the pointer rests on the gallery. |
|
|
225
|
+
| `swipeEnabled` | `Bind<boolean>` | `true` | A finger or a pointer drags the panes; a drag far or fast enough lands on the next one. |
|
|
226
|
+
| `itemsPerPage` | `Bind<number>` | `1` | Panes side by side in the width, with the `gap` token between them. |
|
|
227
|
+
| `stretchImages` | `Bind<boolean>` | `false` | An image fills its pane, cut at the edges, instead of fitting inside it whole. |
|
|
228
|
+
| `height` | `Bind<string \| number \| null>` | `null` | A CSS length or pixels. Without one the gallery is as tall as its tallest pane. |
|
|
229
|
+
| `label` | `Bind<string>` | the kit’s “Gallery” | What screen readers call it. |
|
|
230
|
+
|
|
231
|
+
### Events, properties and methods
|
|
232
|
+
|
|
233
|
+
| Member | Kind | Description |
|
|
234
|
+
| --- | --- | --- |
|
|
235
|
+
| `onSlideChanging` | event | The pane in view is about to change (`from`, `to`, `fromItem`, `toItem`, `byUser`); `cancel = true` keeps the one there. |
|
|
236
|
+
| `onSlideChanged` | event | The pane in view changed (`index`, `item`, `previous`, `byUser`: by a press, a swipe or a key, else programmatically or the slideshow). |
|
|
237
|
+
| `onItemClick` | event | A press on a pane that was not a drag (`index`, `item`, `event`). |
|
|
238
|
+
| `selectedIndex` | read-only | The index of the pane in view; -1 when there is none. |
|
|
239
|
+
| `count` | read-only | How many panes there are. |
|
|
240
|
+
| `isPlaying` | read-only | The slideshow runs now: not paused, and nothing holds it. |
|
|
241
|
+
| `next(), previous()` | `Promise<boolean>` | Goes to the next or the previous pane; `false` at an end without `loop`, or when the change was refused. |
|
|
242
|
+
| `goTo(pane)` | `Promise<boolean>` | Goes to a pane by index or key; `onSlideChanging` is asked first. |
|
|
243
|
+
| `play(), pause()` | `void` | Starts the slideshow again, or stops it until `play()`; the button in the bar does the same. |
|
|
244
|
+
| `refresh()` | `void` | Reads the items again after they were changed in place. |
|
package/docs/home.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @motifx-community/ui
|
|
2
2
|
|
|
3
|
-
> Get started · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Get started · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
Components for MotifJS that work the way desktop UI does — created when needed, shown anywhere, closed and disposed like windows — drawn from the MotifJS design system's tokens.
|
|
6
6
|
|
|
@@ -22,14 +22,18 @@ import { Button, Control, FocusContainer, addShortcut } from '@motifx-community/
|
|
|
22
22
|
|
|
23
23
|
## What ships today
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
More than fifty components, every one an object with the same base: focus and the keyboard, the right roles and names for a screen reader, texts in English and Turkish that switch while the app runs, right to left, and a look in each of the design system's five languages (Tactile, Lounge, Material, Fluent, Lilac) painted from component tokens. Each has a page with live examples and its API.
|
|
26
26
|
|
|
27
|
-
|
|
|
27
|
+
| Group | Components |
|
|
28
28
|
| --- | --- |
|
|
29
|
-
| [`Button`](button.md)
|
|
30
|
-
|
|
|
31
|
-
| [`
|
|
32
|
-
| [`
|
|
29
|
+
| Buttons and commands | [`Button`](button.md) (menu, split, toggle, busy), [`ButtonGroup`](buttongroup.md), [`Toolbar`](toolbar.md), [`MenuBar` and `ContextMenu`](menus.md) |
|
|
30
|
+
| Editors | [`TextBox`](textbox.md) (mask, validation), [`TextArea`](textarea.md), [`NumberBox`](numberbox.md), [`DateBox`](datebox.md), [`DateRangeBox`](daterangebox.md), [`Calendar`](calendar.md), [`ColorBox` and `ColorPicker`](colorbox.md), [`Slider`](slider.md), [`Rating`](rating.md), [`FileUploader`](fileuploader.md) |
|
|
31
|
+
| Choice | [`CheckBox`](checkbox.md), [`Switch`](switch.md), [`RadioGroup`](radiogroup.md), [`DropDown`](dropdown.md), [`ComboBox` and `Autocomplete`](combobox.md), [`Lookup`](lookup.md), [`TagBox`](tagbox.md), [`ListBox`](listbox.md) |
|
|
32
|
+
| Display and feedback | [`Badge`](badge.md), [`Avatar` and `AvatarGroup`](avatar.md), [`Chip` and `ChipGroup`](chip.md), [`Card`](card.md), [`Skeleton`](skeleton.md), [`ProgressBar` and `Spinner`](progress.md), [`LoadPanel`](loadpanel.md), [`Tooltip`](tooltip.md), [`Popover`](popover.md), [`Toast`](toast.md) |
|
|
33
|
+
| Navigation and layers | [`Tabs`](tabs.md), [`Accordion`](accordion.md), [`Breadcrumb`](breadcrumb.md), [`Pagination`](pagination.md), [`Stepper`](stepper.md), [`Wizard`](wizard.md), [`Window` and dialog](window.md), [`BottomSheet`](bottomsheet.md), [`Drawer`](drawer.md), [`ActionSheet`](actionsheet.md) |
|
|
34
|
+
| Layout | [`Stack`, `Grid`, `DockPanel`, `Panel`, `GroupBox`, `SplitContainer`](layout.md), [`FormLayout`](formlayout.md), [`ScrollView`](scrollview.md) (pull to refresh, load more), [`Sortable`](sortable.md) |
|
|
35
|
+
| Data | [`DataGrid`](datagrid.md) (virtual or paged, editing, filters, grouping, master-detail, export), [`TreeView`](treeview.md), [`FilterBuilder`](filterbuilder.md), [`Scheduler`](scheduler.md) (day to timeline, recurrence, resources, iCalendar), [`TabDocumentManager`](tabdocs.md) (tabs, split, dock, new windows); lists and grids read `@motifx-community/data` sources |
|
|
36
|
+
| Base | [`Control`](control.md), [`FocusContainer` and `addShortcut`](keyboard.md), [`uiLocale`](language.md), [the component tokens](tokens.md); `Popup` and `MenuList`, the shared parts a menu or a drop-down opens on |
|
|
33
37
|
|
|
34
38
|
## Design system
|
|
35
39
|
|
package/docs/keyboard.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Keyboard and focus
|
|
2
2
|
|
|
3
|
-
> Foundations · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Foundations · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
The rules every control follows: Tab order, the active control of a container, focus that never falls to `<body>`, `&File` access keys and app-wide shortcuts.
|
|
6
6
|
|
package/docs/language.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Language
|
|
2
2
|
|
|
3
|
-
> Foundations · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Foundations · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
The texts the controls write, the locale their dates and numbers follow, and the direction: one `uiLocale` for the kit, with a pack per language loaded as it is asked for.
|
|
6
6
|
|
package/docs/layout.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Layout
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
Containers that place controls: `Stack` (a row or a column), `Grid` (rows and columns), `Panel` (a plain box that can scroll), `GroupBox` (a titled frame), `DockPanel` (children stuck to its edges) and `SplitContainer` (two panes and a splitter). All of them are controls: they disable and hide what is inside, and lay out children added at any time.
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ Containers that place controls: `Stack` (a row or a column), `Grid` (rows and co
|
|
|
10
10
|
import { Stack, Grid, Panel, GroupBox, DockPanel, SplitContainer, type LayoutSpace } from '@motifx-community/ui';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Declarative and programmatic
|
|
14
14
|
|
|
15
15
|
Children come as JSX or are added later with `controls.add`; either way the container picks them up. A child says where it goes in its own props (`grow`, `row`, `dock`…), whatever kind of component it is.
|
|
16
16
|
|
|
@@ -19,13 +19,13 @@ import type { Component } from '@motifx/core';
|
|
|
19
19
|
import { Button, Grid, Stack, TextBox } from '@motifx-community/ui';
|
|
20
20
|
|
|
21
21
|
/** Buttons added to a Stack with `controls.add`, and a Grid built with `new`. */
|
|
22
|
-
export default function
|
|
22
|
+
export default function Programmatic() {
|
|
23
23
|
let added = 0;
|
|
24
24
|
let bar: Stack | null = null;
|
|
25
25
|
|
|
26
26
|
const addButton = () => bar?.controls.add(new Button({ text: `Button ${++added}`, variant: 'outline', grow: added % 3 === 0 }));
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const buildProgrammatic = (host: Component<HTMLDivElement>) => {
|
|
29
29
|
const grid = new Grid({ columns: '* *', gap: 'xs' });
|
|
30
30
|
grid.element.classList.add('layout-coded');
|
|
31
31
|
grid.controls.add(
|
|
@@ -41,7 +41,7 @@ export default function FromCode() {
|
|
|
41
41
|
<Stack ref={(c: Stack) => (bar = c)} orientation="horizontal" gap="sm" wrap align="center" style="inline-size: 100%">
|
|
42
42
|
<Button text="Add a button" tone="accent" onclick={addButton} />
|
|
43
43
|
</Stack>
|
|
44
|
-
<div style="inline-size: 100%" ref={(c: Component<HTMLDivElement>) =>
|
|
44
|
+
<div style="inline-size: 100%" ref={(c: Component<HTMLDivElement>) => buildProgrammatic(c)} />
|
|
45
45
|
</>
|
|
46
46
|
);
|
|
47
47
|
}
|
|
@@ -287,7 +287,7 @@ const FRAME = 'border: var(--mx-border-width-1) solid var(--mx-color-stroke-card
|
|
|
287
287
|
const BAR = 'background: var(--mx-color-bg-bar);';
|
|
288
288
|
const LAYER = 'background: var(--mx-color-bg-layer);';
|
|
289
289
|
|
|
290
|
-
/** A mail app laid out with DockPanel: a header, a sidebar that changes sides, a status bar, a float button and a panel added
|
|
290
|
+
/** A mail app laid out with DockPanel: a header, a sidebar that changes sides, a status bar, a float button and a panel added programmatically. */
|
|
291
291
|
export default function AppShell() {
|
|
292
292
|
const s = reactive({ side: 'start' as Dock, messages: 3 });
|
|
293
293
|
let shell: DockPanel | null = null;
|
|
@@ -302,7 +302,7 @@ export default function AppShell() {
|
|
|
302
302
|
notes = new Panel({ dock: 'end', padding: 'sm' });
|
|
303
303
|
notes.element.setAttribute('style', `inline-size: 9rem; ${LAYER}`);
|
|
304
304
|
notes.element.classList.add('layout-notes');
|
|
305
|
-
notes.controls.add(<span>Notes, added
|
|
305
|
+
notes.controls.add(<span>Notes, added programmatically.</span>);
|
|
306
306
|
shell?.controls.add(notes);
|
|
307
307
|
};
|
|
308
308
|
|
|
@@ -310,7 +310,7 @@ export default function AppShell() {
|
|
|
310
310
|
<>
|
|
311
311
|
<Stack orientation="horizontal" wrap align="center">
|
|
312
312
|
<Button text={() => `Sidebar: ${s.side}`} size="sm" variant="outline" onclick={() => (s.side = s.side === 'start' ? 'end' : 'start')} />
|
|
313
|
-
<Button text="Notes panel
|
|
313
|
+
<Button text="Notes panel programmatically" size="sm" variant="outline" onclick={toggleNotes} />
|
|
314
314
|
</Stack>
|
|
315
315
|
<DockPanel class="layout-shell" ref={(c: DockPanel) => (shell = c)} style={`block-size: 22rem; inline-size: 100%; overflow: hidden; ${FRAME}`}>
|
|
316
316
|
<Stack dock="top" orientation="horizontal" align="center" gap="sm" padding="xs sm" style={BAR}>
|
|
@@ -332,7 +332,7 @@ export default function AppShell() {
|
|
|
332
332
|
<Panel class="layout-content" text="Message" scrollable padding="md">
|
|
333
333
|
<h3 style="margin-block-start: 0">Welcome</h3>
|
|
334
334
|
<p>The header, the folders and the status bar are docked; this panel fills the rest and scrolls on its own.</p>
|
|
335
|
-
<p>Switch the sidebar to the other side, or add a panel
|
|
335
|
+
<p>Switch the sidebar to the other side, or add a panel programmatically: the layout follows at once.</p>
|
|
336
336
|
</Panel>
|
|
337
337
|
<Button class="layout-help" dock="float" right={16} bottom={48} text="Help" variant="outline" />
|
|
338
338
|
</DockPanel>
|
|
@@ -353,7 +353,7 @@ const FOLDERS = ['Inbox', 'Drafts', 'Sent', 'Archive', 'Spam', 'Trash'];
|
|
|
353
353
|
const FRAME = 'border: var(--mx-border-width-1) solid var(--mx-color-stroke-card); border-radius: var(--mx-radius-lg);';
|
|
354
354
|
const LAYER = 'background: var(--mx-color-bg-layer);';
|
|
355
355
|
|
|
356
|
-
/** A split container inside another: a position bound with x-model, minimum sizes, a fixed pane, and hiding a pane
|
|
356
|
+
/** A split container inside another: a position bound with x-model, minimum sizes, a fixed pane, and hiding a pane programmatically. */
|
|
357
357
|
export default function NestedSplit() {
|
|
358
358
|
const s = reactive({ tree: 180 as SplitPosition, fixed: 'first' as SplitPanel, log: '' });
|
|
359
359
|
let outer: SplitContainer | null = null;
|
|
@@ -567,9 +567,9 @@ Every container also has the shared properties of `Control`: `enabled` / `disabl
|
|
|
567
567
|
|
|
568
568
|
| Method | Returns | Description |
|
|
569
569
|
| --- | --- | --- |
|
|
570
|
-
| `Stack.setGrow(child, grow), growOf(child)` | `void`, value | A child's `grow`
|
|
571
|
-
| `Grid.setCell(child, cell), cellOf(child)` | `void`, `GridCell` | A child's `row`, `column`, `rowSpan`, `columnSpan`
|
|
572
|
-
| `DockPanel.setDock(child, dock), dockOf(child)` | `void`, `Dock` | A child's `dock`
|
|
570
|
+
| `Stack.setGrow(child, grow), growOf(child)` | `void`, value | A child's `grow` programmatically (a value or a function). |
|
|
571
|
+
| `Grid.setCell(child, cell), cellOf(child)` | `void`, `GridCell` | A child's `row`, `column`, `rowSpan`, `columnSpan` programmatically. |
|
|
572
|
+
| `DockPanel.setDock(child, dock), dockOf(child)` | `void`, `Dock` | A child's `dock` programmatically. |
|
|
573
573
|
| `DockPanel.setAnchors(child, anchors)` | `void` | The `left` / `top` / `right` / `bottom` of a `float` child. |
|
|
574
574
|
| `SplitContainer.collapse(pane?), restore()` | `void` | Hides a pane (the first by default) / shows both again. |
|
|
575
575
|
| `GroupBox.focus()` | `boolean` | Focuses the first control inside, opening a collapsed box. |
|
package/docs/listbox.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ListBox
|
|
2
2
|
|
|
3
|
-
> Data · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Data · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
A list that stays on the page. One item or several are chosen with the keys or the pointer; items come from memory or from a data source, can be searched and grouped, and long lists draw only the rows in view.
|
|
6
6
|
|
|
@@ -11,9 +11,9 @@ import { ListBox } from '@motifx-community/ui';
|
|
|
11
11
|
import { data } from '@motifx-community/data';
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Declarative and programmatic
|
|
15
15
|
|
|
16
|
-
`items` can be plain values; `x-model` binds the value. Created with `new`, the same properties are set
|
|
16
|
+
`items` can be plain values; `x-model` binds the value. Created with `new`, the same properties are set programmatically.
|
|
17
17
|
|
|
18
18
|
```tsx
|
|
19
19
|
/** The cities the lists of the examples show. */
|
|
@@ -255,20 +255,20 @@ A prop whose value is a function of its own (`textField`, a template) takes the
|
|
|
255
255
|
|
|
256
256
|
## Example files
|
|
257
257
|
|
|
258
|
-
`
|
|
258
|
+
`Programmatic.tsx`
|
|
259
259
|
|
|
260
260
|
```tsx
|
|
261
261
|
import { reactive } from '@motifx/core';
|
|
262
262
|
import { Button, ListBox, Stack } from '@motifx-community/ui';
|
|
263
263
|
import { cities } from './cities';
|
|
264
264
|
|
|
265
|
-
/** A list bound with x-model, and lists created with `new` and added
|
|
266
|
-
export default function
|
|
265
|
+
/** A list bound with x-model, and lists created with `new` and added programmatically. */
|
|
266
|
+
export default function Programmatic() {
|
|
267
267
|
const form = reactive({ city: 'İzmir' as string | null, result: '' });
|
|
268
268
|
let added = 0;
|
|
269
269
|
let host: Stack | null = null;
|
|
270
270
|
|
|
271
|
-
const
|
|
271
|
+
const addProgrammatic = () => {
|
|
272
272
|
const list = new ListBox<string, string>({ label: `Size ${++added}`, items: ['S', 'M', 'L', 'XL'], height: 4 });
|
|
273
273
|
list.onValueChanged((e) => (form.result = `${list.label}: ${e.value}`));
|
|
274
274
|
host?.controls.add(list);
|
|
@@ -280,7 +280,7 @@ export default function FromCode() {
|
|
|
280
280
|
<ListBox label="&City" items={cities} x-model={() => form.city} />
|
|
281
281
|
<Stack orientation="horizontal" wrap align="center">
|
|
282
282
|
<output class="lb-city">{() => `city: ${form.city ?? '—'}`}</output>
|
|
283
|
-
<Button text="Add a list
|
|
283
|
+
<Button text="Add a list programmatically" variant="outline" onclick={addProgrammatic} />
|
|
284
284
|
<output class="lb-made">{() => form.result}</output>
|
|
285
285
|
</Stack>
|
|
286
286
|
<Stack orientation="horizontal" wrap align="center" ref={(c: Stack) => (host = c)} />
|
package/docs/loadpanel.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# LoadPanel
|
|
2
2
|
|
|
3
|
-
> Feedback · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Feedback · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
A “loading” layer over a container or the whole page: a shade, a pane with the kit’s spinner and a message, a Cancel button when the work can be stopped. Nothing under it can be used meanwhile, and focus comes back afterwards.
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ import { LoadPanel } from '@motifx-community/ui';
|
|
|
12
12
|
|
|
13
13
|
## Over a container
|
|
14
14
|
|
|
15
|
-
`target` names the component or element it covers; `value` (or `x-model`) shows and hides it, `show()` and `hide()`
|
|
15
|
+
`target` names the component or element it covers; `value` (or `x-model`) shows and hides it, `show()` and `hide()` programmatically. `delay` keeps quick work from flashing it.
|
|
16
16
|
|
|
17
17
|
```tsx
|
|
18
18
|
import { reactive } from '@motifx/core';
|
|
@@ -129,7 +129,7 @@ export default function Options() {
|
|
|
129
129
|
| `Over the page` | Without a `target`, it covers the viewport and the rest of the page is inert. |
|
|
130
130
|
| `Focus` | Focus that was under it waits on the panel (on the Cancel button when there is one) and goes back where it was when the panel hides. |
|
|
131
131
|
| `Delay` | Quick work shows nothing: it comes after `delay`, and a hide before that cancels it. |
|
|
132
|
-
| `Spinner.cover` | The kit’s spinner covers a container
|
|
132
|
+
| `Spinner.cover` | The kit’s spinner covers a container programmatically in one call (`Spinner.cover`); the load panel is the component with the pane, the message, the delay and the button. |
|
|
133
133
|
|
|
134
134
|
## Accessibility
|
|
135
135
|
|
|
@@ -179,6 +179,6 @@ export default function Options() {
|
|
|
179
179
|
| --- | --- | --- |
|
|
180
180
|
| `onShown, onHidden` | event | It came on the screen (after its delay); it went. |
|
|
181
181
|
| `onCancel` | event | The Cancel button was pressed, or Escape; the panel hides after. |
|
|
182
|
-
| `show(), hide(), cancel()` | `boolean` / `void` |
|
|
182
|
+
| `show(), hide(), cancel()` | `boolean` / `void` | Programmatically; `show()` is `false` while it is shown or waiting for its delay. |
|
|
183
183
|
| `isShown` | read-only | Whether it is on the screen now. |
|
|
184
184
|
| `spinner, cancelButton` | read-only | The kit’s spinner and button in the pane. |
|
package/docs/lookup.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Lookup
|
|
2
2
|
|
|
3
|
-
> Choice · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Choice · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
Picks one row of a table-like list, typically from a data source searched on the server: a customer by its company, contact and city. The field shows the chosen row's text; everything else works as in DropDown.
|
|
6
6
|
|
package/docs/menus.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MenuBar and ContextMenu
|
|
2
2
|
|
|
3
|
-
> Buttons · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Buttons · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
A menu bar of an app (File, Edit, View) and the menu that opens on a right-click. Both show the same menu items: submenus, check and radio items, shortcuts, access keys.
|
|
6
6
|
|
|
@@ -298,7 +298,7 @@ Menus write no text of their own: every label, shortcut and name comes from your
|
|
|
298
298
|
| --- | --- | --- |
|
|
299
299
|
| `MenuBar.open(item \| index)` | `boolean` | Opens a top item’s menu with focus on its first item. |
|
|
300
300
|
| `MenuBar.close()` | `void` | Closes the open menu. |
|
|
301
|
-
| `ContextMenu.open(at, target?)` | `boolean` | Opens it
|
|
301
|
+
| `ContextMenu.open(at, target?)` | `boolean` | Opens it programmatically, at `{ x, y }` or at an element. |
|
|
302
302
|
| `ContextMenu.close()` | `void` | Closes it. |
|
|
303
303
|
| `MenuBar.refresh(), ContextMenu.refresh()` | `void` | Your items may be plain or reactive; the menu reads them as they are. After changing them in place, call `refresh()`. The bar, the open menu and its submenus follow. |
|
|
304
304
|
| `attachContextMenu(target, items)` | `() => void` | Gives an element or component a menu; `items` can be a function of the opening (`e.target`). Returns the remover. |
|