Skip to content

Commit 4889ba4

Browse files
committed
US198278 tab design updates
* added knobs for theme, orientation and variants for accordion, tabs, and content set
1 parent 7972dff commit 4889ba4

File tree

7 files changed

+56
-33
lines changed

7 files changed

+56
-33
lines changed

elements/pfe-accordion/demo/pfe-accordion.story.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ stories.add(PfeAccordion.tag, () => {
2020
let config = {};
2121
// const props = PfeAccordion.properties;
2222
// const slots = PfeAccordion.slots;
23+
const props = {
24+
on: {
25+
title: "Theme",
26+
type: "string",
27+
enum: [
28+
"light",
29+
"dark"
30+
],
31+
default: "light"
32+
}
33+
};
34+
35+
config.prop = tools.autoPropKnobs(props, storybookBridge);
2336

2437
//-- Add content to light DOM
2538
config.slots = [];

elements/pfe-content-set/demo/pfe-content-set.story.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ stories.add(PfeContentSet.tag, () => {
3030

3131
const variantLabel = "Variant";
3232
const variantOptions = {
33-
"": "default",
34-
primary: "Primary",
35-
secondary: "Secondary"
33+
wind: "wind",
34+
earth: "earth"
3635
};
37-
const variantDefault = "";
36+
const variantDefault = "wind";
3837
const variant = select(variantLabel, variantOptions, variantDefault);
3938
const variantAttr = variant ? ` pfe-variant="${variant}"` : "";
4039

@@ -55,7 +54,7 @@ stories.add(PfeContentSet.tag, () => {
5554
.map((item, i) =>
5655
sets.push({
5756
heading: lorem(headingConfig).replace(/^\w/, c => c.toUpperCase()),
58-
panel: `<h2>${lorem(headingConfig).replace(/^\w/, c =>
57+
panel: `<h2 style="margin-top: 0;">${lorem(headingConfig).replace(/^\w/, c =>
5958
c.toUpperCase()
6059
)}</h2>
6160
${lorem({
@@ -73,7 +72,7 @@ ${Array(countVar)
7372
.split(0)
7473
.map(
7574
(item, i) => `
76-
<h2 pfe-content-set--header>${sets[i].heading}</h2>
75+
<h3 pfe-content-set--header style="margin: 0;">${sets[i].heading}</h3>
7776
<div pfe-content-set--panel>
7877
${sets[i].panel}
7978
</div>`)

elements/pfe-sass/mixins/_mixins.scss

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -193,29 +193,6 @@
193193
}
194194
}
195195

196-
/// ===========================================================================
197-
/// Tab-specific SASS mixins
198-
/// ===========================================================================
199-
200-
@mixin pfe-tab-panel-container($orientation: "horizontal", $border: false) {
201-
margin: 0;
202-
width: 100%;
203-
padding: #{pfe-var(container-spacer)} 0;
204-
@if $orientation == "vertical" {
205-
padding-left: calc(#{pfe-var(container-spacer)} * 2);
206-
}
207-
@if $border {
208-
padding: calc(#{pfe-var(container-spacer)} * 2);
209-
border: #{pfe-var(ui--border-width)} #{pfe-var(ui--border-style)} #{pfe-color(surface--border)};
210-
@if $orientation == "horizontal" {
211-
border-top: none;
212-
}
213-
@if $orientation == "vertical" {
214-
border-left: none;
215-
}
216-
}
217-
}
218-
219196
/// ===========================================================================
220197
/// Accordion Specific SASS Vars
221198
/// ===========================================================================

elements/pfe-sass/variables/_maps.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ $pfe-colors: (
5353
ui-disabled--text: $pfe-color--ui-disabled--text,
5454
ui-disabled--text--hover: $pfe-color--ui-disabled--text--hover,
5555

56-
ui-tab--dark-hover-color: $pfe-color--white,
57-
58-
5956
// ========================================================================
6057
// Base Surface Colors for Container elements
6158
// ========================================================================

elements/pfe-tabs/demo/pfe-tabs.story.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ stories.add(PfeTabs.tag, () => {
3535
title: "Vertical orientation",
3636
type: "boolean",
3737
default: false
38+
},
39+
on: {
40+
title: "Theme",
41+
type: "string",
42+
enum: [
43+
"light",
44+
"dark"
45+
],
46+
default: "light"
47+
},
48+
"pfe-variant": {
49+
title: "Variant",
50+
type: "string",
51+
enum: [
52+
"wind",
53+
"earth"
54+
],
55+
default: "wind"
3856
}
3957
};
4058

elements/pfe-tabs/src/pfe-tab-panel.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
$LOCAL: tabs;
44

5+
@mixin pfe-tab-panel-container($orientation: "horizontal", $border: false) {
6+
margin: 0;
7+
width: 100%;
8+
padding: #{pfe-var(container-spacer)} 0;
9+
@if $orientation == "vertical" {
10+
padding-left: calc(#{pfe-var(container-spacer)} * 2);
11+
}
12+
@if $border {
13+
padding: calc(#{pfe-var(container-spacer)} * 2);
14+
border: #{pfe-var(ui--border-width)} #{pfe-var(ui--border-style)} #{pfe-color(surface--border)};
15+
@if $orientation == "horizontal" {
16+
border-top: none;
17+
}
18+
@if $orientation == "vertical" {
19+
border-left: none;
20+
}
21+
}
22+
}
23+
524
:host {
625
display: block;
726
color: #{pfe-radio(color--text)};

elements/pfe-tabs/src/pfe-tab.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ $LOCAL: tabs;
7777

7878
:host([pfe-variant="wind"][aria-selected="true"][on="dark"]),
7979
:host([pfe-variant="wind"][on="dark"]:hover) {
80-
--pfe-tabs--aux: #{pfe-color(ui-tab--dark-hover-color)};
80+
--pfe-tabs--aux: #{pfe-color(text--on-dark)};
8181
}
8282

8383
/// ===========================================================================

0 commit comments

Comments
 (0)