@zenkigen-inc/component-ui 1.19.0 → 1.19.2

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
@@ -495,6 +495,7 @@ var PopoverContent = (0, import_react4.forwardRef)(function PopoverContent2({ ch
495
495
  ref: composeRefs(floating.refs.setFloating, ref),
496
496
  tabIndex: -1,
497
497
  onKeyDown: handleKeyDown,
498
+ className: "z-popover",
498
499
  style: {
499
500
  position: floating.strategy,
500
501
  top: floating.y ?? 0,
@@ -604,18 +605,18 @@ var import_react_day_picker2 = require("react-day-picker");
604
605
  var import_clsx6 = require("clsx");
605
606
  var import_react_day_picker = require("react-day-picker");
606
607
  var defaultDayPickerClassNames = (0, import_react_day_picker.getDefaultClassNames)();
608
+ var DAY_PICKER_FONT_SIZE = "12px";
607
609
  var dayPickerStyle = {
608
- "--rdp-font-family": "Arial, 'Noto Sans JP', sans-serif",
609
610
  "--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
611
  "--rdp-day-width": "30px",
614
612
  "--rdp-day-height": "30px",
615
613
  "--rdp-day_button-width": "28px",
616
614
  "--rdp-day_button-height": "28px",
617
615
  "--rdp-day_button-border": "1px solid transparent",
618
- "--rdp-weekday-padding": "0px"
616
+ "--rdp-weekday-padding": "0px",
617
+ fontFamily: "Arial, 'Noto Sans JP', sans-serif",
618
+ fontSize: DAY_PICKER_FONT_SIZE,
619
+ fontWeight: 700
619
620
  };
620
621
  var dayPickerClassNames = {
621
622
  month: (0, import_clsx6.clsx)(defaultDayPickerClassNames.month, "flex flex-col px-[7px] py-2")
@@ -624,7 +625,7 @@ var dayButtonBaseClass = "relative grid size-full place-items-center rounded-ful
624
625
 
625
626
  // src/date-picker/date-picker-day-button.tsx
626
627
  var import_jsx_runtime12 = require("react/jsx-runtime");
627
- var CustomDayButton = ({ day, modifiers, className, ...buttonProps }) => {
628
+ var CustomDayButton = ({ day, modifiers, className, style, ...buttonProps }) => {
628
629
  const isSelected = Boolean(modifiers.selected);
629
630
  const isOutside = Boolean(modifiers.outside);
630
631
  const isMinMaxDisabled = Boolean(modifiers.minMaxDisabled);
@@ -637,6 +638,7 @@ var CustomDayButton = ({ day, modifiers, className, ...buttonProps }) => {
637
638
  ...buttonProps,
638
639
  day,
639
640
  modifiers,
641
+ style: { ...style, fontSize: DAY_PICKER_FONT_SIZE },
640
642
  className: (0, import_clsx7.clsx)(
641
643
  className,
642
644
  dayButtonBaseClass,
@@ -744,46 +746,55 @@ var formatMonthLabel = (date) => {
744
746
 
745
747
  // src/date-picker/date-picker-month-caption.tsx
746
748
  var import_jsx_runtime14 = require("react/jsx-runtime");
747
- var CustomMonthCaption = ({ calendarMonth, className, displayIndex, ...props }) => {
749
+ var CustomMonthCaption = ({ calendarMonth, className, displayIndex, style, ...props }) => {
748
750
  void displayIndex;
749
751
  const { goToMonth, nextMonth, previousMonth } = (0, import_react_day_picker3.useDayPicker)();
750
752
  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
- ] });
753
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
754
+ "div",
755
+ {
756
+ className: (0, import_clsx9.clsx)("flex items-center justify-between px-1 pb-0.5", className),
757
+ style: { ...style, fontSize: "inherit", fontWeight: "inherit" },
758
+ ...props,
759
+ children: [
760
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
761
+ IconButton,
762
+ {
763
+ icon: "angle-left",
764
+ size: "small",
765
+ variant: "text",
766
+ isDisabled: !previousMonth,
767
+ "aria-label": "\u524D\u306E\u6708",
768
+ onClick: () => previousMonth && goToMonth(previousMonth)
769
+ }
770
+ ),
771
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "typography-label12bold text-text02", children: formatMonthLabel(captionMonth) }),
772
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
773
+ IconButton,
774
+ {
775
+ icon: "angle-right",
776
+ size: "small",
777
+ variant: "text",
778
+ isDisabled: !nextMonth,
779
+ "aria-label": "\u6B21\u306E\u6708",
780
+ onClick: () => nextMonth && goToMonth(nextMonth)
781
+ }
782
+ )
783
+ ]
784
+ }
785
+ );
776
786
  };
777
787
 
778
788
  // src/date-picker/date-picker-weekday.tsx
779
789
  var import_clsx10 = require("clsx");
780
790
  var import_jsx_runtime15 = require("react/jsx-runtime");
781
- var CustomWeekday = ({ className, children, ...props }) => {
791
+ var CustomWeekday = ({ className, children, style, ...props }) => {
782
792
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
783
793
  "th",
784
794
  {
785
795
  ...props,
786
- className: (0, import_clsx10.clsx)(className, "m-0 flex size-7 items-center justify-center p-0 text-center text-text02"),
796
+ className: (0, import_clsx10.clsx)(className, "m-0 size-7 p-0 text-center align-middle text-text02"),
797
+ style: { ...style, fontSize: "inherit", fontWeight: "bold" },
787
798
  children
788
799
  }
789
800
  );
@@ -2057,7 +2068,8 @@ function Select({
2057
2068
  isError = false,
2058
2069
  isOptionSelected = false,
2059
2070
  onChange,
2060
- optionListMaxHeight
2071
+ optionListMaxHeight,
2072
+ matchListToTrigger = false
2061
2073
  }) {
2062
2074
  const [isOptionListOpen, setIsOptionListOpen] = (0, import_react29.useState)(false);
2063
2075
  const targetRef = (0, import_react29.useRef)(null);
@@ -2071,8 +2083,12 @@ function Select({
2071
2083
  (0, import_react28.size)({
2072
2084
  apply({ availableWidth, elements, rects }) {
2073
2085
  const referenceWidth = rects.reference.width;
2074
- elements.floating.style.minWidth = `${referenceWidth}px`;
2075
- elements.floating.style.maxWidth = `${availableWidth}px`;
2086
+ if (matchListToTrigger) {
2087
+ elements.floating.style.width = `${referenceWidth}px`;
2088
+ } else {
2089
+ elements.floating.style.minWidth = `${referenceWidth}px`;
2090
+ elements.floating.style.maxWidth = `${availableWidth}px`;
2091
+ }
2076
2092
  }
2077
2093
  })
2078
2094
  ],
package/dist/index.mjs CHANGED
@@ -428,6 +428,7 @@ var PopoverContent = forwardRef(function PopoverContent2({ children }, ref) {
428
428
  ref: composeRefs(floating.refs.setFloating, ref),
429
429
  tabIndex: -1,
430
430
  onKeyDown: handleKeyDown,
431
+ className: "z-popover",
431
432
  style: {
432
433
  position: floating.strategy,
433
434
  top: floating.y ?? 0,
@@ -537,18 +538,18 @@ import { DayButton } from "react-day-picker";
537
538
  import { clsx as clsx6 } from "clsx";
538
539
  import { getDefaultClassNames } from "react-day-picker";
539
540
  var defaultDayPickerClassNames = getDefaultClassNames();
541
+ var DAY_PICKER_FONT_SIZE = "12px";
540
542
  var dayPickerStyle = {
541
- "--rdp-font-family": "Arial, 'Noto Sans JP', sans-serif",
542
543
  "--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
544
  "--rdp-day-width": "30px",
547
545
  "--rdp-day-height": "30px",
548
546
  "--rdp-day_button-width": "28px",
549
547
  "--rdp-day_button-height": "28px",
550
548
  "--rdp-day_button-border": "1px solid transparent",
551
- "--rdp-weekday-padding": "0px"
549
+ "--rdp-weekday-padding": "0px",
550
+ fontFamily: "Arial, 'Noto Sans JP', sans-serif",
551
+ fontSize: DAY_PICKER_FONT_SIZE,
552
+ fontWeight: 700
552
553
  };
553
554
  var dayPickerClassNames = {
554
555
  month: clsx6(defaultDayPickerClassNames.month, "flex flex-col px-[7px] py-2")
@@ -557,7 +558,7 @@ var dayButtonBaseClass = "relative grid size-full place-items-center rounded-ful
557
558
 
558
559
  // src/date-picker/date-picker-day-button.tsx
559
560
  import { jsx as jsx11 } from "react/jsx-runtime";
560
- var CustomDayButton = ({ day, modifiers, className, ...buttonProps }) => {
561
+ var CustomDayButton = ({ day, modifiers, className, style, ...buttonProps }) => {
561
562
  const isSelected = Boolean(modifiers.selected);
562
563
  const isOutside = Boolean(modifiers.outside);
563
564
  const isMinMaxDisabled = Boolean(modifiers.minMaxDisabled);
@@ -570,6 +571,7 @@ var CustomDayButton = ({ day, modifiers, className, ...buttonProps }) => {
570
571
  ...buttonProps,
571
572
  day,
572
573
  modifiers,
574
+ style: { ...style, fontSize: DAY_PICKER_FONT_SIZE },
573
575
  className: clsx7(
574
576
  className,
575
577
  dayButtonBaseClass,
@@ -677,46 +679,55 @@ var formatMonthLabel = (date) => {
677
679
 
678
680
  // src/date-picker/date-picker-month-caption.tsx
679
681
  import { jsx as jsx13, jsxs as jsxs3 } from "react/jsx-runtime";
680
- var CustomMonthCaption = ({ calendarMonth, className, displayIndex, ...props }) => {
682
+ var CustomMonthCaption = ({ calendarMonth, className, displayIndex, style, ...props }) => {
681
683
  void displayIndex;
682
684
  const { goToMonth, nextMonth, previousMonth } = useDayPicker();
683
685
  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
- ] });
686
+ return /* @__PURE__ */ jsxs3(
687
+ "div",
688
+ {
689
+ className: clsx9("flex items-center justify-between px-1 pb-0.5", className),
690
+ style: { ...style, fontSize: "inherit", fontWeight: "inherit" },
691
+ ...props,
692
+ children: [
693
+ /* @__PURE__ */ jsx13(
694
+ IconButton,
695
+ {
696
+ icon: "angle-left",
697
+ size: "small",
698
+ variant: "text",
699
+ isDisabled: !previousMonth,
700
+ "aria-label": "\u524D\u306E\u6708",
701
+ onClick: () => previousMonth && goToMonth(previousMonth)
702
+ }
703
+ ),
704
+ /* @__PURE__ */ jsx13("span", { className: "typography-label12bold text-text02", children: formatMonthLabel(captionMonth) }),
705
+ /* @__PURE__ */ jsx13(
706
+ IconButton,
707
+ {
708
+ icon: "angle-right",
709
+ size: "small",
710
+ variant: "text",
711
+ isDisabled: !nextMonth,
712
+ "aria-label": "\u6B21\u306E\u6708",
713
+ onClick: () => nextMonth && goToMonth(nextMonth)
714
+ }
715
+ )
716
+ ]
717
+ }
718
+ );
709
719
  };
710
720
 
711
721
  // src/date-picker/date-picker-weekday.tsx
712
722
  import { clsx as clsx10 } from "clsx";
713
723
  import { jsx as jsx14 } from "react/jsx-runtime";
714
- var CustomWeekday = ({ className, children, ...props }) => {
724
+ var CustomWeekday = ({ className, children, style, ...props }) => {
715
725
  return /* @__PURE__ */ jsx14(
716
726
  "th",
717
727
  {
718
728
  ...props,
719
- className: clsx10(className, "m-0 flex size-7 items-center justify-center p-0 text-center text-text02"),
729
+ className: clsx10(className, "m-0 size-7 p-0 text-center align-middle text-text02"),
730
+ style: { ...style, fontSize: "inherit", fontWeight: "bold" },
720
731
  children
721
732
  }
722
733
  );
@@ -1990,7 +2001,8 @@ function Select({
1990
2001
  isError = false,
1991
2002
  isOptionSelected = false,
1992
2003
  onChange,
1993
- optionListMaxHeight
2004
+ optionListMaxHeight,
2005
+ matchListToTrigger = false
1994
2006
  }) {
1995
2007
  const [isOptionListOpen, setIsOptionListOpen] = useState8(false);
1996
2008
  const targetRef = useRef6(null);
@@ -2004,8 +2016,12 @@ function Select({
2004
2016
  sizeMiddleware({
2005
2017
  apply({ availableWidth, elements, rects }) {
2006
2018
  const referenceWidth = rects.reference.width;
2007
- elements.floating.style.minWidth = `${referenceWidth}px`;
2008
- elements.floating.style.maxWidth = `${availableWidth}px`;
2019
+ if (matchListToTrigger) {
2020
+ elements.floating.style.width = `${referenceWidth}px`;
2021
+ } else {
2022
+ elements.floating.style.minWidth = `${referenceWidth}px`;
2023
+ elements.floating.style.maxWidth = `${availableWidth}px`;
2024
+ }
2009
2025
  }
2010
2026
  })
2011
2027
  ],
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.2",
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.2",
42
+ "@zenkigen-inc/component-icons": "1.19.2",
43
+ "@zenkigen-inc/component-theme": "1.19.2",
44
44
  "clsx": "2.1.1",
45
- "react-day-picker": "9.0.0"
45
+ "react-day-picker": "9.13.0"
46
46
  }
47
47
  }