Browser
now has aredirectAfter
method that redirects to the given URL after the given number of seconds.Menu
now outputs semantic HTML. Links are rendered in HTML lists, with submenus rendered with nested lists.CustomDragLayer
component can now take className prop.Draggable Context
extending functionality to determine if a an item can be dropped on.
- Upgraded carbon-factory to v4.2.2 to support Window environments.
- Travis CI now sets --maxWorkers=2 for npm test to reduce chance of timeouts
- Remove
gulp
as Carbon now uses webpack.
- Add a blue background to fix a 'white text on a white background' issue when selecting rows in the
Table
component with the secondary theme applied. - No longer render a
type
attribute for theIcon
component, as this produced invalid HTML (theIcon
component still accepts atype
prop).
Modal
now has atransitionAppear
andtransitionAppearTimeout
defined on itsCSSTransitionGroup
components so there will be animation on initial mount
- Require npm@6.
- Update packages to resolve issues highlighted by
npm audit
.
Carbon was previously designed around a Browserify based build, we have now migrated to explicitly support Webpack. We have made this decision based on the overwhelming preference in the JavaScript community to work with Webpack, while over the past couple of years support for Browserify has dropped and the library has not been able to keep up with the pace of Webpack. Switching to Webpack also provides us with all the latest development tools such as faster recompilation, hot reloading, and code splitting.
We have updated several components to import assets through their JavaScript file. Due to this change we now require Webpack to precompile the components.
If you use carbon-factory, you can upgrade to v4.1.0 which provides preconfigured Webpack support for working with the Carbon library. If you prefer to manage your own Webpack build, we currently rely on the Parcelify Loader. We will be looking to drop this requirement in the future.
- Fixed #1741:
Flash
component will now open on initial render when itsopen
prop is set totrue
.
- Position textarea label at the top of the component
- Prevent hover styles being applied when hovering over a readonly or a disabled
input
element.
Merged in v3.1.6
Merged in v3.1.5
Merged in v3.1.3 and v3.1.4
Flash component now uses Portal
- Tutorials are now numbered correctly in the Carbon Demo sidebar.
- Demo Site should now correctly deploy in production mode
Preview adds a CSS shimer animation as a placeholder if no children are given or the loading prop is true.
With no children:
<Preview>
{ null }
</Preview>
Using the loading
prop:
<Preview loading>
{ children }
</Preview>
AnimatedMenuButton
,Carousel
,Flash
,ShowEditPod
,Table
, andToast
all pass thecomponent='div'
prop to their respectiveCSSTransitionGroup
components. This fixes incorrectly nested HTML e.g.<div>
tags nested within<span>
tags.- Allow localisation override by removing manual interpolation on
FormSummary
.
Fixes the positioning of the error message which was also not working in IE11 (pageYOffset needed instead of scrollY)
Fixes incorrect dropdown placement in IE11. v3.1.4 only fixed Edge #1733
Fixes incorrect dropdown placement in IE.
Stops incorrect Dirty Form warning from showing in Safari/IE on a clean form
Fixes auto-deployment of tags using Travis CI.
A unique ID has been added to the Portal component entrance and exit nodes. This will help find corresponding nodes in the DOM.
Form autoDisables after submit when the prop autoDisable
is set to true. The props afterFormValidation
and onSubmit
are passed a enableForm
callback function which can be used to reactivate the form.
<Form
onSubmit={ this.saveContact }
autoDisable
>
{children}
</Form>
saveContact = (ev, valid, enableForm) => {
...
Actions.submitForm(...);
enableForm();
};
- Input has 2 new props.
onChangeDeferred
allows a deferred callback after an onChange event.deferTimeout
allows you to customise the default:750
. - Form has 1 new prop.
unsavedWarning
allows a confirmation popup to appear when the user attempts to navigate away from a form they have edited but not saved. True by default. Does not trigger on React Router page transitions. Does not consistantly trigger with browser back/forwards actions. To be reviewed when react-router is upgraded to v4 to use Prompts.
- Modal components now uses the Portal component
- Input validation tooltips now use the Portal component
Toast
component now uses the Portal componentDropdown
component now uses the Portal component
mapToProps
takes precedence over props passed to HOC inconnect
function.inputs
border-color change:hover
is now applied to input rather than input containerStore
: sets themaxListeners
to handle more complex store arrangements
- Resolved new ESLint errors from carbon-factory upgrade.
- Add a
key
to the top-levelMenuListItem
components in the sidebar, which removes the 'Each child in an array or iterator should have a unique "key" prop' warning.
- React has been updated to v16.2.0
- React-DOM has been updated to v16.2.0 for React upgrade
- Enzyme has been updated to v3.3.0 for React upgrade
- Raf has been added at v3.4.0 for React upgrade
- ReactTestRenderer has been updated to v16.2.0 for React upgrade
- React-Highcharts has been updated to v15.0.0 for React upgrade
- React-Transition-Group has been updated to v1.2.1 for React upgrade
- ReactHighlight has been updated to a forked version which works with React v16
- React-Addons-Perf has been removed due to deprecation
- React-Addons-Test-Utils has been removed due to deprecation
React 15 had limited, undocumented support for error boundaries using unstable_handleError
. This method has been renamed to componentDidCatch
.
Previously this would return an error if the given precision was higher than 20 but would not actually enforce the limit. Now, if a value of greater than 20 is set the precision will be set to exactly 20.
ReactDOM.render
and ReactDOM.unstable_renderSubtreeIntoContainer
now return null if called from inside a lifecycle method. To work around this, you can use portals or refs.
Calling setState
with null no longer triggers an update. This allows you to decide in an updater function if you want to re-render.
Calling setState
directly in render always causes an update. This was not previously the case. Regardless, you should not be calling setState
from render.
setState
callbacks (second argument) now fire immediately after componentDidMount
/ componentDidUpdate
instead of after all components have rendered.
Part of updating react from 15.6.0 to 16.2.0 included also updating enzyme to 3.3.0. https://github.com/airbnb/enzyme/blob/enzyme%403.3.0/docs/guides/migration-from-2-to-3.md
If you're upgrading an application that uses Carbon to 3.0.0 you'll need to make sure you have raf
in your project's dependencies. To add raf
to your project dependencies run the following command:
npm install raf --save-dev
You'll also need to add the following line to your jest.conf.json:
"setupFiles": [
"raf/polyfill"
]
To Install the latest Carbon:
npm install --save carbon-react@3.0.0
React has discontinued support for all react-addons, the latest version of each addon should continue to work (except react-addons-perf).
React.createClass
is deprecated and create-react-class
should be used instead
React.PropTypes
is now available as prop-types
React.DOM
is now available as react-dom-factories
react-addons-test-utils
is now available as react-dom/test-utils
Both react
and react-dom
will need to be updated to version 16.2.0
npm install react@^16.2.0 react-dom@^16.2.0 --save
Hydrating a server-rendered container now has an explicit API. If you’re reviving server-rendered HTML, use ReactDOM.hydrate
instead of ReactDOM.render
. Keep using ReactDOM.render
if you’re just doing client-side rendering.
We have updated the Portal
component to use React's own version of portal which is available with React 16, removing the react-portal
dependency.
Portal
now has an additional prop onReposition
which is an optional callback function, called when the window resizes or a parent DOM element is scrolled.
- Checkbox no longer overlays the end of the Help field text when the reverse prop is set to true
Date
: Previously this component would not retain an invalid date value, we now keep the value and throw a validation error on the input.- The DatePicker element will now reposition itself when the DateInput is scrolled.
- Upgrade marked package from v0.3.6 to 0.3.9 to address security vulnerabilities
acronymize
: This helper function provided in/utils/ether
now checks for invalid strings to mitigate errors.
Menu
: Fixes cursor type when hovering a top level menu item.
Portrait
: fixes incorrect text colour in light mode. Also standardises the colours used for the icon and initials.Message
: Fixes the icon positiing in IE11.Toast
: Fixes the icon positiing in IE11.
- Enzyme has been updated to v3.2.0
- Superagent has been updated to v3.8.2 for a security fix
- moment has been updated to v2.20.1 for a security fix
- Carbon now comes with over 100 standard icons to choose from! Check out the Icon component page to view the latest additions like
in_transit
andcredit_card_slash
. Date
's getterdatePickerProps()
now checks the date value before returningDialog
'scenterDialog
andfocusDialog
methods won't attempt to run if the dialog isn't presentForm
'scheckStickyFooter
method won't attempt to run if the form isn't presentTable
'sresizeTable
method won't attempt to run if the table isn't present- Fixed tests broken by Enzyme major version bump.
SettingRow
- the left hand segment now has amax-width
of 300px.
- Upgrade marked package from v0.3.6 to 0.3.9 to address security vulnerabilities
- Revert the
Profile
component changes:darkBackground
is false by default, and the name and email render using the inheritedbody
text colour.
- Adding a transform to an instance of a service class was applying the transform to all other instances. This change ensures the transform is only applied to the specific instance.
- Remove space from clearfix psuedoclasses that was creating a space character that was pushing layouts out of line
Resolves missing assets
file from v2.5.0.
Portrait
can now render an empty string for the alt attribute.- Improve the contrast of the text in the
Profile
component, and thePortrait
component whendarkBackground={ true }
. - Changed type of prop
tooltipMessage
oftooltip-decorator
from string to node to allow children.
- Set the
Component.displayName
on all decorators. NB You may need to update your snapshots as a result of this to change the component name to something more accurate - Handles an empty body (such as that with a 204) more robustly (#1631)
Rainbow
- fixes a bug in which the component was unresponsive to mouse events.
- Added
connect
higher order component as an intermediate step for connecting components to Flux stores through props.
SettingsRow
Adjusted paddings and margins between sections.Dialog
Ensure the heading used within a dialog has 15px padding instead of 20px.
Menu
has been updated based on slightly new designs.MenuItem
now supports theicon
prop.Portrait
sizeextra-small
has reduced from26px
to25px
.Portrait
sizemedium-small
has reduced from50px
to40px
.Profile
has increased margin between the image and text.Dialog
bottom padding has increased by 8px.
Modal
now has a data-state element that begins as default, set to open once transition to open is complete and is set to closed once the transition to closed is complete.
ButtonToggleGroup
is a component that allows a group of ButtonToggles to behave as a single form component with label, field help, validation message, warning message, and info message support.
- Fix table-ajax to only set data-state to loaded once all of the data has been set. This resolves an issue when automating user scenarios allowing us to reliabliy wait for the loaded state to be set, before moving on.
- DropdownFilter now uses a stylized Link component for the Create button.
- DropdownFilter now has
createText
&createIconType
props for customizable create button text and create button Icons (limited to current Carbon Icon types).
Ensures that displayName
is set to the original component's name when connecting to a store using Carbon's flux helper. We have noticed Jest snapshot's have started to default to View
when connected to a store using our flux connector, this change will ensure the display name is maintained.
Dialog
) to use ReactPortal. While this doesn't break applications, it was found to break some tests after an application upgraded. We have decided to disable this feature for now, and will re-add it at a later date when either Portals are better supported by our test tooling or when we release a version 3 of Carbon with potential breaking changes.
The following updates have been made to Carbon components to align with design updates.
- Button - Ensure that the button text is always aligned centrally by default. Resolves an issue where the Button text may wrap where translated text occurs.
- Colors - New Text colors added
- Animated Menu Button - Fixed icon alignment and text weights in
- Flash - Text colors changed to pass accessibility
- Menu - New Drop Shadow
- Multi Action Button - Minor fixes to hover
- Pager - Padding and font size fixes
- Pod - Shadow color update
- Portrait - Border fix
- Settings Row - Separator placement fix
- Split Button - Correct color on hover
- Tabs - Hover color now matches buttons
- Toast - Shadow update
ConfigurableItemsPattern
's propitemsData
is no longer required- We use
core-js
instead ofes6-promise
for Promises as this is more reliable and fixes an issue in IE11. Check you aren't accidentally relying ones6-promise
.
Portal
is a component that wraps the react-portal library.
InputLabel
now allows fieldHelp to be a node type.TooltipDecorator
now uses the newPortal
component for layout. This effectsHelp
andIcon
components.Date
now uses the newPortal
component to render the DatePicker.Modal
now uses the newPortal
component.ActionToolbar
can now receive children to add additional actions. TheTable
component has also been given theactionToolbarChildren
prop to send the same data down.`
- The
react-addons-perf
package is now included indevDependencies
.
- Fix typo in FullScreenHeading
- Upgrades
react-highlight
, which removes the lastcreateClass
warning from React.
- DropdownFilter now uses a stylized Link component for the Create button.
- DropdownFilter now has
createText
&createIconType
props for customizable create button text and create button Icons (limited to current Carbon Icon types).
- DialogFullScreen and Pages now have a max width applied.
- Fixes z-index issue of Dialogs appearing on top of DialogFullScreens.
- Carousel can now have custom transitions using the
transition
prop.
- Fixes a compilation error that occurred in 2.0.0, which resulted in a missing
assets.scss
file. Datepicker
: Stops NavBar submitting the form its contained in
Store no longer accepts a Dispatcher
as its third argument. It will automatically use the dispatcher supplied by Carbon. If you want to pass a custom one then you can pass it as a param in the config:
new Store('name', data, { dispatcher: myDispatcher });
The following packages are now specified as peer dependencies:
- flux
- react
- react-dom
The following packages have been moved from devDependencies
to dependencies
:
i18n-js
immutable
highcharts
react-router
react-transition-group
The following packages have been upgraded:
- flux: now has a peer dependency of at least 3.1.1
- i18n-js: upgraded to rc12 - (scope is now required)
- react-router: ^3.0.0
If you're upgrading an application that uses Carbon to v2.0.0 you'll need to make sure you have flux
, react
, and react-dom
in your project's dependencies. To add flux
, react
, and react-dom
to your project dependencies run the following command:
npm install flux react react-dom --save
Carbon now includes i18n-js
, immutable
, highcharts
, react-router
, and react-transition-group
in its dependencies, so you may be able to remove these from your own project's dependencies. To do this:
- Uninstall and remove
i18n-js
,immutable
,highcharts
,react-router
, andreact-transition-group
from your project's dependencies:
npm uninstall --save i18n-js immutable react-router react-transition-group
- Install the latest Carbon:
npm install --save carbon-react@2.0.0
The Service
class now accepts an object as its second argument, deprecating the separate onSuccess
and onError
arguments.
This allows you to pass in onSuccess
and onError
functions in the object, along with params
if you need query parameters in your requests.
Deprecated invocation:
service.get('1', onSuccessFunc, onErrorFunc)
New invocation:
service.get('1', { onSuccess: onSuccessFunc, onError: onErrorFunc })
service.get('1', { onSuccess: onSuccessFunc, onError: onErrorFunc, params: { key1: 'val1', key2: 'val2'} })
Row
: can no longer render any immediate children. A Column component has been introduced to maintain the column span, offset and align behaviour.
// BEFORE
import Row from 'carbon/lib/components/row';
...
<Row columns='10'>
<div columnSpan='3' columnOffset='2' columnAlign='right'>
Content 1
</div>
<Pod columnSpan='5'>
Content 1
</Pod>
</Row>
// AFTER
import { Row, Column } from 'carbon/lib/components/row';
...
<Row columns='10'>
<Column columnSpan='3' columnOffset='2' columnAlign='right'>
Content 1
</Column>
<Column columnSpan='5'>
<Pod>
Content 1
</Pod>
</Column>
</Row>
Browser
has been updated so thatgetWindow()
will work when run in a node environmentButtonToggle
now lets you add asize
and agrouped
prop.
- Grouped character adds separators to value on first render.
Datepicker
: Stops NavBar submitting the form its contained in
Message
-children
prop is now optional. #1543Message
-title
prop type has been changed from string to node. #1543
Datepicker
: Stops NavBar submitting the form its contained in
Table
now lets you add anaria-describedby
prop.ConfigurableItemRow
is vertically centered correctly.AnimatedMenuButton
uses the native<button>
instead of a div for the close button.Tabs
now includes aria roles for better screen reader support.Tabs
can now be navigated using left/right arrows for horizontal tabs and up/down arrows for vertical tabs on the keyboard to switch between the tab list.
ConfigurableItems
hasstickyFormFooter
enabled
The DraggableContext
component now includes a CustomDragLayer
to enable a ghost row when dragging.
In order to enable this you need to define the draggableNode
prop on the <WithDrag>
component. For example:
class DraggableItems extends React.Component {
render() {
return (
<DraggableContext onDrag={ onItemMoved }>
<ol>
{
items.map((item, index) => {
return (
<WithDrop key={ index } index={ index }>
<DraggableItem />
</WithDrop>
);
});
}
</ol>
</DraggableContext>
);
}
}
...
class DraggableItem extends React.Component {
render() {
return (
<li ref={ (node) => { this._listItem = node; } } >
<WithDrag draggableNode={ () => { return this._listItem; } }>
<span>{ item.content }</span>
</WithDrag>
</li>
);
}
}
Note that the draggableNode
is passed as a function because the ref _listItem
is undefined until the component is mounted.
The Service
class now accepts an object as it's second argument, deprecating the separate onSuccess
and onError
arguments.
This allows you to pass in onSuccess
and onError
functions in the object, along with params
if you need query parameters in your requests.
Deprecated invocation:
service.get('1', onSuccessFunc, onErrorFunc)
New invocation:
service.get('1', { onSuccess: onSuccessFunc, onError: onErrorFunc })
service.get('1', { onSuccess: onSuccessFunc, onError: onErrorFunc, params: { key1: 'val1', key2: 'val2'} })
- The Date Picker library has changed from react-date-picker to react-day-picker as the old library is no longer maintained.
- This will effect the
Date
andDateRange
components but functionally they have remained the same.
FormSummary
: negative margin solves problem where FormSummary is effecting its sibling component's position #1523
- Fixes CSS load order issue with
Dialog
,Form
, and sticky footers.
- Update
Service
class to use prototypal inheritance instead of class properties. - Fixes floating error message caused by https://github.com/Sage/carbon/pull/1452/commits/1f902687c507f7b9cc8fe8cb641c048f8d82b034
The following components have had styling updates:-
- DatePicker
- ButtonToggle
- Heading / Dialog
The 300 weight (Thin) has been replaced by the 900 weight (Black) in Lato.
TableAjax
component now uses the data-state attribute andaria-busy
.
- Carbon now require
npm
version 5 for installing dependencies. - To upgrade your version of npm, run
npm install npm@latest
. - Then, before running
npm install
in your project folder, runnpm verify cache
to update your cache.
ConfigurableItems
pattern now accepts anonReset
prop to be passed in.
Validations
: fixes an error from being thrown for non-Textbox validations when situated inside a Modal.
Date
: Fixes missing background color on validation errors.
Heading
: Removed default top padding.
Menu
: removedalternate
prop, can useSubMenuBlock
instead which achieves the same thing.
Dropdown
: validation fail now allows the dropdown arrow to be visibleDecimal
: fix an issue where values entered without a leading zero were incorrectly failing numerical validation
We now provide the Flux Dispatcher as a singleton within the Carbon library.
import { Dispatcher } from 'carbon-react/lib/utils/flux';
Please note that you should only use one Dispatcher in your application, if you want to start using the one provided in Carbon you need to remove the pre-existing one from your application.
Logger can now supply a option of group
- this will group any logged messages together that share the same group name and that are triggered within 500ms of one another.
- React has been upgraded to 15.6.1 - https://facebook.github.io/react/blog/2017/06/13/react-v15.6.0.html
ConfigurableItems
Drag & Drop and check/uncheck a list of itemsConfigurableItemRow
Used with ConfigurableItems to build the list of configurable items
ConfigurableItemsPattern
Combines ConfigurableItems and ConfigurableItemRow components
TableAjax
now accepts anonAjaxError
function as a prop, to handle Ajax requests that return a HTTP error
The following have had minor internal changes to satisfy the introduction of stricter linting rules:
- Dropdown
- FormSummary
- Page
- Pages
- RadioButton
- Tabs
- Store
Form
now has additional props ofleftAlignedActions
andrightAlignedActions
which allows developers to add additional nodes in line with the default form actions.Button
: Makes large button text the same as the medium buttonButton
: Allows secondary text under main text #1385ButtonToggle
: The buttons can now be toggled using the keyboardPoller
helper has been refactored to no longer use promisesTooltip
now renders an ARIA role of tooltip, and accepts an optionalid
prop
- The
Poller
helper has been refactored to no longer use promises
- Renamed
definition.js
files to__definition__.js
.
Decimal
: fix an issue where values entered without a leading zero were incorrectly failing numerical validation
Dialog
: ensures close icon positioning regardless of CSS load order
- Fixes CSS load order issue with
Dialog
,Form
, and sticky footers.
- Flips errors messages in dialogs if they appear wider than the dialog.
ButtonToggle
: The buttons can now be toggled using the keyboard
- Resolved bug in IE11 where sticky footer was rendering too large in dialogs.
- Added additional guards for browsers that do not support
element.contentDocument
.
- Our files are now published in production mode, removing some developer dependencies previously included.
- A bug was found in the new Dialog behaviour in Safari 9.x which rendered the sticky footer incorrectly. This solves it rendering incorrectly on page load for Safari 9.x. There remains a wider issue around Safari logged here.
- Dialog
- Screen is no longer scrollable when a dialog is open.
- Dialog will attach to the bottom of the browser if it gets too tall, and it's content will become scrollable.
- If a dialog has a form, the form buttons will become sticky to the bottom of the dialog while the dialog is attached to the bottom of the browser (this is only enabled if the prop
stickyFormFooter
is applied to the dialog). - Dialog can now use a prop called
height
, allowing developers to specify a set height for the dialog (the dialog will still attach to the bottom of the browser if it is taller than the browser's height).
- Form
- Now has a prop of
stickyFooter
which whentrue
will enable a sticky footer when it is off the screen. - Now has a prop of
stickyFooterPadding
which will add additional padding to the form buttons when they are sticky (useful for aligning the form buttons between sticky and non-sticky states).
- Now has a prop of
- Selected table rows no longer have highlights applied on hover.
- Revert I18nhelper to use global locale for delimiter and separator
The following have had minor internal changes to satisfy the introduction of stricter linting rules:
- DraggableContext
- DraggableTableCell
- TableRow
- WithDrag
- WithDrop
- ItemTarget
- Text
Dialog
now has aautoFocus
boolean property. You can set this tofalse
if you don't want the dialog to receive keyboard focus when it opens e.g. if your dialog contains form fields that you want to set the focus on instead.Dialog Full screen
: Thecarbon-dialog-full-screen--open
class is now applied to thehtml
element instead of thebody
.Input
: the prefix was hidden when an error was present on the input element.
- Carbon Factory has been upgraded to Version v1.1.7
The following have had minor internal changes to satisfy the introduction of stricter linting rules:
- AppWrapper
- Carousel
- Checkbox
- Column
- Content
- Create
- Date
- DateRange
- Decimal
- Detail
- Dropdown
- DropdownFilter
- DropdownFilterAjax
- Fieldset
- GroupedCharacter
- Heading
- Help
- I18n
- Icon
- Link
- Menu
- MenuItem
- MenuList
- MenuListItem
- MultiStepWizard
- Message
- Modal
- MountInApp
- NavigationBar
- NumberInput
- Pager
- Pill
- Pod
- Portrait
- Profile
- RadioButton
- Rainbow
⚠️ The ref for the highchart instance is now_chart
. This will need updating where Rainbow is used. - Row
- SettingsRow
- ShowEditPod
- Sidebar
- Sidebar Header
- SimpleColorPicker
- Spinner
- SubmenuBlock
- Tabs
- Textarea
- Textbox
- Toast
- Tooltip
- Date
- Devices
- Events
- GUID
- i18n
The following utils have had minor internal changes to satisfy the introduction of stricter linting rules:
- Browser
- CSS
- Ether
- Flux
- Handlers
- Helpers
- Logger
- Promises
- Router
- Service
- Should Component Update decorator
- Tooltip Decorator
- Validators
We now provide a series of components to enable drag and drop functionality. For example:
<DraggableContext onDrag={ onItemMoved }>
<ol>
{
items.map((item, index) => {
return (
<WithDrop key={ index } index={ index }>
<li>
<WithDrag><span>{ item.content }</span></WithDrag>
</li>
</WithDrop>
);
});
}
</ol>
</DraggableContext>
The onDrag
prop can manipulate the order of items as they are dragged. It is a function that receives two arguments: dragIndex
, which is the original position of the item, and hoverIndex
, which is the position of the item if dropped.
An example function signature: onItemMoved = (dragIndex, hoverIndex) => { }
The TableRow
component now supports drag and drop. To enable it you need to add a DraggableContext
component, apply an index to each TableRow
, and define the onDrag
prop to manipulate the order as it changes:
<Table tbody={ false }>
<DraggableContext onDrag={ onRowMoved }>
<tbody>
{
rows.map((row, index) => {
return (
<TableRow key={ index } index={ index }>
{ row.content }
</TableRow>
);
});
}
</tbody>
</DraggableContext>
</Table>
A new helper object is available in utils/helpers/text
. Currently it only contains one method clearSelection
, which clears any selected text on the page.
Pages and Page are new components to enable paginated content for full screen views. See an example with a full screen dialog:
const headingOne = (
<Heading title="My First Page" />
);
const headingTwo = (
<Heading title="My Second Page" />
);
return (
<DialogFullScreen>
<Pages slideIndex={ 0 }>
<Page title={ headingOne }>
Content for the first page.
</Page>
<Page title={ headingTwo }>
Content for the second page.
</Page>
</Pages>
</DialogFullScreen>
);
Alert
now alerts itself to screen readers.Browser
: add a new methodsetInputFocus
to focus on the input field of passed in ref but does not select textCarousel
- has a new prop
enableSlideSelector
defaulted totrue
. Setting it tofalse
will hide the slide selector. - has a new prop
enablePreviousButton
defaulted totrue
. Setting it tofalse
will hide the previous button. - has a new prop
enableNextButton
defaulted totrue
. Setting it tofalse
will hide the next button. - has a new prop
slideIndex
. Changing this prop to an index will select the corresponding slide. - has a new prop
onSlideChange
, which is an action to be called on slide change. It will receive the slide index and the transition direction as params. - animation between slides enhanced.
- has a new prop
Dialog
is now using theHeading
component to render its title and subtitle.DialogFullScreen
is now scrollable if the content goes beyond the height of the browser.Form
now has defaultSaveButton
andCancelButton
functional stateless components. The former can be overridden with a new prop ofcustomSaveButton
.Heading
backLink prop can now be a string or a function.InlineInputs
children are now wrapped by Columns by the component.Menu
has been updated to use a<nav>
tag as its root element.MenuItem
: focus outline is now fully visible when an item is focused.Pager
: Negative values now set to absolute value, NaN values set to page 1.Table
can now receive ancaption
prop which renders a<caption>
element as a child of the table element. Note that the caption is hidden by default, but still accessible to screen readers and assistive technologies.Table
has a new prop of onConfigure. Displays a configure icon to the left of the table header that triggers the callback onClick.MultiActionButton
: Secondary button hover style has been updated to not change on hover.TableHeader
: improve accessibility of sortable columns. They can now receive focus via the keyboard, and includearia-sort
andaria-label
attributes to indicate they are sortable, the current sort direction, and which direction the column will be sorted when sorting is next activated.InputValidation
: now accepts ainfo
prop to display info-styled icon and message attached to an input.
Table
can now receive ancaption
prop which renders a<caption>
element as a child of the table element. Note that the caption is hidden by default, but still accessible to screen readers and assistive technologies.Table
has a new prop of onConfigure. Displays a configure icon to the left of the table header that triggers the callback onClick.Table
has a new prop oftheme
that allows primary (dark) or secondary (light) styling.
DialogFullScreen
now scrolls vertically if it contains content taller than the dialog height.TableHeader
: fix alignment of sort icon in IE11.
- Facebook has deprecated
react-addons-transition-group
andreact-addons-css-transition-group
in favour ofreact-transition-group/TransitionGroup
andreact-transition-group/CSSTransitionGroup
so we have switched to use the later.
- You can now pass
--cdn
to the gulp task to bundle assets pointing towards the CDN.
- Minor changes to guides to reference
carbon-react
in imports. grid
icon added to theIcon
component.
- Update I18nhelper to respect the locale for the delimiter and separator.
- Fix bug with Date Range date pickers not closing correctly
Dropdown
now accepts a new optional function proprenderItem
which will be called to render each option in the list
Content
: gets adata-element
on its body wrapper
- BigNumber has been updated to v4.0.2
Dropdown
: Options list is always rendered to the DOM, but is hidden until selectedTextarea
now accepts a new propwarnOverLimit
to display the character count message in red.- Simplify character count in
Textarea
.
Date
: fixed the warning about an uncontrolled input component- Fix presence validator bug validating value as false if no props sent to validator.
The following component have had minor internal changes to satisfy the introduction of stricter linting rules:
- ActionToolbar
- AnimatedMenuButton
- Button
- ButtonToggle
- Confirm
- Dialog
- DialogFullScreen
- Flash
- MultiActionButton
- SplitButton
- Table
- TableAjax
- TableCell
- TableHeader
- TableRow
- The package name has been updated to
carbon-react
.
- You should now install the package via npm:
npm install carbon-react
.
- React has been upgraded to version 15.5.0 - https://github.com/facebook/react/releases
ActionToolbar
: 'total' field margin and widthBanner
: Component has been Deleted in favour of the Message ComponentButtonToggle
:icon
andiconSize
becomebuttonIcon
andbuttonIconSize
to avoid clash with Input decoratorHeading
: paddingsMenuList
: Main Classes andclassName
props have been moved from theul
to the top leveldiv
. To access theul
usecarbon-menu-list__list
MultiActionButton
: Additional buttons are spaced differentlyMultistepWizard
: Step has less padding-leftPod
: Header has less margin-bottom
- The following components have been refactored to meet best practice standards and pass linting. If you have overridden any internal methods of these components, you may need to update your code.
- Action Toolbar
- Alert
- Animated Menu Button
- App-Wrapper
- Button
- Content
- Create
- Carousel
ButtonToggle
no longer inherits from the label decorator as it was providing more functionality than required.Rainbow
has been updated to no longer use thereact-highcharts
component. To use this component you need to ensure to make theHighcharts
library available to your application globally.ActionToolbar
incorrectly required actions as anArray
- this has been changed to anObject
to reflect its actual usage.
If you have Google Analytics enabled (window.ga
is defined), and you are using the router supplied by Carbon, we will track subsequent page views. Please ensure that your Google Analytics tracking code is defined after you load the your application JavaScript.
Decimal
now shows propType warning when precision is outside the range 0..20Detail
: font size of footer increasedDialog
: font wieghtDropdownFilter
: placeholder text is made more legible by removing italics and making the font color darkerDropdownFilterAjax
:data-state
component tag is added to thegetData
Ajax request to mark the requesting stateFieldset
: icon positioningHeading
: Font size increased and weightInput
: decorator has slight padding changeMenu
includesalternate
prop for marking sub sections of the menu for styling (like tiger stripes for readability on tables, rather than actual submenusMountInApp
now cleans up it's children when the component is unmounted.Pod
: Font size increasedShowEditPod
: z-index on input prefixesTableHeader
: Font weight
Adds a Service
class to make it easier and more clear to create reusable services to interact with a JSON API. The class supports:
GET
,POST
,PUT
andDELETE
requests.- Automatically configured request Headers (no longer need to set
Content-Type
etc for each request) - CSRF support.
- Request and Response transforms.
- Global Success and Error actions for triggering automatic actions (such as flash notifications on error).
This should hopefully replace all uses of Request
or axios
.
- A new 'insertAt' Ether helper to insert a character in a string at a specified indices
- Grouped-character component - displays groups with of characters with separator.
Alert
: default size has been fixed toextra-small
.ButtonToggle
: css typo correctedConfirm
: default size has been fixed toextra-small
.Detail
: Footnote is allowed to expand verticallyHeading
: alignment is fixed in IE wherehr
was centring by defaultLink
: CSS inheritance has been updated to better support buttons.MenuList
: item filter search icon positioning is fixed- Row clones children when mutating props rather than creating new element to retain refs
- Stop input value being removed from props (fixes Button Toggle issue)
Row
: can longer render any immediate children. A Column component has been introduced to maintain the column span, offset and align behaviour.
// BEFORE
import Row from 'carbon/lib/components/row';
...
<Row columns='10'>
<div columnSpan='3' columnOffset='2' columnAlign='right'>
Content 1
</div>
<Pod columnSpan='5'>
Content 1
</Pod>
</Row>
// AFTER
import { Row, Column } from 'carbon/lib/components/row';
...
<Row columns='10'>
<Column columnSpan='3' columnOffset='2' columnAlign='right'>
Content 1
</Column>
<Column columnSpan='5'>
<Pod>
Content 1
</Pod>
</Column>
</Row>
We have added data-attributes to components to better identify them and their parts within the browser. We have added data-component
tags on the top level of any component, and data-element
tags to constituent parts. Developers can also add data-role
tags to components to uniquely identify specific components within their UI.
- Carbon Factory has been upgraded to v0.3.6 - https://github.com/Sage/carbon-factory/releases/tag/v0.3.6
- Can pass command line arg to pecify port for demo server.
gulp --port 1234
DialogFullScreen
now accepts a String for title or any other component.
- Hide SplitButton additional buttons instead of removing them.
- Removed the style node from
package.json
in table-ajax. This file doesn't exist.
- Add
additionalRequestParams
prop toDropdownFilterAjax
- Hide SplitButton additional buttons instead of removing them.
- Ensure that node modules can only upgrade patch versions
ShowEditPod
:beforeFormValidation
andbuttonAlign
props are now passed to theForm
as they should be
A simple InlineInputs
wrapper component which allows multiple input fields to be displayed horizontally
with a label.
<InlineInputs label='Test Label'>
<Textbox />
<Textbox />
</InlineInputs>
Date
now shows error validation when an invalid date is entered.Flash
: Change error icon to match other notifications (now shows error icon whenas
prop iserror
)Form
: adds error and warning icons (and refactors the summary into its own sub-component)Dialog
: Addedsubtitle
propInput
can now receive aninputHelp
prop which renders a tooltip after the input field.
- DateWithinRangeValidator checks that a date is within specified bounds. e.g.
new DateWithinRangeValidator({ limit: 30, units: 'days' }
Dropdown
: adds a set of ontouch events to the list in order to stop blurring from happening until after the touch event which fixes a bug with the input update on finger tap on touch screensTableHeader
: fix overflow issue so that tooltip / help components aren't cut off.Decimal
: fix issue wherevisibleValue
was not updated after a change toprecision
.
Pod
: corrects misalignment caused by centering
DropdownFilter
: Refactored 'freetext' mode to operate onvalue
for an option id, orvisibleValue
for a write-in value.PresenceValidator
: Addedprops
andrequireAll
arguments to validate any/all of multiple input properties.
- Fixes onBlur prop passed to
Date
,Decimal
,Dropdown
,DropdownFilter
, andDropdownFilterAjax
components so it is called instead of ignored I18nHelper
: Number abbreviator allows negative numbers
MenuItem
: AddedonClick
prop.
DateRange
: Two new props have been added,startDateProps
andendDateProps
, to apply props to the childDate
components.MultiStepWizard
now allows adding callbacks when clicking on Next/Back button and allows adding validation callback before wizard submission when clicking on Submit button.
Adds a new mode to DropdownFilter
which prompts the user with suggest-style filtered options, but also allows typed
entries that do not match any options. If the typed string exactly matches the name of an option, that option is
automatically selected on blur, and the onChange
event target will specify the option id as value
and name as
visibleValue
, just as if it had been clicked. If the typed string does not match any options on blur, it remains as
the input value and onChange
will carry an empty string value
and the typed string as visibleValue
.
Usage:
<DropdownFilter options={ options } freetext={ true } onChange={ this.onChange } />
Portrait
: Fixes image stacking.- Fixes decimal input displaying error with single negative sign
-
. - Fixes numeral validation exception with single negative sign
-
. - Currently active inputs no longer re-validate during
componentWillReceiveProps
, ensuring that duplicate re-validation no longer occurs triggering-1
error counts.
- Fixes alignment issue in inputs caused by the font size of prefixes differing from values.
- The I18n helper now uses the current locale for delimiter and separator.
- Validation is now correctly reset when a value is changed externally from the input.
- IsBlankValidator
Can be used to integrate React components into pre-existing user interfaces.
<MountInApp targetId="put_carbon_component_here">
// Children
</MountInApp>
The code above will render all //Children
components inside of the element with ID=put_carbon_component_here
found on the page.
A component that displays squares with color samples that you can choose from.
<SimpleColorPicker
availableColors={ ['transparent', '#ff0102', '#34ff01'] }
selectedColor="#34ff01"
name="settings[color_of_something]"
onChange={ customEventHandler }
/>
- A new 'insertAt' Ether helper to insert a character in a string.
- It inserts a dash by default, or a custom
newChar
insertAt('123456', 2);
// => 12-3456
insertAt('123456789', 3, { newChar:'/' });
// => 123/456789
To repeat the character at the same interval, set repeat
to true
insertAt('123456', 2, { repeat: true });
// => 12-34-56
insertAt('123456789', 3, { newChar:'/', repeat: true });
// => 123/456/789
legacyEditStyles
prop name has changed tointernalEditButton
.
Pod
: bug fixed with link and hover event props being mixed up
I18nHelper.formatCurrency
: returns integer with option { precision: 0 }.
We have updated MultiStepWizard's default buttons as primary.
Now takes a legacy style flag that switches the styles back
-
Icon
: Three new props have been added:bgShape
: 'square', 'rounded-rect', or 'circle'.bgTheme
: 'warning', 'default', 'error', 'info', 'new', 'success', 'help', or 'maintenance'bgSize
: 'small' (default), 'medium', or 'large' - only modifies overall icon size ifbgShape
orbgTheme
is passed.
-
Form
: Two new props have been added,saveButtonProps
andcancelButtonProps
, to apply props to Form buttons.
Browser
: A newpostToNewWindow
method has been added, for sending POST data to a new browser window/tab.
- Added
$beta
orange color variable
We have added a settings row component for settings pages. It employs the current UX standard for the appearance of settings pages. Title, description, and any details (accepts nodes) are formatted into the header, while children are rendered in the input cell. Renders nothing if no children present.
<SettingsRow
className='mysetting-row'
title='My Setting'
description='Some descriptive text'
description={ <span>Detailed description</span> }> }
>
<Checkbox label='Enable my setting' />
<div>Some other blurb about the setting</div>
</SettingsRow>
- Portrait initials are now dark grey on grey
Heading
: One new prop has been added,separator
, to show a 2x50px separator between title and subheader.- All input components can now render an icon using the prop
icon
. Portrait
: Now displays an icon in place of a blank box when the image has not been set and the initials are an empty string.
- single quote(') is valid in email address now.
- Readded the
carbon-tabs
class to the Tabs component. - Clear any selected rows too in refresh()
- SelectedRows should be reset to the same object it is defined with
- The
default
colour set now uses a lighter grey.
- error icon on
Date
component is now displayed in place of the calendar icon clicker
- ImmutableHelper.parseJSON now converts javascript objects to regular Maps rather than ordered maps.
- If you require ordered maps you will need to explicitly create them rather than use ImmutableHelper.
margin-bottom
has been removed from the message component.
Navigation-Bar
: line-height has been applied to parent content div rather than children.- Updated base font CSS to better reflect the Lato font.
- Updated Menu Item CSS to better reflect the Lato font.
- Updated input help text color for accessibility standards.
- Animated Menu Button has been updated with latest font changes.
- Links inside of input warnings are now coloured white.
Tabs
now correctly tracks warning state of a tab.Tabs
no longer jumps when changing tab.
- Datepicker has been upgraded the latest version.
- Bowser has been upgraded to the latest version.
Message
: Two new props have been added,border
androundedCorners
.Dropdown
: One new prop has been added,cacheVisibleValue
.Tabs
now can take a prop of 'position' which supports floating to the left and being positioned in a vertical stack.
- A new
humanizeFilesize
helper for converting bytes to a human readable representation. roundForAbbreviation
is added to handle the number element ofabbreviateNumber
as well as forcing any abbreviated number to one decimal placeabbreviateCurrency
takes unit value
- Cookie functions added to browser helper
- Fixes vertical alignment of minus icon.
Tabs
: Tab Heading hover, focus and active states corrected
Icon
: removes SVGs to fallback to icon font until new SVGs designedFlash
,Message
andToast
: all useflex
for positioning
Pod
: now accepts adisplayEditButtonOnHover
prop which will hide the edit button until the mouse is hovering over it.Pod
: now accepts atriggerEditOnContent
prop will trigger theonEdit
function when clicking the content.Pod
: the colours of an editable pod have been updated to be more consistent.
- Fixes reference to utils from the link component.
Visual improvements to the design of components, which may impact the colors and font styles used.
- Lato font added
- Colors updated
- Table row active and hover styles
- Font sizes for text
- Button color is now determined by a
theme
prop. - If you are using a red or green button, you must pass props of
as
andtheme
. - i.e. for a red button
<Button theme='red'>
Foo
</Button>
- For a green button
<Button theme='green' as='secondary'>
Foo
</Button>
We have added a component to handle I18n translations. The component also supports markdown, allowing developers to safely add HTML markup to translations such as bold tags or hyperlinks.
<I18n scope="my.translation" options={{ myVar: "foobar" }} markdown={ true } />
abbreviateNumber
function is provided for adding 'k' and 'm' style abbreviations for large numbers
Button
: now accepts a size and theme prop to determine size and color respectively.Decimal
now emits value of 0 on blur if cleared.Icon
: new Icons added - Draft, Github, Twitter, Dribble and RemoveLink
: tabindex default and switch control via a propMenuList
: autofocuses on filter when a menu is openedLink
: pressingenter
triggers anyonClick
eventRainbow
: Added the config prop to to be able to control the way the chart is displayed.TableAjax
now acceptspageSize
prop.
- Added callback to poller helper which is called when the terminating condition is not met
- Input prefix is now positioned correctly when using inline labels
Decimal
component can validate properly with alternative i18n settings
MenuList
: handles simpleul
based menus
- Heading component can now configure it's divider on/off using the prop 'divider'.
- The default behaviour for the Pill component was to previously set as
info
. This is now set asdefault
which is a grey colour. - Ensure you check for any implementations of the Pill component where the
as
prop is not defined and set this toas='info'
.
- The Date component now uses Strict mode and a I18n locale for parsing date.
- If you require multiple locales for your Date component you will need to import them from moment js
- Please see the moment js docs for more information
Rainbow
expects the Highcharts library to be already loaded. If your project does not include Highcharts, you need to import it before Rainbow.
import 'react-highcharts/dist/bundle/highcharts';
- Subheader component created to be used with the Table and TableAjax components
ShowEditPod
now closes and cancels editing on Escape keydown.ShowEditPod
puts focus on pod if mounted in editing state.Sidebar
no longer renders a close icon if there is noonCancel
prop.Date
field uses I18n for formats and sanitizes inputs for passingContent
component can take props ofbodyFullWidth
to set component width to 100%;Date
field uses I18n for formats and sanitizes inputs for passingStep
wizard sub-component now accepts a prop ofenabled
.Table
components now accept anonPageSizeChange
callback function as a prop.InputValidation
usesForm
andInput
in order to ensure messages stay on screen for a short while unless the user hovers on another fieldPod
enter triggers edit function and edit element is keyboard accessibleTabs
enter triggers tab load and navigation tabs are keyboard accessibleTabs
focus state is given the same styles as hover statePager
component now emits which element has changed.Sidebar
now takes a size prop (e.g.extra-small
,small
, ...extra-large
)
- Moment JS bumped to version 2.15.1
Decimal
component can prevent decimal value from exceeding the precision setting
Create
component: supplies a button for creating new artefacts.- Detail component
Content
now has additional display options to customise the alignment, to render inline with it's title and to customise the title's width.Link
component now has a prop oficonAlign
to align icons to the right of the link's text.Row
component can now be given a size to control the size of the gutter using the propgutter
(eg.extra-small
,small
,medium
,large
orextra-large
).Row
can enablecolumnDivide
to add dividing lines between columns.ShowEditPod
requires a tab press to focus on the first field of the contained form rather than automatically focusing on the first field
- Inputs now reset parent tabs error state when unmounted
- Valid Date entry formats can be overridden via I18n
- add helper to focus on input field
- Table Header - sort column no longer overlaps text when right aligned
- Add a currencyFormatter helper to the i18n helpers
- Editable Pod width can be set to full width by setting the prop
editContentFullWidth
to true. - Refactor Icon component into separate file SVGs
- Ensure portrait component uses https for gravatar images.
- Have increased pill font size and weight
- Carbon Components CSS now imports from relative paths
- removes uneccessary space from clearfix in
Row
component - Aligned MultiActionButton icon to center
Content
components now handles wrapping more robustly with single words longer than the content width wrapping correctlyFilter
handles it's child inputs more robustly by over-riding widths and margins when children are displayed inline- Darken colour of text--secondary
- Fieldset - readonly fields maintain border
- Remove italics from text--inactive
- Have increased pill font size and weight
- Carbon Components CSS now imports from relative paths
- Allow carbon to be incorporated into webpack project
- Removed footer from datepicker. This will be reverted in the React 15 Upgrade
- The CSS for applying clears to Row columns has been fixed.
- Tooltips now close when component receives new props.
- Text Area now scrollable except when expandable.
- Pod lifecycle methods are no longer defined as class properties.
- Input validation decorator was not re-checking validity for warnings
- Table sort arrows now point in the correct direction.
Pod
applies props to it's container rather than the first child of that container keeping things consistentPod
filters out anytitle
that is not a string before it is applied as an HTML attribute to the underlying element stoppingObject
being output as a browser generated tooltip
- Form now tracks error and warning count on instance as well as in state.
- Tabs component - added check to ensure that onTabChange is not called if the selectedTabId prop is changed to the existing state of the tabs component
- Row now supports immutable children.
- Row columns now clear when there are more columns than the defined number.
- Editable Pod is now aligned properly with title.
- Additional classes were not being applied to the Pod element, this has now been fixed.
- Added missing icon for "entry".
New pixel perfect icon font has been added.
Lato has now been added as the base font for applications, there are 4 weights introduced, 300(light), 400(regular), 600(semi-bold) and 700(bold). For performance, 3 of the 4 new weights used the Google Font CDN network and the 4th is added via assets.
The markup structure for pods has been modified, including some adjustments to Pod padding.
The edit action for a Pod has been modified to sit outside of the Pod.
- Tabs component - added check to ensure that onTabChange is not called if the selectedTabId prop is changed to the existing state of the tabs component
- Improves Flash component timeout behaviour.
As well as just a string, the Flash component will now receive a message value with the following:
- A string:
"Alert"
- An array:
["Message One", "Message Two"]
- An object with description:
{ description: "My description" }
- An object of key/value pairs:
{ first_name: "is required", last_name: "is required" }
- An object with description with nested key/value pairs:
{ description: { first_name: "is required", last_name: "is required" } }
- Tabs component - added check to ensure that onTabChange is not called if the selectedTabId prop is changed to the existing state of the tabs component
- Renamed initialSelectedTabId to selectedTabId and onTabClick to onTabChange in the Tabs component
- If selectedTabId is updated the visible tab will change to the value of selectedTabId, this will call the onTabChange function if set.
- Pod component now accepts a alignTitle prop.
- Checkbox input now has
important
set on position. - Tooltip Decorator now protects against no target or tooltip rendered in the DOM
- ShowEditPod shows edit content when controlled externally
- We have renamed all of our styles to be prefixed with
carbon-
rather thanui-
. This is to avoid conflicts with existing open source libraries like jQuery UI.
// Before:
.ui-button-toggle__icon--large
// After:
.carbon-button-toggle__icon--large
Please ensure you check your application carefully to update any references to these styles when upgrading.
- Show edit pod can now be controlled via props
- Make heading font styles more flexible, providing
h*
,.h*
and@include h*()
- Allow ShowEditPod to receive
false
in itsonEdit
prop to skip rendering of the default edit icon - Added a 'Payment' icon and a 'Key' icon.
- ShowEditPod now animates between the two states
- Help component now opens links in a new tab.
- PresenceValidator now returns false for strings that consist only of spaces
- Csv
- Message
- Link now accepts tooltip props to apply a tooltip to the link. This can be used with the Action Toolbar to apply tooltips to the icon links.
- Input components now accept an onPaste prop.
- Add character count to textarea
- Form now accepts a
onSubmit
prop which is only called when the form is valid. - AppWrapper now has a minimum width of 958px.
- SUG-19: Change padding for the MessageComponent when transparent and non dismissable. When transparent is applied the padding reduces to 2px, but if it's dismissable it enlarges to it's original to prevent overlap.
- Allows
Link
component to handlemailto:
as an href prefix, previously theto:
would have been stripped from the string - Fix error count, when input gets disabled
- The CSS for inputs and icons associated with inputs has changed. If you have overridden this CSS in you code, this may break your input CSS.
- Heading - useful for page titles.
- ShowEditPod - Inline editing of fields
- Date Range - Allows start and end date setting with validation for invalid date combinations.
The router's history object is now accessible:
import { history } from 'carbon/lib/utils/router';
With the history object you can control the DOM for any UI that uses React Router. For more information see the guides https://github.com/ReactJSTraining/history/tree/master/docs
The Link
component can now have its href
or to
props prefixed to customise the type of link it is (regular or react router).
For example:
<Link href="to:/foobar">My React Router Link</Link>
- The window will automatically scroll to the top when the route is transitioned
The Button
component can now have red and green themes, set using the as
prop.
- Information
- Sync
- Progress
- Submitted
- Completed
- A Sass variable has been introduced to define the path where fonts are located.
- Pod title size has been reduced to more accurately match the demo.
- Secondary Content components font weight has been standardised.
- The
children
prop for the Help component is no longer required. - Sibling Content components now have a top margin for spacing.
- Button height has been fixed for buttons that behave like links.
- Adds inline help for radio button.
- Fixes inline help for checkboxes.
- Radio Button sprite has been given a fixed size.
- Increase textTag font-spacing from 0.5 to 0.8.
- Button can receive a prop of
to
. - Fixes fieldset and input margin when rendered on top of one another.
- Fixes position of icon in dropdown button.
- Fixes error icon position for inputs with field help.
- AppWrapper has been increased to 1600px and some padding has been added.
- Form now accepts a prop of
save
which can be used to hide the save button.
!! Babel upgraded to Version 6
- When updating the latest version it is recommend to remove node modules
rm -rf node_modules
and reinstallnpm install
!! Phantom JS Upgraded to version 2
- This may cause a few tests that were giving false positives to fail
- Profile - User to show portrait with name and email.
- AppWrapper - confines your content to the width of your application.
- Menu
- NavigationBar
- All input label padding has been slightly increased.
- Help component has been updated with a new icon.
- Input Label decorator has been fixed to render the help class for labelHelp.
- We have added an
acronymize
function to the Ether util, which will create an acronym from a given string.
- All dropdowns now allow keying up and down through the list
- A polling helper has been added that performs customizable ajax polling.
- Help
- Chevron
- Portrait extra small size has been changed from
20px
to25px
. - Portrait can have a dark background.
- Fixes issue with Portrait size when image would not render.
- Disabled Pill's colours have been updated.
- Individual and Business SVGs have been updated in Icon.
- Renamed Browser
redirectUrl
method toredirectTo
- Fieldset - stacks inputs rendered as children to the
Fieldset
component. - Carousel - can be used to display a gallery of slides.
Added margin and padding 0
to the base CSS.
All components that take a Size Prop have been unified to accept the following
extra-small
small
medium-small
medium
medium-large
large
extra-large
If you are using the default size of a component there is no change needed except for the Spinner
- Added
extra-small
- !! CHANGED -
smed to
medium-small` - !! CHANGED -
mlarge
tomedium-large
- Added
xlarge
- Added
extra-small
- !! CHANGED -
smed to
medium-small` - Added
medium
- !! CHANGED -
mlarge
tomedium-large
- Added
xlarge
-
!! CHANGED - default is now
medium
-
Added
extra-small
-
!! CHANGED -
smed to
medium-small` -
Added
medium
-
!! CHANGED -
mlarge
tomedium-large
-
Added
xlarge
- !! CHANGED -
xsmall
toextra-small
- !! CHANGED -
smed to
medium-small` - !! CHANGED -
med
tomedium
- !! CHANGED -
mlarge
tomedium-large
- Added
xlarge
Our Link component now supports the React Router. Instead of passing a href
prop, pass a to
prop and it will use React Router to navigate.
- Pod can now receive a prop of
onEdit
- if this is a String it will use it as ato
prop on a Link component, if it is a Function it will apply it as anonClick
handler, if it is an object it will apply it's props to the Link. - Pod has an additional padding size added of
extra-large
. - Pod now applies any additional props to it's top most child element.
- We have added a tertiary pod theme.
Content now has a secondary
theme which can be applied using the as
prop.
- You can supply a
input-width
prop to any input to define its width.
Modal
- Modal no longer closes on background click
- New prop
disableEscKey
is defaulted to false - Changes will also effect Dialog, Sidebar etc...
Dialog
- New props
showCloseIcon
(defaulted to true) which show and hides the close icon
Promises Polyfill. Carbon now contains a ES6 Promises helper which can be imported by
import from 'carbon/lib/utils/promises';
Message
- New props
transparent
(defaulted to false) which if set to true sets the background to transparent
- Decimal can now receive a prop of precision
- Small CSS change to remove gap in Safari
- Validation icons now position themselves relative to width of input field when label is inline.
- Add paperclip SVG to Icon
- Multi Step Wizard
- Add edit SVG to Icon
- Supports Ajax call for error validation
- Add reload function to browser helper
- Adding user class names to tabs.
- Authorize Objects in dialog title
Added a redirect action made by the browser. It is now easier to redirect to url
import Browser from 'carbon/lib/utils/helpers/browser';
Browser.redirectUrl(url)
- ButtonToggle.
- Warnings are now ready to use on form inputs, using the same API as validations you can supply an array as a prop to an input:
<Textbox warnings={[ new MyWarning ]} />
- CSS fixes to input error icon and error message.
- CSS fixes to input placeholder text for IE11.
- Fixes no results row in Table to span all columns.
- Fixes issue in Tabs where initialSelectedTabId was ignored
- Fixes a loading row in Table to span all columns.
- Disable multi select for single row in a table
- Add ability to set custom labels on Confirm dialog.
- Fixes scrollbar fixed height.
- Fixes word break on tooltips.
- Selectable table rows now emit an object instead of an array, containing more information about the selected rows.
- Sidebar now scrolls on overflow
- Adds
$app-light-font-family
Sass variable. - Adds
$app-medium-font-family
Sass variable. - Icons - plus, minus, processing. Update contact icons
- Improve tile footer style
- A developer can choose for a Table to not automatically render with a
tbody
, allowing them to manually render it<Table tbody={ false }>
. - Performance improvements for validation messages.
- Inputs can be rendered with fake inputs, useful for pages with lots of inputs where performance can be an issue.
- Number does not show undefined when value props is not provided and user enter alphabets
- Adds external link icon.
- Adds new colors:
$grey-dark-blue-5
,$grey-header
.
- Stores will now throw an error if an invalid action is dispatched.
- Fixes translation issues with Save and Cancel buttons in Form component.
- Fixes error with refresh method on Table, when Table does not have an ActionToolbar.
- Adds
business
andindividual
icons.
- Alert and Confirm have been updated to accept the dialog size prop. Default sizes remain unchanged.
- Fixes overflow bug on Table component.
- Fixes colors for recently added icons.
- Tabs emits a onTabClick event when on the headers is clicked
- Add phone, email, location and mobile icons
- Table now has a
refresh
method to force retrieve data.
- CSS prevent multi action siblings overlapping
- First columns in tables have additional left padding.
- Page size sets 1 of 1 when there are no records.
- Tabs remember the last one they were on when going back in the browser.
- Selectable Tables stopPropagation when selecting checkboxes.
- Adds loading and empty data states to Table component.
- CSS fixes to Portrait.
- CSS fixes to Spinner.
- CSS fixes to Pill.
- MulitActionButton Classes more specific
- Various UI Fixes:
- MultiActionButton toggle placement.
- Removed Tab padding.
- Fixed Button height to 31px.
- Multi Action Button
- Table and TableAjax now have props of
selectable
andhighlightable
, enabling selectable or highlightable rows. Each event also emits events which can be used by developers with props ofonSelect
oronHighlight
. Developers can also manually control the highlighting or selecting of rows using the same props on TableRow components. - Selectable rows also enables an action toolbar for the table, for which actions can be defined using the
actions
prop.
- Created CSS utility to handle generic CSS.
- Inline labels can now be aligned right.
- Added 'small' button option - renders pill-like secondary button.
- Made portrait inline-block to allow label to sit inline.
- Added a 'refresh' svg icon to the icon component.
- Form component can now set custom
saveText
as a prop. - Pill styling tweaked slightly.
- Made portrait inline-block to allow label to sit inline.
- Updated portrait colour for when no image is loaded.
- Update Radio Button and Checkbox colour when disabled and checked.
- Allow tooltip to decorate class that lacks componentProps method.
- Records value typecast to number for i18n in Pager
- Fixed CSS load order issue which caused icons to break their positioning.
- Improved store reset.
store.reset()
will now reset the store to its initial data, whether or not history is enabled. - Inputs can now have field help. Pass
fieldHelp='help message'
to any input. - Inputs can now have label help. Pass
labelHelp='help message'
to any input. - Add
thead
prop toTable
component that allows you to set a row wrapped in athead
tag.
- Sidebar - with sidebar header
- Portrait
- Content
- Help - An info icon with a tooltip.
- Tooltip
-
Row margin has been reduced to
15px
. -
Pod component now receives two additional props:
border
- allows developers to disable border.padding
- allows developers to have control over padding size.
-
Message style has changed to follow toast style
-
Pill style has changed
- Dialog now takes a prop of
disableBackground
which is true by default.
validate()
can now be called viathis.context.form
- Inclusion
- Exclusion
- Added utility classes for styling text.
- Format i18n error number for numeric validation.
- Allow Tables to shrink in size using the
shrink
prop. - Link component can now display with an icon.
- Child components of Row can now use a
columnAlign
prop. - Toast onDismiss is now optional
- Tooltip Decorator - currently available on Icon and Textbox.
- Fixes alignment issue with SplitButton when using anchors.
- Row component will not break with zero children or children of
null
orundefined
.
- Moves the validation logic in Form component to its own method.
- Adds
validateOnMount
prop to Forms. - Help Components on inputs with labels.
- Pager
- Filter
- Table Ajax
- TableCell and TableHeader can receive additional props.
- Inputs no longer render a label if the input has no name or label props.
- Table and TableHeader have been updated to allow sorting.
- Tabs - Passing a prop of align='right' will align tab headers to the right
Improve the existing Date widget to allow passing in minDate
and maxDate
.
An I18nHelper has been created to help with formatting decimal numbers.
Supplies base shouldComponentUpdate
We have added a helper method to convert strings into arrays, for example:
"foo[bar][baz]"
into ["foo", "bar", "baz"]
.
The parseJSON method now converts all integers to strings for consistency
- We have inserted an engine dependency for npm version 3. This is to help mitigate any issues of users reporting issues when installing with npm version 2.
- Spinner
- RadioButton
- Fixed numeral validator so it returns the correct type of validator.
- Fixed I18n translation for integer validation.
autoFocus
no longer automatically opens lists or datepickers on Dropdown and Date components.- Update validations i18n to use
errors.messages
instead ofvalidations
- Bluring of DropdownFilter/DropdownFilterAjax does not throw a js error when no items exist
We have converted Validations provided by Carbon into classes. This means that you need to create an instance when you want to use them.
For example, you would need to change:
<Textbox validations={ [PresenceValidator()] } />
To this:
<Textbox validations={ [new PresenceValidator()] } />
This allows better inspection of the validator, and the ability to modify params on the class.
We now add a common-input--disabled
class to the component when its input is disabled
- Inputs with multiple validations now validate correctly.
- DropdownFilter now parses its filter before creating a Regular Expression.
- Split Button has been given a fixed height to resolve UI issues.
- Dropdown up and down arrows now work with options that use strings for IDs.
- We now use the
$grey-dark-blue-40
color for placeholders in inputs
- SplitButton.
Checks numeral type (Integer of Decimal) Checks if value is equal, greater than, less than
// Integer with a min value of 8
<Number validations={ [NumeralValidator({ integer: true, min: 8 })] }/>
// Decimal with a between 8 and 20
<Number validations={ [NumeralValidator({ integer: true, min: 8, max: 20 })] }/>
// Decimal exactly 3.142
<Number validations={ [NumeralValidator({ is: 3.142 })] }/>
Checks the length of a number of a string
// length is greater than or equal to 8:
<Textbox validations={ [ LengthValidator({ min: 8 }) ] });
// length is less than or equal to 8:
<Textbox validations={ [ LengthValidator({ max: 8 }) ] });
// length is between 5 and 10 characters:
<Number validations={ [ LengthValidator({ min: 5, max: 10 }) ] });
// length is 10 characters:
<Number validations={ [ LengthValidator({ is: 10 }) ] });
Applies a regex validation to the input
<Textbox validations={ [RegexValidator({ format: (/[A-Z]{5}/) }) ] }/>
Applies a email validation to the input
<Textbox validations={ [ EmailValidator() ] }/>
We have added a new feature for input components which allows developers to output a prefix to the input.
<Textbox prefix="foo" />
- Toast notifications have had updated styling applied to them, based on new designs.
- Colour updates to Tabs, to align with design updates
- New colour variables added
- Button component will now render a stylised
anchor
instead of abutton
if passed ahref
prop.
- Add i18n to form buttons
- Performance updates to inputs. We also now provide a
shouldComponentUpdate
method which can be reused in custom components. - Inputs that are detached from a form no longer update error count.
- Form no longer validates disabled fields on submit.
- Form inputs are tracked by a guid now, rather than input name.
- Autocomplete is disabled for all inputs by default.
- Locks version numbers to try and mitigate incompatabilities with third party modules.
- SVG icons inside toast component now re-render properly.
Carbon now has a simple handler pattern implementation. For more information, see the guide.
- Toast
- Message
Several components allow the ability to define a particular type
or status
, such as warning
, error
or success
. We have standardised the way this is implemented in components, each of which should use a prop name of as
.
Similarly, each supported type comes as part of a Sass list variable called $colorIconSets
. This list can be used in component scss
files to iterate through the types available and automatically generate the code required for each type. This means each component will automatically update with any new types added to this list.
You can see examples of how this is implemented in the scss
files for Pill
, Flash
, Banner
or Toast
.
- Due to the standardisation of using the prop
as
, some components will have breaking changes to accomodate this:- Flash
- Pill
- The
cancelHandler
method onDialog
based components has been renamed toonCancel
to bring in line with the convention we would like to progress with for this kind of action name. - The
confirmHandler
method onConfirm
has also been renamed toonConfirm
to align with the naming convention.
- Dialog now centers itself if open on initialize.
- Table, TableRow, TableCell, TableHeader
- Confirm
- Animated Menu Button
- Notification
- Pill
- Banner
- Flash
The previous iteration of grid (InputGrid) was too restrictive, not allowing much flexibility and being too rigid in its implementation. We have now refactored grids creating a Table component with full control and flexibility for the developer. The new way of doing grids also means we no longer need to use complicated immutable helpers we had set up for line items as well as injecting row_id into the store.
The following is an example of how to use the Table component:
import React from 'react';
import { Table, TableRow, TableCell, TableHeader } from 'carbon/lib/components/table';
import Textbox from 'carbon/lib/components/textbox';
import Button from 'carbon/lib/components/button';
class MyView extends React.Component {
render() {
// We map the data from the store, to define what a row should look like.
// Using map allows the developer to define any content they want - this could
// render text, an input, a button or anything else.
let tableRows = this.props.data.map((row, index) => {
<TableRow>
// This cell renders just text for 'description'.
<TableCell>
{ row.get('description') }
</TableCell>
// This cell renders a textbox for 'name'. We also give it an onChange function. It is
// important to notice that we bind additional values to this function - 'this' and 'index'.
// This means that when the function is called it will receive the index as an argument.
// The store then knows which index in the array of data has been modified and needs to update,
// the mutation would look something like:
// `this.data = this.data.setIn(['line_items', action.index, action.name], action.value);`.
<TableCell>
<Textbox value={ row.get('name') } onChange={ Actions.nameUpdated.bind(this, index) } />
</TableCell>
// This cell renders a button component.
<TableCell>
<Button>An Action!</Button>
</TableCell>
</TableRow>
});
// tableRows is now an array mapped from the data we provided. We also need a table header so
// lets add that as an additional row in the array (unshift prepends to an array):
tableRows.unshift(
<TableRow>
<TableHeader>Description</TableHeader>
<TableHeader>Name</TableHeader>
<TableHeader>Actions</TableHeader>
</TableRow>
);
// We can now render the array of rows as a child of Table.
return (
<Table>
{ tableRows }
</Table>
);
}
}
export default MyView
The example above should highlight the flexibility available with grids. You can mix input with plain text or any other component, all in the same table. Adding a placeholder row is simple as well:
import React from 'react';
import { Table, TableRow, TableCell, TableHeader } from 'carbon/lib/components/table';
import Textbox from 'carbon/lib/components/textbox';
class MyView extends React.Component {
render() {
// Define tableRows.
let tableRows = this.props.data.map((row, index) => {
<TableRow>
<TableCell>
<Textbox name="description" value={ row.get('description') } onChange={ Actions.valueUpdated.bind(this, index) } />
</TableCell>
<TableCell>
<Textbox name="name" value={ row.get('name') } onChange={ Actions.valueUpdated.bind(this, index) } />
</TableCell>
</TableRow>
});
// Add header.
tableRows.unshift(
<TableRow>
<TableHeader>Description</TableHeader>
<TableHeader>Name</TableHeader>
</TableRow>
);
// Add placeholder row. The main difference between a regular row is we are not mapping any data to
// this row (as it has none). Also, instead of an index, we are passing the data count to the bound
// action. This means on valueUpdated that it will update the value in the array to an index which
// does not yet exist - effectively creating the new row.
tableRows.push(
<TableRow>
<TableCell>
<Textbox name="description" onChange={ Actions.valueUpdated.bind(this, this.data.count()) } />
</TableCell>
<TableCell>
<Textbox name="name" onChange={ Actions.valueUpdated.bind(this, this.data.count()) } />
</TableCell>
</TableRow>
);
// We can now render the array of rows as a child of Table.
return (
<Table>
{ tableRows }
</Table>
);
}
}
export default MyView
- Decrease width of dropdown icon to 20px
- Backported dropdown validation fix.
- Fixes bug - 'item is undefined triggered when clicking away from dropdown with option highlighted'.
startRouter
no longer throws an error if it cannot find an element to render the component to.
- Dropdown will always return a string value to any callbacks.
- Dropdown components auto select highlighted values on blur.
- Carbon now compiles code to
lib
, allowing developers to no longer require installing babel on their computer.
- Fixes validation message width in Firefox.
- Tabs can now render a single child
- Form submitting state is now controlled by the developer using the
saving
prop.
- Developers can now set the alignment on an input's value using the
align
prop. - Tab allows null children.
- Alert
- Link
- Tabs
Breaking Change! cancelHandler
prop (rather than the cancelDialogHandler
).
Dropdown components have been refactored. We now have three different kinds:
- Dropdown
- Dropdown Filter
- Dropdown Filter Ajax
In previous versions of Carbon, all inputs required a name
property. Some Carbon components would manipulate what this name was, depending on where the input was used.
To keep things simple, and to remove some of the logic behind the scenes, we no longer do any manipulation on input names and the property is no longer a requirement when using a form input.
It is still recommended that you use names on inputs, as they are useful to identify your which input is which. They are also required if you are performing standing HTML form submissions.
- Pod has an option to make it collapsible.
- Fixes position and width or validation messages on inputs.
- Fixes re-validating fields when content is pasted into an input.
- On successful submit, form components will disable their save buttons to prevent multiple form submissions.
An extra validation has been added to decimal to prevent multiple separators from being entered in the input field.
Dropdown and dropdown-suggest have been updated. As they share common functionality, dropdown and dropdown-suggest now use a List decorator. This should not affect how you use either component.
- Dropdown now filters results as you type.
Dialogs have been updated to pass context to any children components. We have used this to switch the Form Cancel button to use the Dialog's cancel handler when the form is nested in a dialog. This overrides the default history.back method.
We have standardised the utilities we provide to easily set up Flux based applications. This involved a few breaking changes:
The base Store class is now available from:
import Store from 'carbon/lib/utils/flux/store';
When creating your store, initialize it with your application's dispatcher. You must also define the store's data and unique name within its constructor. The following shows the minimum required to set up a store:
import Store from 'carbon/lib/utils/flux/store';
import Dispatcher from 'dispatcher';
import ImmutableHelper from 'carbon/lib/utils/helpers/immutable';
class MyStore extends Store {
...
}
let data = ImmutableHelper.parseJSON({});
// init the store with a name, some data, and your dispatcher
export default new MyStore('myStore', data, Dispatcher);
The view helper is now available as a flux utility from Carbon. This was done to clarify its intentions. You can import it with:
import { connect } from 'carbon/lib/utils/flux';
You can then use the connect
function to connect a React component to a store:
import React from 'react';
import MyStore from 'stores/my-store';
import { connect } from 'carbon/lib/utils/flux';
class MyComponent extends React.Component {
render() {
// the connected store data is available on the state as the store's unique name defined in its constructor
let val = this.state.myStore.get('myValue');
return (
<div>My Component.</div>
);
}
}
export default connect(MyComponent, MyStore);
This sets up the listeners and data synchronising between the component and the store.
The connect function can connect multiple stores to the component - simply provide them as an array:
connect(MyComponent, [MyStore, MyOtherStore]);
The route helper now returns a specific function:
import React from 'react';
import { Route } from 'react-router';
import { startRouter } from 'carbon/lib/utils/router';
let routes = (
<Route />
);
startRouter(routes);
The startRouter
function initializes the React router with the given routes. It can also take a second parameter for the HTML target in which to render the React components (by default this uses document.getElementById('app')
).
We now use decorators instead of Higher Order Components in our component library as they are easier to test and result in a tidier and more logical codebase.
Decorators can be found in the /utils/decorators
directory. So far we have decorators for:
- Input
- Input Icon
- Input Label
- Input Validation
Note: although there is an ES7 Babel transform for decorators, we have opted not to use it for now due to the way in which it compiles and produces missing coverage reports.
TableFieldsForMany
is now called InputGrid
.
We have renamed this because its original name was based on a Rails convention and was fairly obscure and confusing.
A new style and colour scheme has been applied to the carbon components library. This change will affect all of the components.
Validations have changed to a function so that different parameters can be passed to them.
You can now define Validations on a component using the following syntax:
<Textbox validations={ [Validation()] } name='valid' />
- Ran ESLint task and fixed any errors.
- Form provides a serialization method to parse its inputs into data usable for Ajax.
- Forms no longer needs a model name defined.
- Updated Form Cancel Button to use History object.
- Textarea is no longer draggable. Add a expandable={true} prop to make the area height change to fit content
- Input components can now use custom classes.
- Checkbox label now sits inline, and is reversable.
- Added props on inputs for inline labels.
- Added Rainbow chart component.
- Added Tabs component.
- Added Number component.
- Decimal now allows tabbing in and out of the field.
- Date now closes on tab out.
Initial prototype release.
Components included:
- Button
- Checkbox
- Date
- Decimal
- Dialog
- Dropdown Suggest
- Dropdown
- Form
- Pod
- Row
- Table Fields for Many
- Table Row
- Textarea
- Textbox
Utils included:
- Events Helper (to help determine keyboard events)
- Immutable Helper (to perform generic tasks with Immutable.js)
- Icons (to include icons from the web font)
- Inputs & Input Validation (generic functionality for inputs)
- Validations (reusable functionality for validations)
- Route Helper (component to provide base route functionality)
- Store Helper (base class for base store functionality)
- View Helper (component to provide base view functionality)