Skip to content

Commit 839dcc7

Browse files
authored
Merge pull request #155 from bindable-ui/feature/nav-item-prefix
adding property and styles for nav item prefix-icon with updated documentation
2 parents a27ccc4 + 0589a12 commit 839dcc7

File tree

8 files changed

+43
-11
lines changed

8 files changed

+43
-11
lines changed

dev-app/app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<c-nav-horizontal-item
5353
position="right"
5454
href="https://github.com/bindable-ui/bindable"
55-
title="v1.11.10"
55+
title="v1.11.11"
5656
></c-nav-horizontal-item>
5757
</c-nav-horizontal>
5858
</l-box>

dev-app/routes/components/navs/vertical/vertical-nav-item/properties/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
title="Accordion Sub 2"
3939
href="http://google.com"
4040
sub-text="Sub Text Here"
41+
prefix-icon="share"
4142
></c-nav-vertical-item>
4243
<c-nav-vertical-item
4344
title="Accordion Sub 3"
@@ -91,10 +92,11 @@
9192

9293
<div>
9394
<l-stack spacing="var(--s-3)">
94-
<c-h3>icon</c-h3>
95+
<c-h3>icons & prefix-icon</c-h3>
96+
<c-notification type="info">NOTE: The `icon` property requires an accompanying `icon-action` property to render on hover. The `prefix-icon` property will always render and has no accompanying action property.</c-notification>
9597
<c-code-sample>
9698
<c-nav-vertical c-nav-vertical style="height: 200px; display: block;">
97-
<c-nav-vertical-item state="active" title="Nav Link 1" href="http://google.com" icon="cog"></c-nav-vertical-item>
99+
<c-nav-vertical-item state="active" title="Nav Link 1" href="http://google.com" prefix-icon="share"></c-nav-vertical-item>
98100
<c-nav-vertical-item title="Nav Link 2" href="http://google.com" icon="cog" icon-action.call="fireIconFunction()"></c-nav-vertical-item>
99101
</c-nav-vertical>
100102
</c-code-sample>

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "@bindable-ui/bindable",
33
"description": "An Aurelia component library",
4-
"version": "1.11.10",
4+
"version": "1.11.11",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/bindable-ui/bindable"
88
},
99
"license": "MIT",
1010
"devDependencies": {
11-
"@bindable-ui/bindable-icons": "^0.3.0",
11+
"@bindable-ui/bindable-icons": "^0.3.2",
1212
"@types/jest": "^24.9.1",
1313
"@types/jquery": "^3.5.14",
1414
"@types/lodash": "^4.14.181",

src/components/navs/c-nav-vertical-item/c-nav-vertical-item.css

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,19 @@ Licensed under the terms of the MIT license. See the LICENSE file in the project
187187
.nav-vertical-item c-nav-vertical ul li a{
188188
padding-top: 0;
189189
padding-bottom: 0;
190-
padding-left: 50px;
190+
padding-left: 36px;
191191
font-size: inherit;
192192
word-break: break-word;
193193
}
194194

195+
.nav-vertical-item c-nav-vertical ul li a l-icon.prefix-icon {
196+
position: absolute;
197+
top: 8px;
198+
left: 14px;
199+
padding: 0 0 5px 5px;
200+
display: inline-flex;
201+
}
202+
195203
/* If the nav item has sub-text */
196204
.nav-vertical-item c-nav-vertical ul li a span{
197205
font-size: inherit;
@@ -294,6 +302,18 @@ Licensed under the terms of the MIT license. See the LICENSE file in the project
294302

295303

296304

305+
/*------------------------------------*\
306+
!PREFIX ICON
307+
\*------------------------------------*/
308+
309+
.prefix-icon {
310+
position: absolute;
311+
top: 8px;
312+
left: 2px;
313+
padding: 0 0 5px 5px;
314+
display: inline-flex;
315+
/* margin-left: -16px;*/
316+
}
297317

298318

299319
/*------------------------------------*\

src/components/navs/c-nav-vertical-item/c-nav-vertical-item.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@
3737
if.bind="!accordionItem && title"
3838
click.delegate="clickTrigger()"
3939
>
40+
<l-icon
41+
if.bind="prefixIcon"
42+
icon="${prefixIcon}"
43+
size="0.875em"
44+
align="-0.125em"
45+
spacing="0"
46+
class="${styles.prefixIcon}"
47+
></l-icon>
4048
${title}
4149
<span
4250
class="${styles.sub}"

src/components/navs/c-nav-vertical-item/c-nav-vertical-item.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export class CNavVerticalItem {
2323
@bindable
2424
public href;
2525
@bindable
26+
public prefixIcon;
27+
@bindable
2628
public icon;
2729
@bindable
2830
public iconAction;

src/global-styles/themes/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ c-nav-vertical{
673673
--nav-item-background-hover: var(--c_ash);
674674
--nav-item-color-active: var(--c_white);
675675
--nav-item-background-active: var(--c_black);
676-
--nav-item-active-bar-size: var(--s-5);
676+
--nav-item-active-bar-size: 4px;
677677
--nav-item-active-bar-color-active: var(--c_primaryMain);
678678
--nav-item-active-bar-color-hover: var(--nav-background);
679679
--nav-item-active-bar-color: var(--nav-background-color);

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,10 @@
387387
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
388388
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
389389

390-
"@bindable-ui/bindable-icons@^0.3.0":
391-
version "0.3.0"
392-
resolved "https://registry.yarnpkg.com/@bindable-ui/bindable-icons/-/bindable-icons-0.3.0.tgz#c72a07a3cb1d57f05c3ab998a1d970e76adf65ea"
393-
integrity sha512-yT0xqISa87Z95UJ96fnwXgp7v6uHUKFv9FcqZSDuvTb75qlKC7sBNhEl1PGn3sa5GAC2QmExjZEpDyuFyGTubA==
390+
"@bindable-ui/bindable-icons@^0.3.2":
391+
version "0.3.2"
392+
resolved "https://registry.yarnpkg.com/@bindable-ui/bindable-icons/-/bindable-icons-0.3.2.tgz#9d5262b0037a84fb2ad6cfad2960a58d7207df0f"
393+
integrity sha512-XfC3eZTB2Kgl01qemxxnk79MF5eouBgJAClw9MfGAII816yqMO59SnXOCLuXFoXIH2v/b4nbk3fFkU5FWBxUjg==
394394

395395
"@cnakazawa/watch@^1.0.3":
396396
version "1.0.4"

0 commit comments

Comments
 (0)