@ansiversa/components 0.0.19 → 0.0.21

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/index.ts CHANGED
@@ -25,3 +25,4 @@ export { default as AvChipList } from './src/AvChipList.astro';
25
25
  export { default as AvTemplateCard } from './src/AvTemplateCard.astro';
26
26
  export { default as AvTemplateGrid } from './src/AvTemplateGrid.astro';
27
27
  export { default as AvDrawer } from './src/AvDrawer.astro';
28
+ export * from "./src/alpine";
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@ansiversa/components",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "Shared UI components and layouts for the Ansiversa ecosystem",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./index.ts",
8
+ "./alpine": "./src/alpine/index.ts",
8
9
  "./styles/global.css": "./src/styles/global.css"
9
10
  },
10
11
  "files": [
@@ -21,4 +22,4 @@
21
22
  "peerDependencies": {
22
23
  "astro": "^4.0.0 || ^5.0.0"
23
24
  }
24
- }
25
+ }
@@ -99,9 +99,9 @@ const rootClassAttr = rootClasses.join(" ");
99
99
  }
100
100
 
101
101
  .av-breadcrumb__current {
102
- font-weight: 500;
103
- color: var(--ans-fg, #111827);
104
- }
102
+ font-weight: 500;
103
+ color: var(--ans-text, var(--ans-fg, #e5e7eb));
104
+ }
105
105
 
106
106
  .av-breadcrumb__separator {
107
107
  margin-inline: 0.125rem;
@@ -0,0 +1,28 @@
1
+ export class AvBaseStore {
2
+ isLoading = false;
3
+ error: string | null = null;
4
+ toast: { type: "success" | "error"; message: string } | null = null;
5
+
6
+ setLoading(v: boolean) { this.isLoading = v; }
7
+ setError(msg: string | null) { this.error = msg; }
8
+ clearError() { this.error = null; }
9
+
10
+ notify(type: "success" | "error", message: string) {
11
+ this.toast = { type, message };
12
+ window.setTimeout(() => {
13
+ if (this.toast?.message === message) this.toast = null;
14
+ }, 2500);
15
+ }
16
+
17
+ confirm(message: string) {
18
+ return window.confirm(message);
19
+ }
20
+ }
21
+
22
+ export function safeErrorMessage(err: unknown, fallback = "Something went wrong.") {
23
+ if (err && typeof err === "object" && "message" in err) {
24
+ const msg = (err as any).message;
25
+ if (typeof msg === "string" && msg.trim()) return msg;
26
+ }
27
+ return fallback;
28
+ }
@@ -0,0 +1 @@
1
+ export * from "./BaseStore";
@@ -1107,6 +1107,42 @@
1107
1107
  stroke-width: 1.75;
1108
1108
  }
1109
1109
 
1110
+ /* Grid utility */
1111
+ .av-card-grid {
1112
+ display: grid;
1113
+ gap: 1rem;
1114
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
1115
+ }
1116
+ /* Status pill utility */
1117
+ .av-status-pill {
1118
+ padding: 0.25rem 0.6rem;
1119
+ border-radius: 999px;
1120
+ background: rgba(148, 163, 184, 0.15);
1121
+ color: var(--av-fg, #e2e8f0);
1122
+ font-size: 0.85rem;
1123
+ white-space: nowrap;
1124
+ }
1125
+
1126
+ .av-status-pill--primary {
1127
+ background: rgba(34, 211, 238, 0.18);
1128
+ color: var(--av-fg, #e2e8f0);
1129
+ }
1130
+
1131
+ /* Loading bar utility */
1132
+ .av-loading-bar {
1133
+ height: 4px;
1134
+ width: 100%;
1135
+ background: linear-gradient(90deg, #22d3ee, #6366f1);
1136
+ animation: av-shimmer 1.6s linear infinite;
1137
+ margin-bottom: 1rem;
1138
+ background-size: 200% 100%;
1139
+ }
1140
+
1141
+ @keyframes av-shimmer {
1142
+ 0% { background-position: 0 0; }
1143
+ 100% { background-position: 200% 0; }
1144
+ }
1145
+
1110
1146
  }
1111
1147
 
1112
1148