@neptune.fintech/web-ui 1.0.0 → 2.1.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/LICENSE +1 -1
- package/README.md +25 -3
- package/dist/components/actions.d.ts +43 -0
- package/dist/components/actions.d.ts.map +1 -0
- package/dist/components/actions.js +279 -0
- package/dist/components/actions.js.map +1 -0
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +9 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/containers.d.ts +54 -0
- package/dist/components/containers.d.ts.map +1 -0
- package/dist/components/containers.js +298 -0
- package/dist/components/containers.js.map +1 -0
- package/dist/components/feedback.d.ts +42 -0
- package/dist/components/feedback.d.ts.map +1 -0
- package/dist/components/feedback.js +241 -0
- package/dist/components/feedback.js.map +1 -0
- package/dist/components/inputs.d.ts +8 -1
- package/dist/components/inputs.d.ts.map +1 -1
- package/dist/components/inputs.js +57 -3
- package/dist/components/inputs.js.map +1 -1
- package/dist/components/layout.d.ts +68 -0
- package/dist/components/layout.d.ts.map +1 -0
- package/dist/components/layout.js +359 -0
- package/dist/components/layout.js.map +1 -0
- package/dist/components/nav-rail.d.ts +22 -0
- package/dist/components/nav-rail.d.ts.map +1 -0
- package/dist/components/nav-rail.js +120 -0
- package/dist/components/nav-rail.js.map +1 -0
- package/dist/components/selection.d.ts +51 -0
- package/dist/components/selection.d.ts.map +1 -0
- package/dist/components/selection.js +377 -0
- package/dist/components/selection.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/register.d.ts.map +1 -1
- package/dist/register.js +38 -0
- package/dist/register.js.map +1 -1
- package/dist/theme/applyTheme.d.ts +1 -1
- package/dist/theme/applyTheme.js +2 -2
- package/dist/theme/applyTheme.js.map +1 -1
- package/package.json +2 -2
- package/styles/themes.css +17 -17
package/LICENSE
CHANGED
|
@@ -64,7 +64,7 @@ obtain a commercial license or cease production use.
|
|
|
64
64
|
(c) No trademark use. This license grants no rights in the Licensor's names,
|
|
65
65
|
logos, or brand names beyond the attribution required above.
|
|
66
66
|
(d) The brands, names, and visual identities of example tenants in this
|
|
67
|
-
repository (e.g. "
|
|
67
|
+
repository (e.g. "Triton Bank", "Nereid", "Proteus") are reference
|
|
68
68
|
illustrations only and convey no rights.
|
|
69
69
|
|
|
70
70
|
------------------------------------------------------------------------------
|
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ import "@neptune.fintech/web-ui/styles.css"; // ships themes.css + system.css
|
|
|
24
24
|
import { applyTheme, registerAll } from "@neptune.fintech/web-ui";
|
|
25
25
|
|
|
26
26
|
registerAll(); // define the custom elements
|
|
27
|
-
applyTheme(document.documentElement, "
|
|
27
|
+
applyTheme(document.documentElement, "triton", { mode: "system", dir: "auto" });
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
```html
|
|
@@ -51,8 +51,30 @@ a brand is zero JavaScript. Custom configs and brandprints resolve through
|
|
|
51
51
|
|
|
52
52
|
## Components
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
A standards-based **Material 3** kit. Every element is themed only by CSS variables.
|
|
55
|
+
|
|
56
|
+
**Core & financial:** `npt-button` (filled / elevated / tonal / outlined / text) ·
|
|
57
|
+
`npt-card` (incl. `glass`) · `npt-balance-card` · `npt-transaction-row` · `npt-text-field` ·
|
|
58
|
+
`npt-badge`.
|
|
59
|
+
|
|
60
|
+
**Buttons & actions:** `npt-icon-button` (standard / filled / tonal / outlined, `[selected]`) ·
|
|
61
|
+
`npt-fab` (`sm`/`md`/`lg`, `[extended]`) · `npt-segmented-button` + `npt-segmented-option`.
|
|
62
|
+
|
|
63
|
+
**Selection controls:** `npt-checkbox` (`[indeterminate]`) · `npt-radio` (name/value group) ·
|
|
64
|
+
`npt-switch` · `npt-slider` (output bubble).
|
|
65
|
+
|
|
66
|
+
**Chips:** `npt-chip` with `variant="assist|filter|input|suggestion"` (filter check, input ✕).
|
|
67
|
+
|
|
68
|
+
**Communication & feedback:** `npt-progress` (linear / circular, `[indeterminate]`) ·
|
|
69
|
+
`npt-snackbar` · `npt-tooltip` · `npt-banner`.
|
|
70
|
+
|
|
71
|
+
**Containers & layout:** `npt-dialog` (scrim, ESC / backdrop close, focus-trap) ·
|
|
72
|
+
`npt-bottom-sheet` · `npt-list` + `npt-list-item` · `npt-divider` (`[inset]`) ·
|
|
73
|
+
`npt-tabs` + `npt-tab` · `npt-accordion` + `npt-accordion-item` · `npt-avatar` ·
|
|
74
|
+
`npt-menu` + `npt-menu-item`.
|
|
75
|
+
|
|
76
|
+
**Navigation:** `npt-app-bar` · `npt-top-app-bar` (`small`/`center`/`medium`/`large`) ·
|
|
77
|
+
`npt-nav-bar` · `npt-nav-rail` · `npt-nav-item`.
|
|
56
78
|
|
|
57
79
|
Every component reads **only** `var(--md-sys-color-*)` / `var(--npt-*)` — no literal color,
|
|
58
80
|
radius, or font anywhere (principle P2). Layout is logical (`*-inline-*`) so it mirrors in
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { NptElement } from "./base.js";
|
|
2
|
+
/**
|
|
3
|
+
* <npt-icon-button variant="standard|filled|tonal|outlined" [selected] [disabled]
|
|
4
|
+
* label="Favourite">★</npt-icon-button>
|
|
5
|
+
* 48dp circular target. `selected` toggles the active treatment.
|
|
6
|
+
*/
|
|
7
|
+
export declare class NptIconButton extends NptElement {
|
|
8
|
+
static observedAttributes: string[];
|
|
9
|
+
attributeChangedCallback(): void;
|
|
10
|
+
protected styles(): string;
|
|
11
|
+
protected render(): string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* <npt-fab size="sm|md|lg" [extended] label="Compose" [disabled]>+</npt-fab>
|
|
15
|
+
* Primary-container floating action. `extended` reveals the text label.
|
|
16
|
+
*/
|
|
17
|
+
export declare class NptFab extends NptElement {
|
|
18
|
+
static observedAttributes: string[];
|
|
19
|
+
attributeChangedCallback(): void;
|
|
20
|
+
protected styles(): string;
|
|
21
|
+
protected render(): string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* <npt-segmented-button [multi]> with <npt-segmented-option> children.
|
|
25
|
+
* Connected single- or multi-select group. Single-select is the default.
|
|
26
|
+
*/
|
|
27
|
+
export declare class NptSegmentedButton extends NptElement {
|
|
28
|
+
static observedAttributes: string[];
|
|
29
|
+
attributeChangedCallback(): void;
|
|
30
|
+
connectedCallback(): void;
|
|
31
|
+
disconnectedCallback(): void;
|
|
32
|
+
private onClick;
|
|
33
|
+
protected styles(): string;
|
|
34
|
+
protected render(): string;
|
|
35
|
+
}
|
|
36
|
+
/** <npt-segmented-option value="day" [selected] [disabled]>Day</npt-segmented-option> */
|
|
37
|
+
export declare class NptSegmentedOption extends NptElement {
|
|
38
|
+
static observedAttributes: string[];
|
|
39
|
+
attributeChangedCallback(): void;
|
|
40
|
+
protected styles(): string;
|
|
41
|
+
protected render(): string;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/components/actions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAmB,MAAM,WAAW,CAAC;AAKxD;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,UAAU;IAC3C,MAAM,CAAC,kBAAkB,WAAgD;IAEzE,wBAAwB,IAAI,IAAI;IAIhC,SAAS,CAAC,MAAM,IAAI,MAAM;IA0D1B,SAAS,CAAC,MAAM,IAAI,MAAM;CAW3B;AAED;;;GAGG;AACH,qBAAa,MAAO,SAAQ,UAAU;IACpC,MAAM,CAAC,kBAAkB,WAA6C;IAEtE,wBAAwB,IAAI,IAAI;IAIhC,SAAS,CAAC,MAAM,IAAI,MAAM;IAwD1B,SAAS,CAAC,MAAM,IAAI,MAAM;CAQ3B;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,UAAU;IAChD,MAAM,CAAC,kBAAkB,WAAa;IAEtC,wBAAwB,IAAI,IAAI;IAIvB,iBAAiB,IAAI,IAAI;IAKlC,oBAAoB,IAAI,IAAI;IAI5B,OAAO,CAAC,OAAO,CAWb;IAEF,SAAS,CAAC,MAAM,IAAI,MAAM;IAe1B,SAAS,CAAC,MAAM,IAAI,MAAM;CAM3B;AAED,yFAAyF;AACzF,qBAAa,kBAAmB,SAAQ,UAAU;IAChD,MAAM,CAAC,kBAAkB,WAAqC;IAE9D,wBAAwB,IAAI,IAAI;IAIhC,SAAS,CAAC,MAAM,IAAI,MAAM;IA0C1B,SAAS,CAAC,MAAM,IAAI,MAAM;CAc3B"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
// © 2026 Neptune.Fintech (neptune.ly) · Neptune Odyssey Community License v1.0
|
|
2
|
+
// Neptune Odyssey — action components
|
|
3
|
+
// <npt-icon-button>, <npt-fab>, <npt-segmented-button> + <npt-segmented-option>.
|
|
4
|
+
// Logical layout → mirrors in RTL. Custom-property driven only.
|
|
5
|
+
import { NptElement, css, html, A11Y } from "./base.js";
|
|
6
|
+
const esc = (v) => (v ?? "").replace(/[&<>"]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """ })[c]);
|
|
7
|
+
/**
|
|
8
|
+
* <npt-icon-button variant="standard|filled|tonal|outlined" [selected] [disabled]
|
|
9
|
+
* label="Favourite">★</npt-icon-button>
|
|
10
|
+
* 48dp circular target. `selected` toggles the active treatment.
|
|
11
|
+
*/
|
|
12
|
+
export class NptIconButton extends NptElement {
|
|
13
|
+
attributeChangedCallback() {
|
|
14
|
+
if (this.isConnected)
|
|
15
|
+
this.update();
|
|
16
|
+
}
|
|
17
|
+
styles() {
|
|
18
|
+
return css `
|
|
19
|
+
${A11Y}
|
|
20
|
+
:host {
|
|
21
|
+
display: inline-block;
|
|
22
|
+
}
|
|
23
|
+
button {
|
|
24
|
+
inline-size: 48px;
|
|
25
|
+
block-size: 48px;
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
border: none;
|
|
30
|
+
border-radius: var(--npt-corner-full, 999px);
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
background: transparent;
|
|
33
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
34
|
+
font-family: var(--npt-font-text);
|
|
35
|
+
font-size: var(--npt-text-title, 18px);
|
|
36
|
+
transition: background-color var(--npt-dur-fast, 200ms) var(--npt-ease-standard, ease),
|
|
37
|
+
color var(--npt-dur-fast, 200ms) var(--npt-ease-standard, ease);
|
|
38
|
+
}
|
|
39
|
+
button:disabled {
|
|
40
|
+
cursor: not-allowed;
|
|
41
|
+
opacity: 0.38;
|
|
42
|
+
}
|
|
43
|
+
:host([variant="filled"]) button {
|
|
44
|
+
background: var(--md-sys-color-surface-container-highest);
|
|
45
|
+
color: var(--md-sys-color-primary);
|
|
46
|
+
}
|
|
47
|
+
:host([variant="filled"][selected]) button {
|
|
48
|
+
background: var(--md-sys-color-primary);
|
|
49
|
+
color: var(--md-sys-color-on-primary);
|
|
50
|
+
}
|
|
51
|
+
:host([variant="tonal"]) button {
|
|
52
|
+
background: var(--md-sys-color-secondary-container);
|
|
53
|
+
color: var(--md-sys-color-on-secondary-container);
|
|
54
|
+
}
|
|
55
|
+
:host([variant="tonal"][selected]) button {
|
|
56
|
+
background: var(--md-sys-color-secondary);
|
|
57
|
+
color: var(--md-sys-color-on-secondary);
|
|
58
|
+
}
|
|
59
|
+
:host([variant="outlined"]) button {
|
|
60
|
+
border: 1px solid var(--md-sys-color-outline);
|
|
61
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
62
|
+
}
|
|
63
|
+
:host([variant="outlined"][selected]) button {
|
|
64
|
+
background: var(--md-sys-color-inverse-surface);
|
|
65
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
66
|
+
border-color: transparent;
|
|
67
|
+
}
|
|
68
|
+
:host(:not([variant])[selected]) button,
|
|
69
|
+
:host([variant="standard"][selected]) button {
|
|
70
|
+
color: var(--md-sys-color-primary);
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
render() {
|
|
75
|
+
const disabled = this.hasAttribute("disabled") ? "disabled" : "";
|
|
76
|
+
const pressed = this.hasAttribute("selected") ? "true" : "false";
|
|
77
|
+
const label = esc(this.getAttribute("label"));
|
|
78
|
+
return html `<button
|
|
79
|
+
part="button"
|
|
80
|
+
${disabled}
|
|
81
|
+
aria-pressed="${pressed}"
|
|
82
|
+
aria-label="${label}"
|
|
83
|
+
><slot></slot></button>`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
NptIconButton.observedAttributes = ["variant", "selected", "disabled", "label"];
|
|
87
|
+
/**
|
|
88
|
+
* <npt-fab size="sm|md|lg" [extended] label="Compose" [disabled]>+</npt-fab>
|
|
89
|
+
* Primary-container floating action. `extended` reveals the text label.
|
|
90
|
+
*/
|
|
91
|
+
export class NptFab extends NptElement {
|
|
92
|
+
attributeChangedCallback() {
|
|
93
|
+
if (this.isConnected)
|
|
94
|
+
this.update();
|
|
95
|
+
}
|
|
96
|
+
styles() {
|
|
97
|
+
return css `
|
|
98
|
+
${A11Y}
|
|
99
|
+
:host {
|
|
100
|
+
display: inline-block;
|
|
101
|
+
}
|
|
102
|
+
button {
|
|
103
|
+
min-inline-size: 56px;
|
|
104
|
+
min-block-size: 56px;
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
gap: var(--npt-space-3, 12px);
|
|
109
|
+
border: none;
|
|
110
|
+
border-radius: var(--npt-corner-lg, 24px);
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
padding-inline: var(--npt-space-4, 16px);
|
|
113
|
+
background: var(--md-sys-color-primary-container);
|
|
114
|
+
color: var(--md-sys-color-on-primary-container);
|
|
115
|
+
font-family: var(--npt-font-text);
|
|
116
|
+
font-size: var(--npt-text-label, 14px);
|
|
117
|
+
font-weight: 600;
|
|
118
|
+
box-shadow: var(--npt-elevation-3, 0 8px 20px rgba(0, 0, 0, 0.2));
|
|
119
|
+
transition: box-shadow var(--npt-dur-fast, 200ms) var(--npt-ease-standard, ease);
|
|
120
|
+
}
|
|
121
|
+
button:disabled {
|
|
122
|
+
cursor: not-allowed;
|
|
123
|
+
opacity: 0.38;
|
|
124
|
+
}
|
|
125
|
+
:host([size="sm"]) button {
|
|
126
|
+
min-inline-size: 40px;
|
|
127
|
+
min-block-size: 40px;
|
|
128
|
+
border-radius: var(--npt-corner-md, 16px);
|
|
129
|
+
}
|
|
130
|
+
:host([size="lg"]) button {
|
|
131
|
+
min-inline-size: 96px;
|
|
132
|
+
min-block-size: 96px;
|
|
133
|
+
border-radius: var(--npt-corner-xl, 32px);
|
|
134
|
+
font-size: var(--npt-text-title, 18px);
|
|
135
|
+
}
|
|
136
|
+
.icon {
|
|
137
|
+
display: inline-flex;
|
|
138
|
+
font-size: var(--npt-text-title, 18px);
|
|
139
|
+
}
|
|
140
|
+
.label {
|
|
141
|
+
display: none;
|
|
142
|
+
}
|
|
143
|
+
:host([extended]) .label {
|
|
144
|
+
display: inline;
|
|
145
|
+
}
|
|
146
|
+
:host([extended]) button {
|
|
147
|
+
padding-inline: var(--npt-space-5, 20px);
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
150
|
+
}
|
|
151
|
+
render() {
|
|
152
|
+
const disabled = this.hasAttribute("disabled") ? "disabled" : "";
|
|
153
|
+
const label = esc(this.getAttribute("label"));
|
|
154
|
+
return html `<button part="button" ${disabled} aria-label="${label}">
|
|
155
|
+
<span class="icon"><slot></slot></span>
|
|
156
|
+
${label ? html `<span class="label">${label}</span>` : ""}
|
|
157
|
+
</button>`;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
NptFab.observedAttributes = ["size", "extended", "label", "disabled"];
|
|
161
|
+
/**
|
|
162
|
+
* <npt-segmented-button [multi]> with <npt-segmented-option> children.
|
|
163
|
+
* Connected single- or multi-select group. Single-select is the default.
|
|
164
|
+
*/
|
|
165
|
+
export class NptSegmentedButton extends NptElement {
|
|
166
|
+
constructor() {
|
|
167
|
+
super(...arguments);
|
|
168
|
+
this.onClick = (e) => {
|
|
169
|
+
const target = e.target?.closest("npt-segmented-option");
|
|
170
|
+
if (!target || target.hasAttribute("disabled"))
|
|
171
|
+
return;
|
|
172
|
+
if (this.hasAttribute("multi")) {
|
|
173
|
+
target.toggleAttribute("selected");
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
for (const opt of this.querySelectorAll("npt-segmented-option")) {
|
|
177
|
+
opt.toggleAttribute("selected", opt === target);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
this.dispatchEvent(new CustomEvent("change", { bubbles: true }));
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
attributeChangedCallback() {
|
|
184
|
+
if (this.isConnected)
|
|
185
|
+
this.update();
|
|
186
|
+
}
|
|
187
|
+
connectedCallback() {
|
|
188
|
+
super.connectedCallback();
|
|
189
|
+
this.addEventListener("click", this.onClick);
|
|
190
|
+
}
|
|
191
|
+
disconnectedCallback() {
|
|
192
|
+
this.removeEventListener("click", this.onClick);
|
|
193
|
+
}
|
|
194
|
+
styles() {
|
|
195
|
+
return css `
|
|
196
|
+
${A11Y}
|
|
197
|
+
:host {
|
|
198
|
+
display: inline-flex;
|
|
199
|
+
}
|
|
200
|
+
.group {
|
|
201
|
+
display: inline-flex;
|
|
202
|
+
border: 1px solid var(--md-sys-color-outline);
|
|
203
|
+
border-radius: var(--npt-corner-full, 999px);
|
|
204
|
+
overflow: hidden;
|
|
205
|
+
}
|
|
206
|
+
`;
|
|
207
|
+
}
|
|
208
|
+
render() {
|
|
209
|
+
const multi = this.hasAttribute("multi");
|
|
210
|
+
return html `<div class="group" part="group" role="group" aria-multiselectable="${multi}">
|
|
211
|
+
<slot></slot>
|
|
212
|
+
</div>`;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
NptSegmentedButton.observedAttributes = ["multi"];
|
|
216
|
+
/** <npt-segmented-option value="day" [selected] [disabled]>Day</npt-segmented-option> */
|
|
217
|
+
export class NptSegmentedOption extends NptElement {
|
|
218
|
+
attributeChangedCallback() {
|
|
219
|
+
if (this.isConnected)
|
|
220
|
+
this.update();
|
|
221
|
+
}
|
|
222
|
+
styles() {
|
|
223
|
+
return css `
|
|
224
|
+
${A11Y}
|
|
225
|
+
:host {
|
|
226
|
+
display: inline-flex;
|
|
227
|
+
}
|
|
228
|
+
.opt {
|
|
229
|
+
min-height: 48px;
|
|
230
|
+
display: inline-flex;
|
|
231
|
+
align-items: center;
|
|
232
|
+
justify-content: center;
|
|
233
|
+
gap: var(--npt-space-2, 8px);
|
|
234
|
+
padding-inline: var(--npt-space-4, 16px);
|
|
235
|
+
border: none;
|
|
236
|
+
border-inline-start: 1px solid var(--md-sys-color-outline);
|
|
237
|
+
background: transparent;
|
|
238
|
+
color: var(--md-sys-color-on-surface);
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
font-family: var(--npt-font-text);
|
|
241
|
+
font-size: var(--npt-text-label, 14px);
|
|
242
|
+
transition: background-color var(--npt-dur-fast, 200ms) var(--npt-ease-standard, ease);
|
|
243
|
+
}
|
|
244
|
+
:host(:first-of-type) .opt {
|
|
245
|
+
border-inline-start: none;
|
|
246
|
+
}
|
|
247
|
+
:host([selected]) .opt {
|
|
248
|
+
background: var(--md-sys-color-secondary-container);
|
|
249
|
+
color: var(--md-sys-color-on-secondary-container);
|
|
250
|
+
}
|
|
251
|
+
.opt:disabled {
|
|
252
|
+
cursor: not-allowed;
|
|
253
|
+
opacity: 0.38;
|
|
254
|
+
}
|
|
255
|
+
.check {
|
|
256
|
+
display: none;
|
|
257
|
+
}
|
|
258
|
+
:host([selected]) .check {
|
|
259
|
+
display: inline;
|
|
260
|
+
}
|
|
261
|
+
`;
|
|
262
|
+
}
|
|
263
|
+
render() {
|
|
264
|
+
const selected = this.hasAttribute("selected");
|
|
265
|
+
const disabled = this.hasAttribute("disabled") ? "disabled" : "";
|
|
266
|
+
return html `<button
|
|
267
|
+
class="opt"
|
|
268
|
+
part="option"
|
|
269
|
+
role="button"
|
|
270
|
+
aria-pressed="${selected}"
|
|
271
|
+
${disabled}
|
|
272
|
+
>
|
|
273
|
+
<span class="check" aria-hidden="true">✓</span>
|
|
274
|
+
<slot></slot>
|
|
275
|
+
</button>`;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
NptSegmentedOption.observedAttributes = ["selected", "disabled", "value"];
|
|
279
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/components/actions.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,sCAAsC;AACtC,iFAAiF;AACjF,gEAAgE;AAChE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,GAAG,GAAG,CAAC,CAAgB,EAAU,EAAE,CACvC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC;AAEvG;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,UAAU;IAG3C,wBAAwB;QACtB,IAAI,IAAI,CAAC,WAAW;YAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IACtC,CAAC;IAES,MAAM;QACd,OAAO,GAAG,CAAA;QACN,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqDP,CAAC;IACJ,CAAC;IAES,MAAM;QACd,MAAM,QAAQ,GAAG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,CAAC;IACV,CAAC;;AAhDM,qCAAkB,GAAG,CAAC,OAAO,CAAC,AAAZ,CAAa;AAmDxC,yFAAyF;AACzF,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAGhD,wBAAwB;QACtB,IAAI,IAAI,CAAC,WAAW;YAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IACtC,CAAC;IAES,MAAM;QACd,OAAO,GAAG,CAAA;QACN,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqCP,CAAC;IACJ,CAAC;IAES,MAAM;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,OAAO,IAAI,CAAA;;;;sBAIO,QAAQ;QACtB,QAAQ;;;;cAIF,CAAC;IACb,CAAC;;AA7DM,qCAAkB,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NptElement } from "./base.js";
|
|
2
2
|
/**
|
|
3
|
-
* <npt-button variant="filled|tonal|outlined|text" [disabled]>Label</npt-button>
|
|
3
|
+
* <npt-button variant="filled|elevated|tonal|outlined|text" [disabled]>Label</npt-button>
|
|
4
4
|
* M3 Expressive button. Pill shape, brand-tinted, 48dp min target.
|
|
5
5
|
*/
|
|
6
6
|
export declare class NptButton extends NptElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAmB,MAAM,WAAW,CAAC;AAExD;;;GAGG;AACH,qBAAa,SAAU,SAAQ,UAAU;IACvC,MAAM,CAAC,kBAAkB,WAA2B;IAEpD,wBAAwB,IAAI,IAAI;IAIhC,SAAS,CAAC,MAAM,IAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAmB,MAAM,WAAW,CAAC;AAExD;;;GAGG;AACH,qBAAa,SAAU,SAAQ,UAAU;IACvC,MAAM,CAAC,kBAAkB,WAA2B;IAEpD,wBAAwB,IAAI,IAAI;IAIhC,SAAS,CAAC,MAAM,IAAI,MAAM;IA6D1B,SAAS,CAAC,MAAM,IAAI,MAAM;CAI3B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Neptune Odyssey — <npt-button> · © 2026 Neptune.Fintech (neptune.ly)
|
|
2
2
|
import { NptElement, css, html, A11Y } from "./base.js";
|
|
3
3
|
/**
|
|
4
|
-
* <npt-button variant="filled|tonal|outlined|text" [disabled]>Label</npt-button>
|
|
4
|
+
* <npt-button variant="filled|elevated|tonal|outlined|text" [disabled]>Label</npt-button>
|
|
5
5
|
* M3 Expressive button. Pill shape, brand-tinted, 48dp min target.
|
|
6
6
|
*/
|
|
7
7
|
export class NptButton extends NptElement {
|
|
@@ -45,6 +45,14 @@ export class NptButton extends NptElement {
|
|
|
45
45
|
:host(:not([variant])) button:hover:not(:disabled) {
|
|
46
46
|
box-shadow: var(--npt-elevation-1, 0 1px 3px rgba(0, 0, 0, 0.2));
|
|
47
47
|
}
|
|
48
|
+
:host([variant="elevated"]) button {
|
|
49
|
+
background: var(--md-sys-color-surface-container-low);
|
|
50
|
+
color: var(--md-sys-color-primary);
|
|
51
|
+
box-shadow: var(--npt-elevation-1, 0 1px 3px rgba(0, 0, 0, 0.2));
|
|
52
|
+
}
|
|
53
|
+
:host([variant="elevated"]) button:hover:not(:disabled) {
|
|
54
|
+
box-shadow: var(--npt-elevation-2, 0 2px 6px rgba(0, 0, 0, 0.18));
|
|
55
|
+
}
|
|
48
56
|
:host([variant="tonal"]) button {
|
|
49
57
|
background: var(--md-sys-color-secondary-container);
|
|
50
58
|
color: var(--md-sys-color-on-secondary-container);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/components/button.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAExD;;;GAGG;AACH,MAAM,OAAO,SAAU,SAAQ,UAAU;IAGvC,wBAAwB;QACtB,IAAI,IAAI,CAAC,WAAW;YAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IACtC,CAAC;IAES,MAAM;QACd,OAAO,GAAG,CAAA;QACN,IAAI
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/components/button.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAExD;;;GAGG;AACH,MAAM,OAAO,SAAU,SAAQ,UAAU;IAGvC,wBAAwB;QACtB,IAAI,IAAI,CAAC,WAAW;YAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IACtC,CAAC;IAES,MAAM;QACd,OAAO,GAAG,CAAA;QACN,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwDP,CAAC;IACJ,CAAC;IAES,MAAM;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,OAAO,IAAI,CAAA,yBAAyB,QAAQ,yBAAyB,CAAC;IACxE,CAAC;;AAtEM,4BAAkB,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { NptElement } from "./base.js";
|
|
2
|
+
/**
|
|
3
|
+
* <npt-dialog [open] headline="Confirm">
|
|
4
|
+
* …content… <span slot="actions">…</span>
|
|
5
|
+
* </npt-dialog>
|
|
6
|
+
* Scrim + centred surface. ESC and backdrop close; focus-trap-lite.
|
|
7
|
+
*/
|
|
8
|
+
export declare class NptDialog extends NptElement {
|
|
9
|
+
static observedAttributes: string[];
|
|
10
|
+
attributeChangedCallback(name: string): void;
|
|
11
|
+
connectedCallback(): void;
|
|
12
|
+
disconnectedCallback(): void;
|
|
13
|
+
/** Close the overlay and emit a `close` event. */
|
|
14
|
+
close(): void;
|
|
15
|
+
private focusFirst;
|
|
16
|
+
private onClick;
|
|
17
|
+
private onKey;
|
|
18
|
+
protected styles(): string;
|
|
19
|
+
protected render(): string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* <npt-bottom-sheet [open]>…content…</npt-bottom-sheet>
|
|
23
|
+
* Bottom-anchored sheet with a drag affordance + scrim. Backdrop/ESC close.
|
|
24
|
+
*/
|
|
25
|
+
export declare class NptBottomSheet extends NptElement {
|
|
26
|
+
static observedAttributes: string[];
|
|
27
|
+
attributeChangedCallback(): void;
|
|
28
|
+
connectedCallback(): void;
|
|
29
|
+
disconnectedCallback(): void;
|
|
30
|
+
/** Close the sheet and emit a `close` event. */
|
|
31
|
+
close(): void;
|
|
32
|
+
private onClick;
|
|
33
|
+
private onKey;
|
|
34
|
+
protected styles(): string;
|
|
35
|
+
protected render(): string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* <npt-menu [open]> with <npt-menu-item> children.
|
|
39
|
+
* Anchored popover. Place inside a positioned ancestor for anchoring.
|
|
40
|
+
*/
|
|
41
|
+
export declare class NptMenu extends NptElement {
|
|
42
|
+
static observedAttributes: string[];
|
|
43
|
+
attributeChangedCallback(): void;
|
|
44
|
+
protected styles(): string;
|
|
45
|
+
protected render(): string;
|
|
46
|
+
}
|
|
47
|
+
/** <npt-menu-item [disabled]>Settings</npt-menu-item> */
|
|
48
|
+
export declare class NptMenuItem extends NptElement {
|
|
49
|
+
static observedAttributes: string[];
|
|
50
|
+
attributeChangedCallback(): void;
|
|
51
|
+
protected styles(): string;
|
|
52
|
+
protected render(): string;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=containers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containers.d.ts","sourceRoot":"","sources":["../../src/components/containers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAmB,MAAM,WAAW,CAAC;AAKxD;;;;;GAKG;AACH,qBAAa,SAAU,SAAQ,UAAU;IACvC,MAAM,CAAC,kBAAkB,WAAwB;IAEjD,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKnC,iBAAiB,IAAI,IAAI;IAMlC,oBAAoB,IAAI,IAAI;IAK5B,kDAAkD;IAClD,KAAK,IAAI,IAAI;IAKb,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,OAAO,CAGb;IAEF,OAAO,CAAC,KAAK,CAoBX;IAEF,SAAS,CAAC,MAAM,IAAI,MAAM;IAiD1B,SAAS,CAAC,MAAM,IAAI,MAAM;CAU3B;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,UAAU;IAC5C,MAAM,CAAC,kBAAkB,WAAY;IAErC,wBAAwB,IAAI,IAAI;IAIvB,iBAAiB,IAAI,IAAI;IAMlC,oBAAoB,IAAI,IAAI;IAK5B,gDAAgD;IAChD,KAAK,IAAI,IAAI;IAKb,OAAO,CAAC,OAAO,CAGb;IAEF,OAAO,CAAC,KAAK,CAKX;IAEF,SAAS,CAAC,MAAM,IAAI,MAAM;IAwC1B,SAAS,CAAC,MAAM,IAAI,MAAM;CAQ3B;AAED;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,UAAU;IACrC,MAAM,CAAC,kBAAkB,WAAY;IAErC,wBAAwB,IAAI,IAAI;IAIhC,SAAS,CAAC,MAAM,IAAI,MAAM;IAwB1B,SAAS,CAAC,MAAM,IAAI,MAAM;CAG3B;AAED,yDAAyD;AAC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