@almadar/ui 2.15.8 → 2.15.10

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.
Files changed (125) hide show
  1. package/dist/components/atoms/ContentSection.d.ts +16 -0
  2. package/dist/components/atoms/SectionHeader.d.ts +14 -0
  3. package/dist/components/atoms/StatCard.d.ts +13 -0
  4. package/dist/components/atoms/index.d.ts +3 -0
  5. package/dist/components/atoms/svg/SvgBranch.d.ts +12 -0
  6. package/dist/components/atoms/svg/SvgConnection.d.ts +13 -0
  7. package/dist/components/atoms/svg/SvgFlow.d.ts +10 -0
  8. package/dist/components/atoms/svg/SvgGrid.d.ts +14 -0
  9. package/dist/components/atoms/svg/SvgLobe.d.ts +13 -0
  10. package/dist/components/atoms/svg/SvgMesh.d.ts +12 -0
  11. package/dist/components/atoms/svg/SvgMorph.d.ts +11 -0
  12. package/dist/components/atoms/svg/SvgNode.d.ts +12 -0
  13. package/dist/components/atoms/svg/SvgPulse.d.ts +12 -0
  14. package/dist/components/atoms/svg/SvgRing.d.ts +13 -0
  15. package/dist/components/atoms/svg/SvgShield.d.ts +11 -0
  16. package/dist/components/atoms/svg/SvgStack.d.ts +13 -0
  17. package/dist/components/atoms/svg/index.d.ts +12 -0
  18. package/dist/{chunk-ACUO2BBW.js → components/index.cjs} +24764 -16677
  19. package/dist/components/index.js +37757 -889
  20. package/dist/components/molecules/AnimatedCounter.d.ts +18 -0
  21. package/dist/components/molecules/ArticleSection.d.ts +18 -0
  22. package/dist/components/molecules/CTABanner.d.ts +31 -0
  23. package/dist/components/molecules/CaseStudyCard.d.ts +24 -0
  24. package/dist/components/molecules/CodeExample.d.ts +23 -0
  25. package/dist/components/molecules/CommunityLinks.d.ts +25 -0
  26. package/dist/components/molecules/DocBreadcrumb.d.ts +20 -0
  27. package/dist/components/molecules/DocCodeBlock.d.ts +13 -0
  28. package/dist/components/molecules/DocPagination.d.ts +14 -0
  29. package/dist/components/molecules/DocSearch.d.ts +15 -0
  30. package/dist/components/molecules/DocSidebar.d.ts +24 -0
  31. package/dist/components/molecules/DocTOC.d.ts +24 -0
  32. package/dist/components/molecules/FeatureCard.d.ts +26 -0
  33. package/dist/components/molecules/FeatureGrid.d.ts +19 -0
  34. package/dist/components/molecules/GradientDivider.d.ts +14 -0
  35. package/dist/components/molecules/HeroSection.d.ts +36 -0
  36. package/dist/components/molecules/InstallBox.d.ts +16 -0
  37. package/dist/components/molecules/MarketingFooter.d.ts +27 -0
  38. package/dist/components/molecules/PricingCard.d.ts +21 -0
  39. package/dist/components/molecules/PricingGrid.d.ts +13 -0
  40. package/dist/components/molecules/PullQuote.d.ts +14 -0
  41. package/dist/components/molecules/ServiceCatalog.d.ts +19 -0
  42. package/dist/components/molecules/ShowcaseCard.d.ts +20 -0
  43. package/dist/components/molecules/SocialProof.d.ts +25 -0
  44. package/dist/components/molecules/SplitSection.d.ts +21 -0
  45. package/dist/components/molecules/StatsGrid.d.ts +17 -0
  46. package/dist/components/molecules/StepFlow.d.ts +20 -0
  47. package/dist/components/molecules/TagCloud.d.ts +18 -0
  48. package/dist/components/molecules/TeamCard.d.ts +18 -0
  49. package/dist/components/molecules/index.d.ts +19 -0
  50. package/dist/components/molecules/svg/AIGenerates.d.ts +7 -0
  51. package/dist/components/molecules/svg/ClosedCircuit.d.ts +7 -0
  52. package/dist/components/molecules/svg/CommunityOwnership.d.ts +7 -0
  53. package/dist/components/molecules/svg/CompileAnywhere.d.ts +7 -0
  54. package/dist/components/molecules/svg/ComposableModels.d.ts +7 -0
  55. package/dist/components/molecules/svg/DescribeProveDeploy.d.ts +7 -0
  56. package/dist/components/molecules/svg/DomainGrid.d.ts +7 -0
  57. package/dist/components/molecules/svg/EventBus.d.ts +7 -0
  58. package/dist/components/molecules/svg/OrbitalUnit.d.ts +7 -0
  59. package/dist/components/molecules/svg/PlanVerifyRemember.d.ts +7 -0
  60. package/dist/components/molecules/svg/ProveCorrect.d.ts +7 -0
  61. package/dist/components/molecules/svg/ServiceLayers.d.ts +7 -0
  62. package/dist/components/molecules/svg/SharedReality.d.ts +7 -0
  63. package/dist/components/molecules/svg/StandardLibrary.d.ts +7 -0
  64. package/dist/components/molecules/svg/StateMachine.d.ts +7 -0
  65. package/dist/components/molecules/svg/WorldModel.d.ts +7 -0
  66. package/dist/components/molecules/svg/index.d.ts +16 -0
  67. package/dist/components/organisms/CaseStudyOrganism.d.ts +19 -0
  68. package/dist/components/organisms/FeatureGridOrganism.d.ts +20 -0
  69. package/dist/components/organisms/HeroOrganism.d.ts +18 -0
  70. package/dist/components/organisms/PricingOrganism.d.ts +19 -0
  71. package/dist/components/organisms/ShowcaseOrganism.d.ts +20 -0
  72. package/dist/components/organisms/StatsOrganism.d.ts +17 -0
  73. package/dist/components/organisms/StepFlowOrganism.d.ts +20 -0
  74. package/dist/components/organisms/TeamOrganism.d.ts +18 -0
  75. package/dist/components/organisms/game/three/index.cjs +2525 -0
  76. package/dist/components/organisms/game/three/index.js +1795 -50
  77. package/dist/components/organisms/index.d.ts +9 -0
  78. package/dist/components/organisms/marketing-types.d.ts +87 -0
  79. package/dist/components/templates/AboutPageTemplate.d.ts +26 -0
  80. package/dist/components/templates/FeatureDetailPageTemplate.d.ts +27 -0
  81. package/dist/components/templates/LandingPageTemplate.d.ts +31 -0
  82. package/dist/components/templates/PricingPageTemplate.d.ts +26 -0
  83. package/dist/components/templates/index.d.ts +4 -0
  84. package/dist/context/index.cjs +550 -0
  85. package/dist/context/index.js +420 -6
  86. package/dist/docs/index.cjs +4015 -0
  87. package/dist/docs/index.d.cts +412 -0
  88. package/dist/docs/index.d.ts +29 -0
  89. package/dist/docs/index.js +3977 -0
  90. package/dist/hooks/index.cjs +2606 -0
  91. package/dist/hooks/index.js +2535 -8
  92. package/dist/illustrations/index.cjs +3004 -0
  93. package/dist/illustrations/index.d.cts +261 -0
  94. package/dist/illustrations/index.d.ts +35 -0
  95. package/dist/illustrations/index.js +2971 -0
  96. package/dist/{chunk-XL7WB2O5.js → lib/index.cjs} +454 -274
  97. package/dist/lib/index.js +1407 -3
  98. package/dist/locales/index.cjs +340 -0
  99. package/dist/locales/index.js +105 -2
  100. package/dist/marketing/index.cjs +4683 -0
  101. package/dist/marketing/index.d.cts +831 -0
  102. package/dist/marketing/index.d.ts +62 -0
  103. package/dist/marketing/index.js +4626 -0
  104. package/dist/providers/index.cjs +4811 -0
  105. package/dist/providers/index.js +4765 -11
  106. package/dist/{chunk-K2D5D3WK.js → renderer/index.cjs} +101 -42
  107. package/dist/renderer/index.js +1036 -2
  108. package/dist/runtime/index.cjs +4400 -0
  109. package/dist/runtime/index.js +3615 -19
  110. package/dist/{chunk-N7MVUW4R.js → stores/index.cjs} +24 -1
  111. package/dist/stores/index.js +194 -2
  112. package/dist/tsup.config.d.ts +2 -1
  113. package/package.json +27 -12
  114. package/tailwind-preset.cjs +9 -0
  115. package/themes/index.css +22 -20
  116. package/dist/chunk-3HJHHULT.js +0 -93
  117. package/dist/chunk-3JGAROCW.js +0 -149
  118. package/dist/chunk-4N3BAPDB.js +0 -1667
  119. package/dist/chunk-CDIOHSKG.js +0 -661
  120. package/dist/chunk-DKQN5FVU.js +0 -279
  121. package/dist/chunk-JJHCOO34.js +0 -375
  122. package/dist/chunk-PKBMQBKP.js +0 -5
  123. package/dist/chunk-QIABKRCN.js +0 -107
  124. package/dist/chunk-SD3KVCY6.js +0 -1465
  125. package/dist/chunk-YXZM3WCF.js +0 -222
@@ -1,3 +1,5 @@
1
+ 'use strict';
2
+
1
3
  // stores/filtering.ts
2
4
  function getDateString(value) {
3
5
  if (!value) return null;
@@ -191,4 +193,25 @@ function getFilterSnapshot() {
191
193
  return filters;
192
194
  }
193
195
 
194
- export { applyFilters, clearAllFilters, clearEntities, clearFilter, createFilter, getAllEntities, getByType, getByTypeFiltered, getDateString, getEntities, getEntity, getFilterSnapshot, getFilters, getSingleton, getSnapshot, matchesFilter, removeEntity, setFilter, spawnEntity, subscribe, updateEntity, updateSingleton };
196
+ exports.applyFilters = applyFilters;
197
+ exports.clearAllFilters = clearAllFilters;
198
+ exports.clearEntities = clearEntities;
199
+ exports.clearFilter = clearFilter;
200
+ exports.createFilter = createFilter;
201
+ exports.getAllEntities = getAllEntities;
202
+ exports.getByType = getByType;
203
+ exports.getByTypeFiltered = getByTypeFiltered;
204
+ exports.getDateString = getDateString;
205
+ exports.getEntities = getEntities;
206
+ exports.getEntity = getEntity;
207
+ exports.getFilterSnapshot = getFilterSnapshot;
208
+ exports.getFilters = getFilters;
209
+ exports.getSingleton = getSingleton;
210
+ exports.getSnapshot = getSnapshot;
211
+ exports.matchesFilter = matchesFilter;
212
+ exports.removeEntity = removeEntity;
213
+ exports.setFilter = setFilter;
214
+ exports.spawnEntity = spawnEntity;
215
+ exports.subscribe = subscribe;
216
+ exports.updateEntity = updateEntity;
217
+ exports.updateSingleton = updateSingleton;
@@ -1,2 +1,194 @@
1
- export { applyFilters, clearAllFilters, clearEntities, clearFilter, createFilter, getAllEntities, getByType, getByTypeFiltered, getDateString, getEntities, getEntity, getFilterSnapshot, getFilters, getSingleton, getSnapshot, matchesFilter, removeEntity, setFilter, spawnEntity, subscribe, updateEntity, updateSingleton } from '../chunk-N7MVUW4R.js';
2
- import '../chunk-PKBMQBKP.js';
1
+ // stores/filtering.ts
2
+ function getDateString(value) {
3
+ if (!value) return null;
4
+ if (typeof value === "string") {
5
+ const match = value.match(/^(\d{4}-\d{2}-\d{2})/);
6
+ return match ? match[1] : null;
7
+ }
8
+ if (value instanceof Date) {
9
+ return value.toISOString().split("T")[0];
10
+ }
11
+ return null;
12
+ }
13
+ function matchesFilter(record, filter) {
14
+ const fieldToCompare = filter.targetField || filter.field;
15
+ const recordValue = record[fieldToCompare];
16
+ const filterValue = filter.value;
17
+ const operator = filter.operator || "eq";
18
+ if (filterValue === null || filterValue === void 0 || filterValue === "") {
19
+ return true;
20
+ }
21
+ switch (operator) {
22
+ case "eq":
23
+ if (typeof recordValue === "string" && typeof filterValue === "string") {
24
+ return recordValue.toLowerCase() === filterValue.toLowerCase();
25
+ }
26
+ return recordValue === filterValue;
27
+ case "contains":
28
+ if (typeof recordValue !== "string") return false;
29
+ return recordValue.toLowerCase().includes(String(filterValue).toLowerCase());
30
+ case "in":
31
+ if (Array.isArray(filterValue)) {
32
+ const normalizedFilterValues = filterValue.map(
33
+ (v) => typeof v === "string" ? v.toLowerCase() : v
34
+ );
35
+ const normalizedRecordValue = typeof recordValue === "string" ? recordValue.toLowerCase() : recordValue;
36
+ return normalizedFilterValues.includes(normalizedRecordValue);
37
+ }
38
+ return false;
39
+ case "date_eq": {
40
+ const recordDate = getDateString(recordValue);
41
+ const filterDate = getDateString(filterValue);
42
+ return Boolean(recordDate && filterDate && recordDate === filterDate);
43
+ }
44
+ case "date_gte": {
45
+ const recordDate = getDateString(recordValue);
46
+ const filterDate = getDateString(filterValue);
47
+ return Boolean(recordDate && filterDate && recordDate >= filterDate);
48
+ }
49
+ case "date_lte": {
50
+ const recordDate = getDateString(recordValue);
51
+ const filterDate = getDateString(filterValue);
52
+ return Boolean(recordDate && filterDate && recordDate <= filterDate);
53
+ }
54
+ case "search": {
55
+ if (typeof filterValue !== "string" || !filterValue.trim()) {
56
+ return true;
57
+ }
58
+ const searchTerm = filterValue.toLowerCase();
59
+ return Object.values(record).some((value) => {
60
+ if (value === null || value === void 0) return false;
61
+ return String(value).toLowerCase().includes(searchTerm);
62
+ });
63
+ }
64
+ default:
65
+ return true;
66
+ }
67
+ }
68
+ function applyFilters(records, entityFilters) {
69
+ if (entityFilters.size === 0) return records;
70
+ return records.filter((record) => {
71
+ for (const [, filter] of entityFilters) {
72
+ if (!matchesFilter(record, filter)) {
73
+ return false;
74
+ }
75
+ }
76
+ return true;
77
+ });
78
+ }
79
+ function createFilter(field, value, operator = "eq", targetField) {
80
+ return {
81
+ field,
82
+ value,
83
+ operator,
84
+ targetField: targetField || field
85
+ };
86
+ }
87
+
88
+ // stores/entityStore.ts
89
+ var entities = /* @__PURE__ */ new Map();
90
+ var filters = /* @__PURE__ */ new Map();
91
+ var listeners = /* @__PURE__ */ new Set();
92
+ var idCounter = 0;
93
+ function subscribe(listener) {
94
+ listeners.add(listener);
95
+ return () => listeners.delete(listener);
96
+ }
97
+ function notify() {
98
+ listeners.forEach((listener) => listener());
99
+ }
100
+ function getEntities() {
101
+ return entities;
102
+ }
103
+ function getEntity(id) {
104
+ return entities.get(id);
105
+ }
106
+ function getByType(type) {
107
+ const types = Array.isArray(type) ? type : [type];
108
+ return [...entities.values()].filter((e) => types.includes(e.type));
109
+ }
110
+ function getAllEntities() {
111
+ return [...entities.values()];
112
+ }
113
+ function getSingleton(type) {
114
+ return [...entities.values()].find((e) => e.type === type);
115
+ }
116
+ function spawnEntity(config) {
117
+ const id = config.id ?? `entity_${++idCounter}`;
118
+ const entity = { ...config, id };
119
+ entities = new Map(entities);
120
+ entities.set(id, entity);
121
+ notify();
122
+ return id;
123
+ }
124
+ function updateEntity(id, updates) {
125
+ const entity = entities.get(id);
126
+ if (entity) {
127
+ entities = new Map(entities);
128
+ entities.set(id, { ...entity, ...updates });
129
+ notify();
130
+ }
131
+ }
132
+ function updateSingleton(type, updates) {
133
+ const entity = getSingleton(type);
134
+ if (entity) {
135
+ updateEntity(entity.id, updates);
136
+ }
137
+ }
138
+ function removeEntity(id) {
139
+ if (entities.has(id)) {
140
+ entities = new Map(entities);
141
+ entities.delete(id);
142
+ notify();
143
+ }
144
+ }
145
+ function clearEntities() {
146
+ entities = /* @__PURE__ */ new Map();
147
+ notify();
148
+ }
149
+ function setFilter(entityType, field, value, operator = "eq", targetField) {
150
+ filters = new Map(filters);
151
+ const entityFilters = new Map(filters.get(entityType) || []);
152
+ entityFilters.set(field, createFilter(field, value, operator, targetField));
153
+ filters.set(entityType, entityFilters);
154
+ notify();
155
+ }
156
+ function clearFilter(entityType, field) {
157
+ const entityFilters = filters.get(entityType);
158
+ if (entityFilters && entityFilters.has(field)) {
159
+ filters = new Map(filters);
160
+ const newFilters = new Map(entityFilters);
161
+ newFilters.delete(field);
162
+ filters.set(entityType, newFilters);
163
+ notify();
164
+ }
165
+ }
166
+ function clearAllFilters(entityType) {
167
+ if (filters.has(entityType)) {
168
+ filters = new Map(filters);
169
+ filters.set(entityType, /* @__PURE__ */ new Map());
170
+ notify();
171
+ }
172
+ }
173
+ function getFilters(entityType) {
174
+ return filters.get(entityType) || /* @__PURE__ */ new Map();
175
+ }
176
+ function getByTypeFiltered(type) {
177
+ const types = Array.isArray(type) ? type : [type];
178
+ let result = [...entities.values()].filter((e) => types.includes(e.type));
179
+ for (const t of types) {
180
+ const typeFilters = filters.get(t);
181
+ if (typeFilters && typeFilters.size > 0) {
182
+ result = applyFilters(result, typeFilters);
183
+ }
184
+ }
185
+ return result;
186
+ }
187
+ function getSnapshot() {
188
+ return entities;
189
+ }
190
+ function getFilterSnapshot() {
191
+ return filters;
192
+ }
193
+
194
+ export { applyFilters, clearAllFilters, clearEntities, clearFilter, createFilter, getAllEntities, getByType, getByTypeFiltered, getDateString, getEntities, getEntity, getFilterSnapshot, getFilters, getSingleton, getSnapshot, matchesFilter, removeEntity, setFilter, spawnEntity, subscribe, updateEntity, updateSingleton };
@@ -1,2 +1,3 @@
1
- declare const _default: import("tsup").Options | import("tsup").Options[] | ((overrideOptions: import("tsup").Options) => import("tsup").Options | import("tsup").Options[] | Promise<import("tsup").Options | import("tsup").Options[]>);
1
+ import { type Options } from 'tsup';
2
+ declare const _default: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
2
3
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "2.15.8",
3
+ "version": "2.15.10",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",
@@ -10,52 +10,52 @@
10
10
  ".": {
11
11
  "types": "./dist/components/index.d.ts",
12
12
  "import": "./dist/components/index.js",
13
- "require": "./dist/components/index.js"
13
+ "require": "./dist/components/index.cjs"
14
14
  },
15
15
  "./components": {
16
16
  "types": "./dist/components/index.d.ts",
17
17
  "import": "./dist/components/index.js",
18
- "require": "./dist/components/index.js"
18
+ "require": "./dist/components/index.cjs"
19
19
  },
20
20
  "./hooks": {
21
21
  "types": "./dist/hooks/index.d.ts",
22
22
  "import": "./dist/hooks/index.js",
23
- "require": "./dist/hooks/index.js"
23
+ "require": "./dist/hooks/index.cjs"
24
24
  },
25
25
  "./providers": {
26
26
  "types": "./dist/providers/index.d.ts",
27
27
  "import": "./dist/providers/index.js",
28
- "require": "./dist/providers/index.js"
28
+ "require": "./dist/providers/index.cjs"
29
29
  },
30
30
  "./context": {
31
31
  "types": "./dist/context/index.d.ts",
32
32
  "import": "./dist/context/index.js",
33
- "require": "./dist/context/index.js"
33
+ "require": "./dist/context/index.cjs"
34
34
  },
35
35
  "./renderer": {
36
36
  "types": "./dist/renderer/index.d.ts",
37
37
  "import": "./dist/renderer/index.js",
38
- "require": "./dist/renderer/index.js"
38
+ "require": "./dist/renderer/index.cjs"
39
39
  },
40
40
  "./runtime": {
41
41
  "types": "./dist/runtime/index.d.ts",
42
42
  "import": "./dist/runtime/index.js",
43
- "require": "./dist/runtime/index.js"
43
+ "require": "./dist/runtime/index.cjs"
44
44
  },
45
45
  "./stores": {
46
46
  "types": "./dist/stores/index.d.ts",
47
47
  "import": "./dist/stores/index.js",
48
- "require": "./dist/stores/index.js"
48
+ "require": "./dist/stores/index.cjs"
49
49
  },
50
50
  "./lib": {
51
51
  "types": "./dist/lib/index.d.ts",
52
52
  "import": "./dist/lib/index.js",
53
- "require": "./dist/lib/index.js"
53
+ "require": "./dist/lib/index.cjs"
54
54
  },
55
55
  "./components/organisms/game/three": {
56
56
  "types": "./dist/components/organisms/game/three/index.d.ts",
57
57
  "import": "./dist/components/organisms/game/three/index.js",
58
- "require": "./dist/components/organisms/game/three/index.js"
58
+ "require": "./dist/components/organisms/game/three/index.cjs"
59
59
  },
60
60
  "./components/organisms/game/TraitStateViewer": {
61
61
  "import": "./components/organisms/game/TraitStateViewer.tsx",
@@ -69,11 +69,26 @@
69
69
  "import": "./templates/index.ts",
70
70
  "types": "./templates/index.ts"
71
71
  },
72
+ "./marketing": {
73
+ "types": "./dist/marketing/index.d.ts",
74
+ "import": "./dist/marketing/index.js",
75
+ "require": "./dist/marketing/index.cjs"
76
+ },
77
+ "./docs": {
78
+ "types": "./dist/docs/index.d.ts",
79
+ "import": "./dist/docs/index.js",
80
+ "require": "./dist/docs/index.cjs"
81
+ },
82
+ "./illustrations": {
83
+ "types": "./dist/illustrations/index.d.ts",
84
+ "import": "./dist/illustrations/index.js",
85
+ "require": "./dist/illustrations/index.cjs"
86
+ },
72
87
  "./themes/*.css": "./themes/*.css",
73
88
  "./locales": {
74
89
  "types": "./dist/locales/index.d.ts",
75
90
  "import": "./dist/locales/index.js",
76
- "require": "./dist/locales/index.js"
91
+ "require": "./dist/locales/index.cjs"
77
92
  },
78
93
  "./locales/en.json": "./locales/en.json",
79
94
  "./locales/ar.json": "./locales/ar.json",
@@ -177,6 +177,15 @@ module.exports = {
177
177
  'text-[var(--color-warning)]',
178
178
  'text-[var(--color-warning-foreground)]',
179
179
  'to-[var(--color-accent)]',
180
+ // Hover elevation & micro-interactions
181
+ 'hover:-translate-y-0.5',
182
+ 'hover:-translate-y-1',
183
+ 'hover:scale-105',
184
+ 'scale-[1.05]',
185
+ 'transition-all',
186
+ 'duration-200',
187
+ 'ring-2',
188
+ 'ring-[var(--color-primary)]',
180
189
  ],
181
190
  theme: {
182
191
  fontFamily: {
package/themes/index.css CHANGED
@@ -4,8 +4,30 @@
4
4
  * Each theme provides both light and dark modes via:
5
5
  * [data-theme="themename-light"] { ... }
6
6
  * [data-theme="themename-dark"] { ... }
7
+ *
8
+ * IMPORTANT: @import must precede all other statements (Vite requirement).
7
9
  */
8
10
 
11
+ /* Core themes */
12
+ @import "./wireframe.css";
13
+ @import "./minimalist.css";
14
+ @import "./almadar.css";
15
+ @import "./trait-wars.css";
16
+
17
+ /* Extended themes */
18
+ @import "./ocean.css";
19
+ @import "./forest.css";
20
+ @import "./sunset.css";
21
+ @import "./lavender.css";
22
+ @import "./rose.css";
23
+ @import "./slate.css";
24
+ @import "./ember.css";
25
+ @import "./midnight.css";
26
+ @import "./sand.css";
27
+ @import "./neon.css";
28
+ @import "./arctic.css";
29
+ @import "./copper.css";
30
+
9
31
  /**
10
32
  * Minimal element reset for @almadar/ui components.
11
33
  *
@@ -56,23 +78,3 @@
56
78
  #ui-slot-portal-root h6 {
57
79
  font-family: var(--font-family, inherit);
58
80
  }
59
-
60
- /* Core themes */
61
- @import "./wireframe.css";
62
- @import "./minimalist.css";
63
- @import "./almadar.css";
64
- @import "./trait-wars.css";
65
-
66
- /* Extended themes */
67
- @import "./ocean.css";
68
- @import "./forest.css";
69
- @import "./sunset.css";
70
- @import "./lavender.css";
71
- @import "./rose.css";
72
- @import "./slate.css";
73
- @import "./ember.css";
74
- @import "./midnight.css";
75
- @import "./sand.css";
76
- @import "./neon.css";
77
- @import "./arctic.css";
78
- @import "./copper.css";
@@ -1,93 +0,0 @@
1
- // lib/api-client.ts
2
- var API_BASE_URL = typeof process !== "undefined" && process.env?.VITE_API_URL ? process.env.VITE_API_URL : "/api";
3
- var ApiError = class extends Error {
4
- constructor(status, statusText, message) {
5
- super(message || `API Error: ${status} ${statusText}`);
6
- this.status = status;
7
- this.statusText = statusText;
8
- this.name = "ApiError";
9
- }
10
- };
11
- async function handleResponse(response) {
12
- if (!response.ok) {
13
- let message;
14
- try {
15
- const errorData = await response.json();
16
- message = errorData.message || errorData.error;
17
- } catch {
18
- }
19
- throw new ApiError(response.status, response.statusText, message);
20
- }
21
- const text = await response.text();
22
- if (!text) {
23
- return void 0;
24
- }
25
- return JSON.parse(text);
26
- }
27
- function getHeaders() {
28
- const headers = {
29
- "Content-Type": "application/json"
30
- };
31
- const token = typeof localStorage !== "undefined" ? localStorage.getItem("authToken") : null;
32
- if (token) {
33
- headers["Authorization"] = `Bearer ${token}`;
34
- }
35
- return headers;
36
- }
37
- var apiClient = {
38
- /**
39
- * GET request
40
- */
41
- async get(endpoint) {
42
- const response = await fetch(`${API_BASE_URL}${endpoint}`, {
43
- method: "GET",
44
- headers: getHeaders()
45
- });
46
- return handleResponse(response);
47
- },
48
- /**
49
- * POST request
50
- */
51
- async post(endpoint, data) {
52
- const response = await fetch(`${API_BASE_URL}${endpoint}`, {
53
- method: "POST",
54
- headers: getHeaders(),
55
- body: data ? JSON.stringify(data) : void 0
56
- });
57
- return handleResponse(response);
58
- },
59
- /**
60
- * PUT request
61
- */
62
- async put(endpoint, data) {
63
- const response = await fetch(`${API_BASE_URL}${endpoint}`, {
64
- method: "PUT",
65
- headers: getHeaders(),
66
- body: data ? JSON.stringify(data) : void 0
67
- });
68
- return handleResponse(response);
69
- },
70
- /**
71
- * PATCH request
72
- */
73
- async patch(endpoint, data) {
74
- const response = await fetch(`${API_BASE_URL}${endpoint}`, {
75
- method: "PATCH",
76
- headers: getHeaders(),
77
- body: data ? JSON.stringify(data) : void 0
78
- });
79
- return handleResponse(response);
80
- },
81
- /**
82
- * DELETE request
83
- */
84
- async delete(endpoint) {
85
- const response = await fetch(`${API_BASE_URL}${endpoint}`, {
86
- method: "DELETE",
87
- headers: getHeaders()
88
- });
89
- return handleResponse(response);
90
- }
91
- };
92
-
93
- export { ApiError, apiClient };
@@ -1,149 +0,0 @@
1
- import { useState, useRef, useEffect, useCallback } from 'react';
2
-
3
- // hooks/useUISlots.ts
4
- var DEFAULT_SLOTS = {
5
- main: null,
6
- sidebar: null,
7
- modal: null,
8
- drawer: null,
9
- overlay: null,
10
- center: null,
11
- toast: null,
12
- "hud-top": null,
13
- "hud-bottom": null,
14
- "hud-left": null,
15
- "hud-right": null,
16
- floating: null
17
- };
18
- var idCounter = 0;
19
- function generateId() {
20
- return `slot-content-${++idCounter}-${Date.now()}`;
21
- }
22
- function useUISlotManager() {
23
- const [slots, setSlots] = useState(DEFAULT_SLOTS);
24
- const subscribersRef = useRef(/* @__PURE__ */ new Set());
25
- const timersRef = useRef(/* @__PURE__ */ new Map());
26
- useEffect(() => {
27
- return () => {
28
- timersRef.current.forEach((timer) => clearTimeout(timer));
29
- timersRef.current.clear();
30
- };
31
- }, []);
32
- const notifySubscribers = useCallback((slot, content) => {
33
- subscribersRef.current.forEach((callback) => {
34
- try {
35
- callback(slot, content);
36
- } catch (error) {
37
- console.error("[UISlots] Subscriber error:", error);
38
- }
39
- });
40
- }, []);
41
- const render = useCallback((config) => {
42
- const id = generateId();
43
- const content = {
44
- id,
45
- pattern: config.pattern,
46
- props: config.props ?? {},
47
- priority: config.priority ?? 0,
48
- animation: config.animation ?? "fade",
49
- onDismiss: config.onDismiss,
50
- sourceTrait: config.sourceTrait
51
- };
52
- if (config.autoDismissMs && config.autoDismissMs > 0) {
53
- content.autoDismissAt = Date.now() + config.autoDismissMs;
54
- const timer = setTimeout(() => {
55
- setSlots((prev) => {
56
- if (prev[config.target]?.id === id) {
57
- content.onDismiss?.();
58
- notifySubscribers(config.target, null);
59
- return { ...prev, [config.target]: null };
60
- }
61
- return prev;
62
- });
63
- timersRef.current.delete(id);
64
- }, config.autoDismissMs);
65
- timersRef.current.set(id, timer);
66
- }
67
- setSlots((prev) => {
68
- const existing = prev[config.target];
69
- if (existing && existing.priority > content.priority) {
70
- console.warn(
71
- `[UISlots] Slot "${config.target}" already has higher priority content (${existing.priority} > ${content.priority})`
72
- );
73
- return prev;
74
- }
75
- notifySubscribers(config.target, content);
76
- return { ...prev, [config.target]: content };
77
- });
78
- return id;
79
- }, [notifySubscribers]);
80
- const clear = useCallback((slot) => {
81
- setSlots((prev) => {
82
- const content = prev[slot];
83
- if (content) {
84
- const timer = timersRef.current.get(content.id);
85
- if (timer) {
86
- clearTimeout(timer);
87
- timersRef.current.delete(content.id);
88
- }
89
- content.onDismiss?.();
90
- notifySubscribers(slot, null);
91
- }
92
- return { ...prev, [slot]: null };
93
- });
94
- }, [notifySubscribers]);
95
- const clearById = useCallback((id) => {
96
- setSlots((prev) => {
97
- const entry = Object.entries(prev).find(([, content]) => content?.id === id);
98
- if (entry) {
99
- const [slot, content] = entry;
100
- const timer = timersRef.current.get(id);
101
- if (timer) {
102
- clearTimeout(timer);
103
- timersRef.current.delete(id);
104
- }
105
- content.onDismiss?.();
106
- notifySubscribers(slot, null);
107
- return { ...prev, [slot]: null };
108
- }
109
- return prev;
110
- });
111
- }, [notifySubscribers]);
112
- const clearAll = useCallback(() => {
113
- timersRef.current.forEach((timer) => clearTimeout(timer));
114
- timersRef.current.clear();
115
- setSlots((prev) => {
116
- Object.entries(prev).forEach(([slot, content]) => {
117
- if (content) {
118
- content.onDismiss?.();
119
- notifySubscribers(slot, null);
120
- }
121
- });
122
- return DEFAULT_SLOTS;
123
- });
124
- }, [notifySubscribers]);
125
- const subscribe = useCallback((callback) => {
126
- subscribersRef.current.add(callback);
127
- return () => {
128
- subscribersRef.current.delete(callback);
129
- };
130
- }, []);
131
- const hasContent = useCallback((slot) => {
132
- return slots[slot] !== null;
133
- }, [slots]);
134
- const getContent = useCallback((slot) => {
135
- return slots[slot];
136
- }, [slots]);
137
- return {
138
- slots,
139
- render,
140
- clear,
141
- clearById,
142
- clearAll,
143
- subscribe,
144
- hasContent,
145
- getContent
146
- };
147
- }
148
-
149
- export { DEFAULT_SLOTS, useUISlotManager };