@zenkigen-inc/component-ui 1.15.1 → 1.15.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.
Files changed (97) hide show
  1. package/dist/index.d.mts +434 -0
  2. package/dist/index.d.ts +434 -27
  3. package/dist/index.js +1602 -1701
  4. package/dist/index.mjs +1915 -0
  5. package/package.json +18 -8
  6. package/tsup.config.ts +13 -0
  7. package/vitest.config.ts +11 -0
  8. package/vitest.setup.ts +1 -0
  9. package/dist/avatar/avatar.d.ts +0 -10
  10. package/dist/avatar/index.d.ts +0 -1
  11. package/dist/breadcrumb/breadcrumb-item.d.ts +0 -2
  12. package/dist/breadcrumb/breadcrumb.d.ts +0 -5
  13. package/dist/breadcrumb/index.d.ts +0 -1
  14. package/dist/button/button.d.ts +0 -22
  15. package/dist/button/index.d.ts +0 -1
  16. package/dist/checkbox/checkbox.d.ts +0 -14
  17. package/dist/checkbox/checked-icon.d.ts +0 -1
  18. package/dist/checkbox/index.d.ts +0 -1
  19. package/dist/checkbox/minus-icon.d.ts +0 -1
  20. package/dist/dropdown/dropdown-context.d.ts +0 -14
  21. package/dist/dropdown/dropdown-item.d.ts +0 -7
  22. package/dist/dropdown/dropdown-menu.d.ts +0 -10
  23. package/dist/dropdown/dropdown.d.ts +0 -26
  24. package/dist/dropdown/index.d.ts +0 -2
  25. package/dist/dropdown/type.d.ts +0 -9
  26. package/dist/evaluation-star/evaluation-star.d.ts +0 -8
  27. package/dist/evaluation-star/index.d.ts +0 -1
  28. package/dist/heading/heading.d.ts +0 -10
  29. package/dist/heading/index.d.ts +0 -1
  30. package/dist/hooks/index.d.ts +0 -1
  31. package/dist/hooks/use-outside-click.d.ts +0 -2
  32. package/dist/icon/icon.d.ts +0 -13
  33. package/dist/icon/index.d.ts +0 -1
  34. package/dist/icon-button/icon-button.d.ts +0 -19
  35. package/dist/icon-button/index.d.ts +0 -1
  36. package/dist/index.esm.js +0 -2147
  37. package/dist/index.esm.js.map +0 -1
  38. package/dist/index.js.map +0 -1
  39. package/dist/loading/index.d.ts +0 -1
  40. package/dist/loading/loading.d.ts +0 -7
  41. package/dist/modal/body-scroll-lock.d.ts +0 -27
  42. package/dist/modal/index.d.ts +0 -1
  43. package/dist/modal/modal-body.d.ts +0 -2
  44. package/dist/modal/modal-context.d.ts +0 -5
  45. package/dist/modal/modal-footer.d.ts +0 -7
  46. package/dist/modal/modal-header.d.ts +0 -6
  47. package/dist/modal/modal.d.ts +0 -18
  48. package/dist/notification-inline/index.d.ts +0 -1
  49. package/dist/notification-inline/notification-inline.d.ts +0 -13
  50. package/dist/pagination/index.d.ts +0 -1
  51. package/dist/pagination/pagination-button.d.ts +0 -6
  52. package/dist/pagination/pagination-context.d.ts +0 -6
  53. package/dist/pagination/pagination.d.ts +0 -12
  54. package/dist/pagination-select/index.d.ts +0 -1
  55. package/dist/pagination-select/pagination-select.d.ts +0 -22
  56. package/dist/radio/index.d.ts +0 -1
  57. package/dist/radio/radio.d.ts +0 -12
  58. package/dist/search/index.d.ts +0 -1
  59. package/dist/search/search.d.ts +0 -12
  60. package/dist/select/index.d.ts +0 -2
  61. package/dist/select/select-context.d.ts +0 -11
  62. package/dist/select/select-item.d.ts +0 -6
  63. package/dist/select/select-list.d.ts +0 -6
  64. package/dist/select/select.d.ts +0 -22
  65. package/dist/select/type.d.ts +0 -7
  66. package/dist/select-sort/index.d.ts +0 -2
  67. package/dist/select-sort/select-item.d.ts +0 -7
  68. package/dist/select-sort/select-list.d.ts +0 -10
  69. package/dist/select-sort/select-sort.d.ts +0 -15
  70. package/dist/select-sort/type.d.ts +0 -1
  71. package/dist/tab/index.d.ts +0 -2
  72. package/dist/tab/tab-item.d.ts +0 -10
  73. package/dist/tab/tab.d.ts +0 -15
  74. package/dist/table/index.d.ts +0 -3
  75. package/dist/table/table-cell.d.ts +0 -8
  76. package/dist/table/table-row.d.ts +0 -7
  77. package/dist/table/table.d.ts +0 -16
  78. package/dist/tag/delete-icon.d.ts +0 -8
  79. package/dist/tag/index.d.ts +0 -2
  80. package/dist/tag/tag.d.ts +0 -17
  81. package/dist/tag/type.d.ts +0 -3
  82. package/dist/text-area/index.d.ts +0 -1
  83. package/dist/text-area/text-area.d.ts +0 -8
  84. package/dist/text-input/index.d.ts +0 -1
  85. package/dist/text-input/text-input.d.ts +0 -7
  86. package/dist/toast/index.d.ts +0 -2
  87. package/dist/toast/toast-provider.d.ts +0 -13
  88. package/dist/toast/toast.d.ts +0 -12
  89. package/dist/toast/type.d.ts +0 -1
  90. package/dist/toggle/index.d.ts +0 -1
  91. package/dist/toggle/toggle.d.ts +0 -12
  92. package/dist/tooltip/index.d.ts +0 -1
  93. package/dist/tooltip/tail-icon.d.ts +0 -8
  94. package/dist/tooltip/tooltip-content.d.ts +0 -11
  95. package/dist/tooltip/tooltip.d.ts +0 -13
  96. package/dist/tooltip/tooltip.hook.d.ts +0 -11
  97. package/dist/tooltip/type.d.ts +0 -13
package/dist/index.js CHANGED
@@ -1,148 +1,197 @@
1
- import { userColors, buttonColors, focusVisible, iconColors, typography, tagColors, tagLightColors } from '@zenkigen-inc/component-theme';
2
- import clsx$1, { clsx } from 'clsx';
3
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
- import { useState, useCallback, useEffect, createContext, useContext, useRef, useLayoutEffect, forwardRef } from 'react';
5
- import { createPortal } from 'react-dom';
6
- import { iconElements } from '@zenkigen-inc/component-icons';
7
-
8
- function _extends() {
9
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
10
- for (var e = 1; e < arguments.length; e++) {
11
- var t = arguments[e];
12
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
13
- }
14
- return n;
15
- }, _extends.apply(null, arguments);
16
- }
17
- function _objectWithoutPropertiesLoose(r, e) {
18
- if (null == r) return {};
19
- var t = {};
20
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
21
- if (-1 !== e.indexOf(n)) continue;
22
- t[n] = r[n];
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
17
  }
24
- return t;
25
- }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
26
29
 
27
- const _excluded$8 = ["size"];
28
- const isAsciiString = str => {
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ Avatar: () => Avatar,
34
+ Breadcrumb: () => Breadcrumb,
35
+ Button: () => Button,
36
+ Checkbox: () => Checkbox,
37
+ Dropdown: () => Dropdown,
38
+ EvaluationStar: () => EvaluationStar,
39
+ Heading: () => Heading,
40
+ Icon: () => Icon,
41
+ IconButton: () => IconButton,
42
+ Loading: () => Loading,
43
+ Modal: () => Modal,
44
+ NotificationInline: () => NotificationInline,
45
+ Pagination: () => Pagination,
46
+ PaginationSelect: () => PaginationSelect,
47
+ Radio: () => Radio,
48
+ Search: () => Search,
49
+ Select: () => Select,
50
+ SelectSort: () => SelectSort,
51
+ Tab: () => Tab,
52
+ TabItem: () => TabItem,
53
+ Table: () => Table,
54
+ TableCell: () => TableCell,
55
+ TableRow: () => TableRow,
56
+ Tag: () => Tag,
57
+ TextArea: () => TextArea,
58
+ TextInput: () => TextInput,
59
+ Toast: () => Toast,
60
+ ToastProvider: () => ToastProvider,
61
+ Toggle: () => Toggle,
62
+ Tooltip: () => Tooltip,
63
+ useOutsideClick: () => useOutsideClick,
64
+ useToast: () => useToast
65
+ });
66
+ module.exports = __toCommonJS(index_exports);
67
+
68
+ // src/avatar/avatar.tsx
69
+ var import_component_theme = require("@zenkigen-inc/component-theme");
70
+ var import_clsx = require("clsx");
71
+ var import_jsx_runtime = require("react/jsx-runtime");
72
+ var isAsciiString = (str) => {
29
73
  return str.charCodeAt(0) < 256;
30
74
  };
31
- function Avatar(_ref) {
32
- var _props$userId, _props$isDisabled;
33
- let {
34
- size = 'medium'
35
- } = _ref,
36
- props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
37
- const classes = clsx('flex items-center justify-center rounded-full text-textOnColor', {
38
- 'w-16 h-16 typography-label16regular': size === 'x-large',
39
- 'w-12 h-12 typography-label14regular': size === 'large',
40
- 'w-10 h-10 typography-label14regular': size === 'medium',
41
- 'w-8 h-8 typography-label11regular': size === 'small',
42
- 'w-6 h-6 typography-label11regular': size === 'x-small',
43
- 'bg-disabled01': props.isDisabled,
44
- 'bg-icon01': props.userId == null,
45
- [userColors[((_props$userId = props.userId) != null ? _props$userId : 0) % userColors.length]]: props.userId != null && !((_props$isDisabled = props.isDisabled) != null ? _props$isDisabled : false)
46
- });
47
- const trimmedFirstName = props.firstName.replace(' ', ' ').trim();
48
- const trimmedLastName = props.lastName.replace(' ', ' ').trim().trim();
75
+ function Avatar({ size = "medium", ...props }) {
76
+ const classes = (0, import_clsx.clsx)("flex items-center justify-center rounded-full text-textOnColor", {
77
+ "w-16 h-16 typography-label16regular": size === "x-large",
78
+ "w-12 h-12 typography-label14regular": size === "large",
79
+ "w-10 h-10 typography-label14regular": size === "medium",
80
+ "w-8 h-8 typography-label11regular": size === "small",
81
+ "w-6 h-6 typography-label11regular": size === "x-small",
82
+ "bg-disabled01": props.isDisabled,
83
+ "bg-icon01": props.userId == null,
84
+ [import_component_theme.userColors[(props.userId ?? 0) % import_component_theme.userColors.length]]: props.userId != null && !(props.isDisabled ?? false)
85
+ });
86
+ const trimmedFirstName = props.firstName.replace("\u3000", " ").trim();
87
+ const trimmedLastName = props.lastName.replace("\u3000", " ").trim().trim();
49
88
  const nameOnIcon = isAsciiString(trimmedLastName) ? trimmedFirstName.slice(0, 1).toUpperCase() + trimmedLastName.slice(0, 1).toUpperCase() : (trimmedLastName + trimmedFirstName).slice(0, 2);
50
- return /*#__PURE__*/jsx("span", {
51
- className: classes,
52
- children: nameOnIcon
53
- });
89
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: classes, children: nameOnIcon });
54
90
  }
55
91
 
56
- const BreadcrumbItem = ({
57
- children
58
- }) => {
59
- return /*#__PURE__*/jsx("li", {
60
- className: "flex gap-2 after:content-['/'] last:after:content-none [&_a]:text-interactive02 [&_a]:hover:underline",
61
- children: children
62
- });
92
+ // src/breadcrumb/breadcrumb-item.tsx
93
+ var import_jsx_runtime2 = require("react/jsx-runtime");
94
+ var BreadcrumbItem = ({ children }) => {
95
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { className: "flex gap-2 after:content-['/'] last:after:content-none [&_a]:text-interactive02 [&_a]:hover:underline", children });
63
96
  };
64
97
 
65
- function Breadcrumb({
66
- children
67
- }) {
68
- return /*#__PURE__*/jsx("nav", {
69
- "aria-label": "breadcrumb",
70
- children: /*#__PURE__*/jsx("ul", {
71
- className: "typography-label14regular flex flex-wrap gap-2 whitespace-nowrap text-text01",
72
- children: children
73
- })
74
- });
98
+ // src/breadcrumb/breadcrumb.tsx
99
+ var import_jsx_runtime3 = require("react/jsx-runtime");
100
+ function Breadcrumb({ children }) {
101
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("nav", { "aria-label": "breadcrumb", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { className: "typography-label14regular flex flex-wrap gap-2 whitespace-nowrap text-text01", children }) });
75
102
  }
76
103
  Breadcrumb.Item = BreadcrumbItem;
77
104
 
78
- const _excluded$7 = ["size", "variant", "isDisabled", "isSelected", "width", "borderRadius", "justifyContent", "before", "after", "elementAs", "children"];
79
- const Button = _ref => {
80
- let {
81
- size = 'medium',
82
- variant = 'fill',
83
- isDisabled,
84
- isSelected = false,
85
- width,
86
- borderRadius,
87
- justifyContent = 'center',
88
- before,
89
- after,
90
- elementAs,
91
- children
92
- } = _ref,
93
- props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
94
- const baseClasses = clsx('flex shrink-0 items-center gap-1', buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, {
95
- 'h-6 px-2.5': size === 'small',
96
- 'h-8 px-3': size === 'medium',
97
- 'h-10 px-4 leading-[24px]': size === 'large',
98
- 'inline-flex': elementAs === 'a',
99
- [buttonColors[variant].selected]: isSelected,
100
- [buttonColors[variant].base]: !isSelected,
101
- 'hover:text-textOnColor active:text-textOnColor [&:hover>*]:fill-iconOnColor [&:active>*]:fill-iconOnColor': isSelected && variant !== 'outline' && variant !== 'text',
102
- 'pointer-events-none': isDisabled,
103
- 'rounded-button': borderRadius == null,
104
- 'justify-start': justifyContent === 'start',
105
- 'justify-center': justifyContent === 'center',
106
- 'typography-label16regular': size === 'large',
107
- 'typography-label14regular': size !== 'large'
108
- });
109
- const Component = elementAs != null ? elementAs : 'button';
110
- return /*#__PURE__*/jsxs(Component, _extends({
111
- className: baseClasses,
112
- style: {
113
- width,
114
- borderRadius
115
- },
116
- disabled: isDisabled
117
- }, props, {
118
- children: [before, children, after]
119
- }));
105
+ // src/button/button.tsx
106
+ var import_component_theme2 = require("@zenkigen-inc/component-theme");
107
+ var import_clsx2 = require("clsx");
108
+ var import_jsx_runtime4 = require("react/jsx-runtime");
109
+ var Button = ({
110
+ size = "medium",
111
+ variant = "fill",
112
+ isDisabled,
113
+ isSelected = false,
114
+ width,
115
+ borderRadius,
116
+ justifyContent = "center",
117
+ before,
118
+ after,
119
+ elementAs,
120
+ children,
121
+ ...props
122
+ }) => {
123
+ const baseClasses = (0, import_clsx2.clsx)(
124
+ "flex shrink-0 items-center gap-1",
125
+ import_component_theme2.buttonColors[variant].hover,
126
+ import_component_theme2.buttonColors[variant].active,
127
+ import_component_theme2.buttonColors[variant].disabled,
128
+ import_component_theme2.focusVisible.normal,
129
+ {
130
+ "h-6 px-2.5": size === "small",
131
+ "h-8 px-3": size === "medium",
132
+ "h-10 px-4 leading-[24px]": size === "large",
133
+ "inline-flex": elementAs === "a",
134
+ [import_component_theme2.buttonColors[variant].selected]: isSelected,
135
+ [import_component_theme2.buttonColors[variant].base]: !isSelected,
136
+ "hover:text-textOnColor active:text-textOnColor [&:hover>*]:fill-iconOnColor [&:active>*]:fill-iconOnColor": isSelected && variant !== "outline" && variant !== "text",
137
+ "pointer-events-none": isDisabled,
138
+ "rounded-button": borderRadius == null,
139
+ "justify-start": justifyContent === "start",
140
+ "justify-center": justifyContent === "center",
141
+ "typography-label16regular": size === "large",
142
+ "typography-label14regular": size !== "large"
143
+ }
144
+ );
145
+ const Component = elementAs ?? "button";
146
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Component, { className: baseClasses, style: { width, borderRadius }, disabled: isDisabled, ...props, children: [
147
+ before,
148
+ children,
149
+ after
150
+ ] });
120
151
  };
121
152
 
122
- const CheckedIcon = () => {
123
- return /*#__PURE__*/jsx("svg", {
124
- viewBox: "0 0 20 20",
125
- xmlns: "http://www.w3.org/2000/svg",
126
- className: "absolute z-10 size-5 rounded-sm fill-iconOnColor hover:rounded-sm",
127
- children: /*#__PURE__*/jsx("path", {
128
- fillRule: "evenodd",
129
- clipRule: "evenodd",
130
- d: "M16.2887 5.38099C16.0069 5.09924 15.5518 5.09924 15.2701 5.38099L7.55461 13.0893L4.72993 10.2646C4.44818 9.98283 3.99305 9.98283 3.71131 10.2646C3.42956 10.5463 3.42956 11.0014 3.71131 11.2832L7.04891 14.6208C7.1934 14.7653 7.374 14.8303 7.56183 14.8303C7.74966 14.8303 7.93027 14.7581 8.07475 14.6208L16.2887 6.40683C16.5704 6.12508 16.5704 5.66273 16.2887 5.38099Z"
131
- })
132
- });
153
+ // src/checkbox/checkbox.tsx
154
+ var import_component_theme3 = require("@zenkigen-inc/component-theme");
155
+ var import_clsx3 = __toESM(require("clsx"));
156
+ var import_react = require("react");
157
+
158
+ // src/checkbox/checked-icon.tsx
159
+ var import_jsx_runtime5 = require("react/jsx-runtime");
160
+ var CheckedIcon = () => {
161
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
162
+ "svg",
163
+ {
164
+ viewBox: "0 0 20 20",
165
+ xmlns: "http://www.w3.org/2000/svg",
166
+ className: "absolute z-10 size-5 rounded-sm fill-iconOnColor hover:rounded-sm",
167
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
168
+ "path",
169
+ {
170
+ fillRule: "evenodd",
171
+ clipRule: "evenodd",
172
+ d: "M16.2887 5.38099C16.0069 5.09924 15.5518 5.09924 15.2701 5.38099L7.55461 13.0893L4.72993 10.2646C4.44818 9.98283 3.99305 9.98283 3.71131 10.2646C3.42956 10.5463 3.42956 11.0014 3.71131 11.2832L7.04891 14.6208C7.1934 14.7653 7.374 14.8303 7.56183 14.8303C7.74966 14.8303 7.93027 14.7581 8.07475 14.6208L16.2887 6.40683C16.5704 6.12508 16.5704 5.66273 16.2887 5.38099Z"
173
+ }
174
+ )
175
+ }
176
+ );
133
177
  };
134
178
 
135
- const MinusIcon = () => {
136
- return /*#__PURE__*/jsx("svg", {
137
- viewBox: "0 0 20 20",
138
- xmlns: "http://www.w3.org/2000/svg",
139
- className: "absolute z-10 size-5 rounded-sm fill-iconOnColor hover:rounded-sm",
140
- children: /*#__PURE__*/jsx("path", {
141
- d: "M4.94723 10.5028H9.49726H10.5028H15.0528C15.3293 10.5028 15.5556 10.2766 15.5556 10C15.5556 9.72352 15.3293 9.49725 15.0528 9.49725H10.5028H9.49726H4.94723C4.67071 9.49725 4.44446 9.72352 4.44446 10C4.44446 10.2766 4.67071 10.5028 4.94723 10.5028Z"
142
- })
143
- });
179
+ // src/checkbox/minus-icon.tsx
180
+ var import_jsx_runtime6 = require("react/jsx-runtime");
181
+ var MinusIcon = () => {
182
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
183
+ "svg",
184
+ {
185
+ viewBox: "0 0 20 20",
186
+ xmlns: "http://www.w3.org/2000/svg",
187
+ className: "absolute z-10 size-5 rounded-sm fill-iconOnColor hover:rounded-sm",
188
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M4.94723 10.5028H9.49726H10.5028H15.0528C15.3293 10.5028 15.5556 10.2766 15.5556 10C15.5556 9.72352 15.3293 9.49725 15.0528 9.49725H10.5028H9.49726H4.94723C4.67071 9.49725 4.44446 9.72352 4.44446 10C4.44446 10.2766 4.67071 10.5028 4.94723 10.5028Z" })
189
+ }
190
+ );
144
191
  };
145
192
 
193
+ // src/checkbox/checkbox.tsx
194
+ var import_jsx_runtime7 = require("react/jsx-runtime");
146
195
  function Checkbox({
147
196
  name,
148
197
  value,
@@ -152,218 +201,223 @@ function Checkbox({
152
201
  isDisabled = false,
153
202
  onChange,
154
203
  label,
155
- color = 'default'
204
+ color = "default"
156
205
  }) {
157
- const [isMouseOver, setIsMouseOver] = useState(false);
158
- const handleMouseOverInput = useCallback(() => {
206
+ const [isMouseOver, setIsMouseOver] = (0, import_react.useState)(false);
207
+ const handleMouseOverInput = (0, import_react.useCallback)(() => {
159
208
  setIsMouseOver(true);
160
209
  }, []);
161
- const handleMouseOutInput = useCallback(() => {
210
+ const handleMouseOutInput = (0, import_react.useCallback)(() => {
162
211
  setIsMouseOver(false);
163
212
  }, []);
164
- const handleChange = useCallback(e => !isDisabled && (onChange == null ? void 0 : onChange(e)), [isDisabled, onChange]);
165
- const baseInputClasses = clsx$1('peer absolute z-[1] size-5 opacity-0', {
166
- 'cursor-not-allowed': isDisabled,
167
- 'cursor-pointer': !isDisabled
168
- });
169
- const boxClasses = clsx$1('inline-flex size-5 items-center justify-center rounded-sm border bg-white', focusVisible.normalPeer, {
170
- 'border-disabled01': isDisabled,
171
- 'border-hoverUiBorder': !isDisabled && isMouseOver && color === 'default',
172
- 'border-uiBorder03': !isDisabled && !isMouseOver && color === 'default',
173
- 'border-interactive02': !isDisabled && !isMouseOver && color === 'gray',
174
- 'border-hoverError': !isDisabled && isMouseOver && color === 'error',
175
- 'border-supportError': !isDisabled && !isMouseOver && color === 'error'
176
- });
177
- const indicatorClasses = clsx$1('relative flex size-5 flex-[0_0_auto] items-center justify-center', {
178
- 'bg-disabled01': isDisabled && isChecked,
179
- 'border-disabled01': isDisabled
180
- });
181
- const afterClasses = clsx$1('absolute inset-0 m-auto block rounded-sm', {
182
- 'bg-disabled01': isDisabled && isChecked,
183
- 'bg-hover01': !(isDisabled && isChecked) && isMouseOver,
184
- 'bg-interactive01': !(isDisabled && isChecked) && !isMouseOver,
185
- 'bg-hover02Dark': !(isDisabled && isChecked) && isMouseOver && color === 'gray',
186
- 'bg-interactive02': !(isDisabled && isChecked) && !isMouseOver && color === 'gray',
187
- 'bg-hoverError': !(isDisabled && isChecked) && isMouseOver && color === 'error',
188
- 'bg-supportError': !(isDisabled && isChecked) && !isMouseOver && color === 'error',
189
- 'scale-0': !isChecked,
190
- 'scale-100': isChecked
191
- });
192
- const hoverIndicatorClasses = clsx$1('inline-block size-3 rounded-[1px]', {
193
- 'bg-hoverUi': !isDisabled && !isChecked && isMouseOver
194
- });
195
- const labelClasses = clsx$1('typography-label14regular ml-2 flex-[1_0_0] break-all', {
196
- 'pointer-events-none cursor-not-allowed text-disabled01': isDisabled,
197
- 'cursor-pointer text-text01': !isDisabled
198
- });
199
- return /*#__PURE__*/jsxs("div", {
200
- className: "flex items-center",
201
- children: [/*#__PURE__*/jsxs("div", {
202
- className: "relative flex size-6 items-center justify-center",
203
- children: [/*#__PURE__*/jsx("input", {
204
- type: "checkbox",
205
- value: value,
206
- name: name,
207
- id: id,
208
- checked: isChecked,
209
- disabled: isDisabled,
210
- onChange: handleChange,
211
- onMouseOver: handleMouseOverInput,
212
- onMouseLeave: handleMouseOutInput,
213
- className: baseInputClasses
214
- }), /*#__PURE__*/jsx("div", {
215
- className: boxClasses,
216
- children: /*#__PURE__*/jsxs("div", {
217
- className: indicatorClasses,
218
- children: [/*#__PURE__*/jsxs("span", {
219
- className: afterClasses,
220
- children: [isChecked && !isIndeterminate && /*#__PURE__*/jsx(CheckedIcon, {}), isIndeterminate && /*#__PURE__*/jsx(MinusIcon, {})]
221
- }), /*#__PURE__*/jsx("span", {
222
- className: hoverIndicatorClasses
223
- })]
224
- })
225
- })]
226
- }), label != null && /*#__PURE__*/jsx("label", {
227
- htmlFor: id,
228
- className: labelClasses,
229
- children: label
230
- })]
231
- });
213
+ const handleChange = (0, import_react.useCallback)(
214
+ (e) => !isDisabled && onChange?.(e),
215
+ [isDisabled, onChange]
216
+ );
217
+ const baseInputClasses = (0, import_clsx3.default)("peer absolute z-[1] size-5 opacity-0", {
218
+ "cursor-not-allowed": isDisabled,
219
+ "cursor-pointer": !isDisabled
220
+ });
221
+ const boxClasses = (0, import_clsx3.default)(
222
+ "inline-flex size-5 items-center justify-center rounded-sm border bg-white",
223
+ import_component_theme3.focusVisible.normalPeer,
224
+ {
225
+ "border-disabled01": isDisabled,
226
+ "border-hoverUiBorder": !isDisabled && isMouseOver && color === "default",
227
+ "border-uiBorder03": !isDisabled && !isMouseOver && color === "default",
228
+ "border-interactive02": !isDisabled && !isMouseOver && color === "gray",
229
+ "border-hoverError": !isDisabled && isMouseOver && color === "error",
230
+ "border-supportError": !isDisabled && !isMouseOver && color === "error"
231
+ }
232
+ );
233
+ const indicatorClasses = (0, import_clsx3.default)("relative flex size-5 flex-[0_0_auto] items-center justify-center", {
234
+ "bg-disabled01": isDisabled && isChecked,
235
+ "border-disabled01": isDisabled
236
+ });
237
+ const afterClasses = (0, import_clsx3.default)("absolute inset-0 m-auto block rounded-sm", {
238
+ "bg-disabled01": isDisabled && isChecked,
239
+ "bg-hover01": !(isDisabled && isChecked) && isMouseOver,
240
+ "bg-interactive01": !(isDisabled && isChecked) && !isMouseOver,
241
+ "bg-hover02Dark": !(isDisabled && isChecked) && isMouseOver && color === "gray",
242
+ "bg-interactive02": !(isDisabled && isChecked) && !isMouseOver && color === "gray",
243
+ "bg-hoverError": !(isDisabled && isChecked) && isMouseOver && color === "error",
244
+ "bg-supportError": !(isDisabled && isChecked) && !isMouseOver && color === "error",
245
+ "scale-0": !isChecked,
246
+ "scale-100": isChecked
247
+ });
248
+ const hoverIndicatorClasses = (0, import_clsx3.default)("inline-block size-3 rounded-[1px]", {
249
+ "bg-hoverUi": !isDisabled && !isChecked && isMouseOver
250
+ });
251
+ const labelClasses = (0, import_clsx3.default)("typography-label14regular ml-2 flex-[1_0_0] break-all", {
252
+ "pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
253
+ "cursor-pointer text-text01": !isDisabled
254
+ });
255
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center", children: [
256
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative flex size-6 items-center justify-center", children: [
257
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
258
+ "input",
259
+ {
260
+ type: "checkbox",
261
+ value,
262
+ name,
263
+ id,
264
+ checked: isChecked,
265
+ disabled: isDisabled,
266
+ onChange: handleChange,
267
+ onMouseOver: handleMouseOverInput,
268
+ onMouseLeave: handleMouseOutInput,
269
+ className: baseInputClasses
270
+ }
271
+ ),
272
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: boxClasses, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: indicatorClasses, children: [
273
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: afterClasses, children: [
274
+ isChecked && !isIndeterminate && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CheckedIcon, {}),
275
+ isIndeterminate && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MinusIcon, {})
276
+ ] }),
277
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: hoverIndicatorClasses })
278
+ ] }) })
279
+ ] }),
280
+ label != null && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: id, className: labelClasses, children: label })
281
+ ] });
232
282
  }
233
283
 
234
- const useOutsideClick = (ref, handler, enabled = true) => {
235
- useEffect(() => {
236
- const listener = event => {
237
- var _event$target;
238
- const element = ref == null ? void 0 : ref.current;
239
- if (element == null || Boolean(element.contains((_event$target = event == null ? void 0 : event.target) != null ? _event$target : null))) {
284
+ // src/dropdown/dropdown.tsx
285
+ var import_component_theme6 = require("@zenkigen-inc/component-theme");
286
+ var import_clsx7 = __toESM(require("clsx"));
287
+ var import_react6 = require("react");
288
+ var import_react_dom = require("react-dom");
289
+
290
+ // src/hooks/use-outside-click.ts
291
+ var import_react2 = require("react");
292
+ var useOutsideClick = (ref, handler, enabled = true) => {
293
+ (0, import_react2.useEffect)(() => {
294
+ const listener = (event) => {
295
+ const element = ref?.current;
296
+ if (element == null || Boolean(element.contains(event?.target ?? null))) {
240
297
  return;
241
298
  }
242
299
  handler(event);
243
300
  };
244
301
  if (enabled) {
245
- document.addEventListener('click', listener);
302
+ document.addEventListener("click", listener);
246
303
  }
247
- return () => document.removeEventListener('click', listener);
304
+ return () => document.removeEventListener("click", listener);
248
305
  }, [ref, enabled, handler]);
249
306
  };
250
307
 
251
- const _excluded$6 = ["size", "isDisabled"];
252
- const Icon = _ref => {
253
- let {
254
- size = 'medium',
255
- isDisabled = false
256
- } = _ref,
257
- props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
258
- const classes = clsx('inline-block shrink-0', {
259
- 'fill-disabled01': isDisabled,
260
- [iconColors.icon01]: !isDisabled && props.color === 'icon01',
261
- [iconColors.icon02]: !isDisabled && props.color === 'icon02',
262
- [iconColors.icon03]: !isDisabled && props.color === 'icon03',
263
- [iconColors.iconOnColor]: !isDisabled && props.color === 'iconOnColor',
264
- 'w-3 h-3': size === 'x-small',
265
- 'w-4 h-4': size === 'small',
266
- 'w-6 h-6': size === 'medium',
267
- 'w-8 h-8': size === 'large',
268
- 'w-10 h-10': size === 'x-large'
269
- }, props.className);
270
- return /*#__PURE__*/jsx("span", {
271
- className: classes,
272
- children: iconElements[props.name]
273
- });
308
+ // src/icon/icon.tsx
309
+ var import_component_icons = require("@zenkigen-inc/component-icons");
310
+ var import_component_theme4 = require("@zenkigen-inc/component-theme");
311
+ var import_clsx4 = require("clsx");
312
+ var import_jsx_runtime8 = require("react/jsx-runtime");
313
+ var Icon = ({ size = "medium", isDisabled = false, ...props }) => {
314
+ const classes = (0, import_clsx4.clsx)(
315
+ "inline-block shrink-0",
316
+ {
317
+ "fill-disabled01": isDisabled,
318
+ [import_component_theme4.iconColors.icon01]: !isDisabled && props.color === "icon01",
319
+ [import_component_theme4.iconColors.icon02]: !isDisabled && props.color === "icon02",
320
+ [import_component_theme4.iconColors.icon03]: !isDisabled && props.color === "icon03",
321
+ [import_component_theme4.iconColors.iconOnColor]: !isDisabled && props.color === "iconOnColor",
322
+ "w-3 h-3": size === "x-small",
323
+ "w-4 h-4": size === "small",
324
+ "w-6 h-6": size === "medium",
325
+ "w-8 h-8": size === "large",
326
+ "w-10 h-10": size === "x-large"
327
+ },
328
+ props.className
329
+ );
330
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: classes, children: import_component_icons.iconElements[props.name] });
274
331
  };
275
332
 
276
- const DropdownContext = /*#__PURE__*/createContext({
333
+ // src/dropdown/dropdown-context.ts
334
+ var import_react3 = require("react");
335
+ var DropdownContext = (0, import_react3.createContext)({
277
336
  isVisible: false,
278
337
  setIsVisible: () => false,
279
338
  isDisabled: false,
280
- targetDimensions: {
281
- width: 0,
282
- height: 0
283
- },
284
- variant: 'outline'
339
+ targetDimensions: { width: 0, height: 0 },
340
+ variant: "outline"
285
341
  });
286
342
 
287
- function DropdownItem({
288
- children,
289
- color = 'gray',
290
- onClick
291
- }) {
292
- const {
293
- setIsVisible
294
- } = useContext(DropdownContext);
295
- const handleClickItem = event => {
343
+ // src/dropdown/dropdown-item.tsx
344
+ var import_component_theme5 = require("@zenkigen-inc/component-theme");
345
+ var import_clsx5 = __toESM(require("clsx"));
346
+ var import_react4 = require("react");
347
+ var import_jsx_runtime9 = require("react/jsx-runtime");
348
+ function DropdownItem({ children, color = "gray", onClick }) {
349
+ const { setIsVisible } = (0, import_react4.useContext)(DropdownContext);
350
+ const handleClickItem = (event) => {
296
351
  setIsVisible(false);
297
- onClick == null || onClick(event);
352
+ onClick?.(event);
298
353
  };
299
- const itemClasses = clsx$1('typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02', focusVisible.inset, {
300
- 'bg-uiBackground01 fill-icon01 text-interactive02': color === 'gray',
301
- 'fill-supportDanger text-supportDanger': color === 'red'
302
- });
303
- return /*#__PURE__*/jsx("li", {
304
- className: "flex w-full items-center",
305
- children: /*#__PURE__*/jsx("button", {
306
- className: itemClasses,
307
- type: "button",
308
- onClick: handleClickItem,
309
- children: children
310
- })
311
- });
354
+ const itemClasses = (0, import_clsx5.default)(
355
+ "typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02",
356
+ import_component_theme5.focusVisible.inset,
357
+ {
358
+ "bg-uiBackground01 fill-icon01 text-interactive02": color === "gray",
359
+ "fill-supportDanger text-supportDanger": color === "red"
360
+ }
361
+ );
362
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("li", { className: "flex w-full items-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: itemClasses, type: "button", onClick: handleClickItem, children }) });
312
363
  }
313
364
 
365
+ // src/dropdown/dropdown-menu.tsx
366
+ var import_clsx6 = __toESM(require("clsx"));
367
+ var import_react5 = require("react");
368
+ var import_jsx_runtime10 = require("react/jsx-runtime");
314
369
  function DropdownMenu({
315
370
  children,
316
371
  maxHeight,
317
372
  isNoPadding = false,
318
- verticalPosition = 'bottom',
319
- horizontalAlign = 'left'
373
+ verticalPosition = "bottom",
374
+ horizontalAlign = "left"
320
375
  }) {
321
- const {
322
- isVisible,
323
- isDisabled,
324
- targetDimensions,
325
- variant,
326
- portalTargetRef
327
- } = useContext(DropdownContext);
328
- const wrapperClasses = clsx$1('z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 shadow-floatingShadow', {
376
+ const { isVisible, isDisabled, targetDimensions, variant, portalTargetRef } = (0, import_react5.useContext)(DropdownContext);
377
+ const wrapperClasses = (0, import_clsx6.default)("z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 shadow-floatingShadow", {
329
378
  absolute: !portalTargetRef,
330
- 'border-solid border border-uiBorder01': variant === 'outline',
331
- 'py-1': !isNoPadding,
332
- 'left-0': horizontalAlign === 'left',
333
- 'right-0': horizontalAlign === 'right',
334
- 'left-auto': horizontalAlign === 'center'
335
- });
336
- return isVisible && !isDisabled && /*#__PURE__*/jsx("ul", {
337
- className: wrapperClasses,
338
- style: {
339
- top: !portalTargetRef && verticalPosition === 'bottom' ? `${targetDimensions.height + 4}px` : 'unset',
340
- bottom: !portalTargetRef && verticalPosition === 'top' ? `${targetDimensions.height + 4}px` : 'unset',
341
- maxHeight
342
- },
343
- children: children
344
- });
379
+ "border-solid border border-uiBorder01": variant === "outline",
380
+ "py-1": !isNoPadding,
381
+ "left-0": horizontalAlign === "left",
382
+ "right-0": horizontalAlign === "right",
383
+ "left-auto": horizontalAlign === "center"
384
+ });
385
+ return isVisible && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
386
+ "ul",
387
+ {
388
+ className: wrapperClasses,
389
+ style: {
390
+ top: !portalTargetRef && verticalPosition === "bottom" ? `${targetDimensions.height + 4}px` : "unset",
391
+ bottom: !portalTargetRef && verticalPosition === "top" ? `${targetDimensions.height + 4}px` : "unset",
392
+ maxHeight
393
+ },
394
+ children
395
+ }
396
+ );
345
397
  }
346
398
 
399
+ // src/dropdown/dropdown.tsx
400
+ var import_jsx_runtime11 = require("react/jsx-runtime");
347
401
  function Dropdown({
348
402
  children,
349
403
  target,
350
404
  label,
351
405
  icon,
352
- size = 'medium',
353
- variant = 'outline',
406
+ size = "medium",
407
+ variant = "outline",
354
408
  title,
355
409
  isDisabled = false,
356
410
  isArrowHidden = false,
357
411
  portalTargetRef
358
412
  }) {
359
- const [isVisible, setIsVisible] = useState(false);
360
- const [targetDimensions, setTargetDimensions] = useState({
413
+ const [isVisible, setIsVisible] = (0, import_react6.useState)(false);
414
+ const [targetDimensions, setTargetDimensions] = (0, import_react6.useState)({
361
415
  width: 0,
362
416
  height: 0
363
417
  });
364
- const targetRef = useRef(null);
418
+ const targetRef = (0, import_react6.useRef)(null);
365
419
  useOutsideClick(targetRef, () => setIsVisible(false));
366
- const handleToggle = useCallback(() => {
420
+ const handleToggle = (0, import_react6.useCallback)(() => {
367
421
  if (targetRef.current === null) {
368
422
  return;
369
423
  }
@@ -379,279 +433,228 @@ function Dropdown({
379
433
  setIsVisible(true);
380
434
  }
381
435
  }, [isVisible]);
382
- const wrapperClasses = clsx$1('relative flex shrink-0 items-center gap-1 rounded', {
383
- 'cursor-not-allowed': isDisabled
384
- });
385
- const childrenButtonClasses = clsx$1('flex items-center justify-center rounded bg-uiBackground01 p-1 hover:bg-hover02 active:bg-active02', focusVisible.normal, {
386
- 'pointer-events-none': isDisabled,
387
- 'border border-uiBorder02': variant === 'outline'
388
- });
389
- const buttonClasses = clsx$1('flex items-center rounded bg-uiBackground01', buttonColors[variant].base, buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, {
390
- 'pointer-events-none': isDisabled,
391
- 'h-6 px-2': size === 'x-small' || size === 'small',
392
- 'h-8 px-4': size === 'medium',
393
- 'h-10 px-4': size === 'large'
394
- });
395
- const labelClasses = clsx$1('flex items-center', {
396
- 'mr-1': !isArrowHidden && size === 'x-small',
397
- 'mr-2': !isArrowHidden && size !== 'x-small',
398
- 'typography-label12regular': size === 'x-small',
399
- 'typography-label14regular': size === 'small' || size === 'medium',
400
- 'typography-label16regular': size === 'large'
401
- });
402
- return /*#__PURE__*/jsx(DropdownContext.Provider, {
403
- value: {
404
- isVisible,
405
- setIsVisible,
406
- isDisabled,
407
- targetDimensions,
408
- variant,
409
- portalTargetRef
410
- },
411
- children: /*#__PURE__*/jsxs("div", {
412
- ref: targetRef,
413
- className: wrapperClasses,
414
- children: [target ? /*#__PURE__*/jsxs("button", {
415
- type: "button",
416
- title: title,
417
- className: childrenButtonClasses,
418
- onClick: handleToggle,
419
- disabled: isDisabled,
420
- children: [target, !isArrowHidden && /*#__PURE__*/jsx("div", {
421
- className: "ml-2 flex items-center fill-icon01",
422
- children: /*#__PURE__*/jsx(Icon, {
423
- name: isVisible ? 'angle-small-up' : 'angle-small-down',
424
- size: size === 'large' ? 'medium' : 'small'
425
- })
426
- })]
427
- }) : /*#__PURE__*/jsxs("button", {
428
- type: "button",
429
- title: title,
430
- className: buttonClasses,
431
- onClick: handleToggle,
432
- disabled: isDisabled,
433
- children: [icon && /*#__PURE__*/jsx("span", {
434
- className: "mr-1 flex",
435
- children: /*#__PURE__*/jsx(Icon, {
436
- name: icon,
437
- size: size === 'large' ? 'medium' : 'small'
438
- })
439
- }), /*#__PURE__*/jsx("span", {
440
- className: labelClasses,
441
- children: label
442
- }), !isArrowHidden && /*#__PURE__*/jsx("div", {
443
- className: "ml-auto flex items-center",
444
- children: /*#__PURE__*/jsx(Icon, {
445
- name: isVisible ? 'angle-small-up' : 'angle-small-down',
446
- size: "small"
447
- })
448
- })]
449
- }), !portalTargetRef ? children : portalTargetRef != null && portalTargetRef.current && /*#__PURE__*/createPortal(children, portalTargetRef.current)]
450
- })
451
- });
436
+ const wrapperClasses = (0, import_clsx7.default)("relative flex shrink-0 items-center gap-1 rounded", {
437
+ "cursor-not-allowed": isDisabled
438
+ });
439
+ const childrenButtonClasses = (0, import_clsx7.default)(
440
+ "flex items-center justify-center rounded bg-uiBackground01 p-1 hover:bg-hover02 active:bg-active02",
441
+ import_component_theme6.focusVisible.normal,
442
+ {
443
+ "pointer-events-none": isDisabled,
444
+ "border border-uiBorder02": variant === "outline"
445
+ }
446
+ );
447
+ const buttonClasses = (0, import_clsx7.default)(
448
+ "flex items-center rounded bg-uiBackground01",
449
+ import_component_theme6.buttonColors[variant].base,
450
+ import_component_theme6.buttonColors[variant].hover,
451
+ import_component_theme6.buttonColors[variant].active,
452
+ import_component_theme6.buttonColors[variant].disabled,
453
+ import_component_theme6.focusVisible.normal,
454
+ {
455
+ "pointer-events-none": isDisabled,
456
+ "h-6 px-2": size === "x-small" || size === "small",
457
+ "h-8 px-4": size === "medium",
458
+ "h-10 px-4": size === "large"
459
+ }
460
+ );
461
+ const labelClasses = (0, import_clsx7.default)("flex items-center", {
462
+ "mr-1": !isArrowHidden && size === "x-small",
463
+ "mr-2": !isArrowHidden && size !== "x-small",
464
+ "typography-label12regular": size === "x-small",
465
+ "typography-label14regular": size === "small" || size === "medium",
466
+ "typography-label16regular": size === "large"
467
+ });
468
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
469
+ DropdownContext.Provider,
470
+ {
471
+ value: { isVisible, setIsVisible, isDisabled, targetDimensions, variant, portalTargetRef },
472
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { ref: targetRef, className: wrapperClasses, children: [
473
+ target ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
474
+ "button",
475
+ {
476
+ type: "button",
477
+ title,
478
+ className: childrenButtonClasses,
479
+ onClick: handleToggle,
480
+ disabled: isDisabled,
481
+ children: [
482
+ target,
483
+ !isArrowHidden && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "ml-2 flex items-center fill-icon01", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
484
+ Icon,
485
+ {
486
+ name: isVisible ? "angle-small-up" : "angle-small-down",
487
+ size: size === "large" ? "medium" : "small"
488
+ }
489
+ ) })
490
+ ]
491
+ }
492
+ ) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", title, className: buttonClasses, onClick: handleToggle, disabled: isDisabled, children: [
493
+ icon && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "mr-1 flex", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: icon, size: size === "large" ? "medium" : "small" }) }),
494
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: labelClasses, children: label }),
495
+ !isArrowHidden && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: isVisible ? "angle-small-up" : "angle-small-down", size: "small" }) })
496
+ ] }),
497
+ !portalTargetRef ? children : portalTargetRef != null && portalTargetRef.current && (0, import_react_dom.createPortal)(children, portalTargetRef.current)
498
+ ] })
499
+ }
500
+ );
452
501
  }
453
502
  Dropdown.Menu = DropdownMenu;
454
503
  Dropdown.Item = DropdownItem;
455
504
 
456
- function EvaluationStar({
457
- value,
458
- isEditable = false,
459
- onChangeRating,
460
- size = 'medium'
461
- }) {
505
+ // src/evaluation-star/evaluation-star.tsx
506
+ var import_component_icons2 = require("@zenkigen-inc/component-icons");
507
+ var import_component_theme7 = require("@zenkigen-inc/component-theme");
508
+ var import_clsx8 = __toESM(require("clsx"));
509
+ var import_react7 = require("react");
510
+ var import_jsx_runtime12 = require("react/jsx-runtime");
511
+ function EvaluationStar({ value, isEditable = false, onChangeRating, size = "medium" }) {
462
512
  const maxRating = 5;
463
- const [currentRating, setCurrentRating] = useState(value);
464
- const handleChangeRating = useCallback(newRating => {
465
- if (isEditable) {
466
- setCurrentRating(newRating);
467
- if (onChangeRating) {
468
- onChangeRating(newRating);
513
+ const [currentRating, setCurrentRating] = (0, import_react7.useState)(value);
514
+ const handleChangeRating = (0, import_react7.useCallback)(
515
+ (newRating) => {
516
+ if (isEditable) {
517
+ setCurrentRating(newRating);
518
+ if (onChangeRating) {
519
+ onChangeRating(newRating);
520
+ }
469
521
  }
470
- }
471
- }, [isEditable, onChangeRating]);
472
- const starClasses = clsx$1(focusVisible.inset, {
473
- 'w-6 h-6': size === 'large',
474
- 'w-4 h-4': size === 'medium'
475
- });
476
- // 各評価のレンダリングロジックを分離(React Hooksのルールに準拠)
477
- const renderStar = rating => {
478
- const color = rating <= currentRating ? 'fill-yellow-yellow50' : 'fill-icon03';
479
- return /*#__PURE__*/jsx("button", {
480
- type: "button",
481
- onClick: () => handleChangeRating(rating),
482
- className: clsx$1(color, starClasses),
483
- disabled: !isEditable,
484
- children: iconElements['star-filled']
485
- }, rating);
522
+ },
523
+ [isEditable, onChangeRating]
524
+ );
525
+ const starClasses = (0, import_clsx8.default)(import_component_theme7.focusVisible.inset, { "w-6 h-6": size === "large", "w-4 h-4": size === "medium" });
526
+ const renderStar = (rating) => {
527
+ const color = rating <= currentRating ? "fill-yellow-yellow50" : "fill-icon03";
528
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
529
+ "button",
530
+ {
531
+ type: "button",
532
+ onClick: () => handleChangeRating(rating),
533
+ className: (0, import_clsx8.default)(color, starClasses),
534
+ disabled: !isEditable,
535
+ children: import_component_icons2.iconElements["star-filled"]
536
+ },
537
+ rating
538
+ );
486
539
  };
487
- // 宣言的な方法で評価の配列を生成
488
- const ratingStars = Array.from({
489
- length: maxRating
490
- }, (_, index) => renderStar(index + 1));
491
- return /*#__PURE__*/jsx("span", {
492
- className: "flex flex-row",
493
- children: ratingStars
494
- });
540
+ const ratingStars = Array.from({ length: maxRating }, (_, index) => renderStar(index + 1));
541
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "flex flex-row", children: ratingStars });
495
542
  }
496
543
 
544
+ // src/heading/heading.tsx
545
+ var import_component_theme8 = require("@zenkigen-inc/component-theme");
546
+ var import_clsx9 = require("clsx");
547
+ var import_jsx_runtime13 = require("react/jsx-runtime");
497
548
  function Heading(props) {
498
549
  const TagName = `h${props.level}`;
499
- const classes = clsx(`flex items-center text-text01`, typography.heading[TagName], {
500
- 'gap-2': props.level === 1,
501
- 'gap-1': props.level > 1
502
- });
503
- return /*#__PURE__*/jsxs(TagName, {
504
- className: classes,
505
- children: [props.before, props.children, props.after]
506
- });
550
+ const classes = (0, import_clsx9.clsx)(`flex items-center text-text01`, import_component_theme8.typography.heading[TagName], {
551
+ "gap-2": props.level === 1,
552
+ "gap-1": props.level > 1
553
+ });
554
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(TagName, { className: classes, children: [
555
+ props.before,
556
+ props.children,
557
+ props.after
558
+ ] });
507
559
  }
508
560
 
509
- const _excluded$5 = ["size", "variant", "isNoPadding", "isDisabled"];
510
- function IconButton(_ref) {
511
- let {
512
- size = 'medium',
513
- variant = 'outline',
514
- isNoPadding = false,
515
- isDisabled = false
516
- } = _ref,
517
- props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
518
- const baseClasses = clsx('typography-label16regular flex items-center justify-center gap-1 rounded', buttonColors[variant].base, buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, {
519
- 'h-4 w-4': size === 'small' && isNoPadding,
520
- 'h-6 w-6': size === 'small' && !isNoPadding || (size === 'medium' || size === 'large') && isNoPadding,
521
- 'h-8 w-8': size === 'medium' && !isNoPadding,
522
- 'h-10 w-10': size === 'large' && !isNoPadding,
523
- 'inline-flex': props.isAnchor,
524
- 'pointer-events-none': isDisabled
525
- });
526
- const iconSize = size === 'small' ? 'small' : 'medium';
561
+ // src/icon-button/icon-button.tsx
562
+ var import_component_theme9 = require("@zenkigen-inc/component-theme");
563
+ var import_clsx10 = require("clsx");
564
+ var import_jsx_runtime14 = require("react/jsx-runtime");
565
+ function IconButton({
566
+ size = "medium",
567
+ variant = "outline",
568
+ isNoPadding = false,
569
+ isDisabled = false,
570
+ ...props
571
+ }) {
572
+ const baseClasses = (0, import_clsx10.clsx)(
573
+ "typography-label16regular flex items-center justify-center gap-1 rounded",
574
+ import_component_theme9.buttonColors[variant].base,
575
+ import_component_theme9.buttonColors[variant].hover,
576
+ import_component_theme9.buttonColors[variant].active,
577
+ import_component_theme9.buttonColors[variant].disabled,
578
+ import_component_theme9.focusVisible.normal,
579
+ {
580
+ "h-4 w-4": size === "small" && isNoPadding,
581
+ "h-6 w-6": size === "small" && !isNoPadding || (size === "medium" || size === "large") && isNoPadding,
582
+ "h-8 w-8": size === "medium" && !isNoPadding,
583
+ "h-10 w-10": size === "large" && !isNoPadding,
584
+ "inline-flex": props.isAnchor,
585
+ "pointer-events-none": isDisabled
586
+ }
587
+ );
588
+ const iconSize = size === "small" ? "small" : "medium";
527
589
  if (props.isAnchor === true) {
528
- return /*#__PURE__*/jsx("a", {
529
- className: baseClasses,
530
- href: props.href,
531
- target: props.target,
532
- children: /*#__PURE__*/jsx(Icon, {
533
- name: props.icon,
534
- size: iconSize
535
- })
536
- });
590
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { className: baseClasses, href: props.href, target: props.target, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: props.icon, size: iconSize }) });
537
591
  } else {
538
- return /*#__PURE__*/jsx("button", {
539
- type: "button",
540
- className: baseClasses,
541
- disabled: isDisabled,
542
- onClick: props.onClick,
543
- children: /*#__PURE__*/jsx(Icon, {
544
- name: props.icon,
545
- size: iconSize
546
- })
547
- });
592
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: baseClasses, disabled: isDisabled, onClick: props.onClick, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: props.icon, size: iconSize }) });
548
593
  }
549
594
  }
550
595
 
551
- function Loading({
552
- size = 'medium',
553
- position = 'fixed',
554
- height = '100%'
555
- }) {
556
- const wrapperClasses = clsx$1(position, 'left-0 top-0 z-20 flex w-full items-center justify-center');
557
- const svgClasses = clsx$1({
558
- 'h-4 w-4': size === 'small',
559
- 'h-8 w-8': size === 'medium',
560
- 'h-16 w-16': size === 'large'
561
- });
562
- return /*#__PURE__*/jsx(Fragment, {
563
- children: /*#__PURE__*/jsxs("div", {
564
- className: wrapperClasses,
565
- style: {
566
- height
567
- },
568
- children: [size === 'small' && /*#__PURE__*/jsx("svg", {
569
- className: svgClasses,
570
- viewBox: "0 0 16 16",
571
- fill: "none",
572
- xmlns: "http://www.w3.org/2000/svg",
573
- children: /*#__PURE__*/jsx("circle", {
574
- className: "origin-center animate-circular-small-move stroke-interactive01",
575
- cx: "8",
576
- cy: "8",
577
- r: "7",
578
- stroke: "currentColor",
579
- strokeWidth: "1.5",
580
- fill: "none"
581
- })
582
- }), size === 'medium' && /*#__PURE__*/jsx("svg", {
583
- className: svgClasses,
584
- viewBox: "0 0 32 32",
585
- fill: "none",
586
- xmlns: "http://www.w3.org/2000/svg",
587
- children: /*#__PURE__*/jsx("circle", {
588
- className: "origin-center animate-circular-medium-move stroke-interactive01",
589
- cx: "16",
590
- cy: "16",
591
- r: "15",
592
- stroke: "currentColor",
593
- strokeWidth: "2",
594
- fill: "none"
595
- })
596
- }), size === 'large' && /*#__PURE__*/jsx("svg", {
597
- className: svgClasses,
598
- viewBox: "0 0 64 64",
599
- fill: "none",
600
- xmlns: "http://www.w3.org/2000/svg",
601
- children: /*#__PURE__*/jsx("circle", {
602
- className: "origin-center animate-circular-large-move stroke-interactive01",
603
- cx: "32",
604
- cy: "32",
605
- r: "30",
606
- stroke: "currentColor",
607
- strokeWidth: "3",
608
- fill: "none"
609
- })
610
- })]
611
- })
612
- });
596
+ // src/loading/loading.tsx
597
+ var import_clsx11 = __toESM(require("clsx"));
598
+ var import_jsx_runtime15 = require("react/jsx-runtime");
599
+ function Loading({ size = "medium", position = "fixed", height = "100%" }) {
600
+ const wrapperClasses = (0, import_clsx11.default)(position, "left-0 top-0 z-20 flex w-full items-center justify-center");
601
+ const svgClasses = (0, import_clsx11.default)({
602
+ "h-4 w-4": size === "small",
603
+ "h-8 w-8": size === "medium",
604
+ "h-16 w-16": size === "large"
605
+ });
606
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: wrapperClasses, style: { height }, children: [
607
+ size === "small" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { className: svgClasses, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
608
+ "circle",
609
+ {
610
+ className: "origin-center animate-circular-small-move stroke-interactive01",
611
+ cx: "8",
612
+ cy: "8",
613
+ r: "7",
614
+ stroke: "currentColor",
615
+ strokeWidth: "1.5",
616
+ fill: "none"
617
+ }
618
+ ) }),
619
+ size === "medium" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { className: svgClasses, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
620
+ "circle",
621
+ {
622
+ className: "origin-center animate-circular-medium-move stroke-interactive01",
623
+ cx: "16",
624
+ cy: "16",
625
+ r: "15",
626
+ stroke: "currentColor",
627
+ strokeWidth: "2",
628
+ fill: "none"
629
+ }
630
+ ) }),
631
+ size === "large" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { className: svgClasses, viewBox: "0 0 64 64", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
632
+ "circle",
633
+ {
634
+ className: "origin-center animate-circular-large-move stroke-interactive01",
635
+ cx: "32",
636
+ cy: "32",
637
+ r: "30",
638
+ stroke: "currentColor",
639
+ strokeWidth: "3",
640
+ fill: "none"
641
+ }
642
+ ) })
643
+ ] }) });
613
644
  }
614
645
 
615
- /**
616
- * モーダル表示時にバックグラウンドのスクロールを防止するコンポーネント。
617
- * コンポーネントがマウントされている間、position: fixedアプローチを使用して
618
- * body要素にスクロールロックを適用します。
619
- * 縦横両方のスクロール位置を保存し、コンポーネントのアンマウント時に復元します。
620
- * スクロールバーの有無を検出し、その幅を考慮してレイアウトシフトを防止します。
621
- * position、top、left、width、overflow、padding-rightを変更し、
622
- * 最小限の変更でスクロールを防止します。
623
- * グローバルCSSに依存せず、すべてインラインスタイルで実装されています。
624
- * このコンポーネントは実際のDOM要素をレンダリングせず、効果のみを適用します。
625
- *
626
- * @example
627
- * // モーダルコンポーネント内で使用する例
628
- * const Modal = ({ isOpen, children }) => {
629
- * return (
630
- * <>
631
- * {isOpen && <BodyScrollLock />}
632
- * {isOpen && (
633
- * <div className="modal">
634
- * {children}
635
- * </div>
636
- * )}
637
- * </>
638
- * );
639
- * };
640
- */
641
- const BodyScrollLock = () => {
642
- useLayoutEffect(() => {
643
- // 現在の縦横スクロール位置を記録
644
- const {
645
- scrollX,
646
- scrollY
647
- } = window;
648
- const {
649
- body
650
- } = document;
651
- // スクロールバーの有無と幅を検出
646
+ // src/modal/modal.tsx
647
+ var import_react11 = require("react");
648
+ var import_react_dom2 = require("react-dom");
649
+
650
+ // src/modal/body-scroll-lock.tsx
651
+ var import_react8 = require("react");
652
+ var BodyScrollLock = () => {
653
+ (0, import_react8.useLayoutEffect)(() => {
654
+ const { scrollX, scrollY } = window;
655
+ const { body } = document;
652
656
  const hasVerticalScrollbar = document.documentElement.scrollHeight > document.documentElement.clientHeight;
653
657
  const scrollbarWidth = hasVerticalScrollbar ? window.innerWidth - document.documentElement.clientWidth : 0;
654
- // 元のインラインスタイルの値を保存
655
658
  const originalInlineStyles = {
656
659
  position: body.style.position,
657
660
  top: body.style.top,
@@ -660,236 +663,182 @@ const BodyScrollLock = () => {
660
663
  overflow: body.style.overflow,
661
664
  paddingRight: body.style.paddingRight
662
665
  };
663
- // スクロールロックスタイルを適用
664
- body.style.position = 'fixed';
666
+ body.style.position = "fixed";
665
667
  body.style.top = `-${scrollY}px`;
666
668
  body.style.left = `-${scrollX}px`;
667
- body.style.width = '100%';
668
- body.style.overflow = 'hidden';
669
- // スクロールバーがある場合、その幅分だけpadding-rightを調整
669
+ body.style.width = "100%";
670
+ body.style.overflow = "hidden";
670
671
  if (hasVerticalScrollbar && scrollbarWidth > 0) {
671
- // 現在のpadding-rightの値を取得
672
- const {
673
- paddingRight
674
- } = window.getComputedStyle(body);
675
- const paddingRightValue = paddingRight !== '' ? parseInt(paddingRight, 10) : 0;
676
- // スクロールバーの幅を加算
672
+ const { paddingRight } = window.getComputedStyle(body);
673
+ const paddingRightValue = paddingRight !== "" ? parseInt(paddingRight, 10) : 0;
677
674
  body.style.paddingRight = `${paddingRightValue + scrollbarWidth}px`;
678
675
  }
679
- // クリーンアップ関数
680
676
  return () => {
681
- // 元のスタイル値を取得
682
- const {
683
- position,
684
- top,
685
- left,
686
- width,
687
- overflow,
688
- paddingRight
689
- } = originalInlineStyles;
690
- // プロパティごとに元の値を復元
691
- restoreProperty(body, 'position', position);
692
- restoreProperty(body, 'top', top);
693
- restoreProperty(body, 'left', left);
694
- restoreProperty(body, 'width', width);
695
- restoreProperty(body, 'overflow', overflow);
696
- restoreProperty(body, 'padding-right', paddingRight);
697
- // スクロール位置を復元
677
+ const { position, top, left, width, overflow, paddingRight } = originalInlineStyles;
678
+ restoreProperty(body, "position", position);
679
+ restoreProperty(body, "top", top);
680
+ restoreProperty(body, "left", left);
681
+ restoreProperty(body, "width", width);
682
+ restoreProperty(body, "overflow", overflow);
683
+ restoreProperty(body, "padding-right", paddingRight);
698
684
  window.scrollTo(scrollX, scrollY);
699
685
  };
700
- }, []); // 空の依存配列を指定して初回のみ実行
701
- // DOM要素をレンダリングせず、nullを返す
686
+ }, []);
702
687
  return null;
703
688
  };
704
- /**
705
- * 元のスタイル値を復元するヘルパー関数
706
- * @param element スタイルを復元する要素
707
- * @param property 復元するCSSプロパティ名
708
- * @param value 復元する値
709
- */
710
689
  function restoreProperty(element, property, value) {
711
- if (value !== '') {
690
+ if (value !== "") {
712
691
  element.style.setProperty(property, value);
713
692
  } else {
714
693
  element.style.removeProperty(property);
715
694
  }
716
695
  }
717
696
 
718
- function ModalBody({
719
- children
720
- }) {
721
- return /*#__PURE__*/jsx("div", {
722
- className: "overflow-y-auto",
723
- children: children
724
- });
697
+ // src/modal/modal-body.tsx
698
+ var import_jsx_runtime16 = require("react/jsx-runtime");
699
+ function ModalBody({ children }) {
700
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "overflow-y-auto", children });
725
701
  }
726
702
 
727
- const ModalContext = /*#__PURE__*/createContext({
703
+ // src/modal/modal-context.ts
704
+ var import_react9 = require("react");
705
+ var ModalContext = (0, import_react9.createContext)({
728
706
  onClose: () => null
729
707
  });
730
708
 
731
- function ModalFooter({
732
- children,
733
- isNoBorder = false
734
- }) {
735
- const wrapperClasses = clsx$1('flex w-full shrink-0 items-center rounded-b-lg px-6 py-4', {
736
- 'border-t-[1px] border-uiBorder01': !isNoBorder
737
- });
738
- return /*#__PURE__*/jsx("div", {
739
- className: wrapperClasses,
740
- children: children
741
- });
709
+ // src/modal/modal-footer.tsx
710
+ var import_clsx12 = __toESM(require("clsx"));
711
+ var import_jsx_runtime17 = require("react/jsx-runtime");
712
+ function ModalFooter({ children, isNoBorder = false }) {
713
+ const wrapperClasses = (0, import_clsx12.default)("flex w-full shrink-0 items-center rounded-b-lg px-6 py-4", {
714
+ "border-t-[1px] border-uiBorder01": !isNoBorder
715
+ });
716
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: wrapperClasses, children });
742
717
  }
743
718
 
744
- function ModalHeader({
745
- children,
746
- isNoBorder = false
747
- }) {
748
- const {
749
- onClose
750
- } = useContext(ModalContext);
751
- const headerClasses = clsx$1('typography-h5 flex w-full shrink-0 items-center justify-between rounded-t-lg px-6 text-text01', {
752
- 'border-b border-uiBorder01': !isNoBorder,
753
- 'h-14': !onClose,
754
- 'h-12': onClose
755
- });
756
- return /*#__PURE__*/jsxs("div", {
757
- className: headerClasses,
758
- children: [/*#__PURE__*/jsx("div", {
759
- children: children
760
- }), onClose && /*#__PURE__*/jsx(IconButton, {
761
- icon: "close",
762
- size: "small",
763
- variant: "text",
764
- onClick: onClose
765
- })]
766
- });
719
+ // src/modal/modal-header.tsx
720
+ var import_clsx13 = __toESM(require("clsx"));
721
+ var import_react10 = require("react");
722
+ var import_jsx_runtime18 = require("react/jsx-runtime");
723
+ function ModalHeader({ children, isNoBorder = false }) {
724
+ const { onClose } = (0, import_react10.useContext)(ModalContext);
725
+ const headerClasses = (0, import_clsx13.default)(
726
+ "typography-h5 flex w-full shrink-0 items-center justify-between rounded-t-lg px-6 text-text01",
727
+ {
728
+ "border-b border-uiBorder01": !isNoBorder,
729
+ "h-14": !onClose,
730
+ "h-12": onClose
731
+ }
732
+ );
733
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: headerClasses, children: [
734
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children }),
735
+ onClose && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconButton, { icon: "close", size: "small", variant: "text", onClick: onClose })
736
+ ] });
767
737
  }
768
738
 
769
- const LIMIT_WIDTH = 320;
770
- const LIMIT_HEIGHT = 184;
739
+ // src/modal/modal.tsx
740
+ var import_jsx_runtime19 = require("react/jsx-runtime");
741
+ var LIMIT_WIDTH = 320;
742
+ var LIMIT_HEIGHT = 184;
771
743
  function Modal({
772
744
  children,
773
745
  width = 480,
774
746
  height,
747
+ maxWidth = "calc(100vw - 40px)",
775
748
  isOpen,
776
749
  onClose,
777
750
  portalTargetRef
778
751
  }) {
779
- const [isMounted, setIsMounted] = useState(false);
780
- const renderWidth = typeof width === 'number' ? Math.max(width, LIMIT_WIDTH) : width;
781
- const renderHeight = typeof height === 'number' ? Math.max(height, LIMIT_HEIGHT) : height;
782
- useEffect(() => {
752
+ const [isMounted, setIsMounted] = (0, import_react11.useState)(false);
753
+ const renderWidth = typeof width === "number" ? Math.max(width, LIMIT_WIDTH) : width;
754
+ const renderHeight = typeof height === "number" ? Math.max(height, LIMIT_HEIGHT) : height;
755
+ (0, import_react11.useEffect)(() => {
783
756
  setIsMounted(true);
784
757
  }, []);
785
- return isMounted && isOpen ? /*#__PURE__*/jsxs(Fragment, {
786
- children: [/*#__PURE__*/jsx(BodyScrollLock, {}), /*#__PURE__*/createPortal(/*#__PURE__*/jsx(ModalContext.Provider, {
787
- value: {
788
- onClose
789
- },
790
- children: /*#__PURE__*/jsx("div", {
791
- className: "fixed left-0 top-0 z-overlay flex size-full items-center justify-center bg-backgroundOverlayBlack py-4",
792
- children: /*#__PURE__*/jsx("div", {
758
+ return isMounted && isOpen ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
759
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(BodyScrollLock, {}),
760
+ (0, import_react_dom2.createPortal)(
761
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ModalContext.Provider, { value: { onClose }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "fixed left-0 top-0 z-overlay flex size-full items-center justify-center bg-backgroundOverlayBlack py-4", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
762
+ "div",
763
+ {
793
764
  className: "grid max-h-full min-h-[120px] grid-rows-[max-content_1fr_max-content] flex-col rounded-lg bg-uiBackground01 shadow-modalShadow",
794
- style: {
795
- width: renderWidth,
796
- height: renderHeight
797
- },
798
- children: children
799
- })
800
- })
801
- }), (portalTargetRef == null ? void 0 : portalTargetRef.current) != null ? portalTargetRef.current : document.body)]
802
- }) : null;
765
+ style: { width: renderWidth, height: renderHeight, maxWidth },
766
+ children
767
+ }
768
+ ) }) }),
769
+ portalTargetRef?.current != null ? portalTargetRef.current : document.body
770
+ )
771
+ ] }) : null;
803
772
  }
804
773
  Modal.Body = ModalBody;
805
774
  Modal.Header = ModalHeader;
806
775
  Modal.Footer = ModalFooter;
807
776
 
808
- const _excluded$4 = ["state", "size"];
809
- function NotificationInline(_ref) {
810
- let {
811
- state = 'default',
812
- size = 'medium'
813
- } = _ref,
814
- props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
815
- const wrapperClasses = clsx('typography-body13regular flex items-center gap-1 rounded text-text01', {
816
- 'bg-uiBackgroundError': state === 'attention',
817
- 'bg-uiBackgroundWarning': state === 'warning',
818
- 'bg-uiBackgroundBlue': state === 'information',
819
- 'bg-uiBackgroundSuccess': state === 'success',
820
- 'bg-uiBackgroundGray': state === 'default',
821
- 'p-2': size === 'small',
822
- 'p-3': size === 'medium'
823
- });
824
- const iconClasses = clsx('flex items-center', {
825
- 'fill-supportError': state === 'attention',
826
- 'fill-supportWarning': state === 'warning',
827
- 'fill-blue-blue50': state === 'information',
828
- 'fill-supportSuccess': state === 'success'
777
+ // src/notification-inline/notification-inline.tsx
778
+ var import_clsx14 = require("clsx");
779
+ var import_jsx_runtime20 = require("react/jsx-runtime");
780
+ function NotificationInline({ state = "default", size = "medium", ...props }) {
781
+ const wrapperClasses = (0, import_clsx14.clsx)("typography-body13regular flex items-center gap-1 rounded text-text01", {
782
+ "bg-uiBackgroundError": state === "attention",
783
+ "bg-uiBackgroundWarning": state === "warning",
784
+ "bg-uiBackgroundBlue": state === "information",
785
+ "bg-uiBackgroundSuccess": state === "success",
786
+ "bg-uiBackgroundGray": state === "default",
787
+ "p-2": size === "small",
788
+ "p-3": size === "medium"
789
+ });
790
+ const iconClasses = (0, import_clsx14.clsx)("flex items-center", {
791
+ "fill-supportError": state === "attention",
792
+ "fill-supportWarning": state === "warning",
793
+ "fill-blue-blue50": state === "information",
794
+ "fill-supportSuccess": state === "success"
829
795
  });
830
796
  const iconName = {
831
- attention: 'attention',
832
- success: 'success-filled',
833
- warning: 'warning',
834
- information: 'information-filled'
797
+ attention: "attention",
798
+ success: "success-filled",
799
+ warning: "warning",
800
+ information: "information-filled"
835
801
  };
836
802
  const iconSize = {
837
- small: 'small',
838
- medium: 'medium'
803
+ small: "small",
804
+ medium: "medium"
839
805
  };
840
- return /*#__PURE__*/jsxs("div", {
841
- className: wrapperClasses,
842
- children: [state !== 'default' && /*#__PURE__*/jsx("div", {
843
- className: iconClasses,
844
- children: /*#__PURE__*/jsx(Icon, {
845
- name: iconName[state],
846
- size: iconSize[size]
847
- })
848
- }), /*#__PURE__*/jsx("p", {
849
- className: "flex-1",
850
- children: props.children
851
- }), props.showClose === true && /*#__PURE__*/jsx("div", {
852
- className: "flex items-center",
853
- children: /*#__PURE__*/jsx(IconButton, {
854
- icon: "close",
855
- size: "small",
856
- variant: "text"
857
- })
858
- })]
859
- });
806
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: wrapperClasses, children: [
807
+ state !== "default" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: iconName[state], size: iconSize[size] }) }),
808
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "flex-1", children: props.children }),
809
+ props.showClose === true && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconButton, { icon: "close", size: "small", variant: "text" }) })
810
+ ] });
860
811
  }
861
812
 
862
- const PaginationContext = /*#__PURE__*/createContext({
813
+ // src/pagination/pagination-button.tsx
814
+ var import_clsx15 = require("clsx");
815
+ var import_react13 = require("react");
816
+
817
+ // src/pagination/pagination-context.ts
818
+ var import_react12 = require("react");
819
+ var PaginationContext = (0, import_react12.createContext)({
863
820
  currentPage: 0
864
821
  });
865
822
 
866
- function PaginationButton({
867
- page,
868
- onClick
869
- }) {
870
- const {
871
- currentPage
872
- } = useContext(PaginationContext);
873
- const buttonClasses = clsx('flex h-8 min-w-8 items-center justify-center rounded fill-icon01 px-1', 'typography-label14regular', 'text-interactive02', 'hover:bg-hover02', {
874
- 'border border-uiBorder02': page === currentPage
875
- }, {
876
- 'border-transparent': page !== currentPage
877
- });
878
- return /*#__PURE__*/jsx("button", {
879
- type: "button",
880
- className: buttonClasses,
881
- onClick: () => onClick(page),
882
- children: page
883
- });
823
+ // src/pagination/pagination-button.tsx
824
+ var import_jsx_runtime21 = require("react/jsx-runtime");
825
+ function PaginationButton({ page, onClick }) {
826
+ const { currentPage } = (0, import_react13.useContext)(PaginationContext);
827
+ const buttonClasses = (0, import_clsx15.clsx)(
828
+ "flex h-8 min-w-8 items-center justify-center rounded fill-icon01 px-1",
829
+ "typography-label14regular",
830
+ "text-interactive02",
831
+ "hover:bg-hover02",
832
+ { "border border-uiBorder02": page === currentPage },
833
+ { "border-transparent": page !== currentPage }
834
+ );
835
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", className: buttonClasses, onClick: () => onClick(page), children: page });
884
836
  }
885
837
 
886
- const START_PAGE = 1;
887
- function Pagination({
888
- currentPage,
889
- totalPage,
890
- sideNumPagesToShow = 3,
891
- onClick
892
- }) {
838
+ // src/pagination/pagination.tsx
839
+ var import_jsx_runtime22 = require("react/jsx-runtime");
840
+ var START_PAGE = 1;
841
+ function Pagination({ currentPage, totalPage, sideNumPagesToShow = 3, onClick }) {
893
842
  let center = Math.max(currentPage, START_PAGE + 1);
894
843
  center = Math.min(center, totalPage - 1);
895
844
  const start = Math.max(center - sideNumPagesToShow, START_PAGE + 1);
@@ -900,166 +849,132 @@ function Pagination({
900
849
  for (let i = start + offsetStart; i <= end + offsetEnd; i++) {
901
850
  pageList.push(i);
902
851
  }
903
- const threeDotIconClasses = 'flex h-8 w-8 items-center justify-center gap-1 fill-icon01';
904
- return /*#__PURE__*/jsx(PaginationContext.Provider, {
905
- value: {
906
- currentPage
907
- },
908
- children: /*#__PURE__*/jsxs("ul", {
909
- className: "flex gap-1",
910
- children: [/*#__PURE__*/jsx("li", {
911
- className: "flex items-center",
912
- children: /*#__PURE__*/jsx(IconButton, {
913
- isDisabled: currentPage === START_PAGE,
914
- variant: "text",
915
- icon: "angle-left",
916
- size: "small",
917
- onClick: () => onClick(currentPage - 1)
918
- })
919
- }), /*#__PURE__*/jsx("li", {
920
- children: /*#__PURE__*/jsx(PaginationButton, {
921
- onClick: () => onClick(START_PAGE),
922
- page: START_PAGE
923
- })
924
- }), pageList.length !== 0 && pageList[0] !== 2 && /*#__PURE__*/jsx("li", {
925
- className: threeDotIconClasses,
926
- children: /*#__PURE__*/jsx(Icon, {
927
- name: "more",
928
- size: "small"
929
- })
930
- }), pageList.map((page, index) => /*#__PURE__*/jsx("li", {
931
- children: /*#__PURE__*/jsx(PaginationButton, {
932
- onClick: () => onClick(page),
933
- page: page
934
- })
935
- }, index)), pageList.length !== 0 && pageList[pageList.length - 1] !== totalPage - 1 && /*#__PURE__*/jsx("li", {
936
- className: threeDotIconClasses,
937
- children: /*#__PURE__*/jsx(Icon, {
938
- name: "more",
939
- size: "small"
940
- })
941
- }), /*#__PURE__*/jsx("li", {
942
- children: /*#__PURE__*/jsx(PaginationButton, {
943
- onClick: () => onClick(totalPage),
944
- page: totalPage
945
- })
946
- }), /*#__PURE__*/jsx("li", {
947
- className: "flex items-center",
948
- children: /*#__PURE__*/jsx(IconButton, {
949
- isDisabled: currentPage === totalPage,
950
- variant: "text",
951
- icon: "angle-right",
952
- size: "small",
953
- onClick: () => onClick(currentPage + 1)
954
- })
955
- })]
956
- })
957
- });
852
+ const threeDotIconClasses = "flex h-8 w-8 items-center justify-center gap-1 fill-icon01";
853
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
854
+ PaginationContext.Provider,
855
+ {
856
+ value: {
857
+ currentPage
858
+ },
859
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("ul", { className: "flex gap-1", children: [
860
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
861
+ IconButton,
862
+ {
863
+ isDisabled: currentPage === START_PAGE,
864
+ variant: "text",
865
+ icon: "angle-left",
866
+ size: "small",
867
+ onClick: () => onClick(currentPage - 1)
868
+ }
869
+ ) }),
870
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PaginationButton, { onClick: () => onClick(START_PAGE), page: START_PAGE }) }),
871
+ pageList.length !== 0 && pageList[0] !== 2 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { className: threeDotIconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "more", size: "small" }) }),
872
+ pageList.map((page, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PaginationButton, { onClick: () => onClick(page), page }) }, index)),
873
+ pageList.length !== 0 && pageList[pageList.length - 1] !== totalPage - 1 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { className: threeDotIconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "more", size: "small" }) }),
874
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PaginationButton, { onClick: () => onClick(totalPage), page: totalPage }) }),
875
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
876
+ IconButton,
877
+ {
878
+ isDisabled: currentPage === totalPage,
879
+ variant: "text",
880
+ icon: "angle-right",
881
+ size: "small",
882
+ onClick: () => onClick(currentPage + 1)
883
+ }
884
+ ) })
885
+ ] })
886
+ }
887
+ );
958
888
  }
959
889
 
960
- const SelectContext = /*#__PURE__*/createContext({
961
- size: 'medium',
890
+ // src/select/select.tsx
891
+ var import_component_theme12 = require("@zenkigen-inc/component-theme");
892
+ var import_clsx18 = __toESM(require("clsx"));
893
+ var import_react17 = require("react");
894
+
895
+ // src/select/select-context.ts
896
+ var import_react14 = require("react");
897
+ var SelectContext = (0, import_react14.createContext)({
898
+ size: "medium",
962
899
  setIsOptionListOpen: () => false,
963
- variant: 'outline'
900
+ variant: "outline"
964
901
  });
965
902
 
966
- function SelectItem$1({
967
- option
968
- }) {
969
- const {
970
- setIsOptionListOpen,
971
- selectedOption,
972
- onChange
973
- } = useContext(SelectContext);
974
- const handleClickItem = option => {
975
- onChange == null || onChange(option);
903
+ // src/select/select-item.tsx
904
+ var import_component_theme10 = require("@zenkigen-inc/component-theme");
905
+ var import_clsx16 = __toESM(require("clsx"));
906
+ var import_react15 = require("react");
907
+ var import_jsx_runtime23 = require("react/jsx-runtime");
908
+ function SelectItem({ option }) {
909
+ const { setIsOptionListOpen, selectedOption, onChange } = (0, import_react15.useContext)(SelectContext);
910
+ const handleClickItem = (option2) => {
911
+ onChange?.(option2);
976
912
  setIsOptionListOpen(false);
977
913
  };
978
- const itemClasses = clsx$1('typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02', focusVisible.inset, {
979
- 'text-interactive01 fill-interactive01 bg-selectedUi': option.id === (selectedOption == null ? void 0 : selectedOption.id),
980
- 'text-interactive02 fill-icon01 bg-uiBackground01': option.id !== (selectedOption == null ? void 0 : selectedOption.id)
981
- });
982
- return /*#__PURE__*/jsx("li", {
983
- className: "flex w-full items-center",
984
- "data-id": option.id,
985
- children: /*#__PURE__*/jsxs("button", {
986
- className: itemClasses,
987
- type: "button",
988
- onClick: () => handleClickItem(option),
989
- children: [option.icon && /*#__PURE__*/jsx(Icon, {
990
- name: option.icon,
991
- size: "small"
992
- }), /*#__PURE__*/jsx("span", {
993
- className: "ml-1 mr-6",
994
- children: option.label
995
- }), option.id === (selectedOption == null ? void 0 : selectedOption.id) && /*#__PURE__*/jsx("div", {
996
- className: "ml-auto flex items-center",
997
- children: /*#__PURE__*/jsx(Icon, {
998
- name: "check",
999
- size: "small"
1000
- })
1001
- })]
1002
- })
1003
- }, option.id);
914
+ const itemClasses = (0, import_clsx16.default)(
915
+ "typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02",
916
+ import_component_theme10.focusVisible.inset,
917
+ {
918
+ "text-interactive01 fill-interactive01 bg-selectedUi": option.id === selectedOption?.id,
919
+ "text-interactive02 fill-icon01 bg-uiBackground01": option.id !== selectedOption?.id
920
+ }
921
+ );
922
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { className: "flex w-full items-center", "data-id": option.id, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("button", { className: itemClasses, type: "button", onClick: () => handleClickItem(option), children: [
923
+ option.icon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: option.icon, size: "small" }),
924
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "ml-1 mr-6", children: option.label }),
925
+ option.id === selectedOption?.id && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: "check", size: "small" }) })
926
+ ] }) }, option.id);
1004
927
  }
1005
928
 
1006
- function SelectList$1({
1007
- children,
1008
- maxHeight
1009
- }) {
1010
- const ref = useRef(null);
1011
- const {
1012
- size,
1013
- selectedOption,
1014
- setIsOptionListOpen,
1015
- variant,
1016
- placeholder,
1017
- onChange
1018
- } = useContext(SelectContext);
929
+ // src/select/select-list.tsx
930
+ var import_component_theme11 = require("@zenkigen-inc/component-theme");
931
+ var import_clsx17 = __toESM(require("clsx"));
932
+ var import_react16 = require("react");
933
+ var import_jsx_runtime24 = require("react/jsx-runtime");
934
+ function SelectList({ children, maxHeight }) {
935
+ const ref = (0, import_react16.useRef)(null);
936
+ const { size, selectedOption, setIsOptionListOpen, variant, placeholder, onChange } = (0, import_react16.useContext)(SelectContext);
1019
937
  const handleClickDeselect = () => {
1020
- onChange == null || onChange(null);
938
+ onChange?.(null);
1021
939
  setIsOptionListOpen(false);
1022
940
  };
1023
- useLayoutEffect(() => {
941
+ (0, import_react16.useLayoutEffect)(() => {
1024
942
  if (maxHeight != null && ref.current) {
1025
- var _ref$current$children;
1026
- const element = Array.from((_ref$current$children = ref.current.children) != null ? _ref$current$children : []).find(item => item.getAttribute('data-id') === (selectedOption == null ? void 0 : selectedOption.id));
943
+ const element = Array.from(ref.current.children ?? []).find(
944
+ (item) => item.getAttribute("data-id") === selectedOption?.id
945
+ );
1027
946
  if (element != null && ref.current.scroll != null) {
1028
947
  const wrapRect = ref.current.getBoundingClientRect();
1029
948
  const rect = element.getBoundingClientRect();
1030
949
  ref.current.scroll(0, rect.top - wrapRect.top - wrapRect.height / 2 + rect.height / 2);
1031
950
  }
1032
951
  }
1033
- // eslint-disable-next-line react-hooks/exhaustive-deps
1034
952
  }, []);
1035
- const listClasses = clsx$1('absolute z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow', {
1036
- 'top-7': size === 'x-small' || size === 'small',
1037
- 'top-9': size === 'medium',
1038
- 'top-11': size === 'large',
1039
- 'border-solid border border-uiBorder01': variant === 'outline'
1040
- });
1041
- const deselectButtonClasses = clsx$1('typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02', focusVisible.inset);
1042
- return /*#__PURE__*/jsxs("ul", {
1043
- className: listClasses,
1044
- style: {
1045
- maxHeight
1046
- },
1047
- ref: ref,
1048
- children: [children, placeholder != null && selectedOption !== null && /*#__PURE__*/jsx("li", {
1049
- children: /*#__PURE__*/jsx("button", {
1050
- className: deselectButtonClasses,
1051
- type: "button",
1052
- onClick: handleClickDeselect,
1053
- children: "\u9078\u629E\u89E3\u9664"
1054
- })
1055
- })]
1056
- });
953
+ const listClasses = (0, import_clsx17.default)(
954
+ "absolute z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow",
955
+ {
956
+ "top-7": size === "x-small" || size === "small",
957
+ "top-9": size === "medium",
958
+ "top-11": size === "large",
959
+ "border-solid border border-uiBorder01": variant === "outline"
960
+ }
961
+ );
962
+ const deselectButtonClasses = (0, import_clsx17.default)(
963
+ "typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
964
+ import_component_theme11.focusVisible.inset
965
+ );
966
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("ul", { className: listClasses, style: { maxHeight }, ref, children: [
967
+ children,
968
+ placeholder != null && selectedOption !== null && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: deselectButtonClasses, type: "button", onClick: handleClickDeselect, children: "\u9078\u629E\u89E3\u9664" }) })
969
+ ] });
1057
970
  }
1058
971
 
972
+ // src/select/select.tsx
973
+ var import_jsx_runtime25 = require("react/jsx-runtime");
1059
974
  function Select({
1060
975
  children,
1061
- size = 'medium',
1062
- variant = 'outline',
976
+ size = "medium",
977
+ variant = "outline",
1063
978
  width,
1064
979
  maxWidth,
1065
980
  placeholder,
@@ -1070,91 +985,75 @@ function Select({
1070
985
  onChange,
1071
986
  optionListMaxHeight
1072
987
  }) {
1073
- const [isOptionListOpen, setIsOptionListOpen] = useState(false);
1074
- const targetRef = useRef(null);
988
+ const [isOptionListOpen, setIsOptionListOpen] = (0, import_react17.useState)(false);
989
+ const targetRef = (0, import_react17.useRef)(null);
1075
990
  useOutsideClick(targetRef, () => setIsOptionListOpen(false));
1076
- const handleClickToggle = () => setIsOptionListOpen(prev => !prev);
1077
- const wrapperClasses = clsx$1('relative flex shrink-0 items-center gap-1 rounded bg-uiBackground01', {
1078
- 'h-6': size === 'x-small' || size === 'small',
1079
- 'h-8': size === 'medium',
1080
- 'h-10': size === 'large',
1081
- 'cursor-not-allowed': isDisabled
1082
- });
1083
- const buttonClasses = clsx$1('flex size-full items-center rounded', buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, {
1084
- [buttonColors[variant].selected]: isOptionSelected && !isDisabled && selectedOption,
1085
- [buttonColors[variant].base]: !(isOptionSelected && !isDisabled && selectedOption),
1086
- 'px-2': size === 'x-small' || size === 'small',
1087
- 'px-4': size === 'medium' || size === 'large',
1088
- 'pointer-events-none': isDisabled
1089
- });
1090
- const labelClasses = clsx$1('overflow-hidden', {
1091
- 'mr-1': size === 'x-small',
1092
- 'mr-2': size !== 'x-small',
1093
- 'typography-label12regular': size === 'x-small',
1094
- 'typography-label14regular': size === 'small' || size === 'medium',
1095
- 'typography-label16regular': size === 'large'
1096
- });
1097
- return /*#__PURE__*/jsx(SelectContext.Provider, {
1098
- value: {
1099
- size,
1100
- variant,
1101
- placeholder,
1102
- setIsOptionListOpen,
1103
- selectedOption,
1104
- onChange
1105
- },
1106
- children: /*#__PURE__*/jsxs("div", {
1107
- className: wrapperClasses,
1108
- style: {
1109
- width,
1110
- maxWidth
991
+ const handleClickToggle = () => setIsOptionListOpen((prev) => !prev);
992
+ const wrapperClasses = (0, import_clsx18.default)("relative flex shrink-0 items-center gap-1 rounded bg-uiBackground01", {
993
+ "h-6": size === "x-small" || size === "small",
994
+ "h-8": size === "medium",
995
+ "h-10": size === "large",
996
+ "cursor-not-allowed": isDisabled
997
+ });
998
+ const buttonClasses = (0, import_clsx18.default)(
999
+ "flex size-full items-center rounded",
1000
+ import_component_theme12.buttonColors[variant].hover,
1001
+ import_component_theme12.buttonColors[variant].active,
1002
+ import_component_theme12.buttonColors[variant].disabled,
1003
+ import_component_theme12.focusVisible.normal,
1004
+ {
1005
+ [import_component_theme12.buttonColors[variant].selected]: isOptionSelected && !isDisabled && selectedOption,
1006
+ [import_component_theme12.buttonColors[variant].base]: !(isOptionSelected && !isDisabled && selectedOption),
1007
+ "px-2": size === "x-small" || size === "small",
1008
+ "px-4": size === "medium" || size === "large",
1009
+ "pointer-events-none": isDisabled
1010
+ }
1011
+ );
1012
+ const labelClasses = (0, import_clsx18.default)("overflow-hidden", {
1013
+ "mr-1": size === "x-small",
1014
+ "mr-2": size !== "x-small",
1015
+ "typography-label12regular": size === "x-small",
1016
+ "typography-label14regular": size === "small" || size === "medium",
1017
+ "typography-label16regular": size === "large"
1018
+ });
1019
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1020
+ SelectContext.Provider,
1021
+ {
1022
+ value: {
1023
+ size,
1024
+ variant,
1025
+ placeholder,
1026
+ setIsOptionListOpen,
1027
+ selectedOption,
1028
+ onChange
1111
1029
  },
1112
- ref: targetRef,
1113
- children: [/*#__PURE__*/jsxs("button", {
1114
- className: buttonClasses,
1115
- type: "button",
1116
- onClick: handleClickToggle,
1117
- disabled: isDisabled,
1118
- children: [selectedOption != null && selectedOption.icon ? /*#__PURE__*/jsx("div", {
1119
- className: "mr-1 flex",
1120
- children: /*#__PURE__*/jsx(Icon, {
1121
- name: selectedOption.icon,
1122
- size: size === 'large' ? 'medium' : 'small'
1123
- })
1124
- }) : placeholder != null && placeholderIcon && /*#__PURE__*/jsx("div", {
1125
- className: "mr-1 flex",
1126
- children: /*#__PURE__*/jsx(Icon, {
1127
- name: placeholderIcon,
1128
- size: size === 'large' ? 'medium' : 'small'
1129
- })
1130
- }), /*#__PURE__*/jsx("div", {
1131
- className: labelClasses,
1132
- children: /*#__PURE__*/jsx("div", {
1133
- className: "truncate",
1134
- children: selectedOption ? selectedOption.label : placeholder != null && placeholder
1135
- })
1136
- }), /*#__PURE__*/jsx("div", {
1137
- className: "ml-auto flex items-center",
1138
- children: /*#__PURE__*/jsx(Icon, {
1139
- name: isOptionListOpen ? 'angle-small-up' : 'angle-small-down',
1140
- size: size === 'large' ? 'medium' : 'small'
1141
- })
1142
- })]
1143
- }), isOptionListOpen && !isDisabled && /*#__PURE__*/jsx(SelectList$1, {
1144
- maxHeight: optionListMaxHeight,
1145
- children: children
1146
- })]
1147
- })
1148
- });
1030
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: wrapperClasses, style: { width, maxWidth }, ref: targetRef, children: [
1031
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("button", { className: buttonClasses, type: "button", onClick: handleClickToggle, disabled: isDisabled, children: [
1032
+ selectedOption?.icon ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "mr-1 flex", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: selectedOption.icon, size: size === "large" ? "medium" : "small" }) }) : placeholder != null && placeholderIcon && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "mr-1 flex", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: placeholderIcon, size: size === "large" ? "medium" : "small" }) }),
1033
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: labelClasses, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "truncate", children: selectedOption ? selectedOption.label : placeholder != null && placeholder }) }),
1034
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1035
+ Icon,
1036
+ {
1037
+ name: isOptionListOpen ? "angle-small-up" : "angle-small-down",
1038
+ size: size === "large" ? "medium" : "small"
1039
+ }
1040
+ ) })
1041
+ ] }),
1042
+ isOptionListOpen && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectList, { maxHeight: optionListMaxHeight, children })
1043
+ ] })
1044
+ }
1045
+ );
1149
1046
  }
1150
- Select.Option = SelectItem$1;
1047
+ Select.Option = SelectItem;
1151
1048
 
1049
+ // src/pagination-select/pagination-select.tsx
1050
+ var import_jsx_runtime26 = require("react/jsx-runtime");
1152
1051
  function PaginationSelect({
1153
1052
  totalSize,
1154
1053
  currentPage,
1155
1054
  sizePerPage,
1156
- countLabel = '件',
1157
- pageLabel = 'ページ',
1055
+ countLabel = "\u4EF6",
1056
+ pageLabel = "\u30DA\u30FC\u30B8",
1158
1057
  optionListMaxHeight = 190,
1159
1058
  onClickPrevButton,
1160
1059
  onClickNextButton,
@@ -1171,239 +1070,224 @@ function PaginationSelect({
1171
1070
  });
1172
1071
  const minCount = totalSize ? (currentPage - 1) * sizePerPage + 1 : 0;
1173
1072
  const maxCount = currentPage * sizePerPage > totalSize ? totalSize : currentPage * sizePerPage;
1174
- return /*#__PURE__*/jsxs("nav", {
1175
- "aria-label": "pagination",
1176
- className: "flex items-center gap-x-1",
1177
- children: [/*#__PURE__*/jsxs("div", {
1178
- className: "flex items-center gap-x-2",
1179
- children: [/*#__PURE__*/jsxs("div", {
1180
- className: "typography-label14regular text-text01",
1181
- children: [minCount > 0 && `${minCount} - `, maxCount, countLabel]
1182
- }), /*#__PURE__*/jsx(Select, {
1183
- size: "medium",
1184
- variant: "outline",
1185
- selectedOption: optionsList.find(option => option.value === currentPage.toString()),
1186
- optionListMaxHeight: optionListMaxHeight,
1187
- onChange: option => option && onChange(Number(option.value)),
1188
- isDisabled: pageMax === 0,
1189
- children: optionsList.map(option => /*#__PURE__*/jsx(Select.Option, {
1190
- option: option
1191
- }, option.id))
1192
- }), /*#__PURE__*/jsxs("div", {
1193
- className: "typography-label14regular text-text03",
1194
- children: ["/ ", pageMax, pageLabel]
1195
- })]
1196
- }), /*#__PURE__*/jsxs("div", {
1197
- className: "flex items-center",
1198
- children: [/*#__PURE__*/jsx(IconButton, {
1199
- variant: "text",
1200
- icon: "angle-left",
1201
- size: "small",
1202
- isDisabled: currentPage === 1,
1203
- onClick: onClickPrevButton
1204
- }), /*#__PURE__*/jsx(IconButton, {
1205
- variant: "text",
1206
- icon: "angle-right",
1207
- size: "small",
1208
- isDisabled: currentPage === pageMax || pageMax === 0,
1209
- onClick: onClickNextButton
1210
- })]
1211
- })]
1212
- });
1073
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("nav", { "aria-label": "pagination", className: "flex items-center gap-x-1", children: [
1074
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-x-2", children: [
1075
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "typography-label14regular text-text01", children: [
1076
+ minCount > 0 && `${minCount} - `,
1077
+ maxCount,
1078
+ countLabel
1079
+ ] }),
1080
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1081
+ Select,
1082
+ {
1083
+ size: "medium",
1084
+ variant: "outline",
1085
+ selectedOption: optionsList.find((option) => option.value === currentPage.toString()),
1086
+ optionListMaxHeight,
1087
+ onChange: (option) => option && onChange(Number(option.value)),
1088
+ isDisabled: pageMax === 0,
1089
+ children: optionsList.map((option) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Select.Option, { option }, option.id))
1090
+ }
1091
+ ),
1092
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "typography-label14regular text-text03", children: [
1093
+ "/ ",
1094
+ pageMax,
1095
+ pageLabel
1096
+ ] })
1097
+ ] }),
1098
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center", children: [
1099
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1100
+ IconButton,
1101
+ {
1102
+ variant: "text",
1103
+ icon: "angle-left",
1104
+ size: "small",
1105
+ isDisabled: currentPage === 1,
1106
+ onClick: onClickPrevButton
1107
+ }
1108
+ ),
1109
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1110
+ IconButton,
1111
+ {
1112
+ variant: "text",
1113
+ icon: "angle-right",
1114
+ size: "small",
1115
+ isDisabled: currentPage === pageMax || pageMax === 0,
1116
+ onClick: onClickNextButton
1117
+ }
1118
+ )
1119
+ ] })
1120
+ ] });
1213
1121
  }
1214
1122
 
1215
- function Radio({
1216
- name,
1217
- value,
1218
- id,
1219
- label,
1220
- isChecked = false,
1221
- isDisabled = false,
1222
- onChange
1223
- }) {
1224
- const [isMouseOver, setIsMouseOver] = useState(false);
1225
- const handleMouseOverInput = useCallback(() => {
1123
+ // src/radio/radio.tsx
1124
+ var import_component_theme13 = require("@zenkigen-inc/component-theme");
1125
+ var import_clsx19 = __toESM(require("clsx"));
1126
+ var import_react18 = require("react");
1127
+ var import_jsx_runtime27 = require("react/jsx-runtime");
1128
+ function Radio({ name, value, id, label, isChecked = false, isDisabled = false, onChange }) {
1129
+ const [isMouseOver, setIsMouseOver] = (0, import_react18.useState)(false);
1130
+ const handleMouseOverInput = (0, import_react18.useCallback)(() => {
1226
1131
  setIsMouseOver(true);
1227
1132
  }, []);
1228
- const handleMouseOutInput = useCallback(() => {
1133
+ const handleMouseOutInput = (0, import_react18.useCallback)(() => {
1229
1134
  setIsMouseOver(false);
1230
1135
  }, []);
1231
- const handleChange = useCallback(e => !isDisabled && (onChange == null ? void 0 : onChange(e)), [isDisabled, onChange]);
1232
- const inputClasses = clsx$1('peer absolute z-[1] size-6 opacity-0', {
1233
- 'cursor-not-allowed': isDisabled,
1234
- 'cursor-pointer': !isDisabled
1235
- });
1236
- const boxClasses = clsx$1('inline-flex size-5 items-center justify-center rounded-full border border-solid bg-white', focusVisible.normalPeer, {
1237
- 'border-disabled01 hover:border-disabled01': isDisabled && !isMouseOver,
1238
- 'border-hoverUiBorder': !isDisabled && isMouseOver,
1239
- 'border-uiBorder03': !isDisabled,
1240
- 'cursor-not-allowed': isDisabled,
1241
- 'cursor-pointer': !isDisabled
1242
- });
1243
- const afterClasses = clsx$1('absolute inset-0 m-auto block size-3 rounded-full', {
1244
- 'bg-disabled01': isDisabled && isChecked,
1245
- 'bg-activeSelectedUi': !isDisabled && isChecked,
1246
- 'scale-0': !isChecked,
1247
- 'scale-100': isChecked
1248
- });
1249
- const hoverIndicatorClasses = clsx$1('inline-block size-3 rounded-full', {
1250
- 'bg-hoverUi': !isDisabled && !isChecked && isMouseOver
1251
- });
1252
- const labelClasses = clsx$1('typography-label14regular ml-2 flex-[1_0_0] select-none break-all', {
1253
- 'pointer-events-none cursor-not-allowed text-disabled01': isDisabled,
1254
- 'cursor-pointer text-text01': !isDisabled
1255
- });
1256
- return /*#__PURE__*/jsxs("div", {
1257
- className: "flex items-center",
1258
- children: [/*#__PURE__*/jsxs("div", {
1259
- className: "flex size-6 items-center justify-center",
1260
- children: [/*#__PURE__*/jsx("input", {
1261
- type: "checkbox",
1262
- value: value,
1263
- name: name,
1264
- id: id,
1265
- checked: isChecked,
1266
- disabled: isDisabled,
1267
- onChange: handleChange,
1268
- onMouseOver: handleMouseOverInput,
1269
- onMouseLeave: handleMouseOutInput,
1270
- className: inputClasses
1271
- }), /*#__PURE__*/jsx("div", {
1272
- className: boxClasses,
1273
- children: /*#__PURE__*/jsxs("div", {
1274
- className: "relative flex size-5 flex-[0_0_auto] items-center justify-center",
1275
- children: [/*#__PURE__*/jsx("span", {
1276
- className: afterClasses
1277
- }), /*#__PURE__*/jsx("span", {
1278
- className: hoverIndicatorClasses
1279
- })]
1280
- })
1281
- })]
1282
- }), /*#__PURE__*/jsx("label", {
1283
- htmlFor: id,
1284
- className: labelClasses,
1285
- children: label
1286
- })]
1287
- });
1136
+ const handleChange = (0, import_react18.useCallback)(
1137
+ (e) => !isDisabled && onChange?.(e),
1138
+ [isDisabled, onChange]
1139
+ );
1140
+ const inputClasses = (0, import_clsx19.default)("peer absolute z-[1] size-6 opacity-0", {
1141
+ "cursor-not-allowed": isDisabled,
1142
+ "cursor-pointer": !isDisabled
1143
+ });
1144
+ const boxClasses = (0, import_clsx19.default)(
1145
+ "inline-flex size-5 items-center justify-center rounded-full border border-solid bg-white",
1146
+ import_component_theme13.focusVisible.normalPeer,
1147
+ {
1148
+ "border-disabled01 hover:border-disabled01": isDisabled && !isMouseOver,
1149
+ "border-hoverUiBorder": !isDisabled && isMouseOver,
1150
+ "border-uiBorder03": !isDisabled,
1151
+ "cursor-not-allowed": isDisabled,
1152
+ "cursor-pointer": !isDisabled
1153
+ }
1154
+ );
1155
+ const afterClasses = (0, import_clsx19.default)("absolute inset-0 m-auto block size-3 rounded-full", {
1156
+ "bg-disabled01": isDisabled && isChecked,
1157
+ "bg-activeSelectedUi": !isDisabled && isChecked,
1158
+ "scale-0": !isChecked,
1159
+ "scale-100": isChecked
1160
+ });
1161
+ const hoverIndicatorClasses = (0, import_clsx19.default)("inline-block size-3 rounded-full", {
1162
+ "bg-hoverUi": !isDisabled && !isChecked && isMouseOver
1163
+ });
1164
+ const labelClasses = (0, import_clsx19.default)("typography-label14regular ml-2 flex-[1_0_0] select-none break-all", {
1165
+ "pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
1166
+ "cursor-pointer text-text01": !isDisabled
1167
+ });
1168
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center", children: [
1169
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex size-6 items-center justify-center", children: [
1170
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1171
+ "input",
1172
+ {
1173
+ type: "checkbox",
1174
+ value,
1175
+ name,
1176
+ id,
1177
+ checked: isChecked,
1178
+ disabled: isDisabled,
1179
+ onChange: handleChange,
1180
+ onMouseOver: handleMouseOverInput,
1181
+ onMouseLeave: handleMouseOutInput,
1182
+ className: inputClasses
1183
+ }
1184
+ ),
1185
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: boxClasses, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative flex size-5 flex-[0_0_auto] items-center justify-center", children: [
1186
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: afterClasses }),
1187
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: hoverIndicatorClasses })
1188
+ ] }) })
1189
+ ] }),
1190
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("label", { htmlFor: id, className: labelClasses, children: label })
1191
+ ] });
1288
1192
  }
1289
1193
 
1290
- const _excluded$3 = ["width", "size"];
1291
- const Search = /*#__PURE__*/forwardRef((_ref, ref) => {
1292
- let {
1293
- width = '100%',
1294
- size = 'medium'
1295
- } = _ref,
1296
- props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
1297
- const classes = clsx('flex items-center rounded-full border border-uiBorder02 bg-uiBackground01 focus-within:border-activeInput', {
1298
- 'h-8 px-3': size === 'medium'
1299
- }, {
1300
- 'h-10 px-4': size === 'large'
1301
- });
1302
- const inputClasses = clsx('mx-2 h-full flex-1 text-text01 outline-0 placeholder:text-textPlaceholder', {
1303
- ['typography-label14regular']: size === 'medium',
1304
- ['typography-label16regular']: size === 'large'
1305
- });
1306
- return /*#__PURE__*/jsx("div", {
1307
- className: "relative",
1308
- ref: ref,
1309
- children: /*#__PURE__*/jsx("form", {
1310
- onSubmit: props.onSubmit,
1311
- children: /*#__PURE__*/jsxs("div", {
1312
- className: classes,
1313
- style: {
1314
- width
1315
- },
1316
- children: [/*#__PURE__*/jsx(Icon, {
1317
- name: "search",
1318
- color: "icon01",
1319
- size: "medium"
1320
- }), /*#__PURE__*/jsx("input", {
1321
- type: "text",
1322
- size: 1,
1323
- value: props.value,
1324
- className: inputClasses,
1325
- placeholder: props.placeholder,
1326
- onChange: props.onChange
1327
- }), props.onClickClearButton && props.value && props.value.length !== 0 && /*#__PURE__*/jsx(IconButton, {
1328
- variant: "text",
1329
- icon: "close",
1330
- size: size === 'medium' ? 'small' : 'medium',
1331
- isNoPadding: true,
1332
- onClick: props.onClickClearButton
1333
- })]
1334
- })
1335
- })
1336
- });
1194
+ // src/search/search.tsx
1195
+ var import_clsx20 = require("clsx");
1196
+ var import_react19 = require("react");
1197
+ var import_jsx_runtime28 = require("react/jsx-runtime");
1198
+ var Search = (0, import_react19.forwardRef)(({ width = "100%", size = "medium", ...props }, ref) => {
1199
+ const classes = (0, import_clsx20.clsx)(
1200
+ "flex items-center rounded-full border border-uiBorder02 bg-uiBackground01 focus-within:border-activeInput",
1201
+ { "h-8 px-3": size === "medium" },
1202
+ { "h-10 px-4": size === "large" }
1203
+ );
1204
+ const inputClasses = (0, import_clsx20.clsx)("mx-2 h-full flex-1 text-text01 outline-0 placeholder:text-textPlaceholder", {
1205
+ ["typography-label14regular"]: size === "medium",
1206
+ ["typography-label16regular"]: size === "large"
1207
+ });
1208
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "relative", ref, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("form", { onSubmit: props.onSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: classes, style: { width }, children: [
1209
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "search", color: "icon01", size: "medium" }),
1210
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1211
+ "input",
1212
+ {
1213
+ type: "text",
1214
+ size: 1,
1215
+ value: props.value,
1216
+ className: inputClasses,
1217
+ placeholder: props.placeholder,
1218
+ onChange: props.onChange
1219
+ }
1220
+ ),
1221
+ props.onClickClearButton && props.value && props.value.length !== 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1222
+ IconButton,
1223
+ {
1224
+ variant: "text",
1225
+ icon: "close",
1226
+ size: size === "medium" ? "small" : "medium",
1227
+ isNoPadding: true,
1228
+ onClick: props.onClickClearButton
1229
+ }
1230
+ )
1231
+ ] }) }) });
1337
1232
  });
1338
- Search.displayName = 'Search';
1233
+ Search.displayName = "Search";
1339
1234
 
1340
- function SelectItem({
1341
- children,
1342
- isSortKey,
1343
- onClickItem
1344
- }) {
1345
- const itemClasses = clsx$1('typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02', focusVisible.inset, {
1346
- 'bg-selectedUi fill-interactive01 text-interactive01': isSortKey,
1347
- 'bg-uiBackground01 fill-icon01 text-interactive02': !isSortKey
1348
- });
1349
- return /*#__PURE__*/jsx("li", {
1350
- className: "flex w-full items-center",
1351
- onClick: onClickItem,
1352
- children: /*#__PURE__*/jsxs("button", {
1353
- className: itemClasses,
1354
- type: "button",
1355
- children: [/*#__PURE__*/jsx("span", {
1356
- className: "ml-1 mr-6",
1357
- children: children
1358
- }), isSortKey && /*#__PURE__*/jsx("div", {
1359
- className: "ml-auto flex items-center",
1360
- children: /*#__PURE__*/jsx(Icon, {
1361
- name: "check",
1362
- size: "small"
1363
- })
1364
- })]
1365
- })
1366
- });
1235
+ // src/select-sort/select-sort.tsx
1236
+ var import_component_theme16 = require("@zenkigen-inc/component-theme");
1237
+ var import_clsx23 = __toESM(require("clsx"));
1238
+ var import_react20 = require("react");
1239
+
1240
+ // src/select-sort/select-list.tsx
1241
+ var import_component_theme15 = require("@zenkigen-inc/component-theme");
1242
+ var import_clsx22 = __toESM(require("clsx"));
1243
+
1244
+ // src/select-sort/select-item.tsx
1245
+ var import_component_theme14 = require("@zenkigen-inc/component-theme");
1246
+ var import_clsx21 = __toESM(require("clsx"));
1247
+ var import_jsx_runtime29 = require("react/jsx-runtime");
1248
+ function SelectItem2({ children, isSortKey, onClickItem }) {
1249
+ const itemClasses = (0, import_clsx21.default)(
1250
+ "typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02",
1251
+ import_component_theme14.focusVisible.inset,
1252
+ {
1253
+ "bg-selectedUi fill-interactive01 text-interactive01": isSortKey,
1254
+ "bg-uiBackground01 fill-icon01 text-interactive02": !isSortKey
1255
+ }
1256
+ );
1257
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("li", { className: "flex w-full items-center", onClick: onClickItem, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { className: itemClasses, type: "button", children: [
1258
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "ml-1 mr-6", children }),
1259
+ isSortKey && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "check", size: "small" }) })
1260
+ ] }) });
1367
1261
  }
1368
1262
 
1369
- function SelectList({
1370
- size,
1371
- variant,
1372
- sortOrder,
1373
- onClickItem,
1374
- onClickDeselect
1375
- }) {
1376
- const listClasses = clsx$1('absolute z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow', {
1377
- 'top-7': size === 'x-small' || size === 'small',
1378
- 'top-9': size === 'medium',
1379
- 'top-11': size === 'large',
1380
- 'border-solid border border-uiBorder01': variant === 'outline'
1381
- });
1382
- const deselectButtonClasses = clsx$1('typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02', focusVisible.inset);
1383
- return /*#__PURE__*/jsxs("ul", {
1384
- className: listClasses,
1385
- children: [/*#__PURE__*/jsx(SelectItem, {
1386
- isSortKey: sortOrder === 'ascend',
1387
- onClickItem: () => onClickItem('ascend'),
1388
- children: "\u6607\u9806\u3067\u4E26\u3073\u66FF\u3048"
1389
- }), /*#__PURE__*/jsx(SelectItem, {
1390
- isSortKey: sortOrder === 'descend',
1391
- onClickItem: () => onClickItem('descend'),
1392
- children: "\u964D\u9806\u3067\u4E26\u3073\u66FF\u3048"
1393
- }), sortOrder !== null && onClickDeselect && /*#__PURE__*/jsx("li", {
1394
- children: /*#__PURE__*/jsx("button", {
1395
- className: deselectButtonClasses,
1396
- type: "button",
1397
- onClick: onClickDeselect,
1398
- children: "\u9078\u629E\u89E3\u9664"
1399
- })
1400
- })]
1401
- });
1263
+ // src/select-sort/select-list.tsx
1264
+ var import_jsx_runtime30 = require("react/jsx-runtime");
1265
+ function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect }) {
1266
+ const listClasses = (0, import_clsx22.default)(
1267
+ "absolute z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow",
1268
+ {
1269
+ "top-7": size === "x-small" || size === "small",
1270
+ "top-9": size === "medium",
1271
+ "top-11": size === "large",
1272
+ "border-solid border border-uiBorder01": variant === "outline"
1273
+ }
1274
+ );
1275
+ const deselectButtonClasses = (0, import_clsx22.default)(
1276
+ "typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
1277
+ import_component_theme15.focusVisible.inset
1278
+ );
1279
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("ul", { className: listClasses, children: [
1280
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectItem2, { isSortKey: sortOrder === "ascend", onClickItem: () => onClickItem("ascend"), children: "\u6607\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
1281
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectItem2, { isSortKey: sortOrder === "descend", onClickItem: () => onClickItem("descend"), children: "\u964D\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
1282
+ sortOrder !== null && onClickDeselect && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { className: deselectButtonClasses, type: "button", onClick: onClickDeselect, children: "\u9078\u629E\u89E3\u9664" }) })
1283
+ ] });
1402
1284
  }
1403
1285
 
1286
+ // src/select-sort/select-sort.tsx
1287
+ var import_jsx_runtime31 = require("react/jsx-runtime");
1404
1288
  function SelectSort({
1405
- size = 'medium',
1406
- variant = 'outline',
1289
+ size = "medium",
1290
+ variant = "outline",
1407
1291
  width,
1408
1292
  label,
1409
1293
  sortOrder,
@@ -1412,127 +1296,133 @@ function SelectSort({
1412
1296
  onChange,
1413
1297
  onClickDeselect
1414
1298
  }) {
1415
- const [isOptionListOpen, setIsOptionListOpen] = useState(false);
1416
- const targetRef = useRef(null);
1299
+ const [isOptionListOpen, setIsOptionListOpen] = (0, import_react20.useState)(false);
1300
+ const targetRef = (0, import_react20.useRef)(null);
1417
1301
  useOutsideClick(targetRef, () => setIsOptionListOpen(false));
1418
- const handleClickToggle = () => setIsOptionListOpen(prev => !prev);
1419
- const handleClickItem = useCallback(value => {
1420
- onChange == null || onChange(value);
1421
- setIsOptionListOpen(false);
1422
- }, [onChange]);
1423
- const wrapperClasses = clsx$1('relative flex shrink-0 items-center gap-1 rounded', {
1424
- 'h-6': size === 'x-small' || size === 'small',
1425
- 'h-8': size === 'medium',
1426
- 'h-10': size === 'large',
1427
- 'cursor-not-allowed': isDisabled
1428
- });
1429
- const buttonClasses = clsx$1('flex size-full items-center rounded', buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, {
1430
- [buttonColors[variant].selected]: isSortKey,
1431
- [buttonColors[variant].base]: !isSortKey,
1432
- 'px-2': size === 'x-small' || size === 'small',
1433
- 'px-4': size === 'medium' || size === 'large',
1434
- 'pointer-events-none': isDisabled
1435
- });
1436
- const labelClasses = clsx$1('truncate', {
1437
- 'typography-label12regular': size === 'x-small',
1438
- 'typography-label14regular': size === 'small' || size === 'medium',
1439
- 'typography-label16regular': size === 'large',
1440
- 'mr-1': size === 'x-small',
1441
- 'mr-2': size !== 'x-small'
1442
- });
1443
- return /*#__PURE__*/jsxs("div", {
1444
- className: wrapperClasses,
1445
- style: {
1446
- width
1302
+ const handleClickToggle = () => setIsOptionListOpen((prev) => !prev);
1303
+ const handleClickItem = (0, import_react20.useCallback)(
1304
+ (value) => {
1305
+ onChange?.(value);
1306
+ setIsOptionListOpen(false);
1447
1307
  },
1448
- ref: targetRef,
1449
- children: [/*#__PURE__*/jsxs("button", {
1450
- className: buttonClasses,
1451
- type: "button",
1452
- onClick: handleClickToggle,
1453
- disabled: isDisabled,
1454
- children: [/*#__PURE__*/jsx("div", {
1455
- className: labelClasses,
1456
- children: label
1457
- }), /*#__PURE__*/jsx("div", {
1458
- className: "ml-auto flex items-center",
1459
- children: isSortKey ? /*#__PURE__*/jsx(Icon, {
1460
- name: sortOrder === 'ascend' ? 'arrow-up' : 'arrow-down',
1461
- size: size === 'large' ? 'medium' : 'small'
1462
- }) : /*#__PURE__*/jsx(Icon, {
1463
- name: isOptionListOpen ? 'angle-small-up' : 'angle-small-down',
1464
- size: size === 'large' ? 'medium' : 'small'
1465
- })
1466
- })]
1467
- }), isOptionListOpen && !isDisabled && /*#__PURE__*/jsx(SelectList, {
1468
- size: size,
1469
- variant: variant,
1470
- sortOrder: sortOrder,
1471
- onClickItem: handleClickItem,
1472
- onClickDeselect: onClickDeselect
1473
- })]
1474
- });
1308
+ [onChange]
1309
+ );
1310
+ const wrapperClasses = (0, import_clsx23.default)("relative flex shrink-0 items-center gap-1 rounded", {
1311
+ "h-6": size === "x-small" || size === "small",
1312
+ "h-8": size === "medium",
1313
+ "h-10": size === "large",
1314
+ "cursor-not-allowed": isDisabled
1315
+ });
1316
+ const buttonClasses = (0, import_clsx23.default)(
1317
+ "flex size-full items-center rounded",
1318
+ import_component_theme16.buttonColors[variant].hover,
1319
+ import_component_theme16.buttonColors[variant].active,
1320
+ import_component_theme16.buttonColors[variant].disabled,
1321
+ import_component_theme16.focusVisible.normal,
1322
+ {
1323
+ [import_component_theme16.buttonColors[variant].selected]: isSortKey,
1324
+ [import_component_theme16.buttonColors[variant].base]: !isSortKey,
1325
+ "px-2": size === "x-small" || size === "small",
1326
+ "px-4": size === "medium" || size === "large",
1327
+ "pointer-events-none": isDisabled
1328
+ }
1329
+ );
1330
+ const labelClasses = (0, import_clsx23.default)("truncate", {
1331
+ "typography-label12regular": size === "x-small",
1332
+ "typography-label14regular": size === "small" || size === "medium",
1333
+ "typography-label16regular": size === "large",
1334
+ "mr-1": size === "x-small",
1335
+ "mr-2": size !== "x-small"
1336
+ });
1337
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: wrapperClasses, style: { width }, ref: targetRef, children: [
1338
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { className: buttonClasses, type: "button", onClick: handleClickToggle, disabled: isDisabled, children: [
1339
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: labelClasses, children: label }),
1340
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "ml-auto flex items-center", children: isSortKey ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
1341
+ Icon,
1342
+ {
1343
+ name: sortOrder === "ascend" ? "arrow-up" : "arrow-down",
1344
+ size: size === "large" ? "medium" : "small"
1345
+ }
1346
+ ) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
1347
+ Icon,
1348
+ {
1349
+ name: isOptionListOpen ? "angle-small-up" : "angle-small-down",
1350
+ size: size === "large" ? "medium" : "small"
1351
+ }
1352
+ ) })
1353
+ ] }),
1354
+ isOptionListOpen && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
1355
+ SelectList2,
1356
+ {
1357
+ size,
1358
+ variant,
1359
+ sortOrder,
1360
+ onClickItem: handleClickItem,
1361
+ onClickDeselect
1362
+ }
1363
+ )
1364
+ ] });
1475
1365
  }
1476
1366
 
1477
- const _excluded$2 = ["isSelected"];
1478
- const TabItem = _ref => {
1479
- let {
1480
- isSelected = false
1481
- } = _ref,
1482
- props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
1483
- const classes = clsx('relative z-0 flex py-2 leading-[24px] before:absolute before:inset-x-0 before:bottom-0 before:h-px hover:text-text01 disabled:pointer-events-none disabled:text-disabled01', {
1484
- 'typography-label14regular': !isSelected,
1485
- 'text-interactive02 hover:before:bg-uiBorder04': !isSelected,
1486
- 'typography-label14bold': isSelected,
1487
- 'before:bg-interactive01 hover:before:bg-interactive01 pointer-events-none': isSelected
1488
- });
1489
- return /*#__PURE__*/jsx("button", {
1490
- type: "button",
1491
- role: "tab",
1492
- "aria-selected": isSelected,
1493
- className: classes,
1494
- disabled: props.isDisabled,
1495
- onClick: () => props.onClick(props.id),
1496
- children: props.children
1497
- });
1367
+ // src/tab/tab-item.tsx
1368
+ var import_clsx24 = require("clsx");
1369
+ var import_jsx_runtime32 = require("react/jsx-runtime");
1370
+ var TabItem = ({ isSelected = false, ...props }) => {
1371
+ const classes = (0, import_clsx24.clsx)(
1372
+ "relative z-0 flex py-2 leading-[24px] before:absolute before:inset-x-0 before:bottom-0 before:h-px hover:text-text01 disabled:pointer-events-none disabled:text-disabled01",
1373
+ {
1374
+ "typography-label14regular": !isSelected,
1375
+ "text-interactive02 hover:before:bg-uiBorder04": !isSelected,
1376
+ "typography-label14bold": isSelected,
1377
+ "before:bg-interactive01 hover:before:bg-interactive01 pointer-events-none": isSelected
1378
+ }
1379
+ );
1380
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1381
+ "button",
1382
+ {
1383
+ type: "button",
1384
+ role: "tab",
1385
+ "aria-selected": isSelected,
1386
+ className: classes,
1387
+ disabled: props.isDisabled,
1388
+ onClick: () => props.onClick(props.id),
1389
+ children: props.children
1390
+ }
1391
+ );
1498
1392
  };
1499
1393
 
1500
- function Tab({
1501
- children
1502
- }) {
1503
- return /*#__PURE__*/jsx("div", {
1504
- role: "tablist",
1505
- className: "relative flex gap-4 px-6 before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-uiBorder01",
1506
- children: children
1507
- });
1394
+ // src/tab/tab.tsx
1395
+ var import_jsx_runtime33 = require("react/jsx-runtime");
1396
+ function Tab({ children }) {
1397
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
1398
+ "div",
1399
+ {
1400
+ role: "tablist",
1401
+ className: "relative flex gap-4 px-6 before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-uiBorder01",
1402
+ children
1403
+ }
1404
+ );
1508
1405
  }
1509
1406
  Tab.Item = TabItem;
1510
1407
 
1511
- function TableCell({
1512
- children,
1513
- className,
1514
- isHeader = false
1515
- }) {
1516
- const classes = clsx$1('border-b border-uiBorder01', {
1517
- 'sticky top-0 z-10 bg-white': isHeader
1518
- }, className);
1519
- return /*#__PURE__*/jsx("div", {
1520
- className: classes,
1521
- children: children
1522
- });
1408
+ // src/table/table-cell.tsx
1409
+ var import_clsx25 = __toESM(require("clsx"));
1410
+ var import_jsx_runtime34 = require("react/jsx-runtime");
1411
+ function TableCell({ children, className, isHeader = false }) {
1412
+ const classes = (0, import_clsx25.default)("border-b border-uiBorder01", { "sticky top-0 z-10 bg-white": isHeader }, className);
1413
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: classes, children });
1523
1414
  }
1524
1415
 
1525
- function TableRow({
1526
- children,
1527
- isHoverBackgroundVisible = false
1528
- }) {
1529
- const rowClasses = clsx$1('contents', isHoverBackgroundVisible && '[&:hover>div]:bg-hoverUi02');
1530
- return /*#__PURE__*/jsx("div", {
1531
- className: rowClasses,
1532
- children: children
1533
- });
1416
+ // src/table/table-row.tsx
1417
+ var import_clsx26 = __toESM(require("clsx"));
1418
+ var import_jsx_runtime35 = require("react/jsx-runtime");
1419
+ function TableRow({ children, isHoverBackgroundVisible = false }) {
1420
+ const rowClasses = (0, import_clsx26.default)("contents", isHoverBackgroundVisible && "[&:hover>div]:bg-hoverUi02");
1421
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: rowClasses, children });
1534
1422
  }
1535
1423
 
1424
+ // src/table/table.tsx
1425
+ var import_jsx_runtime36 = require("react/jsx-runtime");
1536
1426
  function Table({
1537
1427
  width,
1538
1428
  templateRows,
@@ -1541,197 +1431,196 @@ function Table({
1541
1431
  autoRows,
1542
1432
  children
1543
1433
  }) {
1544
- return /*#__PURE__*/jsx("div", {
1545
- className: "grid",
1546
- style: {
1547
- width,
1548
- gridTemplateRows: templateRows,
1549
- gridTemplateColumns: templateColumns,
1550
- gridAutoColumns: autoColumns,
1551
- gridAutoRows: autoRows
1552
- },
1553
- children: children
1554
- });
1434
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
1435
+ "div",
1436
+ {
1437
+ className: "grid",
1438
+ style: {
1439
+ width,
1440
+ gridTemplateRows: templateRows,
1441
+ gridTemplateColumns: templateColumns,
1442
+ gridAutoColumns: autoColumns,
1443
+ gridAutoRows: autoRows
1444
+ },
1445
+ children
1446
+ }
1447
+ );
1555
1448
  }
1556
1449
  Table.Row = TableRow;
1557
1450
  Table.Cell = TableCell;
1558
1451
 
1559
- const DeleteIcon = ({
1560
- color,
1561
- variant,
1562
- onClick
1563
- }) => {
1564
- const deleteButtonClasses = clsx$1('group ml-2 size-[14px] rounded-full p-0.5 hover:cursor-pointer hover:bg-iconOnColor focus-visible:bg-iconOnColor', focusVisible.normal);
1565
- const deletePathClasses = clsx$1({
1566
- 'fill-interactive02': color === 'gray' || variant === 'light',
1567
- 'group-hover:fill-interactive02 group-focus-visible:fill-interactive02 fill-iconOnColor': color !== 'gray'
1568
- });
1569
- return /*#__PURE__*/jsx("button", {
1570
- type: "button",
1571
- className: deleteButtonClasses,
1572
- onClick: onClick,
1573
- children: /*#__PURE__*/jsx("svg", {
1574
- viewBox: "0 0 24 24",
1575
- xmlns: "http://www.w3.org/2000/svg",
1576
- children: /*#__PURE__*/jsx("path", {
1577
- fillRule: "evenodd",
1578
- clipRule: "evenodd",
1579
- d: "M19.7745 4.21818C19.384 3.82765 18.7508 3.82765 18.3603 4.21818L11.9963 10.5821L5.6324 4.21818C5.24187 3.82765 4.60871 3.82765 4.21818 4.21818C3.82766 4.6087 3.82766 5.24187 4.21818 5.63239L10.5821 11.9964L4.21818 18.3603C3.82766 18.7508 3.82766 19.384 4.21818 19.7745C4.60871 20.1651 5.24187 20.165 5.6324 19.7745L11.9963 13.4106L18.3603 19.7745C18.7508 20.165 19.384 20.1651 19.7745 19.7745C20.165 19.384 20.165 18.7508 19.7745 18.3603L13.4106 11.9964L19.7745 5.63239C20.165 5.24187 20.165 4.6087 19.7745 4.21818Z",
1580
- className: deletePathClasses
1581
- })
1582
- })
1583
- });
1452
+ // src/tag/tag.tsx
1453
+ var import_component_theme18 = require("@zenkigen-inc/component-theme");
1454
+ var import_clsx28 = __toESM(require("clsx"));
1455
+
1456
+ // src/tag/delete-icon.tsx
1457
+ var import_component_theme17 = require("@zenkigen-inc/component-theme");
1458
+ var import_clsx27 = __toESM(require("clsx"));
1459
+ var import_jsx_runtime37 = require("react/jsx-runtime");
1460
+ var DeleteIcon = ({ color, variant, onClick }) => {
1461
+ const deleteButtonClasses = (0, import_clsx27.default)(
1462
+ "group ml-2 size-[14px] rounded-full p-0.5 hover:cursor-pointer hover:bg-iconOnColor focus-visible:bg-iconOnColor",
1463
+ import_component_theme17.focusVisible.normal
1464
+ );
1465
+ const deletePathClasses = (0, import_clsx27.default)({
1466
+ "fill-interactive02": color === "gray" || variant === "light",
1467
+ "group-hover:fill-interactive02 group-focus-visible:fill-interactive02 fill-iconOnColor": color !== "gray"
1468
+ });
1469
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("button", { type: "button", className: deleteButtonClasses, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1470
+ "path",
1471
+ {
1472
+ fillRule: "evenodd",
1473
+ clipRule: "evenodd",
1474
+ d: "M19.7745 4.21818C19.384 3.82765 18.7508 3.82765 18.3603 4.21818L11.9963 10.5821L5.6324 4.21818C5.24187 3.82765 4.60871 3.82765 4.21818 4.21818C3.82766 4.6087 3.82766 5.24187 4.21818 5.63239L10.5821 11.9964L4.21818 18.3603C3.82766 18.7508 3.82766 19.384 4.21818 19.7745C4.60871 20.1651 5.24187 20.165 5.6324 19.7745L11.9963 13.4106L18.3603 19.7745C18.7508 20.165 19.384 20.1651 19.7745 19.7745C20.165 19.384 20.165 18.7508 19.7745 18.3603L13.4106 11.9964L19.7745 5.63239C20.165 5.24187 20.165 4.6087 19.7745 4.21818Z",
1475
+ className: deletePathClasses
1476
+ }
1477
+ ) }) });
1584
1478
  };
1585
1479
 
1586
- function Tag({
1587
- id,
1588
- children,
1589
- color,
1590
- variant = 'normal',
1591
- size = 'medium',
1592
- isEditable,
1593
- onDelete
1594
- }) {
1595
- const wrapperClasses = clsx$1('flex', 'items-center', 'justify-center', {
1596
- [tagColors[color]]: variant === 'normal',
1597
- [tagLightColors[color]]: variant === 'light',
1598
- 'h-[14px] typography-label11regular': !isEditable && size === 'x-small',
1599
- 'h-4 typography-label12regular': !isEditable && size === 'small',
1600
- 'h-[18px] typography-label14regular': !isEditable && size === 'medium',
1601
- 'h-[22px] typography-label14regular': isEditable && size === 'medium',
1602
- 'rounded-full': isEditable,
1480
+ // src/tag/tag.tsx
1481
+ var import_jsx_runtime38 = require("react/jsx-runtime");
1482
+ function Tag({ id, children, color, variant = "normal", size = "medium", isEditable, onDelete }) {
1483
+ const wrapperClasses = (0, import_clsx28.default)("flex", "items-center", "justify-center", {
1484
+ [import_component_theme18.tagColors[color]]: variant === "normal",
1485
+ [import_component_theme18.tagLightColors[color]]: variant === "light",
1486
+ "h-[14px] typography-label11regular": !isEditable && size === "x-small",
1487
+ "h-4 typography-label12regular": !isEditable && size === "small",
1488
+ "h-[18px] typography-label14regular": !isEditable && size === "medium",
1489
+ "h-[22px] typography-label14regular": isEditable && size === "medium",
1490
+ "rounded-full": isEditable,
1603
1491
  rounded: !isEditable,
1604
- 'py-0.5 px-1': !isEditable,
1605
- 'py-1 px-2': isEditable
1606
- });
1607
- return /*#__PURE__*/jsxs("div", {
1608
- className: wrapperClasses,
1609
- children: [children, isEditable ? /*#__PURE__*/jsx(DeleteIcon, {
1610
- onClick: () => onDelete(id),
1611
- color: color,
1612
- variant: variant
1613
- }) : null]
1492
+ "py-0.5 px-1": !isEditable,
1493
+ "py-1 px-2": isEditable
1614
1494
  });
1495
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: wrapperClasses, children: [
1496
+ children,
1497
+ isEditable ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DeleteIcon, { onClick: () => onDelete(id), color, variant }) : null
1498
+ ] });
1615
1499
  }
1616
1500
 
1617
- const _excluded$1 = ["size", "isResizable", "isError", "disabled"];
1618
- const TextArea = /*#__PURE__*/forwardRef((_ref, ref) => {
1619
- let {
1620
- size = 'medium',
1621
- isResizable = false,
1622
- isError = false,
1623
- disabled = false
1624
- } = _ref,
1625
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
1626
- const classes = clsx('w-full rounded border outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder', {
1627
- 'border-supportError': isError && !disabled,
1628
- 'hover:border-hoverInput': !disabled && !isError,
1629
- 'border-uiBorder02 hover:focus-within:border-activeInput focus-within:border-activeInput text-text01': !isError,
1630
- 'bg-disabled02 border-disabled01': disabled,
1631
- ['typography-body14regular px-2 pt-1.5 pb-2']: size === 'medium',
1632
- ['text-4 leading-normal px-3.5 py-2.5']: size === 'large',
1633
- 'text-supportError': isError,
1634
- 'resize-none': !isResizable
1635
- });
1636
- return /*#__PURE__*/jsx("div", {
1637
- className: "flex",
1638
- children: /*#__PURE__*/jsx("textarea", _extends({
1639
- ref: ref,
1640
- className: classes
1641
- }, props, {
1642
- disabled: disabled,
1643
- style: {
1644
- height: props.height
1501
+ // src/text-area/text-area.tsx
1502
+ var import_clsx29 = require("clsx");
1503
+ var import_react21 = require("react");
1504
+ var import_jsx_runtime39 = require("react/jsx-runtime");
1505
+ var TextArea = (0, import_react21.forwardRef)(
1506
+ ({
1507
+ size = "medium",
1508
+ isResizable = false,
1509
+ autoHeight = false,
1510
+ maxHeight,
1511
+ isError = false,
1512
+ disabled = false,
1513
+ height,
1514
+ ...props
1515
+ }, ref) => {
1516
+ const classes = (0, import_clsx29.clsx)(
1517
+ "w-full rounded border outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder",
1518
+ {
1519
+ "border-supportError": isError && !disabled,
1520
+ "hover:border-hoverInput": !disabled && !isError,
1521
+ "border-uiBorder02 hover:focus-within:border-activeInput focus-within:border-activeInput text-text01": !isError,
1522
+ "bg-disabled02 border-disabled01": disabled,
1523
+ "typography-body14regular px-2 pt-1.5 pb-2": size === "medium",
1524
+ "text-4 leading-normal px-3.5 py-2.5": size === "large",
1525
+ "field-sizing-content": autoHeight,
1526
+ "text-supportError": isError,
1527
+ "resize-none": !isResizable
1645
1528
  }
1646
- }))
1647
- });
1648
- });
1649
- TextArea.displayName = 'TextArea';
1650
-
1651
- const _excluded = ["size", "isError", "disabled", "onClickClearButton"];
1652
- const TextInput = /*#__PURE__*/forwardRef((_ref, ref) => {
1653
- let {
1654
- size = 'medium',
1655
- isError = false,
1656
- disabled = false,
1657
- onClickClearButton
1658
- } = _ref,
1659
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
1660
- const isShowClearButton = !!onClickClearButton && props.value.length !== 0 && !disabled;
1661
- const inputWrapClasses = clsx('relative flex items-center gap-2 overflow-hidden rounded border', {
1662
- 'border-uiBorder02': !isError && !disabled,
1663
- 'border-supportError': isError && !disabled,
1664
- 'hover:border-hoverInput': !disabled && !isError,
1665
- 'hover:focus-within:border-activeInput': !isError,
1666
- 'focus-within:border-activeInput': !isError,
1667
- 'bg-disabled02 border-disabled01': disabled,
1668
- 'pr-2': size === 'medium' && isShowClearButton,
1669
- 'pr-3': size === 'large' && isShowClearButton
1670
- });
1671
- const inputClasses = clsx('flex-1 outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder', {
1672
- ['typography-label14regular min-h-8 px-2']: size === 'medium',
1673
- ['typography-label16regular min-h-10 px-3']: size === 'large',
1674
- 'text-text01': !isError,
1675
- 'text-supportError': isError,
1676
- 'pr-0': isShowClearButton
1677
- });
1678
- return /*#__PURE__*/jsxs("div", {
1679
- className: inputWrapClasses,
1680
- children: [/*#__PURE__*/jsx("input", _extends({
1681
- ref: ref,
1682
- size: 1,
1683
- className: inputClasses,
1684
- disabled: disabled,
1685
- onChange: props.onChange
1686
- }, props)), isShowClearButton && /*#__PURE__*/jsx(IconButton, {
1687
- variant: "text",
1688
- icon: "close",
1689
- size: "small",
1690
- onClick: onClickClearButton
1691
- })]
1692
- });
1693
- });
1694
- TextInput.displayName = 'TextInput';
1529
+ );
1530
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
1531
+ "textarea",
1532
+ {
1533
+ ref,
1534
+ className: classes,
1535
+ ...props,
1536
+ style: {
1537
+ ...{ maxHeight },
1538
+ // 自動高さではない場合で、height 指定がある場合は設定する
1539
+ ...!autoHeight && height !== null ? { height } : {},
1540
+ // 自動高さの場合で、height が指定されている場合は、height を minHeight に設定する
1541
+ ...autoHeight && height !== null ? { minHeight: height } : {}
1542
+ }
1543
+ }
1544
+ ) });
1545
+ }
1546
+ );
1547
+ TextArea.displayName = "TextArea";
1548
+
1549
+ // src/text-input/text-input.tsx
1550
+ var import_clsx30 = require("clsx");
1551
+ var import_react22 = require("react");
1552
+ var import_jsx_runtime40 = require("react/jsx-runtime");
1553
+ var TextInput = (0, import_react22.forwardRef)(
1554
+ ({ size = "medium", isError = false, disabled = false, onClickClearButton, ...props }, ref) => {
1555
+ const isShowClearButton = !!onClickClearButton && props.value.length !== 0 && !disabled;
1556
+ const inputWrapClasses = (0, import_clsx30.clsx)("relative flex items-center gap-2 overflow-hidden rounded border", {
1557
+ "border-uiBorder02": !isError && !disabled,
1558
+ "border-supportError": isError && !disabled,
1559
+ "hover:border-hoverInput": !disabled && !isError,
1560
+ "hover:focus-within:border-activeInput": !isError,
1561
+ "focus-within:border-activeInput": !isError,
1562
+ "bg-disabled02 border-disabled01": disabled,
1563
+ "pr-2": size === "medium" && isShowClearButton,
1564
+ "pr-3": size === "large" && isShowClearButton
1565
+ });
1566
+ const inputClasses = (0, import_clsx30.clsx)("flex-1 outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder", {
1567
+ ["typography-label14regular min-h-8 px-2"]: size === "medium",
1568
+ ["typography-label16regular min-h-10 px-3"]: size === "large",
1569
+ "text-text01": !isError,
1570
+ "text-supportError": isError,
1571
+ "pr-0": isShowClearButton
1572
+ });
1573
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: inputWrapClasses, children: [
1574
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("input", { ref, size: 1, className: inputClasses, disabled, onChange: props.onChange, ...props }),
1575
+ isShowClearButton && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(IconButton, { variant: "text", icon: "close", size: "small", onClick: onClickClearButton })
1576
+ ] });
1577
+ }
1578
+ );
1579
+ TextInput.displayName = "TextInput";
1695
1580
 
1696
- const CLOSE_TIME_MSEC = 5000;
1581
+ // src/toast/toast.tsx
1582
+ var import_clsx31 = __toESM(require("clsx"));
1583
+ var import_react23 = require("react");
1584
+ var import_jsx_runtime41 = require("react/jsx-runtime");
1585
+ var CLOSE_TIME_MSEC = 5e3;
1697
1586
  function Toast({
1698
- state = 'information',
1699
- width = 'auto',
1587
+ state = "information",
1588
+ width = "auto",
1700
1589
  isAutoClose = false,
1701
1590
  isAnimation = false,
1702
1591
  children,
1703
1592
  onClickClose
1704
1593
  }) {
1705
- const [isRemoving, setIsRemoving] = useState(false);
1706
- const handleClose = useCallback(() => {
1594
+ const [isRemoving, setIsRemoving] = (0, import_react23.useState)(false);
1595
+ const handleClose = (0, import_react23.useCallback)(() => {
1707
1596
  if (isAnimation) {
1708
1597
  setIsRemoving(true);
1709
1598
  } else {
1710
1599
  onClickClose();
1711
1600
  }
1712
1601
  }, [isAnimation, onClickClose]);
1713
- const handleAnimationEnd = e => window.getComputedStyle(e.currentTarget).opacity === '0' && onClickClose();
1714
- const wrapperClasses = clsx$1('pointer-events-auto flex items-start gap-1 bg-white p-4 shadow-floatingShadow', {
1715
- ['animate-toast-in']: isAnimation && !isRemoving,
1716
- ['animate-toast-out opacity-0']: isAnimation && isRemoving
1602
+ const handleAnimationEnd = (e) => window.getComputedStyle(e.currentTarget).opacity === "0" && onClickClose();
1603
+ const wrapperClasses = (0, import_clsx31.default)("pointer-events-auto flex items-start gap-1 bg-white p-4 shadow-floatingShadow", {
1604
+ ["animate-toast-in"]: isAnimation && !isRemoving,
1605
+ ["animate-toast-out opacity-0"]: isAnimation && isRemoving
1717
1606
  });
1718
- const iconClasses = clsx$1('flex items-center', {
1719
- 'fill-supportSuccess': state === 'success',
1720
- 'fill-supportError': state === 'error',
1721
- 'fill-supportWarning': state === 'warning',
1722
- 'fill-supportInfo': state === 'information'
1607
+ const iconClasses = (0, import_clsx31.default)("flex items-center", {
1608
+ "fill-supportSuccess": state === "success",
1609
+ "fill-supportError": state === "error",
1610
+ "fill-supportWarning": state === "warning",
1611
+ "fill-supportInfo": state === "information"
1723
1612
  });
1724
- const textClasses = clsx$1('typography-body13regular flex-1 pt-[3px]', {
1725
- 'text-supportError': state === 'error',
1726
- 'text-text01': state === 'success' || state === 'warning' || state === 'information'
1613
+ const textClasses = (0, import_clsx31.default)("typography-body13regular flex-1 pt-[3px]", {
1614
+ "text-supportError": state === "error",
1615
+ "text-text01": state === "success" || state === "warning" || state === "information"
1727
1616
  });
1728
1617
  const iconName = {
1729
- success: 'success-filled',
1730
- error: 'attention',
1731
- warning: 'warning',
1732
- information: 'information-filled'
1618
+ success: "success-filled",
1619
+ error: "attention",
1620
+ warning: "warning",
1621
+ information: "information-filled"
1733
1622
  };
1734
- useEffect(() => {
1623
+ (0, import_react23.useEffect)(() => {
1735
1624
  const timer = window.setTimeout(() => {
1736
1625
  if (isAutoClose) {
1737
1626
  setIsRemoving(true);
@@ -1739,344 +1628,356 @@ function Toast({
1739
1628
  }, CLOSE_TIME_MSEC);
1740
1629
  return () => window.clearTimeout(timer);
1741
1630
  }, [isAutoClose]);
1742
- return /*#__PURE__*/jsxs("div", {
1743
- className: wrapperClasses,
1744
- style: {
1745
- width
1746
- },
1747
- onAnimationEnd: handleAnimationEnd,
1748
- children: [/*#__PURE__*/jsx("div", {
1749
- className: iconClasses,
1750
- children: /*#__PURE__*/jsx(Icon, {
1751
- name: iconName[state]
1752
- })
1753
- }), /*#__PURE__*/jsx("p", {
1754
- className: textClasses,
1755
- children: children
1756
- }), /*#__PURE__*/jsx(IconButton, {
1757
- icon: "close",
1758
- size: "medium",
1759
- variant: "text",
1760
- onClick: handleClose,
1761
- isNoPadding: true
1762
- })]
1763
- });
1631
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: wrapperClasses, style: { width }, onAnimationEnd: handleAnimationEnd, children: [
1632
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, { name: iconName[state] }) }),
1633
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: textClasses, children }),
1634
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(IconButton, { icon: "close", size: "medium", variant: "text", onClick: handleClose, isNoPadding: true })
1635
+ ] });
1764
1636
  }
1765
1637
 
1766
- const ToastContext = /*#__PURE__*/createContext({});
1767
- const ToastProvider = ({
1768
- children
1769
- }) => {
1770
- const [isClientRender, setIsClientRender] = useState(false);
1771
- const [toasts, setToasts] = useState([]);
1772
- const addToast = useCallback(({
1773
- message,
1774
- state
1775
- }) => {
1776
- setToasts(prev => [...prev, {
1777
- id: Math.trunc(Math.random() * 100000),
1778
- message,
1779
- state
1780
- }]);
1638
+ // src/toast/toast-provider.tsx
1639
+ var import_react24 = require("react");
1640
+ var import_react_dom3 = require("react-dom");
1641
+ var import_jsx_runtime42 = require("react/jsx-runtime");
1642
+ var ToastContext = (0, import_react24.createContext)({});
1643
+ var ToastProvider = ({ children }) => {
1644
+ const [isClientRender, setIsClientRender] = (0, import_react24.useState)(false);
1645
+ const [toasts, setToasts] = (0, import_react24.useState)([]);
1646
+ const addToast = (0, import_react24.useCallback)(({ message, state }) => {
1647
+ setToasts((prev) => [...prev, { id: Math.trunc(Math.random() * 1e5), message, state }]);
1781
1648
  }, []);
1782
- const removeToast = useCallback(id => {
1783
- setToasts(prev => prev.filter(snackbar => snackbar.id !== id));
1649
+ const removeToast = (0, import_react24.useCallback)((id) => {
1650
+ setToasts((prev) => prev.filter((snackbar) => snackbar.id !== id));
1784
1651
  }, []);
1785
- useEffect(() => {
1652
+ (0, import_react24.useEffect)(() => {
1786
1653
  setIsClientRender(true);
1787
1654
  }, []);
1788
- return /*#__PURE__*/jsxs(ToastContext.Provider, {
1789
- value: {
1790
- addToast,
1791
- removeToast
1792
- },
1793
- children: [children, isClientRender && /*#__PURE__*/createPortal(/*#__PURE__*/jsx("div", {
1794
- className: "pointer-events-none fixed bottom-0 left-0 z-toast mb-4 ml-4 flex w-full flex-col-reverse gap-[16px]",
1795
- children: toasts.map(({
1796
- id,
1797
- message,
1798
- state
1799
- }) => /*#__PURE__*/jsx(Toast, {
1800
- state: state,
1801
- isAutoClose: true,
1802
- isAnimation: true,
1803
- onClickClose: () => removeToast(id),
1804
- width: 475,
1805
- children: message
1806
- }, id))
1807
- }), document.body)]
1808
- });
1655
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(ToastContext.Provider, { value: { addToast, removeToast }, children: [
1656
+ children,
1657
+ isClientRender && (0, import_react_dom3.createPortal)(
1658
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "pointer-events-none fixed bottom-0 left-0 z-toast mb-4 ml-4 flex w-full flex-col-reverse gap-[16px]", children: toasts.map(({ id, message, state }) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Toast, { state, isAutoClose: true, isAnimation: true, onClickClose: () => removeToast(id), width: 475, children: message }, id)) }),
1659
+ document.body
1660
+ )
1661
+ ] });
1809
1662
  };
1810
- const useToast = () => {
1811
- return useContext(ToastContext);
1663
+ var useToast = () => {
1664
+ return (0, import_react24.useContext)(ToastContext);
1812
1665
  };
1813
1666
 
1667
+ // src/toggle/toggle.tsx
1668
+ var import_clsx32 = __toESM(require("clsx"));
1669
+ var import_jsx_runtime43 = require("react/jsx-runtime");
1814
1670
  function Toggle({
1815
1671
  id,
1816
- size = 'medium',
1672
+ size = "medium",
1817
1673
  isChecked,
1818
1674
  onChange,
1819
1675
  label,
1820
- labelPosition = 'right',
1676
+ labelPosition = "right",
1821
1677
  isDisabled = false
1822
1678
  }) {
1823
- const baseClasses = clsx$1('relative flex items-center rounded-full', {
1824
- 'bg-disabledOn': isDisabled && isChecked,
1825
- 'bg-disabled01': isDisabled && !isChecked,
1826
- 'bg-interactive01 peer-hover:bg-hover01': !isDisabled && isChecked,
1827
- 'bg-interactive02 peer-hover:bg-hoverGray': !isDisabled && !isChecked,
1828
- 'w-8 h-4 px-[3px]': size === 'small',
1829
- 'w-12 h-6 px-1': size === 'medium' || size === 'large'
1830
- });
1831
- const inputClasses = clsx$1('peer absolute inset-0 z-[1] opacity-0', isDisabled ? 'cursor-not-allowed' : 'cursor-pointer');
1832
- const indicatorClasses = clsx$1('rounded-full bg-iconOnColor', {
1833
- 'w-2.5 h-2.5': size === 'small',
1834
- 'w-4 h-4': size === 'medium' || size === 'large',
1835
- 'ml-auto': isChecked
1836
- });
1837
- const labelClasses = clsx$1('break-all', {
1838
- 'mr-2': labelPosition === 'left',
1839
- 'ml-2': labelPosition === 'right',
1840
- 'typography-label14regular': size === 'small' || size === 'medium',
1841
- 'typography-label16regular': size === 'large',
1842
- 'pointer-events-none cursor-not-allowed text-disabled01': isDisabled,
1843
- 'cursor-pointer text-text01': !isDisabled
1844
- });
1845
- return /*#__PURE__*/jsxs("div", {
1846
- className: "relative flex flex-[0_0_auto] items-center",
1847
- children: [label != null && labelPosition === 'left' && /*#__PURE__*/jsx("label", {
1848
- htmlFor: id,
1849
- className: labelClasses,
1850
- children: label
1851
- }), /*#__PURE__*/jsx("input", {
1852
- className: inputClasses,
1853
- type: "checkbox",
1854
- name: id,
1855
- id: id,
1856
- checked: isChecked,
1857
- onChange: onChange,
1858
- disabled: isDisabled
1859
- }), /*#__PURE__*/jsx("div", {
1860
- className: baseClasses,
1861
- children: /*#__PURE__*/jsx("span", {
1862
- className: indicatorClasses
1863
- })
1864
- }), label != null && labelPosition === 'right' && /*#__PURE__*/jsx("label", {
1865
- htmlFor: id,
1866
- className: labelClasses,
1867
- children: label
1868
- })]
1869
- });
1679
+ const baseClasses = (0, import_clsx32.default)("relative flex items-center rounded-full", {
1680
+ "bg-disabledOn": isDisabled && isChecked,
1681
+ "bg-disabled01": isDisabled && !isChecked,
1682
+ "bg-interactive01 peer-hover:bg-hover01": !isDisabled && isChecked,
1683
+ "bg-interactive02 peer-hover:bg-hoverGray": !isDisabled && !isChecked,
1684
+ "w-8 h-4 px-[3px]": size === "small",
1685
+ "w-12 h-6 px-1": size === "medium" || size === "large"
1686
+ });
1687
+ const inputClasses = (0, import_clsx32.default)(
1688
+ "peer absolute inset-0 z-[1] opacity-0",
1689
+ isDisabled ? "cursor-not-allowed" : "cursor-pointer"
1690
+ );
1691
+ const indicatorClasses = (0, import_clsx32.default)("rounded-full bg-iconOnColor", {
1692
+ "w-2.5 h-2.5": size === "small",
1693
+ "w-4 h-4": size === "medium" || size === "large",
1694
+ "ml-auto": isChecked
1695
+ });
1696
+ const labelClasses = (0, import_clsx32.default)("break-all", {
1697
+ "mr-2": labelPosition === "left",
1698
+ "ml-2": labelPosition === "right",
1699
+ "typography-label14regular": size === "small" || size === "medium",
1700
+ "typography-label16regular": size === "large",
1701
+ "pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
1702
+ "cursor-pointer text-text01": !isDisabled
1703
+ });
1704
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "relative flex flex-[0_0_auto] items-center", children: [
1705
+ label != null && labelPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("label", { htmlFor: id, className: labelClasses, children: label }),
1706
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
1707
+ "input",
1708
+ {
1709
+ className: inputClasses,
1710
+ type: "checkbox",
1711
+ name: id,
1712
+ id,
1713
+ checked: isChecked,
1714
+ onChange,
1715
+ disabled: isDisabled
1716
+ }
1717
+ ),
1718
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: baseClasses, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: indicatorClasses }) }),
1719
+ label != null && labelPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("label", { htmlFor: id, className: labelClasses, children: label })
1720
+ ] });
1870
1721
  }
1871
1722
 
1872
- const useTooltip = () => {
1873
- const calculatePosition = useCallback(args => {
1874
- var _args$maxWidth;
1875
- const result = {
1876
- maxWidth: 'none',
1877
- width: 'auto',
1878
- left: '0px',
1879
- top: '0px',
1880
- bottom: '0px',
1881
- translateX: '0',
1882
- translateY: '0'
1883
- };
1884
- result.maxWidth = (_args$maxWidth = args.maxWidth) != null ? _args$maxWidth : 'none';
1885
- const offsetH = args.tooltipSize === 'small' ? 11 : 22;
1886
- const targetHorizontalCenter = args.dimensions.right - (args.dimensions.right - args.dimensions.left) / 2;
1887
- const targetLeft = args.dimensions.left;
1888
- const targetRight = args.dimensions.right;
1889
- const targetWidth = args.dimensions.width;
1890
- switch (args.horizontalAlign) {
1891
- case 'center':
1892
- result.left = `${targetHorizontalCenter}px`;
1893
- result.translateX = '-50%';
1894
- break;
1895
- case 'left':
1896
- result.left = `${targetLeft - offsetH}px`;
1897
- result.translateX = `${targetWidth / 2}px`;
1898
- break;
1899
- case 'right':
1900
- result.left = `${targetRight + offsetH}px`;
1901
- result.translateX = `-${targetWidth / 2}px`;
1902
- break;
1903
- }
1904
- switch (args.verticalPosition) {
1905
- case 'bottom':
1906
- result.top = `${args.dimensions.top + args.dimensions.height + window.scrollY}px`;
1907
- result.bottom = 'unset';
1908
- break;
1909
- case 'top':
1910
- result.top = `${args.dimensions.top + window.scrollY}px`;
1911
- result.bottom = 'unset';
1912
- result.translateY = '-100%';
1913
- break;
1914
- }
1915
- return result;
1916
- }, []);
1723
+ // src/tooltip/tooltip.tsx
1724
+ var import_react26 = require("react");
1725
+ var import_react_dom4 = require("react-dom");
1726
+
1727
+ // src/tooltip/tooltip.hook.ts
1728
+ var import_react25 = require("react");
1729
+ var useTooltip = () => {
1730
+ const calculatePosition = (0, import_react25.useCallback)(
1731
+ (args) => {
1732
+ const result = {
1733
+ maxWidth: "none",
1734
+ width: "auto",
1735
+ left: "0px",
1736
+ top: "0px",
1737
+ bottom: "0px",
1738
+ translateX: "0",
1739
+ translateY: "0"
1740
+ };
1741
+ result.maxWidth = args.maxWidth ?? "none";
1742
+ const offsetH = args.tooltipSize === "small" ? 11 : 22;
1743
+ const targetHorizontalCenter = args.dimensions.right - (args.dimensions.right - args.dimensions.left) / 2;
1744
+ const targetLeft = args.dimensions.left;
1745
+ const targetRight = args.dimensions.right;
1746
+ const targetWidth = args.dimensions.width;
1747
+ switch (args.horizontalAlign) {
1748
+ case "center":
1749
+ result.left = `${targetHorizontalCenter}px`;
1750
+ result.translateX = "-50%";
1751
+ break;
1752
+ case "left":
1753
+ result.left = `${targetLeft - offsetH}px`;
1754
+ result.translateX = `${targetWidth / 2}px`;
1755
+ break;
1756
+ case "right":
1757
+ result.left = `${targetRight + offsetH}px`;
1758
+ result.translateX = `-${targetWidth / 2}px`;
1759
+ break;
1760
+ }
1761
+ switch (args.verticalPosition) {
1762
+ case "bottom":
1763
+ result.top = `${args.dimensions.top + args.dimensions.height + window.scrollY}px`;
1764
+ result.bottom = "unset";
1765
+ break;
1766
+ case "top":
1767
+ result.top = `${args.dimensions.top + window.scrollY}px`;
1768
+ result.bottom = "unset";
1769
+ result.translateY = "-100%";
1770
+ break;
1771
+ }
1772
+ return result;
1773
+ },
1774
+ []
1775
+ );
1917
1776
  return {
1918
1777
  calculatePosition
1919
1778
  };
1920
1779
  };
1921
1780
 
1922
- const TailIcon = props => {
1923
- const tailClasses = clsx$1('absolute fill-uiBackgroundTooltip', {
1924
- 'rotate-180': props.verticalPosition === 'bottom',
1925
- 'rotate-0': props.verticalPosition !== 'bottom',
1926
- '-top-1': props.verticalPosition === 'bottom' && props.size === 'small',
1927
- '-top-2': props.verticalPosition === 'bottom' && props.size !== 'small',
1928
- '-bottom-1': props.verticalPosition !== 'bottom' && props.size === 'small',
1929
- '-bottom-2': props.verticalPosition !== 'bottom' && props.size !== 'small',
1930
- 'right-2': props.horizontalAlign === 'right' && props.size === 'small',
1931
- 'right-4': props.horizontalAlign === 'right' && props.size !== 'small',
1932
- 'left-2': props.horizontalAlign === 'left' && props.size === 'small',
1933
- 'left-4': props.horizontalAlign === 'left' && props.size !== 'small',
1934
- 'left-1/2 -translate-x-1': props.horizontalAlign === 'center' && props.size === 'small',
1935
- 'left-1/2 -translate-x-2': props.horizontalAlign === 'center' && props.size !== 'small'
1936
- });
1937
- if (props.size === 'small') {
1938
- return /*#__PURE__*/jsx("svg", {
1939
- className: tailClasses,
1940
- width: "8",
1941
- height: "4",
1942
- viewBox: "0 0 8 4",
1943
- xmlns: "http://www.w3.org/2000/svg",
1944
- children: /*#__PURE__*/jsx("path", {
1945
- d: "M4 4L0 0H8L4 4Z"
1946
- })
1947
- });
1781
+ // src/tooltip/tooltip-content.tsx
1782
+ var import_clsx34 = __toESM(require("clsx"));
1783
+
1784
+ // src/tooltip/tail-icon.tsx
1785
+ var import_clsx33 = __toESM(require("clsx"));
1786
+ var import_jsx_runtime44 = require("react/jsx-runtime");
1787
+ var TailIcon = (props) => {
1788
+ const tailClasses = (0, import_clsx33.default)("absolute fill-uiBackgroundTooltip", {
1789
+ "rotate-180": props.verticalPosition === "bottom",
1790
+ "rotate-0": props.verticalPosition !== "bottom",
1791
+ "-top-1": props.verticalPosition === "bottom" && props.size === "small",
1792
+ "-top-2": props.verticalPosition === "bottom" && props.size !== "small",
1793
+ "-bottom-1": props.verticalPosition !== "bottom" && props.size === "small",
1794
+ "-bottom-2": props.verticalPosition !== "bottom" && props.size !== "small",
1795
+ "right-2": props.horizontalAlign === "right" && props.size === "small",
1796
+ "right-4": props.horizontalAlign === "right" && props.size !== "small",
1797
+ "left-2": props.horizontalAlign === "left" && props.size === "small",
1798
+ "left-4": props.horizontalAlign === "left" && props.size !== "small",
1799
+ "left-1/2 -translate-x-1": props.horizontalAlign === "center" && props.size === "small",
1800
+ "left-1/2 -translate-x-2": props.horizontalAlign === "center" && props.size !== "small"
1801
+ });
1802
+ if (props.size === "small") {
1803
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("svg", { className: tailClasses, width: "8", height: "4", viewBox: "0 0 8 4", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", { d: "M4 4L0 0H8L4 4Z" }) });
1948
1804
  } else {
1949
- return /*#__PURE__*/jsx("svg", {
1950
- className: tailClasses,
1951
- width: "14",
1952
- height: "8",
1953
- viewBox: "0 0 14 8",
1954
- fill: "none",
1955
- xmlns: "http://www.w3.org/2000/svg",
1956
- children: /*#__PURE__*/jsx("path", {
1957
- d: "M7 8L0 0H14L7 8Z"
1958
- })
1959
- });
1805
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
1806
+ "svg",
1807
+ {
1808
+ className: tailClasses,
1809
+ width: "14",
1810
+ height: "8",
1811
+ viewBox: "0 0 14 8",
1812
+ fill: "none",
1813
+ xmlns: "http://www.w3.org/2000/svg",
1814
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", { d: "M7 8L0 0H14L7 8Z" })
1815
+ }
1816
+ );
1960
1817
  }
1961
1818
  };
1962
1819
 
1963
- const TooltipContent = ({
1820
+ // src/tooltip/tooltip-content.tsx
1821
+ var import_jsx_runtime45 = require("react/jsx-runtime");
1822
+ var TooltipContent = ({
1964
1823
  content,
1965
1824
  horizontalAlign,
1966
1825
  verticalPosition,
1967
1826
  size,
1968
1827
  tooltipPosition,
1969
1828
  maxWidth,
1970
- isPortal: _isPortal = false
1829
+ isPortal = false
1971
1830
  }) => {
1972
- const tooltipWrapperClasses = clsx$1('absolute z-tooltip m-auto flex', {
1973
- 'top-0': !_isPortal && verticalPosition === 'top',
1974
- 'bottom-0': !_isPortal && verticalPosition === 'bottom',
1975
- 'justify-start': horizontalAlign === 'left',
1976
- 'justify-center': horizontalAlign === 'center',
1977
- 'justify-end': horizontalAlign === 'right',
1978
- 'w-[24px]': size === 'small',
1979
- 'w-[46px]': size !== 'small'
1980
- });
1981
- const tooltipBodyClasses = clsx$1('absolute z-tooltip inline-block w-max rounded bg-uiBackgroundTooltip text-textOnColor', {
1982
- 'typography-body12regular': size === 'small',
1983
- 'typography-body13regular': size === 'medium',
1984
- 'px-2 pb-1 pt-1.5': size === 'small',
1985
- 'px-4 py-3': size === 'medium',
1986
- 'bottom-2': verticalPosition !== 'bottom' && size === 'small',
1987
- 'bottom-3': verticalPosition !== 'bottom' && size === 'medium',
1988
- 'top-2': verticalPosition === 'bottom' && size === 'small',
1989
- 'top-3': verticalPosition === 'bottom' && size === 'medium'
1990
- });
1991
- const tooltipWrapperStyle = _isPortal ? _extends({
1992
- transform: `translate(${tooltipPosition.translateX}, ${tooltipPosition.translateY})`
1993
- }, tooltipPosition) : {};
1994
- return /*#__PURE__*/jsx("div", {
1995
- className: tooltipWrapperClasses,
1996
- style: tooltipWrapperStyle,
1997
- children: /*#__PURE__*/jsxs("div", {
1831
+ const tooltipWrapperClasses = (0, import_clsx34.default)("absolute z-tooltip m-auto flex", {
1832
+ "top-0": !isPortal && verticalPosition === "top",
1833
+ "bottom-0": !isPortal && verticalPosition === "bottom",
1834
+ "justify-start": horizontalAlign === "left",
1835
+ "justify-center": horizontalAlign === "center",
1836
+ "justify-end": horizontalAlign === "right",
1837
+ "w-[24px]": size === "small",
1838
+ "w-[46px]": size !== "small"
1839
+ });
1840
+ const tooltipBodyClasses = (0, import_clsx34.default)(
1841
+ "absolute z-tooltip inline-block w-max rounded bg-uiBackgroundTooltip text-textOnColor",
1842
+ {
1843
+ "typography-body12regular": size === "small",
1844
+ "typography-body13regular": size === "medium",
1845
+ "px-2 pb-1 pt-1.5": size === "small",
1846
+ "px-4 py-3": size === "medium",
1847
+ "bottom-2": verticalPosition !== "bottom" && size === "small",
1848
+ "bottom-3": verticalPosition !== "bottom" && size === "medium",
1849
+ "top-2": verticalPosition === "bottom" && size === "small",
1850
+ "top-3": verticalPosition === "bottom" && size === "medium"
1851
+ }
1852
+ );
1853
+ const tooltipWrapperStyle = isPortal ? {
1854
+ transform: `translate(${tooltipPosition.translateX}, ${tooltipPosition.translateY})`,
1855
+ ...tooltipPosition
1856
+ } : {};
1857
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: tooltipWrapperClasses, style: tooltipWrapperStyle, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
1858
+ "div",
1859
+ {
1998
1860
  className: tooltipBodyClasses,
1999
1861
  style: {
2000
1862
  maxWidth
2001
1863
  },
2002
- children: [content, /*#__PURE__*/jsx(TailIcon, {
2003
- size: size,
2004
- verticalPosition: verticalPosition,
2005
- horizontalAlign: horizontalAlign
2006
- })]
2007
- })
2008
- });
1864
+ children: [
1865
+ content,
1866
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TailIcon, { size, verticalPosition, horizontalAlign })
1867
+ ]
1868
+ }
1869
+ ) });
2009
1870
  };
2010
1871
 
1872
+ // src/tooltip/tooltip.tsx
1873
+ var import_jsx_runtime46 = require("react/jsx-runtime");
2011
1874
  function Tooltip({
2012
1875
  children,
2013
1876
  content,
2014
- size = 'small',
1877
+ size = "small",
2015
1878
  maxWidth,
2016
- verticalPosition = 'bottom',
2017
- horizontalAlign = 'center',
1879
+ verticalPosition = "bottom",
1880
+ horizontalAlign = "center",
2018
1881
  isDisabledHover = false,
2019
1882
  portalTarget
2020
1883
  }) {
2021
- const {
2022
- calculatePosition
2023
- } = useTooltip();
2024
- const [isVisible, setIsVisible] = useState(false);
2025
- const [tooltipPosition, setTooltipPosition] = useState({
2026
- maxWidth: 'none',
2027
- width: 'auto',
2028
- left: '0px',
2029
- top: '0px',
2030
- bottom: '0px',
2031
- translateX: '0',
2032
- translateY: '0'
2033
- });
2034
- const targetRef = useRef(null);
2035
- const handleMouseOverWrapper = useCallback(() => {
1884
+ const { calculatePosition } = useTooltip();
1885
+ const [isVisible, setIsVisible] = (0, import_react26.useState)(false);
1886
+ const [tooltipPosition, setTooltipPosition] = (0, import_react26.useState)({
1887
+ maxWidth: "none",
1888
+ width: "auto",
1889
+ left: "0px",
1890
+ top: "0px",
1891
+ bottom: "0px",
1892
+ translateX: "0",
1893
+ translateY: "0"
1894
+ });
1895
+ const targetRef = (0, import_react26.useRef)(null);
1896
+ const handleMouseOverWrapper = (0, import_react26.useCallback)(() => {
2036
1897
  if (isDisabledHover) {
2037
1898
  return;
2038
1899
  }
2039
1900
  setIsVisible(true);
2040
1901
  }, [isDisabledHover]);
2041
- const handleMouseOutWrapper = useCallback(() => {
1902
+ const handleMouseOutWrapper = (0, import_react26.useCallback)(() => {
2042
1903
  setIsVisible(false);
2043
1904
  }, []);
2044
- useEffect(() => {
2045
- var _targetRef$current;
1905
+ (0, import_react26.useEffect)(() => {
2046
1906
  if (targetRef.current === null) return;
2047
- const dimensions = (_targetRef$current = targetRef.current) == null ? void 0 : _targetRef$current.getBoundingClientRect();
2048
- const position = calculatePosition({
2049
- dimensions,
2050
- maxWidth,
2051
- verticalPosition,
2052
- horizontalAlign,
2053
- tooltipSize: size
2054
- });
1907
+ const dimensions = targetRef.current?.getBoundingClientRect();
1908
+ const position = calculatePosition({ dimensions, maxWidth, verticalPosition, horizontalAlign, tooltipSize: size });
2055
1909
  setTooltipPosition(position);
2056
1910
  }, [calculatePosition, horizontalAlign, maxWidth, size, verticalPosition]);
2057
- return /*#__PURE__*/jsxs("div", {
2058
- ref: targetRef,
2059
- className: "relative flex items-center justify-center",
2060
- onMouseOver: handleMouseOverWrapper,
2061
- onMouseLeave: handleMouseOutWrapper,
2062
- children: [children, isVisible && (portalTarget == null ? /*#__PURE__*/jsx(TooltipContent, {
2063
- content: content,
2064
- size: size,
2065
- maxWidth: maxWidth,
2066
- verticalPosition: verticalPosition,
2067
- horizontalAlign: horizontalAlign,
2068
- tooltipPosition: tooltipPosition
2069
- }) : (/*#__PURE__*/createPortal(/*#__PURE__*/jsx(TooltipContent, {
2070
- isPortal: true,
2071
- content: content,
2072
- size: size,
2073
- maxWidth: maxWidth,
2074
- verticalPosition: verticalPosition,
2075
- horizontalAlign: horizontalAlign,
2076
- tooltipPosition: tooltipPosition
2077
- }), portalTarget)))]
2078
- });
1911
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
1912
+ "div",
1913
+ {
1914
+ ref: targetRef,
1915
+ className: "relative flex items-center justify-center",
1916
+ onMouseOver: handleMouseOverWrapper,
1917
+ onMouseLeave: handleMouseOutWrapper,
1918
+ children: [
1919
+ children,
1920
+ isVisible && (portalTarget == null ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
1921
+ TooltipContent,
1922
+ {
1923
+ content,
1924
+ size,
1925
+ maxWidth,
1926
+ verticalPosition,
1927
+ horizontalAlign,
1928
+ tooltipPosition
1929
+ }
1930
+ ) : (0, import_react_dom4.createPortal)(
1931
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
1932
+ TooltipContent,
1933
+ {
1934
+ isPortal: true,
1935
+ content,
1936
+ size,
1937
+ maxWidth,
1938
+ verticalPosition,
1939
+ horizontalAlign,
1940
+ tooltipPosition
1941
+ }
1942
+ ),
1943
+ portalTarget
1944
+ ))
1945
+ ]
1946
+ }
1947
+ );
2079
1948
  }
2080
-
2081
- export { Avatar, Breadcrumb, Button, Checkbox, Dropdown, EvaluationStar, Heading, Icon, IconButton, Loading, Modal, NotificationInline, Pagination, PaginationSelect, Radio, Search, Select, SelectSort, Tab, TabItem, Table, TableCell, TableRow, Tag, TextArea, TextInput, Toast, ToastProvider, Toggle, Tooltip, useOutsideClick, useToast };
2082
- //# sourceMappingURL=index.js.map
1949
+ // Annotate the CommonJS export names for ESM import in node:
1950
+ 0 && (module.exports = {
1951
+ Avatar,
1952
+ Breadcrumb,
1953
+ Button,
1954
+ Checkbox,
1955
+ Dropdown,
1956
+ EvaluationStar,
1957
+ Heading,
1958
+ Icon,
1959
+ IconButton,
1960
+ Loading,
1961
+ Modal,
1962
+ NotificationInline,
1963
+ Pagination,
1964
+ PaginationSelect,
1965
+ Radio,
1966
+ Search,
1967
+ Select,
1968
+ SelectSort,
1969
+ Tab,
1970
+ TabItem,
1971
+ Table,
1972
+ TableCell,
1973
+ TableRow,
1974
+ Tag,
1975
+ TextArea,
1976
+ TextInput,
1977
+ Toast,
1978
+ ToastProvider,
1979
+ Toggle,
1980
+ Tooltip,
1981
+ useOutsideClick,
1982
+ useToast
1983
+ });