@x-plat/design-system 0.13.0 → 0.14.1

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 (43) hide show
  1. package/dist/{breakpoints-DsXkJgdl.d.cts → breakpoints-CKkNxA-y.d.cts} +1 -1
  2. package/dist/{breakpoints-DsXkJgdl.d.ts → breakpoints-CKkNxA-y.d.ts} +1 -1
  3. package/dist/components/Badge/index.d.cts +1 -1
  4. package/dist/components/Badge/index.d.ts +1 -1
  5. package/dist/components/Dropdown/index.cjs +5 -15
  6. package/dist/components/Dropdown/index.css +0 -3
  7. package/dist/components/Dropdown/index.js +5 -15
  8. package/dist/components/PopOver/index.cjs +3 -14
  9. package/dist/components/PopOver/index.css +0 -3
  10. package/dist/components/PopOver/index.js +3 -14
  11. package/dist/components/Select/index.cjs +4 -14
  12. package/dist/components/Select/index.css +0 -3
  13. package/dist/components/Select/index.js +4 -14
  14. package/dist/components/TimePicker/index.cjs +4 -14
  15. package/dist/components/TimePicker/index.css +0 -3
  16. package/dist/components/TimePicker/index.js +4 -14
  17. package/dist/components/ToggleChip/index.cjs +69 -0
  18. package/dist/components/ToggleChip/index.css +102 -0
  19. package/dist/components/ToggleChip/index.d.cts +37 -0
  20. package/dist/components/ToggleChip/index.d.ts +37 -0
  21. package/dist/components/ToggleChip/index.js +42 -0
  22. package/dist/components/index.cjs +69 -54
  23. package/dist/components/index.css +37 -12
  24. package/dist/components/index.d.cts +2 -1
  25. package/dist/components/index.d.ts +2 -1
  26. package/dist/components/index.js +59 -45
  27. package/dist/index.cjs +88 -73
  28. package/dist/index.css +37 -12
  29. package/dist/index.d.cts +4 -3
  30. package/dist/index.d.ts +4 -3
  31. package/dist/index.js +76 -62
  32. package/dist/layout/Grid/Item/index.d.cts +1 -1
  33. package/dist/layout/Grid/Item/index.d.ts +1 -1
  34. package/dist/layout/Grid/index.d.cts +1 -1
  35. package/dist/layout/Grid/index.d.ts +1 -1
  36. package/dist/layout/index.d.cts +1 -1
  37. package/dist/layout/index.d.ts +1 -1
  38. package/dist/tokens/index.d.cts +1 -1
  39. package/dist/tokens/index.d.ts +1 -1
  40. package/guidelines/Guidelines.md +1 -1
  41. package/guidelines/MIGRATION.md +51 -0
  42. package/guidelines/components/chip-tag.md +80 -2
  43. package/package.json +1 -1
@@ -3876,10 +3876,8 @@ import React19 from "react";
3876
3876
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3877
3877
  const [position, setPosition] = React19.useState({
3878
3878
  position: {},
3879
- direction: "bottom",
3880
- repositioning: false
3879
+ direction: "bottom"
3881
3880
  });
3882
- const placedRef = React19.useRef(false);
3883
3881
  const calculatePosition = React19.useCallback(() => {
3884
3882
  if (!triggerRef.current || !popRef.current) return;
3885
3883
  const triggerRect = triggerRef.current.getBoundingClientRect();
@@ -3902,18 +3900,10 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3902
3900
  left = triggerRect.right - popW;
3903
3901
  }
3904
3902
  if (left < 8) left = 8;
3905
- setPosition({
3906
- position: { top, left },
3907
- direction,
3908
- repositioning: placedRef.current
3909
- });
3910
- placedRef.current = true;
3903
+ setPosition({ position: { top, left }, direction });
3911
3904
  }, [triggerRef, popRef]);
3912
3905
  React19.useLayoutEffect(() => {
3913
- if (!enabled) {
3914
- placedRef.current = false;
3915
- return;
3916
- }
3906
+ if (!enabled) return;
3917
3907
  calculatePosition();
3918
3908
  const raf = requestAnimationFrame(calculatePosition);
3919
3909
  return () => cancelAnimationFrame(raf);
@@ -3979,7 +3969,7 @@ var Dropdown = (props) => {
3979
3969
  const [visible, setVisible] = React21.useState(false);
3980
3970
  const triggerRef = React21.useRef(null);
3981
3971
  const menuRef = React21.useRef(null);
3982
- const { position, direction, repositioning } = useAutoPosition_default(triggerRef, menuRef, mounted);
3972
+ const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
3983
3973
  useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
3984
3974
  useEscapeKey(isOpen, () => {
3985
3975
  setIsOpen(false);
@@ -4014,7 +4004,7 @@ var Dropdown = (props) => {
4014
4004
  "div",
4015
4005
  {
4016
4006
  ref: menuRef,
4017
- className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }, repositioning && "repositioning"),
4007
+ className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
4018
4008
  style: { top: position.top, left: position.left },
4019
4009
  role: "menu",
4020
4010
  children: items.map((item) => /* @__PURE__ */ jsx322(
@@ -5946,7 +5936,6 @@ var PopOver = (props) => {
5946
5936
  className: clsx_default(
5947
5937
  "lib-xplat-pop-over-content",
5948
5938
  position.direction,
5949
- position.repositioning && "repositioning",
5950
5939
  eventTrigger && "visible"
5951
5940
  ),
5952
5941
  ref: popRef,
@@ -6293,7 +6282,7 @@ var SelectRoot = (props) => {
6293
6282
  mounted && /* @__PURE__ */ jsx337(Portal_default, { children: /* @__PURE__ */ jsxs216(
6294
6283
  "div",
6295
6284
  {
6296
- className: clsx_default("lib-xplat-select-content", size, position.direction, stateClass, position.repositioning && "repositioning"),
6285
+ className: clsx_default("lib-xplat-select-content", size, position.direction, stateClass),
6297
6286
  ref: contentRef,
6298
6287
  style: { ...position.position, width: triggerRef.current?.offsetWidth },
6299
6288
  role: "listbox",
@@ -7186,7 +7175,7 @@ var TimePicker = (props) => {
7186
7175
  "div",
7187
7176
  {
7188
7177
  ref: contentRef,
7189
- className: clsx_default("lib-xplat-time-picker-content", size, visible ? "enter" : "exit", position.repositioning && "repositioning"),
7178
+ className: clsx_default("lib-xplat-time-picker-content", size, visible ? "enter" : "exit"),
7190
7179
  style: { ...position.position, width: triggerRef.current?.offsetWidth },
7191
7180
  role: "listbox",
7192
7181
  children: options.map((t) => /* @__PURE__ */ jsx351(
@@ -7306,9 +7295,33 @@ var ToastProvider = ({
7306
7295
  };
7307
7296
  ToastProvider.displayName = "ToastProvider";
7308
7297
 
7298
+ // src/components/ToggleChip/ToggleChip.tsx
7299
+ import { jsx as jsx353 } from "react/jsx-runtime";
7300
+ var ToggleChip = (props) => {
7301
+ const { children, selected = false, onClick, disabled = false, size = "md" } = props;
7302
+ return /* @__PURE__ */ jsx353(
7303
+ "button",
7304
+ {
7305
+ type: "button",
7306
+ className: clsx_default(
7307
+ "lib-xplat-chip",
7308
+ "lib-xplat-toggle-chip",
7309
+ size,
7310
+ selected ? "selected" : "unselected"
7311
+ ),
7312
+ "aria-pressed": selected,
7313
+ disabled,
7314
+ onClick,
7315
+ children
7316
+ }
7317
+ );
7318
+ };
7319
+ ToggleChip.displayName = "ToggleChip";
7320
+ var ToggleChip_default = ToggleChip;
7321
+
7309
7322
  // src/components/Tooltip/Tooltip.tsx
7310
7323
  import React42 from "react";
7311
- import { Fragment as Fragment6, jsx as jsx353, jsxs as jsxs224 } from "react/jsx-runtime";
7324
+ import { Fragment as Fragment6, jsx as jsx354, jsxs as jsxs224 } from "react/jsx-runtime";
7312
7325
  var OFFSET = 12;
7313
7326
  var GAP = 8;
7314
7327
  var SHOW_DELAY = 300;
@@ -7413,7 +7426,7 @@ var Tooltip = (props) => {
7413
7426
  window.clearTimeout(delayTimer.current);
7414
7427
  cancelAnimationFrame(rafRef.current);
7415
7428
  }, []);
7416
- if (!title && !description) return /* @__PURE__ */ jsx353(Fragment6, { children });
7429
+ if (!title && !description) return /* @__PURE__ */ jsx354(Fragment6, { children });
7417
7430
  return /* @__PURE__ */ jsxs224(
7418
7431
  "div",
7419
7432
  {
@@ -7427,7 +7440,7 @@ var Tooltip = (props) => {
7427
7440
  onBlur: close,
7428
7441
  children: [
7429
7442
  children,
7430
- visible && /* @__PURE__ */ jsx353(Portal_default, { children: /* @__PURE__ */ jsxs224(
7443
+ visible && /* @__PURE__ */ jsx354(Portal_default, { children: /* @__PURE__ */ jsxs224(
7431
7444
  "div",
7432
7445
  {
7433
7446
  ref: tooltipRef,
@@ -7435,8 +7448,8 @@ var Tooltip = (props) => {
7435
7448
  className: clsx_default("lib-xplat-tooltip", shape),
7436
7449
  style: { position: "fixed", left: pos.left, top: pos.top },
7437
7450
  children: [
7438
- title && /* @__PURE__ */ jsx353("div", { className: "tooltip-title", children: title }),
7439
- description && /* @__PURE__ */ jsx353("div", { className: "tooltip-desc", children: description })
7451
+ title && /* @__PURE__ */ jsx354("div", { className: "tooltip-title", children: title }),
7452
+ description && /* @__PURE__ */ jsx354("div", { className: "tooltip-desc", children: description })
7440
7453
  ]
7441
7454
  }
7442
7455
  ) })
@@ -7449,10 +7462,10 @@ var Tooltip_default = Tooltip;
7449
7462
 
7450
7463
  // src/components/Video/Video.tsx
7451
7464
  import React43 from "react";
7452
- import { jsx as jsx354, jsxs as jsxs225 } from "react/jsx-runtime";
7465
+ import { jsx as jsx355, jsxs as jsxs225 } from "react/jsx-runtime";
7453
7466
  var PipIcon = () => /* @__PURE__ */ jsxs225("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
7454
- /* @__PURE__ */ jsx354("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
7455
- /* @__PURE__ */ jsx354("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
7467
+ /* @__PURE__ */ jsx355("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
7468
+ /* @__PURE__ */ jsx355("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
7456
7469
  ] });
7457
7470
  var formatTime = (sec) => {
7458
7471
  if (!Number.isFinite(sec) || sec < 0) return "0:00";
@@ -7633,7 +7646,7 @@ var Video = React43.forwardRef((props, ref) => {
7633
7646
  ref: containerRef,
7634
7647
  className: clsx_default("lib-xplat-video", showControls && "has-controls"),
7635
7648
  children: [
7636
- /* @__PURE__ */ jsx354(
7649
+ /* @__PURE__ */ jsx355(
7637
7650
  "video",
7638
7651
  {
7639
7652
  ref: setRefs,
@@ -7654,7 +7667,7 @@ var Video = React43.forwardRef((props, ref) => {
7654
7667
  children
7655
7668
  }
7656
7669
  ),
7657
- showCenterPlay && /* @__PURE__ */ jsx354(
7670
+ showCenterPlay && /* @__PURE__ */ jsx355(
7658
7671
  "button",
7659
7672
  {
7660
7673
  type: "button",
@@ -7666,11 +7679,11 @@ var Video = React43.forwardRef((props, ref) => {
7666
7679
  onClick: togglePlay,
7667
7680
  "aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
7668
7681
  tabIndex: -1,
7669
- children: /* @__PURE__ */ jsx354("span", { className: "center-play-icon", children: /* @__PURE__ */ jsx354(PlayCircleIcon_default, {}) })
7682
+ children: /* @__PURE__ */ jsx355("span", { className: "center-play-icon", children: /* @__PURE__ */ jsx355(PlayCircleIcon_default, {}) })
7670
7683
  }
7671
7684
  ),
7672
7685
  showControls && /* @__PURE__ */ jsxs225("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
7673
- /* @__PURE__ */ jsx354(
7686
+ /* @__PURE__ */ jsx355(
7674
7687
  "input",
7675
7688
  {
7676
7689
  type: "range",
@@ -7688,28 +7701,28 @@ var Video = React43.forwardRef((props, ref) => {
7688
7701
  }
7689
7702
  ),
7690
7703
  /* @__PURE__ */ jsxs225("div", { className: "controls-row", children: [
7691
- /* @__PURE__ */ jsx354(
7704
+ /* @__PURE__ */ jsx355(
7692
7705
  "button",
7693
7706
  {
7694
7707
  type: "button",
7695
7708
  className: "control-btn",
7696
7709
  onClick: togglePlay,
7697
7710
  "aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
7698
- children: isPlaying ? /* @__PURE__ */ jsx354(PauseIcon_default, {}) : /* @__PURE__ */ jsx354(PlayIcon_default, {})
7711
+ children: isPlaying ? /* @__PURE__ */ jsx355(PauseIcon_default, {}) : /* @__PURE__ */ jsx355(PlayIcon_default, {})
7699
7712
  }
7700
7713
  ),
7701
7714
  /* @__PURE__ */ jsxs225("div", { className: "volume-group", children: [
7702
- /* @__PURE__ */ jsx354(
7715
+ /* @__PURE__ */ jsx355(
7703
7716
  "button",
7704
7717
  {
7705
7718
  type: "button",
7706
7719
  className: "control-btn",
7707
7720
  onClick: toggleMute,
7708
7721
  "aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
7709
- children: /* @__PURE__ */ jsx354(VolumeGlyph, {})
7722
+ children: /* @__PURE__ */ jsx355(VolumeGlyph, {})
7710
7723
  }
7711
7724
  ),
7712
- /* @__PURE__ */ jsx354(
7725
+ /* @__PURE__ */ jsx355(
7713
7726
  "input",
7714
7727
  {
7715
7728
  type: "range",
@@ -7729,7 +7742,7 @@ var Video = React43.forwardRef((props, ref) => {
7729
7742
  " / ",
7730
7743
  formatTime(duration)
7731
7744
  ] }),
7732
- /* @__PURE__ */ jsx354("div", { className: "controls-spacer" }),
7745
+ /* @__PURE__ */ jsx355("div", { className: "controls-spacer" }),
7733
7746
  playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs225("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
7734
7747
  /* @__PURE__ */ jsxs225(
7735
7748
  "button",
@@ -7745,7 +7758,7 @@ var Video = React43.forwardRef((props, ref) => {
7745
7758
  ]
7746
7759
  }
7747
7760
  ),
7748
- rateMenuOpen && /* @__PURE__ */ jsx354("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ jsx354("li", { children: /* @__PURE__ */ jsxs225(
7761
+ rateMenuOpen && /* @__PURE__ */ jsx355("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ jsx355("li", { children: /* @__PURE__ */ jsxs225(
7749
7762
  "button",
7750
7763
  {
7751
7764
  type: "button",
@@ -7759,7 +7772,7 @@ var Video = React43.forwardRef((props, ref) => {
7759
7772
  }
7760
7773
  ) }, r2)) })
7761
7774
  ] }),
7762
- showCaptions && /* @__PURE__ */ jsx354(
7775
+ showCaptions && /* @__PURE__ */ jsx355(
7763
7776
  "button",
7764
7777
  {
7765
7778
  type: "button",
@@ -7767,37 +7780,37 @@ var Video = React43.forwardRef((props, ref) => {
7767
7780
  onClick: toggleCaptions,
7768
7781
  "aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
7769
7782
  "aria-pressed": captionsOn,
7770
- children: /* @__PURE__ */ jsx354(TypeIcon_default, {})
7783
+ children: /* @__PURE__ */ jsx355(TypeIcon_default, {})
7771
7784
  }
7772
7785
  ),
7773
- showPip && pipSupported && /* @__PURE__ */ jsx354(
7786
+ showPip && pipSupported && /* @__PURE__ */ jsx355(
7774
7787
  "button",
7775
7788
  {
7776
7789
  type: "button",
7777
7790
  className: clsx_default("control-btn", isPip && "is-active"),
7778
7791
  onClick: togglePip,
7779
7792
  "aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
7780
- children: /* @__PURE__ */ jsx354(PipIcon, {})
7793
+ children: /* @__PURE__ */ jsx355(PipIcon, {})
7781
7794
  }
7782
7795
  ),
7783
- showDownload && /* @__PURE__ */ jsx354(
7796
+ showDownload && /* @__PURE__ */ jsx355(
7784
7797
  "a",
7785
7798
  {
7786
7799
  className: "control-btn",
7787
7800
  href: src,
7788
7801
  download: downloadFileName ?? true,
7789
7802
  "aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
7790
- children: /* @__PURE__ */ jsx354(DownloadIcon_default, {})
7803
+ children: /* @__PURE__ */ jsx355(DownloadIcon_default, {})
7791
7804
  }
7792
7805
  ),
7793
- /* @__PURE__ */ jsx354(
7806
+ /* @__PURE__ */ jsx355(
7794
7807
  "button",
7795
7808
  {
7796
7809
  type: "button",
7797
7810
  className: "control-btn",
7798
7811
  onClick: toggleFullscreen,
7799
7812
  "aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
7800
- children: isFullscreen ? /* @__PURE__ */ jsx354(MinimizeIcon_default, {}) : /* @__PURE__ */ jsx354(MaximizeIcon_default, {})
7813
+ children: isFullscreen ? /* @__PURE__ */ jsx355(MinimizeIcon_default, {}) : /* @__PURE__ */ jsx355(MaximizeIcon_default, {})
7801
7814
  }
7802
7815
  )
7803
7816
  ] })
@@ -7868,6 +7881,7 @@ export {
7868
7881
  TextArea_default as TextArea,
7869
7882
  TimePicker_default as TimePicker,
7870
7883
  ToastProvider,
7884
+ ToggleChip_default as ToggleChip,
7871
7885
  Tooltip_default as Tooltip,
7872
7886
  Video_default as Video,
7873
7887
  hasError,