Repository navigation
v0.202.0
Minor Changes
-
#1582
2e9ae4b86Thanks @tenphi! -Dividerapplies its style props (margin,widthand the rest of its documented set), which it used to drop silently, and takes a neworientation="vertical"prop that renders a vertical separator stretching to the height of its row. It no longer claims thedividergrid area: inside a grid it now takes the next cell, where it used to land in an extra implicit column with zero width. A divider with text is now a separator named by that text for screen readers, and every divider carriesdata-qa="Divider"unless you passqa. A component built withtasty(Divider, …)now renders a real<hr>separator too, where it used to render adivwith no role, so screen readers announce it; hide one that is only decoration witharia-hidden. -
#1586
045328aeeThanks @tenphi! - Breaking: an input's style props now place and size its outer element: the field wrapper when its chrome renders, the input itself when it is bare. Adding a label no longer moveswidth,height,flex*,gridArea,margin,inset,positionorzIndexfrom the field to the control inside it. When style props size a wrapped field, the input stretches to fill it, unless it has a fixed or capped size of its own (CheckboxandSwitchkeep their content width, single-line inputs and a verticalSlidertheir height).stylesstill styles the input andfieldStylesthe wrapper; a style prop wins overfieldStylesfor the same key, and only style props make the input fill the field.This applies to every field-level input: the
TextInputfamily,SearchInput,ColorInput,ComboBox,SearchComboBox,Select,Picker,FilterPicker,ListBox,FilterListBox,TagInput,Checkbox,CheckboxGroup,RadioGroup,Switch, the sliders, the date and time inputs and pickers,FileInput,ColorPickerandColorSwatchGroup. They now take exactly the position and dimension style props (FieldLayoutStyleProps, exported). Every other style prop is removed from them: the base, block, color and flow groups, such asfill,color,border,radius,shadow,outline,padding,preset,font,display,hide,opacity,transition,textAlign,overflow,flow,gap,place,placeItems,placeContent,align,alignItems,alignContent,justify,justifyItemsandjustifyContent(placeSelf,alignSelfandjustifySelfstay). Pass those throughstyles.Migrating: on a labelled field, check style props that used to size the control. A side-label field's
widthnow includes the label column, andheightincludes the label and texts. To size the control alone, usestyles={{ width }}. A state map on a style prop now resolves against the wrapper on a labelled field, so use media, container or root states there, not input states such asfocused.className,style,qaandrefnever move to the wrapper. AfieldStylesused only to place or size the field can become style props.Fixes:
DateInput,TimeInputandFileInputnow apply theirstylesand style props, which they dropped before.RangeSliderforwardsstyles.fieldProps.modsadds to the mods a field wrapper computes instead of replacing them, and anullinfieldStylesorfieldProps.stylesnow resets that key on the wrapper. -
#1585
51727506aThanks @tenphi! -EscapeandTabfollow one rule in every field you type into: they go on to a surrounding dialog, which closes onEscapeand moves focus onTab, unless the field acts on the key or youronKeyDowncallse.preventDefault(). A preventedEscapeorTabstays at the input. Check your handlers:TextInput,TextArea,PasswordInputandSearchInputwith anonKeyDownno longer holdEscapeandTab, so a handler that acts onEscapeinside a dialog needse.preventDefault()to keep the dialog open.ColorInputand an idleSearchComboBoxno longer swallow them. InNumberInput,TagInputandCommandTextAreaa prevented one no longer reaches the dialog, so aTabthat inserts aCommandTextAreaoption keeps focus in the field.ComboBoxnow lets theEscapeorTabthat ends an IME composition in Safari reach the dialog too, like every other field. -
#1587
cc25d5547Thanks @tenphi! - Add tree-shaped options toFilterPicker: passtreeData(withexpandedKeys,defaultExpandedKeysandonExpand) and the popover shows a checkableTreeunder the usual header, search and footer. Tree mode is always multiple selection. Its value is every fully checked key, parents included, in tree order: checking a parent checks its children, and a partly checked parent is half-checked. The cascade runs over the whole tree, so a search never unchecks the nodes it hides. A search keeps each match with its subtree and opens the ancestors of deeper matches, then restores the user's expansion when it clears. Focus stays in the search input, which drives the active row: arrows move it, Right and Left open and close it, Space toggles it while the search is empty, and Enter toggles it and closes the popover. The default summary lists the topmost checked nodes, andrenderSummaryreceives every checked key in tree order. Nothing in the tree is a tab stop, so Tab moves from the search to the footer.childrenis now optional inCubeFilterPickerProps, since a tree-mode picker has none.Treechanges that come with it: a node's newtextValuenames its checkbox whentitleis not a string, and aTreewith anidgives each row an id derived from it. IndefaultCheckedKeysand the array form ofcheckedKeys, a parent key now checks its whole subtree, as in AntD; before, a parent listed without its children rendered unchecked. That holds for a parent whose own checkbox is disabled too, and in an uncontrolledTreea parent the user checked also checks the childrenloadDataadds under it later. Checking, unchecking and conducting a parent key now pass through a node whose checkbox is disabled or hidden to the eligible nodes below it, matching how a parent's state already followed them; before, a click stopped at that node and could leave the parent stuck half-checked. The object form{ checked, halfChecked }is taken as given, as before. Rows no longer carryaria-checked, whichrole="row"does not support (axearia-allowed-attr); each row's checkbox still reports checked and mixed, and the row keeps itsdata-checkedanddata-indeterminateattributes, so a test that read the row'saria-checkedshould read one of those. -
#1586
045328aeeThanks @tenphi! -Picker,FilterPickerandColorPickertake their trigger's tooltip astooltip, asSelect,ButtonandItemdo.triggerTooltipstill works, but it is deprecated and logs a one-time warning in development. The info badge next to a field's label stayslabelTooltip. -
#1591
363a6c8d7Thanks @tenphi! - Read-only fields no longer look editable.isReadOnly, on a field or from a read-onlyForm,Checkbox.GrouporRadio.Group, now sets areadonlymod and a default look: a recessed fill, with the value and label at full contrast. A text box also takes a softer border, except in high contrast. A checkedCheckbox, an onSwitchand a selected classicRadioshow the unchecked outline and a dark mark in place of the brand fill. A read-only field takes no hover state. This coversTextInput,TextArea,PasswordInput,SearchInput,NumberInput,CommandTextArea,ColorInput,TagInput,ComboBox,SearchComboBox,DateInput,TimeInput,DatePicker,DateRangePicker,DateRangeSeparatedPicker,PeriodPicker,Checkbox,SwitchandRadio. Button and tabs radios get the mod and lose their hover state and pointer cursor, and keep their look. Style thereadonlykey instylesorinputStylesto change the look. -
#1583
b727ba8c0Thanks @tenphi! - Add atooltipprop toSwitch, asCheckboxhas: a string orTooltipProviderprops, shown on hover over the switch and its inline label and on keyboard focus, and describing the input to screen readers. A disabled switch with a tooltip stays focusable, markedaria-disabledand inert, so the keyboard reaches the reason it is disabled; not being natively disabled, a switch that is on is part of a plain<form>'s submitted data. Without a tooltip it is natively disabled, as before. Wrapping a disabled switch inTooltipProvideropens nothing, since it takes no trigger props while disabled; usetooltipinstead. On a labelled switch,tooltipis now the switch's own tooltip rather than the old spelling oflabelTooltip, so it no longer warns; the info badge is stilllabelTooltip. -
#1592
23d29d04aThanks @tenphi! -TextInput,NumberInput,PasswordInput,SearchInput,TextAreaandCommandTextAreatake atooltipof their own, asCheckboxandSwitchdo: a string, orTooltipProviderprops. It is anchored to the field box, opens on hover over it and on keyboard focus, closes on any key, and describes the input. A firstEscapeonly closes it, so it doesn't clear aSearchInputor close a dialog. A disabled input with atooltipstays focusable so the keyboard reaches it too: it isaria-disabledand read-only instead of natively disabled, takes no text, doesn't step, and a click on it or on its label doesn't focus it. Not being natively disabled, its value is part of a plain<form>'s submitted data; ui-kit'sFormis not affected.tooltipwas the old name oflabelTooltip, so a caller still passing it for the label badge now gets an input tooltip and no migration warning: rename it tolabelTooltip.
Patch Changes
-
#1583
b727ba8c0Thanks @tenphi! - Keep a disabledCheckboxfocusable while it has atooltip, as a disabledRadioandButtonalready are, so the keyboard can open the tooltip as the mouse does: it is usually the reason the checkbox is disabled. This covers a checkbox disabled on its own and one in a disabledCheckbox.Group. Such a checkbox is markedaria-disabledand stays inert:Spaceand clicks on the box or its label change nothing. Not being natively disabled, a checked one is part of a plain<form>'s submitted data. A disabled checkbox without a tooltip is natively disabled, as before. -
#1593
badb2dc57Thanks @tenphi! - ARadioGroup(includingRadio.ButtonGroupandRadio.Tabs) orCheckboxGroupgivenisDisabled={false}inside a disabled<Form>or<Provider>now enables its options, as an explicitfalsedoes on every other field. Before, the group itself was enabled but each option stayed disabled. The same holds for aCheckboxGroupgivenisReadOnly={false}inside a read-only form. A group that sets neither prop still follows its form, and an option givenisDisabledis still disabled inside an enabled group. A group'sisReadOnlynow also makes other fields rendered inside it read-only, such as aTextInputnext to its options, as itsisDisabledalready disabled them. A loading button radio is now disabled unless the radio itself setsisDisabled={false}: afalseit inherits from its group, form or provider no longer keeps it clickable while it loads. -
#1588
7d60390d0Thanks @tenphi! - A disabledSlider,RangeSliderorHueSlideris now disabled as a whole field: its label is muted and its message hidden, as on every other disabled field. Before,isDisabledreached only the track and thumbs. In a disabled form, the track now looks disabled too, and an explicitisDisabled={false}enables the slider there, as it does every other field. -
#1589
0db331834Thanks @tenphi! - A field givenisDisabled,isReadOnly,isRequired,isInvalidorisValidasundefinednow keeps the state of its enclosing<Form>or<Provider>, as it does when the prop is left out. Before, theundefinedreplaced it, so a wrapper passing an optionalisDisabledthrough rendered an enabled field inside a disabled form. An explicittrueorfalsebehaves as before. This applies everywhereuseProviderPropsis used: every input,SearchInput,SearchComboBox,Label, the calendars and a nestedForm. Form presentation props such aslabelPosition, andformitself, are unchanged:form={undefined}still detaches a field from its form.