@bigtablet/design-system 1.7.2 → 1.9.0

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.
package/dist/index.css CHANGED
@@ -866,6 +866,77 @@
866
866
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
867
867
  }
868
868
 
869
+ /* src/ui/form/date-picker/style.scss */
870
+ .date_picker {
871
+ display: flex;
872
+ gap: 0.5rem;
873
+ }
874
+ .date_picker select {
875
+ min-width: 88px;
876
+ height: 44px;
877
+ padding: 0 0.75rem;
878
+ font-family: "Pretendard", sans-serif;
879
+ font-size: 0.9375rem;
880
+ line-height: 1.5;
881
+ color: #1a1a1a;
882
+ background-color: #ffffff;
883
+ border: 1px solid #e5e5e5;
884
+ border-radius: 6px;
885
+ cursor: pointer;
886
+ transition:
887
+ border-color 0.1s ease-out,
888
+ box-shadow 0.1s ease-out,
889
+ background-color 0.1s ease-out;
890
+ appearance: none;
891
+ background-image:
892
+ linear-gradient(
893
+ 45deg,
894
+ transparent 50%,
895
+ #666666 50%),
896
+ linear-gradient(
897
+ 135deg,
898
+ #666666 50%,
899
+ transparent 50%);
900
+ background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 11px) calc(50% - 3px);
901
+ background-size: 5px 5px;
902
+ background-repeat: no-repeat;
903
+ }
904
+ .date_picker select:hover:not(:disabled) {
905
+ border-color: #000000;
906
+ background-color: #fafafa;
907
+ }
908
+ .date_picker select:focus-visible {
909
+ outline: none;
910
+ border-color: #000000;
911
+ box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.15);
912
+ background-color: #ffffff;
913
+ }
914
+ .date_picker select:disabled {
915
+ cursor: not-allowed;
916
+ color: #9ca3af;
917
+ background-color: #fafafa;
918
+ border-color: rgba(0, 0, 0, 0.08);
919
+ }
920
+ .date_picker select option {
921
+ color: #1a1a1a;
922
+ }
923
+ .date_picker select:nth-child(1) {
924
+ min-width: 96px;
925
+ }
926
+ .date_picker select:nth-child(2),
927
+ .date_picker select:nth-child(3) {
928
+ min-width: 72px;
929
+ }
930
+ @media (max-width: 480px) {
931
+ .date_picker {
932
+ gap: 0.25rem;
933
+ }
934
+ .date_picker select {
935
+ min-width: 0;
936
+ flex: 1;
937
+ }
938
+ }
939
+
869
940
  /* src/ui/navigation/pagination/style.scss */
870
941
  .pagination {
871
942
  display: flex;
package/dist/index.d.ts CHANGED
@@ -123,6 +123,17 @@ interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement
123
123
  }
124
124
  declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
125
125
 
126
+ type DatePickerMode = "year-month" | "year-month-day";
127
+ interface DatePickerProps {
128
+ value?: string;
129
+ onChange: (value: string) => void;
130
+ mode?: DatePickerMode;
131
+ startYear?: number;
132
+ endYear?: number;
133
+ disabled?: boolean;
134
+ }
135
+ declare const DatePicker: ({ value, onChange, mode, startYear, endYear, disabled, }: DatePickerProps) => react_jsx_runtime.JSX.Element;
136
+
126
137
  interface PaginationProps {
127
138
  page: number;
128
139
  totalPages: number;
@@ -139,4 +150,4 @@ interface ModalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">
139
150
  }
140
151
  declare const Modal: ({ open, onClose, closeOnOverlay, width, title, children, className, ...props }: ModalProps) => react_jsx_runtime.JSX.Element | null;
141
152
 
142
- export { AlertProvider, Button, Card, Checkbox, FileInput, Loading, Modal, Pagination, Radio, Select, type SelectOption, Switch, TextField, ToastProvider, useAlert, useToast };
153
+ export { AlertProvider, Button, Card, Checkbox, DatePicker, FileInput, Loading, Modal, Pagination, Radio, Select, type SelectOption, Switch, TextField, ToastProvider, useAlert, useToast };
package/dist/index.js CHANGED
@@ -524,6 +524,69 @@ var TextField = React3.forwardRef(
524
524
  }
525
525
  );
526
526
  TextField.displayName = "TextField";
527
+ var pad = (n) => String(n).padStart(2, "0");
528
+ var getDaysInMonth = (year, month) => new Date(year, month, 0).getDate();
529
+ var DatePicker = ({
530
+ value,
531
+ onChange,
532
+ mode = "year-month-day",
533
+ startYear = 1950,
534
+ endYear = (/* @__PURE__ */ new Date()).getFullYear() + 10,
535
+ disabled
536
+ }) => {
537
+ const [y, m, d] = value?.split("-").map(Number) ?? [];
538
+ const year = y ?? "";
539
+ const month = m ?? "";
540
+ const day = d ?? "";
541
+ const days = year && month ? getDaysInMonth(year, month) : 31;
542
+ const emit = (yy, mm, dd) => {
543
+ const result = mode === "year-month" ? `${yy}-${pad(mm)}-01` : `${yy}-${pad(mm)}-${pad(dd ?? 1)}`;
544
+ onChange(result);
545
+ };
546
+ return /* @__PURE__ */ jsxs("div", { className: "date_picker", children: [
547
+ /* @__PURE__ */ jsxs(
548
+ "select",
549
+ {
550
+ value: year,
551
+ disabled,
552
+ onChange: (e) => emit(Number(e.target.value), month || 1, day || 1),
553
+ children: [
554
+ /* @__PURE__ */ jsx("option", { value: "", disabled: true }),
555
+ Array.from(
556
+ { length: endYear - startYear + 1 },
557
+ (_, i) => startYear + i
558
+ ).map((y2) => /* @__PURE__ */ jsx("option", { value: y2, children: y2 }, y2))
559
+ ]
560
+ }
561
+ ),
562
+ /* @__PURE__ */ jsxs(
563
+ "select",
564
+ {
565
+ value: month,
566
+ disabled: disabled || !year,
567
+ onChange: (e) => emit(year, Number(e.target.value), day || 1),
568
+ children: [
569
+ /* @__PURE__ */ jsx("option", { value: "", disabled: true }),
570
+ Array.from({ length: 12 }, (_, i) => i + 1).map((m2) => /* @__PURE__ */ jsx("option", { value: m2, children: pad(m2) }, m2))
571
+ ]
572
+ }
573
+ ),
574
+ mode === "year-month-day" && /* @__PURE__ */ jsxs(
575
+ "select",
576
+ {
577
+ value: day,
578
+ disabled: disabled || !month,
579
+ onChange: (e) => emit(year, month, Number(e.target.value)),
580
+ children: [
581
+ /* @__PURE__ */ jsx("option", { value: "", disabled: true }),
582
+ Array.from({ length: days }, (_, i) => i + 1).map(
583
+ (d2) => /* @__PURE__ */ jsx("option", { value: d2, children: pad(d2) }, d2)
584
+ )
585
+ ]
586
+ }
587
+ )
588
+ ] });
589
+ };
527
590
  var range = (start, end) => {
528
591
  const out = [];
529
592
  for (let i = start; i <= end; i += 1) out.push(i);
@@ -632,4 +695,4 @@ var Modal = ({
632
695
  );
633
696
  };
634
697
 
635
- export { AlertProvider, Button, Card, Checkbox, FileInput, Loading, Modal, Pagination, Radio, Select, Switch, TextField, ToastProvider, useAlert, useToast };
698
+ export { AlertProvider, Button, Card, Checkbox, DatePicker, FileInput, Loading, Modal, Pagination, Radio, Select, Switch, TextField, ToastProvider, useAlert, useToast };
package/dist/next.css CHANGED
@@ -15,13 +15,13 @@
15
15
  border-bottom: 1px solid #e5e5e5;
16
16
  }
17
17
  .sidebar_brand_link {
18
- display: block;
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: space-between;
21
+ align-items: center;
19
22
  width: 100%;
20
23
  }
21
24
  .sidebar_brand_img {
22
- display: block;
23
- width: 100%;
24
- height: auto;
25
25
  object-fit: contain;
26
26
  }
27
27
  .sidebar_nav {
package/dist/next.js CHANGED
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import Link from 'next/link';
5
5
  import Image from 'next/image';
6
6
  import { ChevronDown } from 'lucide-react';
7
- import { jsxs, jsx } from 'react/jsx-runtime';
7
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
 
9
9
  // src/ui/navigation/sidebar/index.tsx
10
10
  var Sidebar = ({
@@ -22,6 +22,11 @@ var Sidebar = ({
22
22
  return match === "exact" ? activePath === href : activePath.startsWith(href);
23
23
  };
24
24
  const [openGroups, setOpenGroups] = React.useState([]);
25
+ const [isOpen, setIsOpen] = React.useState(true);
26
+ const handleToggleSidebar = (value) => {
27
+ setIsOpen(value);
28
+ localStorage.setItem("isOpen", JSON.stringify(value));
29
+ };
25
30
  React.useEffect(() => {
26
31
  if (!activePath) return;
27
32
  const autoOpenIds = items.filter(
@@ -37,35 +42,47 @@ var Sidebar = ({
37
42
  );
38
43
  };
39
44
  const rootClassName = ["sidebar", className ?? ""].filter(Boolean).join(" ");
40
- return /* @__PURE__ */ jsxs(
45
+ return /* @__PURE__ */ jsx(
41
46
  "aside",
42
47
  {
43
48
  className: rootClassName,
44
- style: { width, ...style },
49
+ style: { width: isOpen ? `${width}px` : "56px", ...style },
45
50
  "aria-label": "\uC0AC\uC774\uB4DC \uB0B4\uBE44\uAC8C\uC774\uC158",
46
- children: [
47
- /* @__PURE__ */ jsx("div", { className: "sidebar_brand", children: /* @__PURE__ */ jsx(
51
+ children: isOpen ? /* @__PURE__ */ jsxs(Fragment, { children: [
52
+ /* @__PURE__ */ jsx("div", { className: "sidebar_brand", children: /* @__PURE__ */ jsxs(
48
53
  Link,
49
54
  {
50
55
  href: brandHref,
51
56
  className: "sidebar_brand_link",
52
57
  "aria-label": "Bigtablet \uD648\uC73C\uB85C",
53
- children: /* @__PURE__ */ jsx(
54
- Image,
55
- {
56
- src: "/images/logo/bigtablet.png",
57
- alt: "Bigtablet",
58
- width: 200,
59
- height: 44,
60
- priority: true,
61
- className: "sidebar_brand_img"
62
- }
63
- )
58
+ children: [
59
+ /* @__PURE__ */ jsx(
60
+ Image,
61
+ {
62
+ src: "/images/logo/bigtablet.png",
63
+ alt: "Bigtablet",
64
+ width: 96,
65
+ height: 30,
66
+ priority: true,
67
+ className: "sidebar_brand_img"
68
+ }
69
+ ),
70
+ /* @__PURE__ */ jsx(
71
+ Image,
72
+ {
73
+ src: "/images/sidebar/arrow-close.svg",
74
+ alt: "ArrowClose",
75
+ width: 24,
76
+ height: 24,
77
+ onClick: () => handleToggleSidebar(false)
78
+ }
79
+ )
80
+ ]
64
81
  }
65
82
  ) }),
66
83
  /* @__PURE__ */ jsx("nav", { className: "sidebar_nav", children: items.map((item) => {
67
84
  if (item.type === "group") {
68
- const isOpen = openGroups.includes(item.id);
85
+ const isOpen2 = openGroups.includes(item.id);
69
86
  return /* @__PURE__ */ jsxs("div", { className: "sidebar_group", children: [
70
87
  /* @__PURE__ */ jsxs(
71
88
  "button",
@@ -73,7 +90,7 @@ var Sidebar = ({
73
90
  type: "button",
74
91
  className: [
75
92
  "sidebar_item",
76
- isOpen && "is_open"
93
+ isOpen2 && "is_open"
77
94
  ].filter(Boolean).join(" "),
78
95
  onClick: () => toggleGroup(item.id),
79
96
  children: [
@@ -84,7 +101,7 @@ var Sidebar = ({
84
101
  {
85
102
  className: [
86
103
  "sidebar_chevron",
87
- isOpen && "is_open"
104
+ isOpen2 && "is_open"
88
105
  ].filter(Boolean).join(" "),
89
106
  children: /* @__PURE__ */ jsx(ChevronDown, { size: 16 })
90
107
  }
@@ -92,7 +109,7 @@ var Sidebar = ({
92
109
  ]
93
110
  }
94
111
  ),
95
- isOpen && /* @__PURE__ */ jsx("div", { className: "sidebar_sub", children: item.children.map((child) => {
112
+ isOpen2 && /* @__PURE__ */ jsx("div", { className: "sidebar_sub", children: item.children.map((child) => {
96
113
  const active2 = isActive(child.href);
97
114
  return /* @__PURE__ */ jsx(
98
115
  Link,
@@ -137,7 +154,16 @@ var Sidebar = ({
137
154
  item.href
138
155
  );
139
156
  }) })
140
- ]
157
+ ] }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
158
+ Image,
159
+ {
160
+ src: "/images/sidebar/menu.svg",
161
+ alt: "menu",
162
+ width: 24,
163
+ height: 24,
164
+ onClick: () => handleToggleSidebar(true)
165
+ }
166
+ ) })
141
167
  }
142
168
  );
143
169
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigtablet/design-system",
3
- "version": "1.7.2",
3
+ "version": "1.9.0",
4
4
  "description": "Bigtablet Design System UI Components",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
@@ -73,7 +73,7 @@
73
73
  "conventional-changelog-conventionalcommits": "^9.1.0",
74
74
  "esbuild-sass-plugin": "^3",
75
75
  "lucide-react": "^0.552.0",
76
- "next": "16.0.9",
76
+ "next": "16.0.10",
77
77
  "react": "19.2.0",
78
78
  "react-dom": "19.2.0",
79
79
  "react-toastify": "^11.0.5",