@jack-henry/jh-elements 2.0.0-beta.8
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/LICENSE +201 -0
- package/NOTICE +26 -0
- package/README.md +13 -0
- package/components/badge/badge.js +73 -0
- package/components/button/button.js +953 -0
- package/components/card/card.js +333 -0
- package/components/checkbox/checkbox.js +601 -0
- package/components/checkbox-group/checkbox-group.js +241 -0
- package/components/divider/divider.js +91 -0
- package/components/icon/icon.js +96 -0
- package/components/input/input.js +1245 -0
- package/components/input-email/input-email.js +18 -0
- package/components/input-password/input-password.js +153 -0
- package/components/input-search/input-search.js +41 -0
- package/components/input-telephone/input-telephone.js +18 -0
- package/components/input-textarea/input-textarea.js +374 -0
- package/components/input-url/input-url.js +31 -0
- package/components/list-group/list-group.js +103 -0
- package/components/list-item/list-item.js +350 -0
- package/components/menu/menu.js +60 -0
- package/components/notification/notification.js +327 -0
- package/components/progress/progress.js +417 -0
- package/components/radio/radio.js +422 -0
- package/components/radio-group/radio-group.js +400 -0
- package/components/switch/switch.js +316 -0
- package/components/table/table.js +367 -0
- package/components/table-data-cell/table-data-cell.js +107 -0
- package/components/table-header-cell/table-header-cell.js +321 -0
- package/components/table-row/table-row.js +52 -0
- package/components/tag/tag.js +422 -0
- package/components/tag-group/tag-group.js +57 -0
- package/components/toast/toast.js +172 -0
- package/components/toast-controller/toast-controller.js +122 -0
- package/components/tooltip/tooltip.js +498 -0
- package/custom-elements.json +6864 -0
- package/index.d.ts +69 -0
- package/jsconfig.json +9 -0
- package/package.json +52 -0
- package/utils/themeProvider.js +32 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2025 Jack Henry
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
import { LitElement, css, html } from 'lit';
|
|
6
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
7
|
+
|
|
8
|
+
let id = 0;
|
|
9
|
+
/**
|
|
10
|
+
* @cssprop --jh-list-group-subheader-color-background - The subheader background-color.
|
|
11
|
+
* Defaults to `transparent`.
|
|
12
|
+
* @cssprop --jh-list-group-subheader-color-text - The subheader text color.
|
|
13
|
+
* Defaults to `--jh-color-content-secondary-enabled`.
|
|
14
|
+
* @cssprop --jh-list-group-subheader-space-padding-right - The subheader padding-right.
|
|
15
|
+
* Defaults to `--jh-dimension-600`
|
|
16
|
+
* @cssprop --jh-list-group-subheader-space-padding-left - The subheader padding-left.
|
|
17
|
+
* Defaults to `--jh-dimension-600`
|
|
18
|
+
*
|
|
19
|
+
* @slot default - Use to insert `<jh-list-item>` component(s).
|
|
20
|
+
* @customElement jh-list-group
|
|
21
|
+
*/
|
|
22
|
+
export class JhListGroup extends LitElement {
|
|
23
|
+
/** @type {?Number} */
|
|
24
|
+
#id;
|
|
25
|
+
|
|
26
|
+
static get styles() {
|
|
27
|
+
return css`
|
|
28
|
+
:host {
|
|
29
|
+
display: block;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
}
|
|
32
|
+
.subheader {
|
|
33
|
+
background-color: var(
|
|
34
|
+
--jh-list-group-subheader-color-background,
|
|
35
|
+
transparent
|
|
36
|
+
);
|
|
37
|
+
color: var(
|
|
38
|
+
--jh-list-group-subheader-color-text,
|
|
39
|
+
var(--jh-color-content-secondary-enabled)
|
|
40
|
+
);
|
|
41
|
+
font-family: var(--jh-font-heading-medium-1-font-family);
|
|
42
|
+
font-weight: var(--jh-font-heading-medium-1-font-weight);
|
|
43
|
+
font-size: var(--jh-font-heading-medium-1-font-size);
|
|
44
|
+
line-height: var(--jh-font-heading-medium-1-line-height);
|
|
45
|
+
padding-top: var(--jh-dimension-400);
|
|
46
|
+
padding-right: var(
|
|
47
|
+
--jh-list-group-subheader-space-padding-right,
|
|
48
|
+
var(--jh-dimension-600)
|
|
49
|
+
);
|
|
50
|
+
padding-bottom: var(--jh-dimension-400);
|
|
51
|
+
padding-left: var(
|
|
52
|
+
--jh-list-group-subheader-space-padding-left,
|
|
53
|
+
var(--jh-dimension-600)
|
|
54
|
+
);
|
|
55
|
+
word-break: break-word;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static get properties() {
|
|
61
|
+
return {
|
|
62
|
+
/** Describes the type of data to be collected. */
|
|
63
|
+
label: {
|
|
64
|
+
type: String,
|
|
65
|
+
},
|
|
66
|
+
/** Sets an `aria-label` to assist screen reader users when no visible label is present. */
|
|
67
|
+
accessibleLabel: { type: String, attribute: 'accessible-label' },
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
constructor() {
|
|
72
|
+
super();
|
|
73
|
+
/** @type {?string} */
|
|
74
|
+
this.label = null;
|
|
75
|
+
/** @type {?string} */
|
|
76
|
+
this.accessibleLabel = null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
connectedCallback() {
|
|
80
|
+
super.connectedCallback();
|
|
81
|
+
this.#id = id++;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
render() {
|
|
85
|
+
return html`
|
|
86
|
+
${this.label
|
|
87
|
+
? html`<div class="subheader" id="list-group-labelledby-${this.#id}">
|
|
88
|
+
${this.label}
|
|
89
|
+
</div>`
|
|
90
|
+
: null}
|
|
91
|
+
<div
|
|
92
|
+
role="group"
|
|
93
|
+
aria-labelledby=${ifDefined(
|
|
94
|
+
this.label ? `list-group-labelledby-${this.#id}` : null
|
|
95
|
+
)}
|
|
96
|
+
aria-label=${ifDefined(this.accessibleLabel)}
|
|
97
|
+
>
|
|
98
|
+
<slot></slot>
|
|
99
|
+
</div>
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
customElements.define('jh-list-group', JhListGroup);
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2025 Jack Henry
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
import { LitElement, css, html } from 'lit';
|
|
6
|
+
import '../divider/divider.js';
|
|
7
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @cssprop --jh-list-item-color-background - The list-item container's background-color.
|
|
11
|
+
* Defaults to `transparent`.
|
|
12
|
+
* @cssprop --jh-list-item-color-text - The default, left, text, metadata, right, primary, and secondary slot text color. Defaults to `--jh-color-content-primary-enabled`.
|
|
13
|
+
* @cssprop --jh-list-item-space-padding-right - The right padding on the list-item container. Defaults to `--jh-dimension-600`.
|
|
14
|
+
* @cssprop --jh-list-item-space-padding-left - The left padding on the list-item container. Defaults to `--jh-dimension-600`.
|
|
15
|
+
* @cssprop --jh-list-item-size-height - The list-item's height. Defaults to `auto`.
|
|
16
|
+
* @cssprop --jh-list-item-color-text-primary - The primary text color.
|
|
17
|
+
* Defaults to `--jh-color-content-primary-enabled`.
|
|
18
|
+
* @cssprop --jh-list-item-color-text-secondary - The secondary text color.
|
|
19
|
+
* Defaults to `--jh-color-content-secondary-enabled`.
|
|
20
|
+
* @cssprop --jh-list-item-metadata-color-text-primary - The primary metadata text color.
|
|
21
|
+
* Defaults to `--jh-color-content-primary-enabled`.
|
|
22
|
+
* @cssprop --jh-list-item-metadata-color-text-secondary - The secondary metadata text color.
|
|
23
|
+
* Defaults to `--jh-color-content-secondary-enabled`.
|
|
24
|
+
* @cssprop --jh-list-item-color-background-focus - The list-item background-color when interactive and focused.
|
|
25
|
+
* Defaults to `--jh-color-container-primary-hover`.
|
|
26
|
+
* @cssprop --jh-list-item-color-focus - The list-item outline when it is interactive and receives keyboard focus.
|
|
27
|
+
* Defaults to `--jh-border-focus-color`.
|
|
28
|
+
* @cssprop --jh-list-item-color-background-hover - The list-item background-color when interactive and hovered.
|
|
29
|
+
* Defaults to `--jh-color-container-primary-hover`.
|
|
30
|
+
* @cssprop --jh-list-item-color-background-active - The list-item background-color when interactive and active.
|
|
31
|
+
* Defaults to `--jh-color-container-primary-active`.
|
|
32
|
+
* @cssprop --jh-list-item-color-background-selected - The list-item background-color when interactive and selected. Defaults to `--jh-color-container-primary-selected`.
|
|
33
|
+
* @cssprop --jh-list-item-color-border-selected - The list-item border-left-color when interactive and selected.
|
|
34
|
+
* Defaults to `--jh-border-selected-color`.
|
|
35
|
+
*
|
|
36
|
+
* @slot default - Use to insert fully customized content into the list-item. Cannot be used with the other slots.
|
|
37
|
+
* @slot jh-list-item-left - Use to insert custom content on the left the list-item.
|
|
38
|
+
* @slot jh-list-item-right - Use to insert custom content on the right the list-item.
|
|
39
|
+
* @slot jh-list-item-content - Use to insert custom content into the list-item.
|
|
40
|
+
* @slot jh-list-item-metadata - Use to insert custom metadata into the list-item.
|
|
41
|
+
* @customElement jh-list-item
|
|
42
|
+
*/
|
|
43
|
+
export class JhListItem extends LitElement {
|
|
44
|
+
/** @type {ElementInternals} */
|
|
45
|
+
#internals;
|
|
46
|
+
|
|
47
|
+
static get styles() {
|
|
48
|
+
return css`
|
|
49
|
+
:host {
|
|
50
|
+
background-color: var(--jh-list-item-color-background, transparent);
|
|
51
|
+
padding-bottom: var(--jh-dimension-400);
|
|
52
|
+
font-family: var(--jh-font-body-medium-1-font-family);
|
|
53
|
+
font-weight: var(--jh-font-body-medium-1-font-weight);
|
|
54
|
+
font-size: var(--jh-font-body-medium-1-font-size);
|
|
55
|
+
line-height: var(--jh-font-body-medium-1-line-height);
|
|
56
|
+
color: var(
|
|
57
|
+
--jh-list-item-color-text,
|
|
58
|
+
var(--jh-color-content-primary-enabled)
|
|
59
|
+
);
|
|
60
|
+
display: block;
|
|
61
|
+
box-sizing: border-box;
|
|
62
|
+
}
|
|
63
|
+
/* list item height is set to auto when styling hook is not set */
|
|
64
|
+
.list-item {
|
|
65
|
+
padding-right: var(
|
|
66
|
+
--jh-list-item-space-padding-right,
|
|
67
|
+
var(--jh-dimension-600)
|
|
68
|
+
);
|
|
69
|
+
padding-left: var(
|
|
70
|
+
--jh-list-item-space-padding-left,
|
|
71
|
+
var(--jh-dimension-600)
|
|
72
|
+
);
|
|
73
|
+
padding-top: var(--jh-dimension-400);
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: row;
|
|
76
|
+
align-items: center;
|
|
77
|
+
height: calc(var(--jh-list-item-size-height, auto) - var(--jh-dimension-400));
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
}
|
|
80
|
+
:host([show-divider]) .list-item {
|
|
81
|
+
height: calc(var(--jh-list-item-size-height, auto) - var(--jh-dimension-400) - 1px);
|
|
82
|
+
}
|
|
83
|
+
/* states for interactive list-items*/
|
|
84
|
+
:host([tabindex]:focus-visible) {
|
|
85
|
+
background-color: var(
|
|
86
|
+
--jh-list-item-color-background-focus,
|
|
87
|
+
var(--jh-color-container-primary-hover)
|
|
88
|
+
);
|
|
89
|
+
outline-color: var(
|
|
90
|
+
--jh-list-item-color-focus,
|
|
91
|
+
var(--jh-border-focus-color)
|
|
92
|
+
);
|
|
93
|
+
outline-style: var(--jh-border-focus-style);
|
|
94
|
+
outline-width: var(--jh-border-focus-width);
|
|
95
|
+
outline-offset: -2px;
|
|
96
|
+
}
|
|
97
|
+
:host([tabindex]:hover) {
|
|
98
|
+
background-color: var(
|
|
99
|
+
--jh-list-item-color-background-hover,
|
|
100
|
+
var(--jh-color-container-primary-hover)
|
|
101
|
+
);
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
}
|
|
104
|
+
:host([tabindex]:active) {
|
|
105
|
+
background-color: var(
|
|
106
|
+
--jh-list-item-color-background-active,
|
|
107
|
+
var(--jh-color-container-primary-active)
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
:host([tabindex][selected]) {
|
|
111
|
+
background-color: var(
|
|
112
|
+
--jh-list-item-color-background-selected,
|
|
113
|
+
var(--jh-color-container-primary-selected)
|
|
114
|
+
);
|
|
115
|
+
border-left-color: var(
|
|
116
|
+
--jh-list-item-color-border-selected,
|
|
117
|
+
var(--jh-border-selected-color)
|
|
118
|
+
);
|
|
119
|
+
border-left-style: var(--jh-border-selected-style);
|
|
120
|
+
border-left-width: var(--jh-border-selected-width);
|
|
121
|
+
}
|
|
122
|
+
:host([tabindex][selected]) .list-item {
|
|
123
|
+
padding-left: var(--jh-dimension-400);
|
|
124
|
+
}
|
|
125
|
+
:host([tabindex][disabled]) {
|
|
126
|
+
opacity: var(--jh-opacity-disabled);
|
|
127
|
+
cursor: default;
|
|
128
|
+
pointer-events: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
:host([show-divider]) {
|
|
132
|
+
padding-bottom: 0;
|
|
133
|
+
}
|
|
134
|
+
jh-divider {
|
|
135
|
+
margin-bottom: 0;
|
|
136
|
+
}
|
|
137
|
+
::slotted([slot='jh-list-item-left']) {
|
|
138
|
+
color: var(
|
|
139
|
+
--jh-list-item-color-text,
|
|
140
|
+
var(--jh-color-content-primary-enabled)
|
|
141
|
+
);
|
|
142
|
+
margin-right: var(--jh-dimension-200);
|
|
143
|
+
flex: 0 0 auto;
|
|
144
|
+
}
|
|
145
|
+
::slotted([slot='jh-list-item-content']) {
|
|
146
|
+
color: var(
|
|
147
|
+
--jh-list-item-color-text,
|
|
148
|
+
var(--jh-color-content-primary-enabled)
|
|
149
|
+
);
|
|
150
|
+
flex: 1 1 auto;
|
|
151
|
+
}
|
|
152
|
+
.text {
|
|
153
|
+
display: flex;
|
|
154
|
+
flex-direction: column;
|
|
155
|
+
flex: 1 1 auto;
|
|
156
|
+
min-width: 0;
|
|
157
|
+
}
|
|
158
|
+
::slotted([slot='jh-list-item-metadata']) {
|
|
159
|
+
color: var(
|
|
160
|
+
--jh-list-item-color-text,
|
|
161
|
+
var(--jh-color-content-primary-enabled)
|
|
162
|
+
);
|
|
163
|
+
margin-left: var(--jh-dimension-200);
|
|
164
|
+
flex: 0 0 auto;
|
|
165
|
+
}
|
|
166
|
+
.metadata {
|
|
167
|
+
margin-left: var(--jh-dimension-200);
|
|
168
|
+
flex: 0 0 auto;
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
}
|
|
172
|
+
::slotted([slot='jh-list-item-right']) {
|
|
173
|
+
color: var(
|
|
174
|
+
--jh-list-item-color-text,
|
|
175
|
+
var(--jh-color-content-primary-enabled)
|
|
176
|
+
);
|
|
177
|
+
margin-left: var(--jh-dimension-200);
|
|
178
|
+
flex: 0 0 auto;
|
|
179
|
+
}
|
|
180
|
+
.primary-text {
|
|
181
|
+
color: var(
|
|
182
|
+
--jh-list-item-color-text-primary,
|
|
183
|
+
var(--jh-color-content-primary-enabled)
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
.secondary-text {
|
|
187
|
+
color: var(
|
|
188
|
+
--jh-list-item-color-text-secondary,
|
|
189
|
+
var(--jh-color-content-secondary-enabled)
|
|
190
|
+
);
|
|
191
|
+
font-family: var(--jh-font-helper-regular-font-family);
|
|
192
|
+
font-weight: var(--jh-font-helper-regular-font-weight);
|
|
193
|
+
font-size: var(--jh-font-helper-regular-font-size);
|
|
194
|
+
line-height: var(--jh-font-helper-regular-line-height);
|
|
195
|
+
margin-top: var(--jh-dimension-50);
|
|
196
|
+
}
|
|
197
|
+
.primary-text,
|
|
198
|
+
.secondary-text {
|
|
199
|
+
display: block;
|
|
200
|
+
word-break: break-word;
|
|
201
|
+
}
|
|
202
|
+
.primary-metadata {
|
|
203
|
+
color: var(
|
|
204
|
+
--jh-list-item-metadata-color-text-primary,
|
|
205
|
+
var(--jh-color-content-primary-enabled)
|
|
206
|
+
);
|
|
207
|
+
text-align: right;
|
|
208
|
+
white-space: nowrap;
|
|
209
|
+
}
|
|
210
|
+
.secondary-metadata {
|
|
211
|
+
color: var(
|
|
212
|
+
--jh-list-item-metadata-color-text-secondary,
|
|
213
|
+
var(--jh-color-content-secondary-enabled)
|
|
214
|
+
);
|
|
215
|
+
font-family: var(--jh-font-helper-regular-font-family);
|
|
216
|
+
font-weight: var(--jh-font-helper-regular-font-weight);
|
|
217
|
+
font-size: var(--jh-font-helper-regular-font-size);
|
|
218
|
+
line-height: var(--jh-font-helper-regular-line-height);
|
|
219
|
+
margin-top: var(--jh-dimension-50);
|
|
220
|
+
text-align: right;
|
|
221
|
+
white-space: nowrap;
|
|
222
|
+
}
|
|
223
|
+
`;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
static get properties() {
|
|
227
|
+
return {
|
|
228
|
+
/**
|
|
229
|
+
* Disables the list-item and prevents all user interactions. May cause list-item to be ignored by assistive technologies(AT).
|
|
230
|
+
*/
|
|
231
|
+
disabled: {
|
|
232
|
+
type: Boolean,
|
|
233
|
+
reflect: true,
|
|
234
|
+
},
|
|
235
|
+
/**
|
|
236
|
+
* The inset of the optional divider. Omit to use the divider-inset token instead.
|
|
237
|
+
*/
|
|
238
|
+
dividerInset: {
|
|
239
|
+
type: Number,
|
|
240
|
+
attribute: 'divider-inset',
|
|
241
|
+
},
|
|
242
|
+
/**
|
|
243
|
+
* The text to show as primary metadata.
|
|
244
|
+
*/
|
|
245
|
+
primaryMetadata: {
|
|
246
|
+
type: String,
|
|
247
|
+
attribute: 'primary-metadata',
|
|
248
|
+
},
|
|
249
|
+
/**
|
|
250
|
+
* The text to show as primary text.
|
|
251
|
+
*/
|
|
252
|
+
primaryText: {
|
|
253
|
+
type: String,
|
|
254
|
+
attribute: 'primary-text',
|
|
255
|
+
},
|
|
256
|
+
/**
|
|
257
|
+
* The text to show as secondary metadata.
|
|
258
|
+
*/
|
|
259
|
+
secondaryMetadata: {
|
|
260
|
+
type: String,
|
|
261
|
+
attribute: 'secondary-metadata',
|
|
262
|
+
},
|
|
263
|
+
/**
|
|
264
|
+
* The text to show as secondary text.
|
|
265
|
+
*/
|
|
266
|
+
secondaryText: {
|
|
267
|
+
type: String,
|
|
268
|
+
attribute: 'secondary-text',
|
|
269
|
+
},
|
|
270
|
+
/**
|
|
271
|
+
* Determines whether an interactive list-item is selected.
|
|
272
|
+
*/
|
|
273
|
+
selected: {
|
|
274
|
+
type: Boolean,
|
|
275
|
+
reflect: true,
|
|
276
|
+
},
|
|
277
|
+
/**
|
|
278
|
+
* Determines whether the divider is displayed below the list-item.
|
|
279
|
+
*/
|
|
280
|
+
showDivider: {
|
|
281
|
+
type: Boolean,
|
|
282
|
+
reflect: true,
|
|
283
|
+
attribute: 'show-divider',
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
constructor() {
|
|
289
|
+
super();
|
|
290
|
+
this.#internals = this.attachInternals();
|
|
291
|
+
this.#internals.role = 'listitem';
|
|
292
|
+
/** @type {?boolean} */
|
|
293
|
+
this.disabled = false;
|
|
294
|
+
/** @type {null|0|8|16|24|32|40|48|56|64|72|80|88|96} */
|
|
295
|
+
this.dividerInset = null;
|
|
296
|
+
/** @type {?string} */
|
|
297
|
+
this.primaryMetadata = null;
|
|
298
|
+
/** @type {?string} */
|
|
299
|
+
this.primaryText = null;
|
|
300
|
+
/** @type {?string} */
|
|
301
|
+
this.secondaryMetadata = null;
|
|
302
|
+
/** @type {?string} */
|
|
303
|
+
this.secondaryText = null;
|
|
304
|
+
/** @type {?boolean} */
|
|
305
|
+
this.selected = false;
|
|
306
|
+
/** @type {?boolean} */
|
|
307
|
+
this.showDivider = false;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
render() {
|
|
311
|
+
let showDivider;
|
|
312
|
+
|
|
313
|
+
if (this.disabled === true && this.hasAttribute('tabindex')) {
|
|
314
|
+
this.setAttribute('aria-disabled', 'true');
|
|
315
|
+
} else {
|
|
316
|
+
this.removeAttribute('aria-disabled');
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (this.showDivider) {
|
|
320
|
+
showDivider = html`
|
|
321
|
+
<jh-divider
|
|
322
|
+
inset=${ifDefined(this.dividerInset ? this.dividerInset : null)}
|
|
323
|
+
></jh-divider>
|
|
324
|
+
`;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return html`
|
|
328
|
+
<div class="list-item">
|
|
329
|
+
<slot></slot>
|
|
330
|
+
<slot name="jh-list-item-left"></slot>
|
|
331
|
+
<slot name="jh-list-item-content">
|
|
332
|
+
<div class="text">
|
|
333
|
+
<div class="primary-text">${this.primaryText}</div>
|
|
334
|
+
<div class="secondary-text">${this.secondaryText}</div>
|
|
335
|
+
</div>
|
|
336
|
+
</slot>
|
|
337
|
+
<slot name="jh-list-item-metadata">
|
|
338
|
+
<div class="metadata">
|
|
339
|
+
<div class="primary-metadata">${this.primaryMetadata}</div>
|
|
340
|
+
<div class="secondary-metadata">${this.secondaryMetadata}</div>
|
|
341
|
+
</div>
|
|
342
|
+
</slot>
|
|
343
|
+
<slot name="jh-list-item-right"></slot>
|
|
344
|
+
</div>
|
|
345
|
+
${showDivider}
|
|
346
|
+
`;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
customElements.define('jh-list-item', JhListItem);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2025 Jack Henry
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
import { LitElement, css, html } from 'lit';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @cssprop --jh-menu-z-index - The menu z-index. Defaults to `--jh-z-index-positive-1000`.
|
|
9
|
+
* @cssprop --jh-menu-color-background - The menu container background-color. Defaults to `--jh-color-container-primary-enabled`.
|
|
10
|
+
* @cssprop --jh-menu-shadow - The menu box-shadow. Defaults to `--jh-shadow-high`.
|
|
11
|
+
* @cssprop --jh-menu-border-radius - The menu border-radius. Defaults to `--jh-border-radius-200`.
|
|
12
|
+
* @cssprop --jh-menu-space-padding - The menu container padding. Defaults to `--jh-dimension-200 0`.
|
|
13
|
+
* @cssprop --jh-menu-color-text - The text color. Defaults to `--jh-color-content-primary-enabled`.
|
|
14
|
+
*
|
|
15
|
+
* @slot default - Use to insert menu items.
|
|
16
|
+
* @customElement jh-menu
|
|
17
|
+
*/
|
|
18
|
+
export class JhMenu extends LitElement {
|
|
19
|
+
/** @type {ElementInternals} */
|
|
20
|
+
#internals;
|
|
21
|
+
|
|
22
|
+
static get styles() {
|
|
23
|
+
return css`
|
|
24
|
+
:host {
|
|
25
|
+
background-color: var(
|
|
26
|
+
--jh-menu-color-background,
|
|
27
|
+
var(--jh-color-container-primary-enabled)
|
|
28
|
+
);
|
|
29
|
+
box-shadow: var(--jh-menu-shadow, var(--jh-shadow-high));
|
|
30
|
+
border-radius: var(
|
|
31
|
+
--jh-menu-border-radius,
|
|
32
|
+
var(--jh-border-radius-200)
|
|
33
|
+
);
|
|
34
|
+
color: var(
|
|
35
|
+
--jh-menu-color-text,
|
|
36
|
+
var(--jh-color-content-primary-enabled)
|
|
37
|
+
);
|
|
38
|
+
padding: var(--jh-menu-space-padding, var(--jh-dimension-200) 0);
|
|
39
|
+
z-index: var(--jh-menu-z-index, var(--jh-z-index-positive-1000));
|
|
40
|
+
font-family: var(--jh-font-body-regular-1-font-family);
|
|
41
|
+
font-weight: var(--jh-font-body-regular-1-font-weight);
|
|
42
|
+
font-size: var(--jh-font-body-regular-1-font-size);
|
|
43
|
+
line-height: var(--jh-font-body-regular-1-line-height);
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
position: relative;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
constructor() {
|
|
52
|
+
super();
|
|
53
|
+
this.#internals = this.attachInternals();
|
|
54
|
+
this.#internals.role = 'menu';
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
return html`<slot></slot>`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
customElements.define('jh-menu', JhMenu);
|