@redvars/peacock 3.10.1 → 3.12.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/dist/BaseInput-CV0pZgSb.js +58 -0
- package/dist/BaseInput-CV0pZgSb.js.map +1 -0
- package/dist/app-bar.js +16 -16
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/assets/theme.d.ts +66 -0
- package/dist/assets/theme.js +134 -0
- package/dist/assets/tokens.css +1 -1
- package/dist/assets/tokens.css.map +1 -1
- package/dist/base-progress-CLZTRveO.js +33 -0
- package/dist/base-progress-CLZTRveO.js.map +1 -0
- package/dist/bottom-sheet.js +1 -1
- package/dist/button-group.js +9 -7
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +225 -187
- package/dist/button.js.map +1 -1
- package/dist/cb-divider.js +7 -6
- package/dist/cb-divider.js.map +1 -1
- package/dist/cb-group-base-D9gv7SDY.js +114 -0
- package/dist/cb-group-base-D9gv7SDY.js.map +1 -0
- package/dist/cb-group-base-DsX_2aFl.js +325 -0
- package/dist/cb-group-base-DsX_2aFl.js.map +1 -0
- package/dist/cb-group.js +96 -0
- package/dist/cb-group.js.map +1 -0
- package/dist/cb-rule.js +212 -0
- package/dist/cb-rule.js.map +1 -0
- package/dist/{chart-bar-CapLbc2e.js → chart-bar-D5dGFJfK.js} +2 -2
- package/dist/{chart-bar-CapLbc2e.js.map → chart-bar-D5dGFJfK.js.map} +1 -1
- package/dist/chart-bar.js +1 -1
- package/dist/chart-stacked-bar.js +1 -1
- package/dist/checkbox.js +78 -53
- package/dist/checkbox.js.map +1 -1
- package/dist/chip-set.js +52 -0
- package/dist/chip-set.js.map +1 -0
- package/dist/chip.js +8 -6
- package/dist/chip.js.map +1 -1
- package/dist/circular-progress.js +177 -0
- package/dist/circular-progress.js.map +1 -0
- package/dist/code-editor.js +129 -72
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +2 -38
- package/dist/code-highlighter.js.map +1 -1
- package/dist/color-field.js +309 -0
- package/dist/color-field.js.map +1 -0
- package/dist/color-picker.js +26 -15
- package/dist/color-picker.js.map +1 -1
- package/dist/condition-builder.js +90 -35
- package/dist/condition-builder.js.map +1 -1
- package/dist/copy-to-clipboard-upGx-Ueo.js +39 -0
- package/dist/copy-to-clipboard-upGx-Ueo.js.map +1 -0
- package/dist/custom-elements-jsdocs.json +1140 -398
- package/dist/custom-elements.json +9065 -3989
- package/dist/date-picker.js +241 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/{element-internals-2CMts_0M.js → delegate-py-Ets8N.js} +2 -43
- package/dist/delegate-py-Ets8N.js.map +1 -0
- package/dist/element-internals-QME0yEz4.js +43 -0
- package/dist/element-internals-QME0yEz4.js.map +1 -0
- package/dist/fab.js +51 -49
- package/dist/fab.js.map +1 -1
- package/dist/field.js +27 -0
- package/dist/field.js.map +1 -1
- package/dist/flow.js +5 -5
- package/dist/form-associated-Bhwwr6dT.js +162 -0
- package/dist/form-associated-Bhwwr6dT.js.map +1 -0
- package/dist/{form-associated-BXADnjOB.js → form-submitter-DPI4L6gj.js} +3 -159
- package/dist/form-submitter-DPI4L6gj.js.map +1 -0
- package/dist/html-editor.js +3 -1
- package/dist/html-editor.js.map +1 -1
- package/dist/icon-button.js +195 -156
- package/dist/icon-button.js.map +1 -1
- package/dist/image.js +2 -2
- package/dist/index.js +36 -11
- package/dist/index.js.map +1 -1
- package/dist/input.js +259 -0
- package/dist/input.js.map +1 -0
- package/dist/item.js +2 -1
- package/dist/item.js.map +1 -1
- package/dist/linear-progress.js +192 -0
- package/dist/linear-progress.js.map +1 -0
- package/dist/{list-AdO-PUq_.js → list-item.js} +12 -222
- package/dist/list-item.js.map +1 -0
- package/dist/list.js +225 -6
- package/dist/list.js.map +1 -1
- package/dist/loader-full.js +31 -8
- package/dist/loader-full.js.map +1 -1
- package/dist/loader.js +58 -25
- package/dist/loader.js.map +1 -1
- package/dist/markdown-editor.js +5 -3
- package/dist/markdown-editor.js.map +1 -1
- package/dist/menu-item.js +30 -30
- package/dist/navigation-bar-item.js +41 -0
- package/dist/navigation-bar-item.js.map +1 -0
- package/dist/navigation-bar.js +128 -0
- package/dist/navigation-bar.js.map +1 -0
- package/dist/navigation-drawer-item.js +236 -0
- package/dist/navigation-drawer-item.js.map +1 -0
- package/dist/navigation-drawer.js +293 -0
- package/dist/navigation-drawer.js.map +1 -0
- package/dist/navigation-rail.js +1 -1
- package/dist/number-field.js +280 -0
- package/dist/number-field.js.map +1 -0
- package/dist/pagination.js +1 -1
- package/dist/radio-group.js +209 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/radio.js +47 -37
- package/dist/radio.js.map +1 -1
- package/dist/segmented-button-group.js +12 -0
- package/dist/segmented-button-group.js.map +1 -1
- package/dist/segmented-button.js +10 -6
- package/dist/segmented-button.js.map +1 -1
- package/dist/select.js +653 -0
- package/dist/select.js.map +1 -0
- package/dist/side-sheet.js +1 -1
- package/dist/sidebar-menu-item.js +273 -0
- package/dist/sidebar-menu-item.js.map +1 -0
- package/dist/sidebar-menu.js +193 -0
- package/dist/sidebar-menu.js.map +1 -0
- package/dist/sidebar-sub-menu.js +301 -0
- package/dist/sidebar-sub-menu.js.map +1 -0
- package/dist/slider.js +76 -24
- package/dist/slider.js.map +1 -1
- package/dist/snackbar.js +3 -3
- package/dist/snackbar.js.map +1 -1
- package/dist/split-button.js +2 -2
- package/dist/src/__internal/utils/size.d.ts +9 -0
- package/dist/src/button/ButtonTypes.d.ts +1 -1
- package/dist/src/checkbox/checkbox.d.ts +28 -22
- package/dist/src/chip/chip/chip.d.ts +3 -0
- package/dist/src/chip/tag/tag.d.ts +5 -1
- package/dist/src/code-editor/code-editor.d.ts +37 -10
- package/dist/src/color-field/color-field.d.ts +55 -0
- package/dist/src/color-field/index.d.ts +1 -0
- package/dist/src/color-picker/color-picker.d.ts +1 -1
- package/dist/src/condition-builder/cb-divider.d.ts +3 -1
- package/dist/src/condition-builder/cb-drag.d.ts +10 -0
- package/dist/src/condition-builder/cb-group-base.d.ts +59 -0
- package/dist/src/condition-builder/cb-group.d.ts +34 -0
- package/dist/src/condition-builder/cb-rule.d.ts +32 -0
- package/dist/src/condition-builder/cb-types.d.ts +13 -0
- package/dist/src/condition-builder/condition-builder.d.ts +35 -14
- package/dist/src/condition-builder/index.d.ts +3 -3
- package/dist/src/date-picker/date-picker.d.ts +0 -1
- package/dist/src/index.d.ts +6 -4
- package/dist/src/input/BaseInput.d.ts +21 -3
- package/dist/src/input/input.d.ts +15 -7
- package/dist/src/navigation-bar/index.d.ts +2 -0
- package/dist/src/navigation-bar/navigation-bar-item.d.ts +23 -0
- package/dist/src/navigation-bar/navigation-bar.d.ts +44 -0
- package/dist/src/navigation-drawer/index.d.ts +2 -0
- package/dist/src/navigation-drawer/navigation-drawer-item.d.ts +48 -0
- package/dist/src/navigation-drawer/navigation-drawer.d.ts +70 -0
- package/dist/src/number-field/number-field.d.ts +0 -1
- package/dist/src/radio/index.d.ts +1 -0
- package/dist/src/radio/radio-group.d.ts +50 -0
- package/dist/src/radio/radio.d.ts +18 -18
- package/dist/src/segmented-button/segmented-button-group.d.ts +5 -0
- package/dist/src/segmented-button/segmented-button.d.ts +2 -1
- package/dist/src/select/select.d.ts +6 -0
- package/dist/src/slider/slider.d.ts +14 -5
- package/dist/src/switch/switch.d.ts +22 -26
- package/dist/src/tabs/tabs.d.ts +3 -0
- package/dist/src/textarea/textarea.d.ts +0 -1
- package/dist/src/time-picker/time-picker.d.ts +0 -1
- package/dist/src/toolbar/toolbar.d.ts +7 -4
- package/dist/src/url-field/url-field.d.ts +0 -1
- package/dist/svg.js +5 -5
- package/dist/switch.js +413 -0
- package/dist/switch.js.map +1 -0
- package/dist/tab.js +2 -1
- package/dist/tab.js.map +1 -1
- package/dist/tabs.js +10 -8
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +349 -0
- package/dist/tag.js.map +1 -0
- package/dist/test/code-editor.test.d.ts +1 -0
- package/dist/test/color-field.test.d.ts +1 -0
- package/dist/test/color-picker.test.d.ts +1 -0
- package/dist/test/condition-builder.test.d.ts +1 -0
- package/dist/test/field.test.d.ts +1 -0
- package/dist/test/form-controls.test.d.ts +1 -0
- package/dist/test/icon.test.d.ts +1 -1
- package/dist/test/input.test.d.ts +1 -0
- package/dist/test/navigation.test.d.ts +1 -0
- package/dist/test/segmented-button.test.d.ts +1 -0
- package/dist/test/slider.test.d.ts +1 -0
- package/dist/textarea.js +237 -0
- package/dist/textarea.js.map +1 -0
- package/dist/time-picker.js +241 -0
- package/dist/time-picker.js.map +1 -0
- package/dist/toolbar.js +26 -9
- package/dist/toolbar.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/url-field.js +298 -0
- package/dist/url-field.js.map +1 -0
- package/package.json +29 -8
- package/readme.md +2 -2
- package/scss/tokens.css +175 -18
- package/src/__internal/utils/size.ts +23 -0
- package/src/app-bar/app-bar.scss +4 -16
- package/src/bottom-sheet/bottom-sheet.scss +1 -1
- package/src/button/ButtonTypes.ts +2 -0
- package/src/button/button/button-base.scss +84 -84
- package/src/button/button/button-colors.scss +14 -2
- package/src/button/button/button-layers.scss +71 -71
- package/src/button/button/button-shapes.scss +2 -2
- package/src/button/button/button-sizes.scss +35 -35
- package/src/button/button/button.scss +1 -1
- package/src/button/button/button.ts +1 -2
- package/src/button/button-group/button-group.scss +5 -5
- package/src/button/fab/fab-sizes.scss +15 -15
- package/src/button/fab/fab.scss +32 -32
- package/src/button/icon-button/icon-button-sizes.scss +7 -7
- package/src/chart-bar/chart-bar.scss +1 -1
- package/src/checkbox/checkbox.scss +7 -6
- package/src/checkbox/checkbox.ts +92 -40
- package/src/chip/chip/chip.ts +8 -5
- package/src/chip/chip-set/chip-set.ts +2 -0
- package/src/chip/tag/tag-colors.scss +1 -1
- package/src/chip/tag/tag-sizes.scss +9 -0
- package/src/chip/tag/tag.scss +1 -1
- package/src/chip/tag/tag.ts +20 -9
- package/src/code-editor/code-editor.scss +8 -3
- package/src/code-editor/code-editor.ts +148 -79
- package/src/code-highlighter/code-highlighter.scss +1 -1
- package/src/color-field/color-field.scss +48 -0
- package/src/color-field/color-field.ts +239 -0
- package/src/color-field/index.ts +1 -0
- package/src/color-picker/color-picker.scss +33 -15
- package/src/color-picker/color-picker.ts +2 -1
- package/src/condition-builder/cb-divider.scss +4 -5
- package/src/condition-builder/cb-divider.ts +3 -1
- package/src/condition-builder/cb-drag.ts +35 -0
- package/src/condition-builder/cb-group-base.scss +97 -0
- package/src/condition-builder/cb-group-base.ts +335 -0
- package/src/condition-builder/cb-group.scss +21 -0
- package/src/condition-builder/cb-group.ts +72 -0
- package/src/condition-builder/cb-rule.scss +90 -0
- package/src/condition-builder/cb-rule.ts +129 -0
- package/src/condition-builder/cb-types.ts +16 -0
- package/src/condition-builder/condition-builder.scss +12 -9
- package/src/condition-builder/condition-builder.ts +77 -17
- package/src/condition-builder/index.ts +7 -3
- package/src/date-picker/date-picker.ts +2 -3
- package/src/field/field.scss +34 -0
- package/src/flow/flow.scss +5 -5
- package/src/image/image.scss +2 -2
- package/src/index.ts +14 -6
- package/src/input/BaseInput.ts +54 -4
- package/src/input/input.ts +104 -79
- package/src/list/list-item.ts +2 -0
- package/src/loader.ts +34 -19
- package/src/markdown-editor/markdown-editor.scss +2 -2
- package/src/menu/menu-item/menu-item.scss +30 -30
- package/src/navigation-bar/index.ts +2 -0
- package/src/navigation-bar/navigation-bar-item.ts +25 -0
- package/src/navigation-bar/navigation-bar.scss +27 -0
- package/src/navigation-bar/navigation-bar.ts +96 -0
- package/src/navigation-drawer/index.ts +2 -0
- package/src/navigation-drawer/navigation-drawer-item.scss +82 -0
- package/src/navigation-drawer/navigation-drawer-item.ts +133 -0
- package/src/navigation-drawer/navigation-drawer.scss +99 -0
- package/src/navigation-drawer/navigation-drawer.ts +196 -0
- package/src/navigation-rail/navigation-rail.scss +1 -1
- package/src/number-field/number-field.ts +2 -3
- package/src/pagination/pagination.scss +1 -1
- package/src/progress/circular-progress/circular-progress.ts +2 -0
- package/src/progress/linear-progress/linear-progress.ts +2 -0
- package/src/radio/index.ts +1 -0
- package/src/radio/radio-group.scss +39 -0
- package/src/radio/radio-group.ts +167 -0
- package/src/radio/radio.ts +74 -31
- package/src/segmented-button/segmented-button-group.ts +12 -0
- package/src/segmented-button/segmented-button.ts +12 -6
- package/src/select/select.ts +21 -1
- package/src/side-sheet/side-sheet.scss +1 -1
- package/src/sidebar-menu/sidebar-menu-item.scss +1 -1
- package/src/sidebar-menu/sidebar-menu-item.ts +2 -0
- package/src/sidebar-menu/sidebar-menu.ts +2 -0
- package/src/sidebar-menu/sidebar-sub-menu.scss +1 -1
- package/src/sidebar-menu/sidebar-sub-menu.ts +2 -0
- package/src/slider/slider.scss +3 -3
- package/src/slider/slider.ts +119 -31
- package/src/snackbar/snackbar.ts +3 -3
- package/src/split-button/split-button-colors.scss +2 -2
- package/src/svg/svg.scss +5 -5
- package/src/switch/switch.scss +0 -1
- package/src/switch/switch.ts +82 -47
- package/src/tabs/tab.scss +2 -1
- package/src/tabs/tabs.ts +14 -8
- package/src/textarea/textarea.ts +2 -3
- package/src/time-picker/time-picker.ts +2 -3
- package/src/toolbar/toolbar.scss +4 -4
- package/src/toolbar/toolbar.ts +12 -5
- package/src/url-field/url-field.ts +2 -3
- package/dist/BaseInput-CU1zZYKc.js +0 -27
- package/dist/BaseInput-CU1zZYKc.js.map +0 -1
- package/dist/brand-loader.js +0 -358
- package/dist/brand-loader.js.map +0 -1
- package/dist/cb-compound-expression.js +0 -133
- package/dist/cb-compound-expression.js.map +0 -1
- package/dist/cb-expression.js +0 -78
- package/dist/cb-expression.js.map +0 -1
- package/dist/cb-predicate.js +0 -141
- package/dist/cb-predicate.js.map +0 -1
- package/dist/element-internals-2CMts_0M.js.map +0 -1
- package/dist/form-associated-BXADnjOB.js.map +0 -1
- package/dist/list-AdO-PUq_.js.map +0 -1
- package/dist/select-DkyRqUTI.js +0 -3955
- package/dist/select-DkyRqUTI.js.map +0 -1
- package/dist/src/brand-loader/brand-loader.d.ts +0 -33
- package/dist/src/brand-loader/index.d.ts +0 -2
- package/dist/src/condition-builder/cb-compound-expression.d.ts +0 -30
- package/dist/src/condition-builder/cb-expression.d.ts +0 -30
- package/dist/src/condition-builder/cb-predicate.d.ts +0 -29
- package/src/brand-loader/brand-loader.scss +0 -270
- package/src/brand-loader/brand-loader.ts +0 -115
- package/src/brand-loader/index.ts +0 -2
- package/src/condition-builder/cb-compound-expression.scss +0 -41
- package/src/condition-builder/cb-compound-expression.ts +0 -79
- package/src/condition-builder/cb-expression.scss +0 -13
- package/src/condition-builder/cb-expression.ts +0 -48
- package/src/condition-builder/cb-predicate.scss +0 -35
- package/src/condition-builder/cb-predicate.ts +0 -101
- /package/dist/test/{brand-loader.test.d.ts → button.test.d.ts} +0 -0
package/dist/menu-item.js
CHANGED
|
@@ -119,32 +119,32 @@ var css_248z$1 = i`* {
|
|
|
119
119
|
--item-label-font-weight: var(--typography-label-large-font-weight);
|
|
120
120
|
--item-label-line-height: var(--typography-label-large-line-height);
|
|
121
121
|
--item-label-letter-spacing: var(--typography-label-large-letter-spacing);
|
|
122
|
-
--item-label-text-color: var(--
|
|
123
|
-
--item-leading-trailing-color: var(--
|
|
124
|
-
--item-supporting-text-color: var(--
|
|
125
|
-
--item-icon-size: var(--menu-item-icon-size, var(--
|
|
122
|
+
--item-label-text-color: var(--_item-label-text-color);
|
|
123
|
+
--item-leading-trailing-color: var(--_item-label-text-color);
|
|
124
|
+
--item-supporting-text-color: var(--_item-label-text-color);
|
|
125
|
+
--item-icon-size: var(--menu-item-icon-size, var(--_item-icon-size));
|
|
126
126
|
}
|
|
127
127
|
.menu-item .menu-item-content .background {
|
|
128
|
-
background-color: var(--
|
|
128
|
+
background-color: var(--_item-container-color);
|
|
129
129
|
opacity: var(--_container-opacity, 1);
|
|
130
130
|
border-radius: var(--shape-corner-medium);
|
|
131
|
-
border-start-start-radius: var(--
|
|
132
|
-
border-start-end-radius: var(--
|
|
133
|
-
border-end-start-radius: var(--
|
|
134
|
-
border-end-end-radius: var(--
|
|
131
|
+
border-start-start-radius: var(--_item-container-shape-start-start);
|
|
132
|
+
border-start-end-radius: var(--_item-container-shape-start-end);
|
|
133
|
+
border-end-start-radius: var(--_item-container-shape-end-start);
|
|
134
|
+
border-end-end-radius: var(--_item-container-shape-end-end);
|
|
135
135
|
}
|
|
136
136
|
.menu-item .menu-item-content .focus-ring {
|
|
137
137
|
--focus-ring-container-shape-start-start: var(
|
|
138
|
-
--
|
|
138
|
+
--_item-container-shape-start-start
|
|
139
139
|
);
|
|
140
140
|
--focus-ring-container-shape-start-end: var(
|
|
141
|
-
--
|
|
141
|
+
--_item-container-shape-start-start
|
|
142
142
|
);
|
|
143
143
|
--focus-ring-container-shape-end-start: var(
|
|
144
|
-
--
|
|
144
|
+
--_item-container-shape-start-start
|
|
145
145
|
);
|
|
146
146
|
--focus-ring-container-shape-end-end: var(
|
|
147
|
-
--
|
|
147
|
+
--_item-container-shape-start-start
|
|
148
148
|
);
|
|
149
149
|
z-index: 2;
|
|
150
150
|
--focus-ring-inset: 0px;
|
|
@@ -157,41 +157,41 @@ var css_248z$1 = i`* {
|
|
|
157
157
|
.menu-item .menu-item-content .skeleton {
|
|
158
158
|
z-index: 2;
|
|
159
159
|
--skeleton-container-shape-start-start: var(
|
|
160
|
-
--
|
|
160
|
+
--_item-container-shape-start-start
|
|
161
161
|
);
|
|
162
162
|
--skeleton-container-shape-start-end: var(
|
|
163
|
-
--
|
|
163
|
+
--_item-container-shape-start-end
|
|
164
164
|
);
|
|
165
165
|
--skeleton-container-shape-end-start: var(
|
|
166
|
-
--
|
|
166
|
+
--_item-container-shape-end-start
|
|
167
167
|
);
|
|
168
168
|
--skeleton-container-shape-end-end: var(
|
|
169
|
-
--
|
|
169
|
+
--_item-container-shape-end-end
|
|
170
170
|
);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
:host {
|
|
174
|
-
--
|
|
175
|
-
--
|
|
176
|
-
--
|
|
177
|
-
--
|
|
178
|
-
--
|
|
179
|
-
--
|
|
174
|
+
--_item-container-color: var(--menu-item-container-color);
|
|
175
|
+
--_item-label-text-color: var(--menu-item-label-color);
|
|
176
|
+
--_item-container-shape-start-start: var(--shape-corner-medium);
|
|
177
|
+
--_item-container-shape-start-end: var(--shape-corner-medium);
|
|
178
|
+
--_item-container-shape-end-start: var(--shape-corner-medium);
|
|
179
|
+
--_item-container-shape-end-end: var(--shape-corner-medium);
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
:host([selected]) {
|
|
183
|
-
--
|
|
184
|
-
--
|
|
185
|
-
--
|
|
186
|
-
--
|
|
187
|
-
--
|
|
188
|
-
--
|
|
183
|
+
--_item-container-color: var(--menu-item-container-selected-color);
|
|
184
|
+
--_item-label-text-color: var(--menu-item-label-selected-color);
|
|
185
|
+
--_item-container-shape-start-start: var(--shape-corner-large);
|
|
186
|
+
--_item-container-shape-start-end: var(--shape-corner-large);
|
|
187
|
+
--_item-container-shape-end-start: var(--shape-corner-large);
|
|
188
|
+
--_item-container-shape-end-end: var(--shape-corner-large);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
:host([disabled]),
|
|
192
192
|
:host([soft-disabled]) {
|
|
193
193
|
cursor: not-allowed;
|
|
194
|
-
--
|
|
194
|
+
--_item-label-text-color: var(--color-on-surface);
|
|
195
195
|
--_container-opacity: 0.12;
|
|
196
196
|
}
|
|
197
197
|
:host([disabled]) .ripple,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { _ as __decorate, I as IndividualComponent } from './IndividualComponent-Bdwyrvd6.js';
|
|
2
|
+
import { NavigationRailItem } from './navigation-rail-item.js';
|
|
3
|
+
import './property-B49QQ8pS.js';
|
|
4
|
+
import './state-DkTK9EGF.js';
|
|
5
|
+
import './query-CHb9Ft_d.js';
|
|
6
|
+
import './base-Cl6v8-BZ.js';
|
|
7
|
+
import './class-map-DG7CA1et.js';
|
|
8
|
+
import './directive-ZPhl09Yt.js';
|
|
9
|
+
import './dispatch-event-utils-CuEqjlPT.js';
|
|
10
|
+
import './observe-slot-change-DPxaZrZF.js';
|
|
11
|
+
import './throttle-C7ZAPqtu.js';
|
|
12
|
+
import './is-link-Dk2OV3PM.js';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @label Navigation Bar Item
|
|
16
|
+
* @tag wc-navigation-bar-item
|
|
17
|
+
* @rawTag navigation-bar-item
|
|
18
|
+
*
|
|
19
|
+
* @summary A destination in a navigation bar.
|
|
20
|
+
* @overview
|
|
21
|
+
* <p>Shows an icon inside the active-indicator pill with a label below. It has the same API as
|
|
22
|
+
* <code>wc-navigation-rail-item</code>: <code>active</code>, <code>disabled</code>, <code>href</code>,
|
|
23
|
+
* <code>value</code>, and the <code>icon</code> and <code>active-icon</code> slots.</p>
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```html
|
|
27
|
+
* <wc-navigation-bar-item active>
|
|
28
|
+
* <wc-icon slot="icon" name="home"></wc-icon>
|
|
29
|
+
* Home
|
|
30
|
+
* </wc-navigation-bar-item>
|
|
31
|
+
* ```
|
|
32
|
+
* @tags navigation
|
|
33
|
+
*/
|
|
34
|
+
let NavigationBarItem = class NavigationBarItem extends NavigationRailItem {
|
|
35
|
+
};
|
|
36
|
+
NavigationBarItem = __decorate([
|
|
37
|
+
IndividualComponent
|
|
38
|
+
], NavigationBarItem);
|
|
39
|
+
|
|
40
|
+
export { NavigationBarItem };
|
|
41
|
+
//# sourceMappingURL=navigation-bar-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-bar-item.js","sources":["../../src/navigation-bar/navigation-bar-item.ts"],"sourcesContent":["import IndividualComponent from '@/IndividualComponent.js';\nimport { NavigationRailItem } from '../navigation-rail/navigation-rail-item.js';\n\n/**\n * @label Navigation Bar Item\n * @tag wc-navigation-bar-item\n * @rawTag navigation-bar-item\n *\n * @summary A destination in a navigation bar.\n * @overview\n * <p>Shows an icon inside the active-indicator pill with a label below. It has the same API as\n * <code>wc-navigation-rail-item</code>: <code>active</code>, <code>disabled</code>, <code>href</code>,\n * <code>value</code>, and the <code>icon</code> and <code>active-icon</code> slots.</p>\n *\n * @example\n * ```html\n * <wc-navigation-bar-item active>\n * <wc-icon slot=\"icon\" name=\"home\"></wc-icon>\n * Home\n * </wc-navigation-bar-item>\n * ```\n * @tags navigation\n */\n@IndividualComponent\nexport class NavigationBarItem extends NavigationRailItem {}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAGA;;;;;;;;;;;;;;;;;;;AAmBG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,kBAAkB,CAAA;;AAA5C,iBAAiB,GAAA,UAAA,CAAA;IAD7B;AACY,CAAA,EAAA,iBAAiB,CAA8B;;;;"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { i, _ as __decorate, I as IndividualComponent, a as i$1, b } from './IndividualComponent-Bdwyrvd6.js';
|
|
2
|
+
import { NavigationBarItem } from './navigation-bar-item.js';
|
|
3
|
+
import './navigation-rail-item.js';
|
|
4
|
+
import './property-B49QQ8pS.js';
|
|
5
|
+
import './state-DkTK9EGF.js';
|
|
6
|
+
import './query-CHb9Ft_d.js';
|
|
7
|
+
import './base-Cl6v8-BZ.js';
|
|
8
|
+
import './class-map-DG7CA1et.js';
|
|
9
|
+
import './directive-ZPhl09Yt.js';
|
|
10
|
+
import './dispatch-event-utils-CuEqjlPT.js';
|
|
11
|
+
import './observe-slot-change-DPxaZrZF.js';
|
|
12
|
+
import './throttle-C7ZAPqtu.js';
|
|
13
|
+
import './is-link-Dk2OV3PM.js';
|
|
14
|
+
|
|
15
|
+
var css_248z = i`* {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
-webkit-tap-highlight-color: transparent;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.screen-reader-only {
|
|
21
|
+
display: none !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
[hidden] {
|
|
25
|
+
display: none !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host {
|
|
29
|
+
display: block;
|
|
30
|
+
width: 100%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.bar {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
height: var(--navigation-bar-height, 5rem);
|
|
37
|
+
padding-inline: var(--spacing-100);
|
|
38
|
+
background-color: var(--navigation-bar-container-color, var(--color-surface-container));
|
|
39
|
+
box-shadow: var(--navigation-bar-elevation, var(--elevation-level2));
|
|
40
|
+
}
|
|
41
|
+
.bar ::slotted(wc-navigation-bar-item) {
|
|
42
|
+
flex: 1 1 0;
|
|
43
|
+
min-width: 0;
|
|
44
|
+
--nav-rail-indicator-width: 4rem;
|
|
45
|
+
}`;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @label Navigation Bar
|
|
49
|
+
* @tag wc-navigation-bar
|
|
50
|
+
* @rawTag navigation-bar
|
|
51
|
+
*
|
|
52
|
+
* @summary A bottom bar with three to five primary destinations, for small screens.
|
|
53
|
+
* @overview
|
|
54
|
+
* <p>Navigation bar lays its <code>wc-navigation-bar-item</code> children out in a row of equal
|
|
55
|
+
* widths. Clicking an item makes it the active one and fires <code>change</code>.</p>
|
|
56
|
+
* <p>The bar does not position itself: place it at the bottom of your layout, or give it
|
|
57
|
+
* <code>position: fixed; inset-inline: 0; bottom: 0</code>.</p>
|
|
58
|
+
*
|
|
59
|
+
* @fires {CustomEvent<{value: string | undefined, index: number, item: NavigationBarItem}>} change - Dispatched when the user activates an item.
|
|
60
|
+
*
|
|
61
|
+
* @cssprop --navigation-bar-container-color - Background of the bar. Defaults to `--color-surface-container`.
|
|
62
|
+
* @cssprop --navigation-bar-height - Height of the bar. Defaults to 5rem (80dp).
|
|
63
|
+
* @cssprop --navigation-bar-elevation - Shadow of the bar. Defaults to `--elevation-level2`.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```html
|
|
67
|
+
* <wc-navigation-bar>
|
|
68
|
+
* <wc-navigation-bar-item active value="home">
|
|
69
|
+
* <wc-icon slot="icon" name="home"></wc-icon>
|
|
70
|
+
* Home
|
|
71
|
+
* </wc-navigation-bar-item>
|
|
72
|
+
* <wc-navigation-bar-item value="search">
|
|
73
|
+
* <wc-icon slot="icon" name="search"></wc-icon>
|
|
74
|
+
* Search
|
|
75
|
+
* </wc-navigation-bar-item>
|
|
76
|
+
* </wc-navigation-bar>
|
|
77
|
+
* ```
|
|
78
|
+
* @tags navigation
|
|
79
|
+
*/
|
|
80
|
+
let NavigationBar = class NavigationBar extends i$1 {
|
|
81
|
+
constructor() {
|
|
82
|
+
// ── Static ───────────────────────────────────────────────────────────────
|
|
83
|
+
super(...arguments);
|
|
84
|
+
this.handleItemClick = (event) => {
|
|
85
|
+
const item = event.target.closest?.('wc-navigation-bar-item');
|
|
86
|
+
if (!item || item.disabled)
|
|
87
|
+
return;
|
|
88
|
+
const items = this.getItems();
|
|
89
|
+
for (const barItem of items) {
|
|
90
|
+
barItem.active = barItem === item;
|
|
91
|
+
}
|
|
92
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
93
|
+
detail: { value: item.value, index: items.indexOf(item), item },
|
|
94
|
+
bubbles: true,
|
|
95
|
+
composed: true,
|
|
96
|
+
}));
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
// ── Lifecycle ────────────────────────────────────────────────────────────
|
|
100
|
+
connectedCallback() {
|
|
101
|
+
super.connectedCallback();
|
|
102
|
+
this.addEventListener('click', this.handleItemClick);
|
|
103
|
+
this.setAttribute('role', 'navigation');
|
|
104
|
+
if (!this.hasAttribute('aria-label')) {
|
|
105
|
+
this.setAttribute('aria-label', 'Main navigation');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
disconnectedCallback() {
|
|
109
|
+
this.removeEventListener('click', this.handleItemClick);
|
|
110
|
+
super.disconnectedCallback();
|
|
111
|
+
}
|
|
112
|
+
// ── Private methods ──────────────────────────────────────────────────────
|
|
113
|
+
getItems() {
|
|
114
|
+
return Array.from(this.querySelectorAll('wc-navigation-bar-item'));
|
|
115
|
+
}
|
|
116
|
+
// ── Render ───────────────────────────────────────────────────────────────
|
|
117
|
+
render() {
|
|
118
|
+
return b `<div class="bar"><slot></slot></div>`;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
NavigationBar.styles = [css_248z];
|
|
122
|
+
NavigationBar.Item = NavigationBarItem;
|
|
123
|
+
NavigationBar = __decorate([
|
|
124
|
+
IndividualComponent
|
|
125
|
+
], NavigationBar);
|
|
126
|
+
|
|
127
|
+
export { NavigationBar };
|
|
128
|
+
//# sourceMappingURL=navigation-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-bar.js","sources":["../../src/navigation-bar/navigation-bar.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport { NavigationBarItem } from './navigation-bar-item.js';\nimport styles from './navigation-bar.scss';\n\n/**\n * @label Navigation Bar\n * @tag wc-navigation-bar\n * @rawTag navigation-bar\n *\n * @summary A bottom bar with three to five primary destinations, for small screens.\n * @overview\n * <p>Navigation bar lays its <code>wc-navigation-bar-item</code> children out in a row of equal\n * widths. Clicking an item makes it the active one and fires <code>change</code>.</p>\n * <p>The bar does not position itself: place it at the bottom of your layout, or give it\n * <code>position: fixed; inset-inline: 0; bottom: 0</code>.</p>\n *\n * @fires {CustomEvent<{value: string | undefined, index: number, item: NavigationBarItem}>} change - Dispatched when the user activates an item.\n *\n * @cssprop --navigation-bar-container-color - Background of the bar. Defaults to `--color-surface-container`.\n * @cssprop --navigation-bar-height - Height of the bar. Defaults to 5rem (80dp).\n * @cssprop --navigation-bar-elevation - Shadow of the bar. Defaults to `--elevation-level2`.\n *\n * @example\n * ```html\n * <wc-navigation-bar>\n * <wc-navigation-bar-item active value=\"home\">\n * <wc-icon slot=\"icon\" name=\"home\"></wc-icon>\n * Home\n * </wc-navigation-bar-item>\n * <wc-navigation-bar-item value=\"search\">\n * <wc-icon slot=\"icon\" name=\"search\"></wc-icon>\n * Search\n * </wc-navigation-bar-item>\n * </wc-navigation-bar>\n * ```\n * @tags navigation\n */\n@IndividualComponent\nexport class NavigationBar extends LitElement {\n // ── Static ───────────────────────────────────────────────────────────────\n\n static styles = [styles];\n\n static Item = NavigationBarItem;\n\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n override connectedCallback() {\n super.connectedCallback();\n this.addEventListener('click', this.handleItemClick);\n this.setAttribute('role', 'navigation');\n if (!this.hasAttribute('aria-label')) {\n this.setAttribute('aria-label', 'Main navigation');\n }\n }\n\n override disconnectedCallback() {\n this.removeEventListener('click', this.handleItemClick);\n super.disconnectedCallback();\n }\n\n // ── Private methods ──────────────────────────────────────────────────────\n\n private getItems(): NavigationBarItem[] {\n return Array.from(\n this.querySelectorAll<NavigationBarItem>('wc-navigation-bar-item'),\n );\n }\n\n private handleItemClick = (event: Event) => {\n const item = (event.target as Element).closest?.(\n 'wc-navigation-bar-item',\n ) as NavigationBarItem | null;\n if (!item || item.disabled) return;\n\n const items = this.getItems();\n for (const barItem of items) {\n barItem.active = barItem === item;\n }\n\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: { value: item.value, index: items.indexOf(item), item },\n bubbles: true,\n composed: true,\n }),\n );\n };\n\n // ── Render ───────────────────────────────────────────────────────────────\n\n render() {\n return html`<div class=\"bar\"><slot></slot></div>`;\n }\n}\n"],"names":["LitElement","html","styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQA,GAAU,CAAA;AAAtC,IAAA,WAAA,GAAA;;;AA+BG,QAAA,IAAA,CAAA,eAAe,GAAG,CAAC,KAAY,KAAI;YACzC,MAAM,IAAI,GAAI,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,CAAA,MAAM,GAAG,CAACC,QAAM,CAAC;AAEjB,aAAA,CAAA,IAAI,GAAG,iBAAH;AALA,aAAa,GAAA,UAAA,CAAA;IADzB;AACY,CAAA,EAAA,aAAa,CAwDzB;;;;"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { i, a as i$1, _ as __decorate, I as IndividualComponent, A, b } from './IndividualComponent-Bdwyrvd6.js';
|
|
2
|
+
import { n } from './property-B49QQ8pS.js';
|
|
3
|
+
import { r } from './state-DkTK9EGF.js';
|
|
4
|
+
import { e } from './query-CHb9Ft_d.js';
|
|
5
|
+
import { e as e$1 } from './class-map-DG7CA1et.js';
|
|
6
|
+
import './base-Cl6v8-BZ.js';
|
|
7
|
+
import './directive-ZPhl09Yt.js';
|
|
8
|
+
|
|
9
|
+
var css_248z = i`* {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
-webkit-tap-highlight-color: transparent;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.screen-reader-only {
|
|
15
|
+
display: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[hidden] {
|
|
19
|
+
display: none !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host {
|
|
23
|
+
display: block;
|
|
24
|
+
color: var(--color-on-surface-variant);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.item {
|
|
28
|
+
background: transparent;
|
|
29
|
+
border: none;
|
|
30
|
+
appearance: none;
|
|
31
|
+
margin: 0;
|
|
32
|
+
outline: none;
|
|
33
|
+
padding: 0;
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
color: inherit;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
outline: none;
|
|
38
|
+
}
|
|
39
|
+
.item:link, .item:visited, .item:hover, .item:active {
|
|
40
|
+
text-decoration: none;
|
|
41
|
+
color: inherit;
|
|
42
|
+
}
|
|
43
|
+
.item {
|
|
44
|
+
position: relative;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
gap: var(--spacing-150);
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: 3.5rem;
|
|
50
|
+
padding-inline: var(--spacing-200) var(--spacing-300);
|
|
51
|
+
border-radius: var(--shape-corner-full);
|
|
52
|
+
color: inherit;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
text-decoration: none;
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
--icon-size: 1.5rem;
|
|
57
|
+
--icon-color: currentColor;
|
|
58
|
+
}
|
|
59
|
+
.item .focus-ring {
|
|
60
|
+
--focus-ring-container-shape-start-start: var(--shape-corner-full);
|
|
61
|
+
--focus-ring-container-shape-start-end: var(--shape-corner-full);
|
|
62
|
+
--focus-ring-container-shape-end-start: var(--shape-corner-full);
|
|
63
|
+
--focus-ring-container-shape-end-end: var(--shape-corner-full);
|
|
64
|
+
}
|
|
65
|
+
.item .ripple {
|
|
66
|
+
border-radius: inherit;
|
|
67
|
+
--ripple-pressed-color: currentColor;
|
|
68
|
+
}
|
|
69
|
+
.item .icon {
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
.item.has-icon .icon {
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
}
|
|
75
|
+
.item .label {
|
|
76
|
+
flex: 1;
|
|
77
|
+
min-width: 0;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
font-family: var(--typography-label-large-font-family) !important;
|
|
82
|
+
font-size: var(--typography-label-large-font-size) !important;
|
|
83
|
+
font-weight: var(--typography-label-large-font-weight) !important;
|
|
84
|
+
line-height: var(--typography-label-large-line-height) !important;
|
|
85
|
+
letter-spacing: var(--typography-label-large-letter-spacing) !important;
|
|
86
|
+
}
|
|
87
|
+
.item .badge {
|
|
88
|
+
font-family: var(--typography-label-large-font-family) !important;
|
|
89
|
+
font-size: var(--typography-label-large-font-size) !important;
|
|
90
|
+
font-weight: var(--typography-label-large-font-weight) !important;
|
|
91
|
+
line-height: var(--typography-label-large-line-height) !important;
|
|
92
|
+
letter-spacing: var(--typography-label-large-letter-spacing) !important;
|
|
93
|
+
}
|
|
94
|
+
.item.active {
|
|
95
|
+
background-color: var(--color-secondary-container);
|
|
96
|
+
color: var(--color-on-secondary-container);
|
|
97
|
+
}
|
|
98
|
+
.item.active .label {
|
|
99
|
+
font-weight: var(--font-weight-bold) !important;
|
|
100
|
+
}
|
|
101
|
+
.item.disabled {
|
|
102
|
+
cursor: not-allowed;
|
|
103
|
+
color: var(--color-on-surface);
|
|
104
|
+
opacity: var(--state-disabled-content-opacity, 0.38);
|
|
105
|
+
}
|
|
106
|
+
.item.disabled .ripple {
|
|
107
|
+
display: none;
|
|
108
|
+
}`;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @label Navigation Drawer Item
|
|
112
|
+
* @tag wc-navigation-drawer-item
|
|
113
|
+
* @rawTag navigation-drawer-item
|
|
114
|
+
*
|
|
115
|
+
* @summary A destination in a navigation drawer.
|
|
116
|
+
* @overview
|
|
117
|
+
* <p>A full-width row with an optional icon, a label and an optional badge. The active item gets
|
|
118
|
+
* the pill-shaped active indicator. With <code>href</code> it renders a link, otherwise a button.</p>
|
|
119
|
+
*
|
|
120
|
+
* @slot - The label.
|
|
121
|
+
* @slot icon - Leading icon.
|
|
122
|
+
* @slot badge - Trailing content, such as a count. Overrides the `badge` attribute.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```html
|
|
126
|
+
* <wc-navigation-drawer-item active badge="24">
|
|
127
|
+
* <wc-icon slot="icon" name="inbox"></wc-icon>
|
|
128
|
+
* Inbox
|
|
129
|
+
* </wc-navigation-drawer-item>
|
|
130
|
+
* ```
|
|
131
|
+
* @tags navigation
|
|
132
|
+
*/
|
|
133
|
+
let NavigationDrawerItem = class NavigationDrawerItem extends i$1 {
|
|
134
|
+
constructor() {
|
|
135
|
+
// ── Static ───────────────────────────────────────────────────────────────
|
|
136
|
+
super(...arguments);
|
|
137
|
+
// ── Properties ───────────────────────────────────────────────────────────
|
|
138
|
+
/** Whether this item is the current destination. */
|
|
139
|
+
this.active = false;
|
|
140
|
+
/** Whether this item is disabled. */
|
|
141
|
+
this.disabled = false;
|
|
142
|
+
/** Link target. */
|
|
143
|
+
this.target = '_self';
|
|
144
|
+
// ── State ────────────────────────────────────────────────────────────────
|
|
145
|
+
/** True when the `icon` slot has content. */
|
|
146
|
+
this.hasIcon = false;
|
|
147
|
+
}
|
|
148
|
+
// ── Public methods ───────────────────────────────────────────────────────
|
|
149
|
+
focus() {
|
|
150
|
+
this.itemElement?.focus();
|
|
151
|
+
}
|
|
152
|
+
blur() {
|
|
153
|
+
this.itemElement?.blur();
|
|
154
|
+
}
|
|
155
|
+
// ── Private methods ──────────────────────────────────────────────────────
|
|
156
|
+
handleIconSlotChange(event) {
|
|
157
|
+
this.hasIcon =
|
|
158
|
+
event.target.assignedElements().length > 0;
|
|
159
|
+
}
|
|
160
|
+
// ── Render helpers ───────────────────────────────────────────────────────
|
|
161
|
+
renderContent() {
|
|
162
|
+
return b `
|
|
163
|
+
<wc-focus-ring class="focus-ring" for="item"></wc-focus-ring>
|
|
164
|
+
<wc-ripple class="ripple" for="item"></wc-ripple>
|
|
165
|
+
<span class="icon"
|
|
166
|
+
><slot name="icon" @slotchange=${this.handleIconSlotChange}></slot
|
|
167
|
+
></span>
|
|
168
|
+
<span class="label"><slot></slot></span>
|
|
169
|
+
<span class="badge"
|
|
170
|
+
><slot name="badge">${this.badge ?? A}</slot></span
|
|
171
|
+
>
|
|
172
|
+
`;
|
|
173
|
+
}
|
|
174
|
+
// ── Render ───────────────────────────────────────────────────────────────
|
|
175
|
+
render() {
|
|
176
|
+
const classes = e$1({
|
|
177
|
+
item: true,
|
|
178
|
+
active: this.active,
|
|
179
|
+
disabled: this.disabled,
|
|
180
|
+
'has-icon': this.hasIcon,
|
|
181
|
+
});
|
|
182
|
+
if (this.href && !this.disabled) {
|
|
183
|
+
return b `<a
|
|
184
|
+
id="item"
|
|
185
|
+
class=${classes}
|
|
186
|
+
href=${this.href}
|
|
187
|
+
target=${this.target}
|
|
188
|
+
aria-current=${this.active ? 'page' : A}
|
|
189
|
+
>${this.renderContent()}</a
|
|
190
|
+
>`;
|
|
191
|
+
}
|
|
192
|
+
return b `<button
|
|
193
|
+
id="item"
|
|
194
|
+
class=${classes}
|
|
195
|
+
?disabled=${this.disabled}
|
|
196
|
+
aria-current=${this.active ? 'page' : A}
|
|
197
|
+
>
|
|
198
|
+
${this.renderContent()}
|
|
199
|
+
</button>`;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
NavigationDrawerItem.shadowRootOptions = {
|
|
203
|
+
...i$1.shadowRootOptions,
|
|
204
|
+
delegatesFocus: true,
|
|
205
|
+
};
|
|
206
|
+
NavigationDrawerItem.styles = [css_248z];
|
|
207
|
+
__decorate([
|
|
208
|
+
n({ type: Boolean, reflect: true })
|
|
209
|
+
], NavigationDrawerItem.prototype, "active", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
n({ type: Boolean, reflect: true })
|
|
212
|
+
], NavigationDrawerItem.prototype, "disabled", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
n({ reflect: true })
|
|
215
|
+
], NavigationDrawerItem.prototype, "href", void 0);
|
|
216
|
+
__decorate([
|
|
217
|
+
n()
|
|
218
|
+
], NavigationDrawerItem.prototype, "target", void 0);
|
|
219
|
+
__decorate([
|
|
220
|
+
n({ reflect: true })
|
|
221
|
+
], NavigationDrawerItem.prototype, "value", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
n()
|
|
224
|
+
], NavigationDrawerItem.prototype, "badge", void 0);
|
|
225
|
+
__decorate([
|
|
226
|
+
r()
|
|
227
|
+
], NavigationDrawerItem.prototype, "hasIcon", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
e('.item')
|
|
230
|
+
], NavigationDrawerItem.prototype, "itemElement", void 0);
|
|
231
|
+
NavigationDrawerItem = __decorate([
|
|
232
|
+
IndividualComponent
|
|
233
|
+
], NavigationDrawerItem);
|
|
234
|
+
|
|
235
|
+
export { NavigationDrawerItem };
|
|
236
|
+
//# sourceMappingURL=navigation-drawer-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-drawer-item.js","sources":["../../src/navigation-drawer/navigation-drawer-item.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport styles from './navigation-drawer-item.scss';\n\n/**\n * @label Navigation Drawer Item\n * @tag wc-navigation-drawer-item\n * @rawTag navigation-drawer-item\n *\n * @summary A destination in a navigation drawer.\n * @overview\n * <p>A full-width row with an optional icon, a label and an optional badge. The active item gets\n * the pill-shaped active indicator. With <code>href</code> it renders a link, otherwise a button.</p>\n *\n * @slot - The label.\n * @slot icon - Leading icon.\n * @slot badge - Trailing content, such as a count. Overrides the `badge` attribute.\n *\n * @example\n * ```html\n * <wc-navigation-drawer-item active badge=\"24\">\n * <wc-icon slot=\"icon\" name=\"inbox\"></wc-icon>\n * Inbox\n * </wc-navigation-drawer-item>\n * ```\n * @tags navigation\n */\n@IndividualComponent\nexport class NavigationDrawerItem extends LitElement {\n // ── Static ───────────────────────────────────────────────────────────────\n\n static override shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n static styles = [styles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n\n /** Whether this item is the current destination. */\n @property({ type: Boolean, reflect: true }) active = false;\n\n /** Whether this item is disabled. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** If provided, the item renders as a link. */\n @property({ reflect: true }) href?: string;\n\n /** Link target. */\n @property() target: string = '_self';\n\n /** Identifies the item in the drawer's `change` event. */\n @property({ reflect: true }) value?: string;\n\n /** Short trailing text, such as an unread count. */\n @property() badge?: string;\n\n // ── State ────────────────────────────────────────────────────────────────\n\n /** True when the `icon` slot has content. */\n @state() private hasIcon = false;\n\n // ── Queries ──────────────────────────────────────────────────────────────\n\n @query('.item') readonly itemElement!: HTMLElement | null;\n\n // ── Public methods ───────────────────────────────────────────────────────\n\n override focus() {\n this.itemElement?.focus();\n }\n\n override blur() {\n this.itemElement?.blur();\n }\n\n // ── Private methods ──────────────────────────────────────────────────────\n\n private handleIconSlotChange(event: Event) {\n this.hasIcon =\n (event.target as HTMLSlotElement).assignedElements().length > 0;\n }\n\n // ── Render helpers ───────────────────────────────────────────────────────\n\n private renderContent() {\n return html`\n <wc-focus-ring class=\"focus-ring\" for=\"item\"></wc-focus-ring>\n <wc-ripple class=\"ripple\" for=\"item\"></wc-ripple>\n <span class=\"icon\"\n ><slot name=\"icon\" @slotchange=${this.handleIconSlotChange}></slot\n ></span>\n <span class=\"label\"><slot></slot></span>\n <span class=\"badge\"\n ><slot name=\"badge\">${this.badge ?? nothing}</slot></span\n >\n `;\n }\n\n // ── Render ───────────────────────────────────────────────────────────────\n\n render() {\n const classes = classMap({\n item: true,\n active: this.active,\n disabled: this.disabled,\n 'has-icon': this.hasIcon,\n });\n\n if (this.href && !this.disabled) {\n return html`<a\n id=\"item\"\n class=${classes}\n href=${this.href}\n target=${this.target}\n aria-current=${this.active ? 'page' : nothing}\n >${this.renderContent()}</a\n >`;\n }\n\n return html`<button\n id=\"item\"\n class=${classes}\n ?disabled=${this.disabled}\n aria-current=${this.active ? 'page' : nothing}\n >\n ${this.renderContent()}\n </button>`;\n }\n}\n"],"names":["LitElement","html","nothing","classMap","styles","property","state","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQA,GAAU,CAAA;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