@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.
- 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/template.js +2 -2
- 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 +4 -4
- package/src/controls/checkbox/checkbox.stories.js +2 -2
- package/src/controls/checkbox/index.js +1 -1
- package/src/controls/checkbox/template.js +2 -2
- package/src/controls/combobox/combobox.stories.js +3 -3
- package/src/controls/combobox/index.js +2 -2
- package/src/controls/combobox/template.js +35 -14
- package/src/controls/fab/fab.stories.js +2 -2
- package/src/controls/fab/index.js +1 -1
- package/src/controls/fab/template.js +4 -4
- 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 +4 -4
- package/src/controls/input/index.js +1 -1
- package/src/controls/input/input.stories.js +2 -2
- package/src/controls/input/template.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/radio-group/template.js +2 -2
- package/src/controls/rating/index.js +1 -1
- package/src/controls/rating/rating.stories.js +2 -2
- package/src/controls/rating/template.js +2 -2
- package/src/controls/select/index.js +1 -1
- package/src/controls/select/select.stories.js +2 -2
- package/src/controls/select/template.js +2 -2
- package/src/controls/slider/index.js +1 -1
- package/src/controls/slider/slider.stories.js +2 -2
- package/src/controls/slider/template.js +2 -2
- package/src/controls/switch/index.js +1 -1
- package/src/controls/switch/switch.stories.js +2 -2
- package/src/controls/switch/template.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/avatar/template.js +2 -1
- package/src/data-display/badge/badge.stories.js +2 -2
- package/src/data-display/badge/index.js +1 -1
- package/src/data-display/badge/template.js +7 -0
- package/src/data-display/chip/chip.stories.js +2 -2
- package/src/data-display/chip/index.js +1 -1
- package/src/data-display/chip/template.js +7 -0
- 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 +40 -28
- package/src/data-display/divider/divider.stories.js +2 -2
- package/src/data-display/divider/index.js +1 -1
- package/src/data-display/divider/template.js +7 -0
- 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/icon/template.js +7 -0
- 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 +22 -13
- 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/material-icon/template.js +7 -0
- 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 +19 -1
- package/src/data-display/tooltip/index.js +1 -1
- package/src/data-display/tooltip/template.js +2 -0
- package/src/data-display/tooltip/tooltip.stories.js +2 -2
- package/src/data-display/typography/index.js +1 -1
- package/src/data-display/typography/template.js +2 -0
- package/src/data-display/typography/typography.stories.js +2 -2
- package/src/data-display/virtual-list/index.js +1 -1
- package/src/data-display/virtual-list/template.js +4 -2
- 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/alert/template.js +2 -0
- package/src/feedback/backdrop/backdrop.stories.js +2 -2
- package/src/feedback/backdrop/index.js +2 -2
- package/src/feedback/backdrop/template.js +2 -0
- package/src/feedback/dialog/dialog.stories.js +2 -2
- package/src/feedback/dialog/index.js +2 -2
- package/src/feedback/dialog/template.js +2 -0
- package/src/feedback/progress/index.js +1 -1
- package/src/feedback/progress/progress.stories.js +2 -2
- package/src/feedback/progress/template.js +3 -1
- package/src/feedback/skeleton/index.js +2 -2
- package/src/feedback/skeleton/skeleton.stories.js +2 -2
- package/src/feedback/skeleton/template.js +2 -0
- package/src/feedback/snackbar/index.js +2 -2
- package/src/feedback/snackbar/snackbar.stories.js +2 -2
- package/src/feedback/snackbar/template.js +2 -0
- 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/container/template.js +2 -0
- package/src/layout/flex/flex.stories.js +2 -2
- package/src/layout/flex/index.js +1 -1
- package/src/layout/flex/template.js +2 -3
- package/src/layout/grid/grid.stories.js +2 -2
- package/src/layout/grid/index.js +1 -1
- package/src/layout/grid/template.js +2 -3
- 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 +16 -2
- package/src/navigation/breadcrumbs/breadcrumbs.stories.js +2 -2
- package/src/navigation/breadcrumbs/index.js +1 -1
- package/src/navigation/breadcrumbs/template.js +16 -2
- package/src/navigation/drawer/drawer.stories.js +2 -2
- package/src/navigation/drawer/index.js +1 -1
- package/src/navigation/drawer/template.js +15 -13
- package/src/navigation/link/index.js +2 -2
- package/src/navigation/link/link.stories.js +2 -2
- package/src/navigation/link/template.js +2 -0
- package/src/navigation/menu/index.js +1 -1
- package/src/navigation/menu/menu.stories.js +2 -2
- package/src/navigation/menu/template.js +15 -1
- package/src/navigation/pagination/index.js +1 -1
- package/src/navigation/pagination/pagination.stories.js +2 -2
- package/src/navigation/pagination/template.js +20 -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 +15 -1
- package/src/navigation/stepper/index.js +1 -1
- package/src/navigation/stepper/stepper.stories.js +2 -2
- package/src/navigation/stepper/template.js +15 -1
- package/src/navigation/tabs/index.js +1 -1
- package/src/navigation/tabs/tabs.stories.js +2 -2
- package/src/navigation/tabs/template.js +17 -1
- package/src/surfaces/accordion/accordion.stories.js +2 -2
- package/src/surfaces/accordion/index.js +1 -1
- package/src/surfaces/accordion/template.js +15 -1
- package/src/surfaces/app-bar/app-bar.stories.js +2 -2
- package/src/surfaces/app-bar/index.js +1 -1
- package/src/surfaces/app-bar/template.js +2 -0
- package/src/surfaces/card/card.stories.js +2 -2
- package/src/surfaces/card/index.js +1 -1
- package/src/surfaces/card/template.js +19 -1
- package/src/surfaces/paper/index.js +2 -2
- package/src/surfaces/paper/paper.stories.js +3 -3
- package/src/surfaces/paper/template.js +2 -0
- 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 +2 -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/data-grid.d.ts +2 -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 +2 -1
- package/types/data-display/material-icon.d.ts +1 -1
- package/types/data-display/table.d.ts +2 -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 +2 -1
- package/types/navigation/breadcrumbs.d.ts +2 -1
- package/types/navigation/drawer.d.ts +1 -1
- package/types/navigation/link.d.ts +1 -1
- package/types/navigation/menu.d.ts +2 -1
- package/types/navigation/pagination.d.ts +2 -1
- package/types/navigation/speed-dial.d.ts +2 -1
- package/types/navigation/stepper.d.ts +2 -1
- package/types/navigation/tabs.d.ts +2 -1
- package/types/surfaces/accordion.d.ts +2 -1
- package/types/surfaces/app-bar.d.ts +1 -1
- package/types/surfaces/card.d.ts +2 -1
- package/types/surfaces/paper.d.ts +1 -1
|
@@ -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 }
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { classMap, html } from "@inglorious/web"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
+
* Renders a modal dialog with header, body, and actions when open.
|
|
10
|
+
* Clicking the backdrop can close the dialog when handlers are provided.
|
|
9
11
|
* @param {DialogProps} props
|
|
10
12
|
* @returns {TemplateResult | null}
|
|
11
13
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Progress } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Feedback/Progress",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Progress),
|
|
8
8
|
argTypes: {
|
|
9
9
|
variant: { control: "select", options: ["linear", "circular"] },
|
|
10
10
|
value: { control: "number" },
|
|
@@ -10,6 +10,8 @@ function clamp(value) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
+
* Renders a linear or circular progress indicator.
|
|
14
|
+
* Indeterminate mode is used when no explicit value is provided.
|
|
13
15
|
* @param {ProgressProps} props
|
|
14
16
|
* @returns {TemplateResult}
|
|
15
17
|
*/
|
|
@@ -41,7 +43,7 @@ export function render(props) {
|
|
|
41
43
|
class=${classMap({
|
|
42
44
|
"iw-progress": true,
|
|
43
45
|
"iw-progress-circular": true,
|
|
44
|
-
|
|
46
|
+
[`iw-progress-${color}`]: true,
|
|
45
47
|
"iw-progress-indeterminate": progress == null,
|
|
46
48
|
...extraClasses,
|
|
47
49
|
})}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as renderers from "./template.js"
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const Skeleton = { ...renderers }
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Skeleton } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Feedback/Skeleton",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Skeleton),
|
|
8
8
|
argTypes: {
|
|
9
9
|
variant: { control: "select", options: ["text", "rect", "circle"] },
|
|
10
10
|
width: { control: "text" },
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { classMap, html } from "@inglorious/web"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
+
* Renders a loading skeleton placeholder for text, blocks, or multiple lines.
|
|
10
|
+
* Use it to indicate content is loading without layout shifts.
|
|
9
11
|
* @param {SkeletonProps} props
|
|
10
12
|
* @returns {TemplateResult}
|
|
11
13
|
*/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as renderers from "./template.js"
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const Snackbar = { ...renderers }
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Snackbar } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Feedback/Snackbar",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Snackbar),
|
|
8
8
|
argTypes: {
|
|
9
9
|
isOpen: { control: "boolean" },
|
|
10
10
|
message: { control: "text" },
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { classMap, html } from "@inglorious/web"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
+
* Renders a transient snackbar message with optional action and dismiss control.
|
|
10
|
+
* Position is configurable (for example bottom-left or top-right).
|
|
9
11
|
* @param {SnackbarProps} props
|
|
10
12
|
* @returns {TemplateResult | null}
|
|
11
13
|
*/
|
package/src/index.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
42
|
-
export {
|
|
43
|
-
export {
|
|
44
|
-
export {
|
|
45
|
-
export {
|
|
1
|
+
export { Button } from "./controls/button/index.js"
|
|
2
|
+
export { ButtonGroup } from "./controls/button-group/index.js"
|
|
3
|
+
export { Checkbox } from "./controls/checkbox/index.js"
|
|
4
|
+
export { Fab } from "./controls/fab/index.js"
|
|
5
|
+
export { IconButton } from "./controls/icon-button/index.js"
|
|
6
|
+
export { Input } from "./controls/input/index.js"
|
|
7
|
+
export { RadioGroup } from "./controls/radio-group/index.js"
|
|
8
|
+
export { Rating } from "./controls/rating/index.js"
|
|
9
|
+
export { Select } from "./controls/select/index.js"
|
|
10
|
+
export { Slider } from "./controls/slider/index.js"
|
|
11
|
+
export { Switch } from "./controls/switch/index.js"
|
|
12
|
+
export { Avatar } from "./data-display/avatar/index.js"
|
|
13
|
+
export { Badge } from "./data-display/badge/index.js"
|
|
14
|
+
export { Chip } from "./data-display/chip/index.js"
|
|
15
|
+
export { DataGrid } from "./data-display/data-grid/index.js"
|
|
16
|
+
export { Divider } from "./data-display/divider/index.js"
|
|
17
|
+
export { Icon } from "./data-display/icon/index.js"
|
|
18
|
+
export { List } from "./data-display/list/index.js"
|
|
19
|
+
export { MaterialIcon } from "./data-display/material-icon/index.js"
|
|
20
|
+
export { Table } from "./data-display/table/index.js"
|
|
21
|
+
export { Tooltip } from "./data-display/tooltip/index.js"
|
|
22
|
+
export { Typography } from "./data-display/typography/index.js"
|
|
23
|
+
export { VirtualList } from "./data-display/virtual-list/index.js"
|
|
24
|
+
export { Alert } from "./feedback/alert/index.js"
|
|
25
|
+
export { Backdrop } from "./feedback/backdrop/index.js"
|
|
26
|
+
export { Dialog } from "./feedback/dialog/index.js"
|
|
27
|
+
export { Progress } from "./feedback/progress/index.js"
|
|
28
|
+
export { Skeleton } from "./feedback/skeleton/index.js"
|
|
29
|
+
export { Snackbar } from "./feedback/snackbar/index.js"
|
|
30
|
+
export { Container } from "./layout/container/index.js"
|
|
31
|
+
export { Flex } from "./layout/flex/index.js"
|
|
32
|
+
export { Grid } from "./layout/grid/index.js"
|
|
33
|
+
export { BottomNavigation } from "./navigation/bottom-navigation/index.js"
|
|
34
|
+
export { Breadcrumbs } from "./navigation/breadcrumbs/index.js"
|
|
35
|
+
export { Drawer } from "./navigation/drawer/index.js"
|
|
36
|
+
export { Link } from "./navigation/link/index.js"
|
|
37
|
+
export { Menu } from "./navigation/menu/index.js"
|
|
38
|
+
export { Pagination } from "./navigation/pagination/index.js"
|
|
39
|
+
export { SpeedDial } from "./navigation/speed-dial/index.js"
|
|
40
|
+
export { Stepper } from "./navigation/stepper/index.js"
|
|
41
|
+
export { Tabs } from "./navigation/tabs/index.js"
|
|
42
|
+
export { Accordion } from "./surfaces/accordion/index.js"
|
|
43
|
+
export { AppBar } from "./surfaces/app-bar/index.js"
|
|
44
|
+
export { Card } from "./surfaces/card/index.js"
|
|
45
|
+
export { Paper } from "./surfaces/paper/index.js"
|
|
@@ -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 { Container } from "."
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Layout/Container",
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
render: createRender(
|
|
9
|
+
render: createRender(Container),
|
|
10
10
|
argTypes: {
|
|
11
11
|
maxWidth: {
|
|
12
12
|
control: "text",
|
|
@@ -79,7 +79,7 @@ export const WidthPresets = {
|
|
|
79
79
|
>
|
|
80
80
|
${size}
|
|
81
81
|
</div>
|
|
82
|
-
${
|
|
82
|
+
${Container.render({
|
|
83
83
|
maxWidth: size,
|
|
84
84
|
children: html`<div
|
|
85
85
|
style="padding: 0.5rem 0.75rem; border: 1px solid var(--iw-color-border);"
|
|
@@ -16,6 +16,8 @@ const SIZE_TO_MAX_WIDTH = {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
+
* Renders a responsive layout container with optional max width and padding.
|
|
20
|
+
* Use it to constrain page content while keeping semantic HTML tags.
|
|
19
21
|
* @param {ContainerProps} props
|
|
20
22
|
* @returns {TemplateResult}
|
|
21
23
|
*/
|
|
@@ -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 { Flex } from "."
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Layout/Flex",
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
render: createRender(
|
|
9
|
+
render: createRender(Flex),
|
|
10
10
|
argTypes: {
|
|
11
11
|
direction: {
|
|
12
12
|
control: "select",
|
package/src/layout/flex/index.js
CHANGED
|
@@ -8,9 +8,8 @@ import { classMap, ref, staticHtml, unsafeStatic } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* Renders a flexible layout container with direction, alignment, spacing, and wrap control.
|
|
12
|
+
* Use it to compose layouts without writing custom flexbox CSS.
|
|
14
13
|
* @param {FlexProps} props
|
|
15
14
|
* @returns {TemplateResult}
|
|
16
15
|
*/
|
|
@@ -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 { Grid } from "."
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Layout/Grid",
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
render: createRender(
|
|
9
|
+
render: createRender(Grid),
|
|
10
10
|
argTypes: {
|
|
11
11
|
columns: {
|
|
12
12
|
control: "number",
|
package/src/layout/grid/index.js
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
import { classMap, html, styleMap } from "@inglorious/web"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Renders a CSS grid container with configurable columns, gaps, and alignment.
|
|
10
|
+
* Supports fixed column counts or auto-fit with a minimum column width.
|
|
12
11
|
* @param {GridProps} props
|
|
13
12
|
* @returns {TemplateResult}
|
|
14
13
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { BottomNavigation } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Navigation/Bottom Navigation",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(BottomNavigation),
|
|
8
8
|
argTypes: {
|
|
9
9
|
actions: { control: "object", description: "Bottom navigation actions." },
|
|
10
10
|
value: { control: "text", description: "Currently selected action value." },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { BottomNavigation } from "./template.js"
|
|
@@ -8,12 +8,24 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
|
|
9
9
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
10
10
|
|
|
11
|
-
export const
|
|
11
|
+
export const BottomNavigation = {
|
|
12
12
|
/**
|
|
13
|
+
* Main entrypoint for bottom navigation. Delegates to the base renderer for overrides.
|
|
14
|
+
* Renders a row of actions with optional labels.
|
|
13
15
|
* @param {BottomNavigationProps} props
|
|
14
16
|
* @returns {TemplateResult}
|
|
15
17
|
*/
|
|
16
18
|
render(props) {
|
|
19
|
+
return this.renderBottomNavigation(props)
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Renders the navigation container and iterates actions.
|
|
24
|
+
* Each action is delegated to `renderAction`.
|
|
25
|
+
* @param {BottomNavigationProps} props
|
|
26
|
+
* @returns {TemplateResult}
|
|
27
|
+
*/
|
|
28
|
+
renderBottomNavigation(props) {
|
|
17
29
|
const {
|
|
18
30
|
type, // eslint-disable-line no-unused-vars
|
|
19
31
|
actions = [],
|
|
@@ -41,6 +53,8 @@ export const bottomNavigation = {
|
|
|
41
53
|
},
|
|
42
54
|
|
|
43
55
|
/**
|
|
56
|
+
* Renders a single bottom navigation action.
|
|
57
|
+
* Handles selection state and click callbacks.
|
|
44
58
|
* @param {BottomNavigationAction} action
|
|
45
59
|
* @param {number} index
|
|
46
60
|
* @param {BottomNavigationProps} props
|
|
@@ -56,7 +70,7 @@ export const bottomNavigation = {
|
|
|
56
70
|
"iw-bottom-navigation-action": true,
|
|
57
71
|
"iw-bottom-navigation-action-selected": selected,
|
|
58
72
|
})}
|
|
59
|
-
aria-current=${selected ? "page" :
|
|
73
|
+
aria-current=${selected ? "page" : "false"}
|
|
60
74
|
?disabled=${action.isDisabled}
|
|
61
75
|
@click=${() => {
|
|
62
76
|
action.onClick?.(currentValue)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Breadcrumbs } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Navigation/Breadcrumbs",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Breadcrumbs),
|
|
8
8
|
argTypes: {
|
|
9
9
|
items: { control: "object", description: "Ordered breadcrumb path items." },
|
|
10
10
|
separator: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Breadcrumbs } from "./template.js"
|
|
@@ -8,12 +8,24 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
|
|
9
9
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
10
10
|
|
|
11
|
-
export const
|
|
11
|
+
export const Breadcrumbs = {
|
|
12
12
|
/**
|
|
13
|
+
* Main entrypoint for breadcrumbs navigation. Delegates to the base renderer for overrides.
|
|
14
|
+
* Renders a list of path items separated by a configurable separator.
|
|
13
15
|
* @param {BreadcrumbsProps} props
|
|
14
16
|
* @returns {TemplateResult}
|
|
15
17
|
*/
|
|
16
18
|
render(props) {
|
|
19
|
+
return this.renderBreadcrumbs(props)
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Renders the breadcrumb container and iterates items.
|
|
24
|
+
* Each item is delegated to `renderItem`.
|
|
25
|
+
* @param {BreadcrumbsProps} props
|
|
26
|
+
* @returns {TemplateResult}
|
|
27
|
+
*/
|
|
28
|
+
renderBreadcrumbs(props) {
|
|
17
29
|
const {
|
|
18
30
|
type, // eslint-disable-line no-unused-vars
|
|
19
31
|
items = [],
|
|
@@ -49,6 +61,8 @@ export const breadcrumbs = {
|
|
|
49
61
|
},
|
|
50
62
|
|
|
51
63
|
/**
|
|
64
|
+
* Renders a single breadcrumb item, handling current vs. link states.
|
|
65
|
+
* Override to customize labels or link behavior.
|
|
52
66
|
* @param {BreadcrumbItem} item
|
|
53
67
|
* @param {number} index
|
|
54
68
|
* @param {BreadcrumbsProps} props
|
|
@@ -70,7 +84,7 @@ export const breadcrumbs = {
|
|
|
70
84
|
class=${classMap({
|
|
71
85
|
"iw-breadcrumbs-current": isLast,
|
|
72
86
|
})}
|
|
73
|
-
aria-current=${isLast ? "page" :
|
|
87
|
+
aria-current=${isLast ? "page" : "false"}
|
|
74
88
|
>
|
|
75
89
|
${item.label}
|
|
76
90
|
</span>`}
|
|
@@ -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 { Drawer } from "."
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Navigation/Drawer",
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
render: createRender(
|
|
9
|
+
render: createRender(Drawer),
|
|
10
10
|
argTypes: {
|
|
11
11
|
isOpen: {
|
|
12
12
|
control: "boolean",
|
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
import { html, when } from "@inglorious/web"
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { Button } from "../../controls/button"
|
|
9
|
+
import { MaterialIcon } from "../../data-display/material-icon"
|
|
10
|
+
import { Backdrop } from "../../feedback/backdrop"
|
|
11
|
+
import { Flex } from "../../layout/flex"
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
+
* Renders a side drawer panel with optional header, body, and collapse controls.
|
|
15
|
+
* Can show a backdrop when open and supports left/right anchoring.
|
|
14
16
|
* @param {DrawerProps} props
|
|
15
17
|
* @returns {TemplateResult}
|
|
16
18
|
*/
|
|
@@ -50,7 +52,7 @@ export function render(props) {
|
|
|
50
52
|
.join(" ")
|
|
51
53
|
|
|
52
54
|
return html`
|
|
53
|
-
${
|
|
55
|
+
${Flex.render({
|
|
54
56
|
element: "aside",
|
|
55
57
|
direction: "column",
|
|
56
58
|
className: drawerClassName,
|
|
@@ -58,7 +60,7 @@ export function render(props) {
|
|
|
58
60
|
when(
|
|
59
61
|
title || onClose,
|
|
60
62
|
() => html`
|
|
61
|
-
${
|
|
63
|
+
${Flex.render({
|
|
62
64
|
align: "center",
|
|
63
65
|
justify: "between",
|
|
64
66
|
gap: "sm",
|
|
@@ -69,14 +71,14 @@ export function render(props) {
|
|
|
69
71
|
() => html`<div class="iw-drawer-title">${title}</div>`,
|
|
70
72
|
),
|
|
71
73
|
when(onClose, () =>
|
|
72
|
-
|
|
74
|
+
Button.render({
|
|
73
75
|
color: "secondary",
|
|
74
76
|
variant: "ghost",
|
|
75
77
|
shape: "square",
|
|
76
78
|
className: "iw-drawer-close",
|
|
77
79
|
"aria-label": "Close",
|
|
78
80
|
onClick: onClose,
|
|
79
|
-
children:
|
|
81
|
+
children: MaterialIcon.render({
|
|
80
82
|
name: "close",
|
|
81
83
|
size: "lg",
|
|
82
84
|
}),
|
|
@@ -87,7 +89,7 @@ export function render(props) {
|
|
|
87
89
|
`,
|
|
88
90
|
),
|
|
89
91
|
|
|
90
|
-
|
|
92
|
+
Flex.render({
|
|
91
93
|
direction: "column",
|
|
92
94
|
className: "iw-drawer-body",
|
|
93
95
|
children,
|
|
@@ -96,11 +98,11 @@ export function render(props) {
|
|
|
96
98
|
when(
|
|
97
99
|
onCollapseToggle,
|
|
98
100
|
() => html`
|
|
99
|
-
${
|
|
101
|
+
${Flex.render({
|
|
100
102
|
justify: "end",
|
|
101
103
|
padding: "sm",
|
|
102
104
|
className: "iw-drawer-footer",
|
|
103
|
-
children:
|
|
105
|
+
children: Button.render({
|
|
104
106
|
color: "secondary",
|
|
105
107
|
variant: "ghost",
|
|
106
108
|
shape: "square",
|
|
@@ -109,7 +111,7 @@ export function render(props) {
|
|
|
109
111
|
? "Expand sidebar"
|
|
110
112
|
: "Collapse sidebar",
|
|
111
113
|
onClick: onCollapseToggle,
|
|
112
|
-
children:
|
|
114
|
+
children: MaterialIcon.render({
|
|
113
115
|
name: "left_panel_close",
|
|
114
116
|
size: "lg",
|
|
115
117
|
}),
|
|
@@ -121,7 +123,7 @@ export function render(props) {
|
|
|
121
123
|
...rest,
|
|
122
124
|
})}
|
|
123
125
|
${when(isOpen && hasBackdrop, () =>
|
|
124
|
-
|
|
126
|
+
Backdrop.render({
|
|
125
127
|
isOpen: true,
|
|
126
128
|
className: "iw-drawer-backdrop",
|
|
127
129
|
onClick: onClose,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as renderers from "./template.js"
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const Link = { ...renderers }
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Link } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Navigation/Link",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Link),
|
|
8
8
|
argTypes: {
|
|
9
9
|
href: { control: "text", description: "Destination URL." },
|
|
10
10
|
label: { control: "text", description: "Fallback text content." },
|
|
@@ -8,6 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
+
* Renders a styled link element with optional underline and color variants.
|
|
12
|
+
* Supports external link behavior and click handling.
|
|
11
13
|
* @param {LinkProps} props
|
|
12
14
|
* @returns {TemplateResult}
|
|
13
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Menu } from "./template.js"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Menu } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Navigation/Menu",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Menu),
|
|
8
8
|
argTypes: {
|
|
9
9
|
isOpen: {
|
|
10
10
|
control: "boolean",
|