@inglorious/ui 1.0.1 → 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 (206) 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/template.js +2 -2
  5. package/src/controls/button-group/button-group.stories.js +2 -2
  6. package/src/controls/button-group/index.js +1 -1
  7. package/src/controls/button-group/template.js +4 -4
  8. package/src/controls/checkbox/checkbox.stories.js +2 -2
  9. package/src/controls/checkbox/index.js +1 -1
  10. package/src/controls/checkbox/template.js +2 -2
  11. package/src/controls/combobox/combobox.stories.js +3 -3
  12. package/src/controls/combobox/index.js +2 -2
  13. package/src/controls/combobox/template.js +35 -14
  14. package/src/controls/fab/fab.stories.js +2 -2
  15. package/src/controls/fab/index.js +1 -1
  16. package/src/controls/fab/template.js +4 -4
  17. package/src/controls/icon-button/icon-button.stories.js +2 -2
  18. package/src/controls/icon-button/index.js +1 -1
  19. package/src/controls/icon-button/template.js +4 -4
  20. package/src/controls/input/index.js +1 -1
  21. package/src/controls/input/input.stories.js +2 -2
  22. package/src/controls/input/template.js +2 -2
  23. package/src/controls/radio-group/index.js +1 -1
  24. package/src/controls/radio-group/radio-group.stories.js +2 -2
  25. package/src/controls/radio-group/template.js +2 -2
  26. package/src/controls/rating/index.js +1 -1
  27. package/src/controls/rating/rating.stories.js +2 -2
  28. package/src/controls/rating/template.js +2 -2
  29. package/src/controls/select/index.js +1 -1
  30. package/src/controls/select/select.stories.js +2 -2
  31. package/src/controls/select/template.js +2 -2
  32. package/src/controls/slider/index.js +1 -1
  33. package/src/controls/slider/slider.stories.js +2 -2
  34. package/src/controls/slider/template.js +2 -2
  35. package/src/controls/switch/index.js +1 -1
  36. package/src/controls/switch/switch.stories.js +2 -2
  37. package/src/controls/switch/template.js +2 -2
  38. package/src/data-display/avatar/avatar.stories.js +2 -2
  39. package/src/data-display/avatar/index.js +1 -1
  40. package/src/data-display/avatar/template.js +2 -1
  41. package/src/data-display/badge/badge.stories.js +2 -2
  42. package/src/data-display/badge/index.js +1 -1
  43. package/src/data-display/badge/template.js +7 -0
  44. package/src/data-display/chip/chip.stories.js +2 -2
  45. package/src/data-display/chip/index.js +1 -1
  46. package/src/data-display/chip/template.js +7 -0
  47. package/src/data-display/data-grid/data-grid.stories.js +4 -4
  48. package/src/data-display/data-grid/filters/index.js +10 -10
  49. package/src/data-display/data-grid/filters/input.js +3 -3
  50. package/src/data-display/data-grid/filters/range.js +4 -4
  51. package/src/data-display/data-grid/filters/select.js +3 -3
  52. package/src/data-display/data-grid/index.js +2 -2
  53. package/src/data-display/data-grid/template.js +40 -28
  54. package/src/data-display/divider/divider.stories.js +2 -2
  55. package/src/data-display/divider/index.js +1 -1
  56. package/src/data-display/divider/template.js +7 -0
  57. package/src/data-display/icon/icon-implementations.mdx +4 -4
  58. package/src/data-display/icon/icon-utf8.stories.js +9 -9
  59. package/src/data-display/icon/icon.stories.js +2 -2
  60. package/src/data-display/icon/index.js +1 -1
  61. package/src/data-display/icon/template.js +7 -0
  62. package/src/data-display/list/index.js +2 -2
  63. package/src/data-display/list/list.stories.js +2 -2
  64. package/src/data-display/list/template.js +22 -13
  65. package/src/data-display/material-icon/index.js +1 -1
  66. package/src/data-display/material-icon/material-icon.stories.js +2 -2
  67. package/src/data-display/material-icon/template.js +7 -0
  68. package/src/data-display/table/index.js +1 -1
  69. package/src/data-display/table/table.stories.js +2 -2
  70. package/src/data-display/table/template.js +19 -1
  71. package/src/data-display/tooltip/index.js +1 -1
  72. package/src/data-display/tooltip/template.js +2 -0
  73. package/src/data-display/tooltip/tooltip.stories.js +2 -2
  74. package/src/data-display/typography/index.js +1 -1
  75. package/src/data-display/typography/template.js +2 -0
  76. package/src/data-display/typography/typography.stories.js +2 -2
  77. package/src/data-display/virtual-list/index.js +1 -1
  78. package/src/data-display/virtual-list/template.js +4 -2
  79. package/src/examples/dashboard/app-drawer.js +15 -15
  80. package/src/examples/dashboard/app-header.js +33 -33
  81. package/src/examples/dashboard/dashboard-jsx.jsx +76 -0
  82. package/src/examples/dashboard/dashboard-vue.vue +68 -0
  83. package/src/examples/dashboard/dashboard.js +43 -42
  84. package/src/examples/dashboard/dashboard.stories.js +46 -16
  85. package/src/examples/dashboard/mode.js +1 -1
  86. package/src/examples/dashboard/primitive-content.js +248 -248
  87. package/src/examples/dashboard/primitive-section.js +25 -25
  88. package/src/examples/dashboard/router.js +1 -1
  89. package/src/examples/dashboard/social-card.js +14 -14
  90. package/src/examples/dashboard/stat-card.js +12 -12
  91. package/src/examples/dashboard/theme.js +1 -1
  92. package/src/examples/dashboard/traffic-card.js +22 -22
  93. package/src/examples/dashboard/traffic-sales-card.js +39 -39
  94. package/src/feedback/alert/alert.stories.js +2 -2
  95. package/src/feedback/alert/index.js +2 -2
  96. package/src/feedback/alert/template.js +2 -0
  97. package/src/feedback/backdrop/backdrop.stories.js +2 -2
  98. package/src/feedback/backdrop/index.js +2 -2
  99. package/src/feedback/backdrop/template.js +2 -0
  100. package/src/feedback/dialog/dialog.stories.js +2 -2
  101. package/src/feedback/dialog/index.js +2 -2
  102. package/src/feedback/dialog/template.js +2 -0
  103. package/src/feedback/progress/index.js +1 -1
  104. package/src/feedback/progress/progress.stories.js +2 -2
  105. package/src/feedback/progress/template.js +3 -1
  106. package/src/feedback/skeleton/index.js +2 -2
  107. package/src/feedback/skeleton/skeleton.stories.js +2 -2
  108. package/src/feedback/skeleton/template.js +2 -0
  109. package/src/feedback/snackbar/index.js +2 -2
  110. package/src/feedback/snackbar/snackbar.stories.js +2 -2
  111. package/src/feedback/snackbar/template.js +2 -0
  112. package/src/index.js +45 -45
  113. package/src/layout/container/container.stories.js +3 -3
  114. package/src/layout/container/index.js +1 -1
  115. package/src/layout/container/template.js +2 -0
  116. package/src/layout/flex/flex.stories.js +2 -2
  117. package/src/layout/flex/index.js +1 -1
  118. package/src/layout/flex/template.js +2 -3
  119. package/src/layout/grid/grid.stories.js +2 -2
  120. package/src/layout/grid/index.js +1 -1
  121. package/src/layout/grid/template.js +2 -3
  122. package/src/navigation/bottom-navigation/bottom-navigation.stories.js +2 -2
  123. package/src/navigation/bottom-navigation/index.js +1 -1
  124. package/src/navigation/bottom-navigation/template.js +16 -2
  125. package/src/navigation/breadcrumbs/breadcrumbs.stories.js +2 -2
  126. package/src/navigation/breadcrumbs/index.js +1 -1
  127. package/src/navigation/breadcrumbs/template.js +16 -2
  128. package/src/navigation/drawer/drawer.stories.js +2 -2
  129. package/src/navigation/drawer/index.js +1 -1
  130. package/src/navigation/drawer/template.js +15 -13
  131. package/src/navigation/link/index.js +2 -2
  132. package/src/navigation/link/link.stories.js +2 -2
  133. package/src/navigation/link/template.js +2 -0
  134. package/src/navigation/menu/index.js +1 -1
  135. package/src/navigation/menu/menu.stories.js +2 -2
  136. package/src/navigation/menu/template.js +15 -1
  137. package/src/navigation/pagination/index.js +1 -1
  138. package/src/navigation/pagination/pagination.stories.js +2 -2
  139. package/src/navigation/pagination/template.js +20 -4
  140. package/src/navigation/speed-dial/index.js +1 -1
  141. package/src/navigation/speed-dial/speed-dial.stories.js +2 -2
  142. package/src/navigation/speed-dial/template.js +15 -1
  143. package/src/navigation/stepper/index.js +1 -1
  144. package/src/navigation/stepper/stepper.stories.js +2 -2
  145. package/src/navigation/stepper/template.js +15 -1
  146. package/src/navigation/tabs/index.js +1 -1
  147. package/src/navigation/tabs/tabs.stories.js +2 -2
  148. package/src/navigation/tabs/template.js +17 -1
  149. package/src/surfaces/accordion/accordion.stories.js +2 -2
  150. package/src/surfaces/accordion/index.js +1 -1
  151. package/src/surfaces/accordion/template.js +15 -1
  152. package/src/surfaces/app-bar/app-bar.stories.js +2 -2
  153. package/src/surfaces/app-bar/index.js +1 -1
  154. package/src/surfaces/app-bar/template.js +2 -0
  155. package/src/surfaces/card/card.stories.js +2 -2
  156. package/src/surfaces/card/index.js +1 -1
  157. package/src/surfaces/card/template.js +19 -1
  158. package/src/surfaces/paper/index.js +2 -2
  159. package/src/surfaces/paper/paper.stories.js +3 -3
  160. package/src/surfaces/paper/template.js +2 -0
  161. package/types/controls/button-group.d.ts +1 -1
  162. package/types/controls/button.d.ts +2 -2
  163. package/types/controls/checkbox.d.ts +1 -1
  164. package/types/controls/combobox.d.ts +2 -1
  165. package/types/controls/fab.d.ts +1 -1
  166. package/types/controls/icon-button.d.ts +1 -1
  167. package/types/controls/input.d.ts +1 -1
  168. package/types/controls/radio-group.d.ts +1 -1
  169. package/types/controls/rating.d.ts +1 -1
  170. package/types/controls/select.d.ts +1 -1
  171. package/types/controls/slider.d.ts +1 -1
  172. package/types/controls/switch.d.ts +1 -1
  173. package/types/data-display/avatar.d.ts +1 -1
  174. package/types/data-display/badge.d.ts +1 -1
  175. package/types/data-display/chip.d.ts +1 -1
  176. package/types/data-display/data-grid.d.ts +2 -1
  177. package/types/data-display/divider.d.ts +1 -1
  178. package/types/data-display/icon.d.ts +1 -1
  179. package/types/data-display/list.d.ts +2 -1
  180. package/types/data-display/material-icon.d.ts +1 -1
  181. package/types/data-display/table.d.ts +2 -1
  182. package/types/data-display/tooltip.d.ts +1 -1
  183. package/types/data-display/typography.d.ts +1 -1
  184. package/types/data-display/virtual-list.d.ts +1 -1
  185. package/types/feedback/alert.d.ts +1 -1
  186. package/types/feedback/backdrop.d.ts +1 -1
  187. package/types/feedback/dialog.d.ts +1 -1
  188. package/types/feedback/progress.d.ts +1 -1
  189. package/types/feedback/skeleton.d.ts +1 -1
  190. package/types/feedback/snackbar.d.ts +1 -1
  191. package/types/layout/container.d.ts +1 -1
  192. package/types/layout/flex.d.ts +1 -1
  193. package/types/layout/grid.d.ts +1 -1
  194. package/types/navigation/bottom-navigation.d.ts +2 -1
  195. package/types/navigation/breadcrumbs.d.ts +2 -1
  196. package/types/navigation/drawer.d.ts +1 -1
  197. package/types/navigation/link.d.ts +1 -1
  198. package/types/navigation/menu.d.ts +2 -1
  199. package/types/navigation/pagination.d.ts +2 -1
  200. package/types/navigation/speed-dial.d.ts +2 -1
  201. package/types/navigation/stepper.d.ts +2 -1
  202. package/types/navigation/tabs.d.ts +2 -1
  203. package/types/surfaces/accordion.d.ts +2 -1
  204. package/types/surfaces/app-bar.d.ts +1 -1
  205. package/types/surfaces/card.d.ts +2 -1
  206. package/types/surfaces/paper.d.ts +1 -1
@@ -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)