@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
@@ -7,11 +7,11 @@
7
7
 
8
8
  import { classMap, html, repeat, when } from "@inglorious/web"
9
9
 
10
- import { input } from "../../controls/input/index.js"
11
- import { select } from "../../controls/select/index.js"
12
- import { pagination } from "../../navigation/pagination/index.js"
13
- import { virtualList } from "../virtual-list/index.js"
14
- import { filters } from "./filters"
10
+ import { Input } from "../../controls/input/index.js"
11
+ import { Select } from "../../controls/select/index.js"
12
+ import { Pagination } from "../../navigation/pagination/index.js"
13
+ import { VirtualList } from "../virtual-list/index.js"
14
+ import { Filters } from "./filters"
15
15
  import {
16
16
  getPaginationInfo,
17
17
  getRowKeyValue,
@@ -25,7 +25,7 @@ const PRETTY_PAGE = 1
25
25
  const FIRST_PAGE = 0
26
26
  const LAST_PAGE = 1
27
27
 
28
- export const dataGrid = {
28
+ export const DataGrid = {
29
29
  /**
30
30
  * Main entrypoint for the data grid template. It delegates to the base grid renderer so overrides can still reuse it.
31
31
  * Data grids support sorting, filtering, selection, pagination, and optional virtualization.
@@ -108,7 +108,7 @@ export const dataGrid = {
108
108
  ${column.title} ${getSortIcon(getSortDirection(props, column.id))}
109
109
  </div>
110
110
 
111
- ${column.isFilterable && filters.render(props, column)}
111
+ ${column.isFilterable && Filters.render(props, column)}
112
112
 
113
113
  <div
114
114
  class="iw-data-grid-column-resizer"
@@ -130,7 +130,7 @@ export const dataGrid = {
130
130
  */
131
131
  renderSearchbar(props) {
132
132
  return html`<div class="iw-data-grid-searchbar">
133
- ${input.render({
133
+ ${Input.render({
134
134
  size: "sm",
135
135
  isFullWidth: true,
136
136
  name: "search",
@@ -164,7 +164,7 @@ export const dataGrid = {
164
164
  const virtualState = getVirtualizationState(props, rows.length)
165
165
  const virtualEntity = {
166
166
  id: props.id,
167
- type: "dataGridVirtualRows",
167
+ type: "DataGridVirtualRows",
168
168
  items: rows,
169
169
  className: "iw-data-grid-body",
170
170
  scrollTop: virtualState.scrollTop,
@@ -190,7 +190,7 @@ export const dataGrid = {
190
190
  }),
191
191
  }
192
192
 
193
- return virtualList.render(virtualEntity, virtualApi)
193
+ return VirtualList.render(virtualEntity, virtualApi)
194
194
  },
195
195
 
196
196
  /**
@@ -300,7 +300,7 @@ export const dataGrid = {
300
300
  */
301
301
  renderPagination(props, paginationInfo) {
302
302
  return html`<div class="iw-data-grid-row">
303
- ${pagination.renderControl(
303
+ ${Pagination.renderControl(
304
304
  {
305
305
  buttonSize: "sm",
306
306
  buttonVariant: "outline",
@@ -313,7 +313,7 @@ export const dataGrid = {
313
313
  onChange: () => props.onPageChange?.(FIRST_PAGE),
314
314
  },
315
315
  )}
316
- ${pagination.renderControl(
316
+ ${Pagination.renderControl(
317
317
  {
318
318
  buttonSize: "sm",
319
319
  buttonVariant: "outline",
@@ -326,7 +326,7 @@ export const dataGrid = {
326
326
  onChange: () => props.onPagePrev?.(),
327
327
  },
328
328
  )}
329
- ${input.render({
329
+ ${Input.render({
330
330
  name: "page",
331
331
  size: "sm",
332
332
  inputType: "number",
@@ -337,7 +337,7 @@ export const dataGrid = {
337
337
  })}
338
338
  /
339
339
  <span>${paginationInfo.totalPages}</span>
340
- ${pagination.renderControl(
340
+ ${Pagination.renderControl(
341
341
  {
342
342
  buttonSize: "sm",
343
343
  buttonVariant: "outline",
@@ -350,7 +350,7 @@ export const dataGrid = {
350
350
  onChange: () => props.onPageNext?.(),
351
351
  },
352
352
  )}
353
- ${pagination.renderControl(
353
+ ${Pagination.renderControl(
354
354
  {
355
355
  buttonSize: "sm",
356
356
  buttonVariant: "outline",
@@ -370,7 +370,7 @@ export const dataGrid = {
370
370
  renderPageSize(props, pagination) {
371
371
  return html`<div class="iw-data-grid-footer-row">
372
372
  <div>Page size:</div>
373
- ${select.render({
373
+ ${Select.render({
374
374
  size: "sm",
375
375
  value: pagination.pageSize,
376
376
  options: pagination.pageSizes,
@@ -1,12 +1,12 @@
1
1
  import { render } from "@inglorious/web/test"
2
2
 
3
3
  import { createRender } from "../../stories/notifyStory.js"
4
- import { divider } from "."
4
+ import { Divider } from "."
5
5
 
6
6
  export default {
7
7
  title: "Data Display/Divider",
8
8
  tags: ["autodocs"],
9
- render: createRender(divider),
9
+ render: createRender(Divider),
10
10
  argTypes: {
11
11
  orientation: {
12
12
  control: "select",
@@ -1,3 +1,3 @@
1
1
  import * as renderers from "./template.js"
2
2
 
3
- export const divider = { ...renderers }
3
+ export const Divider = { ...renderers }
@@ -83,13 +83,13 @@ Use this page as a quick reference for supported icon strategies in `@inglorious
83
83
  <div className="iw-icon-tab-panels">
84
84
  <section className="iw-icon-tab-panel iw-icon-tab-panel-generic">
85
85
  <p>Use <code>@inglorious/ui/icon</code> for glyphs, emoji, and simple symbols. Reference: <a href="/?path=/story/data-display-icon--unicode">UTF-8 Icons</a></p>
86
- <pre><code>{`icon.render({ children: "★", size: "md", color: "primary" })`}</code></pre>
86
+ <pre><code>{`Icon.render({ children: "★", size: "md", color: "primary" })`}</code></pre>
87
87
  <div className="iw-icon-example">★ ⚑ ♫</div>
88
88
  </section>
89
89
 
90
90
  <section className="iw-icon-tab-panel iw-icon-tab-panel-svg">
91
91
  <p>Use inline SVG when you want a custom icon pack without font dependencies.</p>
92
- <pre><code>{`icon.render({
92
+ <pre><code>{`Icon.render({
93
93
  children: html\`<svg viewBox="0 0 24 24" ...>...</svg>\`,
94
94
  size: "md",
95
95
  })`}</code></pre>
@@ -109,7 +109,7 @@ Use this page as a quick reference for supported icon strategies in `@inglorious
109
109
 
110
110
  <section className="iw-icon-tab-panel iw-icon-tab-panel-material">
111
111
  <p>Use <code>@inglorious/ui/material-icon</code> when Material Symbols fonts are loaded. Reference: <a href="https://fonts.google.com/icons?icon.set=Material+Icons" target="_blank">Material Icons</a></p>
112
- <pre><code>{`materialIcon.render({ name: "home", filled: true, size: "md" })`}</code></pre>
112
+ <pre><code>{`MaterialIcon.render({ name: "home", filled: true, size: "md" })`}</code></pre>
113
113
  <div className="iw-icon-example">
114
114
  <span className="iw-material-symbol" aria-hidden="true">home</span>
115
115
  <span className="iw-material-symbol" aria-hidden="true">settings</span>
@@ -119,7 +119,7 @@ Use this page as a quick reference for supported icon strategies in `@inglorious
119
119
 
120
120
  <section className="iw-icon-tab-panel iw-icon-tab-panel-fa">
121
121
  <p>Load Font Awesome CSS globally, then pass an icon element as <code>children</code>. Reference: <a href="https://fontawesome.com/search" target="_blank">Font Awesome Icons</a></p>
122
- <pre><code>{`icon.render({
122
+ <pre><code>{`Icon.render({
123
123
  children: html\`<i class="fa-solid fa-user" aria-hidden="true"></i>\`,
124
124
  })`}</code></pre>
125
125
 
@@ -1,18 +1,18 @@
1
- import { virtualList } from "@inglorious/ui/virtual-list"
1
+ import { VirtualList } from "@inglorious/ui/virtual-list"
2
2
  import { html, repeat } from "@inglorious/web"
3
3
 
4
- import { button } from "../../controls/button"
4
+ import { Button } from "../../controls/button"
5
5
  import {
6
6
  createEntityRender,
7
7
  notifyActionArgType,
8
8
  } from "../../stories/notifyStory.js"
9
- import { icon } from "."
9
+ import { Icon } from "."
10
10
 
11
11
  const unicodeList = {
12
- ...virtualList,
12
+ ...VirtualList,
13
13
 
14
14
  create(entity) {
15
- virtualList.create(entity)
15
+ VirtualList.create(entity)
16
16
 
17
17
  const items = []
18
18
  let rowIndex = 0
@@ -35,7 +35,7 @@ const unicodeList = {
35
35
  },
36
36
 
37
37
  render(entity, api) {
38
- return virtualList.render(entity, {
38
+ return VirtualList.render(entity, {
39
39
  ...api,
40
40
  getType: () => unicodeList,
41
41
  })
@@ -64,7 +64,7 @@ const unicodeList = {
64
64
  .toUpperCase()
65
65
  .padStart(4, "0")}`
66
66
 
67
- return button.render({
67
+ return Button.render({
68
68
  id: code,
69
69
  variant: "ghost",
70
70
  color: "default",
@@ -72,7 +72,7 @@ const unicodeList = {
72
72
  shape: "square",
73
73
  ariaLabel: label,
74
74
  onClick: () => copyGlyph(glyph),
75
- children: icon.render({
75
+ children: Icon.render({
76
76
  children: glyph,
77
77
  size,
78
78
  color: "current",
@@ -128,7 +128,7 @@ export default {
128
128
  export const Unicode = {
129
129
  args: {
130
130
  id: "unicodeList",
131
- type: "unicodeList",
131
+ type: "UnicodeList",
132
132
  start: 0,
133
133
  end: 129799,
134
134
  columns: 20,
@@ -1,10 +1,10 @@
1
1
  import { createRender } from "../../stories/notifyStory.js"
2
- import { icon } from "."
2
+ import { Icon } from "."
3
3
 
4
4
  export default {
5
5
  title: "Data Display/Icon",
6
6
  tags: ["autodocs"],
7
- render: createRender(icon),
7
+ render: createRender(Icon),
8
8
  argTypes: {
9
9
  children: { control: "text", description: "Icon glyph or inline content." },
10
10
  size: {
@@ -1,3 +1,3 @@
1
1
  import * as renderers from "./template.js"
2
2
 
3
- export const icon = { ...renderers }
3
+ export const Icon = { ...renderers }
@@ -1,4 +1,4 @@
1
1
  import * as handlers from "./handlers.js"
2
- import { list as renderers } from "./template.js"
2
+ import { List as renderers } from "./template.js"
3
3
 
4
- export const list = { ...renderers, ...handlers }
4
+ export const List = { ...renderers, ...handlers }
@@ -1,10 +1,10 @@
1
1
  import { createRender } from "../../stories/notifyStory.js"
2
- import { list } from "."
2
+ import { List } from "."
3
3
 
4
4
  export default {
5
5
  title: "Data Display/List",
6
6
  tags: ["autodocs"],
7
- render: createRender(list),
7
+ render: createRender(List),
8
8
  argTypes: {
9
9
  items: {
10
10
  control: "object",
@@ -21,13 +21,13 @@
21
21
 
22
22
  import { classMap, html, ref, repeat, when } from "@inglorious/web"
23
23
 
24
- import { iconButton } from "../../controls/icon-button"
25
- import { flex } from "../../layout/flex"
24
+ import { IconButton } from "../../controls/icon-button"
25
+ import { Flex } from "../../layout/flex"
26
26
  import { applyElementProps } from "../../shared/applyElementProps.js"
27
27
 
28
28
  const PRETTY_INDEX = 1
29
29
 
30
- export const list = {
30
+ export const List = {
31
31
  /**
32
32
  * Main entrypoint for the list component. It delegates to the base list renderer so overrides can reuse it.
33
33
  * Lists support ordered/unordered modes, nested items, and optional dividers.
@@ -158,7 +158,7 @@ export const list = {
158
158
  .filter(Boolean)
159
159
  .join(" ")
160
160
 
161
- return flex.render({
161
+ return Flex.render({
162
162
  element: "li",
163
163
  padding: "sm",
164
164
  direction: "column",
@@ -170,12 +170,12 @@ export const list = {
170
170
  props.onItemClick?.(raw ?? item, path)
171
171
  },
172
172
  children: [
173
- flex.render({
173
+ Flex.render({
174
174
  align: "center",
175
175
  gap: "sm",
176
176
  children: [
177
177
  when(icon, () =>
178
- iconButton.render({
178
+ IconButton.render({
179
179
  icon,
180
180
  size: "sm",
181
181
  color: "secondary",
@@ -184,7 +184,7 @@ export const list = {
184
184
  className: "iw-list-item-icon",
185
185
  }),
186
186
  ),
187
- flex.render({
187
+ Flex.render({
188
188
  direction: "column",
189
189
  gap: "sm",
190
190
  className: "iw-list-item-content",
@@ -204,7 +204,7 @@ export const list = {
204
204
  () =>
205
205
  html`<span class="iw-list-item-trailing">
206
206
  ${when(hasChildren, () =>
207
- iconButton.render({
207
+ IconButton.render({
208
208
  variant: "ghost",
209
209
  color: "secondary",
210
210
  size: "sm",
@@ -1,3 +1,3 @@
1
1
  import * as renderers from "./template.js"
2
2
 
3
- export const materialIcon = { ...renderers }
3
+ export const MaterialIcon = { ...renderers }
@@ -1,6 +1,6 @@
1
1
  import { html, repeat } from "@inglorious/web"
2
2
 
3
- import { materialIcon } from "."
3
+ import { MaterialIcon } from "."
4
4
 
5
5
  const materialIcons = [
6
6
  "search",
@@ -87,7 +87,7 @@ export const Gallery = {
87
87
  materialIcons,
88
88
  (name) => name,
89
89
  (name) =>
90
- materialIcon.render({
90
+ MaterialIcon.render({
91
91
  name,
92
92
  size,
93
93
  isFilled,
@@ -1 +1 @@
1
- export { table } from "./template.js"
1
+ export { Table } from "./template.js"
@@ -1,10 +1,10 @@
1
1
  import { createRender } from "../../stories/notifyStory.js"
2
- import { table } from "."
2
+ import { Table } from "."
3
3
 
4
4
  export default {
5
5
  title: "Data Display/Table",
6
6
  tags: ["autodocs"],
7
- render: createRender(table),
7
+ render: createRender(Table),
8
8
  argTypes: {
9
9
  columns: { control: "object", description: "Column definitions." },
10
10
  rows: { control: "object", description: "Row records." },
@@ -11,7 +11,7 @@ import { applyElementProps } from "../../shared/applyElementProps.js"
11
11
  const EVEN_ROW_DIVISOR = 2
12
12
  const STRIPED_OFFSET = 1
13
13
 
14
- export const table = {
14
+ export const Table = {
15
15
  /**
16
16
  * Main entrypoint for the table component. It delegates to the base table renderer so overrides can reuse it.
17
17
  * Tables render columns and rows and can be striped or full width.
@@ -1,3 +1,3 @@
1
1
  import * as renderers from "./template.js"
2
2
 
3
- export const tooltip = { ...renderers }
3
+ export const Tooltip = { ...renderers }
@@ -1,12 +1,12 @@
1
1
  import { html } from "@inglorious/web"
2
2
 
3
3
  import { createRender } from "../../stories/notifyStory.js"
4
- import { tooltip } from "."
4
+ import { Tooltip } from "."
5
5
 
6
6
  export default {
7
7
  title: "Data Display/Tooltip",
8
8
  tags: ["autodocs"],
9
- render: createRender(tooltip),
9
+ render: createRender(Tooltip),
10
10
  argTypes: {
11
11
  content: { control: "text", description: "Tooltip text." },
12
12
  position: {
@@ -1,3 +1,3 @@
1
1
  import * as renderers from "./template.js"
2
2
 
3
- export const typography = { ...renderers }
3
+ export const Typography = { ...renderers }
@@ -1,10 +1,10 @@
1
1
  import { createRender } from "../../stories/notifyStory.js"
2
- import { typography } from "."
2
+ import { Typography } from "."
3
3
 
4
4
  export default {
5
5
  title: "Data Display/Typography",
6
6
  tags: ["autodocs"],
7
- render: createRender(typography),
7
+ render: createRender(Typography),
8
8
  argTypes: {
9
9
  children: { control: "text", description: "Text content." },
10
10
  variant: {
@@ -1,4 +1,4 @@
1
1
  import * as handlers from "./handlers.js"
2
2
  import * as renderers from "./template.js"
3
3
 
4
- export const virtualList = { ...handlers, ...renderers }
4
+ export const VirtualList = { ...handlers, ...renderers }
@@ -1,13 +1,13 @@
1
1
  import { html } from "@inglorious/web"
2
2
 
3
- import { avatar } from "../../data-display/avatar"
4
- import { badge } from "../../data-display/badge"
5
- import { list } from "../../data-display/list"
6
- import { materialIcon } from "../../data-display/material-icon"
7
- import { flex } from "../../layout/flex"
8
- import { drawer } from "../../navigation/drawer"
9
-
10
- export const appDrawer = {
3
+ import { Avatar } from "../../data-display/avatar"
4
+ import { Badge } from "../../data-display/badge"
5
+ import { List } from "../../data-display/list"
6
+ import { MaterialIcon } from "../../data-display/material-icon"
7
+ import { Flex } from "../../layout/flex"
8
+ import { Drawer } from "../../navigation/drawer"
9
+
10
+ export const AppDrawer = {
11
11
  create(entity) {
12
12
  entity.items ??= getDefaultItems()
13
13
  },
@@ -32,23 +32,23 @@ export const appDrawer = {
32
32
  render(entity, api) {
33
33
  const items = mapItemsForRender(entity.items ?? [], api)
34
34
 
35
- return drawer.render({
35
+ return Drawer.render({
36
36
  ...entity,
37
37
  anchor: "left",
38
38
  onClose: () => api.notify(`#${entity.id}:toggle`),
39
39
  onCollapseToggle: () => api.notify(`#${entity.id}:collapseToggle`),
40
- title: flex.render({
40
+ title: Flex.render({
41
41
  align: "center",
42
42
  gap: "sm",
43
43
  padding: "md",
44
44
  className: "iw-dashboard-brand",
45
45
  children: [
46
- avatar.render({ src: "/transparent.png", shape: "square" }),
46
+ Avatar.render({ src: "/transparent.png", shape: "square" }),
47
47
  html`<span class="iw-dashboard-brand-title">Inglorious UI</span>`,
48
48
  ],
49
49
  }),
50
50
  children: html`
51
- ${list.render({
51
+ ${List.render({
52
52
  isInset: true,
53
53
  padding: "sm",
54
54
  items,
@@ -67,18 +67,18 @@ function mapItemsForRender(items, api) {
67
67
  const mappedItem = { ...item }
68
68
 
69
69
  if (item.icon) {
70
- mappedItem.icon = materialIcon.render({ name: item.icon, size: "lg" })
70
+ mappedItem.icon = MaterialIcon.render({ name: item.icon, size: "lg" })
71
71
  }
72
72
 
73
73
  if (item.badge) {
74
- mappedItem.action = badge.render(item.badge)
74
+ mappedItem.action = Badge.render(item.badge)
75
75
  }
76
76
 
77
77
  if (item.href) {
78
78
  mappedItem.onClick = () => api.notify("#router:navigate", item.href)
79
79
  }
80
80
 
81
- if (router.path === item.href) {
81
+ if (router?.path === item.href) {
82
82
  mappedItem.isSelected = true
83
83
  }
84
84