v14.0.0 #1880
booc0mtaco
started this conversation in
General
v14.0.0
#1880
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
14.0.0 (2024-03-05)
Storybook
⚠ BREAKING CHANGES
remove Grid and Section from exports (#1876)
Text: remove deprecated props (#1873)
size
propThe
size
prop, being redundant, is now replaced by the more expressivepreset
prop, which contains all the semantic (tier-2) tokens by name. Each of thesize
values corresponds to a specific and existingpreset
value, listed in the following table:size
preset
In usages of
size
, you can remove the prop. If there is no preset defined for the instance ofText
, you can use the table above to replace thesize
prop and value with the equivalent preset.weight
propInstead of specifying
weight
on any instance ofText
, you can instead use utility classes or styles to add an override tofont-weight
. Thepreset
values specify weight in addition tofont-size
,line-height
, and other details so overrides like this should be rare.One example to apply this weight override is to use
font-*
or use the relevant CSS properties to adjust the weight.variant
propvariant
overlapped with the utility classes, and served as a namespaced subset of the actual color tokens, in some cases changing the name of the token in the API. We remove variant in favor of utility classes, similar to weight adjustments. For eachvariant
value, the equivalent token to use can be found in the following table:variant
Use the following table to match design intent to code equivalent, referencing the table above. For example, if the code currently uses
variant="neutral-medium"
, convert by removing that, and addingclassName="text-neutral-default"
or usingcolor: var(--eds-theme-color-text-neutral-default)
in a stylesheet.fontSize
from default tailwind configThe existing tailwind config is redundant, as it only partially overlaps the more expressive
preset
field onText
, and lacks the precision of the typography tokens. Along with cleaning up these settings, we also remove a mismatch betweenText
andHeading
(which did not sync up with the associatedpreset
s of either component). This restores the default values provided by tailwind.Heading: remove deprecated props and refactor usages (#1872)
size
prop (in favor ofas
)size
, marked as deprecated before, is now removed fromHeading
. Instead ofsize
, you can now use combinations ofas
andpreset
to get access to both default and custom typography presets. Here's the mapping for the<h*>
tags to thepreset
:size
=>as
preset
headline-lg
headline-md
headline-sm
title-md
title-sm
title-xs
If you used any of the
size
values that map to the HTML heading tags, you can update the prop name fromsize
toas
. Ifpreset
is specified, and it matches the default value from the table above, you can removepreset
.If you used any of the
size
values that map to existing presets, you can update the prop name fromsize
topreset
. Before, the component would convert thesize
value to a relevant defaultas
tag. You can use the inverse of the table (reading right to left) to determine whichas
tag to use if one is not provided.NOTE:
as
now has a default value of"h1"
. You will get accessibility errors ifas
is not provided in the latter cases.variant
prop (in favor of utility classes)The
variant
prop did some of the work of a utility class, by mapping key values to color token usages. However, these named variants didn't match the token naming scheme, and did not provide a set of values that spanned the full set of possible use cases. With this change, we remove this prop, allowingHeading
to inherit color like normal. Internal components that need to specify a color can now do so in component styles, and this makes it easier to customize the color of any heading using component or utility class values.variant
--eds-theme-color-text-utility-error
--eds-theme-color-text-brand-default
--eds-color-info-700
--eds-theme-color-text-neutral-subtle
--eds-theme-color-text-neutral-default
--eds-theme-color-text-neutral-strong
--eds-theme-color-text-utility-success
--eds-theme-color-text-utility-warning
--eds-theme-color-text-neutral-default-inverse
When removing
variant
you can use the table above to refactor to the desired utility class, token, or custom class. Refer to this document for the names of tailwind classes to convert to if used.Examples
<Heading ... variant="error">
=>:<Heading ... className="text-utility-error">
<div className="text-utility-error"><Heading ...></div>
NOTE:
variant="info"
used a tier-1 token directly, which is a violation. Since this is no longer provided internally, this is a reminder that only tier 2 and above tokens should be used in styling and design.Some composed components used or borrowed from the Heading component API. You will see no changes in the following components' usages:
Heading
andModal
Modal
has one change to its API in support of this cleanup. Instead of specifyingsize
like before, we now usepreset
(which comes fromHeading
). By default,Modal
instances useh2
for the level in their titles. Again, you can reference the table above underHeading
for how to update the prop value once moving over topreset
.Link: remove and reset deprecated props (#1871)
size
to availableThis is used sparingly, but will be used more effectively in the future.
fullWidth
from componentThis is a holdover from linkages to
Button
, so removing now that linkis its own component. Use utility classes to alter layout.
Select: remove deprecated props (#1870)
variant
from componentvariant
was partially implemented and inconsistent with othercomponents which have control for display width (they use boolean
fullWidth
). Remove this prop, and rely on utility classes for widthcontrol.
optionsAlign
Consumers should use the
placement
prop to control how to display thepopover. All popover-components share the same API for placement, as
determined by PopperJS.
When using
left
, you can setplacement="bottom-start"
and when usingright
, you can setplacement="bottom-end"
. See more documentation athttps://popper.js.org/docs/v2/constructors/#options
Label: remove deprecated props (#1868)
requiredLabel
from componentoptionalLabel
from componentneither of these are used, and removing them adds clarity and simplicity
to the component.
Also added an additional story to the component documentation for
clarity.
InputField: remove unused prop requiredLabel (#1869)
InlineNotification: remove deprecated props from component (#1867)
inactive
prop from componentThis had been marked as deprecated, so now removing. As of today, it is
not used in any components, and likely too specific a use case to
warrant the additional complexity. Usages of this should be removed from
code and associated designs.
yield
variantRemoving this variant, as it overlaps with the usage of the "warning"
prop, but is a different color and treatment. For users of the value,
designs and code should move to the "warning" value.
Card: deprecate orientation prop (#1866)
This prop was marked as deprecated so removing in this PR. Instead, rely
on consumers to provide any orientation and padding desired on the
sub-components.
Anyone using
orientation="horizontal"
can replace this with, e.g.,TailwindCSS utility class
flex-row
or a similar class definition onthe container.
Badge: deprecate name prop on component (#1865)
Removing this prop
name
for consistency with other components. Thepractice is that any component using another component in a prop should
use a camelCase version of the component's name. Because both were
supported, users of the now-removed
name
component can change the propto
icon
without any issue.Skeleton: deprecate .Rect subcomponent mapping (#1864)
Skeleton
provides the same functionality as.Rect
so simplify byremoving this abstraction.
In each case,
Skeleton.Rect
can be replaced withSkeleton
and retainthe same functionality.
Tag: remove deprecated props and update API (#1862)
We had both "warning" and "yield" as possible values for this
component's variants, which was confusing. Going forward, we will start
with just "warning", and remove this option from the component list. If
using "yield", please consider using "warning" instead, or some other
treatment.
IconName
to be consistent with allother components
This syncs up the headless Icon handling across all components, meaning
that the names and possible values are determined by the mapped icons,
and not any possible ReactNode instance. For consumers, replace any
usages of
<Icon />
with the string provided to this cmoponent. Anyother nodes used will have to be removed.
<Text />
and typography handlingsimplify the handling of type in this component by moving to use
preset
instead of the more<font>
like weight and size props, whichwill also be removed.
Tooltip: remove deprecated props (#1861)
align
prop, in place of the better-namedplacement
propThis has been marked as deprecated for a while now, so cleaning up the
code associated with this. In order to address in a consuming project,
you can replace
align
withplacement
in all use cases (this washappening internally already).
variant
propThe prop was used for a partially-implemented handling of light/dark
mode, and had been marked as deprecated. Removing now, making usage of
the light token values as the current, and only, option.
Tabs: combine Tab sub-component into Tabs
If you are importing any
Tabs
sub-components in your code, you can remove the import-import Tab from '@chanzuckerberg/eds';
... and replace any references to the sub-component with the following:
remove deprecated components
This includes all tests, usages in implementation examples, and stories.
output a single, cjs build
Supporting both cjs and esm is painful. esm is the future, but let's simplify
the EDS build for now, and then update to esm at some point in the future.
For more information: #1856
Features
Bug Fixes
This discussion was created from the release v14.0.0.
Beta Was this translation helpful? Give feedback.
All reactions