@inglorious/ui 1.0.2 → 2.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/package.json +11 -9
- package/src/controls/button/button.stories.js +2 -2
- package/src/controls/button/index.js +1 -1
- package/src/controls/button-group/button-group.stories.js +2 -2
- package/src/controls/button-group/index.js +1 -1
- package/src/controls/button-group/template.js +2 -2
- package/src/controls/checkbox/checkbox.stories.js +2 -2
- package/src/controls/checkbox/index.js +1 -1
- package/src/controls/combobox/combobox.stories.js +3 -3
- package/src/controls/combobox/index.js +2 -2
- package/src/controls/combobox/template.js +3 -3
- package/src/controls/fab/fab.stories.js +2 -2
- package/src/controls/fab/index.js +1 -1
- package/src/controls/fab/template.js +2 -2
- package/src/controls/icon-button/icon-button.stories.js +2 -2
- package/src/controls/icon-button/index.js +1 -1
- package/src/controls/icon-button/template.js +2 -2
- package/src/controls/input/index.js +1 -1
- package/src/controls/input/input.stories.js +2 -2
- package/src/controls/radio-group/index.js +1 -1
- package/src/controls/radio-group/radio-group.stories.js +2 -2
- package/src/controls/rating/index.js +1 -1
- package/src/controls/rating/rating.stories.js +2 -2
- package/src/controls/select/index.js +1 -1
- package/src/controls/select/select.stories.js +2 -2
- package/src/controls/slider/index.js +1 -1
- package/src/controls/slider/slider.stories.js +2 -2
- package/src/controls/switch/index.js +1 -1
- package/src/controls/switch/switch.stories.js +2 -2
- package/src/data-display/avatar/avatar.stories.js +2 -2
- package/src/data-display/avatar/index.js +1 -1
- package/src/data-display/badge/badge.stories.js +2 -2
- package/src/data-display/badge/index.js +1 -1
- package/src/data-display/chip/chip.stories.js +2 -2
- package/src/data-display/chip/index.js +1 -1
- package/src/data-display/data-grid/data-grid.stories.js +4 -4
- package/src/data-display/data-grid/filters/index.js +10 -10
- package/src/data-display/data-grid/filters/input.js +3 -3
- package/src/data-display/data-grid/filters/range.js +4 -4
- package/src/data-display/data-grid/filters/select.js +3 -3
- package/src/data-display/data-grid/index.js +2 -2
- package/src/data-display/data-grid/template.js +16 -16
- package/src/data-display/divider/divider.stories.js +2 -2
- package/src/data-display/divider/index.js +1 -1
- package/src/data-display/icon/icon-implementations.mdx +4 -4
- package/src/data-display/icon/icon-utf8.stories.js +9 -9
- package/src/data-display/icon/icon.stories.js +2 -2
- package/src/data-display/icon/index.js +1 -1
- package/src/data-display/list/index.js +2 -2
- package/src/data-display/list/list.stories.js +2 -2
- package/src/data-display/list/template.js +8 -8
- package/src/data-display/material-icon/index.js +1 -1
- package/src/data-display/material-icon/material-icon.stories.js +2 -2
- package/src/data-display/table/index.js +1 -1
- package/src/data-display/table/table.stories.js +2 -2
- package/src/data-display/table/template.js +1 -1
- package/src/data-display/tooltip/index.js +1 -1
- package/src/data-display/tooltip/tooltip.stories.js +2 -2
- package/src/data-display/typography/index.js +1 -1
- package/src/data-display/typography/typography.stories.js +2 -2
- package/src/data-display/virtual-list/index.js +1 -1
- package/src/examples/dashboard/app-drawer.js +15 -15
- package/src/examples/dashboard/app-header.js +33 -33
- package/src/examples/dashboard/dashboard-jsx.jsx +76 -0
- package/src/examples/dashboard/dashboard-vue.vue +68 -0
- package/src/examples/dashboard/dashboard.js +43 -42
- package/src/examples/dashboard/dashboard.stories.js +46 -16
- package/src/examples/dashboard/mode.js +1 -1
- package/src/examples/dashboard/primitive-content.js +248 -248
- package/src/examples/dashboard/primitive-section.js +25 -25
- package/src/examples/dashboard/router.js +1 -1
- package/src/examples/dashboard/social-card.js +14 -14
- package/src/examples/dashboard/stat-card.js +12 -12
- package/src/examples/dashboard/theme.js +1 -1
- package/src/examples/dashboard/traffic-card.js +22 -22
- package/src/examples/dashboard/traffic-sales-card.js +39 -39
- package/src/feedback/alert/alert.stories.js +2 -2
- package/src/feedback/alert/index.js +2 -2
- package/src/feedback/backdrop/backdrop.stories.js +2 -2
- package/src/feedback/backdrop/index.js +2 -2
- package/src/feedback/dialog/dialog.stories.js +2 -2
- package/src/feedback/dialog/index.js +2 -2
- package/src/feedback/progress/index.js +1 -1
- package/src/feedback/progress/progress.stories.js +2 -2
- package/src/feedback/progress/template.js +1 -1
- package/src/feedback/skeleton/index.js +2 -2
- package/src/feedback/skeleton/skeleton.stories.js +2 -2
- package/src/feedback/snackbar/index.js +2 -2
- package/src/feedback/snackbar/snackbar.stories.js +2 -2
- package/src/index.js +45 -45
- package/src/layout/container/container.stories.js +3 -3
- package/src/layout/container/index.js +1 -1
- package/src/layout/flex/flex.stories.js +2 -2
- package/src/layout/flex/index.js +1 -1
- package/src/layout/grid/grid.stories.js +2 -2
- package/src/layout/grid/index.js +1 -1
- package/src/navigation/bottom-navigation/bottom-navigation.stories.js +2 -2
- package/src/navigation/bottom-navigation/index.js +1 -1
- package/src/navigation/bottom-navigation/template.js +2 -2
- package/src/navigation/breadcrumbs/breadcrumbs.stories.js +2 -2
- package/src/navigation/breadcrumbs/index.js +1 -1
- package/src/navigation/breadcrumbs/template.js +2 -2
- package/src/navigation/drawer/drawer.stories.js +2 -2
- package/src/navigation/drawer/index.js +1 -1
- package/src/navigation/drawer/template.js +13 -13
- package/src/navigation/link/index.js +2 -2
- package/src/navigation/link/link.stories.js +2 -2
- package/src/navigation/menu/index.js +1 -1
- package/src/navigation/menu/menu.stories.js +2 -2
- package/src/navigation/menu/template.js +1 -1
- package/src/navigation/pagination/index.js +1 -1
- package/src/navigation/pagination/pagination.stories.js +2 -2
- package/src/navigation/pagination/template.js +4 -4
- package/src/navigation/speed-dial/index.js +1 -1
- package/src/navigation/speed-dial/speed-dial.stories.js +2 -2
- package/src/navigation/speed-dial/template.js +1 -1
- package/src/navigation/stepper/index.js +1 -1
- package/src/navigation/stepper/stepper.stories.js +2 -2
- package/src/navigation/stepper/template.js +1 -1
- package/src/navigation/tabs/index.js +1 -1
- package/src/navigation/tabs/tabs.stories.js +2 -2
- package/src/navigation/tabs/template.js +1 -1
- package/src/surfaces/accordion/accordion.stories.js +2 -2
- package/src/surfaces/accordion/index.js +1 -1
- package/src/surfaces/accordion/template.js +1 -1
- package/src/surfaces/app-bar/app-bar.stories.js +2 -2
- package/src/surfaces/app-bar/index.js +1 -1
- package/src/surfaces/card/card.stories.js +2 -2
- package/src/surfaces/card/index.js +1 -1
- package/src/surfaces/card/template.js +1 -1
- package/src/surfaces/paper/index.js +2 -2
- package/src/surfaces/paper/paper.stories.js +3 -3
- package/types/controls/button-group.d.ts +1 -1
- package/types/controls/button.d.ts +2 -2
- package/types/controls/checkbox.d.ts +1 -1
- package/types/controls/combobox.d.ts +1 -1
- package/types/controls/fab.d.ts +1 -1
- package/types/controls/icon-button.d.ts +1 -1
- package/types/controls/input.d.ts +1 -1
- package/types/controls/radio-group.d.ts +1 -1
- package/types/controls/rating.d.ts +1 -1
- package/types/controls/select.d.ts +1 -1
- package/types/controls/slider.d.ts +1 -1
- package/types/controls/switch.d.ts +1 -1
- package/types/data-display/avatar.d.ts +1 -1
- package/types/data-display/badge.d.ts +1 -1
- package/types/data-display/chip.d.ts +1 -1
- package/types/data-display/divider.d.ts +1 -1
- package/types/data-display/icon.d.ts +1 -1
- package/types/data-display/list.d.ts +1 -1
- package/types/data-display/material-icon.d.ts +1 -1
- package/types/data-display/table.d.ts +1 -1
- package/types/data-display/tooltip.d.ts +1 -1
- package/types/data-display/typography.d.ts +1 -1
- package/types/data-display/virtual-list.d.ts +1 -1
- package/types/feedback/alert.d.ts +1 -1
- package/types/feedback/backdrop.d.ts +1 -1
- package/types/feedback/dialog.d.ts +1 -1
- package/types/feedback/progress.d.ts +1 -1
- package/types/feedback/skeleton.d.ts +1 -1
- package/types/feedback/snackbar.d.ts +1 -1
- package/types/layout/container.d.ts +1 -1
- package/types/layout/flex.d.ts +1 -1
- package/types/layout/grid.d.ts +1 -1
- package/types/navigation/bottom-navigation.d.ts +1 -1
- package/types/navigation/breadcrumbs.d.ts +1 -1
- package/types/navigation/drawer.d.ts +1 -1
- package/types/navigation/link.d.ts +1 -1
- package/types/navigation/menu.d.ts +1 -1
- package/types/navigation/pagination.d.ts +1 -1
- package/types/navigation/speed-dial.d.ts +1 -1
- package/types/navigation/stepper.d.ts +1 -1
- package/types/navigation/tabs.d.ts +1 -1
- package/types/surfaces/accordion.d.ts +1 -1
- package/types/surfaces/app-bar.d.ts +1 -1
- package/types/surfaces/card.d.ts +1 -1
- package/types/surfaces/paper.d.ts +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { html } from "@inglorious/web"
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { Typography } from "../../data-display/typography/index.js"
|
|
4
|
+
import { Container } from "../../layout/container/index.js"
|
|
5
|
+
import { Flex } from "../../layout/flex/index.js"
|
|
6
|
+
import { Grid } from "../../layout/grid/index.js"
|
|
7
|
+
import { Card } from "../../surfaces/card/index.js"
|
|
8
8
|
import { getPrimitiveContent } from "./primitive-content.js"
|
|
9
9
|
|
|
10
|
-
export const
|
|
10
|
+
export const PrimitiveSection = {
|
|
11
11
|
render(entity, api) {
|
|
12
12
|
const router = api?.getEntity?.("router")
|
|
13
13
|
const content = getPrimitiveContent(router?.path, entity)
|
|
@@ -24,31 +24,31 @@ export const primitiveSection = {
|
|
|
24
24
|
: example?.preview
|
|
25
25
|
const showEmpty = !content
|
|
26
26
|
|
|
27
|
-
return
|
|
27
|
+
return Container.render({
|
|
28
28
|
maxWidth: "xl",
|
|
29
29
|
padding: "lg",
|
|
30
30
|
className: "iw-dashboard-container",
|
|
31
|
-
children:
|
|
31
|
+
children: Flex.render({
|
|
32
32
|
direction: "column",
|
|
33
33
|
gap: "lg",
|
|
34
34
|
children: [
|
|
35
|
-
|
|
35
|
+
Flex.render({
|
|
36
36
|
direction: "column",
|
|
37
37
|
gap: "xs",
|
|
38
38
|
children: [
|
|
39
|
-
|
|
39
|
+
Typography.render({
|
|
40
40
|
variant: "h4",
|
|
41
41
|
children: showEmpty ? "Choose a Primitive" : name,
|
|
42
42
|
}),
|
|
43
43
|
category
|
|
44
|
-
?
|
|
44
|
+
? Typography.render({
|
|
45
45
|
variant: "body2",
|
|
46
46
|
color: "secondary",
|
|
47
47
|
children: `Category: ${category}`,
|
|
48
48
|
})
|
|
49
49
|
: "",
|
|
50
50
|
summary
|
|
51
|
-
?
|
|
51
|
+
? Typography.render({
|
|
52
52
|
variant: "body1",
|
|
53
53
|
color: "secondary",
|
|
54
54
|
children: summary,
|
|
@@ -56,22 +56,22 @@ export const primitiveSection = {
|
|
|
56
56
|
: "",
|
|
57
57
|
],
|
|
58
58
|
}),
|
|
59
|
-
|
|
59
|
+
Card.render({
|
|
60
60
|
padding: "xl",
|
|
61
|
-
children:
|
|
61
|
+
children: Flex.render({
|
|
62
62
|
align: "center",
|
|
63
63
|
justify: "center",
|
|
64
64
|
padding: "xl",
|
|
65
65
|
className: "iw-primitive-placeholder",
|
|
66
66
|
children: html`
|
|
67
67
|
<div style="text-align: center;">
|
|
68
|
-
${
|
|
68
|
+
${Typography.render({
|
|
69
69
|
variant: "h6",
|
|
70
70
|
children: showEmpty
|
|
71
71
|
? "Pick a primitive from the drawer to see details."
|
|
72
72
|
: `Documentation for ${name}`,
|
|
73
73
|
})}
|
|
74
|
-
${
|
|
74
|
+
${Typography.render({
|
|
75
75
|
variant: "body1",
|
|
76
76
|
children:
|
|
77
77
|
description ??
|
|
@@ -80,7 +80,7 @@ export const primitiveSection = {
|
|
|
80
80
|
${useCases.length
|
|
81
81
|
? html`
|
|
82
82
|
<div style="margin-top: 16px; text-align: left;">
|
|
83
|
-
${
|
|
83
|
+
${Typography.render({
|
|
84
84
|
variant: "body2",
|
|
85
85
|
color: "secondary",
|
|
86
86
|
children: "Common use cases",
|
|
@@ -99,26 +99,26 @@ export const primitiveSection = {
|
|
|
99
99
|
}),
|
|
100
100
|
showEmpty
|
|
101
101
|
? ""
|
|
102
|
-
:
|
|
102
|
+
: Card.render({
|
|
103
103
|
padding: "xl",
|
|
104
104
|
className: "iw-primitive-example",
|
|
105
|
-
children:
|
|
105
|
+
children: Flex.render({
|
|
106
106
|
direction: "column",
|
|
107
107
|
gap: "md",
|
|
108
108
|
children: [
|
|
109
|
-
|
|
109
|
+
Typography.render({
|
|
110
110
|
variant: "h6",
|
|
111
111
|
children: "Example",
|
|
112
112
|
}),
|
|
113
|
-
|
|
113
|
+
Grid.render({
|
|
114
114
|
minColumnWidth: "18rem",
|
|
115
115
|
gap: "lg",
|
|
116
116
|
children: [
|
|
117
|
-
|
|
117
|
+
Flex.render({
|
|
118
118
|
direction: "column",
|
|
119
119
|
gap: "sm",
|
|
120
120
|
children: [
|
|
121
|
-
|
|
121
|
+
Typography.render({
|
|
122
122
|
variant: "body2",
|
|
123
123
|
color: "secondary",
|
|
124
124
|
children: "Code",
|
|
@@ -129,11 +129,11 @@ export const primitiveSection = {
|
|
|
129
129
|
"// Example coming soon."}</code></pre>`,
|
|
130
130
|
],
|
|
131
131
|
}),
|
|
132
|
-
|
|
132
|
+
Flex.render({
|
|
133
133
|
direction: "column",
|
|
134
134
|
gap: "sm",
|
|
135
135
|
children: [
|
|
136
|
-
|
|
136
|
+
Typography.render({
|
|
137
137
|
variant: "body2",
|
|
138
138
|
color: "secondary",
|
|
139
139
|
children: "Result",
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { chart } from "@inglorious/charts"
|
|
2
2
|
import { html } from "@inglorious/web"
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { Divider } from "../../data-display/divider"
|
|
5
|
+
import { MaterialIcon } from "../../data-display/material-icon"
|
|
6
|
+
import { Typography } from "../../data-display/typography"
|
|
7
|
+
import { Grid } from "../../layout/grid"
|
|
8
|
+
import { Card } from "../../surfaces/card"
|
|
9
9
|
|
|
10
|
-
export const
|
|
10
|
+
export const SocialCard = {
|
|
11
11
|
render(entity, api) {
|
|
12
|
-
return
|
|
12
|
+
return Card.render({
|
|
13
13
|
className: "iw-dashboard-social-card",
|
|
14
14
|
headerPadding: "none",
|
|
15
15
|
header: html`
|
|
16
16
|
<div class="iw-dashboard-social-cap ${entity.capClass}">
|
|
17
|
-
${
|
|
17
|
+
${MaterialIcon.render({ name: entity.icon, size: "lg" })}
|
|
18
18
|
<div class="iw-dashboard-social-chart">
|
|
19
19
|
${this.renderAreaSpark(entity, api)}
|
|
20
20
|
</div>
|
|
21
21
|
</div>
|
|
22
22
|
`,
|
|
23
|
-
body:
|
|
23
|
+
body: Grid.render({
|
|
24
24
|
columns: "1fr auto 1fr",
|
|
25
25
|
gap: "md",
|
|
26
26
|
className: "iw-dashboard-social-stats",
|
|
27
27
|
children: [
|
|
28
28
|
html`<div>
|
|
29
|
-
${
|
|
30
|
-
${
|
|
29
|
+
${Typography.render({ variant: "h3", children: entity.top })}
|
|
30
|
+
${Typography.render({
|
|
31
31
|
variant: "caption",
|
|
32
32
|
children: entity.topLabel,
|
|
33
33
|
color: "var(--iw-color-text-secondary)",
|
|
34
34
|
})}
|
|
35
35
|
</div>`,
|
|
36
|
-
|
|
36
|
+
Divider.render({ orientation: "vertical" }),
|
|
37
37
|
html`<div>
|
|
38
|
-
${
|
|
39
|
-
${
|
|
38
|
+
${Typography.render({ variant: "h3", children: entity.bottom })}
|
|
39
|
+
${Typography.render({
|
|
40
40
|
variant: "caption",
|
|
41
41
|
children: entity.bottomLabel,
|
|
42
42
|
color: "var(--iw-color-text-secondary)",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { chart } from "@inglorious/charts"
|
|
2
2
|
import { html } from "@inglorious/web"
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { Button } from "../../controls/button"
|
|
5
|
+
import { MaterialIcon } from "../../data-display/material-icon"
|
|
6
|
+
import { Typography } from "../../data-display/typography"
|
|
7
|
+
import { Card } from "../../surfaces/card"
|
|
8
8
|
|
|
9
|
-
export const
|
|
9
|
+
export const StatCard = {
|
|
10
10
|
render(entity, api) {
|
|
11
|
-
return
|
|
11
|
+
return Card.render({
|
|
12
12
|
className: `iw-dashboard-stat ${entity.className}`,
|
|
13
13
|
bodyPadding: "none",
|
|
14
14
|
body: html`
|
|
@@ -16,13 +16,13 @@ export const statCard = {
|
|
|
16
16
|
<div class="iw-dashboard-stat-top">
|
|
17
17
|
<div>
|
|
18
18
|
<div class="iw-dashboard-stat-value">
|
|
19
|
-
${
|
|
19
|
+
${Typography.render({ variant: "h2", children: entity.value })}
|
|
20
20
|
<span
|
|
21
|
-
>(${
|
|
21
|
+
>(${Typography.render({
|
|
22
22
|
variant: "caption",
|
|
23
23
|
children: html`<span class="iw-dashboard-stat-change">
|
|
24
24
|
${entity.change}
|
|
25
|
-
${
|
|
25
|
+
${MaterialIcon.render({
|
|
26
26
|
name: entity.direction,
|
|
27
27
|
size: "sm",
|
|
28
28
|
})}
|
|
@@ -30,17 +30,17 @@ export const statCard = {
|
|
|
30
30
|
})})</span
|
|
31
31
|
>
|
|
32
32
|
</div>
|
|
33
|
-
${
|
|
33
|
+
${Typography.render({ children: entity.label })}
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
36
36
|
<div class="iw-dashboard-stat-chart">
|
|
37
37
|
${this.renderStatChart(entity, api)}
|
|
38
38
|
</div>
|
|
39
|
-
${
|
|
39
|
+
${Button.render({
|
|
40
40
|
variant: "ghost",
|
|
41
41
|
shape: "square",
|
|
42
42
|
className: "iw-dashboard-stat-more",
|
|
43
|
-
children:
|
|
43
|
+
children: MaterialIcon.render({ name: "more_vert", size: "lg" }),
|
|
44
44
|
"aria-label": "More options",
|
|
45
45
|
})}
|
|
46
46
|
</div>
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { chart } from "@inglorious/charts"
|
|
2
2
|
import { html } from "@inglorious/web"
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
4
|
+
import { Button } from "../../controls/button"
|
|
5
|
+
import { ButtonGroup } from "../../controls/button-group"
|
|
6
|
+
import { MaterialIcon } from "../../data-display/material-icon"
|
|
7
|
+
import { Typography } from "../../data-display/typography"
|
|
8
|
+
import { Progress } from "../../feedback/progress"
|
|
9
|
+
import { Flex } from "../../layout/flex"
|
|
10
|
+
import { Grid } from "../../layout/grid"
|
|
11
|
+
import { Card } from "../../surfaces/card"
|
|
12
12
|
import { trafficSeries, trafficSummary } from "./data"
|
|
13
13
|
|
|
14
|
-
export const
|
|
14
|
+
export const TrafficCard = {
|
|
15
15
|
render(entity, api) {
|
|
16
|
-
return
|
|
17
|
-
header:
|
|
16
|
+
return Card.render({
|
|
17
|
+
header: Flex.render({
|
|
18
18
|
justify: "between",
|
|
19
19
|
align: "start",
|
|
20
20
|
gap: "md",
|
|
21
21
|
children: [
|
|
22
22
|
html`<div>
|
|
23
|
-
${
|
|
24
|
-
${
|
|
23
|
+
${Typography.render({ variant: "h3", children: "Traffic" })}
|
|
24
|
+
${Typography.render({
|
|
25
25
|
variant: "caption",
|
|
26
26
|
children: "January - July 2023",
|
|
27
27
|
color: "var(--iw-color-text-secondary)",
|
|
28
28
|
})}
|
|
29
29
|
</div>`,
|
|
30
|
-
|
|
30
|
+
Flex.render({
|
|
31
31
|
gap: "md",
|
|
32
32
|
children: [
|
|
33
|
-
|
|
33
|
+
ButtonGroup.render({
|
|
34
34
|
value: "month",
|
|
35
35
|
variant: "outline",
|
|
36
36
|
color: "secondary",
|
|
@@ -41,10 +41,10 @@ export const trafficCard = {
|
|
|
41
41
|
{ id: "year", label: "Year" },
|
|
42
42
|
],
|
|
43
43
|
}),
|
|
44
|
-
|
|
44
|
+
Button.render({
|
|
45
45
|
size: "md",
|
|
46
46
|
color: "primary",
|
|
47
|
-
children:
|
|
47
|
+
children: MaterialIcon.render({ name: "download" }),
|
|
48
48
|
"aria-label": "Download report",
|
|
49
49
|
}),
|
|
50
50
|
],
|
|
@@ -56,22 +56,22 @@ export const trafficCard = {
|
|
|
56
56
|
${this.renderTrafficChart(entity, api)}
|
|
57
57
|
</div>
|
|
58
58
|
`,
|
|
59
|
-
footer:
|
|
59
|
+
footer: Grid.render({
|
|
60
60
|
minColumnWidth: "17rem",
|
|
61
61
|
gap: "lg",
|
|
62
62
|
children: [
|
|
63
63
|
trafficSummary.map((item) =>
|
|
64
|
-
|
|
64
|
+
Flex.render({
|
|
65
65
|
direction: "column",
|
|
66
66
|
align: "center",
|
|
67
67
|
gap: "sm",
|
|
68
68
|
children: [
|
|
69
|
-
|
|
69
|
+
Typography.render({
|
|
70
70
|
children: item.label,
|
|
71
71
|
color: "var(--iw-color-text-secondary)",
|
|
72
72
|
}),
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
Typography.render({ children: item.value, weight: 600 }),
|
|
74
|
+
Progress.render({
|
|
75
75
|
value: item.progress,
|
|
76
76
|
className: `iw-progress-${item.color}`,
|
|
77
77
|
}),
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { html } from "@inglorious/web"
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
3
|
+
import { Button } from "../../controls/button"
|
|
4
|
+
import { Avatar } from "../../data-display/avatar"
|
|
5
|
+
import { Badge } from "../../data-display/badge"
|
|
6
|
+
import { Icon } from "../../data-display/icon"
|
|
7
|
+
import { MaterialIcon } from "../../data-display/material-icon"
|
|
8
|
+
import { Table } from "../../data-display/table"
|
|
9
|
+
import { Typography } from "../../data-display/typography"
|
|
10
|
+
import { Progress } from "../../feedback/progress"
|
|
11
|
+
import { Flex } from "../../layout/flex"
|
|
12
|
+
import { Grid } from "../../layout/grid"
|
|
13
|
+
import { Card } from "../../surfaces/card"
|
|
14
14
|
import { clientBars, sourceBars, userRows } from "./data"
|
|
15
15
|
|
|
16
|
-
export const
|
|
16
|
+
export const TrafficSalesCard = {
|
|
17
17
|
render(entity, api) {
|
|
18
|
-
return
|
|
18
|
+
return Card.render({
|
|
19
19
|
title: "Traffic & Sales",
|
|
20
20
|
body: html`
|
|
21
|
-
${
|
|
21
|
+
${Grid.render({
|
|
22
22
|
columns: 2,
|
|
23
23
|
gap: "lg",
|
|
24
24
|
className: "iw-dashboard-sales-layout",
|
|
25
25
|
children: [
|
|
26
26
|
html`
|
|
27
27
|
<div>
|
|
28
|
-
${
|
|
28
|
+
${Grid.render({
|
|
29
29
|
columns: 2,
|
|
30
30
|
gap: "lg",
|
|
31
31
|
className: "iw-dashboard-kpi-grid",
|
|
@@ -51,27 +51,27 @@ export const trafficSalesCard = {
|
|
|
51
51
|
],
|
|
52
52
|
})}
|
|
53
53
|
<hr class="iw-dashboard-divider" />
|
|
54
|
-
${
|
|
54
|
+
${Flex.render({
|
|
55
55
|
direction: "column",
|
|
56
56
|
gap: "lg",
|
|
57
57
|
className: "iw-dashboard-progress-list",
|
|
58
58
|
children: clientBars.map(([day, first, second]) =>
|
|
59
|
-
|
|
59
|
+
Grid.render({
|
|
60
60
|
columns: "6rem 1fr",
|
|
61
61
|
gap: "lg",
|
|
62
62
|
align: "center",
|
|
63
63
|
className: "iw-dashboard-progress-row",
|
|
64
64
|
children: [
|
|
65
65
|
html`<span>${day}</span>`,
|
|
66
|
-
|
|
66
|
+
Flex.render({
|
|
67
67
|
direction: "column",
|
|
68
68
|
gap: "sm",
|
|
69
69
|
children: [
|
|
70
|
-
|
|
70
|
+
Progress.render({
|
|
71
71
|
value: first,
|
|
72
72
|
className: "iw-progress-info",
|
|
73
73
|
}),
|
|
74
|
-
|
|
74
|
+
Progress.render({
|
|
75
75
|
value: second,
|
|
76
76
|
className: "iw-progress-error",
|
|
77
77
|
}),
|
|
@@ -85,7 +85,7 @@ export const trafficSalesCard = {
|
|
|
85
85
|
`,
|
|
86
86
|
html`
|
|
87
87
|
<div>
|
|
88
|
-
${
|
|
88
|
+
${Grid.render({
|
|
89
89
|
columns: 2,
|
|
90
90
|
gap: "lg",
|
|
91
91
|
className: "iw-dashboard-kpi-grid",
|
|
@@ -107,30 +107,30 @@ export const trafficSalesCard = {
|
|
|
107
107
|
],
|
|
108
108
|
})}
|
|
109
109
|
<hr class="iw-dashboard-divider" />
|
|
110
|
-
${
|
|
110
|
+
${Flex.render({
|
|
111
111
|
direction: "column",
|
|
112
112
|
gap: "lg",
|
|
113
113
|
className: "iw-dashboard-progress-list",
|
|
114
114
|
children: sourceBars.map(
|
|
115
115
|
([label, value, iconName, tone, metric, suffix]) => html`
|
|
116
116
|
<div>
|
|
117
|
-
${
|
|
117
|
+
${Flex.render({
|
|
118
118
|
align: "center",
|
|
119
119
|
justify: "between",
|
|
120
120
|
gap: "lg",
|
|
121
121
|
children: [
|
|
122
|
-
|
|
122
|
+
Flex.render({
|
|
123
123
|
align: "center",
|
|
124
124
|
gap: "sm",
|
|
125
125
|
children: [
|
|
126
|
-
|
|
126
|
+
MaterialIcon.render({
|
|
127
127
|
name: iconName,
|
|
128
128
|
size: "lg",
|
|
129
129
|
}),
|
|
130
130
|
html`<span>${label}</span>`,
|
|
131
131
|
],
|
|
132
132
|
}),
|
|
133
|
-
|
|
133
|
+
Flex.render({
|
|
134
134
|
align: "center",
|
|
135
135
|
gap: "sm",
|
|
136
136
|
className: "iw-dashboard-progress-meta",
|
|
@@ -143,7 +143,7 @@ export const trafficSalesCard = {
|
|
|
143
143
|
}),
|
|
144
144
|
],
|
|
145
145
|
})}
|
|
146
|
-
${
|
|
146
|
+
${Progress.render({
|
|
147
147
|
value,
|
|
148
148
|
className: `iw-progress-${tone}`,
|
|
149
149
|
})}
|
|
@@ -158,7 +158,7 @@ export const trafficSalesCard = {
|
|
|
158
158
|
|
|
159
159
|
<div style="height: var(--iw-space-5)"></div>
|
|
160
160
|
|
|
161
|
-
${
|
|
161
|
+
${Table.render({
|
|
162
162
|
columns: [
|
|
163
163
|
{ id: "user", title: "User" },
|
|
164
164
|
{ id: "country", title: "Country" },
|
|
@@ -169,17 +169,17 @@ export const trafficSalesCard = {
|
|
|
169
169
|
],
|
|
170
170
|
rows: userRows.map((row) => ({
|
|
171
171
|
user: html`
|
|
172
|
-
${
|
|
172
|
+
${Flex.render({
|
|
173
173
|
align: "center",
|
|
174
174
|
gap: "lg",
|
|
175
175
|
children: [
|
|
176
176
|
html`<span class="iw-dashboard-avatar">
|
|
177
|
-
${
|
|
177
|
+
${Avatar.render({
|
|
178
178
|
size: "lg",
|
|
179
179
|
color: "auto",
|
|
180
180
|
initials: row.initials,
|
|
181
181
|
})}
|
|
182
|
-
${
|
|
182
|
+
${Badge.render({
|
|
183
183
|
shape: "circle",
|
|
184
184
|
ringWidth: "1px",
|
|
185
185
|
color: row.status,
|
|
@@ -200,11 +200,11 @@ export const trafficSalesCard = {
|
|
|
200
200
|
${row.country}
|
|
201
201
|
</div>`,
|
|
202
202
|
usage: html`
|
|
203
|
-
${
|
|
203
|
+
${Flex.render({
|
|
204
204
|
direction: "column",
|
|
205
205
|
gap: "sm",
|
|
206
206
|
children: [
|
|
207
|
-
|
|
207
|
+
Flex.render({
|
|
208
208
|
justify: "between",
|
|
209
209
|
gap: "sm",
|
|
210
210
|
children: [
|
|
@@ -214,7 +214,7 @@ export const trafficSalesCard = {
|
|
|
214
214
|
>`,
|
|
215
215
|
],
|
|
216
216
|
}),
|
|
217
|
-
|
|
217
|
+
Progress.render({
|
|
218
218
|
value: row.usage,
|
|
219
219
|
className: `iw-progress-${row.status}`,
|
|
220
220
|
}),
|
|
@@ -222,7 +222,7 @@ export const trafficSalesCard = {
|
|
|
222
222
|
})}
|
|
223
223
|
`,
|
|
224
224
|
payment: html`<div class="iw-dashboard-payment">
|
|
225
|
-
${
|
|
225
|
+
${Icon.render({
|
|
226
226
|
size: "lg",
|
|
227
227
|
children: html`<i
|
|
228
228
|
class="fa-brands fa-${row.payment}"
|
|
@@ -238,10 +238,10 @@ export const trafficSalesCard = {
|
|
|
238
238
|
`,
|
|
239
239
|
menu: html`
|
|
240
240
|
<div class="iw-dashboard-menu-cell">
|
|
241
|
-
${
|
|
241
|
+
${Button.render({
|
|
242
242
|
variant: "ghost",
|
|
243
243
|
color: "secondary",
|
|
244
|
-
children:
|
|
244
|
+
children: MaterialIcon.render({ name: "more_vert" }),
|
|
245
245
|
"aria-label": "Row actions",
|
|
246
246
|
})}
|
|
247
247
|
</div>
|
|
@@ -255,12 +255,12 @@ export const trafficSalesCard = {
|
|
|
255
255
|
renderKpi(_, { label, value, color }) {
|
|
256
256
|
return html`
|
|
257
257
|
<div class="iw-dashboard-kpi" style=${`color: ${color};`}>
|
|
258
|
-
${
|
|
258
|
+
${Typography.render({
|
|
259
259
|
variant: "caption",
|
|
260
260
|
children: label,
|
|
261
261
|
color: "var(--iw-color-text-secondary)",
|
|
262
262
|
})}
|
|
263
|
-
${
|
|
263
|
+
${Typography.render({ variant: "h3", children: value })}
|
|
264
264
|
</div>
|
|
265
265
|
`
|
|
266
266
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Alert } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Feedback/Alert",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Alert),
|
|
8
8
|
argTypes: {
|
|
9
9
|
title: { control: "text" },
|
|
10
10
|
description: { control: "text" },
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as renderers from "./template.js"
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const Alert = { ...renderers }
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { html } from "@inglorious/web"
|
|
2
2
|
|
|
3
3
|
import { createRender } from "../../stories/notifyStory.js"
|
|
4
|
-
import {
|
|
4
|
+
import { Backdrop } from "."
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Feedback/Backdrop",
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
render: createRender(
|
|
9
|
+
render: createRender(Backdrop),
|
|
10
10
|
argTypes: {
|
|
11
11
|
isOpen: { control: "boolean" },
|
|
12
12
|
onClick: { action: "onClick" },
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as renderers from "./template.js"
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const Backdrop = { ...renderers }
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { html } from "@inglorious/web"
|
|
2
2
|
|
|
3
3
|
import { createRender } from "../../stories/notifyStory.js"
|
|
4
|
-
import {
|
|
4
|
+
import { Dialog } from "."
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Feedback/Dialog",
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
render: createRender(
|
|
9
|
+
render: createRender(Dialog),
|
|
10
10
|
argTypes: {
|
|
11
11
|
isOpen: { control: "boolean" },
|
|
12
12
|
title: { control: "text" },
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as renderers from "./template.js"
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const Dialog = { ...renderers }
|