@zenkigen-inc/component-ui 1.0.1 → 1.1.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.
@@ -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'),
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'),
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) {
@@ -299,7 +288,7 @@ function DropdownMenu(_ref) {
299
288
  variant = _useContext.variant;
300
289
  var wrapperClasses = clsx$1('z-dropdown', 'absolute', 'w-max', 'bg-background-uiBackground01', 'rounded', 'shadow-floatingShadow', 'overflow-y-auto', horizontalAlign === 'left' ? 'left-0' : horizontalAlign === 'right' ? 'right-0' : 'left-auto', {
301
290
  'border-solid border border-border-uiBorder01': variant === 'outline',
302
- 'py-2': !isNoPadding
291
+ 'py-1': !isNoPadding
303
292
  });
304
293
  return isVisible && !isDisabled && /*#__PURE__*/jsx("ul", {
305
294
  className: wrapperClasses,
@@ -444,7 +433,7 @@ function EvaluationStar(_ref) {
444
433
  });
445
434
  var ratingStars = [];
446
435
  var _loop = function _loop(i) {
447
- var color = i <= currentRating ? 'fill-support-supportWarning' : 'fill-icon-icon02';
436
+ var color = i <= currentRating ? 'fill-yellow-yellow50' : 'fill-icon-icon03';
448
437
  ratingStars.push( /*#__PURE__*/jsx("button", {
449
438
  type: "button",
450
439
  onClick: function onClick() {
@@ -466,7 +455,7 @@ function EvaluationStar(_ref) {
466
455
 
467
456
  function Heading(props) {
468
457
  var TagName = "h" + props.level;
469
- var classes = clsx('flex', 'items-center', typography.heading[TagName], {
458
+ var classes = clsx('flex', 'items-center', 'text-text-text01', typography.heading[TagName], {
470
459
  'gap-2': props.level === 1
471
460
  }, {
472
461
  'gap-1': props.level > 1
@@ -535,36 +524,54 @@ function Loading(_ref) {
535
524
  height = _ref$height === void 0 ? '100%' : _ref$height;
536
525
  var wrapperClasses = clsx$1(position, 'top-0', 'left-0', 'z-20', 'flex', 'items-center', 'justify-center', 'w-full');
537
526
  var svgClasses = clsx$1(size === 'small' && 'h-4 w-4', size === 'medium' && 'h-8 w-8', size === 'large' && 'h-16 w-16');
538
- return /*#__PURE__*/jsx("div", {
539
- className: wrapperClasses,
540
- style: {
541
- height: height
542
- },
543
- children: /*#__PURE__*/jsxs("svg", {
544
- className: svgClasses,
545
- viewBox: "0 0 32 32",
546
- fill: "none",
547
- xmlns: "http://www.w3.org/2000/svg",
548
- children: [/*#__PURE__*/jsx("circle", {
549
- className: "stroke-border-uiBorder01",
550
- cx: "16",
551
- cy: "16",
552
- r: "14",
553
- strokeWidth: "3",
554
- fill: "none"
555
- }), /*#__PURE__*/jsx("circle", {
556
- className: "animate-circular-move stroke-interactive-interactive01",
557
- style: {
558
- strokeDasharray: '80px 200px',
559
- strokeDashoffset: '0px',
560
- transformOrigin: 'center center'
561
- },
562
- cx: "16",
563
- cy: "16",
564
- r: "14",
565
- stroke: "currentColor",
566
- strokeWidth: "3",
567
- fill: "none"
527
+ return /*#__PURE__*/jsx(Fragment, {
528
+ children: /*#__PURE__*/jsxs("div", {
529
+ className: wrapperClasses,
530
+ style: {
531
+ height: height
532
+ },
533
+ children: [size === 'small' && /*#__PURE__*/jsx("svg", {
534
+ className: svgClasses,
535
+ viewBox: "0 0 16 16",
536
+ fill: "none",
537
+ xmlns: "http://www.w3.org/2000/svg",
538
+ children: /*#__PURE__*/jsx("circle", {
539
+ className: "origin-center animate-circular-small-move stroke-interactive-interactive01",
540
+ cx: "8",
541
+ cy: "8",
542
+ r: "7",
543
+ stroke: "currentColor",
544
+ strokeWidth: "1.5",
545
+ fill: "none"
546
+ })
547
+ }), size === 'medium' && /*#__PURE__*/jsx("svg", {
548
+ className: svgClasses,
549
+ viewBox: "0 0 32 32",
550
+ fill: "none",
551
+ xmlns: "http://www.w3.org/2000/svg",
552
+ children: /*#__PURE__*/jsx("circle", {
553
+ className: "origin-center animate-circular-medium-move stroke-interactive-interactive01",
554
+ cx: "16",
555
+ cy: "16",
556
+ r: "15",
557
+ stroke: "currentColor",
558
+ strokeWidth: "2",
559
+ fill: "none"
560
+ })
561
+ }), size === 'large' && /*#__PURE__*/jsx("svg", {
562
+ className: svgClasses,
563
+ viewBox: "0 0 64 64",
564
+ fill: "none",
565
+ xmlns: "http://www.w3.org/2000/svg",
566
+ children: /*#__PURE__*/jsx("circle", {
567
+ className: "origin-center animate-circular-large-move stroke-interactive-interactive01",
568
+ cx: "32",
569
+ cy: "32",
570
+ r: "30",
571
+ stroke: "currentColor",
572
+ strokeWidth: "3",
573
+ fill: "none"
574
+ })
568
575
  })]
569
576
  })
570
577
  });
@@ -31460,7 +31467,7 @@ function ModalButtonTab(_ref) {
31460
31467
  setIsOpen(false);
31461
31468
  }, [onClickSecondaryButton, setIsOpen]);
31462
31469
  var handleClickSubButton = useCallback(function () {
31463
- onClickSubButton == null ? void 0 : onClickSubButton();
31470
+ onClickSubButton == null || onClickSubButton();
31464
31471
  }, [onClickSubButton]);
31465
31472
  var wrapperClasses = clsx$1('flex', 'shrink-0', 'items-center', 'w-full', 'rounded-b-lg', 'py-4', 'px-6', {
31466
31473
  'justify-between': isWithCheckbox || subButtonLabel && size !== 'small',
@@ -31532,16 +31539,6 @@ function ModalHeader(_ref) {
31532
31539
  });
31533
31540
  }
31534
31541
 
31535
- function Tab(_ref) {
31536
- var children = _ref.children;
31537
- 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', {});
31538
- return /*#__PURE__*/jsx("div", {
31539
- role: "tablist",
31540
- className: classes,
31541
- children: children
31542
- });
31543
- }
31544
-
31545
31542
  var TabItem = function TabItem(props) {
31546
31543
  var _clsx;
31547
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));
@@ -31558,6 +31555,17 @@ var TabItem = function TabItem(props) {
31558
31555
  });
31559
31556
  };
31560
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
+
31561
31569
  function ModalTab(_ref) {
31562
31570
  var tabItems = _ref.tabItems,
31563
31571
  selectedTab = _ref.selectedTab,
@@ -31696,7 +31704,7 @@ function Radio(_ref) {
31696
31704
  var handleChange = useCallback(function (e) {
31697
31705
  return !isDisabled && (onChange == null ? void 0 : onChange(e));
31698
31706
  }, [isDisabled, onChange]);
31699
- var inputClasses = clsx$1('absolute', 'z-[1]', 'opacity-0', 'peer', {
31707
+ var inputClasses = clsx$1('absolute', 'z-[1]', 'opacity-0', 'peer', 'h-6', 'w-6', {
31700
31708
  'cursor-not-allowed': isDisabled,
31701
31709
  'cursor-pointer': !isDisabled
31702
31710
  });
@@ -31752,34 +31760,47 @@ function Radio(_ref) {
31752
31760
  });
31753
31761
  }
31754
31762
 
31755
- var _excluded = ["width", "value"];
31763
+ var _excluded = ["width", "size"];
31756
31764
  var Search = /*#__PURE__*/forwardRef(function (_ref, ref) {
31765
+ var _clsx;
31757
31766
  var _ref$width = _ref.width,
31758
31767
  width = _ref$width === void 0 ? '100%' : _ref$width,
31759
- _ref$value = _ref.value,
31760
- value = _ref$value === void 0 ? '' : _ref$value,
31768
+ _ref$size = _ref.size,
31769
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
31761
31770
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
31771
+ var classes = clsx('flex', 'items-center', 'rounded-full', 'border', 'border-border-uiBorder02', 'focus-within:border-active-activeInput', {
31772
+ 'h-8 px-3': size === 'medium'
31773
+ }, {
31774
+ 'h-10 px-4': size === 'large'
31775
+ });
31776
+ var inputClasses = clsx('ml-2.5', 'mr-2.5', 'h-full', 'flex-1', 'outline-0', 'text-text-text01', 'placeholder:text-text-textPlaceholder', (_clsx = {}, _clsx["" + typography.label.label2regular] = size === 'medium', _clsx["" + typography.label.label1regular] = size === 'large', _clsx));
31762
31777
  return /*#__PURE__*/jsx("div", {
31763
31778
  className: "relative",
31764
31779
  ref: ref,
31765
31780
  children: /*#__PURE__*/jsx("form", {
31766
31781
  onSubmit: props.onSubmit,
31767
31782
  children: /*#__PURE__*/jsxs("div", {
31768
- className: "flex h-8 items-center rounded-full border border-border-uiBorder02 px-3 focus-within:border-active-activeInput",
31783
+ className: classes,
31769
31784
  style: {
31770
31785
  width: width
31771
31786
  },
31772
31787
  children: [/*#__PURE__*/jsx(Icon, {
31773
31788
  name: "search",
31774
31789
  color: "icon01",
31775
- size: "small"
31790
+ size: "medium"
31776
31791
  }), /*#__PURE__*/jsx("input", {
31777
31792
  type: "text",
31778
31793
  size: 1,
31779
- value: value,
31780
- className: typography.label.label2regular + " ml-3 h-full flex-1 outline-0 placeholder:text-text-textPlaceholder",
31794
+ value: props.value,
31795
+ className: inputClasses,
31781
31796
  placeholder: props.placeholder,
31782
31797
  onChange: props.onChange
31798
+ }), props.onClickClearButton && props.value && props.value.length !== 0 && /*#__PURE__*/jsx(IconButton, {
31799
+ variant: "text",
31800
+ icon: "close",
31801
+ size: size === 'medium' ? 'small' : 'medium',
31802
+ isNoPadding: true,
31803
+ onClick: props.onClickClearButton
31783
31804
  })]
31784
31805
  })
31785
31806
  })
@@ -31802,7 +31823,7 @@ function SelectItem$1(_ref) {
31802
31823
  selectedOption = _useContext.selectedOption,
31803
31824
  onChange = _useContext.onChange;
31804
31825
  var handleClickItem = function handleClickItem(option) {
31805
- onChange == null ? void 0 : onChange(option);
31826
+ onChange == null || onChange(option);
31806
31827
  setIsOptionListOpen(false);
31807
31828
  };
31808
31829
  var listItemClasses = clsx$1('flex w-full items-center');
@@ -31846,7 +31867,7 @@ function SelectList$1(_ref) {
31846
31867
  placeholder = _useContext.placeholder,
31847
31868
  onChange = _useContext.onChange;
31848
31869
  var handleClickDeselect = function handleClickDeselect() {
31849
- onChange == null ? void 0 : onChange(null);
31870
+ onChange == null || onChange(null);
31850
31871
  setIsOptionListOpen(false);
31851
31872
  };
31852
31873
  var listClasses = clsx$1('z-dropdown', 'absolute', 'w-max', 'py-2', 'overflow-y-auto', 'bg-background-uiBackground01', 'rounded', 'shadow-floatingShadow', {
@@ -32055,7 +32076,7 @@ function SelectSort(_ref) {
32055
32076
  });
32056
32077
  };
32057
32078
  var handleClickItem = useCallback(function (value) {
32058
- onChange == null ? void 0 : onChange(value);
32079
+ onChange == null || onChange(value);
32059
32080
  setIsOptionListOpen(false);
32060
32081
  }, [onChange]);
32061
32082
  var wrapperClasses = clsx$1('relative', 'flex', 'shrink-0', 'gap-1', 'items-center', 'rounded', {
@@ -32104,23 +32125,17 @@ function SelectSort(_ref) {
32104
32125
  });
32105
32126
  }
32106
32127
 
32107
- function TableContainer(_ref) {
32108
- var width = _ref.width,
32109
- rows = _ref.rows,
32110
- columns = _ref.columns,
32111
- 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');
32112
32132
  return /*#__PURE__*/jsx("div", {
32113
- className: "grid",
32114
- style: {
32115
- width: width,
32116
- gridTemplateRows: rows,
32117
- gridTemplateColumns: columns
32118
- },
32133
+ className: clsx$1(cellClasses, className),
32119
32134
  children: children
32120
32135
  });
32121
32136
  }
32122
32137
 
32123
- function TableRowContainer(_ref) {
32138
+ function TableRow(_ref) {
32124
32139
  var children = _ref.children,
32125
32140
  isHoverBackgroundVisible = _ref.isHoverBackgroundVisible;
32126
32141
  var rowClasses = clsx$1('contents', isHoverBackgroundVisible && '[&:hover>div]:bg-hover-hoverUi02');
@@ -32130,15 +32145,23 @@ function TableRowContainer(_ref) {
32130
32145
  });
32131
32146
  }
32132
32147
 
32133
- function TableCell(_ref) {
32134
- var children = _ref.children,
32135
- className = _ref.className;
32136
- 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;
32137
32153
  return /*#__PURE__*/jsx("div", {
32138
- className: clsx$1(cellClasses, className),
32154
+ className: "grid",
32155
+ style: {
32156
+ width: width,
32157
+ gridTemplateRows: rows,
32158
+ gridTemplateColumns: columns
32159
+ },
32139
32160
  children: children
32140
32161
  });
32141
32162
  }
32163
+ Table.Row = TableRow;
32164
+ Table.Cell = TableCell;
32142
32165
 
32143
32166
  var DeleteIcon = function DeleteIcon(_ref) {
32144
32167
  var color = _ref.color,
@@ -32467,5 +32490,5 @@ function Tooltip(_ref) {
32467
32490
  });
32468
32491
  }
32469
32492
 
32470
- 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 };
32471
32494
  //# sourceMappingURL=index.esm.js.map