@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inglorious/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A design system for Inglorious Web with render-function components and customizable themes",
|
|
5
5
|
"author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -280,25 +280,27 @@
|
|
|
280
280
|
"**/*.css"
|
|
281
281
|
],
|
|
282
282
|
"peerDependencies": {
|
|
283
|
-
"@inglorious/
|
|
284
|
-
"@inglorious/
|
|
285
|
-
"@inglorious/
|
|
283
|
+
"@inglorious/charts": "5.0.0",
|
|
284
|
+
"@inglorious/web": "5.0.0",
|
|
285
|
+
"@inglorious/utils": "3.8.0"
|
|
286
286
|
},
|
|
287
287
|
"devDependencies": {
|
|
288
288
|
"@fontsource/material-symbols-outlined": "^5.2.36",
|
|
289
289
|
"@fortawesome/fontawesome-free": "^7.2.0",
|
|
290
|
-
"@storybook/addon-docs": "^10.
|
|
291
|
-
"@storybook/web-components-vite": "^10.
|
|
290
|
+
"@storybook/addon-docs": "^10.3.3",
|
|
291
|
+
"@storybook/web-components-vite": "^10.3.3",
|
|
292
292
|
"happy-dom": "^15.11.0",
|
|
293
293
|
"jsdom": "^25.0.0",
|
|
294
294
|
"lucide": "^0.575.0",
|
|
295
295
|
"prettier": "^3.6.2",
|
|
296
|
-
"storybook": "^10.
|
|
296
|
+
"storybook": "^10.3.3",
|
|
297
297
|
"vite": "^7.3.1",
|
|
298
298
|
"vitest": "^4.0.15",
|
|
299
299
|
"@inglorious/eslint-config": "1.1.2",
|
|
300
|
-
"@inglorious/
|
|
301
|
-
"@inglorious/web": "
|
|
300
|
+
"@inglorious/vite-plugin-vue": "1.0.0",
|
|
301
|
+
"@inglorious/web": "5.0.0",
|
|
302
|
+
"@inglorious/store": "10.0.0",
|
|
303
|
+
"@inglorious/vite-plugin-jsx": "2.0.0"
|
|
302
304
|
},
|
|
303
305
|
"engines": {
|
|
304
306
|
"node": ">= 22"
|
|
@@ -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 { Button } from "."
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Controls/Button",
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
render: createRender(
|
|
9
|
+
render: createRender(Button),
|
|
10
10
|
argTypes: {
|
|
11
11
|
children: {
|
|
12
12
|
control: "text",
|
|
@@ -8,8 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a themed button for actions and form submission.
|
|
12
|
+
* Supports variants, sizes, shapes, pressed state, and full-width layout.
|
|
13
13
|
* @example
|
|
14
14
|
* // Stateless usage
|
|
15
15
|
* button.render({ children: 'Click me', variant: 'primary' })
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { ButtonGroup } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/ButtonGroup",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(ButtonGroup),
|
|
8
8
|
argTypes: {
|
|
9
9
|
value: {
|
|
10
10
|
control: "object",
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
import { classMap, html, ref } from "@inglorious/web"
|
|
7
7
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
|
-
import {
|
|
9
|
+
import { Button } from "../button/index.js"
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* Renders a grouped set of buttons with optional single or multi selection.
|
|
13
|
+
* Handles attached layout, selection state, and per-item overrides.
|
|
14
14
|
* @param {ButtonGroupProps} props
|
|
15
15
|
* @returns {TemplateResult}
|
|
16
16
|
*/
|
|
@@ -69,7 +69,7 @@ export function render(props) {
|
|
|
69
69
|
? value === itemValue
|
|
70
70
|
: false
|
|
71
71
|
|
|
72
|
-
return
|
|
72
|
+
return Button.render({
|
|
73
73
|
children: html`
|
|
74
74
|
${icon ? html`<span class="iw-button-icon">${icon}</span>` : null}
|
|
75
75
|
${children ?? label}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Checkbox } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/Checkbox",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Checkbox),
|
|
8
8
|
argTypes: {
|
|
9
9
|
label: { control: "text", description: "Label text." },
|
|
10
10
|
name: { control: "text", description: "Native HTML name attribute." },
|
|
@@ -8,8 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a labeled checkbox for boolean input.
|
|
12
|
+
* Supports disabled/required states plus size and color variants.
|
|
13
13
|
* @param {CheckboxProps} props
|
|
14
14
|
* @returns {TemplateResult}
|
|
15
15
|
*/
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createEntityRender,
|
|
3
3
|
notifyActionArgType,
|
|
4
4
|
} from "../../stories/notifyStory.js"
|
|
5
|
-
import {
|
|
5
|
+
import { Combobox } from "./index.js"
|
|
6
6
|
|
|
7
7
|
const options = [
|
|
8
8
|
{ label: "Italy", value: "it" },
|
|
@@ -14,7 +14,7 @@ const options = [
|
|
|
14
14
|
export default {
|
|
15
15
|
title: "Controls/Combobox",
|
|
16
16
|
tags: ["autodocs"],
|
|
17
|
-
render: createEntityRender({
|
|
17
|
+
render: createEntityRender({ Combobox }),
|
|
18
18
|
argTypes: {
|
|
19
19
|
...notifyActionArgType,
|
|
20
20
|
label: { control: "text", description: "Field label." },
|
|
@@ -59,7 +59,7 @@ export default {
|
|
|
59
59
|
export const SingleClosed = {}
|
|
60
60
|
SingleClosed.args = {
|
|
61
61
|
id: "combobox",
|
|
62
|
-
type: "
|
|
62
|
+
type: "Combobox",
|
|
63
63
|
label: "Country",
|
|
64
64
|
selectedValue: "it",
|
|
65
65
|
isMulti: false,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as handlers from "./handlers.js"
|
|
2
2
|
import * as helpers from "./helpers.js"
|
|
3
|
-
import {
|
|
3
|
+
import { Combobox as renderers } from "./template.js"
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const Combobox = {
|
|
6
6
|
...handlers,
|
|
7
7
|
...renderers,
|
|
8
8
|
render(entity, api) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import { classMap, html, ref, repeat, when } from "@inglorious/web"
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { Chip } from "../../data-display/chip/index.js"
|
|
10
10
|
import {
|
|
11
11
|
filterOptions,
|
|
12
12
|
formatOption,
|
|
@@ -17,13 +17,24 @@ import {
|
|
|
17
17
|
|
|
18
18
|
const NO_FOCUSED_INDEX = -1
|
|
19
19
|
|
|
20
|
-
export const
|
|
20
|
+
export const Combobox = {
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Main entrypoint for the combobox control. It renders the wrapper, label, control, and dropdown when open.
|
|
23
|
+
* Comboboxes support search, single or multi-select values, and clearable selection.
|
|
23
24
|
* @param {ComboboxProps} props
|
|
24
25
|
* @returns {TemplateResult}
|
|
25
26
|
*/
|
|
26
27
|
render(props) {
|
|
28
|
+
return this.renderCombobox(props)
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Main entrypoint for the combobox control. It renders the wrapper, label, control, and dropdown when open.
|
|
33
|
+
* Comboboxes support search, single or multi-select values, and clearable selection.
|
|
34
|
+
* @param {ComboboxProps} props
|
|
35
|
+
* @returns {TemplateResult}
|
|
36
|
+
*/
|
|
37
|
+
renderCombobox(props) {
|
|
27
38
|
return html`<div
|
|
28
39
|
class=${classMap({
|
|
29
40
|
"iw-combobox": true,
|
|
@@ -40,7 +51,8 @@ export const combobox = {
|
|
|
40
51
|
},
|
|
41
52
|
|
|
42
53
|
/**
|
|
43
|
-
*
|
|
54
|
+
* Renders the clickable control element that shows the current selection and toggles the dropdown.
|
|
55
|
+
* Handles placeholder, clear button, and the open/disabled state.
|
|
44
56
|
* @param {ComboboxProps} props
|
|
45
57
|
* @returns {TemplateResult}
|
|
46
58
|
*/
|
|
@@ -85,7 +97,8 @@ export const combobox = {
|
|
|
85
97
|
},
|
|
86
98
|
|
|
87
99
|
/**
|
|
88
|
-
*
|
|
100
|
+
* Renders the currently selected value in single-select mode.
|
|
101
|
+
* Falls back to the placeholder when no value is selected.
|
|
89
102
|
* @param {ComboboxProps} props
|
|
90
103
|
* @returns {TemplateResult}
|
|
91
104
|
*/
|
|
@@ -108,7 +121,8 @@ export const combobox = {
|
|
|
108
121
|
},
|
|
109
122
|
|
|
110
123
|
/**
|
|
111
|
-
*
|
|
124
|
+
* Renders the selected values in multi-select mode as a row of tags.
|
|
125
|
+
* Falls back to the placeholder when the selection is empty.
|
|
112
126
|
* @param {ComboboxProps} props
|
|
113
127
|
* @returns {TemplateResult}
|
|
114
128
|
*/
|
|
@@ -129,7 +143,8 @@ export const combobox = {
|
|
|
129
143
|
},
|
|
130
144
|
|
|
131
145
|
/**
|
|
132
|
-
*
|
|
146
|
+
* Renders a single selected tag in multi-select mode.
|
|
147
|
+
* Used to customize chip styling and remove behavior.
|
|
133
148
|
* @param {ComboboxProps} props
|
|
134
149
|
* @param {string|number} value
|
|
135
150
|
* @returns {TemplateResult}
|
|
@@ -143,7 +158,7 @@ export const combobox = {
|
|
|
143
158
|
class="iw-combobox-multi-value-tag"
|
|
144
159
|
@click=${(event) => event.stopPropagation()}
|
|
145
160
|
>
|
|
146
|
-
${
|
|
161
|
+
${Chip.render({
|
|
147
162
|
id: tagId,
|
|
148
163
|
children: option ? getOptionLabel(option) : String(value),
|
|
149
164
|
isRemovable: true,
|
|
@@ -158,7 +173,8 @@ export const combobox = {
|
|
|
158
173
|
},
|
|
159
174
|
|
|
160
175
|
/**
|
|
161
|
-
*
|
|
176
|
+
* Renders the dropdown panel that contains search input, options, and empty/loading states.
|
|
177
|
+
* Shown only when the combobox is open.
|
|
162
178
|
* @param {ComboboxProps} props
|
|
163
179
|
* @returns {TemplateResult}
|
|
164
180
|
*/
|
|
@@ -195,7 +211,8 @@ export const combobox = {
|
|
|
195
211
|
},
|
|
196
212
|
|
|
197
213
|
/**
|
|
198
|
-
*
|
|
214
|
+
* Renders the optional search input used to filter options.
|
|
215
|
+
* Emits search change events as the user types.
|
|
199
216
|
* @param {ComboboxProps} props
|
|
200
217
|
* @returns {TemplateResult}
|
|
201
218
|
*/
|
|
@@ -214,7 +231,8 @@ export const combobox = {
|
|
|
214
231
|
},
|
|
215
232
|
|
|
216
233
|
/**
|
|
217
|
-
*
|
|
234
|
+
* Renders the list of available options in the dropdown.
|
|
235
|
+
* Delegates each option to `renderOption` for customization.
|
|
218
236
|
* @param {ComboboxProps} props
|
|
219
237
|
* @returns {TemplateResult}
|
|
220
238
|
*/
|
|
@@ -231,7 +249,8 @@ export const combobox = {
|
|
|
231
249
|
},
|
|
232
250
|
|
|
233
251
|
/**
|
|
234
|
-
*
|
|
252
|
+
* Renders a single option row, including selection and focus styling.
|
|
253
|
+
* Handles click/selection for the option.
|
|
235
254
|
* @param {ComboboxProps} props
|
|
236
255
|
* @param {{ option: ComboboxOption, index: number }} payload
|
|
237
256
|
* @returns {TemplateResult}
|
|
@@ -272,7 +291,8 @@ export const combobox = {
|
|
|
272
291
|
},
|
|
273
292
|
|
|
274
293
|
/**
|
|
275
|
-
*
|
|
294
|
+
* Renders the loading state shown while options are being fetched or filtered.
|
|
295
|
+
* Displayed when `isLoading` is true.
|
|
276
296
|
* @param {ComboboxProps} props
|
|
277
297
|
* @returns {TemplateResult}
|
|
278
298
|
*/
|
|
@@ -281,7 +301,8 @@ export const combobox = {
|
|
|
281
301
|
},
|
|
282
302
|
|
|
283
303
|
/**
|
|
284
|
-
*
|
|
304
|
+
* Renders the empty state when no options match the search or list is empty.
|
|
305
|
+
* Uses the `noOptionsMessage` prop when provided.
|
|
285
306
|
* @param {ComboboxProps} props
|
|
286
307
|
* @returns {TemplateResult}
|
|
287
308
|
*/
|
|
@@ -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 { Fab } from "."
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Controls/Fab",
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
render: createRender(
|
|
9
|
+
render: createRender(Fab),
|
|
10
10
|
argTypes: {
|
|
11
11
|
children: { control: "text", description: "Content of the FAB." },
|
|
12
12
|
color: {
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { html } from "@inglorious/web"
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Button } from "../button/index.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a floating action button for primary contextual actions.
|
|
12
|
+
* Supports extended mode to display label text alongside the icon.
|
|
13
13
|
* @param {FabProps} props
|
|
14
14
|
* @returns {TemplateResult}
|
|
15
15
|
*/
|
|
@@ -22,7 +22,7 @@ export function render(props) {
|
|
|
22
22
|
...rest
|
|
23
23
|
} = props
|
|
24
24
|
|
|
25
|
-
return
|
|
25
|
+
return Button.render({
|
|
26
26
|
...rest,
|
|
27
27
|
shape: isExtended ? "pill" : "round",
|
|
28
28
|
className:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { IconButton } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/IconButton",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(IconButton),
|
|
8
8
|
argTypes: {
|
|
9
9
|
icon: { control: "text", description: "Leading icon content." },
|
|
10
10
|
label: { control: "text", description: "Optional button label." },
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { html } from "@inglorious/web"
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Button } from "../button/index.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a button optimized for icons with optional label and icon placement.
|
|
12
|
+
* Built on top of the base button renderer for consistent theming.
|
|
13
13
|
* @param {IconButtonProps} props
|
|
14
14
|
* @returns {TemplateResult}
|
|
15
15
|
*/
|
|
@@ -33,7 +33,7 @@ export function render(props) {
|
|
|
33
33
|
</span>
|
|
34
34
|
`
|
|
35
35
|
|
|
36
|
-
return
|
|
36
|
+
return Button.render({
|
|
37
37
|
...props,
|
|
38
38
|
children,
|
|
39
39
|
onClick,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Input } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/Input",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Input),
|
|
8
8
|
argTypes: {
|
|
9
9
|
// ...notifyActionArgType,
|
|
10
10
|
label: {
|
|
@@ -8,8 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a labeled input field with optional icons, hint text, and error messaging.
|
|
12
|
+
* Supports disabled/readonly/required states and emits `onChange` on input.
|
|
13
13
|
* @example
|
|
14
14
|
* // Stateless usage
|
|
15
15
|
* input.render({ label: 'Email', type: 'email', placeholder: 'you@example.com' })
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { RadioGroup } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/RadioGroup",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(RadioGroup),
|
|
8
8
|
argTypes: {
|
|
9
9
|
label: { control: "text", description: "Fieldset label." },
|
|
10
10
|
name: { control: "text", description: "Native radio input name." },
|
|
@@ -8,8 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a group of radio options for single selection.
|
|
12
|
+
* Supports horizontal/vertical layouts and disabled state.
|
|
13
13
|
* @param {RadioGroupProps} props
|
|
14
14
|
* @returns {TemplateResult}
|
|
15
15
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Rating } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/Rating",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Rating),
|
|
8
8
|
argTypes: {
|
|
9
9
|
value: { control: "number", description: "Current rating value." },
|
|
10
10
|
max: { control: "number", description: "Maximum rating value." },
|
|
@@ -10,8 +10,8 @@ const DEFAULT_MAX = 5
|
|
|
10
10
|
const INDEX_TO_RATING = 1
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* Renders a star (or custom symbol) rating control.
|
|
14
|
+
* Supports max value, read-only/disabled states, and emits selection changes.
|
|
15
15
|
* @param {RatingProps} props
|
|
16
16
|
* @returns {TemplateResult}
|
|
17
17
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Select } from "./index.js"
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/Select",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Select),
|
|
8
8
|
argTypes: {
|
|
9
9
|
name: {
|
|
10
10
|
control: "text",
|
|
@@ -9,8 +9,8 @@ import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
|
9
9
|
import { formatOption, getOptionValue, isOptionSelected } from "./helpers.js"
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* Renders a styled native select control with optional single or multi-select modes.
|
|
13
|
+
* Options can be primitives or objects and are rendered with consistent theming.
|
|
14
14
|
* @example
|
|
15
15
|
* // Stateless usage
|
|
16
16
|
* select.render({ options: ['true', 'false'], value: 'true' })
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Slider } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/Slider",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Slider),
|
|
8
8
|
argTypes: {
|
|
9
9
|
label: { control: "text", description: "Field label." },
|
|
10
10
|
name: { control: "text", description: "Native input name." },
|
|
@@ -13,8 +13,8 @@ const DEFAULT_MAX = 100
|
|
|
13
13
|
const DEFAULT_STEP = 1
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Renders a range slider with optional label and current value display.
|
|
17
|
+
* Supports min/max/step, color, disabled state, and full-width layout.
|
|
18
18
|
* @param {SliderProps} props
|
|
19
19
|
* @returns {TemplateResult}
|
|
20
20
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Switch } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/Switch",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Switch),
|
|
8
8
|
argTypes: {
|
|
9
9
|
label: { control: "text", description: "Label text." },
|
|
10
10
|
name: { control: "text", description: "Native input name." },
|
|
@@ -8,8 +8,8 @@ import { classMap, html, ref } from "@inglorious/web"
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Renders a toggle switch backed by a checkbox input.
|
|
12
|
+
* Use it for boolean settings with optional labels and disabled state.
|
|
13
13
|
* @param {SwitchProps} props
|
|
14
14
|
* @returns {TemplateResult}
|
|
15
15
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Avatar } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Data Display/Avatar",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Avatar),
|
|
8
8
|
argTypes: {
|
|
9
9
|
src: {
|
|
10
10
|
control: "text",
|