@kumori/aurora-wui-components 0.0.2 → 0.0.3
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/dist/components/aurora-button.d.ts +2 -2
- package/dist/components/cards/aurora-base-card.d.ts +2 -8
- package/dist/components/cards/aurora-base-card.d.ts.map +1 -1
- package/dist/components/cards/aurora-more-actions.d.ts +2 -2
- package/dist/components/cards/aurora-more-actions.d.ts.map +1 -1
- package/dist/components/cards/aurora-runtime-card.d.ts +2 -3
- package/dist/components/cards/aurora-runtime-card.d.ts.map +1 -1
- package/dist/components/cards/parts/aurora-card-action-banner.d.ts +2 -2
- package/dist/components/cards/parts/aurora-card-action-banner.d.ts.map +1 -1
- package/dist/components/cards/parts/aurora-card-attention-banner.d.ts +2 -2
- package/dist/components/cards/parts/aurora-card-attention-banner.d.ts.map +1 -1
- package/dist/components/cards/parts/aurora-card-filter-item.d.ts +2 -2
- package/dist/components/cards/parts/aurora-card-filter-item.d.ts.map +1 -1
- package/dist/components/cards/parts/aurora-card-filter.d.ts +2 -3
- package/dist/components/cards/parts/aurora-card-filter.d.ts.map +1 -1
- package/dist/components/cards/parts/aurora-card-header.d.ts +2 -2
- package/dist/components/cards/parts/aurora-card-header.d.ts.map +1 -1
- package/dist/components/cards/parts/aurora-card-resource-table.d.ts +2 -4
- package/dist/components/cards/parts/aurora-card-resource-table.d.ts.map +1 -1
- package/dist/components/cards/parts/aurora-card-stat-item.d.ts +2 -2
- package/dist/components/cards/parts/aurora-card-stat-item.d.ts.map +1 -1
- package/dist/components/cards/parts/aurora-card-stats-row.d.ts +2 -3
- package/dist/components/cards/parts/aurora-card-stats-row.d.ts.map +1 -1
- package/dist/components/cards/parts/aurora-card-status-bar.d.ts +2 -3
- package/dist/components/cards/parts/aurora-card-status-bar.d.ts.map +1 -1
- package/dist/index.js +1222 -15
- package/dist/index.js.map +1 -1
- package/dist/styles/aurora-theme.d.ts +1 -1
- package/package.json +10 -4
- package/dist/components/aurora-button.js +0 -49
- package/dist/components/aurora-button.js.map +0 -1
- package/dist/components/cards/aurora-base-card.js +0 -299
- package/dist/components/cards/aurora-base-card.js.map +0 -1
- package/dist/components/cards/aurora-more-actions.js +0 -194
- package/dist/components/cards/aurora-more-actions.js.map +0 -1
- package/dist/components/cards/aurora-runtime-card.js +0 -427
- package/dist/components/cards/aurora-runtime-card.js.map +0 -1
- package/dist/components/cards/card.types.js +0 -2
- package/dist/components/cards/card.types.js.map +0 -1
- package/dist/components/cards/parts/aurora-card-action-banner.js +0 -61
- package/dist/components/cards/parts/aurora-card-action-banner.js.map +0 -1
- package/dist/components/cards/parts/aurora-card-attention-banner.js +0 -111
- package/dist/components/cards/parts/aurora-card-attention-banner.js.map +0 -1
- package/dist/components/cards/parts/aurora-card-filter-item.js +0 -53
- package/dist/components/cards/parts/aurora-card-filter-item.js.map +0 -1
- package/dist/components/cards/parts/aurora-card-filter.js +0 -168
- package/dist/components/cards/parts/aurora-card-filter.js.map +0 -1
- package/dist/components/cards/parts/aurora-card-header.js +0 -161
- package/dist/components/cards/parts/aurora-card-header.js.map +0 -1
- package/dist/components/cards/parts/aurora-card-resource-table.js +0 -210
- package/dist/components/cards/parts/aurora-card-resource-table.js.map +0 -1
- package/dist/components/cards/parts/aurora-card-stat-item.js +0 -69
- package/dist/components/cards/parts/aurora-card-stat-item.js.map +0 -1
- package/dist/components/cards/parts/aurora-card-stats-row.js +0 -56
- package/dist/components/cards/parts/aurora-card-stats-row.js.map +0 -1
- package/dist/components/cards/parts/aurora-card-status-bar.js +0 -87
- package/dist/components/cards/parts/aurora-card-status-bar.js.map +0 -1
- package/dist/styles/aurora-theme.js +0 -43
- package/dist/styles/aurora-theme.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,16 +1,1223 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { LitElement, css, html, unsafeCSS } from "lit";
|
|
2
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
3
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/decorate.js
|
|
4
|
+
function __decorate(decorators, target, key, desc) {
|
|
5
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/aurora-button.ts
|
|
12
|
+
var AuroraButton = class AuroraButton extends LitElement {
|
|
13
|
+
constructor(..._args) {
|
|
14
|
+
super(..._args);
|
|
15
|
+
this.disabled = false;
|
|
16
|
+
}
|
|
17
|
+
static {
|
|
18
|
+
this.styles = css`
|
|
19
|
+
:host {
|
|
20
|
+
display: inline-block;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
button {
|
|
24
|
+
font: inherit;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
border-radius: 6px;
|
|
27
|
+
border: 1px solid transparent;
|
|
28
|
+
padding: 0.5em 1.2em;
|
|
29
|
+
background-color: var(--aurora-button-bg, #1a1a1a);
|
|
30
|
+
color: var(--aurora-button-color, #ffffff);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
button:disabled {
|
|
34
|
+
cursor: not-allowed;
|
|
35
|
+
opacity: 0.5;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
return html`
|
|
41
|
+
<button ?disabled=${this.disabled}>
|
|
42
|
+
<slot></slot>
|
|
43
|
+
</button>
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
__decorate([property({
|
|
48
|
+
type: Boolean,
|
|
49
|
+
reflect: true
|
|
50
|
+
})], AuroraButton.prototype, "disabled", void 0);
|
|
51
|
+
AuroraButton = __decorate([customElement("aurora-button")], AuroraButton);
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/styles/aurora-theme.ts
|
|
54
|
+
var auroraTheme = css`
|
|
55
|
+
.theme {
|
|
56
|
+
--axebow-primary: var(--color-primary, #34495e);
|
|
57
|
+
--axebow-primary-light: var(--color-primary-light, #b4cded);
|
|
58
|
+
--axebow-tertiary: var(--color-tertiary, #006bff);
|
|
59
|
+
--axebow-success: var(--color-success, #0ecd9a);
|
|
60
|
+
--axebow-secondary: var(--color-secondary, #78787a);
|
|
61
|
+
--axebow-base: var(--color-base, #f0f1f5);
|
|
62
|
+
--axebow-error: var(--color-error, #e93a3a);
|
|
63
|
+
--axebow-white: var(--color-white, #ffffff);
|
|
64
|
+
--axebow-black: var(--color-black, #000000);
|
|
65
|
+
--axebow-warning: var(--color-warning, #f9cf6c);
|
|
66
|
+
--axebow-table-border: var(--color-table-border, #ddd);
|
|
67
|
+
--axebow-gray: var(--color-gray, #8a94ae);
|
|
68
|
+
--axebow-light-gray: var(--color-light-gray, #d9d9d9);
|
|
69
|
+
|
|
70
|
+
--axebow-clickable-blue: var(--color-clickable-blue, #006bff);
|
|
71
|
+
--axebow-sky-gray: var(--color-sky-gray, #8a94ee);
|
|
72
|
+
--axebow-rich-black: var(--color-rich-black, #0d1821);
|
|
73
|
+
--axebow-anti-flash-white: var(--color-anti-flash-white, #f0f1f5);
|
|
74
|
+
--axebow-strong-gray: var(--color-strong-gray, #78787a);
|
|
75
|
+
|
|
76
|
+
--axebow-bg-primary: var(--color-bg-primary, #f0f1f5);
|
|
77
|
+
|
|
78
|
+
--axebow-text-gray: var(--color-text-gray, #78787a);
|
|
79
|
+
|
|
80
|
+
--axebow-premium-label: var(--color-premium-label, #b9935a33);
|
|
81
|
+
--axebow-premium-text: var(--color-premium-text, #b9935a);
|
|
82
|
+
--axebow-deleting-link: var(--color-deleting-link, #a0a0a0);
|
|
83
|
+
--axebow-border-gray: var(--color-border-gray, #9ca3af);
|
|
84
|
+
}
|
|
85
|
+
* {
|
|
86
|
+
font-family: 'Open Sans', sans-serif;
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
var STATUS_COLORS = {
|
|
90
|
+
HEALTHY: "var(--axebow-success)",
|
|
91
|
+
ERROR: "var(--axebow-error)",
|
|
92
|
+
WARNING: "var(--axebow-warning)",
|
|
93
|
+
DEFAULT: "var(--axebow-gray)"
|
|
94
|
+
};
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/styles/tailwind.css?inline
|
|
97
|
+
var tailwind_default = "/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n@layer properties {\n @supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {\n *, :before, :after, ::backdrop {\n --tw-rotate-x: initial;\n --tw-rotate-y: initial;\n --tw-rotate-z: initial;\n --tw-skew-x: initial;\n --tw-skew-y: initial;\n --tw-border-style: solid;\n --tw-leading: initial;\n --tw-font-weight: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-blur: initial;\n --tw-brightness: initial;\n --tw-contrast: initial;\n --tw-grayscale: initial;\n --tw-hue-rotate: initial;\n --tw-invert: initial;\n --tw-opacity: initial;\n --tw-saturate: initial;\n --tw-sepia: initial;\n --tw-drop-shadow: initial;\n --tw-drop-shadow-color: initial;\n --tw-drop-shadow-alpha: 100%;\n --tw-drop-shadow-size: initial;\n --tw-duration: initial;\n --tw-ease: initial;\n }\n }\n}\n\n@layer theme {\n :root, :host {\n --font-sans: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\",\n \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace;\n --color-gray-100: oklch(96.7% .003 264.542);\n --color-black: #000;\n --color-white: #fff;\n --spacing: .25rem;\n --text-xs: .75rem;\n --text-xs--line-height: calc(1 / .75);\n --text-sm: .875rem;\n --text-sm--line-height: calc(1.25 / .875);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-xl: 1.25rem;\n --text-xl--line-height: calc(1.75 / 1.25);\n --font-weight-normal: 400;\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --leading-snug: 1.375;\n --radius-sm: .25rem;\n --radius-md: .375rem;\n --radius-lg: .5rem;\n --ease-in-out: cubic-bezier(.4, 0, .2, 1);\n --default-transition-duration: .15s;\n --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);\n --default-font-family: var(--font-sans);\n --default-mono-font-family: var(--font-mono);\n }\n}\n\n@layer base {\n *, :after, :before, ::backdrop {\n box-sizing: border-box;\n border: 0 solid;\n margin: 0;\n padding: 0;\n }\n\n ::file-selector-button {\n box-sizing: border-box;\n border: 0 solid;\n margin: 0;\n padding: 0;\n }\n\n html, :host {\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n line-height: 1.5;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n\n h1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n -webkit-text-decoration: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n\n b, strong {\n font-weight: bolder;\n }\n\n code, kbd, samp, pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n\n small {\n font-size: 80%;\n }\n\n sub, sup {\n vertical-align: baseline;\n font-size: 75%;\n line-height: 0;\n position: relative;\n }\n\n sub {\n bottom: -.25em;\n }\n\n sup {\n top: -.5em;\n }\n\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n\n :-moz-focusring {\n outline: auto;\n }\n\n progress {\n vertical-align: baseline;\n }\n\n summary {\n display: list-item;\n }\n\n ol, ul, menu {\n list-style: none;\n }\n\n img, svg, video, canvas, audio, iframe, embed, object {\n vertical-align: middle;\n display: block;\n }\n\n img, video {\n max-width: 100%;\n height: auto;\n }\n\n button, input, select, optgroup, textarea {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n opacity: 1;\n background-color: #0000;\n border-radius: 0;\n }\n\n ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n opacity: 1;\n background-color: #0000;\n border-radius: 0;\n }\n\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n\n ::placeholder {\n opacity: 1;\n }\n\n @supports (not ((-webkit-appearance: -apple-pay-button))) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentColor;\n }\n\n @supports (color: color-mix(in lab, red, red)) {\n ::placeholder {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n\n textarea {\n resize: vertical;\n }\n\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n\n ::-webkit-datetime-edit {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-year-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-month-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-day-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-hour-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-minute-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-second-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-millisecond-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n\n ::-webkit-calendar-picker-indicator {\n line-height: 1;\n }\n\n :-moz-ui-invalid {\n box-shadow: none;\n }\n\n button, input:where([type=\"button\"], [type=\"reset\"], [type=\"submit\"]) {\n appearance: button;\n }\n\n ::file-selector-button {\n appearance: button;\n }\n\n ::-webkit-inner-spin-button {\n height: auto;\n }\n\n ::-webkit-outer-spin-button {\n height: auto;\n }\n\n [hidden]:where(:not([hidden=\"until-found\"])) {\n display: none !important;\n }\n}\n\n@layer components;\n\n@layer utilities {\n .pointer-events-none {\n pointer-events: none;\n }\n\n .absolute {\n position: absolute;\n }\n\n .relative {\n position: relative;\n }\n\n .static {\n position: static;\n }\n\n .top-full {\n top: 100%;\n }\n\n .right-0 {\n right: 0;\n }\n\n .bottom-full {\n bottom: 100%;\n }\n\n .left-0 {\n left: 0;\n }\n\n .z-10 {\n z-index: 10;\n }\n\n .m-0 {\n margin: 0;\n }\n\n .mt-1 {\n margin-top: var(--spacing);\n }\n\n .mt-2 {\n margin-top: calc(var(--spacing) * 2);\n }\n\n .mr-2 {\n margin-right: calc(var(--spacing) * 2);\n }\n\n .mb-1 {\n margin-bottom: var(--spacing);\n }\n\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2);\n }\n\n .ml-2 {\n margin-left: calc(var(--spacing) * 2);\n }\n\n .box-border {\n box-sizing: border-box;\n }\n\n .line-clamp-1 {\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n display: -webkit-box;\n overflow: hidden;\n }\n\n .flex {\n display: flex;\n }\n\n .grid {\n display: grid;\n }\n\n .hidden {\n display: none;\n }\n\n .h-2 {\n height: calc(var(--spacing) * 2);\n }\n\n .h-4 {\n height: calc(var(--spacing) * 4);\n }\n\n .h-5 {\n height: calc(var(--spacing) * 5);\n }\n\n .h-6 {\n height: calc(var(--spacing) * 6);\n }\n\n .h-7 {\n height: calc(var(--spacing) * 7);\n }\n\n .h-8 {\n height: calc(var(--spacing) * 8);\n }\n\n .h-10 {\n height: calc(var(--spacing) * 10);\n }\n\n .h-16 {\n height: calc(var(--spacing) * 16);\n }\n\n .h-\\[4\\.5rem\\] {\n height: 4.5rem;\n }\n\n .h-full {\n height: 100%;\n }\n\n .max-h-10 {\n max-height: calc(var(--spacing) * 10);\n }\n\n .max-h-40 {\n max-height: calc(var(--spacing) * 40);\n }\n\n .max-h-full {\n max-height: 100%;\n }\n\n .min-h-10 {\n min-height: calc(var(--spacing) * 10);\n }\n\n .w-4 {\n width: calc(var(--spacing) * 4);\n }\n\n .w-5 {\n width: calc(var(--spacing) * 5);\n }\n\n .w-10 {\n width: calc(var(--spacing) * 10);\n }\n\n .w-full {\n width: 100%;\n }\n\n .max-w-full {\n max-width: 100%;\n }\n\n .min-w-0 {\n min-width: 0;\n }\n\n .min-w-44 {\n min-width: calc(var(--spacing) * 44);\n }\n\n .flex-1 {\n flex: 1;\n }\n\n .shrink-0 {\n flex-shrink: 0;\n }\n\n .transform {\n transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );\n }\n\n .cursor-default {\n cursor: default;\n }\n\n .cursor-not-allowed {\n cursor: not-allowed;\n }\n\n .cursor-pointer {\n cursor: pointer;\n }\n\n .grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n }\n\n .flex-col {\n flex-direction: column;\n }\n\n .flex-row {\n flex-direction: row;\n }\n\n .flex-wrap {\n flex-wrap: wrap;\n }\n\n .items-center {\n align-items: center;\n }\n\n .justify-between {\n justify-content: space-between;\n }\n\n .justify-center {\n justify-content: center;\n }\n\n .justify-end {\n justify-content: flex-end;\n }\n\n .gap-0\\.5 {\n gap: calc(var(--spacing) * .5);\n }\n\n .gap-1 {\n gap: var(--spacing);\n }\n\n .gap-2 {\n gap: calc(var(--spacing) * 2);\n }\n\n .gap-3 {\n gap: calc(var(--spacing) * 3);\n }\n\n .gap-4 {\n gap: calc(var(--spacing) * 4);\n }\n\n .overflow-hidden {\n overflow: hidden;\n }\n\n .overflow-y-auto {\n overflow-y: auto;\n }\n\n .rounded-lg {\n border-radius: var(--radius-lg);\n }\n\n .rounded-md {\n border-radius: var(--radius-md);\n }\n\n .rounded-sm {\n border-radius: var(--radius-sm);\n }\n\n .rounded-b-lg {\n border-bottom-right-radius: var(--radius-lg);\n border-bottom-left-radius: var(--radius-lg);\n }\n\n .border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n }\n\n .border-2 {\n border-style: var(--tw-border-style);\n border-width: 2px;\n }\n\n .border-t {\n border-top-style: var(--tw-border-style);\n border-top-width: 1px;\n }\n\n .border-t-4 {\n border-top-style: var(--tw-border-style);\n border-top-width: 4px;\n }\n\n .border-b {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 1px;\n }\n\n .border-none {\n --tw-border-style: none;\n border-style: none;\n }\n\n .border-\\[var\\(--axebow-gray\\)\\] {\n border-color: var(--axebow-gray);\n }\n\n .border-\\[var\\(--axebow-light-gray\\)\\] {\n border-color: var(--axebow-light-gray);\n }\n\n .border-\\[var\\(--axebow-secondary\\)\\] {\n border-color: var(--axebow-secondary);\n }\n\n .border-transparent {\n border-color: #0000;\n }\n\n .bg-\\[var\\(--axebow-anti-flash-white\\)\\] {\n background-color: var(--axebow-anti-flash-white);\n }\n\n .bg-\\[var\\(--axebow-error\\)\\] {\n background-color: var(--axebow-error);\n }\n\n .bg-\\[var\\(--axebow-gray\\)\\] {\n background-color: var(--axebow-gray);\n }\n\n .bg-\\[var\\(--axebow-light-gray\\)\\] {\n background-color: var(--axebow-light-gray);\n }\n\n .bg-\\[var\\(--axebow-white\\)\\] {\n background-color: var(--axebow-white);\n }\n\n .bg-transparent {\n background-color: #0000;\n }\n\n .bg-white {\n background-color: var(--color-white);\n }\n\n .object-contain {\n object-fit: contain;\n }\n\n .p-2 {\n padding: calc(var(--spacing) * 2);\n }\n\n .px-1 {\n padding-inline: var(--spacing);\n }\n\n .px-1\\.5 {\n padding-inline: calc(var(--spacing) * 1.5);\n }\n\n .px-2 {\n padding-inline: calc(var(--spacing) * 2);\n }\n\n .px-3 {\n padding-inline: calc(var(--spacing) * 3);\n }\n\n .px-5 {\n padding-inline: calc(var(--spacing) * 5);\n }\n\n .py-0\\.5 {\n padding-block: calc(var(--spacing) * .5);\n }\n\n .py-1 {\n padding-block: var(--spacing);\n }\n\n .py-2 {\n padding-block: calc(var(--spacing) * 2);\n }\n\n .py-3 {\n padding-block: calc(var(--spacing) * 3);\n }\n\n .pt-0\\.5 {\n padding-top: calc(var(--spacing) * .5);\n }\n\n .pt-2 {\n padding-top: calc(var(--spacing) * 2);\n }\n\n .pb-4 {\n padding-bottom: calc(var(--spacing) * 4);\n }\n\n .pl-2 {\n padding-left: calc(var(--spacing) * 2);\n }\n\n .pl-6 {\n padding-left: calc(var(--spacing) * 6);\n }\n\n .text-center {\n text-align: center;\n }\n\n .text-left {\n text-align: left;\n }\n\n .text-lg {\n font-size: var(--text-lg);\n line-height: var(--tw-leading, var(--text-lg--line-height));\n }\n\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n\n .text-xl {\n font-size: var(--text-xl);\n line-height: var(--tw-leading, var(--text-xl--line-height));\n }\n\n .text-xs {\n font-size: var(--text-xs);\n line-height: var(--tw-leading, var(--text-xs--line-height));\n }\n\n .leading-none {\n --tw-leading: 1;\n line-height: 1;\n }\n\n .leading-snug {\n --tw-leading: var(--leading-snug);\n line-height: var(--leading-snug);\n }\n\n .font-bold {\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n }\n\n .font-normal {\n --tw-font-weight: var(--font-weight-normal);\n font-weight: var(--font-weight-normal);\n }\n\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n }\n\n .text-ellipsis {\n text-overflow: ellipsis;\n }\n\n .whitespace-nowrap {\n white-space: nowrap;\n }\n\n .text-\\[var\\(--axebow-error\\)\\] {\n color: var(--axebow-error);\n }\n\n .text-\\[var\\(--axebow-gray\\)\\] {\n color: var(--axebow-gray);\n }\n\n .text-\\[var\\(--axebow-primary\\)\\] {\n color: var(--axebow-primary);\n }\n\n .text-\\[var\\(--axebow-rich-black\\)\\] {\n color: var(--axebow-rich-black);\n }\n\n .text-\\[var\\(--axebow-secondary\\)\\] {\n color: var(--axebow-secondary);\n }\n\n .text-\\[var\\(--axebow-tertiary\\)\\] {\n color: var(--axebow-tertiary);\n }\n\n .italic {\n font-style: italic;\n }\n\n .opacity-50 {\n opacity: .5;\n }\n\n .opacity-100 {\n opacity: 1;\n }\n\n .shadow-\\[2px_2px_25px_0px_rgba\\(0\\,0\\,0\\,0\\.1\\)\\] {\n --tw-shadow: 2px 2px 25px 0px var(--tw-shadow-color, #0000001a);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n\n .grayscale {\n --tw-grayscale: grayscale(100%);\n filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );\n }\n\n .transition-all {\n transition-property: all;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n\n .transition-shadow {\n transition-property: box-shadow;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n\n .duration-200 {\n --tw-duration: .2s;\n transition-duration: .2s;\n }\n\n .ease-in-out {\n --tw-ease: var(--ease-in-out);\n transition-timing-function: var(--ease-in-out);\n }\n\n @media (hover: hover) {\n .hover\\:rounded-lg:hover {\n border-radius: var(--radius-lg);\n }\n\n .hover\\:bg-\\[var\\(--axebow-anti-flash-white\\)\\]:hover {\n background-color: var(--axebow-anti-flash-white);\n }\n\n .hover\\:bg-\\[var\\(--axebow-light-gray\\)\\]:hover {\n background-color: var(--axebow-light-gray);\n }\n\n .hover\\:bg-gray-100:hover {\n background-color: var(--color-gray-100);\n }\n\n .hover\\:text-\\[var\\(--axebow-gray\\)\\]:hover {\n color: var(--axebow-gray);\n }\n\n .hover\\:shadow-\\[0_4px_12px_0_rgba\\(13\\,24\\,33\\,0\\.08\\)\\]:hover {\n --tw-shadow: 0 4px 12px 0 var(--tw-shadow-color, #0d182114);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n }\n\n .disabled\\:pointer-events-none:disabled {\n pointer-events: none;\n }\n\n .disabled\\:cursor-not-allowed:disabled {\n cursor: not-allowed;\n }\n\n .disabled\\:opacity-50:disabled {\n opacity: .5;\n }\n}\n\n@property --tw-rotate-x {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-rotate-y {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-rotate-z {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-skew-x {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-skew-y {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-border-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n\n@property --tw-leading {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-font-weight {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n\n@property --tw-shadow-color {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n\n@property --tw-inset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n\n@property --tw-inset-shadow-color {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-inset-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n\n@property --tw-ring-color {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n\n@property --tw-inset-ring-color {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-inset-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n\n@property --tw-ring-inset {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-ring-offset-width {\n syntax: \"<length>\";\n inherits: false;\n initial-value: 0;\n}\n\n@property --tw-ring-offset-color {\n syntax: \"*\";\n inherits: false;\n initial-value: #fff;\n}\n\n@property --tw-ring-offset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n\n@property --tw-blur {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-brightness {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-contrast {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-grayscale {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-hue-rotate {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-invert {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-opacity {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-saturate {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-sepia {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-drop-shadow {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-drop-shadow-color {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-drop-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n\n@property --tw-drop-shadow-size {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-duration {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-ease {\n syntax: \"*\";\n inherits: false\n}\n";
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/components/cards/aurora-more-actions.ts
|
|
100
|
+
var AuroraMoreActions = class AuroraMoreActions extends LitElement {
|
|
101
|
+
constructor(..._args) {
|
|
102
|
+
super(..._args);
|
|
103
|
+
this.open = false;
|
|
104
|
+
this.placement = "bottom";
|
|
105
|
+
this.disabled = false;
|
|
106
|
+
this.options = [];
|
|
107
|
+
this.title = "";
|
|
108
|
+
this.iconName = "";
|
|
109
|
+
this.openToRight = false;
|
|
110
|
+
this.closeLabel = "Close";
|
|
111
|
+
this.moreActionsLabel = "More";
|
|
112
|
+
this._fixedPos = {
|
|
113
|
+
top: 0,
|
|
114
|
+
right: 0
|
|
115
|
+
};
|
|
116
|
+
this._handleOutsideClick = (e) => {
|
|
117
|
+
if (this.open && !this.contains(e.target)) {
|
|
118
|
+
this.open = false;
|
|
119
|
+
this.dispatchEvent(new CustomEvent("toggled", { detail: { open: false } }));
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
this._handleScroll = () => {
|
|
123
|
+
if (this.open && this.openToRight) {
|
|
124
|
+
this.open = false;
|
|
125
|
+
this.dispatchEvent(new CustomEvent("toggled", { detail: { open: false } }));
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
static {
|
|
130
|
+
this.styles = [unsafeCSS(tailwind_default), css`:host { display: inline-block; }`];
|
|
131
|
+
}
|
|
132
|
+
connectedCallback() {
|
|
133
|
+
super.connectedCallback();
|
|
134
|
+
document.addEventListener("click", this._handleOutsideClick);
|
|
135
|
+
window.addEventListener("scroll", this._handleScroll, true);
|
|
136
|
+
}
|
|
137
|
+
disconnectedCallback() {
|
|
138
|
+
super.disconnectedCallback();
|
|
139
|
+
document.removeEventListener("click", this._handleOutsideClick);
|
|
140
|
+
window.removeEventListener("scroll", this._handleScroll, true);
|
|
141
|
+
}
|
|
142
|
+
_toggle(e) {
|
|
143
|
+
if (this.disabled) return;
|
|
144
|
+
e.stopPropagation();
|
|
145
|
+
if (!this.open && this.openToRight) {
|
|
146
|
+
const btn = this.shadowRoot?.querySelector(".trigger");
|
|
147
|
+
if (btn) {
|
|
148
|
+
const rect = btn.getBoundingClientRect();
|
|
149
|
+
this._fixedPos = {
|
|
150
|
+
top: rect.bottom + 8,
|
|
151
|
+
right: window.innerWidth - rect.right
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
this.open = !this.open;
|
|
156
|
+
this.dispatchEvent(new CustomEvent("toggled", { detail: { open: this.open } }));
|
|
157
|
+
}
|
|
158
|
+
_handleSlotClick() {
|
|
159
|
+
this.open = false;
|
|
160
|
+
this.dispatchEvent(new CustomEvent("toggled", { detail: { open: false } }));
|
|
161
|
+
}
|
|
162
|
+
render() {
|
|
163
|
+
const placementClass = this.placement === "top" ? "bottom-full mb-2" : "top-full mt-2";
|
|
164
|
+
const dropdownStyle = this.openToRight ? `position:fixed;top:${this._fixedPos.top}px;right:${this._fixedPos.right}px;z-index:1000;` : "";
|
|
165
|
+
return html`
|
|
166
|
+
<div class="relative w-full h-full flex justify-end">
|
|
167
|
+
<button
|
|
168
|
+
class="trigger relative font-semibold text-xs text-[var(--axebow-tertiary)] cursor-pointer py-1 px-2 h-full bg-transparent border-none transition-all duration-200 flex items-center hover:text-[var(--axebow-gray)] hover:bg-[var(--axebow-anti-flash-white)] hover:rounded-lg disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none"
|
|
169
|
+
?disabled=${this.disabled}
|
|
170
|
+
@click=${this._toggle}
|
|
171
|
+
>
|
|
172
|
+
${this.iconName ? html`<axebow-icon iconName=${this.iconName} size="small" iconColor="var(--axebow-tertiary)"></axebow-icon>` : this.open ? this.closeLabel : this.title || this.moreActionsLabel}
|
|
173
|
+
</button>
|
|
174
|
+
${this.open ? html`
|
|
175
|
+
<div
|
|
176
|
+
class="absolute right-0 z-10 bg-white border border-[var(--axebow-gray)] rounded-lg shadow-[2px_2px_25px_0px_rgba(0,0,0,0.1)] p-2 min-w-44 flex flex-col ${placementClass}"
|
|
177
|
+
style=${dropdownStyle}
|
|
178
|
+
@click=${this._handleSlotClick}
|
|
179
|
+
>
|
|
180
|
+
${this.options?.length ? this.options.map((opt) => html`
|
|
181
|
+
<button
|
|
182
|
+
class="flex items-center gap-2 text-left py-1 px-2 cursor-pointer rounded-sm border border-transparent bg-transparent w-full hover:bg-gray-100"
|
|
183
|
+
@click=${(e) => {
|
|
184
|
+
e.stopPropagation();
|
|
185
|
+
opt.onTap(e);
|
|
186
|
+
this.open = false;
|
|
187
|
+
this.dispatchEvent(new CustomEvent("toggled", { detail: { open: false } }));
|
|
188
|
+
}}
|
|
189
|
+
@mouseenter=${(e) => e.currentTarget.style.borderColor = `var(--axebow-${opt.type})`}
|
|
190
|
+
@mouseleave=${(e) => e.currentTarget.style.borderColor = "transparent"}
|
|
191
|
+
>
|
|
192
|
+
<axebow-icon iconName=${opt.icon} iconColor="var(--axebow-${opt.type})" size="small"></axebow-icon>
|
|
193
|
+
<p class="m-0 whitespace-nowrap" style="color:var(--axebow-${opt.type});">${opt.label}</p>
|
|
194
|
+
</button>
|
|
195
|
+
`) : html`<slot></slot>`}
|
|
196
|
+
</div>
|
|
197
|
+
` : ""}
|
|
198
|
+
</div>
|
|
199
|
+
`;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
__decorate([property({ type: Boolean })], AuroraMoreActions.prototype, "open", void 0);
|
|
203
|
+
__decorate([property({ type: String })], AuroraMoreActions.prototype, "placement", void 0);
|
|
204
|
+
__decorate([property({ type: Boolean })], AuroraMoreActions.prototype, "disabled", void 0);
|
|
205
|
+
__decorate([property({ type: Array })], AuroraMoreActions.prototype, "options", void 0);
|
|
206
|
+
__decorate([property({ type: String })], AuroraMoreActions.prototype, "title", void 0);
|
|
207
|
+
__decorate([property({ type: String })], AuroraMoreActions.prototype, "iconName", void 0);
|
|
208
|
+
__decorate([property({ type: Boolean })], AuroraMoreActions.prototype, "openToRight", void 0);
|
|
209
|
+
__decorate([property({ type: String })], AuroraMoreActions.prototype, "closeLabel", void 0);
|
|
210
|
+
__decorate([property({ type: String })], AuroraMoreActions.prototype, "moreActionsLabel", void 0);
|
|
211
|
+
__decorate([state()], AuroraMoreActions.prototype, "_fixedPos", void 0);
|
|
212
|
+
AuroraMoreActions = __decorate([customElement("aurora-more-actions")], AuroraMoreActions);
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region src/components/cards/parts/aurora-card-header.ts
|
|
215
|
+
var AuroraCardHeader = class AuroraCardHeader extends LitElement {
|
|
216
|
+
constructor(..._args) {
|
|
217
|
+
super(..._args);
|
|
218
|
+
this.logoSrc = null;
|
|
219
|
+
this.tenantOrAccount = "";
|
|
220
|
+
this.name = "";
|
|
221
|
+
this.badge = "none";
|
|
222
|
+
this.subtitle = "";
|
|
223
|
+
this.cardType = "account";
|
|
224
|
+
this.freeIaasLabel = "Free IaaS";
|
|
225
|
+
this.freeIaasTitle = "Free Infrastructure";
|
|
226
|
+
this.freeIaasDesc = "This environment uses free infrastructure.";
|
|
227
|
+
this.haLabel = "Highly Available";
|
|
228
|
+
this.haTitle = "High Availability enabled";
|
|
229
|
+
}
|
|
230
|
+
static {
|
|
231
|
+
this.styles = [unsafeCSS(tailwind_default), css`
|
|
232
|
+
:host { display: block; }
|
|
233
|
+
sl-badge::part(base) { background-color: var(--axebow-secondary); color: white; }
|
|
234
|
+
`];
|
|
235
|
+
}
|
|
236
|
+
_renderBadge() {
|
|
237
|
+
if (this.badge === "free-iaas") return html`
|
|
238
|
+
<sl-tooltip>
|
|
239
|
+
<div slot="content" style="max-width:300px;">
|
|
240
|
+
<strong>${this.freeIaasTitle}</strong>
|
|
241
|
+
<p style="margin-top:0.5rem;">${this.freeIaasDesc}</p>
|
|
242
|
+
</div>
|
|
243
|
+
<div class="flex items-center gap-2 cursor-pointer">
|
|
244
|
+
<axebow-icon iconName="info" iconColor="var(--axebow-gray)" size="small"></axebow-icon>
|
|
245
|
+
<span class="text-[var(--axebow-rich-black)]">${this.freeIaasLabel}</span>
|
|
246
|
+
</div>
|
|
247
|
+
</sl-tooltip>
|
|
248
|
+
`;
|
|
249
|
+
if (this.badge === "ha") return html`
|
|
250
|
+
<sl-tooltip content=${this.haTitle}>
|
|
251
|
+
<sl-badge variant="neutral" pill size="small" class="cursor-pointer">${this.haLabel}</sl-badge>
|
|
252
|
+
</sl-tooltip>
|
|
253
|
+
`;
|
|
254
|
+
return html``;
|
|
255
|
+
}
|
|
256
|
+
render() {
|
|
257
|
+
const isAccount = this.cardType === "account";
|
|
258
|
+
const isTenant = this.cardType === "tenant";
|
|
259
|
+
if (isAccount) return html`
|
|
260
|
+
<div class="w-full bg-[var(--axebow-anti-flash-white)] rounded-md flex items-center gap-3 py-2 px-3 h-16">
|
|
261
|
+
${this.logoSrc ? html`<div class="h-10 w-10 flex items-center justify-center shrink-0"><img src=${this.logoSrc} class="max-h-full max-w-full object-contain" /></div>` : ""}
|
|
262
|
+
<div class="flex flex-col flex-1 min-w-0">
|
|
263
|
+
${this.tenantOrAccount ? html`<span class="font-semibold text-[var(--axebow-primary)] leading-none">${this.tenantOrAccount}</span>` : ""}
|
|
264
|
+
<div class="flex justify-between items-center">
|
|
265
|
+
<span class="font-bold text-xl text-[var(--axebow-primary)] leading-snug pt-0.5">${this.name}</span>
|
|
266
|
+
${this._renderBadge()}
|
|
267
|
+
</div>
|
|
268
|
+
${this.subtitle ? html`<div class="italic text-[var(--axebow-primary)] flex items-center leading-none">${this.subtitle}<slot name="subtitle-tooltip"></slot></div>` : ""}
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
271
|
+
`;
|
|
272
|
+
return html`
|
|
273
|
+
<div class="w-full bg-[var(--axebow-anti-flash-white)] rounded-md flex flex-col justify-center px-5 py-3 h-[4.5rem]">
|
|
274
|
+
<div class="flex flex-col flex-1 min-w-0">
|
|
275
|
+
${this.tenantOrAccount || this.logoSrc ? html`
|
|
276
|
+
<div class="flex gap-2 items-center leading-none mt-1">
|
|
277
|
+
${this.logoSrc ? html`<div class="h-4 w-4"><img src=${this.logoSrc} class="max-h-full max-w-full object-contain" /></div>` : ""}
|
|
278
|
+
<span class="font-semibold ${isTenant ? "text-[var(--axebow-gray)]" : "text-[var(--axebow-primary)]"} leading-none">${this.tenantOrAccount}</span>
|
|
279
|
+
</div>
|
|
280
|
+
` : ""}
|
|
281
|
+
<div class="flex justify-between items-center">
|
|
282
|
+
<span class="font-bold text-xl text-[var(--axebow-primary)] leading-snug pt-0.5">${this.name}</span>
|
|
283
|
+
${this._renderBadge()}
|
|
284
|
+
</div>
|
|
285
|
+
${this.subtitle ? html`<div class="italic text-[var(--axebow-primary)] flex items-center leading-none">${this.subtitle}<slot name="subtitle-tooltip"></slot></div>` : ""}
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
`;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
__decorate([property({ type: String })], AuroraCardHeader.prototype, "logoSrc", void 0);
|
|
292
|
+
__decorate([property({ type: String })], AuroraCardHeader.prototype, "tenantOrAccount", void 0);
|
|
293
|
+
__decorate([property({ type: String })], AuroraCardHeader.prototype, "name", void 0);
|
|
294
|
+
__decorate([property({ type: String })], AuroraCardHeader.prototype, "badge", void 0);
|
|
295
|
+
__decorate([property({ type: String })], AuroraCardHeader.prototype, "subtitle", void 0);
|
|
296
|
+
__decorate([property({ type: String })], AuroraCardHeader.prototype, "cardType", void 0);
|
|
297
|
+
__decorate([property({ type: String })], AuroraCardHeader.prototype, "freeIaasLabel", void 0);
|
|
298
|
+
__decorate([property({ type: String })], AuroraCardHeader.prototype, "freeIaasTitle", void 0);
|
|
299
|
+
__decorate([property({ type: String })], AuroraCardHeader.prototype, "freeIaasDesc", void 0);
|
|
300
|
+
__decorate([property({ type: String })], AuroraCardHeader.prototype, "haLabel", void 0);
|
|
301
|
+
__decorate([property({ type: String })], AuroraCardHeader.prototype, "haTitle", void 0);
|
|
302
|
+
AuroraCardHeader = __decorate([customElement("aurora-card-header")], AuroraCardHeader);
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/components/cards/parts/aurora-card-stat-item.ts
|
|
305
|
+
var AuroraCardStatItem = class AuroraCardStatItem extends LitElement {
|
|
306
|
+
constructor(..._args) {
|
|
307
|
+
super(..._args);
|
|
308
|
+
this.value = 0;
|
|
309
|
+
this.title = "";
|
|
310
|
+
this.label = "";
|
|
311
|
+
this.active = true;
|
|
312
|
+
this.compact = false;
|
|
313
|
+
}
|
|
314
|
+
static {
|
|
315
|
+
this.styles = [unsafeCSS(tailwind_default), css`:host { display: block; }`];
|
|
316
|
+
}
|
|
317
|
+
render() {
|
|
318
|
+
return html`
|
|
319
|
+
<div class="flex flex-col items-center text-center gap-0.5">
|
|
320
|
+
<h4 class="text-lg text-[var(--axebow-primary)] font-bold leading-snug m-0">${this.value}</h4>
|
|
321
|
+
<p class="m-0 leading-snug">${this.title}</p>
|
|
322
|
+
<span
|
|
323
|
+
class="text-[var(--axebow-gray)] font-semibold text-xs ${this.active ? "cursor-pointer opacity-100" : "cursor-not-allowed opacity-50"}"
|
|
324
|
+
@click=${this._onClick}
|
|
325
|
+
>${this.label}</span>
|
|
326
|
+
</div>
|
|
327
|
+
`;
|
|
328
|
+
}
|
|
329
|
+
_onClick() {
|
|
330
|
+
if (this.active) this.dispatchEvent(new CustomEvent("label-click", {
|
|
331
|
+
bubbles: true,
|
|
332
|
+
composed: true
|
|
333
|
+
}));
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
__decorate([property({ type: Number })], AuroraCardStatItem.prototype, "value", void 0);
|
|
337
|
+
__decorate([property({ type: String })], AuroraCardStatItem.prototype, "title", void 0);
|
|
338
|
+
__decorate([property({ type: String })], AuroraCardStatItem.prototype, "label", void 0);
|
|
339
|
+
__decorate([property({ type: Boolean })], AuroraCardStatItem.prototype, "active", void 0);
|
|
340
|
+
__decorate([property({ type: Boolean })], AuroraCardStatItem.prototype, "compact", void 0);
|
|
341
|
+
AuroraCardStatItem = __decorate([customElement("aurora-card-stat-item")], AuroraCardStatItem);
|
|
342
|
+
//#endregion
|
|
343
|
+
//#region src/components/cards/parts/aurora-card-stats-row.ts
|
|
344
|
+
var AuroraCardStatsRow = class AuroraCardStatsRow extends LitElement {
|
|
345
|
+
constructor(..._args) {
|
|
346
|
+
super(..._args);
|
|
347
|
+
this.stats = [];
|
|
348
|
+
this.compact = false;
|
|
349
|
+
}
|
|
350
|
+
static {
|
|
351
|
+
this.styles = [unsafeCSS(tailwind_default), css`:host { display: block; }`];
|
|
352
|
+
}
|
|
353
|
+
render() {
|
|
354
|
+
return html`
|
|
355
|
+
<div class="grid grid-cols-3 gap-1 px-2">
|
|
356
|
+
${this.stats.map((stat, index) => html`
|
|
357
|
+
<aurora-card-stat-item
|
|
358
|
+
.value=${stat.value}
|
|
359
|
+
.title=${stat.title}
|
|
360
|
+
.label=${stat.label}
|
|
361
|
+
.active=${stat.active !== false}
|
|
362
|
+
.compact=${this.compact}
|
|
363
|
+
@label-click=${() => this._handleLabelClick(index)}
|
|
364
|
+
></aurora-card-stat-item>
|
|
365
|
+
`)}
|
|
366
|
+
</div>
|
|
367
|
+
`;
|
|
368
|
+
}
|
|
369
|
+
_handleLabelClick(index) {
|
|
370
|
+
this.dispatchEvent(new CustomEvent("stat-label-click", {
|
|
371
|
+
detail: { index },
|
|
372
|
+
bubbles: true,
|
|
373
|
+
composed: true
|
|
374
|
+
}));
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
__decorate([property({ type: Array })], AuroraCardStatsRow.prototype, "stats", void 0);
|
|
378
|
+
__decorate([property({ type: Boolean })], AuroraCardStatsRow.prototype, "compact", void 0);
|
|
379
|
+
AuroraCardStatsRow = __decorate([customElement("aurora-card-stats-row")], AuroraCardStatsRow);
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/components/cards/parts/aurora-card-filter-item.ts
|
|
382
|
+
var AuroraCardFilterItem = class AuroraCardFilterItem extends LitElement {
|
|
383
|
+
constructor(..._args) {
|
|
384
|
+
super(..._args);
|
|
385
|
+
this.name = "";
|
|
386
|
+
this.showAttention = false;
|
|
387
|
+
}
|
|
388
|
+
static {
|
|
389
|
+
this.styles = [unsafeCSS(tailwind_default), css`:host { display: block; }`];
|
|
390
|
+
}
|
|
391
|
+
render() {
|
|
392
|
+
return html`
|
|
393
|
+
<div
|
|
394
|
+
class="w-full py-1 px-2 flex justify-between items-center border-t border-[var(--axebow-light-gray)] cursor-pointer hover:bg-[var(--axebow-light-gray)]"
|
|
395
|
+
@click=${this._onClick}
|
|
396
|
+
>
|
|
397
|
+
<p class="m-0">${this.name}</p>
|
|
398
|
+
${this.showAttention ? html`<axebow-icon iconName="error" size="small" iconColor="var(--axebow-error)"></axebow-icon>` : ""}
|
|
399
|
+
</div>
|
|
400
|
+
`;
|
|
401
|
+
}
|
|
402
|
+
_onClick() {
|
|
403
|
+
this.dispatchEvent(new CustomEvent("item-select", {
|
|
404
|
+
detail: { name: this.name },
|
|
405
|
+
bubbles: true,
|
|
406
|
+
composed: true
|
|
407
|
+
}));
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
__decorate([property({ type: String })], AuroraCardFilterItem.prototype, "name", void 0);
|
|
411
|
+
__decorate([property({ type: Boolean })], AuroraCardFilterItem.prototype, "showAttention", void 0);
|
|
412
|
+
AuroraCardFilterItem = __decorate([customElement("aurora-card-filter-item")], AuroraCardFilterItem);
|
|
413
|
+
//#endregion
|
|
414
|
+
//#region src/components/cards/parts/aurora-card-filter.ts
|
|
415
|
+
var AuroraCardFilter = class AuroraCardFilter extends LitElement {
|
|
416
|
+
constructor(..._args) {
|
|
417
|
+
super(..._args);
|
|
418
|
+
this.items = [];
|
|
419
|
+
this.selected = null;
|
|
420
|
+
this.emptyLabel = "";
|
|
421
|
+
this.emptyActionLabel = "";
|
|
422
|
+
this.attentionLabel = "Attention needed";
|
|
423
|
+
this.showAttention = false;
|
|
424
|
+
this.opened = false;
|
|
425
|
+
this.isPlainRole = false;
|
|
426
|
+
this.isDisabled = false;
|
|
427
|
+
}
|
|
428
|
+
static {
|
|
429
|
+
this.styles = [unsafeCSS(tailwind_default), css`:host { display: block; }`];
|
|
430
|
+
}
|
|
431
|
+
render() {
|
|
432
|
+
return html`
|
|
433
|
+
<div class="relative">
|
|
434
|
+
<div class="flex justify-between items-center border-b border-[var(--axebow-light-gray)] w-full px-2 cursor-pointer h-7">
|
|
435
|
+
${!this.selected && this.items.length === 0 ? html`
|
|
436
|
+
<p
|
|
437
|
+
class="m-0 ${this.isPlainRole || this.isDisabled ? "text-[var(--axebow-gray)] cursor-default opacity-50" : "text-[var(--axebow-tertiary)] cursor-pointer"}"
|
|
438
|
+
@click=${this.isPlainRole || this.isDisabled ? void 0 : this._onEmptyAction}
|
|
439
|
+
>
|
|
440
|
+
${this.emptyActionLabel}
|
|
441
|
+
</p>
|
|
442
|
+
` : html`
|
|
443
|
+
<div
|
|
444
|
+
class="flex w-full justify-between items-center ${this.isDisabled ? "opacity-50 cursor-not-allowed" : ""}"
|
|
445
|
+
@click=${this.isDisabled ? void 0 : this._onToggle}
|
|
446
|
+
>
|
|
447
|
+
<span class="text-[var(--axebow-tertiary)]">${this.selected ?? this.emptyLabel}</span>
|
|
448
|
+
<div class="flex items-center gap-2">
|
|
449
|
+
${this.showAttention ? html`<p class="text-[var(--axebow-error)] m-0 text-xs">${this.attentionLabel}</p>` : ""}
|
|
450
|
+
<axebow-icon iconName="chevron_right" rotate="90" iconColor="var(--axebow-tertiary)" size="small"></axebow-icon>
|
|
451
|
+
</div>
|
|
452
|
+
</div>
|
|
453
|
+
`}
|
|
454
|
+
</div>
|
|
455
|
+
|
|
456
|
+
<div class="${this.opened ? "" : "hidden"} absolute top-full left-0 right-0 z-10 flex flex-col bg-white rounded-b-lg border border-[var(--axebow-light-gray)] shadow-[2px_2px_25px_0px_rgba(0,0,0,0.1)] max-h-40 overflow-y-auto">
|
|
457
|
+
<p class="w-full p-2 cursor-pointer m-0 hover:bg-[var(--axebow-light-gray)]" @click=${() => this._onSelect(null)}>${this.emptyLabel}</p>
|
|
458
|
+
${this.items.map((item) => html`
|
|
459
|
+
<aurora-card-filter-item
|
|
460
|
+
.name=${item.name}
|
|
461
|
+
.showAttention=${item.showAttention}
|
|
462
|
+
@item-select=${(e) => this._onSelect(e.detail.name)}
|
|
463
|
+
></aurora-card-filter-item>
|
|
464
|
+
`)}
|
|
465
|
+
</div>
|
|
466
|
+
</div>
|
|
467
|
+
`;
|
|
468
|
+
}
|
|
469
|
+
_onToggle() {
|
|
470
|
+
this.dispatchEvent(new CustomEvent("toggle-open", {
|
|
471
|
+
bubbles: true,
|
|
472
|
+
composed: true
|
|
473
|
+
}));
|
|
474
|
+
}
|
|
475
|
+
_onSelect(name) {
|
|
476
|
+
this.dispatchEvent(new CustomEvent("filter-select", {
|
|
477
|
+
detail: { name },
|
|
478
|
+
bubbles: true,
|
|
479
|
+
composed: true
|
|
480
|
+
}));
|
|
481
|
+
}
|
|
482
|
+
_onEmptyAction() {
|
|
483
|
+
this.dispatchEvent(new CustomEvent("empty-action-click", {
|
|
484
|
+
bubbles: true,
|
|
485
|
+
composed: true
|
|
486
|
+
}));
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
__decorate([property({ type: Array })], AuroraCardFilter.prototype, "items", void 0);
|
|
490
|
+
__decorate([property({ type: String })], AuroraCardFilter.prototype, "selected", void 0);
|
|
491
|
+
__decorate([property({ type: String })], AuroraCardFilter.prototype, "emptyLabel", void 0);
|
|
492
|
+
__decorate([property({ type: String })], AuroraCardFilter.prototype, "emptyActionLabel", void 0);
|
|
493
|
+
__decorate([property({ type: String })], AuroraCardFilter.prototype, "attentionLabel", void 0);
|
|
494
|
+
__decorate([property({ type: Boolean })], AuroraCardFilter.prototype, "showAttention", void 0);
|
|
495
|
+
__decorate([property({ type: Boolean })], AuroraCardFilter.prototype, "opened", void 0);
|
|
496
|
+
__decorate([property({ type: Boolean })], AuroraCardFilter.prototype, "isPlainRole", void 0);
|
|
497
|
+
__decorate([property({ type: Boolean })], AuroraCardFilter.prototype, "isDisabled", void 0);
|
|
498
|
+
AuroraCardFilter = __decorate([customElement("aurora-card-filter")], AuroraCardFilter);
|
|
499
|
+
//#endregion
|
|
500
|
+
//#region src/components/cards/parts/aurora-card-attention-banner.ts
|
|
501
|
+
var AuroraCardAttentionBanner = class AuroraCardAttentionBanner extends LitElement {
|
|
502
|
+
constructor(..._args) {
|
|
503
|
+
super(..._args);
|
|
504
|
+
this.cardType = "account";
|
|
505
|
+
this.tableStats = [];
|
|
506
|
+
this.threshold = 90;
|
|
507
|
+
this.isPlainRole = false;
|
|
508
|
+
this.invalidCredentials = false;
|
|
509
|
+
this.manageLabel = "Manage";
|
|
510
|
+
this.askOwnerLabel = "Ask your owner";
|
|
511
|
+
this.invalidCredsLabel = "Invalid credentials.";
|
|
512
|
+
this.limitReachedLabel = "Limit reached.";
|
|
513
|
+
this.andLabel = "and";
|
|
514
|
+
}
|
|
515
|
+
static {
|
|
516
|
+
this.styles = [unsafeCSS(tailwind_default), css`
|
|
517
|
+
:host { display: block; }
|
|
518
|
+
.error-bg { background-color: color-mix(in srgb, var(--axebow-error) 10%, white); }
|
|
519
|
+
`];
|
|
520
|
+
}
|
|
521
|
+
_getExceeded() {
|
|
522
|
+
const primary = this.tableStats.slice(0, 3).map((r) => r.title);
|
|
523
|
+
return this.tableStats.filter((s) => primary.includes(s.title) && s.percentage >= this.threshold).map((s) => s.title);
|
|
524
|
+
}
|
|
525
|
+
_formatList(resources) {
|
|
526
|
+
if (resources.length === 1) return resources[0];
|
|
527
|
+
if (resources.length === 2) return `${resources[0]} ${this.andLabel} ${resources[1]}`;
|
|
528
|
+
return `${resources.slice(0, -1).join(", ")} ${this.andLabel} ${resources[resources.length - 1]}`;
|
|
529
|
+
}
|
|
530
|
+
render() {
|
|
531
|
+
const exceeded = this._getExceeded();
|
|
532
|
+
if (exceeded.length === 0 && !this.invalidCredentials) return html``;
|
|
533
|
+
return html`
|
|
534
|
+
<div class="error-bg flex flex-wrap items-center justify-center gap-1 w-full px-1 text-center">
|
|
535
|
+
${this.isPlainRole ? html`<span class="text-[var(--axebow-error)]">${this.askOwnerLabel}</span>` : html`
|
|
536
|
+
<p class="text-[var(--axebow-error)] m-0">
|
|
537
|
+
${this.invalidCredentials ? this.invalidCredsLabel : `${this.limitReachedLabel} ${this._formatList(exceeded)}.`}
|
|
538
|
+
<span class="text-[var(--axebow-error)] cursor-pointer" @click=${this._onManage}>
|
|
539
|
+
${this.manageLabel}
|
|
540
|
+
<axebow-icon iconName="arrow_forward" iconColor="var(--axebow-error)" size="small"></axebow-icon>
|
|
541
|
+
</span>
|
|
542
|
+
</p>
|
|
543
|
+
`}
|
|
544
|
+
</div>
|
|
545
|
+
`;
|
|
546
|
+
}
|
|
547
|
+
_onManage() {
|
|
548
|
+
this.dispatchEvent(new CustomEvent("manage-click", {
|
|
549
|
+
bubbles: true,
|
|
550
|
+
composed: true
|
|
551
|
+
}));
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
__decorate([property({ type: String })], AuroraCardAttentionBanner.prototype, "cardType", void 0);
|
|
555
|
+
__decorate([property({ type: Array })], AuroraCardAttentionBanner.prototype, "tableStats", void 0);
|
|
556
|
+
__decorate([property({ type: Number })], AuroraCardAttentionBanner.prototype, "threshold", void 0);
|
|
557
|
+
__decorate([property({ type: Boolean })], AuroraCardAttentionBanner.prototype, "isPlainRole", void 0);
|
|
558
|
+
__decorate([property({ type: Boolean })], AuroraCardAttentionBanner.prototype, "invalidCredentials", void 0);
|
|
559
|
+
__decorate([property({ type: String })], AuroraCardAttentionBanner.prototype, "manageLabel", void 0);
|
|
560
|
+
__decorate([property({ type: String })], AuroraCardAttentionBanner.prototype, "askOwnerLabel", void 0);
|
|
561
|
+
__decorate([property({ type: String })], AuroraCardAttentionBanner.prototype, "invalidCredsLabel", void 0);
|
|
562
|
+
__decorate([property({ type: String })], AuroraCardAttentionBanner.prototype, "limitReachedLabel", void 0);
|
|
563
|
+
__decorate([property({ type: String })], AuroraCardAttentionBanner.prototype, "andLabel", void 0);
|
|
564
|
+
AuroraCardAttentionBanner = __decorate([customElement("aurora-card-attention-banner")], AuroraCardAttentionBanner);
|
|
565
|
+
//#endregion
|
|
566
|
+
//#region src/components/cards/parts/aurora-card-action-banner.ts
|
|
567
|
+
var AuroraCardActionBanner = class AuroraCardActionBanner extends LitElement {
|
|
568
|
+
constructor(..._args) {
|
|
569
|
+
super(..._args);
|
|
570
|
+
this.label = "View details";
|
|
571
|
+
}
|
|
572
|
+
static {
|
|
573
|
+
this.styles = [unsafeCSS(tailwind_default), css`
|
|
574
|
+
:host { display: block; }
|
|
575
|
+
.tertiary-bg { background-color: color-mix(in srgb, var(--axebow-tertiary) 10%, white); }
|
|
576
|
+
axebow-button::part(label) { color: var(--axebow-tertiary); font-weight: 600; display: flex; align-items: center; gap: 2px; }
|
|
577
|
+
axebow-button::part(base) { padding: 0; height: auto; min-height: unset; }
|
|
578
|
+
`];
|
|
579
|
+
}
|
|
580
|
+
render() {
|
|
581
|
+
return html`
|
|
582
|
+
<div class="tertiary-bg flex items-center justify-center gap-1 w-full px-3 text-sm text-center">
|
|
583
|
+
<axebow-button variant="text" size="small" @click=${this._onClick}>
|
|
584
|
+
${this.label}
|
|
585
|
+
<axebow-icon iconName="arrow_forward" iconColor="var(--axebow-tertiary)" size="small"></axebow-icon>
|
|
586
|
+
</axebow-button>
|
|
587
|
+
</div>
|
|
588
|
+
`;
|
|
589
|
+
}
|
|
590
|
+
_onClick() {
|
|
591
|
+
this.dispatchEvent(new CustomEvent("action-click", {
|
|
592
|
+
bubbles: true,
|
|
593
|
+
composed: true
|
|
594
|
+
}));
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
__decorate([property({ type: String })], AuroraCardActionBanner.prototype, "label", void 0);
|
|
598
|
+
AuroraCardActionBanner = __decorate([customElement("aurora-card-action-banner")], AuroraCardActionBanner);
|
|
599
|
+
//#endregion
|
|
600
|
+
//#region src/components/cards/parts/aurora-card-resource-table.ts
|
|
601
|
+
var AuroraCardResourceTable = class AuroraCardResourceTable extends LitElement {
|
|
602
|
+
constructor(..._args) {
|
|
603
|
+
super(..._args);
|
|
604
|
+
this.rows = [];
|
|
605
|
+
this.attentionThreshold = 90;
|
|
606
|
+
this.cardType = "account";
|
|
607
|
+
this.isPlainRole = false;
|
|
608
|
+
this.showActionBanner = false;
|
|
609
|
+
this.showWarningBanner = false;
|
|
610
|
+
this.manageLabel = "Manage";
|
|
611
|
+
this.askOwnerLabel = "Ask your owner";
|
|
612
|
+
this.invalidCredsLabel = "Invalid credentials.";
|
|
613
|
+
this.limitReachedLabel = "Limit reached.";
|
|
614
|
+
this.andLabel = "and";
|
|
615
|
+
this.actionBannerLabel = "";
|
|
616
|
+
}
|
|
617
|
+
static {
|
|
618
|
+
this.styles = [unsafeCSS(tailwind_default), css`:host { display: block; }`];
|
|
619
|
+
}
|
|
620
|
+
_hasAttention() {
|
|
621
|
+
const primary = this.rows.slice(0, 3).map((r) => r.title);
|
|
622
|
+
return this.rows.some((s) => primary.includes(s.title) && s.percentage >= this.attentionThreshold);
|
|
623
|
+
}
|
|
624
|
+
render() {
|
|
625
|
+
const showWarning = !this.isPlainRole && this.showWarningBanner;
|
|
626
|
+
const showAttention = !this.isPlainRole && !showWarning && this.showActionBanner && this._hasAttention();
|
|
627
|
+
const showAction = !this.isPlainRole && !showWarning && this.showActionBanner && !this._hasAttention();
|
|
628
|
+
const visibleRows = this.rows.filter((r) => !r.hidden);
|
|
629
|
+
const lastVisible = visibleRows[visibleRows.length - 1];
|
|
630
|
+
return html`
|
|
631
|
+
<div>
|
|
632
|
+
<div class="flex border-b border-[var(--axebow-light-gray)]">
|
|
633
|
+
<!-- Icon + title -->
|
|
634
|
+
<div class="flex flex-col justify-between">
|
|
635
|
+
${this.rows.map((stat, i) => html`
|
|
636
|
+
<div class="flex items-center w-full px-2 h-8 gap-2 ${!stat.hidden && stat !== lastVisible ? "border-b border-[var(--axebow-light-gray)]" : ""}">
|
|
637
|
+
${!stat.hidden ? html`
|
|
638
|
+
<div class="flex items-center gap-2 ${stat.isSecondary ? "ml-2" : ""}">
|
|
639
|
+
<axebow-icon iconName=${stat.icon} size="small" rotate=${stat.iconRotation ?? 0}></axebow-icon>
|
|
640
|
+
<span class="text-xs ${stat.isSecondary ? "" : "font-semibold"}">${stat.title}</span>
|
|
641
|
+
</div>
|
|
642
|
+
` : ""}
|
|
643
|
+
</div>
|
|
644
|
+
`)}
|
|
645
|
+
</div>
|
|
646
|
+
|
|
647
|
+
<!-- Current value -->
|
|
648
|
+
<div class="flex flex-col justify-between">
|
|
649
|
+
${this.rows.map((stat, i) => html`
|
|
650
|
+
<div class="flex items-center justify-end w-full px-2 h-8 gap-2 ${!stat.hidden && stat !== lastVisible ? "border-b border-[var(--axebow-light-gray)]" : ""}">
|
|
651
|
+
${!stat.hidden ? html`
|
|
652
|
+
<p class="${stat.isSecondary ? "font-normal" : "font-semibold"} m-0">${stat.value ?? "-.-"}</p>
|
|
653
|
+
` : ""}
|
|
654
|
+
</div>
|
|
655
|
+
`)}
|
|
656
|
+
</div>
|
|
657
|
+
|
|
658
|
+
<!-- Progress bar -->
|
|
659
|
+
<div class="flex flex-1 flex-col justify-between">
|
|
660
|
+
${this.rows.map((stat, i) => html`
|
|
661
|
+
<div class="flex items-center justify-end w-full px-2 h-8 ${!stat.hidden && stat !== lastVisible ? "border-b border-[var(--axebow-light-gray)]" : ""}">
|
|
662
|
+
${!stat.hidden ? html`
|
|
663
|
+
<div class="h-2 w-full bg-[var(--axebow-light-gray)] rounded-md relative overflow-hidden">
|
|
664
|
+
<div
|
|
665
|
+
class="absolute h-full ${stat.percentage >= this.attentionThreshold ? "bg-[var(--axebow-error)]" : "bg-[var(--axebow-gray)]"}"
|
|
666
|
+
style="width:${stat.percentage}%;"
|
|
667
|
+
></div>
|
|
668
|
+
</div>
|
|
669
|
+
` : ""}
|
|
670
|
+
</div>
|
|
671
|
+
`)}
|
|
672
|
+
</div>
|
|
673
|
+
|
|
674
|
+
<!-- Max value -->
|
|
675
|
+
<div class="flex flex-col justify-between">
|
|
676
|
+
${this.rows.map((stat, i) => html`
|
|
677
|
+
<div class="flex items-center justify-end w-full px-2 h-8 gap-2 ${!stat.hidden && stat !== lastVisible ? "border-b border-[var(--axebow-light-gray)]" : ""}">
|
|
678
|
+
${!stat.hidden ? html`
|
|
679
|
+
<p class="${stat.isSecondary ? "font-normal" : "font-semibold"} m-0">
|
|
680
|
+
${stat.maxValue ?? "-.-"}<span class="font-normal">${stat.tagValue ?? ""}</span>
|
|
681
|
+
</p>
|
|
682
|
+
` : ""}
|
|
683
|
+
</div>
|
|
684
|
+
`)}
|
|
685
|
+
</div>
|
|
686
|
+
</div>
|
|
687
|
+
|
|
688
|
+
${showWarning ? html`<aurora-card-attention-banner
|
|
689
|
+
.invalidCredentials=${true}
|
|
690
|
+
.isPlainRole=${this.isPlainRole}
|
|
691
|
+
.manageLabel=${this.manageLabel}
|
|
692
|
+
.askOwnerLabel=${this.askOwnerLabel}
|
|
693
|
+
.invalidCredsLabel=${this.invalidCredsLabel}
|
|
694
|
+
.limitReachedLabel=${this.limitReachedLabel}
|
|
695
|
+
.andLabel=${this.andLabel}
|
|
696
|
+
></aurora-card-attention-banner>` : showAttention ? html`<aurora-card-attention-banner
|
|
697
|
+
.cardType=${this.cardType}
|
|
698
|
+
.tableStats=${this.rows}
|
|
699
|
+
.threshold=${this.attentionThreshold}
|
|
700
|
+
.isPlainRole=${this.isPlainRole}
|
|
701
|
+
.manageLabel=${this.manageLabel}
|
|
702
|
+
.askOwnerLabel=${this.askOwnerLabel}
|
|
703
|
+
.invalidCredsLabel=${this.invalidCredsLabel}
|
|
704
|
+
.limitReachedLabel=${this.limitReachedLabel}
|
|
705
|
+
.andLabel=${this.andLabel}
|
|
706
|
+
></aurora-card-attention-banner>` : showAction ? html`<aurora-card-action-banner .label=${this.actionBannerLabel} @action-click=${() => this.dispatchEvent(new CustomEvent("action-click", {
|
|
707
|
+
bubbles: true,
|
|
708
|
+
composed: true
|
|
709
|
+
}))}></aurora-card-action-banner>` : ""}
|
|
710
|
+
</div>
|
|
711
|
+
`;
|
|
712
|
+
}
|
|
713
|
+
};
|
|
714
|
+
__decorate([property({ type: Array })], AuroraCardResourceTable.prototype, "rows", void 0);
|
|
715
|
+
__decorate([property({ type: Number })], AuroraCardResourceTable.prototype, "attentionThreshold", void 0);
|
|
716
|
+
__decorate([property({ type: String })], AuroraCardResourceTable.prototype, "cardType", void 0);
|
|
717
|
+
__decorate([property({ type: Boolean })], AuroraCardResourceTable.prototype, "isPlainRole", void 0);
|
|
718
|
+
__decorate([property({ type: Boolean })], AuroraCardResourceTable.prototype, "showActionBanner", void 0);
|
|
719
|
+
__decorate([property({ type: Boolean })], AuroraCardResourceTable.prototype, "showWarningBanner", void 0);
|
|
720
|
+
__decorate([property({ type: String })], AuroraCardResourceTable.prototype, "manageLabel", void 0);
|
|
721
|
+
__decorate([property({ type: String })], AuroraCardResourceTable.prototype, "askOwnerLabel", void 0);
|
|
722
|
+
__decorate([property({ type: String })], AuroraCardResourceTable.prototype, "invalidCredsLabel", void 0);
|
|
723
|
+
__decorate([property({ type: String })], AuroraCardResourceTable.prototype, "limitReachedLabel", void 0);
|
|
724
|
+
__decorate([property({ type: String })], AuroraCardResourceTable.prototype, "andLabel", void 0);
|
|
725
|
+
__decorate([property({ type: String })], AuroraCardResourceTable.prototype, "actionBannerLabel", void 0);
|
|
726
|
+
AuroraCardResourceTable = __decorate([customElement("aurora-card-resource-table")], AuroraCardResourceTable);
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region src/components/cards/parts/aurora-card-status-bar.ts
|
|
729
|
+
var AuroraCardStatusBar = class AuroraCardStatusBar extends LitElement {
|
|
730
|
+
constructor(..._args) {
|
|
731
|
+
super(..._args);
|
|
732
|
+
this.isFreeIaaS = false;
|
|
733
|
+
this.isPlainRole = false;
|
|
734
|
+
this.moreActionsOpen = false;
|
|
735
|
+
this.moreActionsOptions = [];
|
|
736
|
+
this.closeLabel = "Close";
|
|
737
|
+
this.moreActionsLabel = "More";
|
|
738
|
+
}
|
|
739
|
+
static {
|
|
740
|
+
this.styles = [unsafeCSS(tailwind_default), css`:host { display: block; }`];
|
|
741
|
+
}
|
|
742
|
+
render() {
|
|
743
|
+
return html`
|
|
744
|
+
<div class="flex justify-between items-center relative h-6 gap-2 text-xs">
|
|
745
|
+
<div class="flex-1 min-w-0 whitespace-nowrap overflow-hidden text-ellipsis"><slot></slot></div>
|
|
746
|
+
${!this.isFreeIaaS && !this.isPlainRole && this.moreActionsOptions.length > 0 ? html`
|
|
747
|
+
<aurora-more-actions
|
|
748
|
+
class="shrink-0 mr-2"
|
|
749
|
+
placement="top"
|
|
750
|
+
.open=${this.moreActionsOpen}
|
|
751
|
+
.options=${this.moreActionsOptions}
|
|
752
|
+
.closeLabel=${this.closeLabel}
|
|
753
|
+
.moreActionsLabel=${this.moreActionsLabel}
|
|
754
|
+
@toggled=${this._onToggled}
|
|
755
|
+
></aurora-more-actions>
|
|
756
|
+
` : ""}
|
|
757
|
+
</div>
|
|
758
|
+
`;
|
|
759
|
+
}
|
|
760
|
+
_onToggled(e) {
|
|
761
|
+
this.dispatchEvent(new CustomEvent("more-actions-toggled", {
|
|
762
|
+
detail: { open: e.detail.open },
|
|
763
|
+
bubbles: true,
|
|
764
|
+
composed: true
|
|
765
|
+
}));
|
|
766
|
+
}
|
|
767
|
+
};
|
|
768
|
+
__decorate([property({ type: Boolean })], AuroraCardStatusBar.prototype, "isFreeIaaS", void 0);
|
|
769
|
+
__decorate([property({ type: Boolean })], AuroraCardStatusBar.prototype, "isPlainRole", void 0);
|
|
770
|
+
__decorate([property({ type: Boolean })], AuroraCardStatusBar.prototype, "moreActionsOpen", void 0);
|
|
771
|
+
__decorate([property({ type: Array })], AuroraCardStatusBar.prototype, "moreActionsOptions", void 0);
|
|
772
|
+
__decorate([property({ type: String })], AuroraCardStatusBar.prototype, "closeLabel", void 0);
|
|
773
|
+
__decorate([property({ type: String })], AuroraCardStatusBar.prototype, "moreActionsLabel", void 0);
|
|
774
|
+
AuroraCardStatusBar = __decorate([customElement("aurora-card-status-bar")], AuroraCardStatusBar);
|
|
775
|
+
//#endregion
|
|
776
|
+
//#region src/components/cards/aurora-base-card.ts
|
|
777
|
+
var AuroraBaseCard = class AuroraBaseCard extends LitElement {
|
|
778
|
+
constructor(..._args) {
|
|
779
|
+
super(..._args);
|
|
780
|
+
this.cardType = "account";
|
|
781
|
+
this.name = "";
|
|
782
|
+
this.logoSrc = null;
|
|
783
|
+
this.tenantOrAccount = "";
|
|
784
|
+
this.badge = "none";
|
|
785
|
+
this.subtitle = "";
|
|
786
|
+
this.mainStats = [];
|
|
787
|
+
this.compact = false;
|
|
788
|
+
this.tableStats = [];
|
|
789
|
+
this.attentionThreshold = 90;
|
|
790
|
+
this.filterItems = [];
|
|
791
|
+
this.selected = null;
|
|
792
|
+
this.filterOpened = false;
|
|
793
|
+
this.emptyLabel = "";
|
|
794
|
+
this.emptyActionLabel = "";
|
|
795
|
+
this.attentionLabel = "Attention needed";
|
|
796
|
+
this.showAttention = false;
|
|
797
|
+
this.isPlainRole = false;
|
|
798
|
+
this.isDeleting = false;
|
|
799
|
+
this.isDisabled = false;
|
|
800
|
+
this.showActionBanner = false;
|
|
801
|
+
this.showWarningBanner = false;
|
|
802
|
+
this.manageLabel = "Manage";
|
|
803
|
+
this.askOwnerLabel = "Ask your owner";
|
|
804
|
+
this.invalidCredsLabel = "Invalid credentials.";
|
|
805
|
+
this.limitReachedLabel = "Limit reached.";
|
|
806
|
+
this.andLabel = "and";
|
|
807
|
+
this.actionBannerLabel = "";
|
|
808
|
+
this.moreActionsOpen = false;
|
|
809
|
+
this.moreActionsOptions = [];
|
|
810
|
+
this.isFreeIaaS = false;
|
|
811
|
+
this.closeLabel = "Close";
|
|
812
|
+
this.moreActionsLabel = "More";
|
|
813
|
+
this.freeIaasLabel = "Free IaaS";
|
|
814
|
+
this.freeIaasTitle = "Free Infrastructure";
|
|
815
|
+
this.freeIaasDesc = "This environment uses free infrastructure.";
|
|
816
|
+
this.haLabel = "Highly Available";
|
|
817
|
+
this.haTitle = "High Availability enabled";
|
|
818
|
+
}
|
|
819
|
+
static {
|
|
820
|
+
this.styles = [unsafeCSS(tailwind_default), css`
|
|
821
|
+
:host { display: block; width: 450px; max-width: 100%; }
|
|
822
|
+
sl-badge::part(base) { background-color: var(--axebow-secondary); color: white; }
|
|
823
|
+
sl-dialog::part(panel) { width: 35vw; }
|
|
824
|
+
sl-dialog::part(body) { padding-top: 0; }
|
|
825
|
+
sl-alert::part(base) { border-top: 2px solid var(--axebow-error); }
|
|
826
|
+
sl-range, sl-range:hover {
|
|
827
|
+
--sl-color-primary-600: var(--axebow-tertiary);
|
|
828
|
+
--sl-color-primary-500: var(--axebow-tertiary);
|
|
829
|
+
}
|
|
830
|
+
`];
|
|
831
|
+
}
|
|
832
|
+
render() {
|
|
833
|
+
return html`
|
|
834
|
+
<div class="w-full bg-[var(--axebow-white)] rounded-lg px-2 pt-2 pb-4 flex flex-col justify-between gap-2 h-full transition-shadow duration-200 ease-in-out hover:shadow-[0_4px_12px_0_rgba(13,24,33,0.08)]">
|
|
835
|
+
<div class="flex flex-col gap-2">
|
|
836
|
+
<aurora-card-header
|
|
837
|
+
.cardType=${this.cardType}
|
|
838
|
+
.logoSrc=${this.logoSrc}
|
|
839
|
+
.tenantOrAccount=${this.tenantOrAccount}
|
|
840
|
+
.name=${this.name}
|
|
841
|
+
.badge=${this.badge}
|
|
842
|
+
.subtitle=${this.subtitle}
|
|
843
|
+
.freeIaasLabel=${this.freeIaasLabel}
|
|
844
|
+
.freeIaasTitle=${this.freeIaasTitle}
|
|
845
|
+
.freeIaasDesc=${this.freeIaasDesc}
|
|
846
|
+
.haLabel=${this.haLabel}
|
|
847
|
+
.haTitle=${this.haTitle}
|
|
848
|
+
>
|
|
849
|
+
<slot slot="subtitle-tooltip" name="subtitle-tooltip"></slot>
|
|
850
|
+
</aurora-card-header>
|
|
851
|
+
|
|
852
|
+
<div class="w-full px-2 flex flex-col gap-2">
|
|
853
|
+
<aurora-card-stats-row
|
|
854
|
+
.stats=${this.mainStats}
|
|
855
|
+
.compact=${this.compact}
|
|
856
|
+
@stat-label-click=${(e) => !this.isDeleting && this.dispatchEvent(new CustomEvent("stat-label-click", {
|
|
857
|
+
detail: e.detail,
|
|
858
|
+
bubbles: true,
|
|
859
|
+
composed: true
|
|
860
|
+
}))}
|
|
861
|
+
></aurora-card-stats-row>
|
|
862
|
+
|
|
863
|
+
<div class="w-full h-full border border-[var(--axebow-light-gray)] rounded-md">
|
|
864
|
+
<aurora-card-filter
|
|
865
|
+
.items=${this.filterItems}
|
|
866
|
+
.selected=${this.selected}
|
|
867
|
+
.emptyLabel=${this.emptyLabel}
|
|
868
|
+
.emptyActionLabel=${this.emptyActionLabel}
|
|
869
|
+
.attentionLabel=${this.attentionLabel}
|
|
870
|
+
.showAttention=${this.showAttention}
|
|
871
|
+
.opened=${this.filterOpened}
|
|
872
|
+
.isPlainRole=${this.isPlainRole}
|
|
873
|
+
.isDisabled=${this.isDeleting || this.isDisabled}
|
|
874
|
+
@filter-select=${(e) => !this.isDeleting && this.dispatchEvent(new CustomEvent("filter-select", {
|
|
875
|
+
detail: e.detail,
|
|
876
|
+
bubbles: true,
|
|
877
|
+
composed: true
|
|
878
|
+
}))}
|
|
879
|
+
@toggle-open=${() => !this.isDeleting && this.dispatchEvent(new CustomEvent("toggle-filter", {
|
|
880
|
+
bubbles: true,
|
|
881
|
+
composed: true
|
|
882
|
+
}))}
|
|
883
|
+
@empty-action-click=${() => !this.isDeleting && this.dispatchEvent(new CustomEvent("empty-action-click", {
|
|
884
|
+
bubbles: true,
|
|
885
|
+
composed: true
|
|
886
|
+
}))}
|
|
887
|
+
></aurora-card-filter>
|
|
888
|
+
|
|
889
|
+
<aurora-card-resource-table
|
|
890
|
+
.rows=${this.tableStats}
|
|
891
|
+
.attentionThreshold=${this.attentionThreshold}
|
|
892
|
+
.cardType=${this.cardType}
|
|
893
|
+
.isPlainRole=${this.isPlainRole}
|
|
894
|
+
.showActionBanner=${this.showActionBanner}
|
|
895
|
+
.showWarningBanner=${this.showWarningBanner}
|
|
896
|
+
.manageLabel=${this.manageLabel}
|
|
897
|
+
.askOwnerLabel=${this.askOwnerLabel}
|
|
898
|
+
.invalidCredsLabel=${this.invalidCredsLabel}
|
|
899
|
+
.limitReachedLabel=${this.limitReachedLabel}
|
|
900
|
+
.andLabel=${this.andLabel}
|
|
901
|
+
.actionBannerLabel=${this.actionBannerLabel}
|
|
902
|
+
@manage-click=${() => !this.isDeleting && this.dispatchEvent(new CustomEvent("manage-click", {
|
|
903
|
+
bubbles: true,
|
|
904
|
+
composed: true
|
|
905
|
+
}))}
|
|
906
|
+
@action-click=${() => !this.isDeleting && this.dispatchEvent(new CustomEvent("action-click", {
|
|
907
|
+
bubbles: true,
|
|
908
|
+
composed: true
|
|
909
|
+
}))}
|
|
910
|
+
></aurora-card-resource-table>
|
|
911
|
+
</div>
|
|
912
|
+
|
|
913
|
+
<slot name="extra-features"></slot>
|
|
914
|
+
</div>
|
|
915
|
+
</div>
|
|
916
|
+
|
|
917
|
+
<aurora-card-status-bar
|
|
918
|
+
class="mb-1 pl-2"
|
|
919
|
+
.isFreeIaaS=${this.isFreeIaaS}
|
|
920
|
+
.isPlainRole=${this.isPlainRole}
|
|
921
|
+
.moreActionsOpen=${this.moreActionsOpen}
|
|
922
|
+
.moreActionsOptions=${this.moreActionsOptions}
|
|
923
|
+
.closeLabel=${this.closeLabel}
|
|
924
|
+
.moreActionsLabel=${this.moreActionsLabel}
|
|
925
|
+
@more-actions-toggled=${(e) => this.dispatchEvent(new CustomEvent("more-actions-toggled", {
|
|
926
|
+
detail: e.detail,
|
|
927
|
+
bubbles: true,
|
|
928
|
+
composed: true
|
|
929
|
+
}))}
|
|
930
|
+
>
|
|
931
|
+
<slot name="status-footer"></slot>
|
|
932
|
+
</aurora-card-status-bar>
|
|
933
|
+
|
|
934
|
+
<slot name="dialogs"></slot>
|
|
935
|
+
</div>
|
|
936
|
+
`;
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "cardType", void 0);
|
|
940
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "name", void 0);
|
|
941
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "logoSrc", void 0);
|
|
942
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "tenantOrAccount", void 0);
|
|
943
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "badge", void 0);
|
|
944
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "subtitle", void 0);
|
|
945
|
+
__decorate([property({ type: Array })], AuroraBaseCard.prototype, "mainStats", void 0);
|
|
946
|
+
__decorate([property({ type: Boolean })], AuroraBaseCard.prototype, "compact", void 0);
|
|
947
|
+
__decorate([property({ type: Array })], AuroraBaseCard.prototype, "tableStats", void 0);
|
|
948
|
+
__decorate([property({ type: Number })], AuroraBaseCard.prototype, "attentionThreshold", void 0);
|
|
949
|
+
__decorate([property({ type: Array })], AuroraBaseCard.prototype, "filterItems", void 0);
|
|
950
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "selected", void 0);
|
|
951
|
+
__decorate([property({ type: Boolean })], AuroraBaseCard.prototype, "filterOpened", void 0);
|
|
952
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "emptyLabel", void 0);
|
|
953
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "emptyActionLabel", void 0);
|
|
954
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "attentionLabel", void 0);
|
|
955
|
+
__decorate([property({ type: Boolean })], AuroraBaseCard.prototype, "showAttention", void 0);
|
|
956
|
+
__decorate([property({ type: Boolean })], AuroraBaseCard.prototype, "isPlainRole", void 0);
|
|
957
|
+
__decorate([property({ type: Boolean })], AuroraBaseCard.prototype, "isDeleting", void 0);
|
|
958
|
+
__decorate([property({ type: Boolean })], AuroraBaseCard.prototype, "isDisabled", void 0);
|
|
959
|
+
__decorate([property({ type: Boolean })], AuroraBaseCard.prototype, "showActionBanner", void 0);
|
|
960
|
+
__decorate([property({ type: Boolean })], AuroraBaseCard.prototype, "showWarningBanner", void 0);
|
|
961
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "manageLabel", void 0);
|
|
962
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "askOwnerLabel", void 0);
|
|
963
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "invalidCredsLabel", void 0);
|
|
964
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "limitReachedLabel", void 0);
|
|
965
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "andLabel", void 0);
|
|
966
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "actionBannerLabel", void 0);
|
|
967
|
+
__decorate([property({ type: Boolean })], AuroraBaseCard.prototype, "moreActionsOpen", void 0);
|
|
968
|
+
__decorate([property({ type: Array })], AuroraBaseCard.prototype, "moreActionsOptions", void 0);
|
|
969
|
+
__decorate([property({ type: Boolean })], AuroraBaseCard.prototype, "isFreeIaaS", void 0);
|
|
970
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "closeLabel", void 0);
|
|
971
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "moreActionsLabel", void 0);
|
|
972
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "freeIaasLabel", void 0);
|
|
973
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "freeIaasTitle", void 0);
|
|
974
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "freeIaasDesc", void 0);
|
|
975
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "haLabel", void 0);
|
|
976
|
+
__decorate([property({ type: String })], AuroraBaseCard.prototype, "haTitle", void 0);
|
|
977
|
+
AuroraBaseCard = __decorate([customElement("aurora-base-card")], AuroraBaseCard);
|
|
978
|
+
//#endregion
|
|
979
|
+
//#region src/components/cards/aurora-runtime-card.ts
|
|
980
|
+
var AuroraRuntimeCard = class AuroraRuntimeCard extends LitElement {
|
|
981
|
+
constructor(..._args) {
|
|
982
|
+
super(..._args);
|
|
983
|
+
this.name = "";
|
|
984
|
+
this.logo = "";
|
|
985
|
+
this.revisions = [];
|
|
986
|
+
this.displayedRevision = "";
|
|
987
|
+
this.lastDeployed = "";
|
|
988
|
+
this.isDeployed = false;
|
|
989
|
+
this.tableStats = [];
|
|
990
|
+
this.attentionThreshold = 90;
|
|
991
|
+
this.filterOpened = false;
|
|
992
|
+
this.filterDisplayText = "";
|
|
993
|
+
this.filterRoles = [];
|
|
994
|
+
this.showAttention = false;
|
|
995
|
+
this.borderColor = "";
|
|
996
|
+
this.statusCode = "";
|
|
997
|
+
this.statusMessage = "";
|
|
998
|
+
this.isRemoving = false;
|
|
999
|
+
this.deployedLabel = "Deployed";
|
|
1000
|
+
this.allLabel = "All Roles & Instances";
|
|
1001
|
+
this.attentionLabel = "Attention needed";
|
|
1002
|
+
this.serviceDetailLabel = "Service detail";
|
|
1003
|
+
this.manageLabel = "Manage";
|
|
1004
|
+
this.askOwnerLabel = "Ask your owner";
|
|
1005
|
+
this.invalidCredsLabel = "Invalid credentials.";
|
|
1006
|
+
this.limitReachedLabel = "Limit reached.";
|
|
1007
|
+
this.andLabel = "and";
|
|
1008
|
+
}
|
|
1009
|
+
static {
|
|
1010
|
+
this.styles = [unsafeCSS(tailwind_default), css`
|
|
1011
|
+
:host { display: block; width: 380px; height: 417px; max-width: 100%; }
|
|
1012
|
+
|
|
1013
|
+
.revision-wrap sl-select {
|
|
1014
|
+
--sl-input-background-color: transparent;
|
|
1015
|
+
--sl-input-border-color: transparent;
|
|
1016
|
+
border: none;
|
|
1017
|
+
background: transparent;
|
|
1018
|
+
padding: 0;
|
|
1019
|
+
margin: 0;
|
|
1020
|
+
min-width: 0;
|
|
1021
|
+
width: 100% !important;
|
|
1022
|
+
}
|
|
1023
|
+
.revision-wrap sl-select::part(base) {
|
|
1024
|
+
border: none;
|
|
1025
|
+
background-color: transparent;
|
|
1026
|
+
padding: 0;
|
|
1027
|
+
min-width: 0;
|
|
1028
|
+
display: inline-block;
|
|
1029
|
+
}
|
|
1030
|
+
sl-select::part(display-input) { padding: 0 8px; }
|
|
1031
|
+
sl-select::part(combobox) { padding: 0; }
|
|
1032
|
+
sl-select sl-option[checked] .revision-ts,
|
|
1033
|
+
sl-select sl-option[current] .revision-ts,
|
|
1034
|
+
sl-select sl-option[aria-selected="true"] .revision-ts { color: white !important; }
|
|
1035
|
+
sl-tooltip::part(base) { max-width: none; white-space: normal; word-break: break-word; }
|
|
1036
|
+
sl-dialog::part(panel) { width: 35vw; min-width: 400px; }
|
|
1037
|
+
sl-dialog::part(body) { padding-top: 0; }
|
|
1038
|
+
.deploy-time {
|
|
1039
|
+
display: -webkit-box;
|
|
1040
|
+
-webkit-line-clamp: 2;
|
|
1041
|
+
-webkit-box-orient: vertical;
|
|
1042
|
+
overflow: hidden;
|
|
1043
|
+
}
|
|
1044
|
+
`];
|
|
1045
|
+
}
|
|
1046
|
+
render() {
|
|
1047
|
+
return html`
|
|
1048
|
+
<div
|
|
1049
|
+
class="w-full h-full bg-[var(--axebow-white)] rounded-lg px-2 pt-2 pb-4 flex flex-col justify-between gap-2 box-border border-t-4 transition-shadow duration-200 ease-in-out hover:shadow-[0_4px_12px_0_rgba(13,24,33,0.08)] ${this.isRemoving ? "pointer-events-none cursor-not-allowed grayscale" : ""}"
|
|
1050
|
+
style="border-top-color:${this.borderColor};"
|
|
1051
|
+
?inert=${this.isRemoving}
|
|
1052
|
+
>
|
|
1053
|
+
<div class="flex flex-col gap-2">
|
|
1054
|
+
${this._renderHeader()}
|
|
1055
|
+
<div class="w-full px-2 flex flex-col gap-2">
|
|
1056
|
+
${this._renderDeployInfo()}
|
|
1057
|
+
${this._renderTable()}
|
|
1058
|
+
</div>
|
|
1059
|
+
</div>
|
|
1060
|
+
${this._renderFooter()}
|
|
1061
|
+
<slot name="dialogs"></slot>
|
|
1062
|
+
</div>
|
|
1063
|
+
`;
|
|
1064
|
+
}
|
|
1065
|
+
_renderHeader() {
|
|
1066
|
+
return html`
|
|
1067
|
+
<div class="w-full bg-[var(--axebow-anti-flash-white)] rounded-md py-2 px-3 h-16 flex items-center gap-3">
|
|
1068
|
+
${this.logo ? html`<div class="h-10 w-10 flex items-center justify-center shrink-0"><img src=${this.logo} class="max-h-full max-w-full object-contain" /></div>` : ""}
|
|
1069
|
+
<div class="flex flex-col flex-1 min-w-0 justify-center">
|
|
1070
|
+
<div class="flex justify-between items-center">
|
|
1071
|
+
<span class="font-bold text-xl text-[var(--axebow-primary)] leading-snug">${this.name}</span>
|
|
1072
|
+
</div>
|
|
1073
|
+
<div class="revision-wrap italic text-[var(--axebow-primary)] flex items-center">
|
|
1074
|
+
<sl-select style="width:100%;" value=${this.displayedRevision} @sl-change=${this._onRevisionChange}>
|
|
1075
|
+
${this.revisions.map((rev) => html`<sl-option value=${rev.id}>${this._formatRevision(rev.id)}</sl-option>`)}
|
|
1076
|
+
</sl-select>
|
|
1077
|
+
</div>
|
|
1078
|
+
</div>
|
|
1079
|
+
</div>
|
|
1080
|
+
`;
|
|
1081
|
+
}
|
|
1082
|
+
_renderDeployInfo() {
|
|
1083
|
+
return html`
|
|
1084
|
+
<div class="flex flex-row justify-between items-center min-h-10 max-h-10 overflow-hidden">
|
|
1085
|
+
<span class="deploy-time text-[var(--axebow-secondary)]"><slot name="time-elapsed"></slot></span>
|
|
1086
|
+
${this.isDeployed ? html`<span class="text-[var(--axebow-secondary)] border-2 border-[var(--axebow-secondary)] rounded-lg py-0.5 px-1.5 whitespace-nowrap text-xs">${this.deployedLabel}</span>` : ""}
|
|
1087
|
+
</div>
|
|
1088
|
+
`;
|
|
1089
|
+
}
|
|
1090
|
+
_renderTable() {
|
|
1091
|
+
return html`
|
|
1092
|
+
<div class="w-full border border-[var(--axebow-light-gray)] rounded-md">
|
|
1093
|
+
<div class="relative">
|
|
1094
|
+
<div class="flex justify-between items-center border-b border-[var(--axebow-light-gray)] w-full px-2 cursor-pointer h-7" @click=${this._onToggleFilter}>
|
|
1095
|
+
<span class="text-[var(--axebow-tertiary)]">${this.filterDisplayText || this.allLabel}</span>
|
|
1096
|
+
<div class="flex items-center gap-2">
|
|
1097
|
+
${this.showAttention ? html`<p class="text-[var(--axebow-error)] m-0 text-xs">${this.attentionLabel}</p>` : ""}
|
|
1098
|
+
<axebow-icon iconName="chevron_right" rotate="90" iconColor="var(--axebow-tertiary)" size="small"></axebow-icon>
|
|
1099
|
+
</div>
|
|
1100
|
+
</div>
|
|
1101
|
+
|
|
1102
|
+
<div class="${this.filterOpened ? "" : "hidden"} absolute top-full left-0 right-0 z-10 flex flex-col bg-white rounded-b-lg border border-[var(--axebow-light-gray)] shadow-[2px_2px_25px_0px_rgba(0,0,0,0.1)] max-h-40 overflow-y-auto">
|
|
1103
|
+
<p class="w-full p-2 cursor-pointer m-0 hover:bg-[var(--axebow-light-gray)]" @click=${() => this._onFilterChange("", "all")}>${this.allLabel}</p>
|
|
1104
|
+
${this.filterRoles.map((role) => html`
|
|
1105
|
+
<div
|
|
1106
|
+
class="w-full py-1 px-2 flex justify-between items-center border-t border-[var(--axebow-light-gray)] cursor-pointer hover:bg-[var(--axebow-light-gray)]"
|
|
1107
|
+
@click=${() => this._onFilterChange(role.name, "role")}
|
|
1108
|
+
>
|
|
1109
|
+
<div class="flex items-center gap-2">
|
|
1110
|
+
${role.logo ? html`<img src=${role.logo} class="w-5 h-5" />` : ""}
|
|
1111
|
+
<p class="m-0">${role.name}</p>
|
|
1112
|
+
</div>
|
|
1113
|
+
</div>
|
|
1114
|
+
${role.instances.map((inst) => html`
|
|
1115
|
+
<div
|
|
1116
|
+
class="w-full py-1 px-2 pl-6 flex justify-between items-center border-t border-[var(--axebow-light-gray)] cursor-pointer hover:bg-[var(--axebow-light-gray)]"
|
|
1117
|
+
@click=${() => this._onFilterChange(inst.name, "instance")}
|
|
1118
|
+
>
|
|
1119
|
+
<div class="flex items-center gap-2">
|
|
1120
|
+
<axebow-icon iconName="subdirectory_arrow_right" size="small"></axebow-icon>
|
|
1121
|
+
<p class="m-0">${inst.name}</p>
|
|
1122
|
+
</div>
|
|
1123
|
+
${inst.needsAttention ? html`<axebow-icon iconName="warning" iconColor="var(--axebow-error)" size="small"></axebow-icon>` : ""}
|
|
1124
|
+
</div>
|
|
1125
|
+
`)}
|
|
1126
|
+
`)}
|
|
1127
|
+
</div>
|
|
1128
|
+
</div>
|
|
1129
|
+
|
|
1130
|
+
<aurora-card-resource-table
|
|
1131
|
+
.rows=${this.tableStats}
|
|
1132
|
+
.attentionThreshold=${this.attentionThreshold}
|
|
1133
|
+
.manageLabel=${this.manageLabel}
|
|
1134
|
+
.askOwnerLabel=${this.askOwnerLabel}
|
|
1135
|
+
.invalidCredsLabel=${this.invalidCredsLabel}
|
|
1136
|
+
.limitReachedLabel=${this.limitReachedLabel}
|
|
1137
|
+
.andLabel=${this.andLabel}
|
|
1138
|
+
></aurora-card-resource-table>
|
|
1139
|
+
</div>
|
|
1140
|
+
`;
|
|
1141
|
+
}
|
|
1142
|
+
_renderFooter() {
|
|
1143
|
+
return html`
|
|
1144
|
+
<div class="flex justify-between items-center px-2 gap-4 h-10 overflow-hidden mb-1">
|
|
1145
|
+
<div class="flex items-center gap-1 min-w-0 flex-1">
|
|
1146
|
+
${this.borderColor === "var(--axebow-gray)" ? html`<sl-spinner style="--indicator-color:${this.borderColor};"></sl-spinner>` : ""}
|
|
1147
|
+
<p class="font-bold text-xs m-0 line-clamp-1" style="color:${this.borderColor};" title=${this.statusCode}>${this.statusCode}</p>
|
|
1148
|
+
${this.statusCode ? html`
|
|
1149
|
+
<sl-tooltip content=${this.statusMessage}>
|
|
1150
|
+
<axebow-icon class="cursor-pointer shrink-0" iconColor=${this.borderColor} iconName="info" size="small"></axebow-icon>
|
|
1151
|
+
</sl-tooltip>
|
|
1152
|
+
` : ""}
|
|
1153
|
+
</div>
|
|
1154
|
+
<axebow-button variant="text" size="medium" @click=${this._onServiceDetail}>${this.serviceDetailLabel}</axebow-button>
|
|
1155
|
+
</div>
|
|
1156
|
+
`;
|
|
1157
|
+
}
|
|
1158
|
+
_formatRevision(id) {
|
|
1159
|
+
if (!id) return "";
|
|
1160
|
+
const parts = id.split("/");
|
|
1161
|
+
return parts[parts.length - 1] ?? id;
|
|
1162
|
+
}
|
|
1163
|
+
_onRevisionChange(e) {
|
|
1164
|
+
const revision = e.target.value;
|
|
1165
|
+
this.dispatchEvent(new CustomEvent("revision-change", {
|
|
1166
|
+
detail: { revision },
|
|
1167
|
+
bubbles: true,
|
|
1168
|
+
composed: true
|
|
1169
|
+
}));
|
|
1170
|
+
}
|
|
1171
|
+
_onToggleFilter() {
|
|
1172
|
+
this.dispatchEvent(new CustomEvent("toggle-filter", {
|
|
1173
|
+
bubbles: true,
|
|
1174
|
+
composed: true
|
|
1175
|
+
}));
|
|
1176
|
+
}
|
|
1177
|
+
_onFilterChange(selected, type) {
|
|
1178
|
+
this.dispatchEvent(new CustomEvent("filter-change", {
|
|
1179
|
+
detail: {
|
|
1180
|
+
selected,
|
|
1181
|
+
type
|
|
1182
|
+
},
|
|
1183
|
+
bubbles: true,
|
|
1184
|
+
composed: true
|
|
1185
|
+
}));
|
|
1186
|
+
}
|
|
1187
|
+
_onServiceDetail() {
|
|
1188
|
+
this.dispatchEvent(new CustomEvent("service-detail-click", {
|
|
1189
|
+
bubbles: true,
|
|
1190
|
+
composed: true
|
|
1191
|
+
}));
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "name", void 0);
|
|
1195
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "logo", void 0);
|
|
1196
|
+
__decorate([property({ type: Array })], AuroraRuntimeCard.prototype, "revisions", void 0);
|
|
1197
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "displayedRevision", void 0);
|
|
1198
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "lastDeployed", void 0);
|
|
1199
|
+
__decorate([property({ type: Boolean })], AuroraRuntimeCard.prototype, "isDeployed", void 0);
|
|
1200
|
+
__decorate([property({ type: Array })], AuroraRuntimeCard.prototype, "tableStats", void 0);
|
|
1201
|
+
__decorate([property({ type: Number })], AuroraRuntimeCard.prototype, "attentionThreshold", void 0);
|
|
1202
|
+
__decorate([property({ type: Boolean })], AuroraRuntimeCard.prototype, "filterOpened", void 0);
|
|
1203
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "filterDisplayText", void 0);
|
|
1204
|
+
__decorate([property({ type: Array })], AuroraRuntimeCard.prototype, "filterRoles", void 0);
|
|
1205
|
+
__decorate([property({ type: Boolean })], AuroraRuntimeCard.prototype, "showAttention", void 0);
|
|
1206
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "borderColor", void 0);
|
|
1207
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "statusCode", void 0);
|
|
1208
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "statusMessage", void 0);
|
|
1209
|
+
__decorate([property({ type: Boolean })], AuroraRuntimeCard.prototype, "isRemoving", void 0);
|
|
1210
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "deployedLabel", void 0);
|
|
1211
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "allLabel", void 0);
|
|
1212
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "attentionLabel", void 0);
|
|
1213
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "serviceDetailLabel", void 0);
|
|
1214
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "manageLabel", void 0);
|
|
1215
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "askOwnerLabel", void 0);
|
|
1216
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "invalidCredsLabel", void 0);
|
|
1217
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "limitReachedLabel", void 0);
|
|
1218
|
+
__decorate([property({ type: String })], AuroraRuntimeCard.prototype, "andLabel", void 0);
|
|
1219
|
+
AuroraRuntimeCard = __decorate([customElement("aurora-runtime-card")], AuroraRuntimeCard);
|
|
1220
|
+
//#endregion
|
|
1221
|
+
export { AuroraBaseCard, AuroraButton, AuroraCardActionBanner, AuroraCardAttentionBanner, AuroraCardFilter, AuroraCardFilterItem, AuroraCardHeader, AuroraCardResourceTable, AuroraCardStatItem, AuroraCardStatsRow, AuroraCardStatusBar, AuroraMoreActions, AuroraRuntimeCard, STATUS_COLORS, auroraTheme };
|
|
1222
|
+
|
|
16
1223
|
//# sourceMappingURL=index.js.map
|