@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.
Files changed (177) hide show
  1. package/package.json +11 -9
  2. package/src/controls/button/button.stories.js +2 -2
  3. package/src/controls/button/index.js +1 -1
  4. package/src/controls/button-group/button-group.stories.js +2 -2
  5. package/src/controls/button-group/index.js +1 -1
  6. package/src/controls/button-group/template.js +2 -2
  7. package/src/controls/checkbox/checkbox.stories.js +2 -2
  8. package/src/controls/checkbox/index.js +1 -1
  9. package/src/controls/combobox/combobox.stories.js +3 -3
  10. package/src/controls/combobox/index.js +2 -2
  11. package/src/controls/combobox/template.js +3 -3
  12. package/src/controls/fab/fab.stories.js +2 -2
  13. package/src/controls/fab/index.js +1 -1
  14. package/src/controls/fab/template.js +2 -2
  15. package/src/controls/icon-button/icon-button.stories.js +2 -2
  16. package/src/controls/icon-button/index.js +1 -1
  17. package/src/controls/icon-button/template.js +2 -2
  18. package/src/controls/input/index.js +1 -1
  19. package/src/controls/input/input.stories.js +2 -2
  20. package/src/controls/radio-group/index.js +1 -1
  21. package/src/controls/radio-group/radio-group.stories.js +2 -2
  22. package/src/controls/rating/index.js +1 -1
  23. package/src/controls/rating/rating.stories.js +2 -2
  24. package/src/controls/select/index.js +1 -1
  25. package/src/controls/select/select.stories.js +2 -2
  26. package/src/controls/slider/index.js +1 -1
  27. package/src/controls/slider/slider.stories.js +2 -2
  28. package/src/controls/switch/index.js +1 -1
  29. package/src/controls/switch/switch.stories.js +2 -2
  30. package/src/data-display/avatar/avatar.stories.js +2 -2
  31. package/src/data-display/avatar/index.js +1 -1
  32. package/src/data-display/badge/badge.stories.js +2 -2
  33. package/src/data-display/badge/index.js +1 -1
  34. package/src/data-display/chip/chip.stories.js +2 -2
  35. package/src/data-display/chip/index.js +1 -1
  36. package/src/data-display/data-grid/data-grid.stories.js +4 -4
  37. package/src/data-display/data-grid/filters/index.js +10 -10
  38. package/src/data-display/data-grid/filters/input.js +3 -3
  39. package/src/data-display/data-grid/filters/range.js +4 -4
  40. package/src/data-display/data-grid/filters/select.js +3 -3
  41. package/src/data-display/data-grid/index.js +2 -2
  42. package/src/data-display/data-grid/template.js +16 -16
  43. package/src/data-display/divider/divider.stories.js +2 -2
  44. package/src/data-display/divider/index.js +1 -1
  45. package/src/data-display/icon/icon-implementations.mdx +4 -4
  46. package/src/data-display/icon/icon-utf8.stories.js +9 -9
  47. package/src/data-display/icon/icon.stories.js +2 -2
  48. package/src/data-display/icon/index.js +1 -1
  49. package/src/data-display/list/index.js +2 -2
  50. package/src/data-display/list/list.stories.js +2 -2
  51. package/src/data-display/list/template.js +8 -8
  52. package/src/data-display/material-icon/index.js +1 -1
  53. package/src/data-display/material-icon/material-icon.stories.js +2 -2
  54. package/src/data-display/table/index.js +1 -1
  55. package/src/data-display/table/table.stories.js +2 -2
  56. package/src/data-display/table/template.js +1 -1
  57. package/src/data-display/tooltip/index.js +1 -1
  58. package/src/data-display/tooltip/tooltip.stories.js +2 -2
  59. package/src/data-display/typography/index.js +1 -1
  60. package/src/data-display/typography/typography.stories.js +2 -2
  61. package/src/data-display/virtual-list/index.js +1 -1
  62. package/src/examples/dashboard/app-drawer.js +15 -15
  63. package/src/examples/dashboard/app-header.js +33 -33
  64. package/src/examples/dashboard/dashboard-jsx.jsx +76 -0
  65. package/src/examples/dashboard/dashboard-vue.vue +68 -0
  66. package/src/examples/dashboard/dashboard.js +43 -42
  67. package/src/examples/dashboard/dashboard.stories.js +46 -16
  68. package/src/examples/dashboard/mode.js +1 -1
  69. package/src/examples/dashboard/primitive-content.js +248 -248
  70. package/src/examples/dashboard/primitive-section.js +25 -25
  71. package/src/examples/dashboard/router.js +1 -1
  72. package/src/examples/dashboard/social-card.js +14 -14
  73. package/src/examples/dashboard/stat-card.js +12 -12
  74. package/src/examples/dashboard/theme.js +1 -1
  75. package/src/examples/dashboard/traffic-card.js +22 -22
  76. package/src/examples/dashboard/traffic-sales-card.js +39 -39
  77. package/src/feedback/alert/alert.stories.js +2 -2
  78. package/src/feedback/alert/index.js +2 -2
  79. package/src/feedback/backdrop/backdrop.stories.js +2 -2
  80. package/src/feedback/backdrop/index.js +2 -2
  81. package/src/feedback/dialog/dialog.stories.js +2 -2
  82. package/src/feedback/dialog/index.js +2 -2
  83. package/src/feedback/progress/index.js +1 -1
  84. package/src/feedback/progress/progress.stories.js +2 -2
  85. package/src/feedback/progress/template.js +1 -1
  86. package/src/feedback/skeleton/index.js +2 -2
  87. package/src/feedback/skeleton/skeleton.stories.js +2 -2
  88. package/src/feedback/snackbar/index.js +2 -2
  89. package/src/feedback/snackbar/snackbar.stories.js +2 -2
  90. package/src/index.js +45 -45
  91. package/src/layout/container/container.stories.js +3 -3
  92. package/src/layout/container/index.js +1 -1
  93. package/src/layout/flex/flex.stories.js +2 -2
  94. package/src/layout/flex/index.js +1 -1
  95. package/src/layout/grid/grid.stories.js +2 -2
  96. package/src/layout/grid/index.js +1 -1
  97. package/src/navigation/bottom-navigation/bottom-navigation.stories.js +2 -2
  98. package/src/navigation/bottom-navigation/index.js +1 -1
  99. package/src/navigation/bottom-navigation/template.js +2 -2
  100. package/src/navigation/breadcrumbs/breadcrumbs.stories.js +2 -2
  101. package/src/navigation/breadcrumbs/index.js +1 -1
  102. package/src/navigation/breadcrumbs/template.js +2 -2
  103. package/src/navigation/drawer/drawer.stories.js +2 -2
  104. package/src/navigation/drawer/index.js +1 -1
  105. package/src/navigation/drawer/template.js +13 -13
  106. package/src/navigation/link/index.js +2 -2
  107. package/src/navigation/link/link.stories.js +2 -2
  108. package/src/navigation/menu/index.js +1 -1
  109. package/src/navigation/menu/menu.stories.js +2 -2
  110. package/src/navigation/menu/template.js +1 -1
  111. package/src/navigation/pagination/index.js +1 -1
  112. package/src/navigation/pagination/pagination.stories.js +2 -2
  113. package/src/navigation/pagination/template.js +4 -4
  114. package/src/navigation/speed-dial/index.js +1 -1
  115. package/src/navigation/speed-dial/speed-dial.stories.js +2 -2
  116. package/src/navigation/speed-dial/template.js +1 -1
  117. package/src/navigation/stepper/index.js +1 -1
  118. package/src/navigation/stepper/stepper.stories.js +2 -2
  119. package/src/navigation/stepper/template.js +1 -1
  120. package/src/navigation/tabs/index.js +1 -1
  121. package/src/navigation/tabs/tabs.stories.js +2 -2
  122. package/src/navigation/tabs/template.js +1 -1
  123. package/src/surfaces/accordion/accordion.stories.js +2 -2
  124. package/src/surfaces/accordion/index.js +1 -1
  125. package/src/surfaces/accordion/template.js +1 -1
  126. package/src/surfaces/app-bar/app-bar.stories.js +2 -2
  127. package/src/surfaces/app-bar/index.js +1 -1
  128. package/src/surfaces/card/card.stories.js +2 -2
  129. package/src/surfaces/card/index.js +1 -1
  130. package/src/surfaces/card/template.js +1 -1
  131. package/src/surfaces/paper/index.js +2 -2
  132. package/src/surfaces/paper/paper.stories.js +3 -3
  133. package/types/controls/button-group.d.ts +1 -1
  134. package/types/controls/button.d.ts +2 -2
  135. package/types/controls/checkbox.d.ts +1 -1
  136. package/types/controls/combobox.d.ts +1 -1
  137. package/types/controls/fab.d.ts +1 -1
  138. package/types/controls/icon-button.d.ts +1 -1
  139. package/types/controls/input.d.ts +1 -1
  140. package/types/controls/radio-group.d.ts +1 -1
  141. package/types/controls/rating.d.ts +1 -1
  142. package/types/controls/select.d.ts +1 -1
  143. package/types/controls/slider.d.ts +1 -1
  144. package/types/controls/switch.d.ts +1 -1
  145. package/types/data-display/avatar.d.ts +1 -1
  146. package/types/data-display/badge.d.ts +1 -1
  147. package/types/data-display/chip.d.ts +1 -1
  148. package/types/data-display/divider.d.ts +1 -1
  149. package/types/data-display/icon.d.ts +1 -1
  150. package/types/data-display/list.d.ts +1 -1
  151. package/types/data-display/material-icon.d.ts +1 -1
  152. package/types/data-display/table.d.ts +1 -1
  153. package/types/data-display/tooltip.d.ts +1 -1
  154. package/types/data-display/typography.d.ts +1 -1
  155. package/types/data-display/virtual-list.d.ts +1 -1
  156. package/types/feedback/alert.d.ts +1 -1
  157. package/types/feedback/backdrop.d.ts +1 -1
  158. package/types/feedback/dialog.d.ts +1 -1
  159. package/types/feedback/progress.d.ts +1 -1
  160. package/types/feedback/skeleton.d.ts +1 -1
  161. package/types/feedback/snackbar.d.ts +1 -1
  162. package/types/layout/container.d.ts +1 -1
  163. package/types/layout/flex.d.ts +1 -1
  164. package/types/layout/grid.d.ts +1 -1
  165. package/types/navigation/bottom-navigation.d.ts +1 -1
  166. package/types/navigation/breadcrumbs.d.ts +1 -1
  167. package/types/navigation/drawer.d.ts +1 -1
  168. package/types/navigation/link.d.ts +1 -1
  169. package/types/navigation/menu.d.ts +1 -1
  170. package/types/navigation/pagination.d.ts +1 -1
  171. package/types/navigation/speed-dial.d.ts +1 -1
  172. package/types/navigation/stepper.d.ts +1 -1
  173. package/types/navigation/tabs.d.ts +1 -1
  174. package/types/surfaces/accordion.d.ts +1 -1
  175. package/types/surfaces/app-bar.d.ts +1 -1
  176. package/types/surfaces/card.d.ts +1 -1
  177. package/types/surfaces/paper.d.ts +1 -1
@@ -1,15 +1,15 @@
1
1
  import { html } from "@inglorious/web"
2
2
 
3
- import { button } from "../../controls/button"
4
- import { avatar } from "../../data-display/avatar"
5
- import { divider } from "../../data-display/divider"
6
- import { icon } from "../../data-display/icon"
7
- import { materialIcon } from "../../data-display/material-icon"
8
- import { flex } from "../../layout/flex"
9
- import { breadcrumbs } from "../../navigation/breadcrumbs"
10
- import { appBar } from "../../surfaces/app-bar"
3
+ import { Button } from "../../controls/button"
4
+ import { Avatar } from "../../data-display/avatar"
5
+ import { Divider } from "../../data-display/divider"
6
+ import { Icon } from "../../data-display/icon"
7
+ import { MaterialIcon } from "../../data-display/material-icon"
8
+ import { Flex } from "../../layout/flex"
9
+ import { Breadcrumbs } from "../../navigation/breadcrumbs"
10
+ import { AppBar } from "../../surfaces/app-bar"
11
11
 
12
- export const appHeader = {
12
+ export const AppHeader = {
13
13
  render(entity, api) {
14
14
  const themeEntity = api.getEntity("theme")
15
15
  const modeEntity = api.getEntity("mode")
@@ -30,116 +30,116 @@ export const appHeader = {
30
30
 
31
31
  return html`
32
32
  <div class="iw-dashboard-header">
33
- ${appBar.render({
33
+ ${AppBar.render({
34
34
  position: "static",
35
35
  elevated: false,
36
36
  children: html`
37
- ${flex.render({
37
+ ${Flex.render({
38
38
  justify: "between",
39
39
  align: "center",
40
40
  gap: "md",
41
41
  className: "iw-dashboard-header-row",
42
42
  children: [
43
- button.render({
43
+ Button.render({
44
44
  color: "secondary",
45
45
  variant: "ghost",
46
46
  shape: "square",
47
- children: materialIcon.render({ name: "menu", size: "lg" }),
47
+ children: MaterialIcon.render({ name: "menu", size: "lg" }),
48
48
  "aria-label": "Toggle navigation",
49
49
  onClick: () => api.notify(`#appDrawer:toggle`),
50
50
  }),
51
- flex.render({
51
+ Flex.render({
52
52
  align: "center",
53
53
  gap: "sm",
54
54
  className: "iw-dashboard-header-nav",
55
55
  children: [
56
- button.render({
56
+ Button.render({
57
57
  color: "secondary",
58
58
  variant: "ghost",
59
59
  children: "Dashboard",
60
60
  }),
61
- button.render({
61
+ Button.render({
62
62
  color: "secondary",
63
63
  variant: "ghost",
64
64
  children: "Users",
65
65
  }),
66
- button.render({
66
+ Button.render({
67
67
  color: "secondary",
68
68
  variant: "ghost",
69
69
  children: "Settings",
70
70
  }),
71
71
  ],
72
72
  }),
73
- flex.render({
73
+ Flex.render({
74
74
  align: "center",
75
75
  gap: "sm",
76
76
  className: "iw-dashboard-header-actions",
77
77
  children: [
78
- button.render({
78
+ Button.render({
79
79
  color: "secondary",
80
80
  variant: "ghost",
81
81
  shape: "square",
82
- children: materialIcon.render({
82
+ children: MaterialIcon.render({
83
83
  name: "notifications",
84
84
  size: "lg",
85
85
  }),
86
86
  "aria-label": "Notifications",
87
87
  }),
88
- button.render({
88
+ Button.render({
89
89
  color: "secondary",
90
90
  variant: "ghost",
91
91
  shape: "square",
92
- children: materialIcon.render({
92
+ children: MaterialIcon.render({
93
93
  name: "format_list_bulleted",
94
94
  }),
95
95
  "aria-label": "Tasks",
96
96
  }),
97
- button.render({
97
+ Button.render({
98
98
  color: "secondary",
99
99
  variant: "ghost",
100
100
  shape: "square",
101
- children: materialIcon.render({
101
+ children: MaterialIcon.render({
102
102
  name: "mail",
103
103
  size: "lg",
104
104
  }),
105
105
  "aria-label": "Messages",
106
106
  }),
107
- divider.render({ orientation: "vertical" }),
107
+ Divider.render({ orientation: "vertical" }),
108
108
 
109
- button.render({
109
+ Button.render({
110
110
  color: "secondary",
111
111
  variant: "ghost",
112
112
  shape: "square",
113
- children: icon.render({
113
+ children: Icon.render({
114
114
  children: html`<i class=${themeIcon}></i>`,
115
115
  size: "lg",
116
116
  }),
117
117
  "aria-label": `Theme: ${themeName}`,
118
118
  onClick: () => api.notify("#theme:toggle"),
119
119
  }),
120
- button.render({
120
+ Button.render({
121
121
  color: "secondary",
122
122
  variant: "ghost",
123
123
  shape: "square",
124
- children: materialIcon.render({
124
+ children: MaterialIcon.render({
125
125
  name: modeIcon,
126
126
  size: "lg",
127
127
  }),
128
128
  "aria-label": `Mode: ${themeMode}`,
129
129
  onClick: () => api.notify("#mode:toggle"),
130
130
  }),
131
- divider.render({ orientation: "vertical" }),
132
- avatar.render({ src: "/antony.jpeg" }),
131
+ Divider.render({ orientation: "vertical" }),
132
+ Avatar.render({ src: "/antony.jpeg" }),
133
133
  ],
134
134
  }),
135
135
  ],
136
136
  })}
137
137
  `,
138
138
  })}
139
- ${flex.render({
139
+ ${Flex.render({
140
140
  align: "center",
141
141
  className: "iw-dashboard-header-row iw-dashboard-breadcrumbs",
142
- children: breadcrumbs.render({
142
+ children: Breadcrumbs.render({
143
143
  items: [{ label: "Home", href: "#" }, { label: "Dashboard" }],
144
144
  }),
145
145
  })}
@@ -0,0 +1,76 @@
1
+ import { Container } from "../../layout/container/index.js"
2
+ import { Flex } from "../../layout/flex/index.js"
3
+ import { Grid } from "../../layout/grid/index.js"
4
+ import { AppDrawer } from "./app-drawer.js"
5
+ import { AppHeader } from "./app-header.js"
6
+ import { socialCards, statCards } from "./data.js"
7
+ import { PrimitiveSection } from "./primitive-section.js"
8
+ import { SocialCard } from "./social-card.js"
9
+ import { StatCard } from "./stat-card.js"
10
+ import { TrafficCard } from "./traffic-card.js"
11
+ import { TrafficSalesCard } from "./traffic-sales-card.js"
12
+
13
+ export const DashboardJsx = {
14
+ render(entity, api) {
15
+ const appDrawer = api.getEntity("appDrawer")
16
+ const dashboardClassName = [
17
+ "iw-dashboard",
18
+ appDrawer.isHidden && "iw-dashboard-drawer-hidden",
19
+ appDrawer.isCollapsed && "iw-dashboard-drawer-collapsed",
20
+ ]
21
+ .filter(Boolean)
22
+ .join(" ")
23
+
24
+ const router = api.getEntity("router")
25
+ const isDashboardRoot = !router || router.path === "/"
26
+
27
+ return (
28
+ <Flex direction="column" className={dashboardClassName}>
29
+ <AppDrawer />
30
+
31
+ <Flex element="main" direction="column" className="iw-dashboard-main">
32
+ <AppHeader />
33
+
34
+ <Container
35
+ maxWidth="xl"
36
+ padding="lg"
37
+ className="iw-dashboard-container"
38
+ >
39
+ {isDashboardRoot && (
40
+ <Flex direction="column" gap="lg">
41
+ <Grid minColumnWidth="18rem" gap="lg">
42
+ {statCards.map((card) => (
43
+ <StatCard key={card.id} {...card} />
44
+ ))}
45
+ </Grid>
46
+
47
+ <TrafficCard />
48
+
49
+ <Grid columns={3} gap="lg">
50
+ {socialCards.map((card) => (
51
+ <SocialCard key={card.id} {...card} />
52
+ ))}
53
+ </Grid>
54
+
55
+ <TrafficSalesCard />
56
+ </Flex>
57
+ )}
58
+
59
+ {!isDashboardRoot && <PrimitiveSection />}
60
+ </Container>
61
+
62
+ <Flex
63
+ element="footer"
64
+ justify="between"
65
+ gap="md"
66
+ padding="md"
67
+ className="iw-dashboard-footer"
68
+ >
69
+ <div>Admin dashboard example © 2026</div>
70
+ <div>Built with Inglorious UI primitives and charts</div>
71
+ </Flex>
72
+ </Flex>
73
+ </Flex>
74
+ )
75
+ },
76
+ }
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <Flex direction="column" :className="dashboardClassName">
3
+ <AppDrawer />
4
+
5
+ <Flex element="main" direction="column" className="iw-dashboard-main">
6
+ <AppHeader />
7
+
8
+ <Container maxWidth="xl" padding="lg" className="iw-dashboard-container">
9
+ <Flex v-if="isDashboardRoot" direction="column" gap="lg">
10
+ <Grid minColumnWidth="18rem" gap="lg">
11
+ <StatCard v-for="card in statCards" :key="card.id" v-bind="card" />
12
+ </Grid>
13
+
14
+ <TrafficCard />
15
+
16
+ <Grid :columns="3" gap="lg">
17
+ <SocialCard
18
+ v-for="card in socialCards"
19
+ :key="card.icon"
20
+ v-bind="card"
21
+ />
22
+ </Grid>
23
+
24
+ <TrafficSalesCard />
25
+ </Flex>
26
+
27
+ <PrimitiveSection v-else />
28
+ </Container>
29
+
30
+ <Flex
31
+ element="footer"
32
+ justify="between"
33
+ gap="md"
34
+ padding="md"
35
+ className="iw-dashboard-footer"
36
+ >
37
+ <div>Admin dashboard example © 2026</div>
38
+ <div>Built with Inglorious UI primitives and charts</div>
39
+ </Flex>
40
+ </Flex>
41
+ </Flex>
42
+ </template>
43
+
44
+ <script>
45
+ import { Container } from "../../layout/container/index.js"
46
+ import { Flex } from "../../layout/flex/index.js"
47
+ import { Grid } from "../../layout/grid/index.js"
48
+ import { AppDrawer } from "./app-drawer.js"
49
+ import { AppHeader } from "./app-header.js"
50
+ import { socialCards, statCards } from "./data.js"
51
+ import { PrimitiveSection } from "./primitive-section.js"
52
+ import { SocialCard } from "./social-card.js"
53
+ import { StatCard } from "./stat-card.js"
54
+ import { TrafficCard } from "./traffic-card.js"
55
+ import { TrafficSalesCard } from "./traffic-sales-card.js"
56
+
57
+ const appDrawer = api.getEntity("appDrawer")
58
+ const dashboardClassName = [
59
+ "iw-dashboard",
60
+ appDrawer.isHidden && "iw-dashboard-drawer-hidden",
61
+ appDrawer.isCollapsed && "iw-dashboard-drawer-collapsed",
62
+ ]
63
+ .filter(Boolean)
64
+ .join(" ")
65
+
66
+ const router = api.getEntity("router")
67
+ const isDashboardRoot = !router || router.path === "/"
68
+ </script>
@@ -1,20 +1,18 @@
1
- import { html } from "@inglorious/web"
1
+ import { html, when } from "@inglorious/web"
2
2
 
3
- import { container } from "../../layout/container/index.js"
4
- import { flex } from "../../layout/flex/index.js"
5
- import { grid } from "../../layout/grid/index.js"
6
- import { appHeader } from "./app-header.js"
3
+ import { Container } from "../../layout/container/index.js"
4
+ import { Flex } from "../../layout/flex/index.js"
5
+ import { Grid } from "../../layout/grid/index.js"
6
+ import { AppHeader } from "./app-header.js"
7
7
  import { socialCards, statCards } from "./data.js"
8
- import { socialCard } from "./social-card.js"
9
- import { statCard } from "./stat-card.js"
10
- import { trafficCard } from "./traffic-card.js"
11
- import { trafficSalesCard } from "./traffic-sales-card.js"
8
+ import { SocialCard } from "./social-card.js"
9
+ import { StatCard } from "./stat-card.js"
10
+ import { TrafficCard } from "./traffic-card.js"
11
+ import { TrafficSalesCard } from "./traffic-sales-card.js"
12
12
 
13
- export const dashboard = {
13
+ export const Dashboard = {
14
14
  render(entity, api) {
15
15
  const appDrawer = api.getEntity("appDrawer")
16
- const router = api.getEntity("router")
17
-
18
16
  const dashboardClassName = [
19
17
  "iw-dashboard",
20
18
  appDrawer.isHidden && "iw-dashboard-drawer-hidden",
@@ -23,50 +21,53 @@ export const dashboard = {
23
21
  .filter(Boolean)
24
22
  .join(" ")
25
23
 
24
+ const router = api.getEntity("router")
26
25
  const isDashboardRoot = !router || router.path === "/"
27
26
 
28
- let mainContent
29
- if (isDashboardRoot) {
30
- mainContent = flex.render({
31
- direction: "column",
32
- gap: "lg",
33
- children: [
34
- grid.render({
35
- minColumnWidth: "18rem",
36
- gap: "lg",
37
- children: statCards.map((card) => statCard.render(card, api)),
38
- }),
39
- trafficCard.render(entity, api),
40
- grid.render({
41
- columns: 3,
42
- gap: "lg",
43
- children: socialCards.map((card) => socialCard.render(card, api)),
44
- }),
45
- trafficSalesCard.render(entity, api),
46
- ],
47
- })
48
- } else {
49
- mainContent = api.render("primitiveSection")
50
- }
51
-
52
- return flex.render({
27
+ return Flex.render({
53
28
  direction: "column",
54
29
  className: dashboardClassName,
55
30
  children: [
56
31
  api.render("appDrawer"),
57
- flex.render({
32
+ Flex.render({
58
33
  element: "main",
59
34
  direction: "column",
60
35
  className: "iw-dashboard-main",
61
36
  children: [
62
- appHeader.render(entity, api),
63
- container.render({
37
+ AppHeader.render(entity, api),
38
+ Container.render({
64
39
  maxWidth: "xl",
65
40
  padding: "lg",
66
41
  className: "iw-dashboard-container",
67
- children: mainContent,
42
+ children: when(
43
+ isDashboardRoot,
44
+ () =>
45
+ Flex.render({
46
+ direction: "column",
47
+ gap: "lg",
48
+ children: [
49
+ Grid.render({
50
+ minColumnWidth: "18rem",
51
+ gap: "lg",
52
+ children: statCards.map((card) =>
53
+ StatCard.render(card, api),
54
+ ),
55
+ }),
56
+ TrafficCard.render(entity, api),
57
+ Grid.render({
58
+ columns: 3,
59
+ gap: "lg",
60
+ children: socialCards.map((card) =>
61
+ SocialCard.render(card, api),
62
+ ),
63
+ }),
64
+ TrafficSalesCard.render(entity, api),
65
+ ],
66
+ }),
67
+ () => api.render("primitiveSection"),
68
+ ),
68
69
  }),
69
- flex.render({
70
+ Flex.render({
70
71
  element: "footer",
71
72
  justify: "between",
72
73
  gap: "md",
@@ -6,25 +6,29 @@ import {
6
6
  createEntityRender,
7
7
  notifyActionArgType,
8
8
  } from "../../stories/notifyStory.js"
9
- import { appDrawer } from "./app-drawer.js"
10
- import { dashboard } from "./dashboard.js"
11
- import { mode } from "./mode.js"
12
- import { primitiveSection } from "./primitive-section.js"
13
- import { theme } from "./theme.js"
9
+ import { AppDrawer } from "./app-drawer.js"
10
+ import { AppHeader } from "./app-header.js"
11
+ import { Dashboard } from "./dashboard.js"
12
+ import { DashboardJsx } from "./dashboard-jsx.jsx"
13
+ import { DashboardVue } from "./dashboard-vue.vue"
14
+ import { Mode } from "./mode.js"
15
+ import { PrimitiveSection } from "./primitive-section.js"
16
+ import { Theme } from "./theme.js"
17
+
18
+ const baseTypes = {
19
+ Theme,
20
+ Mode,
21
+ AppDrawer,
22
+ AppHeader,
23
+ PrimitiveSection,
24
+ area: areaChart,
25
+ bar: barChart,
26
+ line: lineChart,
27
+ }
14
28
 
15
29
  export default {
16
30
  title: "Examples/AdminDashboard",
17
31
  tags: ["autodocs"],
18
- render: createEntityRender({
19
- theme,
20
- mode,
21
- appDrawer,
22
- dashboard,
23
- primitiveSection,
24
- area: areaChart,
25
- bar: barChart,
26
- line: lineChart,
27
- }),
28
32
  argTypes: {
29
33
  ...notifyActionArgType,
30
34
  },
@@ -40,8 +44,34 @@ export default {
40
44
  }
41
45
 
42
46
  export const Default = {
47
+ render: createEntityRender({
48
+ ...baseTypes,
49
+ Dashboard,
50
+ }),
51
+ args: {
52
+ id: "dashboard",
53
+ type: "Dashboard",
54
+ },
55
+ }
56
+
57
+ export const Jsx = {
58
+ render: createEntityRender({
59
+ ...baseTypes,
60
+ Dashboard: DashboardJsx,
61
+ }),
62
+ args: {
63
+ id: "dashboard",
64
+ type: "Dashboard",
65
+ },
66
+ }
67
+
68
+ export const Vue = {
69
+ render: createEntityRender({
70
+ ...baseTypes,
71
+ Dashboard: DashboardVue,
72
+ }),
43
73
  args: {
44
74
  id: "dashboard",
45
- type: "dashboard",
75
+ type: "Dashboard",
46
76
  },
47
77
  }
@@ -6,7 +6,7 @@ import {
6
6
  nextMode,
7
7
  } from "./theme-utils.js"
8
8
 
9
- export const mode = {
9
+ export const Mode = {
10
10
  create(entity) {
11
11
  entity.mode ??= DEFAULTS.mode
12
12
  applyTheme(getTheme(), entity.mode)