@x-plat/design-system 0.5.17 → 0.5.19

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 (38) hide show
  1. package/dist/components/Chart/index.cjs +147 -27
  2. package/dist/components/Chart/index.css +74 -7
  3. package/dist/components/Chart/index.js +147 -27
  4. package/dist/components/Drawer/index.cjs +2 -4
  5. package/dist/components/Drawer/index.css +12 -0
  6. package/dist/components/Drawer/index.d.cts +2 -1
  7. package/dist/components/Drawer/index.d.ts +2 -1
  8. package/dist/components/Drawer/index.js +2 -4
  9. package/dist/components/Dropdown/index.cjs +2 -0
  10. package/dist/components/Dropdown/index.js +2 -0
  11. package/dist/components/PopOver/index.cjs +2 -0
  12. package/dist/components/PopOver/index.css +2 -1
  13. package/dist/components/PopOver/index.js +2 -0
  14. package/dist/components/Select/index.cjs +2 -0
  15. package/dist/components/Select/index.js +2 -0
  16. package/dist/components/Skeleton/index.cjs +3 -2
  17. package/dist/components/Skeleton/index.d.cts +3 -2
  18. package/dist/components/Skeleton/index.d.ts +3 -2
  19. package/dist/components/Skeleton/index.js +3 -2
  20. package/dist/components/index.cjs +154 -33
  21. package/dist/components/index.css +88 -8
  22. package/dist/components/index.js +154 -33
  23. package/dist/index.cjs +158 -49
  24. package/dist/index.css +88 -8
  25. package/dist/index.js +158 -49
  26. package/dist/layout/Grid/FullGrid/index.cjs +2 -8
  27. package/dist/layout/Grid/FullGrid/index.d.cts +2 -1
  28. package/dist/layout/Grid/FullGrid/index.d.ts +2 -1
  29. package/dist/layout/Grid/FullGrid/index.js +2 -8
  30. package/dist/layout/Grid/FullScreen/index.cjs +2 -8
  31. package/dist/layout/Grid/FullScreen/index.d.cts +2 -1
  32. package/dist/layout/Grid/FullScreen/index.d.ts +2 -1
  33. package/dist/layout/Grid/FullScreen/index.js +2 -8
  34. package/dist/layout/Grid/index.cjs +4 -16
  35. package/dist/layout/Grid/index.js +4 -16
  36. package/dist/layout/index.cjs +4 -16
  37. package/dist/layout/index.js +4 -16
  38. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6211,6 +6211,37 @@ var useChartSize = (ref) => {
6211
6211
  }, [ref]);
6212
6212
  return size;
6213
6213
  };
6214
+ var prefersReducedMotion = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
6215
+ var useChartAnimation = (containerRef, dataKey) => {
6216
+ const [animate, setAnimate] = React5.useState(false);
6217
+ const prevDataKey = React5.useRef(dataKey);
6218
+ const hasAnimated = React5.useRef(false);
6219
+ React5.useEffect(() => {
6220
+ if (prefersReducedMotion()) return;
6221
+ const el = containerRef.current;
6222
+ if (!el) return;
6223
+ const observer = new IntersectionObserver(
6224
+ ([entry]) => {
6225
+ if (entry.isIntersecting && !hasAnimated.current) {
6226
+ hasAnimated.current = true;
6227
+ setAnimate(true);
6228
+ }
6229
+ },
6230
+ { threshold: 0.1 }
6231
+ );
6232
+ observer.observe(el);
6233
+ return () => observer.disconnect();
6234
+ }, [containerRef]);
6235
+ React5.useEffect(() => {
6236
+ if (dataKey !== prevDataKey.current) {
6237
+ prevDataKey.current = dataKey;
6238
+ if (prefersReducedMotion()) return;
6239
+ setAnimate(false);
6240
+ requestAnimationFrame(() => setAnimate(true));
6241
+ }
6242
+ }, [dataKey]);
6243
+ return animate || prefersReducedMotion();
6244
+ };
6214
6245
  var useChartTooltip = (enabled) => {
6215
6246
  const [tooltip, setTooltip] = React5.useState({
6216
6247
  visible: false,
@@ -6276,7 +6307,7 @@ var AxisLabels = React5.memo(({ labels, count, chartW, height }) => {
6276
6307
  }) });
6277
6308
  });
6278
6309
  AxisLabels.displayName = "AxisLabels";
6279
- var LineChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
6310
+ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
6280
6311
  const entries = React5.useMemo(() => Object.entries(data), [data]);
6281
6312
  const maxVal = React5.useMemo(() => {
6282
6313
  const allValues = entries.flatMap(([, v]) => v);
@@ -6296,18 +6327,52 @@ var LineChart = React5.memo(({ data, labels, width, height, onHover, onMove, onL
6296
6327
  [entries, count, chartW, chartH, maxVal]
6297
6328
  );
6298
6329
  const showPoints = count <= 100;
6330
+ const lineRefs = React5.useRef([]);
6331
+ React5.useEffect(() => {
6332
+ if (!animate) return;
6333
+ lineRefs.current.forEach((el) => {
6334
+ if (!el) return;
6335
+ const len = el.getTotalLength();
6336
+ el.style.strokeDasharray = `${len}`;
6337
+ el.style.strokeDashoffset = `${len}`;
6338
+ requestAnimationFrame(() => {
6339
+ el.style.transition = "stroke-dashoffset 1200ms ease-out 200ms";
6340
+ el.style.strokeDashoffset = "0";
6341
+ });
6342
+ });
6343
+ }, [animate, seriesPoints]);
6299
6344
  return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
6300
6345
  /* @__PURE__ */ jsx305(GridLines, { width, height, chartH, maxVal }),
6301
6346
  /* @__PURE__ */ jsx305(AxisLabels, { labels, count, chartW, height }),
6302
6347
  entries.map(([key], di) => {
6303
6348
  const palette = getPalette(LINE_BAR_PALETTES, di, key);
6304
6349
  const color = palette[2];
6350
+ const areaColor = palette[0];
6305
6351
  const points = seriesPoints[di];
6352
+ const gradientId = `line-gradient-${di}`;
6353
+ const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
6354
+ const areaD = `M ${points[0].x},${points[0].y} ${points.map((p) => `L ${p.x},${p.y}`).join(" ")} L ${points[points.length - 1].x},${PADDING.top + chartH} L ${points[0].x},${PADDING.top + chartH} Z`;
6306
6355
  return /* @__PURE__ */ jsxs196("g", { children: [
6356
+ /* @__PURE__ */ jsx305("defs", { children: /* @__PURE__ */ jsxs196("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
6357
+ /* @__PURE__ */ jsx305("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
6358
+ /* @__PURE__ */ jsx305("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
6359
+ ] }) }),
6360
+ /* @__PURE__ */ jsx305(
6361
+ "path",
6362
+ {
6363
+ d: areaD,
6364
+ fill: `url(#${gradientId})`,
6365
+ className: "chart-area",
6366
+ style: animate ? { animationDelay: "600ms" } : { opacity: 1 }
6367
+ }
6368
+ ),
6307
6369
  /* @__PURE__ */ jsx305(
6308
6370
  "polyline",
6309
6371
  {
6310
- points: points.map((p) => `${p.x},${p.y}`).join(" "),
6372
+ ref: (el) => {
6373
+ lineRefs.current[di] = el;
6374
+ },
6375
+ points: polyPoints,
6311
6376
  fill: "none",
6312
6377
  stroke: color,
6313
6378
  strokeWidth: "2"
@@ -6332,7 +6397,7 @@ var LineChart = React5.memo(({ data, labels, width, height, onHover, onMove, onL
6332
6397
  ] });
6333
6398
  });
6334
6399
  LineChart.displayName = "LineChart";
6335
- var CurveChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
6400
+ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
6336
6401
  const entries = React5.useMemo(() => Object.entries(data), [data]);
6337
6402
  const maxVal = React5.useMemo(() => {
6338
6403
  const allValues = entries.flatMap(([, v]) => v);
@@ -6352,6 +6417,20 @@ var CurveChart = React5.memo(({ data, labels, width, height, onHover, onMove, on
6352
6417
  [entries, count, chartW, chartH, maxVal]
6353
6418
  );
6354
6419
  const showPoints = count <= 100;
6420
+ const lineRefs = React5.useRef([]);
6421
+ React5.useEffect(() => {
6422
+ if (!animate) return;
6423
+ lineRefs.current.forEach((el) => {
6424
+ if (!el) return;
6425
+ const len = el.getTotalLength();
6426
+ el.style.strokeDasharray = `${len}`;
6427
+ el.style.strokeDashoffset = `${len}`;
6428
+ requestAnimationFrame(() => {
6429
+ el.style.transition = "stroke-dashoffset 1200ms ease-out 200ms";
6430
+ el.style.strokeDashoffset = "0";
6431
+ });
6432
+ });
6433
+ }, [animate, seriesPoints]);
6355
6434
  return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
6356
6435
  /* @__PURE__ */ jsx305(GridLines, { width, height, chartH, maxVal }),
6357
6436
  /* @__PURE__ */ jsx305(AxisLabels, { labels, count, chartW, height }),
@@ -6368,8 +6447,27 @@ var CurveChart = React5.memo(({ data, labels, width, height, onHover, onMove, on
6368
6447
  /* @__PURE__ */ jsx305("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
6369
6448
  /* @__PURE__ */ jsx305("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
6370
6449
  ] }) }),
6371
- /* @__PURE__ */ jsx305("path", { d: areaPath, fill: `url(#${gradientId})` }),
6372
- /* @__PURE__ */ jsx305("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" }),
6450
+ /* @__PURE__ */ jsx305(
6451
+ "path",
6452
+ {
6453
+ d: areaPath,
6454
+ fill: `url(#${gradientId})`,
6455
+ className: "chart-area",
6456
+ style: animate ? { animationDelay: "600ms" } : { opacity: 1 }
6457
+ }
6458
+ ),
6459
+ /* @__PURE__ */ jsx305(
6460
+ "path",
6461
+ {
6462
+ ref: (el) => {
6463
+ lineRefs.current[di] = el;
6464
+ },
6465
+ d: linePath,
6466
+ fill: "none",
6467
+ stroke: color,
6468
+ strokeWidth: "2"
6469
+ }
6470
+ ),
6373
6471
  showPoints && points.map((p, i) => /* @__PURE__ */ jsx305(
6374
6472
  "circle",
6375
6473
  {
@@ -6389,7 +6487,7 @@ var CurveChart = React5.memo(({ data, labels, width, height, onHover, onMove, on
6389
6487
  ] });
6390
6488
  });
6391
6489
  CurveChart.displayName = "CurveChart";
6392
- var BarChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
6490
+ var BarChart = React5.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
6393
6491
  const entries = React5.useMemo(() => Object.entries(data), [data]);
6394
6492
  const maxVal = React5.useMemo(() => {
6395
6493
  const allValues = entries.flatMap(([, v]) => v);
@@ -6402,6 +6500,7 @@ var BarChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLe
6402
6500
  const groupW = chartW / count;
6403
6501
  const barGap = groupCount > 1 ? 2 : 0;
6404
6502
  const barW = Math.max(1, Math.min(32, (groupW * 0.7 - barGap * (groupCount - 1)) / groupCount));
6503
+ const baseline = PADDING.top + chartH;
6405
6504
  const bars = React5.useMemo(
6406
6505
  () => entries.map(
6407
6506
  ([, values], di) => values.map((v, i) => {
@@ -6427,12 +6526,17 @@ var BarChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLe
6427
6526
  return bars[di].map((b, i) => {
6428
6527
  const r2 = Math.min(4, b.w / 2);
6429
6528
  const d = b.h <= r2 ? `M ${b.x} ${b.y + b.h} V ${b.y} H ${b.x + b.w} V ${b.y + b.h} Z` : `M ${b.x} ${b.y + b.h} V ${b.y + r2} Q ${b.x} ${b.y} ${b.x + r2} ${b.y} H ${b.x + b.w - r2} Q ${b.x + b.w} ${b.y} ${b.x + b.w} ${b.y + r2} V ${b.y + b.h} Z`;
6529
+ const delay = 100 + i * 80;
6430
6530
  return /* @__PURE__ */ jsx305(
6431
6531
  "path",
6432
6532
  {
6433
6533
  d,
6434
6534
  fill: color,
6435
- className: "chart-bar",
6535
+ className: `chart-bar ${animate ? "chart-bar-animate" : ""}`,
6536
+ style: animate ? {
6537
+ transformOrigin: `${b.x + b.w / 2}px ${baseline}px`,
6538
+ animationDelay: `${delay}ms`
6539
+ } : void 0,
6436
6540
  onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${b.v}`),
6437
6541
  onMouseMove: onMove,
6438
6542
  onMouseLeave: onLeave
@@ -6445,7 +6549,7 @@ var BarChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLe
6445
6549
  });
6446
6550
  BarChart.displayName = "BarChart";
6447
6551
  var PieDonutChart = React5.memo(
6448
- ({ data, labels, width, height, isDoughnut, onHover, onMove, onLeave }) => {
6552
+ ({ data, labels, width, height, animate, isDoughnut, onHover, onMove, onLeave }) => {
6449
6553
  const entries = React5.useMemo(() => Object.entries(data), [data]);
6450
6554
  const values = React5.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
6451
6555
  const total = React5.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
@@ -6485,20 +6589,34 @@ var PieDonutChart = React5.memo(
6485
6589
  return { d, lx, ly, v, pct, angle, label: labels[i] || `${i + 1}` };
6486
6590
  });
6487
6591
  }, [values, total, cx, cy, r2, innerR, labels]);
6488
- return /* @__PURE__ */ jsx305("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: sliceData.map((s, i) => /* @__PURE__ */ jsxs196("g", { children: [
6489
- /* @__PURE__ */ jsx305(
6490
- "path",
6491
- {
6492
- d: s.d,
6493
- fill: PIE_COLORS[(i + colorOffset) % PIE_COLORS.length],
6494
- className: "chart-slice",
6495
- onMouseEnter: (e) => onHover(e, `${s.label}: ${s.v} (${s.pct}%)`),
6496
- onMouseMove: onMove,
6497
- onMouseLeave: onLeave
6498
- }
6499
- ),
6500
- s.angle > 0.2 && /* @__PURE__ */ jsx305("text", { x: s.lx, y: s.ly, className: "chart-pie-label", textAnchor: "middle", dominantBaseline: "central", children: s.v })
6501
- ] }, i)) });
6592
+ return /* @__PURE__ */ jsx305("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: sliceData.map((s, i) => {
6593
+ const delay = i * 100;
6594
+ return /* @__PURE__ */ jsxs196("g", { className: animate ? "chart-slice-group-animate" : "", style: animate ? { animationDelay: `${delay}ms` } : void 0, children: [
6595
+ /* @__PURE__ */ jsx305(
6596
+ "path",
6597
+ {
6598
+ d: s.d,
6599
+ fill: PIE_COLORS[(i + colorOffset) % PIE_COLORS.length],
6600
+ className: "chart-slice",
6601
+ onMouseEnter: (e) => onHover(e, `${s.label}: ${s.v} (${s.pct}%)`),
6602
+ onMouseMove: onMove,
6603
+ onMouseLeave: onLeave
6604
+ }
6605
+ ),
6606
+ s.angle > 0.2 && /* @__PURE__ */ jsx305(
6607
+ "text",
6608
+ {
6609
+ x: s.lx,
6610
+ y: s.ly,
6611
+ className: `chart-pie-label ${animate ? "chart-pie-label-animate" : ""}`,
6612
+ style: animate ? { animationDelay: `${delay + 150}ms` } : void 0,
6613
+ textAnchor: "middle",
6614
+ dominantBaseline: "central",
6615
+ children: s.v
6616
+ }
6617
+ )
6618
+ ] }, i);
6619
+ }) });
6502
6620
  }
6503
6621
  );
6504
6622
  PieDonutChart.displayName = "PieDonutChart";
@@ -6532,13 +6650,15 @@ var Chart = React5.memo((props) => {
6532
6650
  const { width, height } = useChartSize(containerRef);
6533
6651
  const stableData = React5.useMemo(() => data, [JSON.stringify(data)]);
6534
6652
  const stableLabels = React5.useMemo(() => labels, [JSON.stringify(labels)]);
6653
+ const dataKey = React5.useMemo(() => JSON.stringify(labels), [labels]);
6654
+ const animate = useChartAnimation(containerRef, dataKey);
6535
6655
  const ready = width > 0 && height > 0;
6536
6656
  return /* @__PURE__ */ jsxs196("div", { className: "lib-xplat-chart", ref: containerRef, children: [
6537
- ready && type === "line" && /* @__PURE__ */ jsx305(LineChart, { data: stableData, labels: stableLabels, width, height, onHover: show, onMove: move, onLeave: hide }),
6538
- ready && type === "curve" && /* @__PURE__ */ jsx305(CurveChart, { data: stableData, labels: stableLabels, width, height, onHover: show, onMove: move, onLeave: hide }),
6539
- ready && type === "bar" && /* @__PURE__ */ jsx305(BarChart, { data: stableData, labels: stableLabels, width, height, onHover: show, onMove: move, onLeave: hide }),
6540
- ready && type === "pie" && /* @__PURE__ */ jsx305(PieDonutChart, { data: stableData, labels: stableLabels, width, height, onHover: show, onMove: move, onLeave: hide }),
6541
- ready && type === "doughnut" && /* @__PURE__ */ jsx305(PieDonutChart, { data: stableData, labels: stableLabels, width, height, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
6657
+ ready && type === "line" && /* @__PURE__ */ jsx305(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
6658
+ ready && type === "curve" && /* @__PURE__ */ jsx305(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
6659
+ ready && type === "bar" && /* @__PURE__ */ jsx305(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
6660
+ ready && type === "pie" && /* @__PURE__ */ jsx305(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
6661
+ ready && type === "doughnut" && /* @__PURE__ */ jsx305(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
6542
6662
  tooltip.visible && /* @__PURE__ */ jsx305(TooltipBubble, { x: tooltip.x, y: tooltip.y, containerWidth: width, children: tooltip.content })
6543
6663
  ] });
6544
6664
  });
@@ -7363,7 +7483,7 @@ import { createPortal as createPortal2 } from "react-dom";
7363
7483
  import { jsx as jsx320, jsxs as jsxs205 } from "react/jsx-runtime";
7364
7484
  var ANIMATION_DURATION_MS2 = 250;
7365
7485
  var Drawer = (props) => {
7366
- const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
7486
+ const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
7367
7487
  const [mounted, setMounted] = React16.useState(false);
7368
7488
  const [visible, setVisible] = React16.useState(false);
7369
7489
  React16.useEffect(() => {
@@ -7379,7 +7499,6 @@ var Drawer = (props) => {
7379
7499
  if (typeof document === "undefined") return null;
7380
7500
  if (!mounted) return null;
7381
7501
  const stateClass = visible ? "enter" : "exit";
7382
- const widthValue = typeof width === "number" ? `${width}px` : width;
7383
7502
  return createPortal2(
7384
7503
  /* @__PURE__ */ jsx320(
7385
7504
  "div",
@@ -7389,8 +7508,7 @@ var Drawer = (props) => {
7389
7508
  children: /* @__PURE__ */ jsxs205(
7390
7509
  "div",
7391
7510
  {
7392
- className: clsx_default("lib-xplat-drawer", placement, stateClass),
7393
- style: { width: widthValue },
7511
+ className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
7394
7512
  role: "dialog",
7395
7513
  "aria-modal": "true",
7396
7514
  onClick: (e) => e.stopPropagation(),
@@ -7450,6 +7568,8 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
7450
7568
  React17.useLayoutEffect(() => {
7451
7569
  if (!enabled) return;
7452
7570
  calculatePosition();
7571
+ const raf = requestAnimationFrame(calculatePosition);
7572
+ return () => cancelAnimationFrame(raf);
7453
7573
  }, [calculatePosition, enabled]);
7454
7574
  React17.useEffect(() => {
7455
7575
  if (!enabled) return;
@@ -8266,11 +8386,12 @@ var Select_default = Select;
8266
8386
 
8267
8387
  // src/components/Skeleton/Skeleton.tsx
8268
8388
  import { jsx as jsx333 } from "react/jsx-runtime";
8389
+ var toSizeVar = (token) => token === "full" ? "100%" : `var(--spacing-size-${token})`;
8269
8390
  var Skeleton = (props) => {
8270
8391
  const { variant = "text", width, height } = props;
8271
8392
  const style = {
8272
- width: typeof width === "number" ? `${width}px` : width,
8273
- height: typeof height === "number" ? `${height}px` : height
8393
+ ...width != null && { width: toSizeVar(width) },
8394
+ ...height != null && { height: toSizeVar(height) }
8274
8395
  };
8275
8396
  return /* @__PURE__ */ jsx333(
8276
8397
  "div",
@@ -9415,14 +9536,8 @@ var Video_default = Video;
9415
9536
  import { jsx as jsx348 } from "react/jsx-runtime";
9416
9537
  var FullGrid = (props) => {
9417
9538
  const { children, gap } = props;
9418
- return /* @__PURE__ */ jsx348(
9419
- "div",
9420
- {
9421
- className: "lib-xplat-full-grid",
9422
- style: gap ? { gap } : void 0,
9423
- children
9424
- }
9425
- );
9539
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
9540
+ return /* @__PURE__ */ jsx348("div", { className: "lib-xplat-full-grid", style, children });
9426
9541
  };
9427
9542
  FullGrid.displayName = "FullGrid";
9428
9543
  var FullGrid_default = FullGrid;
@@ -9431,14 +9546,8 @@ var FullGrid_default = FullGrid;
9431
9546
  import { jsx as jsx349 } from "react/jsx-runtime";
9432
9547
  var FullScreen = (props) => {
9433
9548
  const { children, gap } = props;
9434
- return /* @__PURE__ */ jsx349(
9435
- "div",
9436
- {
9437
- className: "lib-xplat-full-screen",
9438
- style: gap ? { gap } : void 0,
9439
- children
9440
- }
9441
- );
9549
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
9550
+ return /* @__PURE__ */ jsx349("div", { className: "lib-xplat-full-screen", style, children });
9442
9551
  };
9443
9552
  FullScreen.displayName = "FullScreen";
9444
9553
  var FullScreen_default = FullScreen;
@@ -28,14 +28,8 @@ module.exports = __toCommonJS(FullGrid_exports);
28
28
  var import_jsx_runtime = require("react/jsx-runtime");
29
29
  var FullGrid = (props) => {
30
30
  const { children, gap } = props;
31
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
32
- "div",
33
- {
34
- className: "lib-xplat-full-grid",
35
- style: gap ? { gap } : void 0,
36
- children
37
- }
38
- );
31
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
32
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "lib-xplat-full-grid", style, children });
39
33
  };
40
34
  FullGrid.displayName = "FullGrid";
41
35
  var FullGrid_default = FullGrid;
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
 
3
+ type SpaceToken = "none" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16;
3
4
  interface FullGridProps {
4
5
  children: React.ReactNode;
5
- gap?: string;
6
+ gap?: SpaceToken;
6
7
  }
7
8
  declare const FullGrid: React.FC<FullGridProps>;
8
9
 
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
 
3
+ type SpaceToken = "none" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16;
3
4
  interface FullGridProps {
4
5
  children: React.ReactNode;
5
- gap?: string;
6
+ gap?: SpaceToken;
6
7
  }
7
8
  declare const FullGrid: React.FC<FullGridProps>;
8
9
 
@@ -2,14 +2,8 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  var FullGrid = (props) => {
4
4
  const { children, gap } = props;
5
- return /* @__PURE__ */ jsx(
6
- "div",
7
- {
8
- className: "lib-xplat-full-grid",
9
- style: gap ? { gap } : void 0,
10
- children
11
- }
12
- );
5
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
6
+ return /* @__PURE__ */ jsx("div", { className: "lib-xplat-full-grid", style, children });
13
7
  };
14
8
  FullGrid.displayName = "FullGrid";
15
9
  var FullGrid_default = FullGrid;
@@ -28,14 +28,8 @@ module.exports = __toCommonJS(FullScreen_exports);
28
28
  var import_jsx_runtime = require("react/jsx-runtime");
29
29
  var FullScreen = (props) => {
30
30
  const { children, gap } = props;
31
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
32
- "div",
33
- {
34
- className: "lib-xplat-full-screen",
35
- style: gap ? { gap } : void 0,
36
- children
37
- }
38
- );
31
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
32
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "lib-xplat-full-screen", style, children });
39
33
  };
40
34
  FullScreen.displayName = "FullScreen";
41
35
  var FullScreen_default = FullScreen;
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
 
3
+ type SpaceToken = "none" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16;
3
4
  interface FullScreenProps {
4
5
  children: React.ReactNode;
5
- gap?: string;
6
+ gap?: SpaceToken;
6
7
  }
7
8
  declare const FullScreen: React.FC<FullScreenProps>;
8
9
 
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
 
3
+ type SpaceToken = "none" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16;
3
4
  interface FullScreenProps {
4
5
  children: React.ReactNode;
5
- gap?: string;
6
+ gap?: SpaceToken;
6
7
  }
7
8
  declare const FullScreen: React.FC<FullScreenProps>;
8
9
 
@@ -2,14 +2,8 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  var FullScreen = (props) => {
4
4
  const { children, gap } = props;
5
- return /* @__PURE__ */ jsx(
6
- "div",
7
- {
8
- className: "lib-xplat-full-screen",
9
- style: gap ? { gap } : void 0,
10
- children
11
- }
12
- );
5
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
6
+ return /* @__PURE__ */ jsx("div", { className: "lib-xplat-full-screen", style, children });
13
7
  };
14
8
  FullScreen.displayName = "FullScreen";
15
9
  var FullScreen_default = FullScreen;
@@ -31,14 +31,8 @@ module.exports = __toCommonJS(Grid_exports);
31
31
  var import_jsx_runtime = require("react/jsx-runtime");
32
32
  var FullGrid = (props) => {
33
33
  const { children, gap } = props;
34
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
35
- "div",
36
- {
37
- className: "lib-xplat-full-grid",
38
- style: gap ? { gap } : void 0,
39
- children
40
- }
41
- );
34
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "lib-xplat-full-grid", style, children });
42
36
  };
43
37
  FullGrid.displayName = "FullGrid";
44
38
  var FullGrid_default = FullGrid;
@@ -47,14 +41,8 @@ var FullGrid_default = FullGrid;
47
41
  var import_jsx_runtime2 = require("react/jsx-runtime");
48
42
  var FullScreen = (props) => {
49
43
  const { children, gap } = props;
50
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
51
- "div",
52
- {
53
- className: "lib-xplat-full-screen",
54
- style: gap ? { gap } : void 0,
55
- children
56
- }
57
- );
44
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
45
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "lib-xplat-full-screen", style, children });
58
46
  };
59
47
  FullScreen.displayName = "FullScreen";
60
48
  var FullScreen_default = FullScreen;
@@ -2,14 +2,8 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  var FullGrid = (props) => {
4
4
  const { children, gap } = props;
5
- return /* @__PURE__ */ jsx(
6
- "div",
7
- {
8
- className: "lib-xplat-full-grid",
9
- style: gap ? { gap } : void 0,
10
- children
11
- }
12
- );
5
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
6
+ return /* @__PURE__ */ jsx("div", { className: "lib-xplat-full-grid", style, children });
13
7
  };
14
8
  FullGrid.displayName = "FullGrid";
15
9
  var FullGrid_default = FullGrid;
@@ -18,14 +12,8 @@ var FullGrid_default = FullGrid;
18
12
  import { jsx as jsx2 } from "react/jsx-runtime";
19
13
  var FullScreen = (props) => {
20
14
  const { children, gap } = props;
21
- return /* @__PURE__ */ jsx2(
22
- "div",
23
- {
24
- className: "lib-xplat-full-screen",
25
- style: gap ? { gap } : void 0,
26
- children
27
- }
28
- );
15
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
16
+ return /* @__PURE__ */ jsx2("div", { className: "lib-xplat-full-screen", style, children });
29
17
  };
30
18
  FullScreen.displayName = "FullScreen";
31
19
  var FullScreen_default = FullScreen;
@@ -46,14 +46,8 @@ module.exports = __toCommonJS(layout_exports);
46
46
  var import_jsx_runtime = require("react/jsx-runtime");
47
47
  var FullGrid = (props) => {
48
48
  const { children, gap } = props;
49
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
50
- "div",
51
- {
52
- className: "lib-xplat-full-grid",
53
- style: gap ? { gap } : void 0,
54
- children
55
- }
56
- );
49
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
50
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "lib-xplat-full-grid", style, children });
57
51
  };
58
52
  FullGrid.displayName = "FullGrid";
59
53
  var FullGrid_default = FullGrid;
@@ -62,14 +56,8 @@ var FullGrid_default = FullGrid;
62
56
  var import_jsx_runtime2 = require("react/jsx-runtime");
63
57
  var FullScreen = (props) => {
64
58
  const { children, gap } = props;
65
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
66
- "div",
67
- {
68
- className: "lib-xplat-full-screen",
69
- style: gap ? { gap } : void 0,
70
- children
71
- }
72
- );
59
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
60
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "lib-xplat-full-screen", style, children });
73
61
  };
74
62
  FullScreen.displayName = "FullScreen";
75
63
  var FullScreen_default = FullScreen;
@@ -2,14 +2,8 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  var FullGrid = (props) => {
4
4
  const { children, gap } = props;
5
- return /* @__PURE__ */ jsx(
6
- "div",
7
- {
8
- className: "lib-xplat-full-grid",
9
- style: gap ? { gap } : void 0,
10
- children
11
- }
12
- );
5
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
6
+ return /* @__PURE__ */ jsx("div", { className: "lib-xplat-full-grid", style, children });
13
7
  };
14
8
  FullGrid.displayName = "FullGrid";
15
9
  var FullGrid_default = FullGrid;
@@ -18,14 +12,8 @@ var FullGrid_default = FullGrid;
18
12
  import { jsx as jsx2 } from "react/jsx-runtime";
19
13
  var FullScreen = (props) => {
20
14
  const { children, gap } = props;
21
- return /* @__PURE__ */ jsx2(
22
- "div",
23
- {
24
- className: "lib-xplat-full-screen",
25
- style: gap ? { gap } : void 0,
26
- children
27
- }
28
- );
15
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
16
+ return /* @__PURE__ */ jsx2("div", { className: "lib-xplat-full-screen", style, children });
29
17
  };
30
18
  FullScreen.displayName = "FullScreen";
31
19
  var FullScreen_default = FullScreen;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-plat/design-system",
3
- "version": "0.5.17",
3
+ "version": "0.5.19",
4
4
  "description": "XPLAT UI Design System",
5
5
  "author": "XPLAT WOONG",
6
6
  "main": "dist/index.cjs",