Releases: Workday/canvas-kit
v12.0.3
Codemod
- fix: Add codemod to main index file to export (#2996) (@mannycarrera4, manuel.carrera)
v12.0.2
Infrastructure
- fix: Remove duplicate keys from routes (#2994) (@mannycarrera4, manuel.carrera)
v12.0.1
Components
- chore: Update deprecated urls to CodeshiftCommunity (#2977) (@danieldelcore)
- fix: Clean up Select file structure and move examples to main react (#2992) (@mannycarrera4, manuel.carrera)
v12.0.0
BREAKING CHANGES
-
#2793 - Avatar no longer uses
SystemIconCircle
for sizing.Avatar.Size
is no longer supported. Thesize
prop type has change to accept the following:"extraExtraLarge" | "extraLarge" | "large" | "medium" | "small" | "extraSmall" | (string{})
Avatar.Variant
is no longer supported. EnumAvatarVariant
has been removed. Thevariant
type prop now accepts"dark" | "light"
- The
as
prop now accepts any element, not justdiv
.
-
#2674 Codemods formatting have been updated and users will need to format their files after the codemod has been used.
-
#2934 The newly promoted
FormField
is a
compound component.
Due to the different APIs of the component, this change is not codemodable. The following shows
an example of how to update your code to match the new compound component API.// v11 FormField in Main <FormField error={FormField.ErrorType.Alert} labelPosition={FormField.LabelPosition.Left} useFieldSet={true} required={true} hintId="hint-alert" hintText="Please enter a valid email." label="Email" > <TextInput onChange={handleChange} value={value} /> </FormField> // v12 Newly promoted FormField from Preview to Main <FormField error="error" orientation="horizontalStart" isRequired={true} > <FormField.Label>Email</FormField.Label> <FormField.Field> <FormField.Input as={TextInput} onChange={handleChange} value={value} /> <FormField.Hint>Please enter a valid email.</FormField.Hint> </FormField.Field> </FormField>
Noticeable changes:
error
prop takes in the following values:"error" | "alert"
.labelPosition
becomesorientation
with the following values:
"horizontal" | "horizontalStart" | "horizontalEnd" | "vertical"
.useFieldSet
is no longer valid. If you want to group inputs, use
FormFieldGroup
component.required
becomesisRequired
.hintId
is no longer needed. The component handles associating the hint text, label and input
automatically. If you wish to have a uniqueid
, you can add one onto theFormField
element.hintText
is no longer a valid prop. UseFormField.Hint
sub component.errorLabel
andalertLabel
are no longer valid props. Customizing your hint text inside of
FormField.Hint
.label
is no longer a valid prop. UseFormField.Label
sub component to render your label text.- Instead of rendering an input, ensure you use
FormField.Input
with theas
prop. This ensures
proper error handling and aria attributes for accessibility.
-
#2969 We've removed the
MenuItemProps
export from@workday/canvas-kit-react/menu
. UseExtractProps<typeof Menu.Item, never>
instead. We don't mean to export prop interfaces of polymorphic components. Thenever
means "don't add element props". The second parameter is used to pass the interface that theas
prop is pointing to. -
#2980
elemProps
hooks usingcomposeHooks
have more accurate type signatures which may lead to new type errors. For information, view our discussion. -
#2982 A list model's
navigation.getItem()
can returnundefined
if no item is found. Previously it threw an error, which cause many problems. It is now up to the caller to decide what to do with anundefined
return value
Components
-
chore: Removed Select in Preview (#2796) (@thunguyen19, manuel.carrera, @mannycarrera4)
We've removed theSelect
component that was in@workday/canvas-kit-preview-react
. Please use theSelect
in Main (https://workday.github.io/canvas-kit/?path=/docs/components-inputs-select--basic) which is a compound component and offers more flexibility.Thank You Picture
-
chore: Modal, Dialog, Popup and Toast Styles Refactor (#2795) (@josh-bagwell)
UpdatedModal, Dialog, Popup and Toast
to use newsystem
tokens and style utilities. -
chore: Removal of InputIconContainer (#2838) (@josh-bagwell)
We've removedInputIconContainer
from Main. Please useInputGroup
from Main instead. -
chore: Refactor TextArea and TextInput with new styling utilities (#2825) (@mannycarrera4, manuel.carrera, @NicholasBoll)
We've updatedTextInput
andTextArea
to use our new Tokens and styling utilities. The React interface has not changed, but CSS variables are now used for dynamic properties. -
chore: Update Avatar to use createStencil and createComponent (#2793) (@kaconant, krissy.conant, @mannycarrera4, manuel.carrera)
The Avatar component has been refactored to use our new tokens and styling utilities. The changes below highlight the breaking changes to the API. -
feat: Add horizontal start and end label position for form field (#2881) (@mannycarrera4, manuel.carrera, @josh-bagwell)
The orientation prop on the FormField component will be updated to accept the following values:vertical
,horizontalStart
, andhorizontalEnd
.horizontal
will still be accepted as a value in v12, but it will be deprecated and slated for removal in a future major release. These changes are intended to provide more flexibility with label alignments on FormField elements.Instances where the orientation prop of the FormField component is set to
horizontal
will automatically default tohorizontalStart
via a codemod. A console warning message will also appear with a message to change the prop value to either horizontalStart or horizontalEnd. -
chore: Updated unique id generation for classnames (#2913) (@josh-bagwell, @mannycarrera4)
-
chore: Add FormFieldGroup component and density example (#2865) (@mannycarrera4, manuel.carrera, @josh-bagwell, @RayRedGoose)
-
We've added a new
FormFieldGroup
component to use when grouping inputs like checkboxes and radio inputs that need to be associated to one another. Its API matches theFormField
API where you haveerror
prop as well asid
isRequired
andorienation
. -
orientation
has been added back touseFormFieldModel
to better support sub component styling. -
Styles have been cleaned up to use
gap
for proper spacing between labels, inputs and hint text. -
Added a new
FormField.Field
component to ensure proper alignment between label and inputs regardless of orientation and hint text. Ensure to wrap your inputs and hint text in this component.
-
-
chore: Revert Select Preview Removal (#2933) (@josh-bagwell)
-
feat(text-input): Support CSS Variables in InputGroup (#2935) (@NicholasBoll)
-
feat: Promote FormField from Preview to Main (#2934) (@mannycarrera4, manuel.carrera, @josh-bagwell)
We've promoted FormField from Preview to Main. The following changes have been
made to provide more flexibility and better explicit components when using inputs.- The orientation prop on the
FormField
component will be updated to accept the following values:
vertical
,horizontalStart
, andhorizontalEnd
.horizontal
will still be accepted as a value
in v12, but it will be deprecated and slated for removal in a future major release. These changes
are intended to provide more flexibility with label alignments onFormField
elements.
Note: The horizontal alignment of start and end are relative to its container, meaning start
and end match the flex property offlex-start
andflex-end
. This is especially applicable for
moving between RTL (right-to-left) and LTR (left-to-right) languages.Note: Orientation "horizontal" has been deprecated. You will see a console warn message
suggesting to update your types and usage tohorizontalStart
,horizontalEnd
orvertical
.-
useFormFieldModel
:orientation
has been added back intouseFormFieldModel
. While we still
support compat mode due to
style merging issues, having orientation
on the model allows for proper styling of sub components. -
Styles clean up.
FormField.Hint
andFormField.Label
where usingmargin
for spacing. We've
updated styles ...
- The orientation prop on the
v11.1.17
Components
- fix: Unbroken String Overflow Menu Item Fix (#2975) (@josh-bagwell)
A fix to Menu Item to break a long unbroken string forSelect
.
v10.3.63
Components
- fix: Unbroken String Overflow Menu Item Fix (#2975) (@josh-bagwell)
A fix to Menu Item to break a long unbroken string forSelect
.
v11.1.16
Components
- chore: Fixed Button Style Merge Issue (#2951) (@josh-bagwell, manuel.carrera)
Updates Button variants to fix merge style issue.
v11.1.15
Infrastructure
- fix: Remove extract docs in canary to prevent exceeding limit (#2948) (@mannycarrera4, manuel.carrera)
Styling
- fix: Support false modifier values (#2952) (@NicholasBoll)
v11.1.14
Components
- fix: Update BaseButton to use correct theming color for focus ring (#2942) (@josh-bagwell)
Fixes theming for theBaseButton
withinPagination
.
v10.3.62
Components
- fix: Update BaseButton to use correct theming color for focus ring (#2942) (@josh-bagwell)
Fixes theming for theBaseButton
withinPagination
.