@bigtablet/design-system 1.9.0 → 1.9.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.
package/dist/index.css CHANGED
@@ -868,6 +868,21 @@
868
868
 
869
869
  /* src/ui/form/date-picker/style.scss */
870
870
  .date_picker {
871
+ display: flex;
872
+ flex-direction: column;
873
+ gap: 0.25rem;
874
+ }
875
+ .date_picker_label {
876
+ font-family: "Pretendard", sans-serif;
877
+ font-size: 0.875rem;
878
+ line-height: 1.5;
879
+ color: #666666;
880
+ }
881
+ .date_picker_required {
882
+ margin-left: 0.25rem;
883
+ color: #ef4444;
884
+ }
885
+ .date_picker_fields {
871
886
  display: flex;
872
887
  gap: 0.5rem;
873
888
  }
@@ -920,20 +935,26 @@
920
935
  .date_picker select option {
921
936
  color: #1a1a1a;
922
937
  }
923
- .date_picker select:nth-child(1) {
924
- min-width: 96px;
938
+ .date_picker_full {
939
+ width: 100%;
925
940
  }
926
- .date_picker select:nth-child(2),
927
- .date_picker select:nth-child(3) {
928
- min-width: 72px;
941
+ .date_picker_full .date_picker_fields {
942
+ width: 100%;
943
+ }
944
+ .date_picker_full select {
945
+ flex: 1;
946
+ min-width: 0;
947
+ }
948
+ .date_picker_disabled .date_picker_label {
949
+ color: #9ca3af;
929
950
  }
930
951
  @media (max-width: 480px) {
931
- .date_picker {
952
+ .date_picker_fields {
932
953
  gap: 0.25rem;
933
954
  }
934
955
  .date_picker select {
935
- min-width: 0;
936
956
  flex: 1;
957
+ min-width: 0;
937
958
  }
938
959
  }
939
960
 
package/dist/index.d.ts CHANGED
@@ -125,6 +125,8 @@ declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.
125
125
 
126
126
  type DatePickerMode = "year-month" | "year-month-day";
127
127
  interface DatePickerProps {
128
+ label?: string;
129
+ required?: boolean;
128
130
  value?: string;
129
131
  onChange: (value: string) => void;
130
132
  mode?: DatePickerMode;
@@ -132,7 +134,7 @@ interface DatePickerProps {
132
134
  endYear?: number;
133
135
  disabled?: boolean;
134
136
  }
135
- declare const DatePicker: ({ value, onChange, mode, startYear, endYear, disabled, }: DatePickerProps) => react_jsx_runtime.JSX.Element;
137
+ declare const DatePicker: ({ label, required, value, onChange, mode, startYear, endYear, disabled, }: DatePickerProps) => react_jsx_runtime.JSX.Element;
136
138
 
137
139
  interface PaginationProps {
138
140
  page: number;
package/dist/index.js CHANGED
@@ -527,6 +527,8 @@ TextField.displayName = "TextField";
527
527
  var pad = (n) => String(n).padStart(2, "0");
528
528
  var getDaysInMonth = (year, month) => new Date(year, month, 0).getDate();
529
529
  var DatePicker = ({
530
+ label,
531
+ required,
530
532
  value,
531
533
  onChange,
532
534
  mode = "year-month-day",
@@ -543,49 +545,64 @@ var DatePicker = ({
543
545
  const result = mode === "year-month" ? `${yy}-${pad(mm)}-01` : `${yy}-${pad(mm)}-${pad(dd ?? 1)}`;
544
546
  onChange(result);
545
547
  };
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)
548
+ return /* @__PURE__ */ jsxs(
549
+ "div",
550
+ {
551
+ className: [
552
+ "date_picker",
553
+ disabled && "date_picker_disabled"
554
+ ].filter(Boolean).join(" "),
555
+ children: [
556
+ label && /* @__PURE__ */ jsxs("label", { className: "date_picker_label", children: [
557
+ label,
558
+ required && /* @__PURE__ */ jsx("span", { className: "date_picker_required", children: "*" })
559
+ ] }),
560
+ /* @__PURE__ */ jsxs("div", { className: "date_picker_fields", children: [
561
+ /* @__PURE__ */ jsxs(
562
+ "select",
563
+ {
564
+ value: year,
565
+ disabled,
566
+ onChange: (e) => emit(Number(e.target.value), month || 1, day || 1),
567
+ children: [
568
+ /* @__PURE__ */ jsx("option", { value: "", disabled: true }),
569
+ Array.from(
570
+ { length: endYear - startYear + 1 },
571
+ (_, i) => startYear + i
572
+ ).map((y2) => /* @__PURE__ */ jsx("option", { value: y2, children: y2 }, y2))
573
+ ]
574
+ }
575
+ ),
576
+ /* @__PURE__ */ jsxs(
577
+ "select",
578
+ {
579
+ value: month,
580
+ disabled: disabled || !year,
581
+ onChange: (e) => emit(year, Number(e.target.value), day || 1),
582
+ children: [
583
+ /* @__PURE__ */ jsx("option", { value: "", disabled: true }),
584
+ Array.from({ length: 12 }, (_, i) => i + 1).map((m2) => /* @__PURE__ */ jsx("option", { value: m2, children: pad(m2) }, m2))
585
+ ]
586
+ }
587
+ ),
588
+ mode === "year-month-day" && /* @__PURE__ */ jsxs(
589
+ "select",
590
+ {
591
+ value: day,
592
+ disabled: disabled || !month,
593
+ onChange: (e) => emit(year, month, Number(e.target.value)),
594
+ children: [
595
+ /* @__PURE__ */ jsx("option", { value: "", disabled: true }),
596
+ Array.from({ length: days }, (_, i) => i + 1).map(
597
+ (d2) => /* @__PURE__ */ jsx("option", { value: d2, children: pad(d2) }, d2)
598
+ )
599
+ ]
600
+ }
584
601
  )
585
- ]
586
- }
587
- )
588
- ] });
602
+ ] })
603
+ ]
604
+ }
605
+ );
589
606
  };
590
607
  var range = (start, end) => {
591
608
  const out = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigtablet/design-system",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Bigtablet Design System UI Components",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",