Consistency in naming component "types"
Description
To have a consistent way of defining type for the components/directives, based on the way we create themes.
Current state
igx-badge API:
| type | string | Set the badge type to either default, info, success, warning, or error. Depending on the type, specific background color is set as declared in the default theme. |
|---|
igx-linear-bar API:
| type | string | Set type of the linear bar. Possible options - default, success, info, warning, and danger. |
|---|
igx-circular-bar does not have a type in the API.
igxButton does not have type in the API, and can only be modified though the theming engine.
Expectations
Our palettes accept arguments for primary, secondary, info, success, warn, and error colors. I would expect to get a "default" without explicitly setting it, so a "default" option seems redundant. I'd expect to receive the theming colors as options - namely: primary, secondary, info, success, and warn for each of the already mentioned components/directives.
- [x] remove "default" options.
- [x] rename (possibly add, to avoid breaking changes) the 'danger' type to 'error'
- [x] ~~add 'primary' and 'secondary' options to igx-linear-bar~~
- [x] ~~add 'primary' and 'secondary' options to igx-badge~~
- [x] ~~add type to igxButton~~
- [x] ~~add type to igx-circular-bar~~
- [ ] remove "default" options. - This would cause a breaking change.
- [ ] rename (possibly add, to avoid breaking changes) the 'danger' type to 'error' - This can be done.
- [ ] add 'primary' and 'secondary' options to igx-linear-bar - I don't see why we would do/need that.
- [ ] add 'primary' and 'secondary' options to igx-badge - I don't see why we would do/need that.
- [ ] add type to igxButton - This could definitely be improved, but it would be a breaking change.
- [ ] add type to igx-circular-bar - This can safely be refactored.
I've identified the following relevant enumerator types that can be modified:
Avatar Component (set via type):
export enum AvatarType {
DEFAULT = 'default',
INITIALS = 'initials',
IMAGE = 'image',
ICON = 'icon'
}
Badge Component (set via type):
export enum Type {
DEFAULT = 'default',
INFO = 'info',
SUCCESS = 'success',
WARNING = 'warning',
ERROR = 'error'
}
Card Component (set via type):
export enum IgxCardType {
DEFAULT = 'default',
OUTLINED = 'outlined'
}
Divider Directive (set via type):
export enum IgxDividerType {
DEFAULT = 'default',
DASHED = 'dashed'
}
Linear Progress (set via type):
export enum IgxProgressType {
DANGER = 'danger',
INFO = 'info',
WARNING = 'warning',
SUCCESS = 'success'
}
Tabs Component (set via tabsType):
export enum TabsType {
FIXED = 'fixed',
CONTENTFIT = 'contentfit'
}
Slider Component (set via type):
export enum SliderType {
SLIDER,
RANGE
}
Input Group Component (set via type):
enum IgxInputGroupType {
LINE,
BOX,
BORDER,
FLUENT,
SEARCH,
FLUENT_SEARCH,
}
The igxButton directive doesn't have an enumerator listing all of it's types. This can definitely be improved, but as stated above, it will be another breaking change.
@simeonoff should we also consider the error, warn, success on the input? These styles should be triggered by validation implicitly but nevertheless it may make sense in certain scenarios to want to set their state e.g. if the validity is a combination of fields that have to make sense together.
also for the badge and progress I see how removing default and adding the primary and secondary is a breaking change but I don't see it as a big problem. We can deprecate the default and introduce the two new options for a while before removing the default type completely. I think the new options will give some more flexibility and make sense.
Sorry if I am missing the obvious but what breaking change are we introducing to the buttons? Do you mean that they have types like raised, flat etc. and adding on for the color would be the breaking change?
OK, @simeonoff and I agreed on how we should proceed and the comment above should be disregarded