@zenkigen-inc/component-ui 1.0.2 → 1.1.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.
@@ -1,7 +1,2 @@
1
- import { ReactNode } from 'react';
2
- type Props = {
3
- isLast: boolean;
4
- children?: ReactNode;
5
- };
6
- export declare const BreadcrumbItem: ({ children, isLast }: Props) => import("react").JSX.Element;
7
- export {};
1
+ import { PropsWithChildren } from 'react';
2
+ export declare const BreadcrumbItem: ({ children }: PropsWithChildren) => import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
- import { ReactNode } from 'react';
2
- type Props = {
3
- children: ReactNode[];
4
- };
5
- export declare const Breadcrumb: ({ children }: Props) => import("react").JSX.Element;
6
- export {};
1
+ import { PropsWithChildren } from 'react';
2
+ export declare function Breadcrumb({ children }: PropsWithChildren): import("react").JSX.Element;
3
+ export declare namespace Breadcrumb {
4
+ var Item: ({ children }: {
5
+ children?: import("react").ReactNode;
6
+ }) => import("react").JSX.Element;
7
+ }
package/dist/index.esm.js CHANGED
@@ -37,35 +37,24 @@ function Avatar(_ref) {
37
37
  }
38
38
 
39
39
  var BreadcrumbItem = function BreadcrumbItem(_ref) {
40
- var children = _ref.children,
41
- isLast = _ref.isLast;
42
- return /*#__PURE__*/jsxs(Fragment, {
43
- children: [/*#__PURE__*/jsx("li", {
44
- className: clsx$1('[&_a]:text-interactive-interactive02', '[&_a]:hover:underline'),
45
- children: children
46
- }), !isLast && /*#__PURE__*/jsx("li", {
47
- "aria-hidden": "true",
48
- className: "text-interactive-interactive02",
49
- children: "/"
50
- })]
40
+ var children = _ref.children;
41
+ return /*#__PURE__*/jsx("li", {
42
+ className: "flex gap-2 after:content-['/'] last:after:content-none [&_a]:text-interactive-interactive02 [&_a]:hover:underline",
43
+ children: children
51
44
  });
52
45
  };
53
46
 
54
- var Breadcrumb = function Breadcrumb(_ref) {
47
+ function Breadcrumb(_ref) {
55
48
  var children = _ref.children;
56
49
  return /*#__PURE__*/jsx("nav", {
57
50
  "aria-label": "breadcrumb",
58
51
  children: /*#__PURE__*/jsx("ul", {
59
- className: clsx$1(typography.label.label2regular, 'flex flex-wrap gap-2 whitespace-nowrap text-text-text01'),
60
- children: children.map(function (child, i) {
61
- return /*#__PURE__*/jsx(BreadcrumbItem, {
62
- isLast: i === children.length - 1,
63
- children: child
64
- }, i);
65
- })
52
+ className: typography.label.label2regular + " flex flex-wrap gap-2 whitespace-nowrap text-text-text01",
53
+ children: children
66
54
  })
67
55
  });
68
- };
56
+ }
57
+ Breadcrumb.Item = BreadcrumbItem;
69
58
 
70
59
  var _excluded$4 = ["size", "variant"];
71
60
  function Button(_ref) {
@@ -31478,7 +31467,7 @@ function ModalButtonTab(_ref) {
31478
31467
  setIsOpen(false);
31479
31468
  }, [onClickSecondaryButton, setIsOpen]);
31480
31469
  var handleClickSubButton = useCallback(function () {
31481
- onClickSubButton == null ? void 0 : onClickSubButton();
31470
+ onClickSubButton == null || onClickSubButton();
31482
31471
  }, [onClickSubButton]);
31483
31472
  var wrapperClasses = clsx$1('flex', 'shrink-0', 'items-center', 'w-full', 'rounded-b-lg', 'py-4', 'px-6', {
31484
31473
  'justify-between': isWithCheckbox || subButtonLabel && size !== 'small',
@@ -31550,16 +31539,6 @@ function ModalHeader(_ref) {
31550
31539
  });
31551
31540
  }
31552
31541
 
31553
- function Tab(_ref) {
31554
- var children = _ref.children;
31555
- var classes = clsx('flex', 'px-6', 'gap-4', 'relative', 'before:bg-border-uiBorder01', 'before:h-px', 'before:bottom-0', 'before:left-0', 'before:right-0', 'before:absolute', {});
31556
- return /*#__PURE__*/jsx("div", {
31557
- role: "tablist",
31558
- className: classes,
31559
- children: children
31560
- });
31561
- }
31562
-
31563
31542
  var TabItem = function TabItem(props) {
31564
31543
  var _clsx;
31565
31544
  var classes = clsx('relative', 'flex', 'z-0', 'py-2', 'leading-[24px]', 'before:h-px', 'before:absolute', 'before:left-0', 'before:right-0', 'before:bottom-0', 'hover:text-text-text01', 'disabled:text-disabled-disabled01', 'disabled:pointer-events-none', (_clsx = {}, _clsx["" + typography.label.label2regular] = !props.isSelected, _clsx['text-interactive-interactive02 hover:before:bg-border-uiBorder02Dark'] = !props.isSelected, _clsx["" + typography.label.label2bold] = props.isSelected, _clsx['before:bg-interactive-interactive01 hover:before:bg-interactive-interactive01 pointer-events-none'] = props.isSelected, _clsx));
@@ -31576,6 +31555,17 @@ var TabItem = function TabItem(props) {
31576
31555
  });
31577
31556
  };
31578
31557
 
31558
+ function Tab(_ref) {
31559
+ var children = _ref.children;
31560
+ var classes = clsx('flex', 'px-6', 'gap-4', 'relative', 'before:bg-border-uiBorder01', 'before:h-px', 'before:bottom-0', 'before:left-0', 'before:right-0', 'before:absolute', {});
31561
+ return /*#__PURE__*/jsx("div", {
31562
+ role: "tablist",
31563
+ className: classes,
31564
+ children: children
31565
+ });
31566
+ }
31567
+ Tab.Item = TabItem;
31568
+
31579
31569
  function ModalTab(_ref) {
31580
31570
  var tabItems = _ref.tabItems,
31581
31571
  selectedTab = _ref.selectedTab,
@@ -31805,7 +31795,7 @@ var Search = /*#__PURE__*/forwardRef(function (_ref, ref) {
31805
31795
  className: inputClasses,
31806
31796
  placeholder: props.placeholder,
31807
31797
  onChange: props.onChange
31808
- }), props.value && props.value.length !== 0 && /*#__PURE__*/jsx(IconButton, {
31798
+ }), props.onClickClearButton && props.value && props.value.length !== 0 && /*#__PURE__*/jsx(IconButton, {
31809
31799
  variant: "text",
31810
31800
  icon: "close",
31811
31801
  size: size === 'medium' ? 'small' : 'medium',
@@ -31833,7 +31823,7 @@ function SelectItem$1(_ref) {
31833
31823
  selectedOption = _useContext.selectedOption,
31834
31824
  onChange = _useContext.onChange;
31835
31825
  var handleClickItem = function handleClickItem(option) {
31836
- onChange == null ? void 0 : onChange(option);
31826
+ onChange == null || onChange(option);
31837
31827
  setIsOptionListOpen(false);
31838
31828
  };
31839
31829
  var listItemClasses = clsx$1('flex w-full items-center');
@@ -31877,7 +31867,7 @@ function SelectList$1(_ref) {
31877
31867
  placeholder = _useContext.placeholder,
31878
31868
  onChange = _useContext.onChange;
31879
31869
  var handleClickDeselect = function handleClickDeselect() {
31880
- onChange == null ? void 0 : onChange(null);
31870
+ onChange == null || onChange(null);
31881
31871
  setIsOptionListOpen(false);
31882
31872
  };
31883
31873
  var listClasses = clsx$1('z-dropdown', 'absolute', 'w-max', 'py-2', 'overflow-y-auto', 'bg-background-uiBackground01', 'rounded', 'shadow-floatingShadow', {
@@ -31984,7 +31974,7 @@ function Select(_ref) {
31984
31974
  className: "ml-auto flex items-center",
31985
31975
  children: /*#__PURE__*/jsx(Icon, {
31986
31976
  name: isOptionListOpen ? 'angle-small-up' : 'angle-small-down',
31987
- size: "small"
31977
+ size: size === 'large' ? 'medium' : 'small'
31988
31978
  })
31989
31979
  })]
31990
31980
  }), isOptionListOpen && !isDisabled && /*#__PURE__*/jsx(SelectList$1, {
@@ -32086,7 +32076,7 @@ function SelectSort(_ref) {
32086
32076
  });
32087
32077
  };
32088
32078
  var handleClickItem = useCallback(function (value) {
32089
- onChange == null ? void 0 : onChange(value);
32079
+ onChange == null || onChange(value);
32090
32080
  setIsOptionListOpen(false);
32091
32081
  }, [onChange]);
32092
32082
  var wrapperClasses = clsx$1('relative', 'flex', 'shrink-0', 'gap-1', 'items-center', 'rounded', {
@@ -32122,7 +32112,7 @@ function SelectSort(_ref) {
32122
32112
  size: size === 'large' ? 'medium' : 'small'
32123
32113
  }) : /*#__PURE__*/jsx(Icon, {
32124
32114
  name: isOptionListOpen ? 'angle-small-up' : 'angle-small-down',
32125
- size: "small"
32115
+ size: size === 'large' ? 'medium' : 'small'
32126
32116
  })
32127
32117
  })]
32128
32118
  }), isOptionListOpen && !isDisabled && /*#__PURE__*/jsx(SelectList, {
@@ -32135,23 +32125,17 @@ function SelectSort(_ref) {
32135
32125
  });
32136
32126
  }
32137
32127
 
32138
- function TableContainer(_ref) {
32139
- var width = _ref.width,
32140
- rows = _ref.rows,
32141
- columns = _ref.columns,
32142
- children = _ref.children;
32128
+ function TableCell(_ref) {
32129
+ var children = _ref.children,
32130
+ className = _ref.className;
32131
+ var cellClasses = clsx$1('border-b-[1px] border-border-uiBorder01');
32143
32132
  return /*#__PURE__*/jsx("div", {
32144
- className: "grid",
32145
- style: {
32146
- width: width,
32147
- gridTemplateRows: rows,
32148
- gridTemplateColumns: columns
32149
- },
32133
+ className: clsx$1(cellClasses, className),
32150
32134
  children: children
32151
32135
  });
32152
32136
  }
32153
32137
 
32154
- function TableRowContainer(_ref) {
32138
+ function TableRow(_ref) {
32155
32139
  var children = _ref.children,
32156
32140
  isHoverBackgroundVisible = _ref.isHoverBackgroundVisible;
32157
32141
  var rowClasses = clsx$1('contents', isHoverBackgroundVisible && '[&:hover>div]:bg-hover-hoverUi02');
@@ -32161,15 +32145,23 @@ function TableRowContainer(_ref) {
32161
32145
  });
32162
32146
  }
32163
32147
 
32164
- function TableCell(_ref) {
32165
- var children = _ref.children,
32166
- className = _ref.className;
32167
- var cellClasses = clsx$1('border-b-[1px] border-border-uiBorder01');
32148
+ function Table(_ref) {
32149
+ var width = _ref.width,
32150
+ rows = _ref.rows,
32151
+ columns = _ref.columns,
32152
+ children = _ref.children;
32168
32153
  return /*#__PURE__*/jsx("div", {
32169
- className: clsx$1(cellClasses, className),
32154
+ className: "grid",
32155
+ style: {
32156
+ width: width,
32157
+ gridTemplateRows: rows,
32158
+ gridTemplateColumns: columns
32159
+ },
32170
32160
  children: children
32171
32161
  });
32172
32162
  }
32163
+ Table.Row = TableRow;
32164
+ Table.Cell = TableCell;
32173
32165
 
32174
32166
  var DeleteIcon = function DeleteIcon(_ref) {
32175
32167
  var color = _ref.color,
@@ -32476,7 +32468,7 @@ function Tooltip(_ref) {
32476
32468
  setIsVisible(false);
32477
32469
  }, []);
32478
32470
  var targetClasses = clsx$1('relative', 'flex', 'items-center', 'justify-center');
32479
- var tooltipBodyClasses = clsx$1('z-tooltip', 'absolute', 'w-max', horizontalAlign === 'left' ? 'left-0' : horizontalAlign === 'right' ? 'right-0' : 'left-auto', 'inline-block', size === 'small' ? 'px-2 pb-1 pt-1.5' : 'px-4 py-3', 'text-text-textOnColor', 'bg-background-uiBackgroundTooltip', 'rounded', 'shadow-floatingShadow', typography.body[size === 'small' ? 'body3regular' : 'body2regular']);
32471
+ var tooltipBodyClasses = clsx$1('z-tooltip', 'absolute', 'w-max', horizontalAlign === 'left' ? 'left-0' : horizontalAlign === 'right' ? 'right-0' : 'left-auto', 'inline-block', size === 'small' ? 'px-2 pb-1 pt-1.5' : 'px-4 py-3', 'text-text-textOnColor', 'bg-background-uiBackgroundTooltip', 'rounded', typography.body[size === 'small' ? 'body3regular' : 'body2regular']);
32480
32472
  return /*#__PURE__*/jsxs("div", {
32481
32473
  ref: targetRef,
32482
32474
  className: targetClasses,
@@ -32498,5 +32490,5 @@ function Tooltip(_ref) {
32498
32490
  });
32499
32491
  }
32500
32492
 
32501
- export { Avatar, Breadcrumb, Button, Checkbox, Dropdown, EvaluationStar, Heading, Icon, IconButton, Loading, Modal, NotificationInline, Radio, Search, Select, SelectSort, Tab, TabItem, TableCell, TableContainer, TableRowContainer, Tag, Toast, ToastProvider, Toggle, Tooltip, useToast };
32493
+ export { Avatar, Breadcrumb, Button, Checkbox, Dropdown, EvaluationStar, Heading, Icon, IconButton, Loading, Modal, NotificationInline, Radio, Search, Select, SelectSort, Tab, TabItem, Table, TableCell, TableRow, Tag, Toast, ToastProvider, Toggle, Tooltip, useToast };
32502
32494
  //# sourceMappingURL=index.esm.js.map