Skip to content

Commit 760d8bb

Browse files
authored
Merge pull request #169 from umbraco/feature/loader-bar-looks
2 parents adb4f3b + a74cccc commit 760d8bb

File tree

10 files changed

+15022
-5640
lines changed

10 files changed

+15022
-5640
lines changed

package-lock.json

Lines changed: 14997 additions & 5629 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/uui-button/lib/uui-button.element.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ export class UUIButtonElement extends LabelMixin('', LitElement) {
166166
#loader {
167167
font-size: 1.5em;
168168
}
169+
:host([look]:not([look=''])) #loader {
170+
color: inherit;
171+
}
169172
170173
/* ANIMATIONS */
171174
@keyframes fadeIn {

packages/uui-button/lib/uui-button.story.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default {
1818
look: '',
1919
type: '',
2020
label: 'Button',
21+
state: '',
2122
},
2223
argTypes: {
2324
look: {
@@ -270,11 +271,8 @@ WithIcon.parameters = {
270271
},
271272
};
272273

273-
export const WaitingState = () => html`
274-
<uui-button state="waiting" label="A11Y proper label">
275-
Loading button
276-
</uui-button>
277-
`;
274+
export const WaitingState = Template.bind({});
275+
WaitingState.args = { state: 'waiting' };
278276
WaitingState.parameters = {
279277
docs: {
280278
source: {

packages/uui-css/lib/custom-properties/colors.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,10 @@
182182
--uui-color-mine-grey-dimmed: color(
183183
$mine-grey saturation(- 100%) lightness(+ 10%)
184184
);
185+
186+
--uui-color-primary: var(--uui-color-violet-blue);
187+
--uui-color-secondary: var(--uui-color-timberwolf);
188+
--uui-color-positive: var(--uui-color-jungle-green);
189+
--uui-color-warning: var(--uui-color-sunglow);
190+
--uui-color-danger: var(--uui-color-maroon-flush);
185191
}

packages/uui-loader-bar/lib/uui-loader-bar.element.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export class UUILoaderBarElement extends LitElement {
1919
width: 100%;
2020
height: 4px;
2121
overflow: hidden;
22+
color: var(--uui-color-primary);
2223
}
2324
2425
#bar,
@@ -74,6 +75,7 @@ export class UUILoaderBarElement extends LitElement {
7475
];
7576

7677
private _progress = 0;
78+
7779
/**
7880
* Set this to a number between 0 and 100 to reflect the progress of some operation. When the value is left at 0 loader will looped animation
7981
* @type {number}

packages/uui-loader-bar/lib/uui-loader-bar.story.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ const Template: Story = props =>
2727
<uui-loader-bar
2828
progress=${props.progress}
2929
animationDuration=${props.animationDuration}
30-
style="color: ${props.color}"></uui-loader-bar>
30+
style=${props.color ? 'color: ' + props.color : ''}></uui-loader-bar>
3131
`;
3232

3333
export const AAAOverview = Template.bind({});
3434
AAAOverview.storyName = 'Overview';
35-
AAAOverview.args = { color: 'black' };
35+
AAAOverview.args = { color: '' };
3636
AAAOverview.argTypes = {
3737
color: { table: { category: 'inline styling' } },
3838
};

packages/uui-loader-circle/lib/uui-loader-circle.element.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export class UUILoaderCircleElement extends LitElement {
2121
position: relative;
2222
width: 1em;
2323
height: 1em;
24+
color: var(--uui-color-primary);
2425
}
2526
2627
#spinner {

packages/uui-loader-circle/lib/uui-loader-circle.story.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@ export default {
2222
const Template: Story = props =>
2323
html`
2424
<uui-loader-circle
25-
style="color: ${props.color}; font-size: ${props.fontSize}"
25+
style="${props.color
26+
? 'color: ' + props.color
27+
: ''}; font-size: ${props.fontSize}"
2628
progress=${props.progress}
2729
?show-progress=${props.showProgress}></uui-loader-circle>
2830
`;
2931

3032
export const AAAOverview = Template.bind({});
3133
AAAOverview.storyName = 'Overview';
3234

33-
AAAOverview.args = { color: 'black' };
35+
AAAOverview.args = { color: '' };
3436
AAAOverview.argTypes = {
3537
color: { table: { category: 'inline styling' } },
3638
};

packages/uui-loader/lib/uui-loader.element.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export class UUILoaderElement extends LitElement {
1111
css`
1212
:host {
1313
/* currently this components color is defined through currentColor, if we like to use a different color, we need to implemenet a --uui-interface- color which will be set/overwritten when looks are set, aka. if this element is used within a button with the look danger, then this component would get an appropriate color. */
14+
color: var(--uui-color-primary);
1415
}
1516
1617
div {

packages/uui-loader/lib/uui-loader.story.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ export default {
1818
};
1919

2020
export const Overview: Story = props =>
21-
html`<uui-loader style="color: ${props.color}"></uui-loader>`;
22-
Overview.args = { color: 'black' };
21+
html`<uui-loader
22+
style=${props.color ? 'color: ' + props.color : ''}></uui-loader>`;
23+
Overview.args = { color: '' };
2324
Overview.argTypes = {
2425
color: { table: { category: 'inline styling' } },
2526
};

0 commit comments

Comments
 (0)