@govtechsg/sgds-web-component 3.13.1 → 3.13.2-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/sidebar-element.d.ts +112 -0
- package/base/sidebar-element.js +281 -0
- package/base/sidebar-element.js.map +1 -0
- package/components/Footer/footer.js +1 -1
- package/components/Footer/index.umd.min.js +1 -1
- package/components/Footer/index.umd.min.js.map +1 -1
- package/components/Pagination/index.umd.min.js +3 -1
- package/components/Pagination/index.umd.min.js.map +1 -1
- package/components/Pagination/pagination.js +1 -1
- package/components/Pagination/sgds-pagination.js +2 -0
- package/components/Pagination/sgds-pagination.js.map +1 -1
- package/components/Sidebar/index.d.ts +16 -0
- package/components/Sidebar/index.js +10 -0
- package/components/Sidebar/index.js.map +1 -0
- package/components/Sidebar/index.umd.min.js +2427 -0
- package/components/Sidebar/index.umd.min.js.map +1 -0
- package/components/Sidebar/sgds-sidebar-group.d.ts +51 -0
- package/components/Sidebar/sgds-sidebar-group.js +124 -0
- package/components/Sidebar/sgds-sidebar-group.js.map +1 -0
- package/components/Sidebar/sgds-sidebar-item.d.ts +25 -0
- package/components/Sidebar/sgds-sidebar-item.js +73 -0
- package/components/Sidebar/sgds-sidebar-item.js.map +1 -0
- package/components/Sidebar/sgds-sidebar-section.d.ts +55 -0
- package/components/Sidebar/sgds-sidebar-section.js +122 -0
- package/components/Sidebar/sgds-sidebar-section.js.map +1 -0
- package/components/Sidebar/sgds-sidebar.d.ts +88 -0
- package/components/Sidebar/sgds-sidebar.js +338 -0
- package/components/Sidebar/sgds-sidebar.js.map +1 -0
- package/components/Sidebar/sidebar-context.d.ts +51 -0
- package/components/Sidebar/sidebar-context.js +45 -0
- package/components/Sidebar/sidebar-context.js.map +1 -0
- package/components/Sidebar/sidebar-item.js +6 -0
- package/components/Sidebar/sidebar-item.js.map +1 -0
- package/components/Sidebar/sidebar-section.js +6 -0
- package/components/Sidebar/sidebar-section.js.map +1 -0
- package/components/Sidebar/sidebar.js +6 -0
- package/components/Sidebar/sidebar.js.map +1 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/index.js.map +1 -1
- package/components/index.umd.min.js +87 -50
- package/components/index.umd.min.js.map +1 -1
- package/css/fouc.css +5 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/index.umd.min.js +164 -51
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/base/sidebar-element.cjs.js +286 -0
- package/react/base/sidebar-element.cjs.js.map +1 -0
- package/react/base/sidebar-element.js +282 -0
- package/react/base/sidebar-element.js.map +1 -0
- package/react/components/Footer/footer.cjs.js +1 -1
- package/react/components/Footer/footer.js +1 -1
- package/react/components/Pagination/pagination.cjs.js +1 -1
- package/react/components/Pagination/pagination.js +1 -1
- package/react/components/Pagination/sgds-pagination.cjs.js +2 -0
- package/react/components/Pagination/sgds-pagination.cjs.js.map +1 -1
- package/react/components/Pagination/sgds-pagination.js +2 -0
- package/react/components/Pagination/sgds-pagination.js.map +1 -1
- package/react/components/Sidebar/sgds-sidebar-group.cjs.js +130 -0
- package/react/components/Sidebar/sgds-sidebar-group.cjs.js.map +1 -0
- package/react/components/Sidebar/sgds-sidebar-group.js +125 -0
- package/react/components/Sidebar/sgds-sidebar-group.js.map +1 -0
- package/react/components/Sidebar/sgds-sidebar-item.cjs.js +79 -0
- package/react/components/Sidebar/sgds-sidebar-item.cjs.js.map +1 -0
- package/react/components/Sidebar/sgds-sidebar-item.js +74 -0
- package/react/components/Sidebar/sgds-sidebar-item.js.map +1 -0
- package/react/components/Sidebar/sgds-sidebar-section.cjs.js +128 -0
- package/react/components/Sidebar/sgds-sidebar-section.cjs.js.map +1 -0
- package/react/components/Sidebar/sgds-sidebar-section.js +123 -0
- package/react/components/Sidebar/sgds-sidebar-section.js.map +1 -0
- package/react/components/Sidebar/sgds-sidebar.cjs.js +344 -0
- package/react/components/Sidebar/sgds-sidebar.cjs.js.map +1 -0
- package/react/components/Sidebar/sgds-sidebar.js +339 -0
- package/react/components/Sidebar/sgds-sidebar.js.map +1 -0
- package/react/components/Sidebar/sidebar-context.cjs.js +54 -0
- package/react/components/Sidebar/sidebar-context.cjs.js.map +1 -0
- package/react/components/Sidebar/sidebar-context.js +46 -0
- package/react/components/Sidebar/sidebar-context.js.map +1 -0
- package/react/components/Sidebar/sidebar-item.cjs.js +11 -0
- package/react/components/Sidebar/sidebar-item.cjs.js.map +1 -0
- package/react/components/Sidebar/sidebar-item.js +7 -0
- package/react/components/Sidebar/sidebar-item.js.map +1 -0
- package/react/components/Sidebar/sidebar-section.cjs.js +11 -0
- package/react/components/Sidebar/sidebar-section.cjs.js.map +1 -0
- package/react/components/Sidebar/sidebar-section.js +7 -0
- package/react/components/Sidebar/sidebar-section.js.map +1 -0
- package/react/components/Sidebar/sidebar.cjs.js +11 -0
- package/react/components/Sidebar/sidebar.cjs.js.map +1 -0
- package/react/components/Sidebar/sidebar.js +7 -0
- package/react/components/Sidebar/sidebar.js.map +1 -0
- package/react/index.cjs.js +64 -56
- package/react/index.cjs.js.map +1 -1
- package/react/index.d.ts +5 -1
- package/react/index.js +5 -1
- package/react/index.js.map +1 -1
- package/react/sidebar/index.cjs.js +40 -0
- package/react/sidebar/index.cjs.js.map +1 -0
- package/react/sidebar/index.d.ts +2 -0
- package/react/sidebar/index.js +16 -0
- package/react/sidebar/index.js.map +1 -0
- package/react/sidebar-group/index.cjs.js +40 -0
- package/react/sidebar-group/index.cjs.js.map +1 -0
- package/react/sidebar-group/index.d.ts +2 -0
- package/react/sidebar-group/index.js +16 -0
- package/react/sidebar-group/index.js.map +1 -0
- package/react/sidebar-item/index.cjs.js +40 -0
- package/react/sidebar-item/index.cjs.js.map +1 -0
- package/react/sidebar-item/index.d.ts +2 -0
- package/react/sidebar-item/index.js +16 -0
- package/react/sidebar-item/index.js.map +1 -0
- package/react/sidebar-section/index.cjs.js +40 -0
- package/react/sidebar-section/index.cjs.js.map +1 -0
- package/react/sidebar-section/index.d.ts +2 -0
- package/react/sidebar-section/index.js +16 -0
- package/react/sidebar-section/index.js.map +1 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var tslib = require('tslib');
|
|
7
|
+
var lit = require('lit');
|
|
8
|
+
var decorators_js = require('lit/decorators.js');
|
|
9
|
+
var classMap_js = require('lit/directives/class-map.js');
|
|
10
|
+
var sgdsElement = require('../../base/sgds-element.cjs.js');
|
|
11
|
+
var sidebarItem = require('./sidebar-item.cjs.js');
|
|
12
|
+
var sidebarElement = require('../../base/sidebar-element.cjs.js');
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @summary Sidebar item is a selectable navigation item within the sidebar component.
|
|
16
|
+
* It can be used as a terminal leaf node in the navigation hierarchy (does not support nested children).
|
|
17
|
+
* Items can optionally wrap anchor links for programmatic navigation to external URLs or routes.
|
|
18
|
+
*
|
|
19
|
+
* @slot default - Text content for the item label
|
|
20
|
+
* @slot trailingIcon - Icon to display after the label text
|
|
21
|
+
*
|
|
22
|
+
* See SgdsSidebar for parent component usage and selection events.
|
|
23
|
+
*/
|
|
24
|
+
class SgdsSidebarItem extends sidebarElement.SidebarElement {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
/**
|
|
28
|
+
* The name of the icon to display before the item label.
|
|
29
|
+
* Icon name corresponds to sgds-icon component icons.
|
|
30
|
+
* When empty, no icon is displayed and spacing is adjusted.
|
|
31
|
+
* @attribute icon
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @default ""
|
|
34
|
+
*/
|
|
35
|
+
this.icon = "";
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
return lit.html `
|
|
39
|
+
<div
|
|
40
|
+
class=${classMap_js.classMap({
|
|
41
|
+
"sidebar-item": true,
|
|
42
|
+
"sidebar-item--collapsed": this._sidebarCollapsed && this._childLevel === 0,
|
|
43
|
+
active: this._selected
|
|
44
|
+
})}
|
|
45
|
+
@click=${() => this._handleClick()}
|
|
46
|
+
aria-level=${this._childLevel}
|
|
47
|
+
aria-label=${this.title || this.name}
|
|
48
|
+
name=${this.name}
|
|
49
|
+
tabindex=${this._hidden ? -1 : 0}
|
|
50
|
+
role="button"
|
|
51
|
+
>
|
|
52
|
+
<div class="sidebar-item-label-wrapper">
|
|
53
|
+
<div>
|
|
54
|
+
${this._childLevel <= 1 ? lit.html `<slot name="leadingIcon"></slot>` : lit.nothing}
|
|
55
|
+
<span
|
|
56
|
+
class=${classMap_js.classMap({
|
|
57
|
+
"sidebar-item-label": true,
|
|
58
|
+
offset: this._childLevel > 1
|
|
59
|
+
})}
|
|
60
|
+
>${this.title}</span
|
|
61
|
+
>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<span class="sidebar-item-trailingIcon">
|
|
65
|
+
<slot name="trailingIcon"></slot>
|
|
66
|
+
</span>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
SgdsSidebarItem.styles = [...sgdsElement["default"].styles, sidebarItem["default"]];
|
|
73
|
+
tslib.__decorate([
|
|
74
|
+
decorators_js.property({ type: String, reflect: true })
|
|
75
|
+
], SgdsSidebarItem.prototype, "icon", void 0);
|
|
76
|
+
|
|
77
|
+
exports.SgdsSidebarItem = SgdsSidebarItem;
|
|
78
|
+
exports["default"] = SgdsSidebarItem;
|
|
79
|
+
//# sourceMappingURL=sgds-sidebar-item.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sgds-sidebar-item.cjs.js","sources":["../../../../src/components/Sidebar/sgds-sidebar-item.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport sidebarOptionStyle from \"./sidebar-item.css\";\n\nimport SgdsIcon from \"../Icon/sgds-icon\";\n\nimport { SidebarElement } from \"../../base/sidebar-element\";\n\n/**\n * @summary Sidebar item is a selectable navigation item within the sidebar component.\n * It can be used as a terminal leaf node in the navigation hierarchy (does not support nested children).\n * Items can optionally wrap anchor links for programmatic navigation to external URLs or routes.\n *\n * @slot default - Text content for the item label\n * @slot trailingIcon - Icon to display after the label text\n *\n * See SgdsSidebar for parent component usage and selection events.\n */\nexport class SgdsSidebarItem extends SidebarElement {\n static styles = [...SgdsElement.styles, sidebarOptionStyle];\n\n /**\n * The name of the icon to display before the item label.\n * Icon name corresponds to sgds-icon component icons.\n * When empty, no icon is displayed and spacing is adjusted.\n * @attribute icon\n * @type {string}\n * @default \"\"\n */\n @property({ type: String, reflect: true }) icon = \"\";\n\n render() {\n return html`\n <div\n class=${classMap({\n \"sidebar-item\": true,\n \"sidebar-item--collapsed\": this._sidebarCollapsed && this._childLevel === 0,\n active: this._selected\n })}\n @click=${() => this._handleClick()}\n aria-level=${this._childLevel}\n aria-label=${this.title || this.name}\n name=${this.name}\n tabindex=${this._hidden ? -1 : 0}\n role=\"button\"\n >\n <div class=\"sidebar-item-label-wrapper\">\n <div>\n ${this._childLevel <= 1 ? html`<slot name=\"leadingIcon\"></slot>` : nothing}\n <span\n class=${classMap({\n \"sidebar-item-label\": true,\n offset: this._childLevel > 1\n })}\n >${this.title}</span\n >\n </div>\n\n <span class=\"sidebar-item-trailingIcon\">\n <slot name=\"trailingIcon\"></slot>\n </span>\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsSidebarItem;\n"],"names":["SidebarElement","html","classMap","nothing","SgdsElement","sidebarOptionStyle","__decorate","property"],"mappings":";;;;;;;;;;;;;AAUA;;;;;;;;;AASG;AACG,MAAO,eAAgB,SAAQA,6BAAc,CAAA;AAAnD,IAAA,WAAA,GAAA;;AAGE;;;;;;;AAOG;QACwC,IAAI,CAAA,IAAA,GAAG,EAA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nothing } from 'lit';
|
|
4
|
+
import { property } from 'lit/decorators.js';
|
|
5
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
6
|
+
import SgdsElement from '../../base/sgds-element.js';
|
|
7
|
+
import css_248z from './sidebar-item.js';
|
|
8
|
+
import { SidebarElement } from '../../base/sidebar-element.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @summary Sidebar item is a selectable navigation item within the sidebar component.
|
|
12
|
+
* It can be used as a terminal leaf node in the navigation hierarchy (does not support nested children).
|
|
13
|
+
* Items can optionally wrap anchor links for programmatic navigation to external URLs or routes.
|
|
14
|
+
*
|
|
15
|
+
* @slot default - Text content for the item label
|
|
16
|
+
* @slot trailingIcon - Icon to display after the label text
|
|
17
|
+
*
|
|
18
|
+
* See SgdsSidebar for parent component usage and selection events.
|
|
19
|
+
*/
|
|
20
|
+
class SgdsSidebarItem extends SidebarElement {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
/**
|
|
24
|
+
* The name of the icon to display before the item label.
|
|
25
|
+
* Icon name corresponds to sgds-icon component icons.
|
|
26
|
+
* When empty, no icon is displayed and spacing is adjusted.
|
|
27
|
+
* @attribute icon
|
|
28
|
+
* @type {string}
|
|
29
|
+
* @default ""
|
|
30
|
+
*/
|
|
31
|
+
this.icon = "";
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return html `
|
|
35
|
+
<div
|
|
36
|
+
class=${classMap({
|
|
37
|
+
"sidebar-item": true,
|
|
38
|
+
"sidebar-item--collapsed": this._sidebarCollapsed && this._childLevel === 0,
|
|
39
|
+
active: this._selected
|
|
40
|
+
})}
|
|
41
|
+
@click=${() => this._handleClick()}
|
|
42
|
+
aria-level=${this._childLevel}
|
|
43
|
+
aria-label=${this.title || this.name}
|
|
44
|
+
name=${this.name}
|
|
45
|
+
tabindex=${this._hidden ? -1 : 0}
|
|
46
|
+
role="button"
|
|
47
|
+
>
|
|
48
|
+
<div class="sidebar-item-label-wrapper">
|
|
49
|
+
<div>
|
|
50
|
+
${this._childLevel <= 1 ? html `<slot name="leadingIcon"></slot>` : nothing}
|
|
51
|
+
<span
|
|
52
|
+
class=${classMap({
|
|
53
|
+
"sidebar-item-label": true,
|
|
54
|
+
offset: this._childLevel > 1
|
|
55
|
+
})}
|
|
56
|
+
>${this.title}</span
|
|
57
|
+
>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<span class="sidebar-item-trailingIcon">
|
|
61
|
+
<slot name="trailingIcon"></slot>
|
|
62
|
+
</span>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
`;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
SgdsSidebarItem.styles = [...SgdsElement.styles, css_248z];
|
|
69
|
+
__decorate([
|
|
70
|
+
property({ type: String, reflect: true })
|
|
71
|
+
], SgdsSidebarItem.prototype, "icon", void 0);
|
|
72
|
+
|
|
73
|
+
export { SgdsSidebarItem, SgdsSidebarItem as default };
|
|
74
|
+
//# sourceMappingURL=sgds-sidebar-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sgds-sidebar-item.js","sources":["../../../../src/components/Sidebar/sgds-sidebar-item.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport sidebarOptionStyle from \"./sidebar-item.css\";\n\nimport SgdsIcon from \"../Icon/sgds-icon\";\n\nimport { SidebarElement } from \"../../base/sidebar-element\";\n\n/**\n * @summary Sidebar item is a selectable navigation item within the sidebar component.\n * It can be used as a terminal leaf node in the navigation hierarchy (does not support nested children).\n * Items can optionally wrap anchor links for programmatic navigation to external URLs or routes.\n *\n * @slot default - Text content for the item label\n * @slot trailingIcon - Icon to display after the label text\n *\n * See SgdsSidebar for parent component usage and selection events.\n */\nexport class SgdsSidebarItem extends SidebarElement {\n static styles = [...SgdsElement.styles, sidebarOptionStyle];\n\n /**\n * The name of the icon to display before the item label.\n * Icon name corresponds to sgds-icon component icons.\n * When empty, no icon is displayed and spacing is adjusted.\n * @attribute icon\n * @type {string}\n * @default \"\"\n */\n @property({ type: String, reflect: true }) icon = \"\";\n\n render() {\n return html`\n <div\n class=${classMap({\n \"sidebar-item\": true,\n \"sidebar-item--collapsed\": this._sidebarCollapsed && this._childLevel === 0,\n active: this._selected\n })}\n @click=${() => this._handleClick()}\n aria-level=${this._childLevel}\n aria-label=${this.title || this.name}\n name=${this.name}\n tabindex=${this._hidden ? -1 : 0}\n role=\"button\"\n >\n <div class=\"sidebar-item-label-wrapper\">\n <div>\n ${this._childLevel <= 1 ? html`<slot name=\"leadingIcon\"></slot>` : nothing}\n <span\n class=${classMap({\n \"sidebar-item-label\": true,\n offset: this._childLevel > 1\n })}\n >${this.title}</span\n >\n </div>\n\n <span class=\"sidebar-item-trailingIcon\">\n <slot name=\"trailingIcon\"></slot>\n </span>\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsSidebarItem;\n"],"names":["sidebarOptionStyle"],"mappings":";;;;;;;;;AAUA;;;;;;;;;AASG;AACG,MAAO,eAAgB,SAAQ,cAAc,CAAA;AAAnD,IAAA,WAAA,GAAA;;AAGE;;;;;;;AAOG;QACwC,IAAI,CAAA,IAAA,GAAG,EAAE,CAAC;KAoCtD;IAlCC,MAAM,GAAA;AACJ,QAAA,OAAO,IAAI,CAAA,CAAA;;AAEC,cAAA,EAAA,QAAQ,CAAC;AACf,YAAA,cAAc,EAAE,IAAI;YACpB,yBAAyB,EAAE,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC;YAC3E,MAAM,EAAE,IAAI,CAAC,SAAS;SACvB,CAAC,CAAA;AACO,eAAA,EAAA,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;AACrB,mBAAA,EAAA,IAAI,CAAC,WAAW,CAAA;AAChB,mBAAA,EAAA,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAA;AAC7B,aAAA,EAAA,IAAI,CAAC,IAAI,CAAA;mBACL,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;;;;;AAK1B,YAAA,EAAA,IAAI,CAAC,WAAW,IAAI,CAAC,GAAG,IAAI,CAAA,CAAA,gCAAA,CAAkC,GAAG,OAAO,CAAA;;AAEhE,oBAAA,EAAA,QAAQ,CAAC;AACf,YAAA,oBAAoB,EAAE,IAAI;AAC1B,YAAA,MAAM,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC;SAC7B,CAAC,CAAA;AACC,eAAA,EAAA,IAAI,CAAC,KAAK,CAAA;;;;;;;;;KAStB,CAAC;KACH;;AA7CM,eAAM,CAAA,MAAA,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAEA,QAAkB,CAA7C,CAA+C;AAUjB,UAAA,CAAA;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAAW,CAAA,EAAA,eAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var tslib = require('tslib');
|
|
7
|
+
var lit = require('lit');
|
|
8
|
+
var decorators_js = require('lit/decorators.js');
|
|
9
|
+
var classMap_js = require('lit/directives/class-map.js');
|
|
10
|
+
var sgdsElement = require('../../base/sgds-element.cjs.js');
|
|
11
|
+
var sidebarSection = require('./sidebar-section.cjs.js');
|
|
12
|
+
var sidebarElement = require('../../base/sidebar-element.cjs.js');
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @summary Sidebar section is a container component that groups related sidebar items into organized sections.
|
|
16
|
+
* It displays a section header/title and can optionally be collapsible. Sections help organize navigation
|
|
17
|
+
* items hierarchically within the sidebar, providing visual separation between different areas of functionality.
|
|
18
|
+
*
|
|
19
|
+
* @slot - Insert sgds-sidebar-item and sgds-sidebar-group elements to be grouped within this section
|
|
20
|
+
*/
|
|
21
|
+
class SgdsSidebarSection extends sidebarElement.SidebarElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
/**
|
|
25
|
+
* The display title/label for the sidebar section header.
|
|
26
|
+
* Always visible in the sidebar, used to group related items.
|
|
27
|
+
* @attribute title
|
|
28
|
+
* @type {string}
|
|
29
|
+
* @default ""
|
|
30
|
+
*/
|
|
31
|
+
this.title = "";
|
|
32
|
+
/**
|
|
33
|
+
* Controls whether the section content is expanded or collapsed.
|
|
34
|
+
* When true, the section content is hidden but the section header remains visible.
|
|
35
|
+
* Only applicable when the section is collapsible.
|
|
36
|
+
* @attribute collapsed
|
|
37
|
+
* @type {boolean}
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
this.collapsed = false;
|
|
41
|
+
/**
|
|
42
|
+
* Enables a collapsible section header with expand/collapse toggle functionality.
|
|
43
|
+
* When true, users can click the header to toggle section visibility.
|
|
44
|
+
* When false, the section header is display-only and not interactive.
|
|
45
|
+
* @attribute collapsible
|
|
46
|
+
* @type {boolean}
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
this.collapsible = false;
|
|
50
|
+
/**
|
|
51
|
+
* Tracks whether this section is the last child of its parent.
|
|
52
|
+
* Used to remove bottom border from the last section.
|
|
53
|
+
* @type {boolean}
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
this._isLastChild = false;
|
|
57
|
+
}
|
|
58
|
+
connectedCallback() {
|
|
59
|
+
var _a;
|
|
60
|
+
super.connectedCallback();
|
|
61
|
+
this.setAttribute("role", "region");
|
|
62
|
+
this._isLastChild = ((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.lastElementChild) === this;
|
|
63
|
+
this._childLevel = null;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Handles click events on the section label.
|
|
67
|
+
* Toggles the collapsed state to show/hide section content.
|
|
68
|
+
* Only called if the section is collapsible (collapsible prop is true).
|
|
69
|
+
* @private
|
|
70
|
+
* @returns {void}
|
|
71
|
+
*/
|
|
72
|
+
_handleClick() {
|
|
73
|
+
if (this.collapsible)
|
|
74
|
+
this.collapsed = !this.collapsed;
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
return lit.html `
|
|
78
|
+
<div
|
|
79
|
+
class=${classMap_js.classMap({
|
|
80
|
+
"sidebar-section": true,
|
|
81
|
+
"no-border": this._isLastChild,
|
|
82
|
+
"sidebar-section--collapsed": this._sidebarCollapsed
|
|
83
|
+
})}
|
|
84
|
+
>
|
|
85
|
+
<div
|
|
86
|
+
class="sidebar-section-label"
|
|
87
|
+
@click=${this._handleClick}
|
|
88
|
+
aria-expanded=${!this.collapsed}
|
|
89
|
+
aria-disabled=${!this.collapsible}
|
|
90
|
+
tabindex="0"
|
|
91
|
+
>
|
|
92
|
+
<span>${this.title}</span>
|
|
93
|
+
${this.collapsible
|
|
94
|
+
? lit.html `<sgds-icon name=${this.collapsed ? "chevron-down" : "chevron-up"} size="sm"></sgds-icon>`
|
|
95
|
+
: lit.nothing}
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<div
|
|
99
|
+
class=${classMap_js.classMap({
|
|
100
|
+
"sidebar-section-content": true,
|
|
101
|
+
"sidebar-section-content--collapsed": this.collapsed && this.collapsible
|
|
102
|
+
})}
|
|
103
|
+
>
|
|
104
|
+
<div>
|
|
105
|
+
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
`;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
SgdsSidebarSection.styles = [...sgdsElement["default"].styles, sidebarSection["default"]];
|
|
113
|
+
tslib.__decorate([
|
|
114
|
+
decorators_js.property({ type: String, reflect: true })
|
|
115
|
+
], SgdsSidebarSection.prototype, "title", void 0);
|
|
116
|
+
tslib.__decorate([
|
|
117
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
118
|
+
], SgdsSidebarSection.prototype, "collapsed", void 0);
|
|
119
|
+
tslib.__decorate([
|
|
120
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
121
|
+
], SgdsSidebarSection.prototype, "collapsible", void 0);
|
|
122
|
+
tslib.__decorate([
|
|
123
|
+
decorators_js.state()
|
|
124
|
+
], SgdsSidebarSection.prototype, "_isLastChild", void 0);
|
|
125
|
+
|
|
126
|
+
exports.SgdsSidebarSection = SgdsSidebarSection;
|
|
127
|
+
exports["default"] = SgdsSidebarSection;
|
|
128
|
+
//# sourceMappingURL=sgds-sidebar-section.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sgds-sidebar-section.cjs.js","sources":["../../../../src/components/Sidebar/sgds-sidebar-section.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport sidebarSectionStyle from \"./sidebar-section.css\";\n\nimport { SidebarElement } from \"../../base/sidebar-element\";\n\n/**\n * @summary Sidebar section is a container component that groups related sidebar items into organized sections.\n * It displays a section header/title and can optionally be collapsible. Sections help organize navigation\n * items hierarchically within the sidebar, providing visual separation between different areas of functionality.\n *\n * @slot - Insert sgds-sidebar-item and sgds-sidebar-group elements to be grouped within this section\n */\nexport class SgdsSidebarSection extends SidebarElement {\n static styles = [...SgdsElement.styles, sidebarSectionStyle];\n\n /**\n * The display title/label for the sidebar section header.\n * Always visible in the sidebar, used to group related items.\n * @attribute title\n * @type {string}\n * @default \"\"\n */\n @property({ type: String, reflect: true }) title = \"\";\n\n /**\n * Controls whether the section content is expanded or collapsed.\n * When true, the section content is hidden but the section header remains visible.\n * Only applicable when the section is collapsible.\n * @attribute collapsed\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean, reflect: true }) collapsed = false;\n\n /**\n * Enables a collapsible section header with expand/collapse toggle functionality.\n * When true, users can click the header to toggle section visibility.\n * When false, the section header is display-only and not interactive.\n * @attribute collapsible\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean, reflect: true }) collapsible = false;\n\n /**\n * Tracks whether this section is the last child of its parent.\n * Used to remove bottom border from the last section.\n * @type {boolean}\n * @internal\n */\n @state() private _isLastChild = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute(\"role\", \"region\");\n this._isLastChild = this.parentElement?.lastElementChild === this;\n this._childLevel = null;\n }\n\n /**\n * Handles click events on the section label.\n * Toggles the collapsed state to show/hide section content.\n * Only called if the section is collapsible (collapsible prop is true).\n * @private\n * @returns {void}\n */\n override _handleClick() {\n if (this.collapsible) this.collapsed = !this.collapsed;\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n \"sidebar-section\": true,\n \"no-border\": this._isLastChild,\n \"sidebar-section--collapsed\": this._sidebarCollapsed\n })}\n >\n <div\n class=\"sidebar-section-label\"\n @click=${this._handleClick}\n aria-expanded=${!this.collapsed}\n aria-disabled=${!this.collapsible}\n tabindex=\"0\"\n >\n <span>${this.title}</span>\n ${this.collapsible\n ? html`<sgds-icon name=${this.collapsed ? \"chevron-down\" : \"chevron-up\"} size=\"sm\"></sgds-icon>`\n : nothing}\n </div>\n\n <div\n class=${classMap({\n \"sidebar-section-content\": true,\n \"sidebar-section-content--collapsed\": this.collapsed && this.collapsible\n })}\n >\n <div>\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsSidebarSection;\n"],"names":["SidebarElement","html","classMap","nothing","SgdsElement","sidebarSectionStyle","__decorate","property","state"],"mappings":";;;;;;;;;;;;;AAQA;;;;;;AAMG;AACG,MAAO,kBAAmB,SAAQA,6BAAc,CAAA;AAAtD,IAAA,WAAA,GAAA;;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+
import { classMap } from 'lit/directives/class-map.js';
|
|
6
|
+
import SgdsElement from '../../base/sgds-element.js';
|
|
7
|
+
import css_248z from './sidebar-section.js';
|
|
8
|
+
import { SidebarElement } from '../../base/sidebar-element.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @summary Sidebar section is a container component that groups related sidebar items into organized sections.
|
|
12
|
+
* It displays a section header/title and can optionally be collapsible. Sections help organize navigation
|
|
13
|
+
* items hierarchically within the sidebar, providing visual separation between different areas of functionality.
|
|
14
|
+
*
|
|
15
|
+
* @slot - Insert sgds-sidebar-item and sgds-sidebar-group elements to be grouped within this section
|
|
16
|
+
*/
|
|
17
|
+
class SgdsSidebarSection extends SidebarElement {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
/**
|
|
21
|
+
* The display title/label for the sidebar section header.
|
|
22
|
+
* Always visible in the sidebar, used to group related items.
|
|
23
|
+
* @attribute title
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @default ""
|
|
26
|
+
*/
|
|
27
|
+
this.title = "";
|
|
28
|
+
/**
|
|
29
|
+
* Controls whether the section content is expanded or collapsed.
|
|
30
|
+
* When true, the section content is hidden but the section header remains visible.
|
|
31
|
+
* Only applicable when the section is collapsible.
|
|
32
|
+
* @attribute collapsed
|
|
33
|
+
* @type {boolean}
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
this.collapsed = false;
|
|
37
|
+
/**
|
|
38
|
+
* Enables a collapsible section header with expand/collapse toggle functionality.
|
|
39
|
+
* When true, users can click the header to toggle section visibility.
|
|
40
|
+
* When false, the section header is display-only and not interactive.
|
|
41
|
+
* @attribute collapsible
|
|
42
|
+
* @type {boolean}
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
this.collapsible = false;
|
|
46
|
+
/**
|
|
47
|
+
* Tracks whether this section is the last child of its parent.
|
|
48
|
+
* Used to remove bottom border from the last section.
|
|
49
|
+
* @type {boolean}
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
this._isLastChild = false;
|
|
53
|
+
}
|
|
54
|
+
connectedCallback() {
|
|
55
|
+
var _a;
|
|
56
|
+
super.connectedCallback();
|
|
57
|
+
this.setAttribute("role", "region");
|
|
58
|
+
this._isLastChild = ((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.lastElementChild) === this;
|
|
59
|
+
this._childLevel = null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Handles click events on the section label.
|
|
63
|
+
* Toggles the collapsed state to show/hide section content.
|
|
64
|
+
* Only called if the section is collapsible (collapsible prop is true).
|
|
65
|
+
* @private
|
|
66
|
+
* @returns {void}
|
|
67
|
+
*/
|
|
68
|
+
_handleClick() {
|
|
69
|
+
if (this.collapsible)
|
|
70
|
+
this.collapsed = !this.collapsed;
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
return html `
|
|
74
|
+
<div
|
|
75
|
+
class=${classMap({
|
|
76
|
+
"sidebar-section": true,
|
|
77
|
+
"no-border": this._isLastChild,
|
|
78
|
+
"sidebar-section--collapsed": this._sidebarCollapsed
|
|
79
|
+
})}
|
|
80
|
+
>
|
|
81
|
+
<div
|
|
82
|
+
class="sidebar-section-label"
|
|
83
|
+
@click=${this._handleClick}
|
|
84
|
+
aria-expanded=${!this.collapsed}
|
|
85
|
+
aria-disabled=${!this.collapsible}
|
|
86
|
+
tabindex="0"
|
|
87
|
+
>
|
|
88
|
+
<span>${this.title}</span>
|
|
89
|
+
${this.collapsible
|
|
90
|
+
? html `<sgds-icon name=${this.collapsed ? "chevron-down" : "chevron-up"} size="sm"></sgds-icon>`
|
|
91
|
+
: nothing}
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div
|
|
95
|
+
class=${classMap({
|
|
96
|
+
"sidebar-section-content": true,
|
|
97
|
+
"sidebar-section-content--collapsed": this.collapsed && this.collapsible
|
|
98
|
+
})}
|
|
99
|
+
>
|
|
100
|
+
<div>
|
|
101
|
+
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
`;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
SgdsSidebarSection.styles = [...SgdsElement.styles, css_248z];
|
|
109
|
+
__decorate([
|
|
110
|
+
property({ type: String, reflect: true })
|
|
111
|
+
], SgdsSidebarSection.prototype, "title", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
property({ type: Boolean, reflect: true })
|
|
114
|
+
], SgdsSidebarSection.prototype, "collapsed", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
property({ type: Boolean, reflect: true })
|
|
117
|
+
], SgdsSidebarSection.prototype, "collapsible", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
state()
|
|
120
|
+
], SgdsSidebarSection.prototype, "_isLastChild", void 0);
|
|
121
|
+
|
|
122
|
+
export { SgdsSidebarSection, SgdsSidebarSection as default };
|
|
123
|
+
//# sourceMappingURL=sgds-sidebar-section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sgds-sidebar-section.js","sources":["../../../../src/components/Sidebar/sgds-sidebar-section.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport sidebarSectionStyle from \"./sidebar-section.css\";\n\nimport { SidebarElement } from \"../../base/sidebar-element\";\n\n/**\n * @summary Sidebar section is a container component that groups related sidebar items into organized sections.\n * It displays a section header/title and can optionally be collapsible. Sections help organize navigation\n * items hierarchically within the sidebar, providing visual separation between different areas of functionality.\n *\n * @slot - Insert sgds-sidebar-item and sgds-sidebar-group elements to be grouped within this section\n */\nexport class SgdsSidebarSection extends SidebarElement {\n static styles = [...SgdsElement.styles, sidebarSectionStyle];\n\n /**\n * The display title/label for the sidebar section header.\n * Always visible in the sidebar, used to group related items.\n * @attribute title\n * @type {string}\n * @default \"\"\n */\n @property({ type: String, reflect: true }) title = \"\";\n\n /**\n * Controls whether the section content is expanded or collapsed.\n * When true, the section content is hidden but the section header remains visible.\n * Only applicable when the section is collapsible.\n * @attribute collapsed\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean, reflect: true }) collapsed = false;\n\n /**\n * Enables a collapsible section header with expand/collapse toggle functionality.\n * When true, users can click the header to toggle section visibility.\n * When false, the section header is display-only and not interactive.\n * @attribute collapsible\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean, reflect: true }) collapsible = false;\n\n /**\n * Tracks whether this section is the last child of its parent.\n * Used to remove bottom border from the last section.\n * @type {boolean}\n * @internal\n */\n @state() private _isLastChild = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute(\"role\", \"region\");\n this._isLastChild = this.parentElement?.lastElementChild === this;\n this._childLevel = null;\n }\n\n /**\n * Handles click events on the section label.\n * Toggles the collapsed state to show/hide section content.\n * Only called if the section is collapsible (collapsible prop is true).\n * @private\n * @returns {void}\n */\n override _handleClick() {\n if (this.collapsible) this.collapsed = !this.collapsed;\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n \"sidebar-section\": true,\n \"no-border\": this._isLastChild,\n \"sidebar-section--collapsed\": this._sidebarCollapsed\n })}\n >\n <div\n class=\"sidebar-section-label\"\n @click=${this._handleClick}\n aria-expanded=${!this.collapsed}\n aria-disabled=${!this.collapsible}\n tabindex=\"0\"\n >\n <span>${this.title}</span>\n ${this.collapsible\n ? html`<sgds-icon name=${this.collapsed ? \"chevron-down\" : \"chevron-up\"} size=\"sm\"></sgds-icon>`\n : nothing}\n </div>\n\n <div\n class=${classMap({\n \"sidebar-section-content\": true,\n \"sidebar-section-content--collapsed\": this.collapsed && this.collapsible\n })}\n >\n <div>\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsSidebarSection;\n"],"names":["sidebarSectionStyle"],"mappings":";;;;;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