diff --git a/docs/guides/upgrade-guide.md b/docs/guides/upgrade-guide.md index 138aa4e0a3..35249e8a29 100644 --- a/docs/guides/upgrade-guide.md +++ b/docs/guides/upgrade-guide.md @@ -76,6 +76,37 @@ The new icons automatically sync with theme changes, support all InstUI color to - `alert` color has been removed. Please use `primary` instead. - Some prop values have been deprecated, see [Text](/Text) for more details. +### Pill + +#### Deprecated color prop values + +The following `color` prop values have been **removed**: + +- `'danger'` - use `'error'` instead +- `'alert'` - use `'info'` instead + +#### Theme variable changes + +- theme variable `fontFamily` has been added +- theme variable `padding` has been renamed to `paddingHorizontal` (now only controls horizontal padding) +- theme variable `background` has been renamed to `backgroundColor` +- theme variable `primaryColor` has been split into: + - `baseTextColor` (for text color) + - `baseBorderColor` (for border color) +- theme variable `successColor` has been split into: + - `successTextColor` (for text color) + - `successBorderColor` (for border color) +- theme variable `infoColor` has been split into: + - `infoTextColor` (for text color) + - `infoBorderColor` (for border color) +- theme variable `warningColor` has been split into: + - `warningTextColor` (for text color) + - `warningBorderColor` (for border color) +- theme variable `dangerColor` has been removed, replaced with: + - `errorTextColor` (for text color) + - `errorBorderColor` (for border color) +- theme variable `alertColor` has been removed (use `info*` variables instead) + ## API Changes ### Focus rings diff --git a/packages/ui-pill/src/Pill/README.md b/packages/ui-pill/src/Pill/README.md index 7b70469b41..cfc02bc079 100644 --- a/packages/ui-pill/src/Pill/README.md +++ b/packages/ui-pill/src/Pill/README.md @@ -11,85 +11,6 @@ you can use the `statusLabel` prop to add a label to the left of the main text. --- type: example --- -
- - -
- - Excused - - - Draft - - } - color="success" - margin="x-small" - > - Checked In - - } - color="warning" - margin="x-small" - > - Late - - } - color="error" - margin="x-small" - > - Notification - -
-
- -
- - Excused - - - Draft - - } - color="success" - margin="x-small" - > - Checked In - - } - color="warning" - margin="x-small" - > - Late - - } - color="error" - margin="x-small" - > - Notification - -
-
-
} + renderIcon={} color="success" margin="x-small" > Checked In } + renderIcon={} color="warning" margin="x-small" > Late } + renderIcon={} color="error" margin="x-small" > Notification
-
- -
- - Excused - - - Draft - - } - color="success" - margin="x-small" - > - Checked In - - } - color="warning" - margin="x-small" - > - Late - - } - color="error" - margin="x-small" - > - Notification - -
-
-
``` The component has a `max-width`, set by its theme. Any overflowing text will be handled via ellipses. diff --git a/packages/ui-pill/src/Pill/styles.ts b/packages/ui-pill/src/Pill/styles.ts index e12ecf26af..0ba45ffece 100644 --- a/packages/ui-pill/src/Pill/styles.ts +++ b/packages/ui-pill/src/Pill/styles.ts @@ -68,15 +68,15 @@ const generateStyle = ( label: 'pill', display: 'flex', alignItems: 'center', - justifyContent: 'center', boxSizing: 'border-box', padding: `0 ${componentTheme.paddingHorizontal}`, background: componentTheme.backgroundColor, borderWidth: componentTheme.borderWidth, borderStyle: componentTheme.borderStyle, borderRadius: componentTheme.borderRadius, - /* line-height does not account for top/bottom border width */ - lineHeight: `calc(${componentTheme.height} - (${componentTheme.borderWidth} * 2))`, + fontFamily: componentTheme.fontFamily, + height: componentTheme.height, + lineHeight: componentTheme.lineHeight, ...pillColorVariants[color!] }, status: {