ic-ui-kit icon indicating copy to clipboard operation
ic-ui-kit copied to clipboard

[ic-loading-indicator]: Allow loading indicator to accept arrays of strings

Open MI6-451 opened this issue 3 years ago • 2 comments

Summary

Allow the loading indicator to allow arrays of strings as prop inputs as opposed to a single string with values separated by '/'

💬 Description

Currently, when a developer wants to have multiple text values appear and switch periodically below a loading indicator component (e.g. loading -> still loading -> loading) this must be input as a single string with values separated by '/' e.g. "loading/still loading" We should instead allow developers to input an array of strings e.g. ["loading", "still loading"]

💰 Use value

This change will hopefully make the developer experience when using this component smoother as it is more in line with standard practice and what most developers would expect.

Additional info

This will introduce a breaking change as any loading indicators currently implemented with multiple text values will need to be updated to use arrays rather than '/' separated values.

MI6-451 avatar Jan 09 '23 12:01 MI6-451

Depending on when this is done, it may be possible to allow an array and string with '/'. There is a split which converts the string to an array (https://github.com/mi6/ic-ui-kit/blob/main/packages/web-components/src/components/ic-loading-indicator/ic-loading-indicator.tsx#L202), so there can be a check on the data type of label. If returns array/object, skip the split and use the rest of the method.

jd239 avatar Mar 29 '23 14:03 jd239

Do on the v3 branch when we work on it

MI6-255 avatar Jun 13 '24 09:06 MI6-255