@x-plat/design-system 0.5.5 → 0.5.7

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.
@@ -1624,13 +1624,14 @@ var SingleDatePicker_default = SingleDatePicker;
1624
1624
  // src/components/DatePicker/InputDatePicker/index.tsx
1625
1625
  var import_jsx_runtime299 = require("react/jsx-runtime");
1626
1626
  var formatDate = (date) => {
1627
+ if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
1627
1628
  const y = date.getFullYear();
1628
1629
  const m = String(date.getMonth() + 1).padStart(2, "0");
1629
1630
  const d = String(date.getDate()).padStart(2, "0");
1630
1631
  return `${y}/${m}/${d}`;
1631
1632
  };
1632
1633
  var InputDatePicker = (props) => {
1633
- const { value, onChange, minDate, maxDate, disabled, locale } = props;
1634
+ const { value, onChange, minDate, maxDate, disabled, locale, placeholder } = props;
1634
1635
  const [isOpen, setIsOpen] = import_react7.default.useState(false);
1635
1636
  const containerRef = import_react7.default.useRef(null);
1636
1637
  const calendarRef = import_react7.default.useRef(null);
@@ -1640,27 +1641,42 @@ var InputDatePicker = (props) => {
1640
1641
  onChange?.(date);
1641
1642
  setIsOpen(false);
1642
1643
  };
1643
- return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)("div", { className: "lib-xplat-datepicker input-datepicker", ref: containerRef, children: [
1644
- /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { onClick: () => !disabled && setIsOpen(!isOpen), children: /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(
1645
- Input_default,
1646
- {
1647
- value: formatDate(value),
1648
- suffix: /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(CalenderIcon_default, {}),
1649
- disabled,
1650
- readOnly: true
1651
- }
1652
- ) }),
1653
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: "input-datepicker-dropdown", ref: calendarRef, children: /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(
1654
- SingleDatePicker_default,
1655
- {
1656
- value,
1657
- onChange: handleSelect,
1658
- minDate,
1659
- maxDate,
1660
- locale
1661
- }
1662
- ) })
1663
- ] });
1644
+ return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)(
1645
+ "div",
1646
+ {
1647
+ className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"),
1648
+ ref: containerRef,
1649
+ children: [
1650
+ /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(
1651
+ "div",
1652
+ {
1653
+ className: "input-datepicker-trigger",
1654
+ onClick: () => !disabled && setIsOpen((o) => !o),
1655
+ children: /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(
1656
+ Input_default,
1657
+ {
1658
+ value: formatDate(value),
1659
+ placeholder,
1660
+ suffix: /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(CalenderIcon_default, {}),
1661
+ disabled,
1662
+ readOnly: true
1663
+ }
1664
+ )
1665
+ }
1666
+ ),
1667
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: "input-datepicker-dropdown", ref: calendarRef, children: /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(
1668
+ SingleDatePicker_default,
1669
+ {
1670
+ value: value ?? /* @__PURE__ */ new Date(),
1671
+ onChange: handleSelect,
1672
+ minDate,
1673
+ maxDate,
1674
+ locale
1675
+ }
1676
+ ) })
1677
+ ]
1678
+ }
1679
+ );
1664
1680
  };
1665
1681
  InputDatePicker.displayName = "InputDatePicker";
1666
1682
  var InputDatePicker_default = InputDatePicker;
@@ -261,6 +261,7 @@
261
261
  .lib-xplat-datepicker.range {
262
262
  display: flex;
263
263
  flex-direction: column;
264
+ container-type: inline-size;
264
265
  }
265
266
  .lib-xplat-datepicker .datepicker-range-tabs {
266
267
  display: none;
@@ -303,7 +304,7 @@
303
304
  color: var(--semantic-text-muted);
304
305
  margin-bottom: var(--spacing-space-2);
305
306
  }
306
- @media (max-width: 600px) {
307
+ @container (max-width: 600px) {
307
308
  .lib-xplat-datepicker .datepicker-range-tabs {
308
309
  display: flex;
309
310
  }
@@ -320,6 +321,18 @@
320
321
  .lib-xplat-datepicker.input-datepicker {
321
322
  position: relative;
322
323
  }
324
+ .lib-xplat-datepicker.input-datepicker .input-datepicker-trigger {
325
+ cursor: pointer;
326
+ }
327
+ .lib-xplat-datepicker.input-datepicker .input-datepicker-trigger input {
328
+ cursor: pointer;
329
+ }
330
+ .lib-xplat-datepicker.input-datepicker.disabled .input-datepicker-trigger {
331
+ cursor: not-allowed;
332
+ }
333
+ .lib-xplat-datepicker.input-datepicker.disabled .input-datepicker-trigger input {
334
+ cursor: not-allowed;
335
+ }
323
336
  .lib-xplat-datepicker.input-datepicker .input-datepicker-dropdown {
324
337
  position: absolute;
325
338
  top: 100%;
@@ -2,12 +2,13 @@ import React from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
 
4
4
  interface InputDatePickerProps {
5
- value: Date;
5
+ value?: Date | null;
6
6
  onChange?: (date: Date) => void;
7
7
  minDate?: Date;
8
8
  maxDate?: Date;
9
9
  disabled?: boolean;
10
10
  locale?: "ko" | "en";
11
+ placeholder?: string;
11
12
  }
12
13
  declare const InputDatePicker: React.FC<InputDatePickerProps>;
13
14
 
@@ -2,12 +2,13 @@ import React from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
 
4
4
  interface InputDatePickerProps {
5
- value: Date;
5
+ value?: Date | null;
6
6
  onChange?: (date: Date) => void;
7
7
  minDate?: Date;
8
8
  maxDate?: Date;
9
9
  disabled?: boolean;
10
10
  locale?: "ko" | "en";
11
+ placeholder?: string;
11
12
  }
12
13
  declare const InputDatePicker: React.FC<InputDatePickerProps>;
13
14
 
@@ -1585,13 +1585,14 @@ var SingleDatePicker_default = SingleDatePicker;
1585
1585
  // src/components/DatePicker/InputDatePicker/index.tsx
1586
1586
  import { jsx as jsx299, jsxs as jsxs192 } from "react/jsx-runtime";
1587
1587
  var formatDate = (date) => {
1588
+ if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
1588
1589
  const y = date.getFullYear();
1589
1590
  const m = String(date.getMonth() + 1).padStart(2, "0");
1590
1591
  const d = String(date.getDate()).padStart(2, "0");
1591
1592
  return `${y}/${m}/${d}`;
1592
1593
  };
1593
1594
  var InputDatePicker = (props) => {
1594
- const { value, onChange, minDate, maxDate, disabled, locale } = props;
1595
+ const { value, onChange, minDate, maxDate, disabled, locale, placeholder } = props;
1595
1596
  const [isOpen, setIsOpen] = React6.useState(false);
1596
1597
  const containerRef = React6.useRef(null);
1597
1598
  const calendarRef = React6.useRef(null);
@@ -1601,27 +1602,42 @@ var InputDatePicker = (props) => {
1601
1602
  onChange?.(date);
1602
1603
  setIsOpen(false);
1603
1604
  };
1604
- return /* @__PURE__ */ jsxs192("div", { className: "lib-xplat-datepicker input-datepicker", ref: containerRef, children: [
1605
- /* @__PURE__ */ jsx299("div", { onClick: () => !disabled && setIsOpen(!isOpen), children: /* @__PURE__ */ jsx299(
1606
- Input_default,
1607
- {
1608
- value: formatDate(value),
1609
- suffix: /* @__PURE__ */ jsx299(CalenderIcon_default, {}),
1610
- disabled,
1611
- readOnly: true
1612
- }
1613
- ) }),
1614
- isOpen && /* @__PURE__ */ jsx299("div", { className: "input-datepicker-dropdown", ref: calendarRef, children: /* @__PURE__ */ jsx299(
1615
- SingleDatePicker_default,
1616
- {
1617
- value,
1618
- onChange: handleSelect,
1619
- minDate,
1620
- maxDate,
1621
- locale
1622
- }
1623
- ) })
1624
- ] });
1605
+ return /* @__PURE__ */ jsxs192(
1606
+ "div",
1607
+ {
1608
+ className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"),
1609
+ ref: containerRef,
1610
+ children: [
1611
+ /* @__PURE__ */ jsx299(
1612
+ "div",
1613
+ {
1614
+ className: "input-datepicker-trigger",
1615
+ onClick: () => !disabled && setIsOpen((o) => !o),
1616
+ children: /* @__PURE__ */ jsx299(
1617
+ Input_default,
1618
+ {
1619
+ value: formatDate(value),
1620
+ placeholder,
1621
+ suffix: /* @__PURE__ */ jsx299(CalenderIcon_default, {}),
1622
+ disabled,
1623
+ readOnly: true
1624
+ }
1625
+ )
1626
+ }
1627
+ ),
1628
+ isOpen && /* @__PURE__ */ jsx299("div", { className: "input-datepicker-dropdown", ref: calendarRef, children: /* @__PURE__ */ jsx299(
1629
+ SingleDatePicker_default,
1630
+ {
1631
+ value: value ?? /* @__PURE__ */ new Date(),
1632
+ onChange: handleSelect,
1633
+ minDate,
1634
+ maxDate,
1635
+ locale
1636
+ }
1637
+ ) })
1638
+ ]
1639
+ }
1640
+ );
1625
1641
  };
1626
1642
  InputDatePicker.displayName = "InputDatePicker";
1627
1643
  var InputDatePicker_default = InputDatePicker;
@@ -4,6 +4,7 @@
4
4
  width: 100%;
5
5
  height: 100%;
6
6
  position: relative;
7
+ overflow: auto;
7
8
  }
8
9
  .lib-xplat-table-wrapper > .lib-xplat-table {
9
10
  width: 100%;
@@ -634,7 +634,7 @@ var Video = import_react.default.forwardRef((props, ref) => {
634
634
  onTimeUpdate: handleTimeUpdate,
635
635
  onVolumeChange: handleVolumeChange,
636
636
  onRateChange: handleRateChange,
637
- onClick: togglePlay,
637
+ onClick: showControls || showCenterPlay ? togglePlay : void 0,
638
638
  ...rest,
639
639
  children
640
640
  }
@@ -14,6 +14,9 @@
14
14
  max-height: 100%;
15
15
  object-fit: contain;
16
16
  vertical-align: middle;
17
+ }
18
+ .lib-xplat-video.has-controls > video,
19
+ .lib-xplat-video:has(> .center-play) > video {
17
20
  cursor: pointer;
18
21
  }
19
22
  .lib-xplat-video > .center-play {
@@ -176,6 +179,9 @@
176
179
  appearance: none;
177
180
  background: transparent;
178
181
  cursor: pointer;
182
+ margin: 0;
183
+ padding: 0;
184
+ align-self: center;
179
185
  }
180
186
  .lib-xplat-video .seekbar:focus,
181
187
  .lib-xplat-video .volume-slider:focus {
@@ -187,6 +193,7 @@
187
193
  appearance: none;
188
194
  width: 12px;
189
195
  height: 12px;
196
+ margin-top: -4px;
190
197
  border-radius: 50%;
191
198
  background: #fff;
192
199
  border: none;
@@ -598,7 +598,7 @@ var Video = React.forwardRef((props, ref) => {
598
598
  onTimeUpdate: handleTimeUpdate,
599
599
  onVolumeChange: handleVolumeChange,
600
600
  onRateChange: handleRateChange,
601
- onClick: togglePlay,
601
+ onClick: showControls || showCenterPlay ? togglePlay : void 0,
602
602
  ...rest,
603
603
  children
604
604
  }
@@ -2802,13 +2802,14 @@ var SingleDatePicker_default = SingleDatePicker;
2802
2802
  // src/components/DatePicker/InputDatePicker/index.tsx
2803
2803
  var import_jsx_runtime312 = require("react/jsx-runtime");
2804
2804
  var formatDate = (date) => {
2805
+ if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
2805
2806
  const y = date.getFullYear();
2806
2807
  const m = String(date.getMonth() + 1).padStart(2, "0");
2807
2808
  const d = String(date.getDate()).padStart(2, "0");
2808
2809
  return `${y}/${m}/${d}`;
2809
2810
  };
2810
2811
  var InputDatePicker = (props) => {
2811
- const { value, onChange, minDate, maxDate, disabled, locale } = props;
2812
+ const { value, onChange, minDate, maxDate, disabled, locale, placeholder } = props;
2812
2813
  const [isOpen, setIsOpen] = import_react11.default.useState(false);
2813
2814
  const containerRef = import_react11.default.useRef(null);
2814
2815
  const calendarRef = import_react11.default.useRef(null);
@@ -2818,27 +2819,42 @@ var InputDatePicker = (props) => {
2818
2819
  onChange?.(date);
2819
2820
  setIsOpen(false);
2820
2821
  };
2821
- return /* @__PURE__ */ (0, import_jsx_runtime312.jsxs)("div", { className: "lib-xplat-datepicker input-datepicker", ref: containerRef, children: [
2822
- /* @__PURE__ */ (0, import_jsx_runtime312.jsx)("div", { onClick: () => !disabled && setIsOpen(!isOpen), children: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
2823
- Input_default,
2824
- {
2825
- value: formatDate(value),
2826
- suffix: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(CalenderIcon_default, {}),
2827
- disabled,
2828
- readOnly: true
2829
- }
2830
- ) }),
2831
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime312.jsx)("div", { className: "input-datepicker-dropdown", ref: calendarRef, children: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
2832
- SingleDatePicker_default,
2833
- {
2834
- value,
2835
- onChange: handleSelect,
2836
- minDate,
2837
- maxDate,
2838
- locale
2839
- }
2840
- ) })
2841
- ] });
2822
+ return /* @__PURE__ */ (0, import_jsx_runtime312.jsxs)(
2823
+ "div",
2824
+ {
2825
+ className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"),
2826
+ ref: containerRef,
2827
+ children: [
2828
+ /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
2829
+ "div",
2830
+ {
2831
+ className: "input-datepicker-trigger",
2832
+ onClick: () => !disabled && setIsOpen((o) => !o),
2833
+ children: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
2834
+ Input_default,
2835
+ {
2836
+ value: formatDate(value),
2837
+ placeholder,
2838
+ suffix: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(CalenderIcon_default, {}),
2839
+ disabled,
2840
+ readOnly: true
2841
+ }
2842
+ )
2843
+ }
2844
+ ),
2845
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime312.jsx)("div", { className: "input-datepicker-dropdown", ref: calendarRef, children: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
2846
+ SingleDatePicker_default,
2847
+ {
2848
+ value: value ?? /* @__PURE__ */ new Date(),
2849
+ onChange: handleSelect,
2850
+ minDate,
2851
+ maxDate,
2852
+ locale
2853
+ }
2854
+ ) })
2855
+ ]
2856
+ }
2857
+ );
2842
2858
  };
2843
2859
  InputDatePicker.displayName = "InputDatePicker";
2844
2860
  var InputDatePicker_default = InputDatePicker;
@@ -5056,7 +5072,7 @@ var Video = import_react39.default.forwardRef((props, ref) => {
5056
5072
  onTimeUpdate: handleTimeUpdate,
5057
5073
  onVolumeChange: handleVolumeChange,
5058
5074
  onRateChange: handleRateChange,
5059
- onClick: togglePlay,
5075
+ onClick: showControls || showCenterPlay ? togglePlay : void 0,
5060
5076
  ...rest,
5061
5077
  children
5062
5078
  }
@@ -2244,6 +2244,7 @@
2244
2244
  .lib-xplat-datepicker.range {
2245
2245
  display: flex;
2246
2246
  flex-direction: column;
2247
+ container-type: inline-size;
2247
2248
  }
2248
2249
  .lib-xplat-datepicker .datepicker-range-tabs {
2249
2250
  display: none;
@@ -2286,7 +2287,7 @@
2286
2287
  color: var(--semantic-text-muted);
2287
2288
  margin-bottom: var(--spacing-space-2);
2288
2289
  }
2289
- @media (max-width: 600px) {
2290
+ @container (max-width: 600px) {
2290
2291
  .lib-xplat-datepicker .datepicker-range-tabs {
2291
2292
  display: flex;
2292
2293
  }
@@ -2303,6 +2304,18 @@
2303
2304
  .lib-xplat-datepicker.input-datepicker {
2304
2305
  position: relative;
2305
2306
  }
2307
+ .lib-xplat-datepicker.input-datepicker .input-datepicker-trigger {
2308
+ cursor: pointer;
2309
+ }
2310
+ .lib-xplat-datepicker.input-datepicker .input-datepicker-trigger input {
2311
+ cursor: pointer;
2312
+ }
2313
+ .lib-xplat-datepicker.input-datepicker.disabled .input-datepicker-trigger {
2314
+ cursor: not-allowed;
2315
+ }
2316
+ .lib-xplat-datepicker.input-datepicker.disabled .input-datepicker-trigger input {
2317
+ cursor: not-allowed;
2318
+ }
2306
2319
  .lib-xplat-datepicker.input-datepicker .input-datepicker-dropdown {
2307
2320
  position: absolute;
2308
2321
  top: 100%;
@@ -3609,6 +3622,7 @@
3609
3622
  width: 100%;
3610
3623
  height: 100%;
3611
3624
  position: relative;
3625
+ overflow: auto;
3612
3626
  }
3613
3627
  .lib-xplat-table-wrapper > .lib-xplat-table {
3614
3628
  width: 100%;
@@ -4078,6 +4092,9 @@
4078
4092
  max-height: 100%;
4079
4093
  object-fit: contain;
4080
4094
  vertical-align: middle;
4095
+ }
4096
+ .lib-xplat-video.has-controls > video,
4097
+ .lib-xplat-video:has(> .center-play) > video {
4081
4098
  cursor: pointer;
4082
4099
  }
4083
4100
  .lib-xplat-video > .center-play {
@@ -4240,6 +4257,9 @@
4240
4257
  appearance: none;
4241
4258
  background: transparent;
4242
4259
  cursor: pointer;
4260
+ margin: 0;
4261
+ padding: 0;
4262
+ align-self: center;
4243
4263
  }
4244
4264
  .lib-xplat-video .seekbar:focus,
4245
4265
  .lib-xplat-video .volume-slider:focus {
@@ -4251,6 +4271,7 @@
4251
4271
  appearance: none;
4252
4272
  width: 12px;
4253
4273
  height: 12px;
4274
+ margin-top: -4px;
4254
4275
  border-radius: 50%;
4255
4276
  background: #fff;
4256
4277
  border: none;
@@ -2714,13 +2714,14 @@ var SingleDatePicker_default = SingleDatePicker;
2714
2714
  // src/components/DatePicker/InputDatePicker/index.tsx
2715
2715
  import { jsx as jsx312, jsxs as jsxs201 } from "react/jsx-runtime";
2716
2716
  var formatDate = (date) => {
2717
+ if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
2717
2718
  const y = date.getFullYear();
2718
2719
  const m = String(date.getMonth() + 1).padStart(2, "0");
2719
2720
  const d = String(date.getDate()).padStart(2, "0");
2720
2721
  return `${y}/${m}/${d}`;
2721
2722
  };
2722
2723
  var InputDatePicker = (props) => {
2723
- const { value, onChange, minDate, maxDate, disabled, locale } = props;
2724
+ const { value, onChange, minDate, maxDate, disabled, locale, placeholder } = props;
2724
2725
  const [isOpen, setIsOpen] = React10.useState(false);
2725
2726
  const containerRef = React10.useRef(null);
2726
2727
  const calendarRef = React10.useRef(null);
@@ -2730,27 +2731,42 @@ var InputDatePicker = (props) => {
2730
2731
  onChange?.(date);
2731
2732
  setIsOpen(false);
2732
2733
  };
2733
- return /* @__PURE__ */ jsxs201("div", { className: "lib-xplat-datepicker input-datepicker", ref: containerRef, children: [
2734
- /* @__PURE__ */ jsx312("div", { onClick: () => !disabled && setIsOpen(!isOpen), children: /* @__PURE__ */ jsx312(
2735
- Input_default,
2736
- {
2737
- value: formatDate(value),
2738
- suffix: /* @__PURE__ */ jsx312(CalenderIcon_default, {}),
2739
- disabled,
2740
- readOnly: true
2741
- }
2742
- ) }),
2743
- isOpen && /* @__PURE__ */ jsx312("div", { className: "input-datepicker-dropdown", ref: calendarRef, children: /* @__PURE__ */ jsx312(
2744
- SingleDatePicker_default,
2745
- {
2746
- value,
2747
- onChange: handleSelect,
2748
- minDate,
2749
- maxDate,
2750
- locale
2751
- }
2752
- ) })
2753
- ] });
2734
+ return /* @__PURE__ */ jsxs201(
2735
+ "div",
2736
+ {
2737
+ className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"),
2738
+ ref: containerRef,
2739
+ children: [
2740
+ /* @__PURE__ */ jsx312(
2741
+ "div",
2742
+ {
2743
+ className: "input-datepicker-trigger",
2744
+ onClick: () => !disabled && setIsOpen((o) => !o),
2745
+ children: /* @__PURE__ */ jsx312(
2746
+ Input_default,
2747
+ {
2748
+ value: formatDate(value),
2749
+ placeholder,
2750
+ suffix: /* @__PURE__ */ jsx312(CalenderIcon_default, {}),
2751
+ disabled,
2752
+ readOnly: true
2753
+ }
2754
+ )
2755
+ }
2756
+ ),
2757
+ isOpen && /* @__PURE__ */ jsx312("div", { className: "input-datepicker-dropdown", ref: calendarRef, children: /* @__PURE__ */ jsx312(
2758
+ SingleDatePicker_default,
2759
+ {
2760
+ value: value ?? /* @__PURE__ */ new Date(),
2761
+ onChange: handleSelect,
2762
+ minDate,
2763
+ maxDate,
2764
+ locale
2765
+ }
2766
+ ) })
2767
+ ]
2768
+ }
2769
+ );
2754
2770
  };
2755
2771
  InputDatePicker.displayName = "InputDatePicker";
2756
2772
  var InputDatePicker_default = InputDatePicker;
@@ -4968,7 +4984,7 @@ var Video = React38.forwardRef((props, ref) => {
4968
4984
  onTimeUpdate: handleTimeUpdate,
4969
4985
  onVolumeChange: handleVolumeChange,
4970
4986
  onRateChange: handleRateChange,
4971
- onClick: togglePlay,
4987
+ onClick: showControls || showCenterPlay ? togglePlay : void 0,
4972
4988
  ...rest,
4973
4989
  children
4974
4990
  }
package/dist/index.cjs CHANGED
@@ -7226,13 +7226,14 @@ var SingleDatePicker_default = SingleDatePicker;
7226
7226
  // src/components/DatePicker/InputDatePicker/index.tsx
7227
7227
  var import_jsx_runtime312 = require("react/jsx-runtime");
7228
7228
  var formatDate = (date) => {
7229
+ if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
7229
7230
  const y = date.getFullYear();
7230
7231
  const m = String(date.getMonth() + 1).padStart(2, "0");
7231
7232
  const d = String(date.getDate()).padStart(2, "0");
7232
7233
  return `${y}/${m}/${d}`;
7233
7234
  };
7234
7235
  var InputDatePicker = (props) => {
7235
- const { value, onChange, minDate, maxDate, disabled, locale } = props;
7236
+ const { value, onChange, minDate, maxDate, disabled, locale, placeholder } = props;
7236
7237
  const [isOpen, setIsOpen] = import_react11.default.useState(false);
7237
7238
  const containerRef = import_react11.default.useRef(null);
7238
7239
  const calendarRef = import_react11.default.useRef(null);
@@ -7242,27 +7243,42 @@ var InputDatePicker = (props) => {
7242
7243
  onChange?.(date);
7243
7244
  setIsOpen(false);
7244
7245
  };
7245
- return /* @__PURE__ */ (0, import_jsx_runtime312.jsxs)("div", { className: "lib-xplat-datepicker input-datepicker", ref: containerRef, children: [
7246
- /* @__PURE__ */ (0, import_jsx_runtime312.jsx)("div", { onClick: () => !disabled && setIsOpen(!isOpen), children: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
7247
- Input_default,
7248
- {
7249
- value: formatDate(value),
7250
- suffix: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(CalenderIcon_default, {}),
7251
- disabled,
7252
- readOnly: true
7253
- }
7254
- ) }),
7255
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime312.jsx)("div", { className: "input-datepicker-dropdown", ref: calendarRef, children: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
7256
- SingleDatePicker_default,
7257
- {
7258
- value,
7259
- onChange: handleSelect,
7260
- minDate,
7261
- maxDate,
7262
- locale
7263
- }
7264
- ) })
7265
- ] });
7246
+ return /* @__PURE__ */ (0, import_jsx_runtime312.jsxs)(
7247
+ "div",
7248
+ {
7249
+ className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"),
7250
+ ref: containerRef,
7251
+ children: [
7252
+ /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
7253
+ "div",
7254
+ {
7255
+ className: "input-datepicker-trigger",
7256
+ onClick: () => !disabled && setIsOpen((o) => !o),
7257
+ children: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
7258
+ Input_default,
7259
+ {
7260
+ value: formatDate(value),
7261
+ placeholder,
7262
+ suffix: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(CalenderIcon_default, {}),
7263
+ disabled,
7264
+ readOnly: true
7265
+ }
7266
+ )
7267
+ }
7268
+ ),
7269
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime312.jsx)("div", { className: "input-datepicker-dropdown", ref: calendarRef, children: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
7270
+ SingleDatePicker_default,
7271
+ {
7272
+ value: value ?? /* @__PURE__ */ new Date(),
7273
+ onChange: handleSelect,
7274
+ minDate,
7275
+ maxDate,
7276
+ locale
7277
+ }
7278
+ ) })
7279
+ ]
7280
+ }
7281
+ );
7266
7282
  };
7267
7283
  InputDatePicker.displayName = "InputDatePicker";
7268
7284
  var InputDatePicker_default = InputDatePicker;
@@ -9480,7 +9496,7 @@ var Video = import_react39.default.forwardRef((props, ref) => {
9480
9496
  onTimeUpdate: handleTimeUpdate,
9481
9497
  onVolumeChange: handleVolumeChange,
9482
9498
  onRateChange: handleRateChange,
9483
- onClick: togglePlay,
9499
+ onClick: showControls || showCenterPlay ? togglePlay : void 0,
9484
9500
  ...rest,
9485
9501
  children
9486
9502
  }
package/dist/index.css CHANGED
@@ -2244,6 +2244,7 @@
2244
2244
  .lib-xplat-datepicker.range {
2245
2245
  display: flex;
2246
2246
  flex-direction: column;
2247
+ container-type: inline-size;
2247
2248
  }
2248
2249
  .lib-xplat-datepicker .datepicker-range-tabs {
2249
2250
  display: none;
@@ -2286,7 +2287,7 @@
2286
2287
  color: var(--semantic-text-muted);
2287
2288
  margin-bottom: var(--spacing-space-2);
2288
2289
  }
2289
- @media (max-width: 600px) {
2290
+ @container (max-width: 600px) {
2290
2291
  .lib-xplat-datepicker .datepicker-range-tabs {
2291
2292
  display: flex;
2292
2293
  }
@@ -2303,6 +2304,18 @@
2303
2304
  .lib-xplat-datepicker.input-datepicker {
2304
2305
  position: relative;
2305
2306
  }
2307
+ .lib-xplat-datepicker.input-datepicker .input-datepicker-trigger {
2308
+ cursor: pointer;
2309
+ }
2310
+ .lib-xplat-datepicker.input-datepicker .input-datepicker-trigger input {
2311
+ cursor: pointer;
2312
+ }
2313
+ .lib-xplat-datepicker.input-datepicker.disabled .input-datepicker-trigger {
2314
+ cursor: not-allowed;
2315
+ }
2316
+ .lib-xplat-datepicker.input-datepicker.disabled .input-datepicker-trigger input {
2317
+ cursor: not-allowed;
2318
+ }
2306
2319
  .lib-xplat-datepicker.input-datepicker .input-datepicker-dropdown {
2307
2320
  position: absolute;
2308
2321
  top: 100%;
@@ -3609,6 +3622,7 @@
3609
3622
  width: 100%;
3610
3623
  height: 100%;
3611
3624
  position: relative;
3625
+ overflow: auto;
3612
3626
  }
3613
3627
  .lib-xplat-table-wrapper > .lib-xplat-table {
3614
3628
  width: 100%;
@@ -4078,6 +4092,9 @@
4078
4092
  max-height: 100%;
4079
4093
  object-fit: contain;
4080
4094
  vertical-align: middle;
4095
+ }
4096
+ .lib-xplat-video.has-controls > video,
4097
+ .lib-xplat-video:has(> .center-play) > video {
4081
4098
  cursor: pointer;
4082
4099
  }
4083
4100
  .lib-xplat-video > .center-play {
@@ -4240,6 +4257,9 @@
4240
4257
  appearance: none;
4241
4258
  background: transparent;
4242
4259
  cursor: pointer;
4260
+ margin: 0;
4261
+ padding: 0;
4262
+ align-self: center;
4243
4263
  }
4244
4264
  .lib-xplat-video .seekbar:focus,
4245
4265
  .lib-xplat-video .volume-slider:focus {
@@ -4251,6 +4271,7 @@
4251
4271
  appearance: none;
4252
4272
  width: 12px;
4253
4273
  height: 12px;
4274
+ margin-top: -4px;
4254
4275
  border-radius: 50%;
4255
4276
  background: #fff;
4256
4277
  border: none;
package/dist/index.js CHANGED
@@ -6829,13 +6829,14 @@ var SingleDatePicker_default = SingleDatePicker;
6829
6829
  // src/components/DatePicker/InputDatePicker/index.tsx
6830
6830
  import { jsx as jsx312, jsxs as jsxs201 } from "react/jsx-runtime";
6831
6831
  var formatDate = (date) => {
6832
+ if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
6832
6833
  const y = date.getFullYear();
6833
6834
  const m = String(date.getMonth() + 1).padStart(2, "0");
6834
6835
  const d = String(date.getDate()).padStart(2, "0");
6835
6836
  return `${y}/${m}/${d}`;
6836
6837
  };
6837
6838
  var InputDatePicker = (props) => {
6838
- const { value, onChange, minDate, maxDate, disabled, locale } = props;
6839
+ const { value, onChange, minDate, maxDate, disabled, locale, placeholder } = props;
6839
6840
  const [isOpen, setIsOpen] = React10.useState(false);
6840
6841
  const containerRef = React10.useRef(null);
6841
6842
  const calendarRef = React10.useRef(null);
@@ -6845,27 +6846,42 @@ var InputDatePicker = (props) => {
6845
6846
  onChange?.(date);
6846
6847
  setIsOpen(false);
6847
6848
  };
6848
- return /* @__PURE__ */ jsxs201("div", { className: "lib-xplat-datepicker input-datepicker", ref: containerRef, children: [
6849
- /* @__PURE__ */ jsx312("div", { onClick: () => !disabled && setIsOpen(!isOpen), children: /* @__PURE__ */ jsx312(
6850
- Input_default,
6851
- {
6852
- value: formatDate(value),
6853
- suffix: /* @__PURE__ */ jsx312(CalenderIcon_default, {}),
6854
- disabled,
6855
- readOnly: true
6856
- }
6857
- ) }),
6858
- isOpen && /* @__PURE__ */ jsx312("div", { className: "input-datepicker-dropdown", ref: calendarRef, children: /* @__PURE__ */ jsx312(
6859
- SingleDatePicker_default,
6860
- {
6861
- value,
6862
- onChange: handleSelect,
6863
- minDate,
6864
- maxDate,
6865
- locale
6866
- }
6867
- ) })
6868
- ] });
6849
+ return /* @__PURE__ */ jsxs201(
6850
+ "div",
6851
+ {
6852
+ className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"),
6853
+ ref: containerRef,
6854
+ children: [
6855
+ /* @__PURE__ */ jsx312(
6856
+ "div",
6857
+ {
6858
+ className: "input-datepicker-trigger",
6859
+ onClick: () => !disabled && setIsOpen((o) => !o),
6860
+ children: /* @__PURE__ */ jsx312(
6861
+ Input_default,
6862
+ {
6863
+ value: formatDate(value),
6864
+ placeholder,
6865
+ suffix: /* @__PURE__ */ jsx312(CalenderIcon_default, {}),
6866
+ disabled,
6867
+ readOnly: true
6868
+ }
6869
+ )
6870
+ }
6871
+ ),
6872
+ isOpen && /* @__PURE__ */ jsx312("div", { className: "input-datepicker-dropdown", ref: calendarRef, children: /* @__PURE__ */ jsx312(
6873
+ SingleDatePicker_default,
6874
+ {
6875
+ value: value ?? /* @__PURE__ */ new Date(),
6876
+ onChange: handleSelect,
6877
+ minDate,
6878
+ maxDate,
6879
+ locale
6880
+ }
6881
+ ) })
6882
+ ]
6883
+ }
6884
+ );
6869
6885
  };
6870
6886
  InputDatePicker.displayName = "InputDatePicker";
6871
6887
  var InputDatePicker_default = InputDatePicker;
@@ -9083,7 +9099,7 @@ var Video = React38.forwardRef((props, ref) => {
9083
9099
  onTimeUpdate: handleTimeUpdate,
9084
9100
  onVolumeChange: handleVolumeChange,
9085
9101
  onRateChange: handleRateChange,
9086
- onClick: togglePlay,
9102
+ onClick: showControls || showCenterPlay ? togglePlay : void 0,
9087
9103
  ...rest,
9088
9104
  children
9089
9105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-plat/design-system",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "XPLAT UI Design System",
5
5
  "author": "XPLAT WOONG",
6
6
  "main": "dist/index.cjs",