Skip to content

Commit 69df0db

Browse files
committed
cleanup after SB8 upgrade
1 parent edec3ad commit 69df0db

File tree

5 files changed

+111
-119
lines changed

5 files changed

+111
-119
lines changed

docs/js/all.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/navigation.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

stories/Components/Navigationcomponents/Sidebar/Sidebar.stories.js

Lines changed: 106 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -17,125 +17,123 @@ export default {
1717
},
1818
parameters: {
1919
docs: {
20-
page: () => (
21-
<>
22-
<h1>Sidebar</h1>
23-
24-
<p>The Sidebar Component is a shorter piece of text that appears next to and accompanies a longer article.</p>
25-
26-
<h3>Overview</h3>
27-
<p>A sidebar is a column on the left or right side of a page which highlights the extra information related to the page.</p>
28-
<p><strong>When to use:</strong></p>
29-
<ul>
30-
<li>When an extra piece of information needs to be added to the page.</li>
31-
<li>When links to the supplementary information need to be added.</li>
32-
</ul>
33-
34-
<h3>Formatting</h3>
35-
36-
<h4>Default</h4>
37-
<p>The sidebar is a column that displays the supplementary information or links related to the page.</p>
38-
39-
<h3>Behaviors</h3>
40-
41-
<h4>States</h4>
42-
<p>The sidebar First level row has two types: default and mobile with three states: default, hover, and selected. The mobile sidebar is used for mobile applications.</p>
43-
<p>The following behavior modifiers are available:</p>
44-
45-
<h5>Default state:</h5>
46-
<ol>
47-
<li>The White colored box with the default state indicates that the sidebar is not opened or expanded yet.</li>
48-
<li>The White colored box with down arrow and default state indicates that the sidebar isn’t open but expanded.</li>
49-
<li>The White colored box with the up arrow and default state indicates that the sidebar is opened and expanded.</li>
50-
</ol>
51-
52-
<h5>Hover state:</h5>
53-
<ol>
54-
<li>The Gray coloured box with hover state indicates that once the mouse is hovered over the sidebar it changes appearance.</li>
55-
<li>The Gray colored box with down arrow and a hover state indicates that the sidebar changes appearance when the mouse hovers over it. The down arrow indicates that it is not opened but expanded.</li>
56-
<li>The Gray colored box with the up arrow and hover state indicates that the sidebar changes appearance when the mouse hovers over it. The up arrow indicates that it is opened and expanded.</li>
57-
</ol>
58-
59-
<h5>Selected state:</h5>
60-
<ol>
61-
<li>The Blue colored box with selected state indicates that the sidebar is selected but it isn’t opened or expanded.</li>
62-
<li>The Blue colored box with a down arrow and selected state indicates that the sidebar is selected. The down arrow indicates that the sidebar is expanded but isn’t opened.</li>
63-
<li>The Blue colored box with the up arrow and selected state indicates that the sidebar is selected. The up arrow indicates that the sidebar is opened and expanded.</li>
64-
<li>The Second level row has two types: default and mobile with two states: default and hover. The font size is smaller for the mobile sidebar to make it more convenient as the mobile screen is smaller than the laptop/desktop.</li>
65-
</ol>
66-
67-
<h4>Default state:</h4>
68-
<ol>
69-
<li>The White colored box with the default state indicates the second sidebar which contains more information regarding the page.</li>
70-
</ol>
71-
72-
<h4>Hover state:</h4>
73-
<p>The Grey colored box with hover state indicates that the sidebar changes appearance once the mouse hovers over it.</p>
74-
75-
<Canvas>
76-
<Story name="Sidebar">
77-
{(args) => (
78-
<Sidebar
79-
data={caption.sidebardata}
80-
headerText={caption.headerText}
81-
label={caption.label}
82-
size="large-4"
83-
active={"default"}
84-
{...args}
85-
/>
86-
)}
87-
</Story>
88-
</Canvas>
89-
90-
<h3>Usage:</h3>
91-
<ol>
92-
<li>Copy HTML from the HTML tab of canvas and also include CSS and JS files listed below.</li>
93-
<li>Initialize the sidebar for mobile and desktop by calling <code>sidebarNav()</code>, <code>sidebarMenu()</code> functions.</li>
94-
</ol>
95-
96-
<h3>CSS and JS References</h3>
97-
<h4>CSS:</h4>
98-
<ul>
99-
<li><a href="https://cdn.jsdelivr.net/npm/@undp/design-system/docs/css/base-minimal.min.css">https://cdn.jsdelivr.net/npm/@undp/design-system/docs/css/base-minimal.min.css</a></li>
100-
<li><a href="https://cdn.jsdelivr.net/npm/@undp/design-system/docs/css/components/sidebar-data.min.css">https://cdn.jsdelivr.net/npm/@undp/design-system/docs/css/components/sidebar-data.min.css</a></li>
101-
<li><a href="https://cdn.jsdelivr.net/npm/@undp/design-system/docs/css/components/sidebar.min.css">https://cdn.jsdelivr.net/npm/@undp/design-system/docs/css/components/sidebar.min.css</a></li>
102-
</ul>
103-
104-
<h4>JS:</h4>
105-
<ul>
106-
<li><a href="https://cdn.jsdelivr.net/npm/@undp/design-system/docs/js/sidebar.min.js">https://cdn.jsdelivr.net/npm/@undp/design-system/docs/js/sidebar.min.js</a></li>
107-
</ul>
108-
109-
<h3>Interactions</h3>
110-
<ul>
111-
<li>The hover state is applied to the entire button.</li>
112-
<li>The selected state is applied to the entire button.</li>
113-
</ul>
114-
115-
<h3>Changelog</h3>
116-
<p>1.0 — Released component</p>
117-
118-
</>
119-
)
20+
page: () => (
21+
<>
22+
<h1>Sidebar</h1>
23+
24+
<p>The Sidebar Component is a shorter piece of text that appears next to and accompanies a longer article.</p>
25+
26+
<h3>Overview</h3>
27+
<p>A sidebar is a column on the left or right side of a page which highlights the extra information related to the page.</p>
28+
<p><strong>When to use:</strong></p>
29+
<ul>
30+
<li>When an extra piece of information needs to be added to the page.</li>
31+
<li>When links to the supplementary information need to be added.</li>
32+
</ul>
33+
34+
<h3>Formatting</h3>
35+
36+
<h4>Default</h4>
37+
<p>The sidebar is a column that displays the supplementary information or links related to the page.</p>
38+
39+
<h3>Behaviors</h3>
40+
41+
<h4>States</h4>
42+
<p>The sidebar First level row has two types: default and mobile with three states: default, hover, and selected. The mobile sidebar is used for mobile applications.</p>
43+
<p>The following behavior modifiers are available:</p>
44+
45+
<h5>Default state:</h5>
46+
<ol>
47+
<li>The White colored box with the default state indicates that the sidebar is not opened or expanded yet.</li>
48+
<li>The White colored box with down arrow and default state indicates that the sidebar isn’t open but expanded.</li>
49+
<li>The White colored box with the up arrow and default state indicates that the sidebar is opened and expanded.</li>
50+
</ol>
51+
52+
<h5>Hover state:</h5>
53+
<ol>
54+
<li>The Gray coloured box with hover state indicates that once the mouse is hovered over the sidebar it changes appearance.</li>
55+
<li>The Gray colored box with down arrow and a hover state indicates that the sidebar changes appearance when the mouse hovers over it. The down arrow indicates that it is not opened but expanded.</li>
56+
<li>The Gray colored box with the up arrow and hover state indicates that the sidebar changes appearance when the mouse hovers over it. The up arrow indicates that it is opened and expanded.</li>
57+
</ol>
58+
59+
<h5>Selected state:</h5>
60+
<ol>
61+
<li>The Blue colored box with selected state indicates that the sidebar is selected but it isn’t opened or expanded.</li>
62+
<li>The Blue colored box with a down arrow and selected state indicates that the sidebar is selected. The down arrow indicates that the sidebar is expanded but isn’t opened.</li>
63+
<li>The Blue colored box with the up arrow and selected state indicates that the sidebar is selected. The up arrow indicates that the sidebar is opened and expanded.</li>
64+
<li>The Second level row has two types: default and mobile with two states: default and hover. The font size is smaller for the mobile sidebar to make it more convenient as the mobile screen is smaller than the laptop/desktop.</li>
65+
</ol>
66+
67+
<h4>Default state:</h4>
68+
<ol>
69+
<li>The White colored box with the default state indicates the second sidebar which contains more information regarding the page.</li>
70+
</ol>
71+
72+
<h4>Hover state:</h4>
73+
<p>The Grey colored box with hover state indicates that the sidebar changes appearance once the mouse hovers over it.</p>
74+
75+
<Canvas>
76+
<Story name="Sidebar">
77+
{(args) => (
78+
<Sidebar
79+
data={caption.sidebardata}
80+
headerText={caption.headerText}
81+
label={caption.label}
82+
size="large-4"
83+
active={"default"}
84+
{...args}
85+
/>
86+
)}
87+
</Story>
88+
</Canvas>
89+
90+
<h3>Usage:</h3>
91+
<ol>
92+
<li>Copy HTML from the HTML tab of canvas and also include CSS and JS files listed below.</li>
93+
<li>Initialize the sidebar for mobile and desktop by calling <code>sidebarNav()</code>, <code>sidebarMenu()</code> functions.</li>
94+
</ol>
95+
96+
<h3>CSS and JS References</h3>
97+
<h4>CSS:</h4>
98+
<ul>
99+
<li><a href="https://cdn.jsdelivr.net/npm/@undp/design-system/docs/css/base-minimal.min.css">https://cdn.jsdelivr.net/npm/@undp/design-system/docs/css/base-minimal.min.css</a></li>
100+
<li><a href="https://cdn.jsdelivr.net/npm/@undp/design-system/docs/css/components/sidebar-data.min.css">https://cdn.jsdelivr.net/npm/@undp/design-system/docs/css/components/sidebar-data.min.css</a></li>
101+
<li><a href="https://cdn.jsdelivr.net/npm/@undp/design-system/docs/css/components/sidebar.min.css">https://cdn.jsdelivr.net/npm/@undp/design-system/docs/css/components/sidebar.min.css</a></li>
102+
</ul>
103+
104+
<h4>JS:</h4>
105+
<ul>
106+
<li><a href="https://cdn.jsdelivr.net/npm/@undp/design-system/docs/js/sidebar.min.js">https://cdn.jsdelivr.net/npm/@undp/design-system/docs/js/sidebar.min.js</a></li>
107+
</ul>
108+
109+
<h3>Interactions</h3>
110+
<ul>
111+
<li>The hover state is applied to the entire button.</li>
112+
<li>The selected state is applied to the entire button.</li>
113+
</ul>
114+
115+
<h3>Changelog</h3>
116+
<p>1.0 — Released component</p>
117+
118+
</>
119+
)
120120
},
121121
},
122122
};
123123

124124
const Template = (args, { globals: { locale } }) => {
125125
const caption = getCaptionForLocale(locale) || 'english';
126-
console.log(caption);
127126
return (
128127
<Sidebar
129-
data={caption.sidebardata}
130-
headerText={caption.headerText}
131-
label={caption.label}
132-
size="large-4"
133-
active={"default"}
134-
{...args}
128+
data={caption.sidebardata}
129+
headerText={caption.headerText}
130+
label={caption.label}
131+
size="large-4"
132+
active={"default"}
133+
{...args}
135134
/>
136135
);
137136
};
138137

139138
export const SidebarStory = Template.bind({});
140139
SidebarStory.storyName = 'Sidebar';
141-

stories/Documentation/intro.mdx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,10 @@ export const data = [
210210
<hr />
211211
<p>
212212
<strong>
213-
UNDP Design System |{" "}
214-
<a
215-
href="https://github.com/undp/design-system/releases"
216-
target="_blank"
217-
>
218-
Version {pkg.version}
219-
</a>
213+
UNDP Design System | <a href="https://github.com/undp/design-system/releases" target="_blank">Version {pkg.version}</a>
220214
</strong>
221215
</p>
222216
</div>
223217
</div>
224218
</div>
225-
</div>
219+
</div>

stories/assets/js/navigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export const navigationInitialize = (locale) => {
210210
}, 800);
211211
setTimeout(() => {
212212
jQuery('.global-header').removeClass('show-content');
213-
if (document.getElementsByTagName('header')[0].classList.length) {
213+
if (document.getElementsByTagName('header').length && document.getElementsByTagName('header')[0].classList.length) {
214214
localStorage.setItem('current-nav', document.getElementsByTagName('header')[0].classList[0]);
215215
}
216216
}, 1000);

0 commit comments

Comments
 (0)