@x-plat/design-system 0.5.16 → 0.5.18

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 (35) hide show
  1. package/dist/components/Drawer/index.cjs +2 -4
  2. package/dist/components/Drawer/index.css +12 -0
  3. package/dist/components/Drawer/index.d.cts +2 -1
  4. package/dist/components/Drawer/index.d.ts +2 -1
  5. package/dist/components/Drawer/index.js +2 -4
  6. package/dist/components/Dropdown/index.cjs +1 -1
  7. package/dist/components/Dropdown/index.js +1 -1
  8. package/dist/components/PopOver/index.cjs +1 -1
  9. package/dist/components/PopOver/index.css +0 -1
  10. package/dist/components/PopOver/index.js +1 -1
  11. package/dist/components/Select/index.cjs +2 -2
  12. package/dist/components/Select/index.js +2 -2
  13. package/dist/components/Skeleton/index.cjs +3 -2
  14. package/dist/components/Skeleton/index.d.cts +3 -2
  15. package/dist/components/Skeleton/index.d.ts +3 -2
  16. package/dist/components/Skeleton/index.js +3 -2
  17. package/dist/components/index.cjs +7 -8
  18. package/dist/components/index.css +12 -1
  19. package/dist/components/index.js +7 -8
  20. package/dist/index.cjs +11 -24
  21. package/dist/index.css +12 -1
  22. package/dist/index.js +11 -24
  23. package/dist/layout/Grid/FullGrid/index.cjs +2 -8
  24. package/dist/layout/Grid/FullGrid/index.d.cts +2 -1
  25. package/dist/layout/Grid/FullGrid/index.d.ts +2 -1
  26. package/dist/layout/Grid/FullGrid/index.js +2 -8
  27. package/dist/layout/Grid/FullScreen/index.cjs +2 -8
  28. package/dist/layout/Grid/FullScreen/index.d.cts +2 -1
  29. package/dist/layout/Grid/FullScreen/index.d.ts +2 -1
  30. package/dist/layout/Grid/FullScreen/index.js +2 -8
  31. package/dist/layout/Grid/index.cjs +4 -16
  32. package/dist/layout/Grid/index.js +4 -16
  33. package/dist/layout/index.cjs +4 -16
  34. package/dist/layout/index.js +4 -16
  35. package/package.json +1 -1
@@ -58,7 +58,7 @@ var clsx_default = clsx;
58
58
  var import_jsx_runtime = require("react/jsx-runtime");
59
59
  var ANIMATION_DURATION_MS = 250;
60
60
  var Drawer = (props) => {
61
- const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
61
+ const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
62
62
  const [mounted, setMounted] = import_react.default.useState(false);
63
63
  const [visible, setVisible] = import_react.default.useState(false);
64
64
  import_react.default.useEffect(() => {
@@ -74,7 +74,6 @@ var Drawer = (props) => {
74
74
  if (typeof document === "undefined") return null;
75
75
  if (!mounted) return null;
76
76
  const stateClass = visible ? "enter" : "exit";
77
- const widthValue = typeof width === "number" ? `${width}px` : width;
78
77
  return (0, import_react_dom.createPortal)(
79
78
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
80
79
  "div",
@@ -84,8 +83,7 @@ var Drawer = (props) => {
84
83
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
85
84
  "div",
86
85
  {
87
- className: clsx_default("lib-xplat-drawer", placement, stateClass),
88
- style: { width: widthValue },
86
+ className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
89
87
  role: "dialog",
90
88
  "aria-modal": "true",
91
89
  onClick: (e) => e.stopPropagation(),
@@ -23,6 +23,18 @@
23
23
  transition: transform 0.25s ease;
24
24
  z-index: 1001;
25
25
  }
26
+ .lib-xplat-drawer.sm {
27
+ width: 280px;
28
+ }
29
+ .lib-xplat-drawer.md {
30
+ width: 360px;
31
+ }
32
+ .lib-xplat-drawer.lg {
33
+ width: 480px;
34
+ }
35
+ .lib-xplat-drawer.xl {
36
+ width: 640px;
37
+ }
26
38
  .lib-xplat-drawer.right {
27
39
  right: 0;
28
40
  transform: translateX(100%);
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
 
3
3
  type DrawerPlacement = "left" | "right";
4
+ type DrawerSize = "sm" | "md" | "lg" | "xl";
4
5
  interface DrawerProps {
5
6
  isOpen: boolean;
6
7
  onClose: () => void;
7
8
  placement?: DrawerPlacement;
8
- width?: string | number;
9
+ size?: DrawerSize;
9
10
  title?: React.ReactNode;
10
11
  children?: React.ReactNode;
11
12
  }
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
 
3
3
  type DrawerPlacement = "left" | "right";
4
+ type DrawerSize = "sm" | "md" | "lg" | "xl";
4
5
  interface DrawerProps {
5
6
  isOpen: boolean;
6
7
  onClose: () => void;
7
8
  placement?: DrawerPlacement;
8
- width?: string | number;
9
+ size?: DrawerSize;
9
10
  title?: React.ReactNode;
10
11
  children?: React.ReactNode;
11
12
  }
@@ -22,7 +22,7 @@ var clsx_default = clsx;
22
22
  import { jsx, jsxs } from "react/jsx-runtime";
23
23
  var ANIMATION_DURATION_MS = 250;
24
24
  var Drawer = (props) => {
25
- const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
25
+ const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
26
26
  const [mounted, setMounted] = React.useState(false);
27
27
  const [visible, setVisible] = React.useState(false);
28
28
  React.useEffect(() => {
@@ -38,7 +38,6 @@ var Drawer = (props) => {
38
38
  if (typeof document === "undefined") return null;
39
39
  if (!mounted) return null;
40
40
  const stateClass = visible ? "enter" : "exit";
41
- const widthValue = typeof width === "number" ? `${width}px` : width;
42
41
  return createPortal(
43
42
  /* @__PURE__ */ jsx(
44
43
  "div",
@@ -48,8 +47,7 @@ var Drawer = (props) => {
48
47
  children: /* @__PURE__ */ jsxs(
49
48
  "div",
50
49
  {
51
- className: clsx_default("lib-xplat-drawer", placement, stateClass),
52
- style: { width: widthValue },
50
+ className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
53
51
  role: "dialog",
54
52
  "aria-modal": "true",
55
53
  onClick: (e) => e.stopPropagation(),
@@ -66,7 +66,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
66
66
  }
67
67
  if (left < 8) left = 8;
68
68
  setPosition({
69
- position: { top, left, width: triggerRect.width },
69
+ position: { top, left },
70
70
  direction
71
71
  });
72
72
  }, [triggerRef, popRef]);
@@ -30,7 +30,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
30
30
  }
31
31
  if (left < 8) left = 8;
32
32
  setPosition({
33
- position: { top, left, width: triggerRect.width },
33
+ position: { top, left },
34
34
  direction
35
35
  });
36
36
  }, [triggerRef, popRef]);
@@ -66,7 +66,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
66
66
  }
67
67
  if (left < 8) left = 8;
68
68
  setPosition({
69
- position: { top, left, width: triggerRect.width },
69
+ position: { top, left },
70
70
  direction
71
71
  });
72
72
  }, [triggerRef, popRef]);
@@ -1,7 +1,6 @@
1
1
  /* src/components/PopOver/popOver.scss */
2
2
  .lib-xplat-pop-over {
3
3
  position: relative;
4
- width: fit-content;
5
4
  cursor: pointer;
6
5
  user-select: none;
7
6
  }
@@ -30,7 +30,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
30
30
  }
31
31
  if (left < 8) left = 8;
32
32
  setPosition({
33
- position: { top, left, width: triggerRect.width },
33
+ position: { top, left },
34
34
  direction
35
35
  });
36
36
  }, [triggerRef, popRef]);
@@ -67,7 +67,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
67
67
  }
68
68
  if (left < 8) left = 8;
69
69
  setPosition({
70
- position: { top, left, width: triggerRect.width },
70
+ position: { top, left },
71
71
  direction
72
72
  });
73
73
  }, [triggerRef, popRef]);
@@ -1220,7 +1220,7 @@ var SelectRoot = (props) => {
1220
1220
  {
1221
1221
  className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
1222
1222
  ref: contentRef,
1223
- style: { ...position.position, minWidth: position.position.width },
1223
+ style: { ...position.position, width: triggerRef.current?.offsetWidth },
1224
1224
  role: "listbox",
1225
1225
  children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(context_default.Provider, { value: ctxValue, children: itemChildren })
1226
1226
  }
@@ -30,7 +30,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
30
30
  }
31
31
  if (left < 8) left = 8;
32
32
  setPosition({
33
- position: { top, left, width: triggerRect.width },
33
+ position: { top, left },
34
34
  direction
35
35
  });
36
36
  }, [triggerRef, popRef]);
@@ -1183,7 +1183,7 @@ var SelectRoot = (props) => {
1183
1183
  {
1184
1184
  className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
1185
1185
  ref: contentRef,
1186
- style: { ...position.position, minWidth: position.position.width },
1186
+ style: { ...position.position, width: triggerRef.current?.offsetWidth },
1187
1187
  role: "listbox",
1188
1188
  children: /* @__PURE__ */ jsx297(context_default.Provider, { value: ctxValue, children: itemChildren })
1189
1189
  }
@@ -42,11 +42,12 @@ var clsx_default = clsx;
42
42
 
43
43
  // src/components/Skeleton/Skeleton.tsx
44
44
  var import_jsx_runtime = require("react/jsx-runtime");
45
+ var toSizeVar = (token) => token === "full" ? "100%" : `var(--spacing-size-${token})`;
45
46
  var Skeleton = (props) => {
46
47
  const { variant = "text", width, height } = props;
47
48
  const style = {
48
- width: typeof width === "number" ? `${width}px` : width,
49
- height: typeof height === "number" ? `${height}px` : height
49
+ ...width != null && { width: toSizeVar(width) },
50
+ ...height != null && { height: toSizeVar(height) }
50
51
  };
51
52
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
52
53
  "div",
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
 
3
3
  type SkeletonVariant = "text" | "circular" | "rectangular";
4
+ type SizeToken = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | "full";
4
5
  interface SkeletonProps {
5
6
  variant?: SkeletonVariant;
6
- width?: string | number;
7
- height?: string | number;
7
+ width?: SizeToken;
8
+ height?: SizeToken;
8
9
  }
9
10
  declare const Skeleton: React.FC<SkeletonProps>;
10
11
 
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
 
3
3
  type SkeletonVariant = "text" | "circular" | "rectangular";
4
+ type SizeToken = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | "full";
4
5
  interface SkeletonProps {
5
6
  variant?: SkeletonVariant;
6
- width?: string | number;
7
- height?: string | number;
7
+ width?: SizeToken;
8
+ height?: SizeToken;
8
9
  }
9
10
  declare const Skeleton: React.FC<SkeletonProps>;
10
11
 
@@ -16,11 +16,12 @@ var clsx_default = clsx;
16
16
 
17
17
  // src/components/Skeleton/Skeleton.tsx
18
18
  import { jsx } from "react/jsx-runtime";
19
+ var toSizeVar = (token) => token === "full" ? "100%" : `var(--spacing-size-${token})`;
19
20
  var Skeleton = (props) => {
20
21
  const { variant = "text", width, height } = props;
21
22
  const style = {
22
- width: typeof width === "number" ? `${width}px` : width,
23
- height: typeof height === "number" ? `${height}px` : height
23
+ ...width != null && { width: toSizeVar(width) },
24
+ ...height != null && { height: toSizeVar(height) }
24
25
  };
25
26
  return /* @__PURE__ */ jsx(
26
27
  "div",
@@ -3336,7 +3336,7 @@ var import_react_dom3 = require("react-dom");
3336
3336
  var import_jsx_runtime320 = require("react/jsx-runtime");
3337
3337
  var ANIMATION_DURATION_MS2 = 250;
3338
3338
  var Drawer = (props) => {
3339
- const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
3339
+ const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
3340
3340
  const [mounted, setMounted] = import_react17.default.useState(false);
3341
3341
  const [visible, setVisible] = import_react17.default.useState(false);
3342
3342
  import_react17.default.useEffect(() => {
@@ -3352,7 +3352,6 @@ var Drawer = (props) => {
3352
3352
  if (typeof document === "undefined") return null;
3353
3353
  if (!mounted) return null;
3354
3354
  const stateClass = visible ? "enter" : "exit";
3355
- const widthValue = typeof width === "number" ? `${width}px` : width;
3356
3355
  return (0, import_react_dom3.createPortal)(
3357
3356
  /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
3358
3357
  "div",
@@ -3362,8 +3361,7 @@ var Drawer = (props) => {
3362
3361
  children: /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)(
3363
3362
  "div",
3364
3363
  {
3365
- className: clsx_default("lib-xplat-drawer", placement, stateClass),
3366
- style: { width: widthValue },
3364
+ className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
3367
3365
  role: "dialog",
3368
3366
  "aria-modal": "true",
3369
3367
  onClick: (e) => e.stopPropagation(),
@@ -3416,7 +3414,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3416
3414
  }
3417
3415
  if (left < 8) left = 8;
3418
3416
  setPosition({
3419
- position: { top, left, width: triggerRect.width },
3417
+ position: { top, left },
3420
3418
  direction
3421
3419
  });
3422
3420
  }, [triggerRef, popRef]);
@@ -4222,7 +4220,7 @@ var SelectRoot = (props) => {
4222
4220
  {
4223
4221
  className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
4224
4222
  ref: contentRef,
4225
- style: { ...position.position, minWidth: position.position.width },
4223
+ style: { ...position.position, width: triggerRef.current?.offsetWidth },
4226
4224
  role: "listbox",
4227
4225
  children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(context_default.Provider, { value: ctxValue, children: itemChildren })
4228
4226
  }
@@ -4239,11 +4237,12 @@ var Select_default = Select;
4239
4237
 
4240
4238
  // src/components/Skeleton/Skeleton.tsx
4241
4239
  var import_jsx_runtime333 = require("react/jsx-runtime");
4240
+ var toSizeVar = (token) => token === "full" ? "100%" : `var(--spacing-size-${token})`;
4242
4241
  var Skeleton = (props) => {
4243
4242
  const { variant = "text", width, height } = props;
4244
4243
  const style = {
4245
- width: typeof width === "number" ? `${width}px` : width,
4246
- height: typeof height === "number" ? `${height}px` : height
4244
+ ...width != null && { width: toSizeVar(width) },
4245
+ ...height != null && { height: toSizeVar(height) }
4247
4246
  };
4248
4247
  return /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
4249
4248
  "div",
@@ -2551,6 +2551,18 @@
2551
2551
  transition: transform 0.25s ease;
2552
2552
  z-index: 1001;
2553
2553
  }
2554
+ .lib-xplat-drawer.sm {
2555
+ width: 280px;
2556
+ }
2557
+ .lib-xplat-drawer.md {
2558
+ width: 360px;
2559
+ }
2560
+ .lib-xplat-drawer.lg {
2561
+ width: 480px;
2562
+ }
2563
+ .lib-xplat-drawer.xl {
2564
+ width: 640px;
2565
+ }
2554
2566
  .lib-xplat-drawer.right {
2555
2567
  right: 0;
2556
2568
  transform: translateX(100%);
@@ -2934,7 +2946,6 @@
2934
2946
  /* src/components/PopOver/popOver.scss */
2935
2947
  .lib-xplat-pop-over {
2936
2948
  position: relative;
2937
- width: fit-content;
2938
2949
  cursor: pointer;
2939
2950
  user-select: none;
2940
2951
  }
@@ -3248,7 +3248,7 @@ import { createPortal as createPortal2 } from "react-dom";
3248
3248
  import { jsx as jsx320, jsxs as jsxs205 } from "react/jsx-runtime";
3249
3249
  var ANIMATION_DURATION_MS2 = 250;
3250
3250
  var Drawer = (props) => {
3251
- const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
3251
+ const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
3252
3252
  const [mounted, setMounted] = React16.useState(false);
3253
3253
  const [visible, setVisible] = React16.useState(false);
3254
3254
  React16.useEffect(() => {
@@ -3264,7 +3264,6 @@ var Drawer = (props) => {
3264
3264
  if (typeof document === "undefined") return null;
3265
3265
  if (!mounted) return null;
3266
3266
  const stateClass = visible ? "enter" : "exit";
3267
- const widthValue = typeof width === "number" ? `${width}px` : width;
3268
3267
  return createPortal2(
3269
3268
  /* @__PURE__ */ jsx320(
3270
3269
  "div",
@@ -3274,8 +3273,7 @@ var Drawer = (props) => {
3274
3273
  children: /* @__PURE__ */ jsxs205(
3275
3274
  "div",
3276
3275
  {
3277
- className: clsx_default("lib-xplat-drawer", placement, stateClass),
3278
- style: { width: widthValue },
3276
+ className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
3279
3277
  role: "dialog",
3280
3278
  "aria-modal": "true",
3281
3279
  onClick: (e) => e.stopPropagation(),
@@ -3328,7 +3326,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3328
3326
  }
3329
3327
  if (left < 8) left = 8;
3330
3328
  setPosition({
3331
- position: { top, left, width: triggerRect.width },
3329
+ position: { top, left },
3332
3330
  direction
3333
3331
  });
3334
3332
  }, [triggerRef, popRef]);
@@ -4134,7 +4132,7 @@ var SelectRoot = (props) => {
4134
4132
  {
4135
4133
  className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
4136
4134
  ref: contentRef,
4137
- style: { ...position.position, minWidth: position.position.width },
4135
+ style: { ...position.position, width: triggerRef.current?.offsetWidth },
4138
4136
  role: "listbox",
4139
4137
  children: /* @__PURE__ */ jsx332(context_default.Provider, { value: ctxValue, children: itemChildren })
4140
4138
  }
@@ -4151,11 +4149,12 @@ var Select_default = Select;
4151
4149
 
4152
4150
  // src/components/Skeleton/Skeleton.tsx
4153
4151
  import { jsx as jsx333 } from "react/jsx-runtime";
4152
+ var toSizeVar = (token) => token === "full" ? "100%" : `var(--spacing-size-${token})`;
4154
4153
  var Skeleton = (props) => {
4155
4154
  const { variant = "text", width, height } = props;
4156
4155
  const style = {
4157
- width: typeof width === "number" ? `${width}px` : width,
4158
- height: typeof height === "number" ? `${height}px` : height
4156
+ ...width != null && { width: toSizeVar(width) },
4157
+ ...height != null && { height: toSizeVar(height) }
4159
4158
  };
4160
4159
  return /* @__PURE__ */ jsx333(
4161
4160
  "div",
package/dist/index.cjs CHANGED
@@ -7760,7 +7760,7 @@ var import_react_dom3 = require("react-dom");
7760
7760
  var import_jsx_runtime320 = require("react/jsx-runtime");
7761
7761
  var ANIMATION_DURATION_MS2 = 250;
7762
7762
  var Drawer = (props) => {
7763
- const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
7763
+ const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
7764
7764
  const [mounted, setMounted] = import_react17.default.useState(false);
7765
7765
  const [visible, setVisible] = import_react17.default.useState(false);
7766
7766
  import_react17.default.useEffect(() => {
@@ -7776,7 +7776,6 @@ var Drawer = (props) => {
7776
7776
  if (typeof document === "undefined") return null;
7777
7777
  if (!mounted) return null;
7778
7778
  const stateClass = visible ? "enter" : "exit";
7779
- const widthValue = typeof width === "number" ? `${width}px` : width;
7780
7779
  return (0, import_react_dom3.createPortal)(
7781
7780
  /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
7782
7781
  "div",
@@ -7786,8 +7785,7 @@ var Drawer = (props) => {
7786
7785
  children: /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)(
7787
7786
  "div",
7788
7787
  {
7789
- className: clsx_default("lib-xplat-drawer", placement, stateClass),
7790
- style: { width: widthValue },
7788
+ className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
7791
7789
  role: "dialog",
7792
7790
  "aria-modal": "true",
7793
7791
  onClick: (e) => e.stopPropagation(),
@@ -7840,7 +7838,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
7840
7838
  }
7841
7839
  if (left < 8) left = 8;
7842
7840
  setPosition({
7843
- position: { top, left, width: triggerRect.width },
7841
+ position: { top, left },
7844
7842
  direction
7845
7843
  });
7846
7844
  }, [triggerRef, popRef]);
@@ -8646,7 +8644,7 @@ var SelectRoot = (props) => {
8646
8644
  {
8647
8645
  className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
8648
8646
  ref: contentRef,
8649
- style: { ...position.position, minWidth: position.position.width },
8647
+ style: { ...position.position, width: triggerRef.current?.offsetWidth },
8650
8648
  role: "listbox",
8651
8649
  children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(context_default.Provider, { value: ctxValue, children: itemChildren })
8652
8650
  }
@@ -8663,11 +8661,12 @@ var Select_default = Select;
8663
8661
 
8664
8662
  // src/components/Skeleton/Skeleton.tsx
8665
8663
  var import_jsx_runtime333 = require("react/jsx-runtime");
8664
+ var toSizeVar = (token) => token === "full" ? "100%" : `var(--spacing-size-${token})`;
8666
8665
  var Skeleton = (props) => {
8667
8666
  const { variant = "text", width, height } = props;
8668
8667
  const style = {
8669
- width: typeof width === "number" ? `${width}px` : width,
8670
- height: typeof height === "number" ? `${height}px` : height
8668
+ ...width != null && { width: toSizeVar(width) },
8669
+ ...height != null && { height: toSizeVar(height) }
8671
8670
  };
8672
8671
  return /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
8673
8672
  "div",
@@ -9812,14 +9811,8 @@ var Video_default = Video;
9812
9811
  var import_jsx_runtime348 = require("react/jsx-runtime");
9813
9812
  var FullGrid = (props) => {
9814
9813
  const { children, gap } = props;
9815
- return /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
9816
- "div",
9817
- {
9818
- className: "lib-xplat-full-grid",
9819
- style: gap ? { gap } : void 0,
9820
- children
9821
- }
9822
- );
9814
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
9815
+ return /* @__PURE__ */ (0, import_jsx_runtime348.jsx)("div", { className: "lib-xplat-full-grid", style, children });
9823
9816
  };
9824
9817
  FullGrid.displayName = "FullGrid";
9825
9818
  var FullGrid_default = FullGrid;
@@ -9828,14 +9821,8 @@ var FullGrid_default = FullGrid;
9828
9821
  var import_jsx_runtime349 = require("react/jsx-runtime");
9829
9822
  var FullScreen = (props) => {
9830
9823
  const { children, gap } = props;
9831
- return /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(
9832
- "div",
9833
- {
9834
- className: "lib-xplat-full-screen",
9835
- style: gap ? { gap } : void 0,
9836
- children
9837
- }
9838
- );
9824
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
9825
+ return /* @__PURE__ */ (0, import_jsx_runtime349.jsx)("div", { className: "lib-xplat-full-screen", style, children });
9839
9826
  };
9840
9827
  FullScreen.displayName = "FullScreen";
9841
9828
  var FullScreen_default = FullScreen;
package/dist/index.css CHANGED
@@ -2551,6 +2551,18 @@
2551
2551
  transition: transform 0.25s ease;
2552
2552
  z-index: 1001;
2553
2553
  }
2554
+ .lib-xplat-drawer.sm {
2555
+ width: 280px;
2556
+ }
2557
+ .lib-xplat-drawer.md {
2558
+ width: 360px;
2559
+ }
2560
+ .lib-xplat-drawer.lg {
2561
+ width: 480px;
2562
+ }
2563
+ .lib-xplat-drawer.xl {
2564
+ width: 640px;
2565
+ }
2554
2566
  .lib-xplat-drawer.right {
2555
2567
  right: 0;
2556
2568
  transform: translateX(100%);
@@ -2934,7 +2946,6 @@
2934
2946
  /* src/components/PopOver/popOver.scss */
2935
2947
  .lib-xplat-pop-over {
2936
2948
  position: relative;
2937
- width: fit-content;
2938
2949
  cursor: pointer;
2939
2950
  user-select: none;
2940
2951
  }
package/dist/index.js CHANGED
@@ -7363,7 +7363,7 @@ import { createPortal as createPortal2 } from "react-dom";
7363
7363
  import { jsx as jsx320, jsxs as jsxs205 } from "react/jsx-runtime";
7364
7364
  var ANIMATION_DURATION_MS2 = 250;
7365
7365
  var Drawer = (props) => {
7366
- const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
7366
+ const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
7367
7367
  const [mounted, setMounted] = React16.useState(false);
7368
7368
  const [visible, setVisible] = React16.useState(false);
7369
7369
  React16.useEffect(() => {
@@ -7379,7 +7379,6 @@ var Drawer = (props) => {
7379
7379
  if (typeof document === "undefined") return null;
7380
7380
  if (!mounted) return null;
7381
7381
  const stateClass = visible ? "enter" : "exit";
7382
- const widthValue = typeof width === "number" ? `${width}px` : width;
7383
7382
  return createPortal2(
7384
7383
  /* @__PURE__ */ jsx320(
7385
7384
  "div",
@@ -7389,8 +7388,7 @@ var Drawer = (props) => {
7389
7388
  children: /* @__PURE__ */ jsxs205(
7390
7389
  "div",
7391
7390
  {
7392
- className: clsx_default("lib-xplat-drawer", placement, stateClass),
7393
- style: { width: widthValue },
7391
+ className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
7394
7392
  role: "dialog",
7395
7393
  "aria-modal": "true",
7396
7394
  onClick: (e) => e.stopPropagation(),
@@ -7443,7 +7441,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
7443
7441
  }
7444
7442
  if (left < 8) left = 8;
7445
7443
  setPosition({
7446
- position: { top, left, width: triggerRect.width },
7444
+ position: { top, left },
7447
7445
  direction
7448
7446
  });
7449
7447
  }, [triggerRef, popRef]);
@@ -8249,7 +8247,7 @@ var SelectRoot = (props) => {
8249
8247
  {
8250
8248
  className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
8251
8249
  ref: contentRef,
8252
- style: { ...position.position, minWidth: position.position.width },
8250
+ style: { ...position.position, width: triggerRef.current?.offsetWidth },
8253
8251
  role: "listbox",
8254
8252
  children: /* @__PURE__ */ jsx332(context_default.Provider, { value: ctxValue, children: itemChildren })
8255
8253
  }
@@ -8266,11 +8264,12 @@ var Select_default = Select;
8266
8264
 
8267
8265
  // src/components/Skeleton/Skeleton.tsx
8268
8266
  import { jsx as jsx333 } from "react/jsx-runtime";
8267
+ var toSizeVar = (token) => token === "full" ? "100%" : `var(--spacing-size-${token})`;
8269
8268
  var Skeleton = (props) => {
8270
8269
  const { variant = "text", width, height } = props;
8271
8270
  const style = {
8272
- width: typeof width === "number" ? `${width}px` : width,
8273
- height: typeof height === "number" ? `${height}px` : height
8271
+ ...width != null && { width: toSizeVar(width) },
8272
+ ...height != null && { height: toSizeVar(height) }
8274
8273
  };
8275
8274
  return /* @__PURE__ */ jsx333(
8276
8275
  "div",
@@ -9415,14 +9414,8 @@ var Video_default = Video;
9415
9414
  import { jsx as jsx348 } from "react/jsx-runtime";
9416
9415
  var FullGrid = (props) => {
9417
9416
  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
- );
9417
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
9418
+ return /* @__PURE__ */ jsx348("div", { className: "lib-xplat-full-grid", style, children });
9426
9419
  };
9427
9420
  FullGrid.displayName = "FullGrid";
9428
9421
  var FullGrid_default = FullGrid;
@@ -9431,14 +9424,8 @@ var FullGrid_default = FullGrid;
9431
9424
  import { jsx as jsx349 } from "react/jsx-runtime";
9432
9425
  var FullScreen = (props) => {
9433
9426
  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
- );
9427
+ const style = gap != null ? { gap: `var(--spacing-space-${gap})` } : void 0;
9428
+ return /* @__PURE__ */ jsx349("div", { className: "lib-xplat-full-screen", style, children });
9442
9429
  };
9443
9430
  FullScreen.displayName = "FullScreen";
9444
9431
  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.16",
3
+ "version": "0.5.18",
4
4
  "description": "XPLAT UI Design System",
5
5
  "author": "XPLAT WOONG",
6
6
  "main": "dist/index.cjs",