@zenkigen-inc/component-ui 1.19.0 → 1.19.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.d.mts CHANGED
@@ -641,20 +641,34 @@ type Props$b = {
641
641
  declare function SelectItem({ option }: Props$b): react.JSX.Element;
642
642
 
643
643
  type Props$a = {
644
+ /** コンポーネントのサイズ */
644
645
  size?: 'x-small' | 'small' | 'medium' | 'large';
646
+ /** 表示スタイルのバリエーション */
645
647
  variant?: 'outline' | 'text';
648
+ /** コンポーネントの幅 */
646
649
  width?: CSSProperties['width'];
650
+ /** コンポーネントの最大幅 */
647
651
  maxWidth?: CSSProperties['maxWidth'];
652
+ /** 未選択時に表示されるテキスト */
648
653
  placeholder?: string;
654
+ /** プレースホルダー表示時のアイコン */
649
655
  placeholderIcon?: IconName;
656
+ /** 現在選択されているオプション */
650
657
  selectedOption?: SelectOption | null;
658
+ /** オプションリストの最大高さ */
651
659
  optionListMaxHeight?: CSSProperties['height'];
660
+ /** 無効状態の制御 */
652
661
  isDisabled?: boolean;
662
+ /** エラー状態の制御 */
653
663
  isError?: boolean;
664
+ /** 選択状態の見た目を適用するかどうか */
654
665
  isOptionSelected?: boolean;
666
+ /** 選択変更時のコールバック関数 */
655
667
  onChange?: (option: SelectOption | null) => void;
668
+ /** ドロップダウンリストの幅をトリガーボタンの幅に合わせる */
669
+ matchListToTrigger?: boolean;
656
670
  };
657
- declare function Select({ children, size, variant, width, maxWidth, placeholder, placeholderIcon, selectedOption, isDisabled, isError, isOptionSelected, onChange, optionListMaxHeight, }: PropsWithChildren<Props$a>): react.JSX.Element;
671
+ declare function Select({ children, size, variant, width, maxWidth, placeholder, placeholderIcon, selectedOption, isDisabled, isError, isOptionSelected, onChange, optionListMaxHeight, matchListToTrigger, }: PropsWithChildren<Props$a>): react.JSX.Element;
658
672
  declare namespace Select {
659
673
  var Option: typeof SelectItem;
660
674
  }
package/dist/index.d.ts CHANGED
@@ -641,20 +641,34 @@ type Props$b = {
641
641
  declare function SelectItem({ option }: Props$b): react.JSX.Element;
642
642
 
643
643
  type Props$a = {
644
+ /** コンポーネントのサイズ */
644
645
  size?: 'x-small' | 'small' | 'medium' | 'large';
646
+ /** 表示スタイルのバリエーション */
645
647
  variant?: 'outline' | 'text';
648
+ /** コンポーネントの幅 */
646
649
  width?: CSSProperties['width'];
650
+ /** コンポーネントの最大幅 */
647
651
  maxWidth?: CSSProperties['maxWidth'];
652
+ /** 未選択時に表示されるテキスト */
648
653
  placeholder?: string;
654
+ /** プレースホルダー表示時のアイコン */
649
655
  placeholderIcon?: IconName;
656
+ /** 現在選択されているオプション */
650
657
  selectedOption?: SelectOption | null;
658
+ /** オプションリストの最大高さ */
651
659
  optionListMaxHeight?: CSSProperties['height'];
660
+ /** 無効状態の制御 */
652
661
  isDisabled?: boolean;
662
+ /** エラー状態の制御 */
653
663
  isError?: boolean;
664
+ /** 選択状態の見た目を適用するかどうか */
654
665
  isOptionSelected?: boolean;
666
+ /** 選択変更時のコールバック関数 */
655
667
  onChange?: (option: SelectOption | null) => void;
668
+ /** ドロップダウンリストの幅をトリガーボタンの幅に合わせる */
669
+ matchListToTrigger?: boolean;
656
670
  };
657
- declare function Select({ children, size, variant, width, maxWidth, placeholder, placeholderIcon, selectedOption, isDisabled, isError, isOptionSelected, onChange, optionListMaxHeight, }: PropsWithChildren<Props$a>): react.JSX.Element;
671
+ declare function Select({ children, size, variant, width, maxWidth, placeholder, placeholderIcon, selectedOption, isDisabled, isError, isOptionSelected, onChange, optionListMaxHeight, matchListToTrigger, }: PropsWithChildren<Props$a>): react.JSX.Element;
658
672
  declare namespace Select {
659
673
  var Option: typeof SelectItem;
660
674
  }
package/dist/index.js CHANGED
@@ -604,18 +604,18 @@ var import_react_day_picker2 = require("react-day-picker");
604
604
  var import_clsx6 = require("clsx");
605
605
  var import_react_day_picker = require("react-day-picker");
606
606
  var defaultDayPickerClassNames = (0, import_react_day_picker.getDefaultClassNames)();
607
+ var DAY_PICKER_FONT_SIZE = "12px";
607
608
  var dayPickerStyle = {
608
- "--rdp-font-family": "Arial, 'Noto Sans JP', sans-serif",
609
609
  "--rdp-nav-height": "30px",
610
- "--rdp-day-font": "700 12px/1 'Arial', 'Noto Sans JP', sans-serif",
611
- "--rdp-selected-font": "700 12px/1 'Arial', 'Noto Sans JP', sans-serif",
612
- "--rdp-weekday-font": "700 12px/1 'Arial', 'Noto Sans JP', sans-serif",
613
610
  "--rdp-day-width": "30px",
614
611
  "--rdp-day-height": "30px",
615
612
  "--rdp-day_button-width": "28px",
616
613
  "--rdp-day_button-height": "28px",
617
614
  "--rdp-day_button-border": "1px solid transparent",
618
- "--rdp-weekday-padding": "0px"
615
+ "--rdp-weekday-padding": "0px",
616
+ fontFamily: "Arial, 'Noto Sans JP', sans-serif",
617
+ fontSize: DAY_PICKER_FONT_SIZE,
618
+ fontWeight: 700
619
619
  };
620
620
  var dayPickerClassNames = {
621
621
  month: (0, import_clsx6.clsx)(defaultDayPickerClassNames.month, "flex flex-col px-[7px] py-2")
@@ -624,7 +624,7 @@ var dayButtonBaseClass = "relative grid size-full place-items-center rounded-ful
624
624
 
625
625
  // src/date-picker/date-picker-day-button.tsx
626
626
  var import_jsx_runtime12 = require("react/jsx-runtime");
627
- var CustomDayButton = ({ day, modifiers, className, ...buttonProps }) => {
627
+ var CustomDayButton = ({ day, modifiers, className, style, ...buttonProps }) => {
628
628
  const isSelected = Boolean(modifiers.selected);
629
629
  const isOutside = Boolean(modifiers.outside);
630
630
  const isMinMaxDisabled = Boolean(modifiers.minMaxDisabled);
@@ -637,6 +637,7 @@ var CustomDayButton = ({ day, modifiers, className, ...buttonProps }) => {
637
637
  ...buttonProps,
638
638
  day,
639
639
  modifiers,
640
+ style: { ...style, fontSize: DAY_PICKER_FONT_SIZE },
640
641
  className: (0, import_clsx7.clsx)(
641
642
  className,
642
643
  dayButtonBaseClass,
@@ -744,46 +745,55 @@ var formatMonthLabel = (date) => {
744
745
 
745
746
  // src/date-picker/date-picker-month-caption.tsx
746
747
  var import_jsx_runtime14 = require("react/jsx-runtime");
747
- var CustomMonthCaption = ({ calendarMonth, className, displayIndex, ...props }) => {
748
+ var CustomMonthCaption = ({ calendarMonth, className, displayIndex, style, ...props }) => {
748
749
  void displayIndex;
749
750
  const { goToMonth, nextMonth, previousMonth } = (0, import_react_day_picker3.useDayPicker)();
750
751
  const captionMonth = calendarMonth.date;
751
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: (0, import_clsx9.clsx)("flex items-center justify-between px-1 pb-0.5", className), ...props, children: [
752
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
753
- IconButton,
754
- {
755
- icon: "angle-left",
756
- size: "small",
757
- variant: "text",
758
- isDisabled: !previousMonth,
759
- "aria-label": "\u524D\u306E\u6708",
760
- onClick: () => previousMonth && goToMonth(previousMonth)
761
- }
762
- ),
763
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "typography-label12bold text-text02", children: formatMonthLabel(captionMonth) }),
764
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
765
- IconButton,
766
- {
767
- icon: "angle-right",
768
- size: "small",
769
- variant: "text",
770
- isDisabled: !nextMonth,
771
- "aria-label": "\u6B21\u306E\u6708",
772
- onClick: () => nextMonth && goToMonth(nextMonth)
773
- }
774
- )
775
- ] });
752
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
753
+ "div",
754
+ {
755
+ className: (0, import_clsx9.clsx)("flex items-center justify-between px-1 pb-0.5", className),
756
+ style: { ...style, fontSize: "inherit", fontWeight: "inherit" },
757
+ ...props,
758
+ children: [
759
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
760
+ IconButton,
761
+ {
762
+ icon: "angle-left",
763
+ size: "small",
764
+ variant: "text",
765
+ isDisabled: !previousMonth,
766
+ "aria-label": "\u524D\u306E\u6708",
767
+ onClick: () => previousMonth && goToMonth(previousMonth)
768
+ }
769
+ ),
770
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "typography-label12bold text-text02", children: formatMonthLabel(captionMonth) }),
771
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
772
+ IconButton,
773
+ {
774
+ icon: "angle-right",
775
+ size: "small",
776
+ variant: "text",
777
+ isDisabled: !nextMonth,
778
+ "aria-label": "\u6B21\u306E\u6708",
779
+ onClick: () => nextMonth && goToMonth(nextMonth)
780
+ }
781
+ )
782
+ ]
783
+ }
784
+ );
776
785
  };
777
786
 
778
787
  // src/date-picker/date-picker-weekday.tsx
779
788
  var import_clsx10 = require("clsx");
780
789
  var import_jsx_runtime15 = require("react/jsx-runtime");
781
- var CustomWeekday = ({ className, children, ...props }) => {
790
+ var CustomWeekday = ({ className, children, style, ...props }) => {
782
791
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
783
792
  "th",
784
793
  {
785
794
  ...props,
786
- className: (0, import_clsx10.clsx)(className, "m-0 flex size-7 items-center justify-center p-0 text-center text-text02"),
795
+ className: (0, import_clsx10.clsx)(className, "m-0 size-7 p-0 text-center align-middle text-text02"),
796
+ style: { ...style, fontSize: "inherit", fontWeight: "bold" },
787
797
  children
788
798
  }
789
799
  );
@@ -2057,7 +2067,8 @@ function Select({
2057
2067
  isError = false,
2058
2068
  isOptionSelected = false,
2059
2069
  onChange,
2060
- optionListMaxHeight
2070
+ optionListMaxHeight,
2071
+ matchListToTrigger = false
2061
2072
  }) {
2062
2073
  const [isOptionListOpen, setIsOptionListOpen] = (0, import_react29.useState)(false);
2063
2074
  const targetRef = (0, import_react29.useRef)(null);
@@ -2071,8 +2082,12 @@ function Select({
2071
2082
  (0, import_react28.size)({
2072
2083
  apply({ availableWidth, elements, rects }) {
2073
2084
  const referenceWidth = rects.reference.width;
2074
- elements.floating.style.minWidth = `${referenceWidth}px`;
2075
- elements.floating.style.maxWidth = `${availableWidth}px`;
2085
+ if (matchListToTrigger) {
2086
+ elements.floating.style.width = `${referenceWidth}px`;
2087
+ } else {
2088
+ elements.floating.style.minWidth = `${referenceWidth}px`;
2089
+ elements.floating.style.maxWidth = `${availableWidth}px`;
2090
+ }
2076
2091
  }
2077
2092
  })
2078
2093
  ],
package/dist/index.mjs CHANGED
@@ -537,18 +537,18 @@ import { DayButton } from "react-day-picker";
537
537
  import { clsx as clsx6 } from "clsx";
538
538
  import { getDefaultClassNames } from "react-day-picker";
539
539
  var defaultDayPickerClassNames = getDefaultClassNames();
540
+ var DAY_PICKER_FONT_SIZE = "12px";
540
541
  var dayPickerStyle = {
541
- "--rdp-font-family": "Arial, 'Noto Sans JP', sans-serif",
542
542
  "--rdp-nav-height": "30px",
543
- "--rdp-day-font": "700 12px/1 'Arial', 'Noto Sans JP', sans-serif",
544
- "--rdp-selected-font": "700 12px/1 'Arial', 'Noto Sans JP', sans-serif",
545
- "--rdp-weekday-font": "700 12px/1 'Arial', 'Noto Sans JP', sans-serif",
546
543
  "--rdp-day-width": "30px",
547
544
  "--rdp-day-height": "30px",
548
545
  "--rdp-day_button-width": "28px",
549
546
  "--rdp-day_button-height": "28px",
550
547
  "--rdp-day_button-border": "1px solid transparent",
551
- "--rdp-weekday-padding": "0px"
548
+ "--rdp-weekday-padding": "0px",
549
+ fontFamily: "Arial, 'Noto Sans JP', sans-serif",
550
+ fontSize: DAY_PICKER_FONT_SIZE,
551
+ fontWeight: 700
552
552
  };
553
553
  var dayPickerClassNames = {
554
554
  month: clsx6(defaultDayPickerClassNames.month, "flex flex-col px-[7px] py-2")
@@ -557,7 +557,7 @@ var dayButtonBaseClass = "relative grid size-full place-items-center rounded-ful
557
557
 
558
558
  // src/date-picker/date-picker-day-button.tsx
559
559
  import { jsx as jsx11 } from "react/jsx-runtime";
560
- var CustomDayButton = ({ day, modifiers, className, ...buttonProps }) => {
560
+ var CustomDayButton = ({ day, modifiers, className, style, ...buttonProps }) => {
561
561
  const isSelected = Boolean(modifiers.selected);
562
562
  const isOutside = Boolean(modifiers.outside);
563
563
  const isMinMaxDisabled = Boolean(modifiers.minMaxDisabled);
@@ -570,6 +570,7 @@ var CustomDayButton = ({ day, modifiers, className, ...buttonProps }) => {
570
570
  ...buttonProps,
571
571
  day,
572
572
  modifiers,
573
+ style: { ...style, fontSize: DAY_PICKER_FONT_SIZE },
573
574
  className: clsx7(
574
575
  className,
575
576
  dayButtonBaseClass,
@@ -677,46 +678,55 @@ var formatMonthLabel = (date) => {
677
678
 
678
679
  // src/date-picker/date-picker-month-caption.tsx
679
680
  import { jsx as jsx13, jsxs as jsxs3 } from "react/jsx-runtime";
680
- var CustomMonthCaption = ({ calendarMonth, className, displayIndex, ...props }) => {
681
+ var CustomMonthCaption = ({ calendarMonth, className, displayIndex, style, ...props }) => {
681
682
  void displayIndex;
682
683
  const { goToMonth, nextMonth, previousMonth } = useDayPicker();
683
684
  const captionMonth = calendarMonth.date;
684
- return /* @__PURE__ */ jsxs3("div", { className: clsx9("flex items-center justify-between px-1 pb-0.5", className), ...props, children: [
685
- /* @__PURE__ */ jsx13(
686
- IconButton,
687
- {
688
- icon: "angle-left",
689
- size: "small",
690
- variant: "text",
691
- isDisabled: !previousMonth,
692
- "aria-label": "\u524D\u306E\u6708",
693
- onClick: () => previousMonth && goToMonth(previousMonth)
694
- }
695
- ),
696
- /* @__PURE__ */ jsx13("span", { className: "typography-label12bold text-text02", children: formatMonthLabel(captionMonth) }),
697
- /* @__PURE__ */ jsx13(
698
- IconButton,
699
- {
700
- icon: "angle-right",
701
- size: "small",
702
- variant: "text",
703
- isDisabled: !nextMonth,
704
- "aria-label": "\u6B21\u306E\u6708",
705
- onClick: () => nextMonth && goToMonth(nextMonth)
706
- }
707
- )
708
- ] });
685
+ return /* @__PURE__ */ jsxs3(
686
+ "div",
687
+ {
688
+ className: clsx9("flex items-center justify-between px-1 pb-0.5", className),
689
+ style: { ...style, fontSize: "inherit", fontWeight: "inherit" },
690
+ ...props,
691
+ children: [
692
+ /* @__PURE__ */ jsx13(
693
+ IconButton,
694
+ {
695
+ icon: "angle-left",
696
+ size: "small",
697
+ variant: "text",
698
+ isDisabled: !previousMonth,
699
+ "aria-label": "\u524D\u306E\u6708",
700
+ onClick: () => previousMonth && goToMonth(previousMonth)
701
+ }
702
+ ),
703
+ /* @__PURE__ */ jsx13("span", { className: "typography-label12bold text-text02", children: formatMonthLabel(captionMonth) }),
704
+ /* @__PURE__ */ jsx13(
705
+ IconButton,
706
+ {
707
+ icon: "angle-right",
708
+ size: "small",
709
+ variant: "text",
710
+ isDisabled: !nextMonth,
711
+ "aria-label": "\u6B21\u306E\u6708",
712
+ onClick: () => nextMonth && goToMonth(nextMonth)
713
+ }
714
+ )
715
+ ]
716
+ }
717
+ );
709
718
  };
710
719
 
711
720
  // src/date-picker/date-picker-weekday.tsx
712
721
  import { clsx as clsx10 } from "clsx";
713
722
  import { jsx as jsx14 } from "react/jsx-runtime";
714
- var CustomWeekday = ({ className, children, ...props }) => {
723
+ var CustomWeekday = ({ className, children, style, ...props }) => {
715
724
  return /* @__PURE__ */ jsx14(
716
725
  "th",
717
726
  {
718
727
  ...props,
719
- className: clsx10(className, "m-0 flex size-7 items-center justify-center p-0 text-center text-text02"),
728
+ className: clsx10(className, "m-0 size-7 p-0 text-center align-middle text-text02"),
729
+ style: { ...style, fontSize: "inherit", fontWeight: "bold" },
720
730
  children
721
731
  }
722
732
  );
@@ -1990,7 +2000,8 @@ function Select({
1990
2000
  isError = false,
1991
2001
  isOptionSelected = false,
1992
2002
  onChange,
1993
- optionListMaxHeight
2003
+ optionListMaxHeight,
2004
+ matchListToTrigger = false
1994
2005
  }) {
1995
2006
  const [isOptionListOpen, setIsOptionListOpen] = useState8(false);
1996
2007
  const targetRef = useRef6(null);
@@ -2004,8 +2015,12 @@ function Select({
2004
2015
  sizeMiddleware({
2005
2016
  apply({ availableWidth, elements, rects }) {
2006
2017
  const referenceWidth = rects.reference.width;
2007
- elements.floating.style.minWidth = `${referenceWidth}px`;
2008
- elements.floating.style.maxWidth = `${availableWidth}px`;
2018
+ if (matchListToTrigger) {
2019
+ elements.floating.style.width = `${referenceWidth}px`;
2020
+ } else {
2021
+ elements.floating.style.minWidth = `${referenceWidth}px`;
2022
+ elements.floating.style.maxWidth = `${availableWidth}px`;
2023
+ }
2009
2024
  }
2010
2025
  })
2011
2026
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenkigen-inc/component-ui",
3
- "version": "1.19.0",
3
+ "version": "1.19.1",
4
4
  "repository": "https://github.com/zenkigen/zenkigen-component",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -38,10 +38,10 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@floating-ui/react": "0.27.16",
41
- "@zenkigen-inc/component-config": "1.19.0",
42
- "@zenkigen-inc/component-icons": "1.19.0",
43
- "@zenkigen-inc/component-theme": "1.19.0",
41
+ "@zenkigen-inc/component-config": "1.19.1",
42
+ "@zenkigen-inc/component-icons": "1.19.1",
43
+ "@zenkigen-inc/component-theme": "1.19.1",
44
44
  "clsx": "2.1.1",
45
- "react-day-picker": "9.0.0"
45
+ "react-day-picker": "9.13.0"
46
46
  }
47
47
  }