Skip to content

Commit 5916f2f

Browse files
committed
fix(subtabs): adjust position of unsaved indicator when used with notifications
1 parent aaaf487 commit 5916f2f

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed

ui/components/tabs/base/_index.scss

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,33 @@
194194
background-color: $color-brand-dark;
195195
}
196196
}
197+
198+
.slds-indicator_unread {
199+
display: inline-block;
200+
height: 6px;
201+
width: 6px;
202+
position: relative;
203+
top: auto;
204+
left: auto;
205+
}
206+
}
207+
208+
/**
209+
* @summary Creates styles for a Tab Item when its in an unsaved or dirty state
210+
* @selector .slds-is-unsaved
211+
* @restrict .slds-tabs_default__item
212+
*/
213+
&.slds-is-unsaved {
214+
215+
.slds-indicator_unread {
216+
margin-left: -0.35rem; //random but matches spec
217+
}
218+
219+
.slds-indicator_unsaved {
220+
position: relative;
221+
top: ($spacing-xx-small * -1);
222+
}
223+
197224
}
198225
}
199226

ui/components/tabs/sub-tabs/example.jsx

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ let Subtab = props => (
1818
{
1919
'slds-has-notification': props.hasNotification,
2020
'slds-has-focus': props.hasFocus,
21-
'slds-active': props.active
21+
'slds-active': props.active,
22+
'slds-is-unsaved': props.itemUnsaved
2223
},
2324
props.className
2425
)}
@@ -352,5 +353,45 @@ export let states = [
352353
</div>
353354
</div>
354355
)
356+
},
357+
{
358+
id: 'subtabs-notification-dirty',
359+
label: 'Unsaved With Notification',
360+
element: (
361+
<div className="slds-tabs_default slds-sub-tabs">
362+
<ul className="slds-tabs_default__nav" role="tablist">
363+
<Subtab
364+
title="00071938"
365+
active
366+
tabItemId="subtab-tabitem-01"
367+
tabPanelId="subtab-tabpanel-01"
368+
/>
369+
<Subtab
370+
title="Chat - Customer"
371+
hasNotification
372+
itemUnsaved
373+
tabItemId="subtab-tabitem-02"
374+
tabPanelId="subtab-tabpanel-02"
375+
symbol="live_chat"
376+
/>
377+
</ul>
378+
<div
379+
className="slds-tabs_default__content slds-show"
380+
id="subtab-tabpanel-01"
381+
role="tabpanel"
382+
aria-labelledby="subtab-tabitem-01"
383+
>
384+
Item One Content
385+
</div>
386+
<div
387+
className="slds-tabs_default__content slds-hide"
388+
id="subtab-tabpanel-02"
389+
role="tabpanel"
390+
aria-labelledby="subtab-tabitem-02"
391+
>
392+
Item Two Content
393+
</div>
394+
</div>
395+
)
355396
}
356397
];

0 commit comments

Comments
 (0)