@inglorious/ui 0.1.0 → 1.0.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/README.md +45 -0
- package/package.json +191 -16
- package/src/all.css +7 -0
- package/src/controls/button/button.stories.js +35 -15
- package/src/controls/button/index.js +1 -3
- package/src/controls/button/style.css +80 -37
- package/src/controls/button/template.js +23 -26
- package/src/controls/button-group/button-group.stories.js +19 -15
- package/src/controls/button-group/index.js +1 -2
- package/src/controls/button-group/style.css +0 -7
- package/src/controls/button-group/template.js +46 -56
- package/src/controls/checkbox/checkbox.stories.js +16 -13
- package/src/controls/checkbox/index.js +1 -2
- package/src/controls/checkbox/style.css +23 -2
- package/src/controls/checkbox/template.js +20 -18
- package/src/controls/combobox/combobox.stories.js +92 -0
- package/src/controls/{select → combobox}/handlers.js +8 -5
- package/src/controls/combobox/helpers.js +91 -0
- package/src/controls/combobox/index.js +43 -0
- package/src/controls/combobox/style.css +203 -0
- package/src/controls/combobox/template.js +340 -0
- package/src/controls/controls.css +12 -0
- package/src/controls/fab/fab.stories.js +11 -11
- package/src/controls/fab/index.js +1 -2
- package/src/controls/fab/template.js +21 -19
- package/src/controls/icon-button/icon-button.stories.js +8 -10
- package/src/controls/icon-button/index.js +1 -2
- package/src/controls/icon-button/template.js +13 -19
- package/src/controls/input/index.js +1 -2
- package/src/controls/input/input.stories.js +24 -23
- package/src/controls/input/style.css +9 -7
- package/src/controls/input/template.js +28 -31
- package/src/controls/radio-group/index.js +1 -2
- package/src/controls/radio-group/radio-group.stories.js +11 -8
- package/src/controls/radio-group/style.css +22 -1
- package/src/controls/radio-group/template.js +20 -15
- package/src/controls/rating/index.js +1 -2
- package/src/controls/rating/rating.stories.js +7 -10
- package/src/controls/rating/style.css +1 -2
- package/src/controls/rating/template.js +20 -17
- package/src/controls/select/helpers.js +2 -21
- package/src/controls/select/index.js +1 -13
- package/src/controls/select/select.stories.js +68 -64
- package/src/controls/select/style.css +66 -189
- package/src/controls/select/template.js +77 -406
- package/src/controls/slider/index.js +1 -2
- package/src/controls/slider/slider.stories.js +15 -12
- package/src/controls/slider/style.css +24 -3
- package/src/controls/slider/template.js +30 -23
- package/src/controls/switch/index.js +1 -2
- package/src/controls/switch/style.css +23 -2
- package/src/controls/switch/switch.stories.js +14 -11
- package/src/controls/switch/template.js +18 -16
- package/src/data-display/avatar/avatar.stories.js +106 -0
- package/src/data-display/avatar/index.js +3 -0
- package/src/data-display/avatar/style.css +64 -0
- package/src/data-display/avatar/template.js +81 -0
- package/src/data-display/badge/badge.stories.js +64 -0
- package/src/data-display/badge/index.js +3 -0
- package/src/data-display/badge/style.css +84 -0
- package/src/data-display/badge/template.js +46 -0
- package/src/data-display/chip/chip.stories.js +57 -0
- package/src/data-display/chip/index.js +3 -0
- package/src/data-display/chip/style.css +84 -0
- package/src/data-display/chip/template.js +32 -0
- package/src/data-display/data-display.css +11 -0
- package/src/data-display/data-grid/base.css +58 -0
- package/src/data-display/data-grid/data-grid.stories.js +158 -0
- package/src/data-display/data-grid/filters/helpers.js +8 -0
- package/src/data-display/data-grid/filters/index.js +21 -0
- package/src/data-display/data-grid/filters/input.js +24 -0
- package/src/data-display/data-grid/filters/range.js +48 -0
- package/src/data-display/data-grid/filters/select.js +17 -0
- package/src/data-display/data-grid/handlers.js +523 -0
- package/src/data-display/data-grid/helpers.js +248 -0
- package/src/data-display/data-grid/index.js +64 -0
- package/src/data-display/data-grid/style.css +14 -0
- package/src/data-display/data-grid/template.js +458 -0
- package/src/data-display/data-grid/theme.css +148 -0
- package/src/data-display/divider/divider.stories.js +48 -0
- package/src/data-display/divider/index.js +3 -0
- package/src/data-display/divider/style.css +18 -0
- package/src/data-display/divider/template.js +17 -0
- package/src/data-display/icon/icon-implementations.mdx +160 -0
- package/src/data-display/icon/icon-utf8.stories.js +156 -0
- package/src/data-display/icon/icon.stories.js +38 -0
- package/src/data-display/icon/index.js +3 -0
- package/src/data-display/icon/style.css +17 -0
- package/src/data-display/icon/template.js +19 -0
- package/src/data-display/list/handlers.js +25 -0
- package/src/data-display/list/index.js +4 -0
- package/src/data-display/list/list.stories.js +187 -0
- package/src/data-display/list/style.css +119 -0
- package/src/data-display/list/template.js +302 -0
- package/src/data-display/material-icon/index.js +3 -0
- package/src/data-display/material-icon/material-icon.stories.js +99 -0
- package/src/data-display/material-icon/style.css +27 -0
- package/src/data-display/material-icon/template.js +21 -0
- package/src/data-display/table/index.js +1 -0
- package/src/data-display/table/style.css +42 -0
- package/src/data-display/table/table.stories.js +40 -0
- package/src/data-display/table/template.js +114 -0
- package/src/data-display/tooltip/index.js +3 -0
- package/src/data-display/tooltip/style.css +57 -0
- package/src/data-display/tooltip/template.js +58 -0
- package/src/data-display/tooltip/tooltip.stories.js +44 -0
- package/src/data-display/typography/index.js +3 -0
- package/src/data-display/typography/style.css +49 -0
- package/src/data-display/typography/template.js +110 -0
- package/src/data-display/typography/typography.stories.js +48 -0
- package/src/data-display/virtual-list/handlers.js +68 -0
- package/src/data-display/virtual-list/index.js +4 -0
- package/src/data-display/virtual-list/template.js +101 -0
- package/src/examples/dashboard/app-drawer.js +255 -0
- package/src/examples/dashboard/app-header.js +149 -0
- package/src/examples/dashboard/dashboard.js +85 -0
- package/src/examples/dashboard/dashboard.stories.js +47 -0
- package/src/examples/dashboard/data.js +205 -0
- package/src/examples/dashboard/mode.js +27 -0
- package/src/examples/dashboard/primitive-content.js +1325 -0
- package/src/examples/dashboard/primitive-section.js +158 -0
- package/src/examples/dashboard/router.js +13 -0
- package/src/examples/dashboard/social-card.js +73 -0
- package/src/examples/dashboard/stat-card.js +84 -0
- package/src/examples/dashboard/style.css +339 -0
- package/src/examples/dashboard/theme-utils.js +95 -0
- package/src/examples/dashboard/theme.js +27 -0
- package/src/examples/dashboard/traffic-card.js +108 -0
- package/src/examples/dashboard/traffic-sales-card.js +267 -0
- package/src/feedback/alert/alert.stories.js +70 -0
- package/src/feedback/alert/index.js +3 -0
- package/src/feedback/alert/style.css +98 -0
- package/src/feedback/alert/template.js +74 -0
- package/src/feedback/backdrop/backdrop.stories.js +21 -0
- package/src/feedback/backdrop/index.js +3 -0
- package/src/feedback/backdrop/style.css +25 -0
- package/src/feedback/backdrop/template.js +31 -0
- package/src/feedback/dialog/dialog.stories.js +27 -0
- package/src/feedback/dialog/index.js +3 -0
- package/src/feedback/dialog/style.css +68 -0
- package/src/feedback/dialog/template.js +64 -0
- package/src/feedback/feedback.css +6 -0
- package/src/feedback/progress/index.js +3 -0
- package/src/feedback/progress/progress.stories.js +54 -0
- package/src/feedback/progress/style.css +95 -0
- package/src/feedback/progress/template.js +88 -0
- package/src/feedback/skeleton/index.js +3 -0
- package/src/feedback/skeleton/skeleton.stories.js +44 -0
- package/src/feedback/skeleton/style.css +41 -0
- package/src/feedback/skeleton/template.js +48 -0
- package/src/feedback/snackbar/index.js +3 -0
- package/src/feedback/snackbar/snackbar.stories.js +25 -0
- package/src/feedback/snackbar/style.css +64 -0
- package/src/feedback/snackbar/template.js +55 -0
- package/src/index.js +32 -1
- package/src/layout/container/container.stories.js +105 -0
- package/src/layout/container/index.js +3 -0
- package/src/layout/container/style.css +34 -0
- package/src/layout/container/template.js +119 -0
- package/src/layout/flex/flex.stories.js +28 -10
- package/src/layout/flex/index.js +1 -2
- package/src/layout/flex/style.css +20 -0
- package/src/layout/flex/template.js +40 -13
- package/src/layout/grid/grid.stories.js +46 -30
- package/src/layout/grid/index.js +1 -2
- package/src/layout/grid/style.css +20 -0
- package/src/layout/grid/template.js +100 -20
- package/src/layout/layout.css +3 -0
- package/src/navigation/bottom-navigation/bottom-navigation.stories.js +33 -0
- package/src/navigation/bottom-navigation/index.js +1 -0
- package/src/navigation/bottom-navigation/style.css +32 -0
- package/src/navigation/bottom-navigation/template.js +74 -0
- package/src/navigation/breadcrumbs/breadcrumbs.stories.js +33 -0
- package/src/navigation/breadcrumbs/index.js +1 -0
- package/src/navigation/breadcrumbs/style.css +27 -0
- package/src/navigation/breadcrumbs/template.js +79 -0
- package/src/navigation/drawer/drawer.stories.js +60 -0
- package/src/navigation/drawer/index.js +3 -0
- package/src/navigation/drawer/style.css +125 -0
- package/src/navigation/drawer/template.js +131 -0
- package/src/navigation/link/index.js +3 -0
- package/src/navigation/link/link.stories.js +53 -0
- package/src/navigation/link/style.css +40 -0
- package/src/navigation/link/template.js +53 -0
- package/src/navigation/menu/index.js +1 -0
- package/src/navigation/menu/menu.stories.js +36 -0
- package/src/navigation/menu/style.css +44 -0
- package/src/navigation/menu/template.js +81 -0
- package/src/navigation/navigation.css +9 -0
- package/src/navigation/pagination/index.js +1 -0
- package/src/navigation/pagination/pagination.stories.js +61 -0
- package/src/navigation/pagination/style.css +29 -0
- package/src/navigation/pagination/template.js +140 -0
- package/src/navigation/speed-dial/index.js +1 -0
- package/src/navigation/speed-dial/speed-dial.stories.js +40 -0
- package/src/navigation/speed-dial/style.css +38 -0
- package/src/navigation/speed-dial/template.js +68 -0
- package/src/navigation/stepper/index.js +1 -0
- package/src/navigation/stepper/stepper.stories.js +35 -0
- package/src/navigation/stepper/style.css +49 -0
- package/src/navigation/stepper/template.js +61 -0
- package/src/navigation/tabs/index.js +1 -0
- package/src/navigation/tabs/style.css +35 -0
- package/src/navigation/tabs/tabs.stories.js +40 -0
- package/src/navigation/tabs/template.js +79 -0
- package/src/overview.mdx +39 -0
- package/src/stories/notifyStory.js +22 -25
- package/src/styles/base.css +2 -0
- package/src/styles/reset.css +15 -0
- package/src/{themes → styles/themes}/bootstrap.css +2 -0
- package/src/{themes → styles/themes}/inglorious.css +9 -1
- package/src/{themes → styles/themes}/material.css +2 -0
- package/src/{tokens/index.css → styles/tokens.css} +9 -0
- package/src/surfaces/accordion/accordion.stories.js +60 -0
- package/src/surfaces/accordion/index.js +1 -0
- package/src/surfaces/accordion/style.css +64 -0
- package/src/surfaces/accordion/template.js +85 -0
- package/src/surfaces/app-bar/app-bar.stories.js +109 -0
- package/src/surfaces/app-bar/index.js +3 -0
- package/src/surfaces/app-bar/style.css +109 -0
- package/src/surfaces/app-bar/template.js +78 -0
- package/src/surfaces/card/card.stories.js +108 -0
- package/src/surfaces/card/index.js +1 -0
- package/src/surfaces/card/style.css +107 -0
- package/src/surfaces/card/template.js +163 -0
- package/src/surfaces/paper/index.js +3 -0
- package/src/surfaces/paper/paper.stories.js +97 -0
- package/src/surfaces/paper/style.css +73 -0
- package/src/surfaces/paper/template.js +76 -0
- package/src/surfaces/surfaces.css +4 -0
- package/types/controls/button-group.d.ts +8 -7
- package/types/controls/button.d.ts +10 -7
- package/types/controls/checkbox.d.ts +8 -6
- package/types/controls/combobox.d.ts +66 -0
- package/types/controls/fab.d.ts +6 -5
- package/types/controls/icon-button.d.ts +8 -7
- package/types/controls/input.d.ts +18 -11
- package/types/controls/radio-group.d.ts +7 -5
- package/types/controls/rating.d.ts +6 -5
- package/types/controls/select.d.ts +11 -34
- package/types/controls/slider.d.ts +8 -6
- package/types/controls/switch.d.ts +7 -5
- package/types/data-display/avatar.d.ts +30 -0
- package/types/data-display/badge.d.ts +20 -0
- package/types/data-display/chip.d.ts +25 -0
- package/types/data-display/data-grid.d.ts +151 -0
- package/types/data-display/divider.d.ts +14 -0
- package/types/data-display/icon.d.ts +16 -0
- package/types/data-display/list.d.ts +66 -0
- package/types/data-display/material-icon.d.ts +15 -0
- package/types/data-display/table.d.ts +45 -0
- package/types/data-display/tooltip.d.ts +20 -0
- package/types/data-display/typography.d.ts +28 -0
- package/types/data-display/virtual-list.d.ts +94 -0
- package/types/feedback/alert.d.ts +22 -0
- package/types/feedback/backdrop.d.ts +17 -0
- package/types/feedback/dialog.d.ts +21 -0
- package/types/feedback/progress.d.ts +18 -0
- package/types/feedback/skeleton.d.ts +18 -0
- package/types/feedback/snackbar.d.ts +19 -0
- package/types/index.d.ts +92 -14
- package/types/layout/container.d.ts +28 -0
- package/types/layout/flex.d.ts +16 -5
- package/types/layout/grid.d.ts +15 -4
- package/types/navigation/bottom-navigation.d.ts +33 -0
- package/types/navigation/breadcrumbs.d.ts +29 -0
- package/types/navigation/drawer.d.ts +23 -0
- package/types/navigation/link.d.ts +22 -0
- package/types/navigation/menu.d.ts +32 -0
- package/types/navigation/pagination.d.ts +50 -0
- package/types/navigation/speed-dial.d.ts +35 -0
- package/types/navigation/stepper.d.ts +26 -0
- package/types/navigation/tabs.d.ts +31 -0
- package/types/surfaces/accordion.d.ts +32 -0
- package/types/surfaces/app-bar.d.ts +25 -0
- package/types/surfaces/card.d.ts +39 -0
- package/types/surfaces/paper.d.ts +28 -0
- package/src/shared/withRenderValidation.js +0 -19
- package/src/widgets/card/card.stories.js +0 -135
- package/src/widgets/card/index.js +0 -4
- package/src/widgets/card/style.css +0 -53
- package/src/widgets/card/template.js +0 -97
- package/types/widgets/card.d.ts +0 -21
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export type ListItem =
|
|
4
|
+
| string
|
|
5
|
+
| number
|
|
6
|
+
| {
|
|
7
|
+
id?: string | number
|
|
8
|
+
label?: TemplateResult | string | number
|
|
9
|
+
primary?: TemplateResult | string | number
|
|
10
|
+
secondary?: TemplateResult | string | number
|
|
11
|
+
icon?: TemplateResult | string | number
|
|
12
|
+
action?: TemplateResult | string | number
|
|
13
|
+
isExpanded?: boolean
|
|
14
|
+
onToggle?: (item: ListItem, path: number[]) => void
|
|
15
|
+
isDisabled?: boolean
|
|
16
|
+
isSelected?: boolean
|
|
17
|
+
hasDivider?: boolean
|
|
18
|
+
onClick?: (item: ListItem, path: number[]) => void
|
|
19
|
+
children?: ListItem[] | TemplateResult | string | number
|
|
20
|
+
[key: string]: unknown
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ListProps {
|
|
24
|
+
id?: string
|
|
25
|
+
type?: string
|
|
26
|
+
items?: ListItem[]
|
|
27
|
+
children?: TemplateResult | string | number
|
|
28
|
+
isOrdered?: boolean
|
|
29
|
+
isDense?: boolean
|
|
30
|
+
isDivided?: boolean
|
|
31
|
+
isInset?: boolean
|
|
32
|
+
padding?: "none" | "sm" | "md" | "lg" | "xl"
|
|
33
|
+
path?: number[]
|
|
34
|
+
className?: string
|
|
35
|
+
onItemClick?: (item: ListItem, path: number[]) => void
|
|
36
|
+
onItemToggle?: (item: ListItem, path: number[]) => void
|
|
37
|
+
[key: string]: unknown
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ListType {
|
|
41
|
+
render(props: ListProps): TemplateResult
|
|
42
|
+
renderItem(
|
|
43
|
+
props: ListProps,
|
|
44
|
+
payload: {
|
|
45
|
+
item: ListItem
|
|
46
|
+
meta: {
|
|
47
|
+
id: string | number
|
|
48
|
+
primary: TemplateResult | string | number
|
|
49
|
+
secondary?: TemplateResult | string | number
|
|
50
|
+
icon?: TemplateResult | string | number
|
|
51
|
+
action?: TemplateResult | string | number
|
|
52
|
+
isExpanded?: boolean
|
|
53
|
+
onToggle?: (item: ListItem, path: number[]) => void
|
|
54
|
+
isDisabled?: boolean
|
|
55
|
+
isSelected?: boolean
|
|
56
|
+
hasDivider?: boolean
|
|
57
|
+
onClick?: (item: ListItem, path: number[]) => void
|
|
58
|
+
children?: ListItem[] | TemplateResult | string | number | null
|
|
59
|
+
}
|
|
60
|
+
index: number
|
|
61
|
+
path: number[]
|
|
62
|
+
},
|
|
63
|
+
): TemplateResult
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export declare const list: ListType
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface MaterialIconProps {
|
|
4
|
+
id?: string
|
|
5
|
+
name?: string
|
|
6
|
+
size?: "sm" | "md" | "lg"
|
|
7
|
+
isFilled?: boolean
|
|
8
|
+
[key: string]: unknown
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface MaterialIconType {
|
|
12
|
+
render(props: MaterialIconProps): TemplateResult
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export declare const materialIcon: MaterialIconType
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface TableColumn {
|
|
4
|
+
id: string
|
|
5
|
+
label?: string
|
|
6
|
+
title?: string
|
|
7
|
+
align?: "left" | "center" | "right"
|
|
8
|
+
[key: string]: unknown
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type TableRow = Record<string, unknown>
|
|
12
|
+
|
|
13
|
+
export interface TableProps {
|
|
14
|
+
id?: string
|
|
15
|
+
type?: string
|
|
16
|
+
columns?: TableColumn[]
|
|
17
|
+
rows?: TableRow[]
|
|
18
|
+
isFullWidth?: boolean
|
|
19
|
+
isStriped?: boolean
|
|
20
|
+
onRowClick?: (row: TableRow) => void
|
|
21
|
+
[key: string]: unknown
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface TableType {
|
|
25
|
+
render(props: TableProps): TemplateResult
|
|
26
|
+
renderHeaderCell(
|
|
27
|
+
props: TableProps,
|
|
28
|
+
payload: { column: TableColumn; index: number },
|
|
29
|
+
): TemplateResult
|
|
30
|
+
renderRow(
|
|
31
|
+
props: TableProps,
|
|
32
|
+
payload: { row: Record<string, unknown>; index: number },
|
|
33
|
+
): TemplateResult
|
|
34
|
+
renderCell(
|
|
35
|
+
props: TableProps,
|
|
36
|
+
payload: {
|
|
37
|
+
column: TableColumn
|
|
38
|
+
row: Record<string, unknown>
|
|
39
|
+
index: number
|
|
40
|
+
columnIndex: number
|
|
41
|
+
},
|
|
42
|
+
): TemplateResult
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export declare const table: TableType
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface TooltipProps {
|
|
4
|
+
id?: string
|
|
5
|
+
children?: TemplateResult | string | number
|
|
6
|
+
content?: TemplateResult | string | number
|
|
7
|
+
position?: "top" | "right" | "bottom" | "left"
|
|
8
|
+
size?: "sm" | "md" | "lg"
|
|
9
|
+
isOpen?: boolean
|
|
10
|
+
maxWidth?: string
|
|
11
|
+
className?: string
|
|
12
|
+
onClick: () => void
|
|
13
|
+
[key: string]: unknown
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface TooltipType {
|
|
17
|
+
render(props: TooltipProps): TemplateResult
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export declare const tooltip: TooltipType
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export type TypographyVariant =
|
|
4
|
+
| "body"
|
|
5
|
+
| "h1"
|
|
6
|
+
| "h2"
|
|
7
|
+
| "h3"
|
|
8
|
+
| "caption"
|
|
9
|
+
| "overline"
|
|
10
|
+
|
|
11
|
+
export interface TypographyProps {
|
|
12
|
+
id?: string
|
|
13
|
+
children?: TemplateResult | string | number
|
|
14
|
+
variant?: TypographyVariant
|
|
15
|
+
align?: "left" | "center" | "right"
|
|
16
|
+
weight?: string | number
|
|
17
|
+
color?: string
|
|
18
|
+
isNoWrap?: boolean
|
|
19
|
+
hasGutterBottom?: boolean
|
|
20
|
+
className?: string
|
|
21
|
+
[key: string]: unknown
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface TypographyType {
|
|
25
|
+
render(props: TypographyProps): TemplateResult
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export declare const typography: TypographyType
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { TemplateResult, Api } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a single item in the virtual list's data array.
|
|
5
|
+
* It's a generic record but should ideally have a unique `id`.
|
|
6
|
+
*/
|
|
7
|
+
export type VirtualListItem = Record<string, any> & { id: string | number }
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Represents the state of a virtualized list entity.
|
|
11
|
+
*/
|
|
12
|
+
export interface VirtualListEntity<
|
|
13
|
+
T extends VirtualListItem = VirtualListItem,
|
|
14
|
+
> {
|
|
15
|
+
/** A unique identifier for the list entity. */
|
|
16
|
+
id: string | number
|
|
17
|
+
|
|
18
|
+
/** The entity type, used to look up rendering logic. */
|
|
19
|
+
type: string
|
|
20
|
+
|
|
21
|
+
/** The full array of items for the list. */
|
|
22
|
+
items: T[]
|
|
23
|
+
|
|
24
|
+
/** The current scroll position from the top in pixels. */
|
|
25
|
+
scrollTop: number
|
|
26
|
+
|
|
27
|
+
/** The start and end indices of the currently visible items (including buffer). */
|
|
28
|
+
visibleRange: { start: number; end: number }
|
|
29
|
+
|
|
30
|
+
/** The height of the visible viewport in pixels. */
|
|
31
|
+
viewportHeight: number
|
|
32
|
+
|
|
33
|
+
/** The number of items to render outside the viewport (above and below). */
|
|
34
|
+
bufferSize: number
|
|
35
|
+
|
|
36
|
+
/** The measured height of a single item in pixels. Null until measured on mount. */
|
|
37
|
+
itemHeight: number | null
|
|
38
|
+
|
|
39
|
+
/** An estimated height for items used for calculations before they are measured. */
|
|
40
|
+
estimatedHeight: number
|
|
41
|
+
|
|
42
|
+
/** Any other custom properties. */
|
|
43
|
+
[key: string]: any
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The virtual list type implementation, combining logic and rendering.
|
|
48
|
+
*/
|
|
49
|
+
export interface VirtualListType {
|
|
50
|
+
/**
|
|
51
|
+
* Initializes the list entity with default state.
|
|
52
|
+
* @param entity The list entity to initialize.
|
|
53
|
+
*/
|
|
54
|
+
create(entity: VirtualListEntity): void
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Handles the scroll event to update the visible range of items.
|
|
58
|
+
* @param entity The list entity.
|
|
59
|
+
* @param containerEl The scrolling container element.
|
|
60
|
+
*/
|
|
61
|
+
scroll(entity: VirtualListEntity, containerEl: HTMLElement): void
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Mounts the list, measuring the first item to determine the `itemHeight`
|
|
65
|
+
* for accurate virtualization calculations.
|
|
66
|
+
* @param entity The list entity.
|
|
67
|
+
* @param containerEl The scrolling container element.
|
|
68
|
+
*/
|
|
69
|
+
mount(entity: VirtualListEntity, containerEl: HTMLElement): void
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Renders the virtualized list component.
|
|
73
|
+
* @param entity The list entity.
|
|
74
|
+
* @param api The store API.
|
|
75
|
+
*/
|
|
76
|
+
render(entity: VirtualListEntity, api: Api): TemplateResult
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Renders a single item in the list. This is a default implementation
|
|
80
|
+
* and is expected to be overridden by a specific list type.
|
|
81
|
+
* @param entity The list entity.
|
|
82
|
+
* @param payload The payload for rendering the item.
|
|
83
|
+
* @param payload.item The item data.
|
|
84
|
+
* @param payload.index The item's absolute index in the full list.
|
|
85
|
+
* @param api The API object.
|
|
86
|
+
*/
|
|
87
|
+
renderItem(
|
|
88
|
+
entity: VirtualListEntity,
|
|
89
|
+
payload: { item: VirtualListItem; index: number },
|
|
90
|
+
api: Api,
|
|
91
|
+
): TemplateResult
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export declare const virtualList: VirtualListType
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface AlertProps {
|
|
4
|
+
id?: string
|
|
5
|
+
type?: string
|
|
6
|
+
title?: TemplateResult | string | number
|
|
7
|
+
description?: TemplateResult | string | number
|
|
8
|
+
children?: TemplateResult | string | number
|
|
9
|
+
severity?: "info" | "success" | "warning" | "error"
|
|
10
|
+
variant?: "filled" | "outlined"
|
|
11
|
+
icon?: TemplateResult | string | number
|
|
12
|
+
action?: TemplateResult | string | number
|
|
13
|
+
onClose?: () => void
|
|
14
|
+
className?: string
|
|
15
|
+
[key: string]: unknown
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface AlertType {
|
|
19
|
+
render(props: AlertProps): TemplateResult
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export declare const alert: AlertType
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface BackdropProps {
|
|
4
|
+
id?: string
|
|
5
|
+
type?: string
|
|
6
|
+
isOpen?: boolean
|
|
7
|
+
className?: string
|
|
8
|
+
children?: TemplateResult | string | number
|
|
9
|
+
onClick?: () => void
|
|
10
|
+
[key: string]: unknown
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface BackdropType {
|
|
14
|
+
render(props: BackdropProps): TemplateResult | null
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare const backdrop: BackdropType
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface DialogProps {
|
|
4
|
+
id?: string
|
|
5
|
+
type?: string
|
|
6
|
+
isOpen?: boolean
|
|
7
|
+
title?: TemplateResult | string | number
|
|
8
|
+
description?: TemplateResult | string | number
|
|
9
|
+
children?: TemplateResult | string | number
|
|
10
|
+
actions?: TemplateResult | string | number
|
|
11
|
+
className?: string
|
|
12
|
+
onClose?: () => void
|
|
13
|
+
onBackdropClick?: () => void
|
|
14
|
+
[key: string]: unknown
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface DialogType {
|
|
18
|
+
render(props: DialogProps): TemplateResult | null
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export declare const dialog: DialogType
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface ProgressProps {
|
|
4
|
+
id?: string
|
|
5
|
+
type?: string
|
|
6
|
+
variant?: "linear" | "circular"
|
|
7
|
+
value?: number
|
|
8
|
+
size?: number
|
|
9
|
+
thickness?: number
|
|
10
|
+
className?: string
|
|
11
|
+
[key: string]: unknown
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ProgressType {
|
|
15
|
+
render(props: ProgressProps): TemplateResult
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export declare const progress: ProgressType
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface SkeletonProps {
|
|
4
|
+
id?: string
|
|
5
|
+
type?: string
|
|
6
|
+
variant?: "text" | "rect" | "circle"
|
|
7
|
+
width?: number | string
|
|
8
|
+
height?: number | string
|
|
9
|
+
lines?: number
|
|
10
|
+
className?: string
|
|
11
|
+
[key: string]: unknown
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface SkeletonType {
|
|
15
|
+
render(props: SkeletonProps): TemplateResult
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export declare const skeleton: SkeletonType
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface SnackbarProps {
|
|
4
|
+
id?: string
|
|
5
|
+
type?: string
|
|
6
|
+
isOpen?: boolean
|
|
7
|
+
message?: TemplateResult | string | number
|
|
8
|
+
action?: TemplateResult | string | number
|
|
9
|
+
position?: "bottom-left" | "bottom-right" | "top-left" | "top-right"
|
|
10
|
+
className?: string
|
|
11
|
+
onClose?: () => void
|
|
12
|
+
[key: string]: unknown
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface SnackbarType {
|
|
16
|
+
render(props: SnackbarProps): TemplateResult | null
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare const snackbar: SnackbarType
|
package/types/index.d.ts
CHANGED
|
@@ -1,14 +1,92 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type {
|
|
3
|
-
export type {
|
|
4
|
-
export type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export type {
|
|
10
|
-
export type {
|
|
11
|
-
export type {
|
|
12
|
-
export type {
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
export type { ButtonProps, ButtonType } from "./controls/button"
|
|
2
|
+
export type { ButtonGroupProps, ButtonGroupType } from "./controls/button-group"
|
|
3
|
+
export type { CheckboxProps, CheckboxType } from "./controls/checkbox"
|
|
4
|
+
export type {
|
|
5
|
+
ComboboxProps,
|
|
6
|
+
ComboboxType,
|
|
7
|
+
ComboboxOption,
|
|
8
|
+
} from "./controls/combobox"
|
|
9
|
+
export type { FabProps, FabType } from "./controls/fab"
|
|
10
|
+
export type { IconButtonProps, IconButtonType } from "./controls/icon-button"
|
|
11
|
+
export type { InputProps, InputType } from "./controls/input"
|
|
12
|
+
export type {
|
|
13
|
+
RadioGroupProps,
|
|
14
|
+
RadioGroupType,
|
|
15
|
+
RadioOption,
|
|
16
|
+
} from "./controls/radio-group"
|
|
17
|
+
export type { RatingProps, RatingType } from "./controls/rating"
|
|
18
|
+
export type { SelectProps, SelectType, SelectOption } from "./controls/select"
|
|
19
|
+
export type { SliderProps, SliderType } from "./controls/slider"
|
|
20
|
+
export type { SwitchProps, SwitchType } from "./controls/switch"
|
|
21
|
+
export type { ContainerProps, ContainerType } from "./layout/container"
|
|
22
|
+
export type { FlexProps, FlexType } from "./layout/flex"
|
|
23
|
+
export type { GridProps, GridType } from "./layout/grid"
|
|
24
|
+
export type {
|
|
25
|
+
BottomNavigationProps,
|
|
26
|
+
BottomNavigationType,
|
|
27
|
+
BottomNavigationAction,
|
|
28
|
+
} from "./navigation/bottom-navigation"
|
|
29
|
+
export type {
|
|
30
|
+
BreadcrumbsProps,
|
|
31
|
+
BreadcrumbsType,
|
|
32
|
+
BreadcrumbItem,
|
|
33
|
+
} from "./navigation/breadcrumbs"
|
|
34
|
+
export type { DrawerProps, DrawerType } from "./navigation/drawer"
|
|
35
|
+
export type { LinkProps, LinkType } from "./navigation/link"
|
|
36
|
+
export type { MenuProps, MenuType, MenuItem } from "./navigation/menu"
|
|
37
|
+
export type { PaginationProps, PaginationType } from "./navigation/pagination"
|
|
38
|
+
export type {
|
|
39
|
+
SpeedDialProps,
|
|
40
|
+
SpeedDialType,
|
|
41
|
+
SpeedDialAction,
|
|
42
|
+
} from "./navigation/speed-dial"
|
|
43
|
+
export type { StepperProps, StepperType, Step } from "./navigation/stepper"
|
|
44
|
+
export type { TabsProps, TabsType, TabItem } from "./navigation/tabs"
|
|
45
|
+
export type {
|
|
46
|
+
AccordionProps,
|
|
47
|
+
AccordionType,
|
|
48
|
+
AccordionItem,
|
|
49
|
+
} from "./surfaces/accordion"
|
|
50
|
+
export type { AppBarProps, AppBarType } from "./surfaces/app-bar"
|
|
51
|
+
export type { CardProps, CardType } from "./surfaces/card"
|
|
52
|
+
export type { PaperProps, PaperType } from "./surfaces/paper"
|
|
53
|
+
export type { AvatarProps, AvatarType } from "./data-display/avatar"
|
|
54
|
+
export type { BadgeProps, BadgeType } from "./data-display/badge"
|
|
55
|
+
export type { ChipProps, ChipType } from "./data-display/chip"
|
|
56
|
+
export type {
|
|
57
|
+
DataGridProps,
|
|
58
|
+
DataGridType,
|
|
59
|
+
Column,
|
|
60
|
+
Row,
|
|
61
|
+
DataGridVirtualization,
|
|
62
|
+
} from "./data-display/data-grid"
|
|
63
|
+
export type { DividerProps, DividerType } from "./data-display/divider"
|
|
64
|
+
export type { IconProps, IconType } from "./data-display/icon"
|
|
65
|
+
export type { ListProps, ListType, ListItem } from "./data-display/list"
|
|
66
|
+
export type {
|
|
67
|
+
VirtualListEntity,
|
|
68
|
+
VirtualListItem,
|
|
69
|
+
VirtualListType,
|
|
70
|
+
} from "./data-display/virtual-list"
|
|
71
|
+
export type {
|
|
72
|
+
MaterialIconProps,
|
|
73
|
+
MaterialIconType,
|
|
74
|
+
} from "./data-display/material-icon"
|
|
75
|
+
export type {
|
|
76
|
+
TableProps,
|
|
77
|
+
TableType,
|
|
78
|
+
TableColumn,
|
|
79
|
+
TableRow,
|
|
80
|
+
} from "./data-display/table"
|
|
81
|
+
export type { TooltipProps, TooltipType } from "./data-display/tooltip"
|
|
82
|
+
export type {
|
|
83
|
+
TypographyProps,
|
|
84
|
+
TypographyType,
|
|
85
|
+
TypographyVariant,
|
|
86
|
+
} from "./data-display/typography"
|
|
87
|
+
export type { AlertProps, AlertType } from "./feedback/alert"
|
|
88
|
+
export type { BackdropProps, BackdropType } from "./feedback/backdrop"
|
|
89
|
+
export type { DialogProps, DialogType } from "./feedback/dialog"
|
|
90
|
+
export type { ProgressProps, ProgressType } from "./feedback/progress"
|
|
91
|
+
export type { SkeletonProps, SkeletonType } from "./feedback/skeleton"
|
|
92
|
+
export type { SnackbarProps, SnackbarType } from "./feedback/snackbar"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface ContainerProps {
|
|
4
|
+
id?: string
|
|
5
|
+
type?: string
|
|
6
|
+
element?:
|
|
7
|
+
| "div"
|
|
8
|
+
| "section"
|
|
9
|
+
| "main"
|
|
10
|
+
| "header"
|
|
11
|
+
| "footer"
|
|
12
|
+
| "nav"
|
|
13
|
+
| "aside"
|
|
14
|
+
| "article"
|
|
15
|
+
children?: TemplateResult | string | number
|
|
16
|
+
maxWidth?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | false | number | string
|
|
17
|
+
isFixed?: boolean
|
|
18
|
+
padding?: "none" | "sm" | "md" | "lg" | "xl"
|
|
19
|
+
isCentered?: boolean
|
|
20
|
+
className?: string
|
|
21
|
+
[key: string]: unknown
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ContainerType {
|
|
25
|
+
render(props: ContainerProps): TemplateResult
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export declare const container: ContainerType
|
package/types/layout/flex.d.ts
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
import type { TemplateResult
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
2
|
|
|
3
|
-
export interface
|
|
3
|
+
export interface FlexProps {
|
|
4
4
|
id?: string
|
|
5
5
|
type?: string
|
|
6
|
+
element?:
|
|
7
|
+
| "div"
|
|
8
|
+
| "section"
|
|
9
|
+
| "main"
|
|
10
|
+
| "header"
|
|
11
|
+
| "footer"
|
|
12
|
+
| "nav"
|
|
13
|
+
| "aside"
|
|
14
|
+
| "article"
|
|
6
15
|
direction?: "row" | "column" | "row-reverse" | "column-reverse"
|
|
7
16
|
wrap?: "nowrap" | "wrap" | "wrap-reverse"
|
|
8
17
|
justify?: "start" | "center" | "end" | "between" | "around" | "evenly"
|
|
9
18
|
align?: "stretch" | "start" | "center" | "end" | "baseline"
|
|
10
19
|
gap?: "none" | "sm" | "md" | "lg" | "xl"
|
|
11
|
-
|
|
12
|
-
|
|
20
|
+
padding?: "none" | "sm" | "md" | "lg" | "xl"
|
|
21
|
+
isInline?: boolean
|
|
22
|
+
isFullWidth?: boolean
|
|
13
23
|
children?: Array<TemplateResult | string | number>
|
|
24
|
+
onClick?: () => void
|
|
14
25
|
}
|
|
15
26
|
|
|
16
27
|
export interface FlexType {
|
|
17
|
-
render(
|
|
28
|
+
render(props: FlexProps): TemplateResult
|
|
18
29
|
}
|
|
19
30
|
|
|
20
31
|
export declare const flex: FlexType
|
package/types/layout/grid.d.ts
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
import type { TemplateResult
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
2
|
|
|
3
|
-
export interface
|
|
3
|
+
export interface GridProps {
|
|
4
4
|
id?: string
|
|
5
5
|
type?: string
|
|
6
|
+
element?:
|
|
7
|
+
| "div"
|
|
8
|
+
| "section"
|
|
9
|
+
| "main"
|
|
10
|
+
| "header"
|
|
11
|
+
| "footer"
|
|
12
|
+
| "nav"
|
|
13
|
+
| "aside"
|
|
14
|
+
| "article"
|
|
6
15
|
columns?: number
|
|
7
16
|
minColumnWidth?: string
|
|
8
17
|
gap?: "none" | "sm" | "md" | "lg" | "xl"
|
|
18
|
+
padding?: "none" | "sm" | "md" | "lg" | "xl"
|
|
9
19
|
align?: "stretch" | "start" | "center" | "end"
|
|
10
20
|
justify?: "stretch" | "start" | "center" | "end"
|
|
11
|
-
|
|
21
|
+
isFullWidth?: boolean
|
|
12
22
|
children?: Array<TemplateResult | string | number>
|
|
23
|
+
onClick?: () => void
|
|
13
24
|
}
|
|
14
25
|
|
|
15
26
|
export interface GridType {
|
|
16
|
-
render(
|
|
27
|
+
render(props: GridProps): TemplateResult
|
|
17
28
|
}
|
|
18
29
|
|
|
19
30
|
export declare const grid: GridType
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface BottomNavigationAction {
|
|
4
|
+
id?: string | number
|
|
5
|
+
value?: string | number
|
|
6
|
+
label: TemplateResult | string | number
|
|
7
|
+
icon?: TemplateResult | string | number
|
|
8
|
+
isDisabled?: boolean
|
|
9
|
+
onClick?: (value: string | number) => void
|
|
10
|
+
[key: string]: unknown
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface BottomNavigationProps {
|
|
14
|
+
id?: string
|
|
15
|
+
type?: string
|
|
16
|
+
actions?: BottomNavigationAction[]
|
|
17
|
+
value?: string | number
|
|
18
|
+
hasLabels?: boolean
|
|
19
|
+
className?: string
|
|
20
|
+
onChange?: (value: string | number) => void
|
|
21
|
+
[key: string]: unknown
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface BottomNavigationType {
|
|
25
|
+
render(props: BottomNavigationProps): TemplateResult
|
|
26
|
+
renderAction(
|
|
27
|
+
action: BottomNavigationAction,
|
|
28
|
+
index: number,
|
|
29
|
+
props: BottomNavigationProps,
|
|
30
|
+
): TemplateResult
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export declare const bottomNavigation: BottomNavigationType
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface BreadcrumbItem {
|
|
4
|
+
id?: string | number
|
|
5
|
+
label: TemplateResult | string | number
|
|
6
|
+
href?: string
|
|
7
|
+
onClick?: () => void
|
|
8
|
+
[key: string]: unknown
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface BreadcrumbsProps {
|
|
12
|
+
id?: string
|
|
13
|
+
type?: string
|
|
14
|
+
items: BreadcrumbItem[]
|
|
15
|
+
separator?: TemplateResult | string | number
|
|
16
|
+
className?: string
|
|
17
|
+
[key: string]: unknown
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface BreadcrumbsType {
|
|
21
|
+
render(props: BreadcrumbsProps): TemplateResult
|
|
22
|
+
renderItem(
|
|
23
|
+
item: BreadcrumbItem,
|
|
24
|
+
index: number,
|
|
25
|
+
props: BreadcrumbsProps,
|
|
26
|
+
): TemplateResult
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export declare const breadcrumbs: BreadcrumbsType
|