shru-design-system 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shru-design-system",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "A React component library with atoms and molecules built on Radix UI and Tailwind CSS",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -88,26 +88,26 @@
88
88
  function loadJSONSync(relativePath, bases) {
89
89
  for (var i = 0; i < bases.length; i++) {
90
90
  var base = bases[i];
91
- try {
91
+ try {
92
92
  var url = base.endsWith('/') ? base + relativePath : base + '/' + relativePath;
93
- var xhr = new XMLHttpRequest();
93
+ var xhr = new XMLHttpRequest();
94
94
  xhr.open('GET', url, false);
95
- xhr.send(null);
96
-
95
+ xhr.send(null);
96
+
97
97
  // 404 means file doesn't exist - try next base
98
- if (xhr.status === 404) {
98
+ if (xhr.status === 404) {
99
99
  continue;
100
+ }
101
+
102
+ if (xhr.status === 200 || xhr.status === 0) {
103
+ var contentType = xhr.getResponseHeader('content-type');
104
+ // Check if response is actually JSON (not HTML error page)
105
+ if (contentType && contentType.includes('application/json')) {
106
+ return JSON.parse(xhr.responseText);
100
107
  }
101
-
102
- if (xhr.status === 200 || xhr.status === 0) {
103
- var contentType = xhr.getResponseHeader('content-type');
104
- // Check if response is actually JSON (not HTML error page)
105
- if (contentType && contentType.includes('application/json')) {
106
- return JSON.parse(xhr.responseText);
107
- }
108
108
  // If not JSON (likely HTML error page), try next base
109
109
  continue;
110
- }
110
+ }
111
111
  } catch (e) {
112
112
  // Try next base
113
113
  }