Learn / Upgrading to 0.41

foldkit-mixins-ui: the widgets

A widget's fixed text is one words object. The labels objects, the *Label options and the functions of a count are gone. A word is text with {blanks}, and you pass only the words you change. This touches Command, Tour, Carousel, Questionnaire, Pagination, Toast, TagsInput, Rating, Slider, SignaturePad, ImageCropper, FloatingPanel and others.

diff
- Questionnaire.view({ ...options, submitLabel: 'Send', nextLabel: 'Continue' }, h)
+ Questionnaire.view({ ...options, words: { submit: 'Send', next: 'Continue' } }, h)
- TagsInput.view({ ...options, words: { remove: tag => `Remove ${tag}` } }, h)
+ TagsInput.view({ ...options, words: { remove: 'Remove {tag}' } }, h)
- Carousel.view({ ...options, slideLabel: … }, h)
+ Carousel.view({ ...options, words: { slide: '{index} of {count}' } }, h)

Words are text, not functions, because a function inside a widget's view inputs cannot be drawn through h.submodel.

A feature that pulls in code is a value you import and pass, so a page that does not pass it does not ship it:

diff
- Table.view({ ...options, fluid: true }, h)
+ Table.view({ ...options, fluid: Table.fluid }, h)
- Table.view({ ...options, selection: { ...selection, checkbox } }, h)
+ Table.view({ ...options, selection: { ...selection, control: Table.checkboxes(CheckboxStyle) } }, h)
- Breadcrumb.view({ ...options, collapse: { max: 3, menu } }, h)
+ Breadcrumb.view({ ...options, collapse: BreadcrumbMenu.make({ max: 3, menu }) }, h)
- Chart.view({ ...options, kind: 'bar' }, h)
+ Chart.view({ ...options, kind: Chart.bars }, h)
- Avatar.view({ ...options, src: { asset, provider, width } }, h)
+ Avatar.view({ ...options, picture: Avatar.picture({ asset, provider, width }) }, h)

Picker.view takes a choice (Picker.one(items)) and a value where it took options and an Option.

One clear option, one tone name, one argument order:

diff
- SearchField.view({ ...options, onClear: Message.Cleared() }, h)
+ SearchField.view({ ...options, clear: { onClear: Message.Cleared() } }, h)
- CascadeSelect.view({ ...options, clearable: true }, h)
+ CascadeSelect.view({ ...options, clear: true }, h)
- Recipes.Alert({ tone: 'error' })
+ Recipes.Alert({ tone: 'danger' })
- AppShell.view(options, main, h)
+ AppShell.view({ ...options, main }, h)

The tone error is danger on Progress too. A SearchField given no clear has neither the button nor Escape's clearing.

Smaller changes, each a type error where it applies:

Keyboard and ARIA behaviour changes that compile either way: Home and End in a Combobox move the caret in the field; a single-choice Segmented is a radio group; Skeleton and Spinner are role="status" only. Each has its entry in the changelog.