ssovee-os-web-ui 0.1.46 → 0.1.48

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/index.cjs CHANGED
@@ -3206,12 +3206,40 @@ var useGridClasses = (windowSize, gridRules) => {
3206
3206
  if (windowSize.width <= 640) return "mobile";
3207
3207
  if (windowSize.width <= 1024) return "tablet";
3208
3208
  return "desktop";
3209
- }, [windowSize]);
3209
+ }, [windowSize.width]);
3210
3210
  const gridClasses = React22.useMemo(() => {
3211
3211
  const classes = {};
3212
+ const resolveSpan = (classRules) => {
3213
+ const directRules = classRules["col-span"] ?? classRules.colSpan ?? classRules.span;
3214
+ const normalizedRules = directRules ?? classRules;
3215
+ const fallbackByDevice = {
3216
+ mobile: ["mobile", "tablet", "desktop"],
3217
+ tablet: ["tablet", "desktop", "mobile"],
3218
+ desktop: ["desktop", "tablet", "mobile"]
3219
+ };
3220
+ const aliasByDevice = {
3221
+ mobile: ["mobile", "sm"],
3222
+ tablet: ["tablet", "md"],
3223
+ desktop: ["desktop", "lg"]
3224
+ };
3225
+ const orderedDevices = fallbackByDevice[deviceType];
3226
+ for (const device of orderedDevices) {
3227
+ const aliases = aliasByDevice[device];
3228
+ for (const alias of aliases) {
3229
+ const candidate = normalizedRules?.[alias];
3230
+ if (typeof candidate === "number") {
3231
+ return String(candidate);
3232
+ }
3233
+ if (typeof candidate === "string" && candidate.trim() !== "") {
3234
+ return candidate;
3235
+ }
3236
+ }
3237
+ }
3238
+ return "12";
3239
+ };
3212
3240
  for (const element in gridRules) {
3213
3241
  const classRules = gridRules[element];
3214
- const colSpan = classRules["col-span"][deviceType];
3242
+ const colSpan = resolveSpan(classRules);
3215
3243
  classes[element] = `col-span-${deviceType}-${colSpan}`;
3216
3244
  }
3217
3245
  return classes;