@x-plat/design-system 0.3.8 → 0.3.9

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.
@@ -92,6 +92,12 @@
92
92
  .lib-xplat-calendar .calendar-day.outside .calendar-day-number {
93
93
  color: var(--xplat-neutral-300);
94
94
  }
95
+ .lib-xplat-calendar .calendar-day.outside.sunday .calendar-day-number {
96
+ color: color-mix(in srgb, var(--xplat-red-500) 35%, transparent);
97
+ }
98
+ .lib-xplat-calendar .calendar-day.outside.saturday .calendar-day-number {
99
+ color: color-mix(in srgb, var(--xplat-blue-500) 35%, transparent);
100
+ }
95
101
  .lib-xplat-calendar .calendar-day.disabled {
96
102
  cursor: not-allowed;
97
103
  }
@@ -103,12 +109,12 @@
103
109
  font-weight: 700;
104
110
  color: var(--xplat-blue-600);
105
111
  }
106
- .lib-xplat-calendar .calendar-day.today .calendar-day-number::after {
112
+ .lib-xplat-calendar .calendar-day.today .calendar-day-number::before {
107
113
  content: "";
108
114
  position: absolute;
109
- bottom: -2px;
110
- left: 50%;
111
- transform: translateX(-50%);
115
+ top: 50%;
116
+ left: -6px;
117
+ transform: translateY(-50%);
112
118
  width: 4px;
113
119
  height: 4px;
114
120
  border-radius: 50%;
@@ -124,13 +130,13 @@
124
130
  .lib-xplat-calendar .calendar-day.selected:hover {
125
131
  background-color: var(--xplat-neutral-800);
126
132
  }
127
- .lib-xplat-calendar .calendar-day.selected.today .calendar-day-number::after {
133
+ .lib-xplat-calendar .calendar-day.selected.today .calendar-day-number::before {
128
134
  background-color: var(--xplat-white);
129
135
  }
130
- .lib-xplat-calendar .calendar-day.sunday .calendar-day-number {
136
+ .lib-xplat-calendar .calendar-day.sunday:not(.outside) .calendar-day-number {
131
137
  color: var(--xplat-red-500);
132
138
  }
133
- .lib-xplat-calendar .calendar-day.saturday .calendar-day-number {
139
+ .lib-xplat-calendar .calendar-day.saturday:not(.outside) .calendar-day-number {
134
140
  color: var(--xplat-blue-500);
135
141
  }
136
142
  .lib-xplat-calendar .calendar-day.selected .calendar-day-number {
@@ -1450,6 +1450,34 @@ var MONTH_LABELS = {
1450
1450
 
1451
1451
  // src/components/DatePicker/SingleDatePicker/index.tsx
1452
1452
  var import_jsx_runtime298 = require("react/jsx-runtime");
1453
+ var DayCell = import_react6.default.memo(
1454
+ ({
1455
+ day,
1456
+ disabled,
1457
+ selected,
1458
+ highlighted,
1459
+ onClick
1460
+ }) => /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(
1461
+ "button",
1462
+ {
1463
+ type: "button",
1464
+ className: clsx_default(
1465
+ "datepicker-day",
1466
+ !day.isCurrentMonth && "outside",
1467
+ disabled && "disabled",
1468
+ selected && "selected",
1469
+ highlighted && !selected && "highlighted",
1470
+ day.isToday && "today",
1471
+ day.isSunday && "sunday",
1472
+ day.isSaturday && "saturday"
1473
+ ),
1474
+ disabled: disabled || !day.isCurrentMonth,
1475
+ onClick,
1476
+ children: day.day
1477
+ }
1478
+ )
1479
+ );
1480
+ DayCell.displayName = "DayCell";
1453
1481
  var SingleDatePicker = (props) => {
1454
1482
  const {
1455
1483
  value,
@@ -1481,6 +1509,12 @@ var SingleDatePicker = (props) => {
1481
1509
  }
1482
1510
  return set;
1483
1511
  }, [highlightDates]);
1512
+ const handleSelect = import_react6.default.useCallback(
1513
+ (date) => {
1514
+ onChange?.(date);
1515
+ },
1516
+ [onChange]
1517
+ );
1484
1518
  const weekdays = WEEKDAY_LABELS[locale];
1485
1519
  return /* @__PURE__ */ (0, import_jsx_runtime298.jsxs)(
1486
1520
  "div",
@@ -1513,26 +1547,15 @@ var SingleDatePicker = (props) => {
1513
1547
  `${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
1514
1548
  );
1515
1549
  return /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(
1516
- "button",
1550
+ DayCell,
1517
1551
  {
1518
- type: "button",
1519
- className: clsx_default(
1520
- "datepicker-day",
1521
- !day.isCurrentMonth && "outside",
1522
- disabled && "disabled",
1523
- selected && "selected",
1524
- highlighted && !selected && "highlighted",
1525
- day.isToday && "today",
1526
- day.isSunday && "sunday",
1527
- day.isSaturday && "saturday"
1528
- ),
1529
- disabled: disabled || !day.isCurrentMonth,
1552
+ day,
1553
+ disabled,
1554
+ selected,
1555
+ highlighted,
1530
1556
  onClick: () => {
1531
- if (!disabled && day.isCurrentMonth) {
1532
- onChange?.(day.date);
1533
- }
1534
- },
1535
- children: day.day
1557
+ if (!disabled && day.isCurrentMonth) handleSelect(day.date);
1558
+ }
1536
1559
  },
1537
1560
  idx
1538
1561
  );
@@ -167,6 +167,12 @@
167
167
  color: var(--xplat-neutral-300);
168
168
  cursor: default;
169
169
  }
170
+ .lib-xplat-datepicker .datepicker-day.outside.sunday {
171
+ color: color-mix(in srgb, var(--xplat-red-500) 35%, transparent);
172
+ }
173
+ .lib-xplat-datepicker .datepicker-day.outside.saturday {
174
+ color: color-mix(in srgb, var(--xplat-blue-500) 35%, transparent);
175
+ }
170
176
  .lib-xplat-datepicker .datepicker-day.disabled {
171
177
  color: var(--xplat-neutral-300);
172
178
  cursor: not-allowed;
@@ -1411,6 +1411,34 @@ var MONTH_LABELS = {
1411
1411
 
1412
1412
  // src/components/DatePicker/SingleDatePicker/index.tsx
1413
1413
  import { jsx as jsx298, jsxs as jsxs191 } from "react/jsx-runtime";
1414
+ var DayCell = React5.memo(
1415
+ ({
1416
+ day,
1417
+ disabled,
1418
+ selected,
1419
+ highlighted,
1420
+ onClick
1421
+ }) => /* @__PURE__ */ jsx298(
1422
+ "button",
1423
+ {
1424
+ type: "button",
1425
+ className: clsx_default(
1426
+ "datepicker-day",
1427
+ !day.isCurrentMonth && "outside",
1428
+ disabled && "disabled",
1429
+ selected && "selected",
1430
+ highlighted && !selected && "highlighted",
1431
+ day.isToday && "today",
1432
+ day.isSunday && "sunday",
1433
+ day.isSaturday && "saturday"
1434
+ ),
1435
+ disabled: disabled || !day.isCurrentMonth,
1436
+ onClick,
1437
+ children: day.day
1438
+ }
1439
+ )
1440
+ );
1441
+ DayCell.displayName = "DayCell";
1414
1442
  var SingleDatePicker = (props) => {
1415
1443
  const {
1416
1444
  value,
@@ -1442,6 +1470,12 @@ var SingleDatePicker = (props) => {
1442
1470
  }
1443
1471
  return set;
1444
1472
  }, [highlightDates]);
1473
+ const handleSelect = React5.useCallback(
1474
+ (date) => {
1475
+ onChange?.(date);
1476
+ },
1477
+ [onChange]
1478
+ );
1445
1479
  const weekdays = WEEKDAY_LABELS[locale];
1446
1480
  return /* @__PURE__ */ jsxs191(
1447
1481
  "div",
@@ -1474,26 +1508,15 @@ var SingleDatePicker = (props) => {
1474
1508
  `${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
1475
1509
  );
1476
1510
  return /* @__PURE__ */ jsx298(
1477
- "button",
1511
+ DayCell,
1478
1512
  {
1479
- type: "button",
1480
- className: clsx_default(
1481
- "datepicker-day",
1482
- !day.isCurrentMonth && "outside",
1483
- disabled && "disabled",
1484
- selected && "selected",
1485
- highlighted && !selected && "highlighted",
1486
- day.isToday && "today",
1487
- day.isSunday && "sunday",
1488
- day.isSaturday && "saturday"
1489
- ),
1490
- disabled: disabled || !day.isCurrentMonth,
1513
+ day,
1514
+ disabled,
1515
+ selected,
1516
+ highlighted,
1491
1517
  onClick: () => {
1492
- if (!disabled && day.isCurrentMonth) {
1493
- onChange?.(day.date);
1494
- }
1495
- },
1496
- children: day.day
1518
+ if (!disabled && day.isCurrentMonth) handleSelect(day.date);
1519
+ }
1497
1520
  },
1498
1521
  idx
1499
1522
  );
@@ -16663,6 +16663,34 @@ var useClickOutside_default = useClickOutside;
16663
16663
  // src/components/DatePicker/SingleDatePicker/index.tsx
16664
16664
  var import_react11 = __toESM(require("react"), 1);
16665
16665
  var import_jsx_runtime312 = require("react/jsx-runtime");
16666
+ var DayCell = import_react11.default.memo(
16667
+ ({
16668
+ day,
16669
+ disabled,
16670
+ selected,
16671
+ highlighted,
16672
+ onClick
16673
+ }) => /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
16674
+ "button",
16675
+ {
16676
+ type: "button",
16677
+ className: clsx_default(
16678
+ "datepicker-day",
16679
+ !day.isCurrentMonth && "outside",
16680
+ disabled && "disabled",
16681
+ selected && "selected",
16682
+ highlighted && !selected && "highlighted",
16683
+ day.isToday && "today",
16684
+ day.isSunday && "sunday",
16685
+ day.isSaturday && "saturday"
16686
+ ),
16687
+ disabled: disabled || !day.isCurrentMonth,
16688
+ onClick,
16689
+ children: day.day
16690
+ }
16691
+ )
16692
+ );
16693
+ DayCell.displayName = "DayCell";
16666
16694
  var SingleDatePicker = (props) => {
16667
16695
  const {
16668
16696
  value,
@@ -16694,6 +16722,12 @@ var SingleDatePicker = (props) => {
16694
16722
  }
16695
16723
  return set2;
16696
16724
  }, [highlightDates]);
16725
+ const handleSelect = import_react11.default.useCallback(
16726
+ (date) => {
16727
+ onChange?.(date);
16728
+ },
16729
+ [onChange]
16730
+ );
16697
16731
  const weekdays = WEEKDAY_LABELS[locale];
16698
16732
  return /* @__PURE__ */ (0, import_jsx_runtime312.jsxs)(
16699
16733
  "div",
@@ -16726,26 +16760,15 @@ var SingleDatePicker = (props) => {
16726
16760
  `${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
16727
16761
  );
16728
16762
  return /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
16729
- "button",
16763
+ DayCell,
16730
16764
  {
16731
- type: "button",
16732
- className: clsx_default(
16733
- "datepicker-day",
16734
- !day.isCurrentMonth && "outside",
16735
- disabled && "disabled",
16736
- selected && "selected",
16737
- highlighted && !selected && "highlighted",
16738
- day.isToday && "today",
16739
- day.isSunday && "sunday",
16740
- day.isSaturday && "saturday"
16741
- ),
16742
- disabled: disabled || !day.isCurrentMonth,
16765
+ day,
16766
+ disabled,
16767
+ selected,
16768
+ highlighted,
16743
16769
  onClick: () => {
16744
- if (!disabled && day.isCurrentMonth) {
16745
- onChange?.(day.date);
16746
- }
16747
- },
16748
- children: day.day
16770
+ if (!disabled && day.isCurrentMonth) handleSelect(day.date);
16771
+ }
16749
16772
  },
16750
16773
  idx
16751
16774
  );
@@ -767,6 +767,12 @@
767
767
  .lib-xplat-calendar .calendar-day.outside .calendar-day-number {
768
768
  color: var(--xplat-neutral-300);
769
769
  }
770
+ .lib-xplat-calendar .calendar-day.outside.sunday .calendar-day-number {
771
+ color: color-mix(in srgb, var(--xplat-red-500) 35%, transparent);
772
+ }
773
+ .lib-xplat-calendar .calendar-day.outside.saturday .calendar-day-number {
774
+ color: color-mix(in srgb, var(--xplat-blue-500) 35%, transparent);
775
+ }
770
776
  .lib-xplat-calendar .calendar-day.disabled {
771
777
  cursor: not-allowed;
772
778
  }
@@ -778,12 +784,12 @@
778
784
  font-weight: 700;
779
785
  color: var(--xplat-blue-600);
780
786
  }
781
- .lib-xplat-calendar .calendar-day.today .calendar-day-number::after {
787
+ .lib-xplat-calendar .calendar-day.today .calendar-day-number::before {
782
788
  content: "";
783
789
  position: absolute;
784
- bottom: -2px;
785
- left: 50%;
786
- transform: translateX(-50%);
790
+ top: 50%;
791
+ left: -6px;
792
+ transform: translateY(-50%);
787
793
  width: 4px;
788
794
  height: 4px;
789
795
  border-radius: 50%;
@@ -799,13 +805,13 @@
799
805
  .lib-xplat-calendar .calendar-day.selected:hover {
800
806
  background-color: var(--xplat-neutral-800);
801
807
  }
802
- .lib-xplat-calendar .calendar-day.selected.today .calendar-day-number::after {
808
+ .lib-xplat-calendar .calendar-day.selected.today .calendar-day-number::before {
803
809
  background-color: var(--xplat-white);
804
810
  }
805
- .lib-xplat-calendar .calendar-day.sunday .calendar-day-number {
811
+ .lib-xplat-calendar .calendar-day.sunday:not(.outside) .calendar-day-number {
806
812
  color: var(--xplat-red-500);
807
813
  }
808
- .lib-xplat-calendar .calendar-day.saturday .calendar-day-number {
814
+ .lib-xplat-calendar .calendar-day.saturday:not(.outside) .calendar-day-number {
809
815
  color: var(--xplat-blue-500);
810
816
  }
811
817
  .lib-xplat-calendar .calendar-day.selected .calendar-day-number {
@@ -1230,6 +1236,12 @@
1230
1236
  color: var(--xplat-neutral-300);
1231
1237
  cursor: default;
1232
1238
  }
1239
+ .lib-xplat-datepicker .datepicker-day.outside.sunday {
1240
+ color: color-mix(in srgb, var(--xplat-red-500) 35%, transparent);
1241
+ }
1242
+ .lib-xplat-datepicker .datepicker-day.outside.saturday {
1243
+ color: color-mix(in srgb, var(--xplat-blue-500) 35%, transparent);
1244
+ }
1233
1245
  .lib-xplat-datepicker .datepicker-day.disabled {
1234
1246
  color: var(--xplat-neutral-300);
1235
1247
  cursor: not-allowed;
@@ -16577,6 +16577,34 @@ var useClickOutside_default = useClickOutside;
16577
16577
  // src/components/DatePicker/SingleDatePicker/index.tsx
16578
16578
  import React9 from "react";
16579
16579
  import { jsx as jsx312, jsxs as jsxs199 } from "react/jsx-runtime";
16580
+ var DayCell = React9.memo(
16581
+ ({
16582
+ day,
16583
+ disabled,
16584
+ selected,
16585
+ highlighted,
16586
+ onClick
16587
+ }) => /* @__PURE__ */ jsx312(
16588
+ "button",
16589
+ {
16590
+ type: "button",
16591
+ className: clsx_default(
16592
+ "datepicker-day",
16593
+ !day.isCurrentMonth && "outside",
16594
+ disabled && "disabled",
16595
+ selected && "selected",
16596
+ highlighted && !selected && "highlighted",
16597
+ day.isToday && "today",
16598
+ day.isSunday && "sunday",
16599
+ day.isSaturday && "saturday"
16600
+ ),
16601
+ disabled: disabled || !day.isCurrentMonth,
16602
+ onClick,
16603
+ children: day.day
16604
+ }
16605
+ )
16606
+ );
16607
+ DayCell.displayName = "DayCell";
16580
16608
  var SingleDatePicker = (props) => {
16581
16609
  const {
16582
16610
  value,
@@ -16608,6 +16636,12 @@ var SingleDatePicker = (props) => {
16608
16636
  }
16609
16637
  return set2;
16610
16638
  }, [highlightDates]);
16639
+ const handleSelect = React9.useCallback(
16640
+ (date) => {
16641
+ onChange?.(date);
16642
+ },
16643
+ [onChange]
16644
+ );
16611
16645
  const weekdays = WEEKDAY_LABELS[locale];
16612
16646
  return /* @__PURE__ */ jsxs199(
16613
16647
  "div",
@@ -16640,26 +16674,15 @@ var SingleDatePicker = (props) => {
16640
16674
  `${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
16641
16675
  );
16642
16676
  return /* @__PURE__ */ jsx312(
16643
- "button",
16677
+ DayCell,
16644
16678
  {
16645
- type: "button",
16646
- className: clsx_default(
16647
- "datepicker-day",
16648
- !day.isCurrentMonth && "outside",
16649
- disabled && "disabled",
16650
- selected && "selected",
16651
- highlighted && !selected && "highlighted",
16652
- day.isToday && "today",
16653
- day.isSunday && "sunday",
16654
- day.isSaturday && "saturday"
16655
- ),
16656
- disabled: disabled || !day.isCurrentMonth,
16679
+ day,
16680
+ disabled,
16681
+ selected,
16682
+ highlighted,
16657
16683
  onClick: () => {
16658
- if (!disabled && day.isCurrentMonth) {
16659
- onChange?.(day.date);
16660
- }
16661
- },
16662
- children: day.day
16684
+ if (!disabled && day.isCurrentMonth) handleSelect(day.date);
16685
+ }
16663
16686
  },
16664
16687
  idx
16665
16688
  );
package/dist/index.cjs CHANGED
@@ -21201,6 +21201,34 @@ var useClickOutside_default = useClickOutside;
21201
21201
  // src/components/DatePicker/SingleDatePicker/index.tsx
21202
21202
  var import_react11 = __toESM(require("react"), 1);
21203
21203
  var import_jsx_runtime312 = require("react/jsx-runtime");
21204
+ var DayCell = import_react11.default.memo(
21205
+ ({
21206
+ day,
21207
+ disabled,
21208
+ selected,
21209
+ highlighted,
21210
+ onClick
21211
+ }) => /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
21212
+ "button",
21213
+ {
21214
+ type: "button",
21215
+ className: clsx_default(
21216
+ "datepicker-day",
21217
+ !day.isCurrentMonth && "outside",
21218
+ disabled && "disabled",
21219
+ selected && "selected",
21220
+ highlighted && !selected && "highlighted",
21221
+ day.isToday && "today",
21222
+ day.isSunday && "sunday",
21223
+ day.isSaturday && "saturday"
21224
+ ),
21225
+ disabled: disabled || !day.isCurrentMonth,
21226
+ onClick,
21227
+ children: day.day
21228
+ }
21229
+ )
21230
+ );
21231
+ DayCell.displayName = "DayCell";
21204
21232
  var SingleDatePicker = (props) => {
21205
21233
  const {
21206
21234
  value,
@@ -21232,6 +21260,12 @@ var SingleDatePicker = (props) => {
21232
21260
  }
21233
21261
  return set2;
21234
21262
  }, [highlightDates]);
21263
+ const handleSelect = import_react11.default.useCallback(
21264
+ (date) => {
21265
+ onChange?.(date);
21266
+ },
21267
+ [onChange]
21268
+ );
21235
21269
  const weekdays = WEEKDAY_LABELS[locale];
21236
21270
  return /* @__PURE__ */ (0, import_jsx_runtime312.jsxs)(
21237
21271
  "div",
@@ -21264,26 +21298,15 @@ var SingleDatePicker = (props) => {
21264
21298
  `${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
21265
21299
  );
21266
21300
  return /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
21267
- "button",
21301
+ DayCell,
21268
21302
  {
21269
- type: "button",
21270
- className: clsx_default(
21271
- "datepicker-day",
21272
- !day.isCurrentMonth && "outside",
21273
- disabled && "disabled",
21274
- selected && "selected",
21275
- highlighted && !selected && "highlighted",
21276
- day.isToday && "today",
21277
- day.isSunday && "sunday",
21278
- day.isSaturday && "saturday"
21279
- ),
21280
- disabled: disabled || !day.isCurrentMonth,
21303
+ day,
21304
+ disabled,
21305
+ selected,
21306
+ highlighted,
21281
21307
  onClick: () => {
21282
- if (!disabled && day.isCurrentMonth) {
21283
- onChange?.(day.date);
21284
- }
21285
- },
21286
- children: day.day
21308
+ if (!disabled && day.isCurrentMonth) handleSelect(day.date);
21309
+ }
21287
21310
  },
21288
21311
  idx
21289
21312
  );
package/dist/index.css CHANGED
@@ -767,6 +767,12 @@
767
767
  .lib-xplat-calendar .calendar-day.outside .calendar-day-number {
768
768
  color: var(--xplat-neutral-300);
769
769
  }
770
+ .lib-xplat-calendar .calendar-day.outside.sunday .calendar-day-number {
771
+ color: color-mix(in srgb, var(--xplat-red-500) 35%, transparent);
772
+ }
773
+ .lib-xplat-calendar .calendar-day.outside.saturday .calendar-day-number {
774
+ color: color-mix(in srgb, var(--xplat-blue-500) 35%, transparent);
775
+ }
770
776
  .lib-xplat-calendar .calendar-day.disabled {
771
777
  cursor: not-allowed;
772
778
  }
@@ -778,12 +784,12 @@
778
784
  font-weight: 700;
779
785
  color: var(--xplat-blue-600);
780
786
  }
781
- .lib-xplat-calendar .calendar-day.today .calendar-day-number::after {
787
+ .lib-xplat-calendar .calendar-day.today .calendar-day-number::before {
782
788
  content: "";
783
789
  position: absolute;
784
- bottom: -2px;
785
- left: 50%;
786
- transform: translateX(-50%);
790
+ top: 50%;
791
+ left: -6px;
792
+ transform: translateY(-50%);
787
793
  width: 4px;
788
794
  height: 4px;
789
795
  border-radius: 50%;
@@ -799,13 +805,13 @@
799
805
  .lib-xplat-calendar .calendar-day.selected:hover {
800
806
  background-color: var(--xplat-neutral-800);
801
807
  }
802
- .lib-xplat-calendar .calendar-day.selected.today .calendar-day-number::after {
808
+ .lib-xplat-calendar .calendar-day.selected.today .calendar-day-number::before {
803
809
  background-color: var(--xplat-white);
804
810
  }
805
- .lib-xplat-calendar .calendar-day.sunday .calendar-day-number {
811
+ .lib-xplat-calendar .calendar-day.sunday:not(.outside) .calendar-day-number {
806
812
  color: var(--xplat-red-500);
807
813
  }
808
- .lib-xplat-calendar .calendar-day.saturday .calendar-day-number {
814
+ .lib-xplat-calendar .calendar-day.saturday:not(.outside) .calendar-day-number {
809
815
  color: var(--xplat-blue-500);
810
816
  }
811
817
  .lib-xplat-calendar .calendar-day.selected .calendar-day-number {
@@ -1230,6 +1236,12 @@
1230
1236
  color: var(--xplat-neutral-300);
1231
1237
  cursor: default;
1232
1238
  }
1239
+ .lib-xplat-datepicker .datepicker-day.outside.sunday {
1240
+ color: color-mix(in srgb, var(--xplat-red-500) 35%, transparent);
1241
+ }
1242
+ .lib-xplat-datepicker .datepicker-day.outside.saturday {
1243
+ color: color-mix(in srgb, var(--xplat-blue-500) 35%, transparent);
1244
+ }
1233
1245
  .lib-xplat-datepicker .datepicker-day.disabled {
1234
1246
  color: var(--xplat-neutral-300);
1235
1247
  cursor: not-allowed;
package/dist/index.js CHANGED
@@ -20808,6 +20808,34 @@ var useClickOutside_default = useClickOutside;
20808
20808
  // src/components/DatePicker/SingleDatePicker/index.tsx
20809
20809
  import React9 from "react";
20810
20810
  import { jsx as jsx312, jsxs as jsxs199 } from "react/jsx-runtime";
20811
+ var DayCell = React9.memo(
20812
+ ({
20813
+ day,
20814
+ disabled,
20815
+ selected,
20816
+ highlighted,
20817
+ onClick
20818
+ }) => /* @__PURE__ */ jsx312(
20819
+ "button",
20820
+ {
20821
+ type: "button",
20822
+ className: clsx_default(
20823
+ "datepicker-day",
20824
+ !day.isCurrentMonth && "outside",
20825
+ disabled && "disabled",
20826
+ selected && "selected",
20827
+ highlighted && !selected && "highlighted",
20828
+ day.isToday && "today",
20829
+ day.isSunday && "sunday",
20830
+ day.isSaturday && "saturday"
20831
+ ),
20832
+ disabled: disabled || !day.isCurrentMonth,
20833
+ onClick,
20834
+ children: day.day
20835
+ }
20836
+ )
20837
+ );
20838
+ DayCell.displayName = "DayCell";
20811
20839
  var SingleDatePicker = (props) => {
20812
20840
  const {
20813
20841
  value,
@@ -20839,6 +20867,12 @@ var SingleDatePicker = (props) => {
20839
20867
  }
20840
20868
  return set2;
20841
20869
  }, [highlightDates]);
20870
+ const handleSelect = React9.useCallback(
20871
+ (date) => {
20872
+ onChange?.(date);
20873
+ },
20874
+ [onChange]
20875
+ );
20842
20876
  const weekdays = WEEKDAY_LABELS[locale];
20843
20877
  return /* @__PURE__ */ jsxs199(
20844
20878
  "div",
@@ -20871,26 +20905,15 @@ var SingleDatePicker = (props) => {
20871
20905
  `${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
20872
20906
  );
20873
20907
  return /* @__PURE__ */ jsx312(
20874
- "button",
20908
+ DayCell,
20875
20909
  {
20876
- type: "button",
20877
- className: clsx_default(
20878
- "datepicker-day",
20879
- !day.isCurrentMonth && "outside",
20880
- disabled && "disabled",
20881
- selected && "selected",
20882
- highlighted && !selected && "highlighted",
20883
- day.isToday && "today",
20884
- day.isSunday && "sunday",
20885
- day.isSaturday && "saturday"
20886
- ),
20887
- disabled: disabled || !day.isCurrentMonth,
20910
+ day,
20911
+ disabled,
20912
+ selected,
20913
+ highlighted,
20888
20914
  onClick: () => {
20889
- if (!disabled && day.isCurrentMonth) {
20890
- onChange?.(day.date);
20891
- }
20892
- },
20893
- children: day.day
20915
+ if (!disabled && day.isCurrentMonth) handleSelect(day.date);
20916
+ }
20894
20917
  },
20895
20918
  idx
20896
20919
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-plat/design-system",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "XPLAT UI Design System",
5
5
  "author": "XPLAT WOONG",
6
6
  "main": "dist/index.cjs",