@inglorious/ui 0.1.0 → 1.0.1
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 +190 -15
- 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,23 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface DrawerProps {
|
|
4
|
+
id?: string
|
|
5
|
+
type?: string
|
|
6
|
+
isOpen?: boolean
|
|
7
|
+
anchor?: "left" | "right" | "top" | "bottom"
|
|
8
|
+
variant?: "temporary" | "persistent" | "permanent" | "responsive"
|
|
9
|
+
breakpoint?: "sm" | "md" | "lg" | "xl"
|
|
10
|
+
isCollapsed?: boolean
|
|
11
|
+
title?: TemplateResult | string | number
|
|
12
|
+
children?: TemplateResult | string | number
|
|
13
|
+
hasBackdrop?: boolean
|
|
14
|
+
className?: string
|
|
15
|
+
onClose?: () => void
|
|
16
|
+
[key: string]: unknown
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface DrawerType {
|
|
20
|
+
render(props: DrawerProps): TemplateResult | null
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare const drawer: DrawerType
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface LinkProps {
|
|
4
|
+
id?: string
|
|
5
|
+
type?: string
|
|
6
|
+
href?: string
|
|
7
|
+
label?: TemplateResult | string | number
|
|
8
|
+
children?: TemplateResult | string | number
|
|
9
|
+
underline?: "always" | "hover" | "none"
|
|
10
|
+
color?: "primary" | "secondary" | "inherit"
|
|
11
|
+
isMuted?: boolean
|
|
12
|
+
isExternal?: boolean
|
|
13
|
+
className?: string
|
|
14
|
+
onClick?: () => void
|
|
15
|
+
[key: string]: unknown
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface LinkType {
|
|
19
|
+
render(props: LinkProps): TemplateResult
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export declare const link: LinkType
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface MenuItem {
|
|
4
|
+
id?: string | number
|
|
5
|
+
value?: string | number
|
|
6
|
+
label?: TemplateResult | string | number
|
|
7
|
+
icon?: TemplateResult | string | number
|
|
8
|
+
trailing?: TemplateResult | string | number
|
|
9
|
+
hasDivider?: boolean
|
|
10
|
+
isDisabled?: boolean
|
|
11
|
+
isSelected?: boolean
|
|
12
|
+
onClick?: (value: string | number) => void
|
|
13
|
+
[key: string]: unknown
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface MenuProps {
|
|
17
|
+
id?: string
|
|
18
|
+
type?: string
|
|
19
|
+
isOpen?: boolean
|
|
20
|
+
items?: MenuItem[]
|
|
21
|
+
isDense?: boolean
|
|
22
|
+
className?: string
|
|
23
|
+
onItemClick?: (value: string | number, item: MenuItem) => void
|
|
24
|
+
[key: string]: unknown
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface MenuType {
|
|
28
|
+
render(props: MenuProps): TemplateResult | null
|
|
29
|
+
renderItem(item: MenuItem, index: number, props: MenuProps): TemplateResult
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export declare const menu: MenuType
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface PaginationProps {
|
|
4
|
+
id?: string
|
|
5
|
+
type?: string
|
|
6
|
+
page?: number
|
|
7
|
+
count?: number
|
|
8
|
+
siblingCount?: number
|
|
9
|
+
isFirstButtonVisible?: boolean
|
|
10
|
+
isLastButtonVisible?: boolean
|
|
11
|
+
isDisabled?: boolean
|
|
12
|
+
buttonVariant?: "default" | "outline" | "ghost"
|
|
13
|
+
buttonColor?:
|
|
14
|
+
| "primary"
|
|
15
|
+
| "secondary"
|
|
16
|
+
| "success"
|
|
17
|
+
| "warning"
|
|
18
|
+
| "error"
|
|
19
|
+
| "info"
|
|
20
|
+
buttonSize?: "sm" | "md" | "lg"
|
|
21
|
+
itemClassName?: string
|
|
22
|
+
className?: string
|
|
23
|
+
onChange?: (page: number) => void
|
|
24
|
+
[key: string]: unknown
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface PaginationItemRenderProps {
|
|
28
|
+
item: number | string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface PaginationControlRenderProps {
|
|
32
|
+
label: string
|
|
33
|
+
target: number
|
|
34
|
+
isDisabled?: boolean
|
|
35
|
+
onChange?: (page: number) => void
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface PaginationType {
|
|
39
|
+
render(props: PaginationProps): TemplateResult
|
|
40
|
+
renderItem(
|
|
41
|
+
props: PaginationProps,
|
|
42
|
+
payload: PaginationItemRenderProps,
|
|
43
|
+
): TemplateResult
|
|
44
|
+
renderControl(
|
|
45
|
+
props: PaginationProps,
|
|
46
|
+
payload: PaginationControlRenderProps,
|
|
47
|
+
): TemplateResult
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export declare const pagination: PaginationType
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface SpeedDialAction {
|
|
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 SpeedDialProps {
|
|
14
|
+
id?: string
|
|
15
|
+
type?: string
|
|
16
|
+
isOpen?: boolean
|
|
17
|
+
icon?: TemplateResult | string | number
|
|
18
|
+
ariaLabel?: string
|
|
19
|
+
direction?: "up" | "down" | "left" | "right"
|
|
20
|
+
actions?: SpeedDialAction[]
|
|
21
|
+
onToggle?: (isOpen: boolean) => void
|
|
22
|
+
onAction?: (value: string | number, action: SpeedDialAction) => void
|
|
23
|
+
[key: string]: unknown
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface SpeedDialType {
|
|
27
|
+
render(props: SpeedDialProps): TemplateResult
|
|
28
|
+
renderAction(
|
|
29
|
+
action: SpeedDialAction,
|
|
30
|
+
index: number,
|
|
31
|
+
props: SpeedDialProps,
|
|
32
|
+
): TemplateResult
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export declare const speedDial: SpeedDialType
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface Step {
|
|
4
|
+
id?: string | number
|
|
5
|
+
label: TemplateResult | string | number
|
|
6
|
+
optional?: TemplateResult | string | number
|
|
7
|
+
isCompleted?: boolean
|
|
8
|
+
[key: string]: unknown
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface StepperProps {
|
|
12
|
+
id?: string
|
|
13
|
+
type?: string
|
|
14
|
+
steps?: Step[]
|
|
15
|
+
activeStep?: number
|
|
16
|
+
orientation?: "horizontal" | "vertical"
|
|
17
|
+
isAlternativeLabel?: boolean
|
|
18
|
+
[key: string]: unknown
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface StepperType {
|
|
22
|
+
render(props: StepperProps): TemplateResult
|
|
23
|
+
renderStep(step: Step, index: number, props: StepperProps): TemplateResult
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export declare const stepper: StepperType
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface TabItem {
|
|
4
|
+
id?: string | number
|
|
5
|
+
value?: string | number
|
|
6
|
+
label: TemplateResult | string | number
|
|
7
|
+
icon?: TemplateResult | string | number
|
|
8
|
+
panel?: TemplateResult | string | number
|
|
9
|
+
isDisabled?: boolean
|
|
10
|
+
onClick?: (value: string | number) => void
|
|
11
|
+
[key: string]: unknown
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TabsProps {
|
|
15
|
+
id?: string
|
|
16
|
+
type?: string
|
|
17
|
+
items?: TabItem[]
|
|
18
|
+
value?: string | number
|
|
19
|
+
isCentered?: boolean
|
|
20
|
+
isFullWidth?: boolean
|
|
21
|
+
onChange?: (value: string | number) => void
|
|
22
|
+
[key: string]: unknown
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface TabsType {
|
|
26
|
+
render(props: TabsProps): TemplateResult
|
|
27
|
+
renderTab(item: TabItem, index: number, props: TabsProps): TemplateResult
|
|
28
|
+
renderPanel(item: TabItem | null, props: TabsProps): TemplateResult | null
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare const tabs: TabsType
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface AccordionItem {
|
|
4
|
+
id?: string | number
|
|
5
|
+
title: TemplateResult | string | number
|
|
6
|
+
content?: TemplateResult | string | number
|
|
7
|
+
icon?: TemplateResult | string | number
|
|
8
|
+
isExpanded?: boolean
|
|
9
|
+
isDisabled?: boolean
|
|
10
|
+
onToggle?: (item: AccordionItem, index: number, expanded: boolean) => void
|
|
11
|
+
[key: string]: unknown
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AccordionProps {
|
|
15
|
+
id?: string
|
|
16
|
+
type?: string
|
|
17
|
+
className?: string
|
|
18
|
+
items?: AccordionItem[]
|
|
19
|
+
onItemToggle?: (item: AccordionItem, index: number, expanded: boolean) => void
|
|
20
|
+
[key: string]: unknown
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface AccordionType {
|
|
24
|
+
render(props: AccordionProps): TemplateResult
|
|
25
|
+
renderItem(
|
|
26
|
+
item: AccordionItem,
|
|
27
|
+
index: number,
|
|
28
|
+
props: AccordionProps,
|
|
29
|
+
): TemplateResult
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export declare const accordion: AccordionType
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface AppBarProps {
|
|
4
|
+
id?: string
|
|
5
|
+
type?: string
|
|
6
|
+
title?: TemplateResult | string | number
|
|
7
|
+
subtitle?: TemplateResult | string | number
|
|
8
|
+
leading?: TemplateResult | string | number
|
|
9
|
+
trailing?: TemplateResult | string | number
|
|
10
|
+
children?: TemplateResult | string | number
|
|
11
|
+
isDense?: boolean
|
|
12
|
+
variant?: "regular" | "dense" | "prominent"
|
|
13
|
+
color?: "default" | "primary" | "secondary" | "transparent" | "inherit"
|
|
14
|
+
isElevated?: boolean
|
|
15
|
+
position?: "static" | "sticky" | "fixed" | "absolute" | "relative"
|
|
16
|
+
placement?: "top" | "bottom"
|
|
17
|
+
className?: string
|
|
18
|
+
[key: string]: unknown
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface AppBarType {
|
|
22
|
+
render(props: AppBarProps): TemplateResult
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export declare const appBar: AppBarType
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface CardProps {
|
|
4
|
+
id?: string
|
|
5
|
+
type?: string
|
|
6
|
+
element?:
|
|
7
|
+
| "article"
|
|
8
|
+
| "section"
|
|
9
|
+
| "div"
|
|
10
|
+
| "main"
|
|
11
|
+
| "header"
|
|
12
|
+
| "footer"
|
|
13
|
+
| "nav"
|
|
14
|
+
| "aside"
|
|
15
|
+
title?: TemplateResult | string | number
|
|
16
|
+
subtitle?: TemplateResult | string | number
|
|
17
|
+
header?: TemplateResult | string | number
|
|
18
|
+
body?: TemplateResult | string | number
|
|
19
|
+
children?: TemplateResult | string | number
|
|
20
|
+
footer?: TemplateResult | string | number
|
|
21
|
+
headerPadding?: "none" | "sm" | "md" | "lg" | "xl"
|
|
22
|
+
bodyPadding?: "none" | "sm" | "md" | "lg" | "xl"
|
|
23
|
+
footerPadding?: "none" | "sm" | "md" | "lg" | "xl"
|
|
24
|
+
isHoverable?: boolean
|
|
25
|
+
isClickable?: boolean
|
|
26
|
+
isFullWidth?: boolean
|
|
27
|
+
className?: string
|
|
28
|
+
onClick?: () => void
|
|
29
|
+
[key: string]: unknown
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface CardType {
|
|
33
|
+
render(props: CardProps): TemplateResult
|
|
34
|
+
renderHeader(props: CardProps): TemplateResult | null
|
|
35
|
+
renderBody(props: CardProps): TemplateResult | null
|
|
36
|
+
renderFooter(props: CardProps): TemplateResult | null
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export declare const card: CardType
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TemplateResult } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
export interface PaperProps {
|
|
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
|
+
variant?: "elevated" | "outlined"
|
|
17
|
+
elevation?: number
|
|
18
|
+
padding?: "none" | "sm" | "md" | "lg"
|
|
19
|
+
radius?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full"
|
|
20
|
+
className?: string
|
|
21
|
+
[key: string]: unknown
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface PaperType {
|
|
25
|
+
render(props: PaperProps): TemplateResult
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export declare const paper: PaperType
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export function withRenderValidation(type) {
|
|
2
|
-
if (typeof type.render !== "function") {
|
|
3
|
-
throw new TypeError(
|
|
4
|
-
"withRenderValidation(type): type.render must be a function",
|
|
5
|
-
)
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
...type,
|
|
10
|
-
|
|
11
|
-
render(entity, api) {
|
|
12
|
-
if (entity == null || api == null) {
|
|
13
|
-
throw new TypeError("render(entity, api): both arguments are required")
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return type.render(entity, api)
|
|
17
|
-
},
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { html } from "@inglorious/web"
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
makeStoryRender,
|
|
5
|
-
notifyActionArgType,
|
|
6
|
-
} from "../../stories/notifyStory.js"
|
|
7
|
-
import { card } from "."
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: "Widgets/Card",
|
|
11
|
-
tags: ["autodocs"],
|
|
12
|
-
render: makeStoryRender(card, "story-card"),
|
|
13
|
-
argTypes: {
|
|
14
|
-
...notifyActionArgType,
|
|
15
|
-
title: {
|
|
16
|
-
control: "text",
|
|
17
|
-
description: "Primary header text.",
|
|
18
|
-
},
|
|
19
|
-
subtitle: {
|
|
20
|
-
control: "text",
|
|
21
|
-
description: "Secondary header text.",
|
|
22
|
-
},
|
|
23
|
-
hoverable: {
|
|
24
|
-
control: "boolean",
|
|
25
|
-
description: "Enables hover visual feedback.",
|
|
26
|
-
},
|
|
27
|
-
clickable: {
|
|
28
|
-
control: "boolean",
|
|
29
|
-
description: "Marks the card as interactive and emits click events.",
|
|
30
|
-
},
|
|
31
|
-
fullWidth: {
|
|
32
|
-
control: "boolean",
|
|
33
|
-
description: "Expands card width to 100% of its container.",
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
parameters: {
|
|
37
|
-
docs: {
|
|
38
|
-
description: {
|
|
39
|
-
component:
|
|
40
|
-
"Container widget with overridable header/body/footer sub-renderers.",
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
actions: {
|
|
44
|
-
handles: ["click"],
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
}
|
|
48
|
-
export const Default = {}
|
|
49
|
-
Default.args = {
|
|
50
|
-
title: "Card Title",
|
|
51
|
-
subtitle: "This is a card subtitle",
|
|
52
|
-
hoverable: false,
|
|
53
|
-
clickable: false,
|
|
54
|
-
fullWidth: false,
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export const Hoverable = {}
|
|
58
|
-
Hoverable.args = {
|
|
59
|
-
...Default.args,
|
|
60
|
-
hoverable: true,
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export const Clickable = {}
|
|
64
|
-
Clickable.args = {
|
|
65
|
-
...Default.args,
|
|
66
|
-
hoverable: true,
|
|
67
|
-
clickable: true,
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const cardWithFooter = [
|
|
71
|
-
...card,
|
|
72
|
-
{
|
|
73
|
-
renderFooter(entity, api) {
|
|
74
|
-
return html`<div
|
|
75
|
-
class="iw-card-footer"
|
|
76
|
-
style="display: flex; gap: 0.5rem;"
|
|
77
|
-
>
|
|
78
|
-
${entity.footerActions?.map(
|
|
79
|
-
(action) =>
|
|
80
|
-
html`<button
|
|
81
|
-
class="iw-button iw-button-sm ${action.variant === "ghost"
|
|
82
|
-
? "iw-button-ghost"
|
|
83
|
-
: ""}"
|
|
84
|
-
@click=${() => api.notify(`#${entity.id}:${action.event}`)}
|
|
85
|
-
>
|
|
86
|
-
${action.label}
|
|
87
|
-
</button>`,
|
|
88
|
-
)}
|
|
89
|
-
</div>`
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
]
|
|
93
|
-
|
|
94
|
-
export const WithFooter = {}
|
|
95
|
-
WithFooter.render = makeStoryRender(cardWithFooter, "card-footer", {
|
|
96
|
-
resolveByEntityType: true,
|
|
97
|
-
})
|
|
98
|
-
WithFooter.args = {
|
|
99
|
-
type: "cardWithFooter",
|
|
100
|
-
title: "Card with Footer",
|
|
101
|
-
subtitle: "This card has a footer section",
|
|
102
|
-
footerActions: [
|
|
103
|
-
{ label: "Cancel", event: "cancel", variant: "ghost" },
|
|
104
|
-
{ label: "Save", event: "save" },
|
|
105
|
-
],
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export const NoHeader = {}
|
|
109
|
-
NoHeader.args = {
|
|
110
|
-
title: null,
|
|
111
|
-
subtitle: null,
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export const FullWidth = {}
|
|
115
|
-
FullWidth.args = {
|
|
116
|
-
...Default.args,
|
|
117
|
-
fullWidth: true,
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export const Interactive = {}
|
|
121
|
-
Interactive.render = makeStoryRender(cardWithFooter, "card-interactive", {
|
|
122
|
-
resolveByEntityType: true,
|
|
123
|
-
})
|
|
124
|
-
Interactive.args = {
|
|
125
|
-
type: "cardWithFooter",
|
|
126
|
-
title: "Interactive Card",
|
|
127
|
-
subtitle: "Hover, click, and trigger footer actions",
|
|
128
|
-
hoverable: true,
|
|
129
|
-
clickable: true,
|
|
130
|
-
fullWidth: false,
|
|
131
|
-
footerActions: [
|
|
132
|
-
{ label: "Details", event: "details", variant: "ghost" },
|
|
133
|
-
{ label: "Open", event: "open" },
|
|
134
|
-
],
|
|
135
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
.iw-card {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
background-color: var(--iw-card-bg);
|
|
5
|
-
border: 1px solid var(--iw-card-border);
|
|
6
|
-
border-radius: var(--iw-card-radius);
|
|
7
|
-
box-shadow: var(--iw-card-shadow);
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
transition: all var(--iw-transition-normal);
|
|
10
|
-
|
|
11
|
-
&.iw-card-hoverable:hover {
|
|
12
|
-
box-shadow: var(--iw-card-shadow-hover);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&.iw-card-clickable {
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&.iw-card-full-width {
|
|
20
|
-
width: 100%;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.iw-card-header {
|
|
24
|
-
padding: var(--iw-space-4);
|
|
25
|
-
border-bottom: 1px solid var(--iw-color-border);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.iw-card-title {
|
|
29
|
-
margin: 0;
|
|
30
|
-
font-size: var(--iw-font-size-lg);
|
|
31
|
-
font-weight: var(--iw-font-weight-semibold);
|
|
32
|
-
color: var(--iw-color-text);
|
|
33
|
-
line-height: var(--iw-line-height-tight);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.iw-card-subtitle {
|
|
37
|
-
margin: var(--iw-space-1) 0 0;
|
|
38
|
-
font-size: var(--iw-font-size-sm);
|
|
39
|
-
color: var(--iw-color-text-secondary);
|
|
40
|
-
line-height: var(--iw-line-height-normal);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.iw-card-body {
|
|
44
|
-
padding: var(--iw-space-4);
|
|
45
|
-
flex: 1;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.iw-card-footer {
|
|
49
|
-
padding: var(--iw-space-4);
|
|
50
|
-
border-top: 1px solid var(--iw-color-border);
|
|
51
|
-
background-color: var(--iw-color-bg-secondary);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../../../types/widgets/card').CardEntity} CardEntity
|
|
3
|
-
* @typedef {import('@inglorious/web').Api} Api
|
|
4
|
-
* @typedef {import('@inglorious/web').TemplateResult} TemplateResult
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { classMap, html } from "@inglorious/web"
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Card component for Inglorious Web.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* // Stateless usage
|
|
14
|
-
* card.render({ title: 'Card Title', subtitle: 'Description' }, api)
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* // Stateful usage with event handling
|
|
18
|
-
* // Entity: { type: 'card', id: 'myCard', title: 'Click me' }
|
|
19
|
-
* // In store: api.render('myCard')
|
|
20
|
-
*
|
|
21
|
-
* @param {CardEntity} entity
|
|
22
|
-
* @param {Api} api
|
|
23
|
-
* @returns {TemplateResult}
|
|
24
|
-
*/
|
|
25
|
-
export function render(entity, api) {
|
|
26
|
-
const { hoverable = false, clickable = false, fullWidth = false } = entity
|
|
27
|
-
const type = getCardType(entity, api)
|
|
28
|
-
|
|
29
|
-
const classes = {
|
|
30
|
-
"iw-card": true,
|
|
31
|
-
"iw-card-hoverable": hoverable || clickable,
|
|
32
|
-
"iw-card-clickable": clickable,
|
|
33
|
-
"iw-card-full-width": fullWidth,
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return html`
|
|
37
|
-
<div
|
|
38
|
-
class=${classMap(classes)}
|
|
39
|
-
@click=${() => api.notify(`#${entity.id}:click`)}
|
|
40
|
-
>
|
|
41
|
-
${type.renderHeader(entity, api)} ${type.renderBody(entity, api)}
|
|
42
|
-
${type.renderFooter(entity, api)}
|
|
43
|
-
</div>
|
|
44
|
-
`
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Default header renderer.
|
|
49
|
-
* Override in composed types for custom header rendering.
|
|
50
|
-
* @param {CardEntity} entity
|
|
51
|
-
* @returns {TemplateResult | null}
|
|
52
|
-
*/
|
|
53
|
-
export function renderHeader(entity) {
|
|
54
|
-
const { title, subtitle } = entity
|
|
55
|
-
const hasHeader = title || subtitle
|
|
56
|
-
if (!hasHeader) return null
|
|
57
|
-
|
|
58
|
-
return html`<div class="iw-card-header">
|
|
59
|
-
${title ? html`<h3 class="iw-card-title">${title}</h3>` : null}
|
|
60
|
-
${subtitle ? html`<p class="iw-card-subtitle">${subtitle}</p>` : null}
|
|
61
|
-
</div>`
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Default body renderer.
|
|
66
|
-
* Override in composed types for custom body rendering.
|
|
67
|
-
* @returns {TemplateResult}
|
|
68
|
-
*/
|
|
69
|
-
export function renderBody() {
|
|
70
|
-
return html`<div class="iw-card-body">
|
|
71
|
-
<slot></slot>
|
|
72
|
-
</div>`
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Default footer renderer.
|
|
77
|
-
* Override in composed types for custom footer rendering.
|
|
78
|
-
* @returns {TemplateResult | null}
|
|
79
|
-
*/
|
|
80
|
-
export function renderFooter() {
|
|
81
|
-
return null
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function getCardType(entity, api) {
|
|
85
|
-
const resolved = api?.getType?.(entity?.type)
|
|
86
|
-
return hasCardRenderers(resolved)
|
|
87
|
-
? resolved
|
|
88
|
-
: { renderHeader, renderBody, renderFooter }
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function hasCardRenderers(type) {
|
|
92
|
-
return (
|
|
93
|
-
typeof type?.renderHeader === "function" &&
|
|
94
|
-
typeof type?.renderBody === "function" &&
|
|
95
|
-
typeof type?.renderFooter === "function"
|
|
96
|
-
)
|
|
97
|
-
}
|
package/types/widgets/card.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { TemplateResult, Api } from "@inglorious/web"
|
|
2
|
-
|
|
3
|
-
export interface CardEntity {
|
|
4
|
-
id?: string
|
|
5
|
-
type?: string
|
|
6
|
-
title?: string
|
|
7
|
-
subtitle?: string
|
|
8
|
-
hoverable?: boolean
|
|
9
|
-
clickable?: boolean
|
|
10
|
-
fullWidth?: boolean
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface CardType {
|
|
14
|
-
render(entity: CardEntity, api: Api): TemplateResult
|
|
15
|
-
renderHeader(entity: CardEntity, api: Api): TemplateResult | null
|
|
16
|
-
renderBody(entity: CardEntity, api: Api): TemplateResult
|
|
17
|
-
renderFooter(entity: CardEntity, api: Api): TemplateResult | null
|
|
18
|
-
click(entity: CardEntity, payload: unknown, api: Api): void
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export declare const card: CardType
|