@x-plat/design-system 0.1.3 → 0.1.4

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 (61) hide show
  1. package/dist/components/Accordion/index.cjs +908 -18
  2. package/dist/components/Accordion/index.js +908 -18
  3. package/dist/components/Avatar/index.css +1 -0
  4. package/dist/components/CheckBox/index.cjs +1 -1
  5. package/dist/components/CheckBox/index.css +13 -1
  6. package/dist/components/CheckBox/index.js +1 -1
  7. package/dist/components/DatePicker/index.cjs +75 -5
  8. package/dist/components/DatePicker/index.css +20 -2
  9. package/dist/components/DatePicker/index.d.cts +245 -4
  10. package/dist/components/DatePicker/index.d.ts +245 -4
  11. package/dist/components/DatePicker/index.js +75 -5
  12. package/dist/components/Drawer/index.cjs +111 -0
  13. package/dist/components/Drawer/index.css +70 -0
  14. package/dist/components/Drawer/index.d.cts +14 -0
  15. package/dist/components/Drawer/index.d.ts +14 -0
  16. package/dist/components/Drawer/index.js +74 -0
  17. package/dist/components/Dropdown/index.cjs +185 -0
  18. package/dist/components/Dropdown/index.css +54 -0
  19. package/dist/components/Dropdown/index.d.cts +17 -0
  20. package/dist/components/Dropdown/index.d.ts +17 -0
  21. package/dist/components/Dropdown/index.js +148 -0
  22. package/dist/components/EmptyState/index.cjs +60 -0
  23. package/dist/components/EmptyState/index.css +32 -0
  24. package/dist/components/EmptyState/index.d.cts +12 -0
  25. package/dist/components/EmptyState/index.d.ts +12 -0
  26. package/dist/components/EmptyState/index.js +33 -0
  27. package/dist/components/FileUpload/index.cjs +1039 -0
  28. package/dist/components/FileUpload/index.css +42 -0
  29. package/dist/components/FileUpload/index.d.cts +14 -0
  30. package/dist/components/FileUpload/index.d.ts +14 -0
  31. package/dist/components/FileUpload/index.js +1002 -0
  32. package/dist/components/Pagination/index.cjs +913 -7
  33. package/dist/components/Pagination/index.js +913 -7
  34. package/dist/components/Radio/index.css +1 -1
  35. package/dist/components/Steps/index.cjs +1105 -0
  36. package/dist/components/Steps/index.css +918 -0
  37. package/dist/components/Steps/index.d.cts +134 -0
  38. package/dist/components/Steps/index.d.ts +134 -0
  39. package/dist/components/Steps/index.js +1078 -0
  40. package/dist/components/Tag/index.cjs +1090 -0
  41. package/dist/components/Tag/index.css +498 -0
  42. package/dist/components/Tag/index.d.cts +131 -0
  43. package/dist/components/Tag/index.d.ts +131 -0
  44. package/dist/components/Tag/index.js +1063 -0
  45. package/dist/components/Toast/index.cjs +150 -0
  46. package/dist/components/Toast/index.css +111 -0
  47. package/dist/components/Toast/index.d.cts +15 -0
  48. package/dist/components/Toast/index.d.ts +15 -0
  49. package/dist/components/Toast/index.js +112 -0
  50. package/dist/components/Tooltip/index.css +3 -0
  51. package/dist/components/index.cjs +1651 -1182
  52. package/dist/components/index.css +5771 -4005
  53. package/dist/components/index.d.cts +7 -0
  54. package/dist/components/index.d.ts +7 -0
  55. package/dist/components/index.js +1619 -1158
  56. package/dist/index.cjs +2674 -2241
  57. package/dist/index.css +5771 -4005
  58. package/dist/index.d.cts +7 -0
  59. package/dist/index.d.ts +7 -0
  60. package/dist/index.js +2742 -2317
  61. package/package.json +2 -2
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { C as ColorNamespace, a as ColorName, d as ColorProps } from '../../colors-BG91q_uV.js';
2
4
 
3
5
  interface InputDatePickerProps {
4
6
  value: Date;
@@ -33,7 +35,7 @@ interface PopupPickerBaseProps {
33
35
  type PopupPickerProps = PopupPickerBaseProps & (SinglePickerProps | RangePickerProps$1);
34
36
  declare const PopupPicker: React.FC<PopupPickerProps>;
35
37
 
36
- interface RangePickerProps {
38
+ interface RangePickerProps<N extends ColorNamespace = "xplat", C extends ColorName<N> = ColorName<N>> extends Partial<ColorProps<N, C>> {
37
39
  startDate: Date;
38
40
  endDate: Date;
39
41
  onChange?: (range: {
@@ -43,14 +45,253 @@ interface RangePickerProps {
43
45
  minDate?: Date;
44
46
  maxDate?: Date;
45
47
  }
46
- declare const RangePicker: React.FC<RangePickerProps>;
48
+ declare const RangePicker: {
49
+ <N extends ColorNamespace = "xplat", C extends ColorName<N> = keyof {
50
+ readonly xplat: {
51
+ readonly red: {
52
+ readonly 50: "#FFF0F0";
53
+ readonly 100: "#FFDDDE";
54
+ readonly 200: "#FFC1C2";
55
+ readonly 300: "#FF9698";
56
+ readonly 400: "#FF5A5D";
57
+ readonly 500: "#FF272B";
58
+ readonly 600: "#F80409";
59
+ readonly 700: "#D40105";
60
+ readonly 800: "#AE0609";
61
+ readonly 900: "#900C0F";
62
+ };
63
+ readonly green: {
64
+ readonly 50: "#E5F6EA";
65
+ readonly 100: "#C1E7CC";
66
+ readonly 200: "#98D8AC";
67
+ readonly 300: "#6CCA8B";
68
+ readonly 400: "#47BE72";
69
+ readonly 500: "#10B259";
70
+ readonly 600: "#00A34F";
71
+ readonly 700: "#009143";
72
+ readonly 800: "#007F38";
73
+ readonly 900: "#006024";
74
+ };
75
+ readonly orange: {
76
+ readonly 50: "#FFF8EC";
77
+ readonly 100: "#FFF0D3";
78
+ readonly 200: "#FFDDA5";
79
+ readonly 300: "#FFC46D";
80
+ readonly 400: "#FF9F32";
81
+ readonly 500: "#FF820A";
82
+ readonly 600: "#FF6900";
83
+ readonly 700: "#CC4B02";
84
+ readonly 800: "#A13A0B";
85
+ readonly 900: "#82320C";
86
+ };
87
+ readonly yellow: {
88
+ readonly 50: "#FFFDE7";
89
+ readonly 100: "#FFFAC1";
90
+ readonly 200: "#FFF186";
91
+ readonly 300: "#FFE041";
92
+ readonly 400: "#FFCC0D";
93
+ readonly 500: "#F0B100";
94
+ readonly 600: "#D18800";
95
+ readonly 700: "#A66002";
96
+ readonly 800: "#894B0A";
97
+ readonly 900: "#743D0F";
98
+ };
99
+ readonly blue: {
100
+ readonly 50: "#F1F4FD";
101
+ readonly 100: "#DFE7FA";
102
+ readonly 200: "#C5D4F8";
103
+ readonly 300: "#9EB8F2";
104
+ readonly 400: "#7093EA";
105
+ readonly 500: "#4D6DE3";
106
+ readonly 600: "#3950D7";
107
+ readonly 700: "#303EC5";
108
+ readonly 800: "#2D35A0";
109
+ readonly 900: "#29317F";
110
+ };
111
+ readonly lightblue: {
112
+ readonly 50: "#EEFAFF";
113
+ readonly 100: "#D9F4FF";
114
+ readonly 200: "#BBEDFF";
115
+ readonly 300: "#8DE3FF";
116
+ readonly 400: "#57D0FF";
117
+ readonly 500: "#30B6FF";
118
+ readonly 600: "#1999F7";
119
+ readonly 700: "#1280E3";
120
+ readonly 800: "#1566B8";
121
+ readonly 900: "#175791";
122
+ };
123
+ readonly purple: {
124
+ readonly 50: "#FBF6FE";
125
+ readonly 100: "#F5EAFD";
126
+ readonly 200: "#EDD8FC";
127
+ readonly 300: "#E0BAF8";
128
+ readonly 400: "#CD8DF3";
129
+ readonly 500: "#B961EB";
130
+ readonly 600: "#A541DC";
131
+ readonly 700: "#9230C5";
132
+ readonly 800: "#782B9E";
133
+ readonly 900: "#62247F";
134
+ };
135
+ readonly pink: {
136
+ readonly 50: "#FFF4FE";
137
+ readonly 100: "#FFE7FD";
138
+ readonly 200: "#FFCFFA";
139
+ readonly 300: "#FEA9F1";
140
+ readonly 400: "#FD75E7";
141
+ readonly 500: "#F553DA";
142
+ readonly 600: "#D821B6";
143
+ readonly 700: "#B31892";
144
+ readonly 800: "#921676";
145
+ readonly 900: "#781761";
146
+ };
147
+ readonly neutral: {
148
+ readonly 50: "#FAFAFA";
149
+ readonly 100: "#F5F5F5";
150
+ readonly 200: "#E5E5E5";
151
+ readonly 300: "#D4D4D4";
152
+ readonly 400: "#A1A1A1";
153
+ readonly 500: "#737373";
154
+ readonly 600: "#525252";
155
+ readonly 700: "#404040";
156
+ readonly 800: "#262626";
157
+ readonly 900: "#171717";
158
+ };
159
+ readonly black: "#000000";
160
+ readonly white: "#FFFFFF";
161
+ };
162
+ readonly test: {
163
+ readonly default: "#ffffff";
164
+ };
165
+ }[N]>(props: RangePickerProps<N, C>): react_jsx_runtime.JSX.Element;
166
+ displayName: string;
167
+ };
47
168
 
48
- interface SingleDatePickerProps {
169
+ interface SingleDatePickerProps<N extends ColorNamespace = "xplat", C extends ColorName<N> = ColorName<N>> extends Partial<ColorProps<N, C>> {
49
170
  value: Date | null;
50
171
  onChange?: (date: Date | null) => void;
51
172
  minDate?: Date;
52
173
  maxDate?: Date;
174
+ highlightDates?: Date[];
53
175
  }
54
- declare const SingleDatePicker: React.FC<SingleDatePickerProps>;
176
+ declare const SingleDatePicker: {
177
+ <N extends ColorNamespace = "xplat", C extends ColorName<N> = keyof {
178
+ readonly xplat: {
179
+ readonly red: {
180
+ readonly 50: "#FFF0F0";
181
+ readonly 100: "#FFDDDE";
182
+ readonly 200: "#FFC1C2";
183
+ readonly 300: "#FF9698";
184
+ readonly 400: "#FF5A5D";
185
+ readonly 500: "#FF272B";
186
+ readonly 600: "#F80409";
187
+ readonly 700: "#D40105";
188
+ readonly 800: "#AE0609";
189
+ readonly 900: "#900C0F";
190
+ };
191
+ readonly green: {
192
+ readonly 50: "#E5F6EA";
193
+ readonly 100: "#C1E7CC";
194
+ readonly 200: "#98D8AC";
195
+ readonly 300: "#6CCA8B";
196
+ readonly 400: "#47BE72";
197
+ readonly 500: "#10B259";
198
+ readonly 600: "#00A34F";
199
+ readonly 700: "#009143";
200
+ readonly 800: "#007F38";
201
+ readonly 900: "#006024";
202
+ };
203
+ readonly orange: {
204
+ readonly 50: "#FFF8EC";
205
+ readonly 100: "#FFF0D3";
206
+ readonly 200: "#FFDDA5";
207
+ readonly 300: "#FFC46D";
208
+ readonly 400: "#FF9F32";
209
+ readonly 500: "#FF820A";
210
+ readonly 600: "#FF6900";
211
+ readonly 700: "#CC4B02";
212
+ readonly 800: "#A13A0B";
213
+ readonly 900: "#82320C";
214
+ };
215
+ readonly yellow: {
216
+ readonly 50: "#FFFDE7";
217
+ readonly 100: "#FFFAC1";
218
+ readonly 200: "#FFF186";
219
+ readonly 300: "#FFE041";
220
+ readonly 400: "#FFCC0D";
221
+ readonly 500: "#F0B100";
222
+ readonly 600: "#D18800";
223
+ readonly 700: "#A66002";
224
+ readonly 800: "#894B0A";
225
+ readonly 900: "#743D0F";
226
+ };
227
+ readonly blue: {
228
+ readonly 50: "#F1F4FD";
229
+ readonly 100: "#DFE7FA";
230
+ readonly 200: "#C5D4F8";
231
+ readonly 300: "#9EB8F2";
232
+ readonly 400: "#7093EA";
233
+ readonly 500: "#4D6DE3";
234
+ readonly 600: "#3950D7";
235
+ readonly 700: "#303EC5";
236
+ readonly 800: "#2D35A0";
237
+ readonly 900: "#29317F";
238
+ };
239
+ readonly lightblue: {
240
+ readonly 50: "#EEFAFF";
241
+ readonly 100: "#D9F4FF";
242
+ readonly 200: "#BBEDFF";
243
+ readonly 300: "#8DE3FF";
244
+ readonly 400: "#57D0FF";
245
+ readonly 500: "#30B6FF";
246
+ readonly 600: "#1999F7";
247
+ readonly 700: "#1280E3";
248
+ readonly 800: "#1566B8";
249
+ readonly 900: "#175791";
250
+ };
251
+ readonly purple: {
252
+ readonly 50: "#FBF6FE";
253
+ readonly 100: "#F5EAFD";
254
+ readonly 200: "#EDD8FC";
255
+ readonly 300: "#E0BAF8";
256
+ readonly 400: "#CD8DF3";
257
+ readonly 500: "#B961EB";
258
+ readonly 600: "#A541DC";
259
+ readonly 700: "#9230C5";
260
+ readonly 800: "#782B9E";
261
+ readonly 900: "#62247F";
262
+ };
263
+ readonly pink: {
264
+ readonly 50: "#FFF4FE";
265
+ readonly 100: "#FFE7FD";
266
+ readonly 200: "#FFCFFA";
267
+ readonly 300: "#FEA9F1";
268
+ readonly 400: "#FD75E7";
269
+ readonly 500: "#F553DA";
270
+ readonly 600: "#D821B6";
271
+ readonly 700: "#B31892";
272
+ readonly 800: "#921676";
273
+ readonly 900: "#781761";
274
+ };
275
+ readonly neutral: {
276
+ readonly 50: "#FAFAFA";
277
+ readonly 100: "#F5F5F5";
278
+ readonly 200: "#E5E5E5";
279
+ readonly 300: "#D4D4D4";
280
+ readonly 400: "#A1A1A1";
281
+ readonly 500: "#737373";
282
+ readonly 600: "#525252";
283
+ readonly 700: "#404040";
284
+ readonly 800: "#262626";
285
+ readonly 900: "#171717";
286
+ };
287
+ readonly black: "#000000";
288
+ readonly white: "#FFFFFF";
289
+ };
290
+ readonly test: {
291
+ readonly default: "#ffffff";
292
+ };
293
+ }[N]>(props: SingleDatePickerProps<N, C>): react_jsx_runtime.JSX.Element;
294
+ displayName: string;
295
+ };
55
296
 
56
297
  export { InputDatePicker, PopupPicker as PopupDatePicker, RangePicker as RangeDatePicker, SingleDatePicker };
@@ -1508,13 +1508,48 @@ var Modal_default = Modal;
1508
1508
  import DatePicker2 from "react-datepicker";
1509
1509
  import "react-datepicker/dist/react-datepicker.css";
1510
1510
  import { jsx as jsx301 } from "react/jsx-runtime";
1511
+ function getColorValue(ns, color, depth) {
1512
+ const nsColors = colors[ns];
1513
+ const colorEntry = nsColors[color];
1514
+ if (typeof colorEntry === "string") return colorEntry;
1515
+ return colorEntry[String(depth)] ?? "";
1516
+ }
1511
1517
  var SingleDatePicker = (props) => {
1512
- const { value, onChange, ...rest } = props;
1518
+ const {
1519
+ value,
1520
+ onChange,
1521
+ colorNamespace = "xplat",
1522
+ color = "blue",
1523
+ colorDepth,
1524
+ highlightDates,
1525
+ ...rest
1526
+ } = props;
1513
1527
  const handleChange = (date) => {
1514
1528
  if (Array.isArray(date)) return;
1515
1529
  onChange?.(date);
1516
1530
  };
1517
- return /* @__PURE__ */ jsx301("div", { className: "lib-xplat-datepicker", children: /* @__PURE__ */ jsx301(DatePicker2, { selected: value, onChange: handleChange, inline: true, ...rest }) });
1531
+ const activeColor = getColorValue(
1532
+ colorNamespace,
1533
+ color,
1534
+ colorDepth ?? 500
1535
+ );
1536
+ return /* @__PURE__ */ jsx301(
1537
+ "div",
1538
+ {
1539
+ className: "lib-xplat-datepicker",
1540
+ style: { "--datepicker-active-color": activeColor },
1541
+ children: /* @__PURE__ */ jsx301(
1542
+ DatePicker2,
1543
+ {
1544
+ selected: value,
1545
+ onChange: handleChange,
1546
+ inline: true,
1547
+ highlightDates,
1548
+ ...rest
1549
+ }
1550
+ )
1551
+ }
1552
+ );
1518
1553
  };
1519
1554
  SingleDatePicker.displayName = "SingleDatePicker";
1520
1555
  var SingleDatePicker_default = SingleDatePicker;
@@ -1575,9 +1610,40 @@ PopupPicker.displayName = "PopupPicker";
1575
1610
  var PopupPicker_default = PopupPicker;
1576
1611
 
1577
1612
  // src/components/DatePicker/RangePicker/index.tsx
1613
+ import React6 from "react";
1578
1614
  import { jsx as jsx303, jsxs as jsxs192 } from "react/jsx-runtime";
1615
+ function getDatesBetween(start, end) {
1616
+ const dates = [];
1617
+ const current = new Date(start);
1618
+ current.setHours(0, 0, 0, 0);
1619
+ const last = new Date(end);
1620
+ last.setHours(0, 0, 0, 0);
1621
+ while (current <= last) {
1622
+ dates.push(new Date(current));
1623
+ current.setDate(current.getDate() + 1);
1624
+ }
1625
+ return dates;
1626
+ }
1579
1627
  var RangePicker = (props) => {
1580
- const { startDate, endDate, onChange, minDate, maxDate } = props;
1628
+ const {
1629
+ startDate,
1630
+ endDate,
1631
+ onChange,
1632
+ minDate,
1633
+ maxDate,
1634
+ colorNamespace,
1635
+ color,
1636
+ colorDepth
1637
+ } = props;
1638
+ const rangeDates = React6.useMemo(
1639
+ () => getDatesBetween(startDate, endDate),
1640
+ [startDate, endDate]
1641
+ );
1642
+ const colorProps = {
1643
+ ...colorNamespace !== void 0 && { colorNamespace },
1644
+ ...color !== void 0 && { color },
1645
+ ...colorDepth !== void 0 && { colorDepth }
1646
+ };
1581
1647
  return /* @__PURE__ */ jsxs192("div", { className: "lib-xplat-range-datepicker", children: [
1582
1648
  /* @__PURE__ */ jsxs192("div", { className: "lib-xplat-range-datepicker-from", children: [
1583
1649
  /* @__PURE__ */ jsx303("span", { className: "lib-xplat-range-datepicker-label", children: "\uC2DC\uC791" }),
@@ -1587,7 +1653,9 @@ var RangePicker = (props) => {
1587
1653
  value: startDate,
1588
1654
  onChange: (date) => date != null && onChange?.({ startDate: date, endDate }),
1589
1655
  minDate,
1590
- maxDate: endDate
1656
+ maxDate: endDate,
1657
+ highlightDates: rangeDates,
1658
+ ...colorProps
1591
1659
  }
1592
1660
  )
1593
1661
  ] }),
@@ -1599,7 +1667,9 @@ var RangePicker = (props) => {
1599
1667
  value: endDate,
1600
1668
  onChange: (date) => date != null && onChange?.({ startDate, endDate: date }),
1601
1669
  minDate: startDate,
1602
- maxDate
1670
+ maxDate,
1671
+ highlightDates: rangeDates,
1672
+ ...colorProps
1603
1673
  }
1604
1674
  )
1605
1675
  ] })
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/components/Drawer/index.ts
31
+ var Drawer_exports = {};
32
+ __export(Drawer_exports, {
33
+ Drawer: () => Drawer_default
34
+ });
35
+ module.exports = __toCommonJS(Drawer_exports);
36
+
37
+ // src/components/Drawer/Drawer.tsx
38
+ var import_react = __toESM(require("react"), 1);
39
+ var import_react_dom = require("react-dom");
40
+
41
+ // node_modules/clsx/dist/clsx.mjs
42
+ function r(e) {
43
+ var t, f, n = "";
44
+ if ("string" == typeof e || "number" == typeof e) n += e;
45
+ else if ("object" == typeof e) if (Array.isArray(e)) {
46
+ var o = e.length;
47
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
48
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
49
+ return n;
50
+ }
51
+ function clsx() {
52
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
53
+ return n;
54
+ }
55
+ var clsx_default = clsx;
56
+
57
+ // src/components/Drawer/Drawer.tsx
58
+ var import_jsx_runtime = require("react/jsx-runtime");
59
+ var ANIMATION_DURATION_MS = 250;
60
+ var Drawer = (props) => {
61
+ const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
62
+ const [mounted, setMounted] = import_react.default.useState(false);
63
+ const [visible, setVisible] = import_react.default.useState(false);
64
+ import_react.default.useEffect(() => {
65
+ if (isOpen) {
66
+ setMounted(true);
67
+ const t2 = setTimeout(() => setVisible(true), 1);
68
+ return () => clearTimeout(t2);
69
+ }
70
+ setVisible(false);
71
+ const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS);
72
+ return () => clearTimeout(t);
73
+ }, [isOpen]);
74
+ if (typeof document === "undefined") return null;
75
+ if (!mounted) return null;
76
+ const stateClass = visible ? "enter" : "exit";
77
+ const widthValue = typeof width === "number" ? `${width}px` : width;
78
+ return (0, import_react_dom.createPortal)(
79
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
80
+ "div",
81
+ {
82
+ className: clsx_default("lib-xplat-drawer-overlay", stateClass),
83
+ onClick: onClose,
84
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
85
+ "div",
86
+ {
87
+ className: clsx_default("lib-xplat-drawer", placement, stateClass),
88
+ style: { width: widthValue },
89
+ role: "dialog",
90
+ "aria-modal": "true",
91
+ onClick: (e) => e.stopPropagation(),
92
+ children: [
93
+ title && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "drawer-header", children: [
94
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "drawer-title", children: title }),
95
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
96
+ ] }),
97
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "drawer-body", children })
98
+ ]
99
+ }
100
+ )
101
+ }
102
+ ),
103
+ document.body
104
+ );
105
+ };
106
+ Drawer.displayName = "Drawer";
107
+ var Drawer_default = Drawer;
108
+ // Annotate the CommonJS export names for ESM import in node:
109
+ 0 && (module.exports = {
110
+ Drawer
111
+ });
@@ -0,0 +1,70 @@
1
+ /* src/components/Drawer/drawer.scss */
2
+ .lib-xplat-drawer-overlay {
3
+ position: fixed;
4
+ inset: 0;
5
+ z-index: 1000;
6
+ background: rgba(0, 0, 0, 0);
7
+ transition: background-color 0.25s ease;
8
+ }
9
+ .lib-xplat-drawer-overlay.enter {
10
+ background: rgba(0, 0, 0, 0.4);
11
+ }
12
+ .lib-xplat-drawer-overlay.exit {
13
+ background: rgba(0, 0, 0, 0);
14
+ }
15
+ .lib-xplat-drawer {
16
+ position: fixed;
17
+ top: 0;
18
+ height: 100%;
19
+ background: #FFFFFF;
20
+ box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
21
+ display: flex;
22
+ flex-direction: column;
23
+ transition: transform 0.25s ease;
24
+ z-index: 1001;
25
+ }
26
+ .lib-xplat-drawer.right {
27
+ right: 0;
28
+ transform: translateX(100%);
29
+ }
30
+ .lib-xplat-drawer.right.enter {
31
+ transform: translateX(0);
32
+ }
33
+ .lib-xplat-drawer.left {
34
+ left: 0;
35
+ transform: translateX(-100%);
36
+ box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
37
+ }
38
+ .lib-xplat-drawer.left.enter {
39
+ transform: translateX(0);
40
+ }
41
+ .lib-xplat-drawer .drawer-header {
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: space-between;
45
+ padding: 1rem 1.25rem;
46
+ border-bottom: 1px solid #E5E5E5;
47
+ }
48
+ .lib-xplat-drawer .drawer-title {
49
+ font-size: 16px;
50
+ font-weight: 600;
51
+ color: #171717;
52
+ }
53
+ .lib-xplat-drawer .close-btn {
54
+ background: none;
55
+ border: none;
56
+ cursor: pointer;
57
+ font-size: 22px;
58
+ line-height: 1;
59
+ color: #737373;
60
+ padding: 0;
61
+ transition: color 0.2s;
62
+ }
63
+ .lib-xplat-drawer .close-btn:hover {
64
+ color: #262626;
65
+ }
66
+ .lib-xplat-drawer .drawer-body {
67
+ flex: 1;
68
+ padding: 1.25rem;
69
+ overflow-y: auto;
70
+ }
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+
3
+ type DrawerPlacement = "left" | "right";
4
+ interface DrawerProps {
5
+ isOpen: boolean;
6
+ onClose: () => void;
7
+ placement?: DrawerPlacement;
8
+ width?: string | number;
9
+ title?: React.ReactNode;
10
+ children?: React.ReactNode;
11
+ }
12
+ declare const Drawer: React.FC<DrawerProps>;
13
+
14
+ export { Drawer };
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+
3
+ type DrawerPlacement = "left" | "right";
4
+ interface DrawerProps {
5
+ isOpen: boolean;
6
+ onClose: () => void;
7
+ placement?: DrawerPlacement;
8
+ width?: string | number;
9
+ title?: React.ReactNode;
10
+ children?: React.ReactNode;
11
+ }
12
+ declare const Drawer: React.FC<DrawerProps>;
13
+
14
+ export { Drawer };
@@ -0,0 +1,74 @@
1
+ // src/components/Drawer/Drawer.tsx
2
+ import React from "react";
3
+ import { createPortal } from "react-dom";
4
+
5
+ // node_modules/clsx/dist/clsx.mjs
6
+ function r(e) {
7
+ var t, f, n = "";
8
+ if ("string" == typeof e || "number" == typeof e) n += e;
9
+ else if ("object" == typeof e) if (Array.isArray(e)) {
10
+ var o = e.length;
11
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
12
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
13
+ return n;
14
+ }
15
+ function clsx() {
16
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
17
+ return n;
18
+ }
19
+ var clsx_default = clsx;
20
+
21
+ // src/components/Drawer/Drawer.tsx
22
+ import { jsx, jsxs } from "react/jsx-runtime";
23
+ var ANIMATION_DURATION_MS = 250;
24
+ var Drawer = (props) => {
25
+ const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
26
+ const [mounted, setMounted] = React.useState(false);
27
+ const [visible, setVisible] = React.useState(false);
28
+ React.useEffect(() => {
29
+ if (isOpen) {
30
+ setMounted(true);
31
+ const t2 = setTimeout(() => setVisible(true), 1);
32
+ return () => clearTimeout(t2);
33
+ }
34
+ setVisible(false);
35
+ const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS);
36
+ return () => clearTimeout(t);
37
+ }, [isOpen]);
38
+ if (typeof document === "undefined") return null;
39
+ if (!mounted) return null;
40
+ const stateClass = visible ? "enter" : "exit";
41
+ const widthValue = typeof width === "number" ? `${width}px` : width;
42
+ return createPortal(
43
+ /* @__PURE__ */ jsx(
44
+ "div",
45
+ {
46
+ className: clsx_default("lib-xplat-drawer-overlay", stateClass),
47
+ onClick: onClose,
48
+ children: /* @__PURE__ */ jsxs(
49
+ "div",
50
+ {
51
+ className: clsx_default("lib-xplat-drawer", placement, stateClass),
52
+ style: { width: widthValue },
53
+ role: "dialog",
54
+ "aria-modal": "true",
55
+ onClick: (e) => e.stopPropagation(),
56
+ children: [
57
+ title && /* @__PURE__ */ jsxs("div", { className: "drawer-header", children: [
58
+ /* @__PURE__ */ jsx("span", { className: "drawer-title", children: title }),
59
+ /* @__PURE__ */ jsx("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
60
+ ] }),
61
+ /* @__PURE__ */ jsx("div", { className: "drawer-body", children })
62
+ ]
63
+ }
64
+ )
65
+ }
66
+ ),
67
+ document.body
68
+ );
69
+ };
70
+ Drawer.displayName = "Drawer";
71
+ var Drawer_default = Drawer;
72
+ export {
73
+ Drawer_default as Drawer
74
+ };