@inglorious/ui 1.0.0 → 1.0.2
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/package.json +5 -5
- package/src/controls/button/template.js +2 -2
- package/src/controls/button-group/template.js +2 -2
- package/src/controls/checkbox/template.js +2 -2
- package/src/controls/combobox/template.js +32 -11
- package/src/controls/fab/template.js +2 -2
- package/src/controls/icon-button/template.js +2 -2
- package/src/controls/input/template.js +2 -2
- package/src/controls/radio-group/template.js +2 -2
- package/src/controls/rating/template.js +2 -2
- package/src/controls/select/template.js +2 -2
- package/src/controls/slider/template.js +2 -2
- package/src/controls/switch/template.js +2 -2
- package/src/data-display/avatar/template.js +2 -1
- package/src/data-display/badge/template.js +7 -0
- package/src/data-display/chip/template.js +7 -0
- package/src/data-display/data-grid/template.js +24 -12
- package/src/data-display/divider/template.js +7 -0
- package/src/data-display/icon/template.js +7 -0
- package/src/data-display/list/template.js +14 -5
- package/src/data-display/material-icon/template.js +7 -0
- package/src/data-display/table/template.js +18 -0
- package/src/data-display/tooltip/template.js +2 -0
- package/src/data-display/typography/template.js +2 -0
- package/src/data-display/virtual-list/template.js +4 -2
- package/src/feedback/alert/template.js +2 -0
- package/src/feedback/backdrop/template.js +2 -0
- package/src/feedback/dialog/template.js +2 -0
- package/src/feedback/progress/template.js +2 -0
- package/src/feedback/skeleton/template.js +2 -0
- package/src/feedback/snackbar/template.js +2 -0
- package/src/layout/container/template.js +2 -0
- package/src/layout/flex/template.js +2 -3
- package/src/layout/grid/template.js +2 -3
- package/src/navigation/bottom-navigation/template.js +14 -0
- package/src/navigation/breadcrumbs/template.js +14 -0
- package/src/navigation/drawer/template.js +2 -0
- package/src/navigation/link/template.js +2 -0
- package/src/navigation/menu/template.js +14 -0
- package/src/navigation/pagination/template.js +16 -0
- package/src/navigation/speed-dial/template.js +14 -0
- package/src/navigation/stepper/template.js +14 -0
- package/src/navigation/tabs/template.js +16 -0
- package/src/surfaces/accordion/template.js +14 -0
- package/src/surfaces/app-bar/template.js +2 -0
- package/src/surfaces/card/template.js +18 -0
- package/src/surfaces/paper/template.js +2 -0
- package/types/controls/combobox.d.ts +1 -0
- package/types/data-display/data-grid.d.ts +2 -1
- package/types/data-display/list.d.ts +1 -0
- package/types/data-display/table.d.ts +1 -0
- package/types/navigation/bottom-navigation.d.ts +1 -0
- package/types/navigation/breadcrumbs.d.ts +1 -0
- package/types/navigation/menu.d.ts +1 -0
- package/types/navigation/pagination.d.ts +1 -0
- package/types/navigation/speed-dial.d.ts +1 -0
- package/types/navigation/stepper.d.ts +1 -0
- package/types/navigation/tabs.d.ts +1 -0
- package/types/surfaces/accordion.d.ts +1 -0
- package/types/surfaces/card.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inglorious/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A design system for Inglorious Web with render-function components and customizable themes",
|
|
5
5
|
"author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -280,9 +280,9 @@
|
|
|
280
280
|
"**/*.css"
|
|
281
281
|
],
|
|
282
282
|
"peerDependencies": {
|
|
283
|
-
"@inglorious/charts": "4.0.
|
|
283
|
+
"@inglorious/charts": "4.0.1",
|
|
284
284
|
"@inglorious/utils": "3.7.3",
|
|
285
|
-
"@inglorious/web": "4.5.
|
|
285
|
+
"@inglorious/web": "4.5.1"
|
|
286
286
|
},
|
|
287
287
|
"devDependencies": {
|
|
288
288
|
"@fontsource/material-symbols-outlined": "^5.2.36",
|
|
@@ -296,9 +296,9 @@
|
|
|
296
296
|
"storybook": "^10.2.19",
|
|
297
297
|
"vite": "^7.3.1",
|
|
298
298
|
"vitest": "^4.0.15",
|
|
299
|
-
"@inglorious/
|
|
299
|
+
"@inglorious/eslint-config": "1.1.2",
|
|
300
300
|
"@inglorious/store": "9.6.0",
|
|
301
|
-
"@inglorious/
|
|
301
|
+
"@inglorious/web": "4.5.1"
|
|
302
302
|
},
|
|
303
303
|
"engines": {
|
|
304
304
|
"node": ">= 22"
|
|
@@ -8,8 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a themed button for actions and form submission.
|
|
12
|
+
* Supports variants, sizes, shapes, pressed state, and full-width layout.
|
|
13
13
|
* @example
|
|
14
14
|
* // Stateless usage
|
|
15
15
|
* button.render({ children: 'Click me', variant: 'primary' })
|
|
@@ -9,8 +9,8 @@ import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
|
9
9
|
import { button } from "../button/index.js"
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* Renders a grouped set of buttons with optional single or multi selection.
|
|
13
|
+
* Handles attached layout, selection state, and per-item overrides.
|
|
14
14
|
* @param {ButtonGroupProps} props
|
|
15
15
|
* @returns {TemplateResult}
|
|
16
16
|
*/
|
|
@@ -8,8 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a labeled checkbox for boolean input.
|
|
12
|
+
* Supports disabled/required states plus size and color variants.
|
|
13
13
|
* @param {CheckboxProps} props
|
|
14
14
|
* @returns {TemplateResult}
|
|
15
15
|
*/
|
|
@@ -19,11 +19,22 @@ const NO_FOCUSED_INDEX = -1
|
|
|
19
19
|
|
|
20
20
|
export const combobox = {
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Main entrypoint for the combobox control. It renders the wrapper, label, control, and dropdown when open.
|
|
23
|
+
* Comboboxes support search, single or multi-select values, and clearable selection.
|
|
23
24
|
* @param {ComboboxProps} props
|
|
24
25
|
* @returns {TemplateResult}
|
|
25
26
|
*/
|
|
26
27
|
render(props) {
|
|
28
|
+
return this.renderCombobox(props)
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Main entrypoint for the combobox control. It renders the wrapper, label, control, and dropdown when open.
|
|
33
|
+
* Comboboxes support search, single or multi-select values, and clearable selection.
|
|
34
|
+
* @param {ComboboxProps} props
|
|
35
|
+
* @returns {TemplateResult}
|
|
36
|
+
*/
|
|
37
|
+
renderCombobox(props) {
|
|
27
38
|
return html`<div
|
|
28
39
|
class=${classMap({
|
|
29
40
|
"iw-combobox": true,
|
|
@@ -40,7 +51,8 @@ export const combobox = {
|
|
|
40
51
|
},
|
|
41
52
|
|
|
42
53
|
/**
|
|
43
|
-
*
|
|
54
|
+
* Renders the clickable control element that shows the current selection and toggles the dropdown.
|
|
55
|
+
* Handles placeholder, clear button, and the open/disabled state.
|
|
44
56
|
* @param {ComboboxProps} props
|
|
45
57
|
* @returns {TemplateResult}
|
|
46
58
|
*/
|
|
@@ -85,7 +97,8 @@ export const combobox = {
|
|
|
85
97
|
},
|
|
86
98
|
|
|
87
99
|
/**
|
|
88
|
-
*
|
|
100
|
+
* Renders the currently selected value in single-select mode.
|
|
101
|
+
* Falls back to the placeholder when no value is selected.
|
|
89
102
|
* @param {ComboboxProps} props
|
|
90
103
|
* @returns {TemplateResult}
|
|
91
104
|
*/
|
|
@@ -108,7 +121,8 @@ export const combobox = {
|
|
|
108
121
|
},
|
|
109
122
|
|
|
110
123
|
/**
|
|
111
|
-
*
|
|
124
|
+
* Renders the selected values in multi-select mode as a row of tags.
|
|
125
|
+
* Falls back to the placeholder when the selection is empty.
|
|
112
126
|
* @param {ComboboxProps} props
|
|
113
127
|
* @returns {TemplateResult}
|
|
114
128
|
*/
|
|
@@ -129,7 +143,8 @@ export const combobox = {
|
|
|
129
143
|
},
|
|
130
144
|
|
|
131
145
|
/**
|
|
132
|
-
*
|
|
146
|
+
* Renders a single selected tag in multi-select mode.
|
|
147
|
+
* Used to customize chip styling and remove behavior.
|
|
133
148
|
* @param {ComboboxProps} props
|
|
134
149
|
* @param {string|number} value
|
|
135
150
|
* @returns {TemplateResult}
|
|
@@ -158,7 +173,8 @@ export const combobox = {
|
|
|
158
173
|
},
|
|
159
174
|
|
|
160
175
|
/**
|
|
161
|
-
*
|
|
176
|
+
* Renders the dropdown panel that contains search input, options, and empty/loading states.
|
|
177
|
+
* Shown only when the combobox is open.
|
|
162
178
|
* @param {ComboboxProps} props
|
|
163
179
|
* @returns {TemplateResult}
|
|
164
180
|
*/
|
|
@@ -195,7 +211,8 @@ export const combobox = {
|
|
|
195
211
|
},
|
|
196
212
|
|
|
197
213
|
/**
|
|
198
|
-
*
|
|
214
|
+
* Renders the optional search input used to filter options.
|
|
215
|
+
* Emits search change events as the user types.
|
|
199
216
|
* @param {ComboboxProps} props
|
|
200
217
|
* @returns {TemplateResult}
|
|
201
218
|
*/
|
|
@@ -214,7 +231,8 @@ export const combobox = {
|
|
|
214
231
|
},
|
|
215
232
|
|
|
216
233
|
/**
|
|
217
|
-
*
|
|
234
|
+
* Renders the list of available options in the dropdown.
|
|
235
|
+
* Delegates each option to `renderOption` for customization.
|
|
218
236
|
* @param {ComboboxProps} props
|
|
219
237
|
* @returns {TemplateResult}
|
|
220
238
|
*/
|
|
@@ -231,7 +249,8 @@ export const combobox = {
|
|
|
231
249
|
},
|
|
232
250
|
|
|
233
251
|
/**
|
|
234
|
-
*
|
|
252
|
+
* Renders a single option row, including selection and focus styling.
|
|
253
|
+
* Handles click/selection for the option.
|
|
235
254
|
* @param {ComboboxProps} props
|
|
236
255
|
* @param {{ option: ComboboxOption, index: number }} payload
|
|
237
256
|
* @returns {TemplateResult}
|
|
@@ -272,7 +291,8 @@ export const combobox = {
|
|
|
272
291
|
},
|
|
273
292
|
|
|
274
293
|
/**
|
|
275
|
-
*
|
|
294
|
+
* Renders the loading state shown while options are being fetched or filtered.
|
|
295
|
+
* Displayed when `isLoading` is true.
|
|
276
296
|
* @param {ComboboxProps} props
|
|
277
297
|
* @returns {TemplateResult}
|
|
278
298
|
*/
|
|
@@ -281,7 +301,8 @@ export const combobox = {
|
|
|
281
301
|
},
|
|
282
302
|
|
|
283
303
|
/**
|
|
284
|
-
*
|
|
304
|
+
* Renders the empty state when no options match the search or list is empty.
|
|
305
|
+
* Uses the `noOptionsMessage` prop when provided.
|
|
285
306
|
* @param {ComboboxProps} props
|
|
286
307
|
* @returns {TemplateResult}
|
|
287
308
|
*/
|
|
@@ -8,8 +8,8 @@ import { html } from "@inglorious/web"
|
|
|
8
8
|
import { button } from "../button/index.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a floating action button for primary contextual actions.
|
|
12
|
+
* Supports extended mode to display label text alongside the icon.
|
|
13
13
|
* @param {FabProps} props
|
|
14
14
|
* @returns {TemplateResult}
|
|
15
15
|
*/
|
|
@@ -8,8 +8,8 @@ import { html } from "@inglorious/web"
|
|
|
8
8
|
import { button } from "../button/index.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a button optimized for icons with optional label and icon placement.
|
|
12
|
+
* Built on top of the base button renderer for consistent theming.
|
|
13
13
|
* @param {IconButtonProps} props
|
|
14
14
|
* @returns {TemplateResult}
|
|
15
15
|
*/
|
|
@@ -8,8 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a labeled input field with optional icons, hint text, and error messaging.
|
|
12
|
+
* Supports disabled/readonly/required states and emits `onChange` on input.
|
|
13
13
|
* @example
|
|
14
14
|
* // Stateless usage
|
|
15
15
|
* input.render({ label: 'Email', type: 'email', placeholder: 'you@example.com' })
|
|
@@ -8,8 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a group of radio options for single selection.
|
|
12
|
+
* Supports horizontal/vertical layouts and disabled state.
|
|
13
13
|
* @param {RadioGroupProps} props
|
|
14
14
|
* @returns {TemplateResult}
|
|
15
15
|
*/
|
|
@@ -10,8 +10,8 @@ const DEFAULT_MAX = 5
|
|
|
10
10
|
const INDEX_TO_RATING = 1
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* Renders a star (or custom symbol) rating control.
|
|
14
|
+
* Supports max value, read-only/disabled states, and emits selection changes.
|
|
15
15
|
* @param {RatingProps} props
|
|
16
16
|
* @returns {TemplateResult}
|
|
17
17
|
*/
|
|
@@ -9,8 +9,8 @@ import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
|
9
9
|
import { formatOption, getOptionValue, isOptionSelected } from "./helpers.js"
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* Renders a styled native select control with optional single or multi-select modes.
|
|
13
|
+
* Options can be primitives or objects and are rendered with consistent theming.
|
|
14
14
|
* @example
|
|
15
15
|
* // Stateless usage
|
|
16
16
|
* select.render({ options: ['true', 'false'], value: 'true' })
|
|
@@ -13,8 +13,8 @@ const DEFAULT_MAX = 100
|
|
|
13
13
|
const DEFAULT_STEP = 1
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Renders a range slider with optional label and current value display.
|
|
17
|
+
* Supports min/max/step, color, disabled state, and full-width layout.
|
|
18
18
|
* @param {SliderProps} props
|
|
19
19
|
* @returns {TemplateResult}
|
|
20
20
|
*/
|
|
@@ -8,8 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a toggle switch backed by a checkbox input.
|
|
12
|
+
* Use it for boolean settings with optional labels and disabled state.
|
|
13
13
|
* @param {SwitchProps} props
|
|
14
14
|
* @returns {TemplateResult}
|
|
15
15
|
*/
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
import { classMap, html, styleMap } from "@inglorious/web"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Renders an avatar with image, initials, or fallback content.
|
|
10
|
+
* Supports size, shape, and automatic background color generation.
|
|
10
11
|
* @param {AvatarProps} props
|
|
11
12
|
* @returns {TemplateResult}
|
|
12
13
|
*/
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {import('../../../types/data-display/badge').BadgeProps} BadgeProps
|
|
3
|
+
* @typedef {import('@inglorious/web').TemplateResult} TemplateResult
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
6
|
import { classMap, html, styleMap } from "@inglorious/web"
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Renders a compact badge for status, labels, or counts.
|
|
10
|
+
* Supports color, variant, size, shape, and optional ring styling.
|
|
11
|
+
* @param {BadgeProps} props
|
|
12
|
+
* @returns {TemplateResult}
|
|
13
|
+
*/
|
|
7
14
|
export function render(props) {
|
|
8
15
|
const {
|
|
9
16
|
children,
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {import('../../../types/data-display/chip').ChipProps} ChipProps
|
|
3
|
+
* @typedef {import('@inglorious/web').TemplateResult} TemplateResult
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
6
|
import { classMap, html } from "@inglorious/web"
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Renders a compact chip label with optional remove action.
|
|
10
|
+
* Use chips for tags, filters, or selected values.
|
|
11
|
+
* @param {ChipProps} props
|
|
12
|
+
* @returns {TemplateResult}
|
|
13
|
+
*/
|
|
7
14
|
export function render(props) {
|
|
8
15
|
const {
|
|
9
16
|
children,
|
|
@@ -27,7 +27,8 @@ const LAST_PAGE = 1
|
|
|
27
27
|
|
|
28
28
|
export const dataGrid = {
|
|
29
29
|
/**
|
|
30
|
-
* Main entrypoint
|
|
30
|
+
* Main entrypoint for the data grid template. It delegates to the base grid renderer so overrides can still reuse it.
|
|
31
|
+
* Data grids support sorting, filtering, selection, pagination, and optional virtualization.
|
|
31
32
|
* @param {DataGridProps} props The data grid props.
|
|
32
33
|
* @returns {TemplateResult} The rendered data grid.
|
|
33
34
|
*/
|
|
@@ -36,7 +37,8 @@ export const dataGrid = {
|
|
|
36
37
|
},
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
|
-
* Renders the data grid
|
|
40
|
+
* Renders the data grid container and wires the header, body, and footer regions.
|
|
41
|
+
* This is the canonical renderer that custom `render()` overrides should call.
|
|
40
42
|
* @param {DataGridProps} props The data grid props.
|
|
41
43
|
* @returns {TemplateResult} The rendered data grid.
|
|
42
44
|
*/
|
|
@@ -55,7 +57,8 @@ export const dataGrid = {
|
|
|
55
57
|
},
|
|
56
58
|
|
|
57
59
|
/**
|
|
58
|
-
* Renders the
|
|
60
|
+
* Renders the grid header region, including optional toolbar and column headers.
|
|
61
|
+
* Column rendering is delegated to `renderHeaderColumn`.
|
|
59
62
|
* @param {DataGridProps} props The data grid props.
|
|
60
63
|
* @returns {TemplateResult} The rendered header.
|
|
61
64
|
*/
|
|
@@ -74,7 +77,8 @@ export const dataGrid = {
|
|
|
74
77
|
},
|
|
75
78
|
|
|
76
79
|
/**
|
|
77
|
-
* Renders the toolbar
|
|
80
|
+
* Renders the toolbar row that contains search, bulk actions, and filtering controls.
|
|
81
|
+
* Override to customize the global header tools.
|
|
78
82
|
* @param {DataGridProps} props The data grid props.
|
|
79
83
|
* @returns {TemplateResult}
|
|
80
84
|
*/
|
|
@@ -85,7 +89,8 @@ export const dataGrid = {
|
|
|
85
89
|
},
|
|
86
90
|
|
|
87
91
|
/**
|
|
88
|
-
* Renders a single column
|
|
92
|
+
* Renders a single column header cell, including sorting and filter affordances.
|
|
93
|
+
* Override to customize header labels or controls per column.
|
|
89
94
|
* @param {DataGridProps} props The data grid props.
|
|
90
95
|
* @param {object} payload The payload.
|
|
91
96
|
* @param {Column} payload.column The column definition.
|
|
@@ -118,7 +123,8 @@ export const dataGrid = {
|
|
|
118
123
|
},
|
|
119
124
|
|
|
120
125
|
/**
|
|
121
|
-
* Renders the search
|
|
126
|
+
* Renders the global search input shown in the grid toolbar.
|
|
127
|
+
* Used when `search` is enabled in the grid props.
|
|
122
128
|
* @param {DataGridProps} props The data grid props.
|
|
123
129
|
* @returns {TemplateResult} The rendered search bar.
|
|
124
130
|
*/
|
|
@@ -137,7 +143,8 @@ export const dataGrid = {
|
|
|
137
143
|
},
|
|
138
144
|
|
|
139
145
|
/**
|
|
140
|
-
* Renders the
|
|
146
|
+
* Renders the grid body, either as a standard list of rows or as a virtualized list.
|
|
147
|
+
* Row rendering is delegated to `renderRow`.
|
|
141
148
|
* @param {DataGridProps} props The data grid props.
|
|
142
149
|
* @returns {TemplateResult} The rendered data grid body.
|
|
143
150
|
*/
|
|
@@ -187,7 +194,8 @@ export const dataGrid = {
|
|
|
187
194
|
},
|
|
188
195
|
|
|
189
196
|
/**
|
|
190
|
-
* Renders a single row
|
|
197
|
+
* Renders a single data row and wires row click/selection handlers.
|
|
198
|
+
* Cells are delegated to `renderCell` for customization.
|
|
191
199
|
* @param {DataGridProps} props The data grid props.
|
|
192
200
|
* @param {object} payload The payload.
|
|
193
201
|
* @param {Row} payload.row The row data.
|
|
@@ -220,7 +228,8 @@ export const dataGrid = {
|
|
|
220
228
|
},
|
|
221
229
|
|
|
222
230
|
/**
|
|
223
|
-
* Renders a single cell
|
|
231
|
+
* Renders a single cell container and delegates the value to `renderValue`.
|
|
232
|
+
* Override to customize per-column cell structure.
|
|
224
233
|
* @param {DataGridProps} props The data grid props.
|
|
225
234
|
* @param {object} payload The payload.
|
|
226
235
|
* @param {any} payload.cell The cell data.
|
|
@@ -243,7 +252,8 @@ export const dataGrid = {
|
|
|
243
252
|
},
|
|
244
253
|
|
|
245
254
|
/**
|
|
246
|
-
* Renders the
|
|
255
|
+
* Renders the raw cell value for a column.
|
|
256
|
+
* Override to format values or inject custom content.
|
|
247
257
|
* @param {DataGridProps} _props The data grid props (ignored).
|
|
248
258
|
* @param {object} payload The payload.
|
|
249
259
|
* @param {any} payload.value The value to render.
|
|
@@ -254,7 +264,8 @@ export const dataGrid = {
|
|
|
254
264
|
},
|
|
255
265
|
|
|
256
266
|
/**
|
|
257
|
-
* Renders the
|
|
267
|
+
* Renders the grid footer, including pagination controls and page size selectors.
|
|
268
|
+
* Footer elements are delegated to `renderPagination` and `renderPageSize`.
|
|
258
269
|
* @param {DataGridProps} props The data grid props.
|
|
259
270
|
* @returns {TemplateResult} The rendered footer.
|
|
260
271
|
*/
|
|
@@ -281,7 +292,8 @@ export const dataGrid = {
|
|
|
281
292
|
},
|
|
282
293
|
|
|
283
294
|
/**
|
|
284
|
-
* Renders the
|
|
295
|
+
* Renders pagination controls for the grid footer.
|
|
296
|
+
* Override to provide custom paging UI.
|
|
285
297
|
* @param {DataGridProps} props The data grid props.
|
|
286
298
|
* @param {object} pagination The pagination info object from `getPaginationInfo`.
|
|
287
299
|
* @returns {TemplateResult} The rendered pagination controls.
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {import('../../../types/data-display/divider').DividerProps} DividerProps
|
|
3
|
+
* @typedef {import('@inglorious/web').TemplateResult} TemplateResult
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
6
|
import { classMap, html } from "@inglorious/web"
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Renders a horizontal or vertical divider line.
|
|
10
|
+
* Supports inset styling for aligned content blocks.
|
|
11
|
+
* @param {DividerProps} props
|
|
12
|
+
* @returns {TemplateResult}
|
|
13
|
+
*/
|
|
7
14
|
export function render(props) {
|
|
8
15
|
const { orientation = "horizontal", isInset = false } = props
|
|
9
16
|
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {import('../../../types/data-display/icon').IconProps} IconProps
|
|
3
|
+
* @typedef {import('@inglorious/web').TemplateResult} TemplateResult
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
6
|
import { classMap, html } from "@inglorious/web"
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Renders an inline icon element with size and color control.
|
|
10
|
+
* Use it for custom SVG, emoji, or font-based glyphs.
|
|
11
|
+
* @param {IconProps} props
|
|
12
|
+
* @returns {TemplateResult}
|
|
13
|
+
*/
|
|
7
14
|
export function render({ children, size = "md", color = "current", onClick }) {
|
|
8
15
|
return html`<span
|
|
9
16
|
class=${classMap({
|
|
@@ -29,10 +29,22 @@ const PRETTY_INDEX = 1
|
|
|
29
29
|
|
|
30
30
|
export const list = {
|
|
31
31
|
/**
|
|
32
|
+
* Main entrypoint for the list component. It delegates to the base list renderer so overrides can reuse it.
|
|
33
|
+
* Lists support ordered/unordered modes, nested items, and optional dividers.
|
|
32
34
|
* @param {ListProps} props
|
|
33
35
|
* @returns {TemplateResult}
|
|
34
36
|
*/
|
|
35
37
|
render(props) {
|
|
38
|
+
return this.renderList(props)
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Renders the list container (ordered or unordered) and iterates items.
|
|
43
|
+
* Each item is delegated to `renderItem` for customization.
|
|
44
|
+
* @param {ListProps} props
|
|
45
|
+
* @returns {TemplateResult}
|
|
46
|
+
*/
|
|
47
|
+
renderList(props) {
|
|
36
48
|
const {
|
|
37
49
|
type, // eslint-disable-line no-unused-vars
|
|
38
50
|
items = [],
|
|
@@ -107,13 +119,10 @@ export const list = {
|
|
|
107
119
|
},
|
|
108
120
|
|
|
109
121
|
/**
|
|
122
|
+
* Renders a single list item, including icon, primary/secondary text, and actions.
|
|
123
|
+
* Handles item click/toggle wiring and nested children.
|
|
110
124
|
* @param {ListProps} props
|
|
111
125
|
* @param {{
|
|
112
|
-
* item: ListItem,
|
|
113
|
-
* meta: ListItemMeta,
|
|
114
|
-
* index: number,
|
|
115
|
-
* path: number[]
|
|
116
|
-
* }} payload
|
|
117
126
|
* @returns {TemplateResult}
|
|
118
127
|
*/
|
|
119
128
|
renderItem(props, { item, meta, path }) {
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {import('../../../types/data-display/material-icon').MaterialIconProps} MaterialIconProps
|
|
3
|
+
* @typedef {import('@inglorious/web').TemplateResult} TemplateResult
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
6
|
import { classMap, html } from "@inglorious/web"
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Renders a Material Symbols icon by name.
|
|
10
|
+
* Requires the Material Symbols font and supports filled and size variants.
|
|
11
|
+
* @param {MaterialIconProps} props
|
|
12
|
+
* @returns {TemplateResult}
|
|
13
|
+
*/
|
|
7
14
|
export function render(props) {
|
|
8
15
|
const { name = "help", size = "md", isFilled = true, onClick } = props
|
|
9
16
|
|
|
@@ -13,10 +13,22 @@ const STRIPED_OFFSET = 1
|
|
|
13
13
|
|
|
14
14
|
export const table = {
|
|
15
15
|
/**
|
|
16
|
+
* Main entrypoint for the table component. It delegates to the base table renderer so overrides can reuse it.
|
|
17
|
+
* Tables render columns and rows and can be striped or full width.
|
|
16
18
|
* @param {TableProps} props
|
|
17
19
|
* @returns {TemplateResult}
|
|
18
20
|
*/
|
|
19
21
|
render(props) {
|
|
22
|
+
return this.renderTable(props)
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Renders the table wrapper, header row, and body rows.
|
|
27
|
+
* Header and cells are delegated to `renderHeaderCell` and `renderCell`.
|
|
28
|
+
* @param {TableProps} props
|
|
29
|
+
* @returns {TemplateResult}
|
|
30
|
+
*/
|
|
31
|
+
renderTable(props) {
|
|
20
32
|
const {
|
|
21
33
|
columns = [],
|
|
22
34
|
rows = [],
|
|
@@ -61,6 +73,8 @@ export const table = {
|
|
|
61
73
|
},
|
|
62
74
|
|
|
63
75
|
/**
|
|
76
|
+
* Renders a single header cell label for a column.
|
|
77
|
+
* Override to customize header content or add controls.
|
|
64
78
|
* @param {TableProps} _props
|
|
65
79
|
* @param {{column: TableColumn, index: number}} payload
|
|
66
80
|
* @returns {TemplateResult}
|
|
@@ -71,6 +85,8 @@ export const table = {
|
|
|
71
85
|
},
|
|
72
86
|
|
|
73
87
|
/**
|
|
88
|
+
* Renders a single table row and wires row click handlers.
|
|
89
|
+
* Cells are delegated to `renderCell`.
|
|
74
90
|
* @param {TableProps} props
|
|
75
91
|
* @param {{row: Record<string, unknown>, index: number}} payload
|
|
76
92
|
* @returns {TemplateResult}
|
|
@@ -95,6 +111,8 @@ export const table = {
|
|
|
95
111
|
},
|
|
96
112
|
|
|
97
113
|
/**
|
|
114
|
+
* Renders a single table cell value for a column.
|
|
115
|
+
* Override to format values or inject custom content.
|
|
98
116
|
* @param {TableProps} _props
|
|
99
117
|
* @param {{column: TableColumn, row: Record<string, unknown>}} payload
|
|
100
118
|
* @returns {TemplateResult}
|
|
@@ -8,6 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
+
* Renders a tooltip trigger and bubble with positional styling.
|
|
12
|
+
* Use `isOpen` to control visibility and `content` to set the tooltip body.
|
|
11
13
|
* @param {TooltipProps} props
|
|
12
14
|
* @returns {TemplateResult}
|
|
13
15
|
*/
|
|
@@ -8,6 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
+
* Renders styled text with semantic variants such as headings, body, and caption.
|
|
12
|
+
* Supports alignment, weight, color, and gutter spacing.
|
|
11
13
|
* @param {TypographyProps} props
|
|
12
14
|
* @returns {TemplateResult}
|
|
13
15
|
*/
|
|
@@ -9,7 +9,8 @@ import { html, ref, repeat, styleMap } from "@inglorious/web"
|
|
|
9
9
|
const PRETTY_INDEX = 1
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Renders
|
|
12
|
+
* Renders a virtualized list that only mounts visible items for performance.
|
|
13
|
+
* Uses item height estimates to compute scroll ranges and notifies on mount/scroll.
|
|
13
14
|
* @param {VirtualListEntity} entity The list entity state.
|
|
14
15
|
* @param {Api} api The API object.
|
|
15
16
|
* @returns {TemplateResult} The rendered list.
|
|
@@ -85,7 +86,8 @@ export function render(entity, api) {
|
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
/**
|
|
88
|
-
* Default item renderer.
|
|
89
|
+
* Default item renderer for a virtualized list item.
|
|
90
|
+
* Override to customize how each item is displayed.
|
|
89
91
|
* @param {VirtualListEntity} entity The list entity.
|
|
90
92
|
* @param {object} payload The payload for rendering the item.
|
|
91
93
|
* @param {any} payload.item The item data.
|
|
@@ -8,6 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
+
* Renders an alert message with optional title, description, icon, and actions.
|
|
12
|
+
* Supports severity and variant styles for info, success, warning, and error.
|
|
11
13
|
* @param {AlertProps} props
|
|
12
14
|
* @returns {TemplateResult}
|
|
13
15
|
*/
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { classMap, html } from "@inglorious/web"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
+
* Renders a modal dialog with header, body, and actions when open.
|
|
10
|
+
* Clicking the backdrop can close the dialog when handlers are provided.
|
|
9
11
|
* @param {DialogProps} props
|
|
10
12
|
* @returns {TemplateResult | null}
|
|
11
13
|
*/
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { classMap, html } from "@inglorious/web"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
+
* Renders a loading skeleton placeholder for text, blocks, or multiple lines.
|
|
10
|
+
* Use it to indicate content is loading without layout shifts.
|
|
9
11
|
* @param {SkeletonProps} props
|
|
10
12
|
* @returns {TemplateResult}
|
|
11
13
|
*/
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { classMap, html } from "@inglorious/web"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
+
* Renders a transient snackbar message with optional action and dismiss control.
|
|
10
|
+
* Position is configurable (for example bottom-left or top-right).
|
|
9
11
|
* @param {SnackbarProps} props
|
|
10
12
|
* @returns {TemplateResult | null}
|
|
11
13
|
*/
|
|
@@ -16,6 +16,8 @@ const SIZE_TO_MAX_WIDTH = {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
+
* Renders a responsive layout container with optional max width and padding.
|
|
20
|
+
* Use it to constrain page content while keeping semantic HTML tags.
|
|
19
21
|
* @param {ContainerProps} props
|
|
20
22
|
* @returns {TemplateResult}
|
|
21
23
|
*/
|
|
@@ -8,9 +8,8 @@ import { classMap, ref, staticHtml, unsafeStatic } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* Renders a flexible layout container with direction, alignment, spacing, and wrap control.
|
|
12
|
+
* Use it to compose layouts without writing custom flexbox CSS.
|
|
14
13
|
* @param {FlexProps} props
|
|
15
14
|
* @returns {TemplateResult}
|
|
16
15
|
*/
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
import { classMap, html, styleMap } from "@inglorious/web"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Renders a CSS grid container with configurable columns, gaps, and alignment.
|
|
10
|
+
* Supports fixed column counts or auto-fit with a minimum column width.
|
|
12
11
|
* @param {GridProps} props
|
|
13
12
|
* @returns {TemplateResult}
|
|
14
13
|
*/
|
|
@@ -10,10 +10,22 @@ import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
|
10
10
|
|
|
11
11
|
export const bottomNavigation = {
|
|
12
12
|
/**
|
|
13
|
+
* Main entrypoint for bottom navigation. Delegates to the base renderer for overrides.
|
|
14
|
+
* Renders a row of actions with optional labels.
|
|
13
15
|
* @param {BottomNavigationProps} props
|
|
14
16
|
* @returns {TemplateResult}
|
|
15
17
|
*/
|
|
16
18
|
render(props) {
|
|
19
|
+
return this.renderBottomNavigation(props)
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Renders the navigation container and iterates actions.
|
|
24
|
+
* Each action is delegated to `renderAction`.
|
|
25
|
+
* @param {BottomNavigationProps} props
|
|
26
|
+
* @returns {TemplateResult}
|
|
27
|
+
*/
|
|
28
|
+
renderBottomNavigation(props) {
|
|
17
29
|
const {
|
|
18
30
|
type, // eslint-disable-line no-unused-vars
|
|
19
31
|
actions = [],
|
|
@@ -41,6 +53,8 @@ export const bottomNavigation = {
|
|
|
41
53
|
},
|
|
42
54
|
|
|
43
55
|
/**
|
|
56
|
+
* Renders a single bottom navigation action.
|
|
57
|
+
* Handles selection state and click callbacks.
|
|
44
58
|
* @param {BottomNavigationAction} action
|
|
45
59
|
* @param {number} index
|
|
46
60
|
* @param {BottomNavigationProps} props
|
|
@@ -10,10 +10,22 @@ import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
|
10
10
|
|
|
11
11
|
export const breadcrumbs = {
|
|
12
12
|
/**
|
|
13
|
+
* Main entrypoint for breadcrumbs navigation. Delegates to the base renderer for overrides.
|
|
14
|
+
* Renders a list of path items separated by a configurable separator.
|
|
13
15
|
* @param {BreadcrumbsProps} props
|
|
14
16
|
* @returns {TemplateResult}
|
|
15
17
|
*/
|
|
16
18
|
render(props) {
|
|
19
|
+
return this.renderBreadcrumbs(props)
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Renders the breadcrumb container and iterates items.
|
|
24
|
+
* Each item is delegated to `renderItem`.
|
|
25
|
+
* @param {BreadcrumbsProps} props
|
|
26
|
+
* @returns {TemplateResult}
|
|
27
|
+
*/
|
|
28
|
+
renderBreadcrumbs(props) {
|
|
17
29
|
const {
|
|
18
30
|
type, // eslint-disable-line no-unused-vars
|
|
19
31
|
items = [],
|
|
@@ -49,6 +61,8 @@ export const breadcrumbs = {
|
|
|
49
61
|
},
|
|
50
62
|
|
|
51
63
|
/**
|
|
64
|
+
* Renders a single breadcrumb item, handling current vs. link states.
|
|
65
|
+
* Override to customize labels or link behavior.
|
|
52
66
|
* @param {BreadcrumbItem} item
|
|
53
67
|
* @param {number} index
|
|
54
68
|
* @param {BreadcrumbsProps} props
|
|
@@ -11,6 +11,8 @@ import { backdrop } from "../../feedback/backdrop"
|
|
|
11
11
|
import { flex } from "../../layout/flex"
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
+
* Renders a side drawer panel with optional header, body, and collapse controls.
|
|
15
|
+
* Can show a backdrop when open and supports left/right anchoring.
|
|
14
16
|
* @param {DrawerProps} props
|
|
15
17
|
* @returns {TemplateResult}
|
|
16
18
|
*/
|
|
@@ -8,6 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
+
* Renders a styled link element with optional underline and color variants.
|
|
12
|
+
* Supports external link behavior and click handling.
|
|
11
13
|
* @param {LinkProps} props
|
|
12
14
|
* @returns {TemplateResult}
|
|
13
15
|
*/
|
|
@@ -10,10 +10,22 @@ import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
|
10
10
|
|
|
11
11
|
export const menu = {
|
|
12
12
|
/**
|
|
13
|
+
* Main entrypoint for a menu list. Delegates to the base renderer for overrides.
|
|
14
|
+
* Menus render selectable items and optional dividers.
|
|
13
15
|
* @param {MenuProps} props
|
|
14
16
|
* @returns {TemplateResult | null}
|
|
15
17
|
*/
|
|
16
18
|
render(props) {
|
|
19
|
+
return this.renderMenu(props)
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Renders the menu container and iterates items when open.
|
|
24
|
+
* Each item is delegated to `renderItem`.
|
|
25
|
+
* @param {MenuProps} props
|
|
26
|
+
* @returns {TemplateResult | null}
|
|
27
|
+
*/
|
|
28
|
+
renderMenu(props) {
|
|
17
29
|
const {
|
|
18
30
|
type, // eslint-disable-line no-unused-vars
|
|
19
31
|
isOpen = false,
|
|
@@ -46,6 +58,8 @@ export const menu = {
|
|
|
46
58
|
},
|
|
47
59
|
|
|
48
60
|
/**
|
|
61
|
+
* Renders a single menu item or divider.
|
|
62
|
+
* Handles selection, disabled state, and click callbacks.
|
|
49
63
|
* @param {MenuItem} item
|
|
50
64
|
* @param {number} index
|
|
51
65
|
* @param {MenuProps} props
|
|
@@ -13,10 +13,22 @@ const PRETTY_PAGE = 1
|
|
|
13
13
|
|
|
14
14
|
export const pagination = {
|
|
15
15
|
/**
|
|
16
|
+
* Main entrypoint for pagination controls. Delegates to the base renderer for overrides.
|
|
17
|
+
* Supports sibling ranges, first/last buttons, and disabled state.
|
|
16
18
|
* @param {PaginationProps} props
|
|
17
19
|
* @returns {TemplateResult}
|
|
18
20
|
*/
|
|
19
21
|
render(props) {
|
|
22
|
+
return this.renderPagination(props)
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Renders the pagination container and page/control items.
|
|
27
|
+
* Items are delegated to `renderItem` and `renderControl`.
|
|
28
|
+
* @param {PaginationProps} props
|
|
29
|
+
* @returns {TemplateResult}
|
|
30
|
+
*/
|
|
31
|
+
renderPagination(props) {
|
|
20
32
|
const {
|
|
21
33
|
page = 1,
|
|
22
34
|
count = 1,
|
|
@@ -68,6 +80,8 @@ export const pagination = {
|
|
|
68
80
|
},
|
|
69
81
|
|
|
70
82
|
/**
|
|
83
|
+
* Renders a single page number item or ellipsis.
|
|
84
|
+
* Uses the button primitive for interactive pages.
|
|
71
85
|
* @param {PaginationProps} props
|
|
72
86
|
* @param {PaginationItemRenderProps} payload
|
|
73
87
|
* @returns {TemplateResult}
|
|
@@ -97,6 +111,8 @@ export const pagination = {
|
|
|
97
111
|
},
|
|
98
112
|
|
|
99
113
|
/**
|
|
114
|
+
* Renders a navigation control (first/prev/next/last).
|
|
115
|
+
* Uses the button primitive and wires change events.
|
|
100
116
|
* @param {PaginationProps} props
|
|
101
117
|
* @param {PaginationControlRenderProps} payload
|
|
102
118
|
* @returns {TemplateResult}
|
|
@@ -8,10 +8,22 @@ import { classMap, html } from "@inglorious/web"
|
|
|
8
8
|
|
|
9
9
|
export const speedDial = {
|
|
10
10
|
/**
|
|
11
|
+
* Main entrypoint for the speed dial. Delegates to the base renderer for overrides.
|
|
12
|
+
* Shows a trigger button and an expandable list of actions.
|
|
11
13
|
* @param {SpeedDialProps} props
|
|
12
14
|
* @returns {TemplateResult}
|
|
13
15
|
*/
|
|
14
16
|
render(props) {
|
|
17
|
+
return this.renderSpeedDial(props)
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Renders the speed dial container, trigger, and optional actions list.
|
|
22
|
+
* Actions are delegated to `renderAction`.
|
|
23
|
+
* @param {SpeedDialProps} props
|
|
24
|
+
* @returns {TemplateResult}
|
|
25
|
+
*/
|
|
26
|
+
renderSpeedDial(props) {
|
|
15
27
|
const {
|
|
16
28
|
isOpen = false,
|
|
17
29
|
direction = "up",
|
|
@@ -46,6 +58,8 @@ export const speedDial = {
|
|
|
46
58
|
},
|
|
47
59
|
|
|
48
60
|
/**
|
|
61
|
+
* Renders a single speed dial action button.
|
|
62
|
+
* Handles click callbacks and disabled state.
|
|
49
63
|
* @param {SpeedDialAction} action
|
|
50
64
|
* @param {number} index
|
|
51
65
|
* @param {SpeedDialProps} props
|
|
@@ -8,10 +8,22 @@ import { classMap, html } from "@inglorious/web"
|
|
|
8
8
|
|
|
9
9
|
export const stepper = {
|
|
10
10
|
/**
|
|
11
|
+
* Main entrypoint for the stepper component. Delegates to the base renderer for overrides.
|
|
12
|
+
* Steppers render a sequence of steps with completion states.
|
|
11
13
|
* @param {StepperProps} props
|
|
12
14
|
* @returns {TemplateResult}
|
|
13
15
|
*/
|
|
14
16
|
render(props) {
|
|
17
|
+
return this.renderStepper(props)
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Renders the ordered list of steps with orientation styling.
|
|
22
|
+
* Each step is delegated to `renderStep`.
|
|
23
|
+
* @param {StepperProps} props
|
|
24
|
+
* @returns {TemplateResult}
|
|
25
|
+
*/
|
|
26
|
+
renderStepper(props) {
|
|
15
27
|
const {
|
|
16
28
|
steps = [],
|
|
17
29
|
activeStep = 0,
|
|
@@ -33,6 +45,8 @@ export const stepper = {
|
|
|
33
45
|
},
|
|
34
46
|
|
|
35
47
|
/**
|
|
48
|
+
* Renders a single step with label, optional text, and completion state.
|
|
49
|
+
* Calculates active/completed styling based on the current step.
|
|
36
50
|
* @param {Step} step
|
|
37
51
|
* @param {number} index
|
|
38
52
|
* @param {StepperProps} props
|
|
@@ -8,10 +8,22 @@ import { classMap, html } from "@inglorious/web"
|
|
|
8
8
|
|
|
9
9
|
export const tabs = {
|
|
10
10
|
/**
|
|
11
|
+
* Main entrypoint for tabbed navigation. Delegates to the base renderer for overrides.
|
|
12
|
+
* Renders tab labels and the active panel.
|
|
11
13
|
* @param {TabsProps} props
|
|
12
14
|
* @returns {TemplateResult}
|
|
13
15
|
*/
|
|
14
16
|
render(props) {
|
|
17
|
+
return this.renderTabs(props)
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Renders the tabs list and the active panel container.
|
|
22
|
+
* Individual tabs are delegated to `renderTab`.
|
|
23
|
+
* @param {TabsProps} props
|
|
24
|
+
* @returns {TemplateResult}
|
|
25
|
+
*/
|
|
26
|
+
renderTabs(props) {
|
|
15
27
|
const {
|
|
16
28
|
items = [],
|
|
17
29
|
value = items[0]?.value ?? 0,
|
|
@@ -40,6 +52,8 @@ export const tabs = {
|
|
|
40
52
|
},
|
|
41
53
|
|
|
42
54
|
/**
|
|
55
|
+
* Renders a single tab button with selected/disabled states.
|
|
56
|
+
* Wires click events to update the active tab.
|
|
43
57
|
* @param {TabItem} item
|
|
44
58
|
* @param {number} index
|
|
45
59
|
* @param {TabsProps} props
|
|
@@ -69,6 +83,8 @@ export const tabs = {
|
|
|
69
83
|
},
|
|
70
84
|
|
|
71
85
|
/**
|
|
86
|
+
* Renders the active tab panel content.
|
|
87
|
+
* Returns `null` when the active item has no panel.
|
|
72
88
|
* @param {TabItem | null} item
|
|
73
89
|
* @returns {TemplateResult | null}
|
|
74
90
|
*/
|
|
@@ -10,10 +10,22 @@ import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
|
10
10
|
|
|
11
11
|
export const accordion = {
|
|
12
12
|
/**
|
|
13
|
+
* Main entrypoint for the accordion component. Delegates to the base accordion renderer for overrides.
|
|
14
|
+
* Accordions render a list of collapsible items with optional icons.
|
|
13
15
|
* @param {AccordionProps} props
|
|
14
16
|
* @returns {TemplateResult}
|
|
15
17
|
*/
|
|
16
18
|
render(props) {
|
|
19
|
+
return this.renderAccordion(props)
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Renders the accordion container and iterates items.
|
|
24
|
+
* Each item is delegated to `renderItem`.
|
|
25
|
+
* @param {AccordionProps} props
|
|
26
|
+
* @returns {TemplateResult}
|
|
27
|
+
*/
|
|
28
|
+
renderAccordion(props) {
|
|
17
29
|
const {
|
|
18
30
|
type, // eslint-disable-line no-unused-vars
|
|
19
31
|
items = [],
|
|
@@ -40,6 +52,8 @@ export const accordion = {
|
|
|
40
52
|
},
|
|
41
53
|
|
|
42
54
|
/**
|
|
55
|
+
* Renders a single accordion item with trigger and panel content.
|
|
56
|
+
* Handles expand/collapse behavior and item-level callbacks.
|
|
43
57
|
* @param {AccordionItem} item
|
|
44
58
|
* @param {number} index
|
|
45
59
|
* @param {AccordionProps} props
|
|
@@ -8,6 +8,8 @@ import { classMap, html, ref, when } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
+
* Renders a top app bar with optional leading/trailing content and title metadata.
|
|
12
|
+
* Supports variants, density, color, and positioning modes.
|
|
11
13
|
* @param {AppBarProps} props
|
|
12
14
|
* @returns {TemplateResult}
|
|
13
15
|
*/
|
|
@@ -9,10 +9,22 @@ import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
|
9
9
|
|
|
10
10
|
export const card = {
|
|
11
11
|
/**
|
|
12
|
+
* Main entrypoint for the card component. Delegates to the base card renderer for easy overrides.
|
|
13
|
+
* Cards support header, body, and footer slots with optional click behavior.
|
|
12
14
|
* @param {CardProps} props
|
|
13
15
|
* @returns {TemplateResult}
|
|
14
16
|
*/
|
|
15
17
|
render(props) {
|
|
18
|
+
return this.renderCard(props)
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Renders the card container and composes header, body, and footer sub-sections.
|
|
23
|
+
* Uses `element` to control the semantic tag.
|
|
24
|
+
* @param {CardProps} props
|
|
25
|
+
* @returns {TemplateResult}
|
|
26
|
+
*/
|
|
27
|
+
renderCard(props) {
|
|
16
28
|
const {
|
|
17
29
|
type, // eslint-disable-line no-unused-vars
|
|
18
30
|
element = "article",
|
|
@@ -52,6 +64,8 @@ export const card = {
|
|
|
52
64
|
},
|
|
53
65
|
|
|
54
66
|
/**
|
|
67
|
+
* Renders the optional card header area (title, subtitle, or custom header content).
|
|
68
|
+
* Returns `null` when no header content is provided.
|
|
55
69
|
* @param {CardProps} props
|
|
56
70
|
* @returns {TemplateResult | null}
|
|
57
71
|
*/
|
|
@@ -83,6 +97,8 @@ export const card = {
|
|
|
83
97
|
},
|
|
84
98
|
|
|
85
99
|
/**
|
|
100
|
+
* Renders the main card content area.
|
|
101
|
+
* Returns `null` when there is no body or children content.
|
|
86
102
|
* @param {CardProps} props
|
|
87
103
|
* @returns {TemplateResult | null}
|
|
88
104
|
*/
|
|
@@ -103,6 +119,8 @@ export const card = {
|
|
|
103
119
|
},
|
|
104
120
|
|
|
105
121
|
/**
|
|
122
|
+
* Renders the optional card footer area, typically for actions.
|
|
123
|
+
* Returns `null` when no footer content is provided.
|
|
106
124
|
* @param {CardProps} props
|
|
107
125
|
* @returns {TemplateResult | null}
|
|
108
126
|
*/
|
|
@@ -8,6 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
+
* Renders a surface container with elevation, radius, and padding options.
|
|
12
|
+
* Use it as a generic surface for grouping content.
|
|
11
13
|
* @param {PaperProps} props
|
|
12
14
|
* @returns {TemplateResult}
|
|
13
15
|
*/
|
|
@@ -51,6 +51,7 @@ export interface ComboboxProps {
|
|
|
51
51
|
export interface ComboboxType {
|
|
52
52
|
create(entity: ComboboxProps): void
|
|
53
53
|
render(entity: ComboboxProps, api: Api): TemplateResult
|
|
54
|
+
renderCombobox(props: ComboboxProps): TemplateResult
|
|
54
55
|
open(entity: ComboboxProps): void
|
|
55
56
|
close(entity: ComboboxProps): void
|
|
56
57
|
toggle(entity: ComboboxProps): void
|
|
@@ -122,9 +122,10 @@ export interface DataGridType {
|
|
|
122
122
|
rowsToggleAll(entity: DataGridProps): void
|
|
123
123
|
rowsSelectAll(entity: DataGridProps): void
|
|
124
124
|
selectionClear(entity: DataGridProps): void
|
|
125
|
-
virtualScroll(entity: DataGridProps, containerEl: HTMLElement): void
|
|
126
125
|
virtualMount(entity: DataGridProps, containerEl: HTMLElement): void
|
|
126
|
+
virtualScroll(entity: DataGridProps, containerEl: HTMLElement): void
|
|
127
127
|
render(entity: DataGridProps, api: Api): TemplateResult
|
|
128
|
+
renderDataGrid(entity: DataGridProps, api: Api): TemplateResult
|
|
128
129
|
renderHeader(entity: DataGridProps, api: Api): TemplateResult
|
|
129
130
|
renderToolbar(entity: DataGridProps, api: Api): TemplateResult
|
|
130
131
|
renderHeaderColumn(
|
|
@@ -23,6 +23,7 @@ export interface BottomNavigationProps {
|
|
|
23
23
|
|
|
24
24
|
export interface BottomNavigationType {
|
|
25
25
|
render(props: BottomNavigationProps): TemplateResult
|
|
26
|
+
renderBottomNavigation(props: BottomNavigationProps): TemplateResult
|
|
26
27
|
renderAction(
|
|
27
28
|
action: BottomNavigationAction,
|
|
28
29
|
index: number,
|
|
@@ -37,6 +37,7 @@ export interface PaginationControlRenderProps {
|
|
|
37
37
|
|
|
38
38
|
export interface PaginationType {
|
|
39
39
|
render(props: PaginationProps): TemplateResult
|
|
40
|
+
renderPagination(props: PaginationProps): TemplateResult
|
|
40
41
|
renderItem(
|
|
41
42
|
props: PaginationProps,
|
|
42
43
|
payload: PaginationItemRenderProps,
|
|
@@ -24,6 +24,7 @@ export interface TabsProps {
|
|
|
24
24
|
|
|
25
25
|
export interface TabsType {
|
|
26
26
|
render(props: TabsProps): TemplateResult
|
|
27
|
+
renderTabs(props: TabsProps): TemplateResult
|
|
27
28
|
renderTab(item: TabItem, index: number, props: TabsProps): TemplateResult
|
|
28
29
|
renderPanel(item: TabItem | null, props: TabsProps): TemplateResult | null
|
|
29
30
|
}
|
package/types/surfaces/card.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export interface CardProps {
|
|
|
31
31
|
|
|
32
32
|
export interface CardType {
|
|
33
33
|
render(props: CardProps): TemplateResult
|
|
34
|
+
renderCard(props: CardProps): TemplateResult
|
|
34
35
|
renderHeader(props: CardProps): TemplateResult | null
|
|
35
36
|
renderBody(props: CardProps): TemplateResult | null
|
|
36
37
|
renderFooter(props: CardProps): TemplateResult | null
|