@serendie/ui 2.3.0-dev.202512090256 → 2.3.0-dev.202601080839
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/Button/Button.d.ts +12 -1
- package/dist/components/DatePicker/DatePicker.d.ts +7 -0
- package/dist/components/DatePicker/DatePicker.js +126 -116
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +7 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +43 -38
- package/dist/components/ModalDialog/ModalDialog.d.ts +2 -0
- package/dist/components/ModalDialog/ModalDialog.js +30 -28
- package/dist/components/Pagination/Pagination.js +66 -63
- package/dist/components/PasswordField/PasswordField.js +30 -29
- package/dist/components/Search/Search.d.ts +7 -0
- package/dist/components/Search/Search.js +43 -34
- package/dist/components/Select/Select.d.ts +7 -0
- package/dist/components/Select/Select.js +54 -51
- package/dist/components/TextArea/TextArea.js +23 -22
- package/dist/components/TextField/TextField.js +31 -31
- package/dist/hooks/useAutoPortalContainer.d.ts +21 -0
- package/dist/hooks/useAutoPortalContainer.js +16 -0
- package/dist/i18n/dictionary.d.ts +24 -0
- package/dist/i18n/dictionary.js +28 -4
- package/package.json +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { SerendieSymbolChevronLeft as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as C, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { SerendieSymbolChevronLeft as _, SerendieSymbolChevronRight as I } from "@serendie/symbols";
|
|
3
|
+
import N, { useState as j } from "react";
|
|
4
4
|
import { IconButton as m } from "../IconButton/IconButton.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
5
|
+
import { useTranslations as z } from "../../i18n/index.js";
|
|
6
|
+
import { sva as R } from "../../styled-system/css/sva.js";
|
|
7
|
+
import { PaginationRoot as w } from "../../node_modules/@ark-ui/react/dist/components/pagination/pagination-root.js";
|
|
8
|
+
import { cx as O } from "../../styled-system/css/cx.js";
|
|
9
|
+
import { PaginationContext as W } from "../../node_modules/@ark-ui/react/dist/components/pagination/pagination-context.js";
|
|
10
|
+
import { PaginationPrevTrigger as F } from "../../node_modules/@ark-ui/react/dist/components/pagination/pagination-prev-trigger.js";
|
|
11
|
+
import { PaginationItem as L } from "../../node_modules/@ark-ui/react/dist/components/pagination/pagination-item.js";
|
|
12
|
+
import { PaginationEllipsis as B } from "../../node_modules/@ark-ui/react/dist/components/pagination/pagination-ellipsis.js";
|
|
13
|
+
import { PaginationNextTrigger as E } from "../../node_modules/@ark-ui/react/dist/components/pagination/pagination-next-trigger.js";
|
|
14
|
+
const M = R({
|
|
14
15
|
slots: ["root", "item", "ellipsis", "prevTrigger", "nextTrigger"],
|
|
15
16
|
base: {
|
|
16
17
|
root: {
|
|
@@ -80,102 +81,104 @@ const L = N({
|
|
|
80
81
|
defaultVariants: {
|
|
81
82
|
size: "medium"
|
|
82
83
|
}
|
|
83
|
-
}),
|
|
84
|
+
}), Z = N.forwardRef(
|
|
84
85
|
({
|
|
85
86
|
count: d,
|
|
86
|
-
pageSize:
|
|
87
|
-
page:
|
|
88
|
-
onPageChange:
|
|
89
|
-
siblingCount:
|
|
90
|
-
className:
|
|
91
|
-
size:
|
|
92
|
-
...
|
|
93
|
-
},
|
|
94
|
-
const [b,
|
|
87
|
+
pageSize: p = 1,
|
|
88
|
+
page: r,
|
|
89
|
+
onPageChange: l,
|
|
90
|
+
siblingCount: h = 2,
|
|
91
|
+
className: y,
|
|
92
|
+
size: f = "medium",
|
|
93
|
+
...u
|
|
94
|
+
}, P) => {
|
|
95
|
+
const [b, v] = j(1), a = M({ size: f }), x = (t) => {
|
|
96
|
+
r || v(t.page), l == null || l(t);
|
|
97
|
+
}, i = z(), T = {
|
|
95
98
|
count: d,
|
|
96
|
-
pageSize:
|
|
97
|
-
siblingCount:
|
|
98
|
-
...
|
|
99
|
-
onPageChange:
|
|
100
|
-
o || P(t.page), n == null || n(t);
|
|
101
|
-
}
|
|
99
|
+
pageSize: p,
|
|
100
|
+
siblingCount: h,
|
|
101
|
+
...r ? { page: r } : { page: b },
|
|
102
|
+
onPageChange: x
|
|
102
103
|
};
|
|
103
104
|
return /* @__PURE__ */ e(
|
|
104
|
-
|
|
105
|
+
w,
|
|
105
106
|
{
|
|
106
|
-
ref:
|
|
107
|
-
className:
|
|
108
|
-
...
|
|
109
|
-
...
|
|
110
|
-
children: /* @__PURE__ */ e(
|
|
111
|
-
const
|
|
112
|
-
return /* @__PURE__ */
|
|
107
|
+
ref: P,
|
|
108
|
+
className: O(a.root, y),
|
|
109
|
+
...T,
|
|
110
|
+
...u,
|
|
111
|
+
children: /* @__PURE__ */ e(W, { children: (t) => {
|
|
112
|
+
const n = t.page <= 1, S = Math.ceil(d / p), o = t.page >= S;
|
|
113
|
+
return /* @__PURE__ */ C(c, { children: [
|
|
113
114
|
/* @__PURE__ */ e(
|
|
114
|
-
|
|
115
|
+
F,
|
|
115
116
|
{
|
|
116
|
-
className:
|
|
117
|
-
disabled:
|
|
117
|
+
className: a.prevTrigger,
|
|
118
|
+
disabled: n,
|
|
118
119
|
asChild: !0,
|
|
119
120
|
children: /* @__PURE__ */ e(
|
|
120
121
|
m,
|
|
121
122
|
{
|
|
122
|
-
icon: /* @__PURE__ */ e(
|
|
123
|
+
icon: /* @__PURE__ */ e(_, {}),
|
|
123
124
|
shape: "rectangle",
|
|
124
125
|
styleType: "ghost",
|
|
125
126
|
size: "small",
|
|
126
|
-
"aria-label":
|
|
127
|
-
disabled:
|
|
128
|
-
title:
|
|
127
|
+
"aria-label": i(n ? "pagination.firstPage" : "pagination.previousPage"),
|
|
128
|
+
disabled: n,
|
|
129
|
+
title: i(n ? "pagination.firstPage" : "pagination.previousPage")
|
|
129
130
|
}
|
|
130
131
|
)
|
|
131
132
|
}
|
|
132
133
|
),
|
|
133
134
|
t.pages.map(
|
|
134
|
-
(s,
|
|
135
|
-
|
|
135
|
+
(s, g) => s.type === "page" ? /* @__PURE__ */ e(
|
|
136
|
+
L,
|
|
136
137
|
{
|
|
137
138
|
...s,
|
|
138
|
-
className:
|
|
139
|
+
className: a.item,
|
|
139
140
|
asChild: !0,
|
|
140
141
|
children: /* @__PURE__ */ e(
|
|
141
142
|
m,
|
|
142
143
|
{
|
|
143
|
-
icon: /* @__PURE__ */ e(
|
|
144
|
+
icon: /* @__PURE__ */ e(c, { children: s.value }),
|
|
144
145
|
shape: "rectangle",
|
|
145
146
|
styleType: "ghost",
|
|
146
147
|
size: "small",
|
|
147
|
-
"aria-label":
|
|
148
|
-
|
|
148
|
+
"aria-label": i("pagination.goToPage", {
|
|
149
|
+
page: s.value
|
|
150
|
+
}),
|
|
151
|
+
title: i("pagination.goToPage", { page: s.value })
|
|
149
152
|
}
|
|
150
153
|
)
|
|
151
154
|
},
|
|
152
|
-
|
|
155
|
+
g
|
|
153
156
|
) : /* @__PURE__ */ e(
|
|
154
|
-
|
|
157
|
+
B,
|
|
155
158
|
{
|
|
156
|
-
index:
|
|
157
|
-
className:
|
|
159
|
+
index: g,
|
|
160
|
+
className: a.ellipsis,
|
|
158
161
|
children: "…"
|
|
159
162
|
},
|
|
160
|
-
|
|
163
|
+
g
|
|
161
164
|
)
|
|
162
165
|
),
|
|
163
166
|
/* @__PURE__ */ e(
|
|
164
|
-
|
|
167
|
+
E,
|
|
165
168
|
{
|
|
166
|
-
className:
|
|
167
|
-
disabled:
|
|
169
|
+
className: a.nextTrigger,
|
|
170
|
+
disabled: o,
|
|
168
171
|
asChild: !0,
|
|
169
172
|
children: /* @__PURE__ */ e(
|
|
170
173
|
m,
|
|
171
174
|
{
|
|
172
|
-
icon: /* @__PURE__ */ e(
|
|
175
|
+
icon: /* @__PURE__ */ e(I, {}),
|
|
173
176
|
shape: "rectangle",
|
|
174
177
|
styleType: "ghost",
|
|
175
178
|
size: "small",
|
|
176
|
-
"aria-label":
|
|
177
|
-
disabled:
|
|
178
|
-
title:
|
|
179
|
+
"aria-label": i(o ? "pagination.lastPage" : "pagination.nextPage"),
|
|
180
|
+
disabled: o,
|
|
181
|
+
title: i(o ? "pagination.lastPage" : "pagination.nextPage")
|
|
179
182
|
}
|
|
180
183
|
)
|
|
181
184
|
}
|
|
@@ -187,6 +190,6 @@ const L = N({
|
|
|
187
190
|
}
|
|
188
191
|
);
|
|
189
192
|
export {
|
|
190
|
-
|
|
191
|
-
|
|
193
|
+
Z as Pagination,
|
|
194
|
+
M as PaginationStyle
|
|
192
195
|
};
|
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { TextField as
|
|
4
|
-
import { SerendieSymbolEyeHidden as
|
|
5
|
-
import { IconButton as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { forwardRef as m, useState as p } from "react";
|
|
3
|
+
import { TextField as w } from "../TextField/TextField.js";
|
|
4
|
+
import { SerendieSymbolEyeHidden as y, SerendieSymbolEye as c } from "@serendie/symbols";
|
|
5
|
+
import { IconButton as f } from "../IconButton/IconButton.js";
|
|
6
|
+
import { useTranslations as g } from "../../i18n/index.js";
|
|
7
|
+
const P = m(
|
|
8
|
+
({ disableToggle: r = !1, disabled: t, ...i }, a) => {
|
|
9
|
+
const e = g(), [s, d] = p(!1), l = r ? void 0 : /* @__PURE__ */ o(
|
|
10
|
+
f,
|
|
11
|
+
{
|
|
12
|
+
type: "button",
|
|
13
|
+
onClick: () => {
|
|
14
|
+
d((n) => !n);
|
|
15
|
+
},
|
|
16
|
+
styleType: "ghost",
|
|
17
|
+
size: "small",
|
|
18
|
+
shape: "circle",
|
|
19
|
+
"aria-label": e(s ? "passwordField.hidePassword" : "passwordField.showPassword"),
|
|
20
|
+
disabled: t,
|
|
21
|
+
icon: s ? /* @__PURE__ */ o(y, {}) : /* @__PURE__ */ o(c, {})
|
|
22
|
+
}
|
|
23
|
+
);
|
|
9
24
|
return /* @__PURE__ */ o(
|
|
10
|
-
|
|
25
|
+
w,
|
|
11
26
|
{
|
|
12
|
-
type:
|
|
13
|
-
rightContent:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
onClick: () => {
|
|
18
|
-
l((a) => !a);
|
|
19
|
-
},
|
|
20
|
-
styleType: "ghost",
|
|
21
|
-
size: "small",
|
|
22
|
-
shape: "circle",
|
|
23
|
-
"aria-label": t ? "パスワードを隠す" : "パスワードを表示",
|
|
24
|
-
disabled: e,
|
|
25
|
-
icon: t ? /* @__PURE__ */ o(p, {}) : /* @__PURE__ */ o(y, {})
|
|
26
|
-
}
|
|
27
|
-
),
|
|
28
|
-
disabled: e,
|
|
29
|
-
...r,
|
|
30
|
-
ref: i
|
|
27
|
+
type: s ? "text" : "password",
|
|
28
|
+
rightContent: l,
|
|
29
|
+
disabled: t,
|
|
30
|
+
...i,
|
|
31
|
+
ref: a
|
|
31
32
|
}
|
|
32
33
|
);
|
|
33
34
|
}
|
|
34
35
|
);
|
|
35
|
-
|
|
36
|
+
P.displayName = "PasswordField";
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
P as PasswordField
|
|
38
39
|
};
|
|
@@ -48,6 +48,13 @@ export declare const SearchStyle: import('../../../styled-system/types').SlotRec
|
|
|
48
48
|
}>;
|
|
49
49
|
type SearchStyleProps = ComboboxRootProps<string> & RecipeVariantProps<typeof SearchStyle> & {
|
|
50
50
|
items?: string[];
|
|
51
|
+
/**
|
|
52
|
+
* Portalを使用するかどうか
|
|
53
|
+
* - `true` (デフォルト): body直下にポータルする。ModalDialog/Drawer内にある場合は自動的にそのコンテンツ内にポータルされる
|
|
54
|
+
* - `false`: ポータルを使用せず、その場にレンダリングする
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
portalled?: boolean;
|
|
51
58
|
};
|
|
52
59
|
export declare const Search: React.FC<SearchStyleProps>;
|
|
53
60
|
export {};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { SerendieSymbolMagnifyingGlass as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
2
|
+
import { SerendieSymbolMagnifyingGlass as x, SerendieSymbolClose as b } from "@serendie/symbols";
|
|
3
|
+
import { useAutoPortalContainer as u } from "../../hooks/useAutoPortalContainer.js";
|
|
4
|
+
import { createListCollection as f } from "../../node_modules/@ark-ui/react/dist/components/collection/list-collection.js";
|
|
5
|
+
import { Portal as h } from "../../node_modules/@ark-ui/react/dist/components/portal/portal.js";
|
|
6
|
+
import { Box as S } from "../../styled-system/jsx/box.js";
|
|
7
|
+
import { sva as C } from "../../styled-system/css/sva.js";
|
|
8
|
+
import { ComboboxRoot as w } from "../../node_modules/@ark-ui/react/dist/components/combobox/combobox-root.js";
|
|
9
|
+
import { ComboboxControl as I } from "../../node_modules/@ark-ui/react/dist/components/combobox/combobox-control.js";
|
|
10
|
+
import { cx as v } from "../../styled-system/css/cx.js";
|
|
11
|
+
import { ComboboxInput as B } from "../../node_modules/@ark-ui/react/dist/components/combobox/combobox-input.js";
|
|
12
|
+
import { ComboboxTrigger as N } from "../../node_modules/@ark-ui/react/dist/components/combobox/combobox-trigger.js";
|
|
13
|
+
import { ComboboxPositioner as R } from "../../node_modules/@ark-ui/react/dist/components/combobox/combobox-positioner.js";
|
|
14
|
+
import { ComboboxContent as _ } from "../../node_modules/@ark-ui/react/dist/components/combobox/combobox-content.js";
|
|
15
|
+
import { ComboboxItemGroup as P } from "../../node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group.js";
|
|
16
|
+
import { ComboboxItem as E } from "../../node_modules/@ark-ui/react/dist/components/combobox/combobox-item.js";
|
|
17
|
+
import { ComboboxItemText as T } from "../../node_modules/@ark-ui/react/dist/components/combobox/combobox-item-text.js";
|
|
18
|
+
const d = C({
|
|
18
19
|
slots: [
|
|
19
20
|
"input",
|
|
20
21
|
"control",
|
|
@@ -143,16 +144,17 @@ const d = u({
|
|
|
143
144
|
defaultVariants: {
|
|
144
145
|
size: "medium"
|
|
145
146
|
}
|
|
146
|
-
}),
|
|
147
|
+
}), X = ({
|
|
147
148
|
items: i = [],
|
|
148
|
-
|
|
149
|
+
portalled: t = !0,
|
|
150
|
+
...r
|
|
149
151
|
}) => {
|
|
150
|
-
const [
|
|
152
|
+
const [l, c] = d.splitVariantProps(r), s = d(l), { collection: L, ...n } = c, { triggerRef: p, portalContainerRef: g } = u(t), m = f({ items: i });
|
|
151
153
|
return /* @__PURE__ */ e(
|
|
152
|
-
|
|
154
|
+
w,
|
|
153
155
|
{
|
|
154
|
-
...
|
|
155
|
-
collection:
|
|
156
|
+
...n,
|
|
157
|
+
collection: m,
|
|
156
158
|
lazyMount: !0,
|
|
157
159
|
unmountOnExit: !0,
|
|
158
160
|
positioning: {
|
|
@@ -162,34 +164,41 @@ const d = u({
|
|
|
162
164
|
}
|
|
163
165
|
},
|
|
164
166
|
children: [
|
|
165
|
-
/* @__PURE__ */ e(
|
|
166
|
-
|
|
167
|
-
/* @__PURE__ */ o(C, { className: s.input }),
|
|
168
|
-
i.length > 0 && /* @__PURE__ */ o(w, { children: /* @__PURE__ */ o("div", { className: s.closeIcon, children: /* @__PURE__ */ o(g, { className: s.icon }) }) })
|
|
169
|
-
] }),
|
|
170
|
-
/* @__PURE__ */ o(x, { children: /* @__PURE__ */ o(I, { children: /* @__PURE__ */ o(v, { className: s.combobox, children: /* @__PURE__ */ o(B, { id: "framework", children: n.items.map((m, c) => /* @__PURE__ */ e(
|
|
171
|
-
N,
|
|
167
|
+
/* @__PURE__ */ e(
|
|
168
|
+
I,
|
|
172
169
|
{
|
|
173
|
-
|
|
170
|
+
className: v(s.control, n.className),
|
|
171
|
+
ref: p,
|
|
172
|
+
children: [
|
|
173
|
+
/* @__PURE__ */ o("div", { className: s.iconBox, children: /* @__PURE__ */ o(x, { className: s.icon }) }),
|
|
174
|
+
/* @__PURE__ */ o(B, { className: s.input }),
|
|
175
|
+
i.length > 0 && /* @__PURE__ */ o(N, { children: /* @__PURE__ */ o("div", { className: s.closeIcon, children: /* @__PURE__ */ o(b, { className: s.icon }) }) })
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
/* @__PURE__ */ o(h, { disabled: !t, container: g, children: /* @__PURE__ */ o(R, { children: /* @__PURE__ */ o(_, { className: s.combobox, children: /* @__PURE__ */ o(P, { id: "framework", children: m.items.map((a, y) => /* @__PURE__ */ e(
|
|
180
|
+
E,
|
|
181
|
+
{
|
|
182
|
+
item: a,
|
|
174
183
|
className: s.comboboxItem,
|
|
175
184
|
children: [
|
|
176
185
|
/* @__PURE__ */ o(
|
|
177
|
-
|
|
186
|
+
S,
|
|
178
187
|
{
|
|
179
188
|
w: "sd.system.dimension.spacing.large",
|
|
180
189
|
h: "sd.system.dimension.spacing.large"
|
|
181
190
|
}
|
|
182
191
|
),
|
|
183
|
-
/* @__PURE__ */ o(
|
|
192
|
+
/* @__PURE__ */ o(T, { children: a })
|
|
184
193
|
]
|
|
185
194
|
},
|
|
186
|
-
|
|
195
|
+
y
|
|
187
196
|
)) }) }) }) })
|
|
188
197
|
]
|
|
189
198
|
}
|
|
190
199
|
);
|
|
191
200
|
};
|
|
192
201
|
export {
|
|
193
|
-
|
|
202
|
+
X as Search,
|
|
194
203
|
d as SearchStyle
|
|
195
204
|
};
|
|
@@ -58,6 +58,13 @@ type Props = {
|
|
|
58
58
|
invalidMessage?: string;
|
|
59
59
|
items?: selectItem[];
|
|
60
60
|
collection?: SelectRootProps<selectItem>["collection"];
|
|
61
|
+
/**
|
|
62
|
+
* Portalを使用するかどうか
|
|
63
|
+
* - `true` (デフォルト): body直下にポータルする。ModalDialog/Drawer内にある場合は自動的にそのコンテンツ内にポータルされる
|
|
64
|
+
* - `false`: ポータルを使用せず、その場にレンダリングする
|
|
65
|
+
* @default true
|
|
66
|
+
*/
|
|
67
|
+
portalled?: boolean;
|
|
61
68
|
};
|
|
62
69
|
type selectItem = {
|
|
63
70
|
label: string;
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { SerendieSymbolChevronDown as
|
|
3
|
-
import { List as
|
|
4
|
-
import { ListItem as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
2
|
+
import { SerendieSymbolChevronDown as C } from "@serendie/symbols";
|
|
3
|
+
import { List as T } from "../List/List.js";
|
|
4
|
+
import { ListItem as N } from "../List/ListItem.js";
|
|
5
|
+
import { useAutoPortalContainer as R } from "../../hooks/useAutoPortalContainer.js";
|
|
6
|
+
import { useTranslations as z } from "../../i18n/index.js";
|
|
7
|
+
import { createListCollection as P } from "../../node_modules/@ark-ui/react/dist/components/collection/list-collection.js";
|
|
8
|
+
import { Portal as V } from "../../node_modules/@ark-ui/react/dist/components/portal/portal.js";
|
|
9
|
+
import { sva as L } from "../../styled-system/css/sva.js";
|
|
10
|
+
import { SelectRoot as B } from "../../node_modules/@ark-ui/react/dist/components/select/select-root.js";
|
|
11
|
+
import { cx as I } from "../../styled-system/css/cx.js";
|
|
12
|
+
import { SelectLabel as A } from "../../node_modules/@ark-ui/react/dist/components/select/select-label.js";
|
|
13
|
+
import { css as r } from "../../styled-system/css/css.js";
|
|
14
|
+
import { SelectControl as O } from "../../node_modules/@ark-ui/react/dist/components/select/select-control.js";
|
|
15
|
+
import { SelectTrigger as j } from "../../node_modules/@ark-ui/react/dist/components/select/select-trigger.js";
|
|
16
|
+
import { SelectValueText as W } from "../../node_modules/@ark-ui/react/dist/components/select/select-value-text.js";
|
|
17
|
+
import { SelectPositioner as E } from "../../node_modules/@ark-ui/react/dist/components/select/select-positioner.js";
|
|
18
|
+
import { SelectContent as k } from "../../node_modules/@ark-ui/react/dist/components/select/select-content.js";
|
|
19
|
+
import { SelectItem as q } from "../../node_modules/@ark-ui/react/dist/components/select/select-item.js";
|
|
20
|
+
const c = L({
|
|
19
21
|
slots: ["root", "valueText", "trigger", "content", "item", "iconBox"],
|
|
20
22
|
base: {
|
|
21
23
|
root: {
|
|
@@ -156,29 +158,30 @@ const l = T({
|
|
|
156
158
|
defaultVariants: {
|
|
157
159
|
size: "medium"
|
|
158
160
|
}
|
|
159
|
-
}),
|
|
160
|
-
placeholder:
|
|
161
|
-
label:
|
|
162
|
-
required:
|
|
163
|
-
requiredLabel:
|
|
164
|
-
invalid:
|
|
161
|
+
}), de = ({
|
|
162
|
+
placeholder: p = "",
|
|
163
|
+
label: a,
|
|
164
|
+
required: y,
|
|
165
|
+
requiredLabel: g,
|
|
166
|
+
invalid: d,
|
|
165
167
|
invalidMessage: m,
|
|
166
|
-
className:
|
|
167
|
-
items:
|
|
168
|
-
|
|
168
|
+
className: u,
|
|
169
|
+
items: x = [],
|
|
170
|
+
portalled: n = !0,
|
|
171
|
+
...h
|
|
169
172
|
}) => {
|
|
170
|
-
const [t,
|
|
171
|
-
items:
|
|
173
|
+
const b = z(), [t, f] = c.splitVariantProps(h), o = c(t), { collection: D, ...S } = f, { triggerRef: v, portalContainerRef: w } = R(n), l = P({
|
|
174
|
+
items: x,
|
|
172
175
|
itemToString: (s) => s.label,
|
|
173
176
|
itemToValue: (s) => s.value
|
|
174
177
|
});
|
|
175
178
|
return /* @__PURE__ */ i(
|
|
176
|
-
|
|
179
|
+
B,
|
|
177
180
|
{
|
|
178
|
-
...
|
|
179
|
-
collection:
|
|
180
|
-
invalid:
|
|
181
|
-
className:
|
|
181
|
+
...S,
|
|
182
|
+
collection: l,
|
|
183
|
+
invalid: d,
|
|
184
|
+
className: I(o.root, u),
|
|
182
185
|
positioning: {
|
|
183
186
|
sameWidth: !0,
|
|
184
187
|
offset: {
|
|
@@ -187,45 +190,45 @@ const l = T({
|
|
|
187
190
|
}
|
|
188
191
|
},
|
|
189
192
|
children: [
|
|
190
|
-
|
|
193
|
+
a && t.size != "small" && // smallの場合はラベルを表示しない
|
|
191
194
|
/* @__PURE__ */ i(
|
|
192
|
-
|
|
195
|
+
A,
|
|
193
196
|
{
|
|
194
|
-
className:
|
|
197
|
+
className: r({
|
|
195
198
|
textStyle: {
|
|
196
199
|
base: "sd.system.typography.label.medium_compact",
|
|
197
200
|
expanded: "sd.system.typography.label.medium_expanded"
|
|
198
201
|
}
|
|
199
202
|
}),
|
|
200
203
|
children: [
|
|
201
|
-
|
|
202
|
-
|
|
204
|
+
a,
|
|
205
|
+
y && /* @__PURE__ */ e(
|
|
203
206
|
"span",
|
|
204
207
|
{
|
|
205
|
-
className:
|
|
208
|
+
className: r({
|
|
206
209
|
pl: "sd.system.dimension.spacing.extraSmall",
|
|
207
210
|
color: "sd.system.color.impression.negative"
|
|
208
211
|
}),
|
|
209
|
-
children:
|
|
212
|
+
children: g ?? b("common.required")
|
|
210
213
|
}
|
|
211
214
|
)
|
|
212
215
|
]
|
|
213
216
|
}
|
|
214
217
|
),
|
|
215
|
-
/* @__PURE__ */ e(
|
|
218
|
+
/* @__PURE__ */ e(O, { children: /* @__PURE__ */ i(j, { className: o.trigger, ref: v, children: [
|
|
216
219
|
/* @__PURE__ */ e(
|
|
217
|
-
|
|
220
|
+
W,
|
|
218
221
|
{
|
|
219
|
-
placeholder:
|
|
222
|
+
placeholder: p,
|
|
220
223
|
className: o.valueText
|
|
221
224
|
}
|
|
222
225
|
),
|
|
223
|
-
/* @__PURE__ */ e(
|
|
226
|
+
/* @__PURE__ */ e(C, { className: o.iconBox })
|
|
224
227
|
] }) }),
|
|
225
|
-
|
|
228
|
+
d && m && /* @__PURE__ */ e(
|
|
226
229
|
"div",
|
|
227
230
|
{
|
|
228
|
-
className:
|
|
231
|
+
className: r({
|
|
229
232
|
textStyle: {
|
|
230
233
|
base: "sd.system.typography.body.extraSmall_compact",
|
|
231
234
|
expanded: "sd.system.typography.body.extraSmall_expanded"
|
|
@@ -235,20 +238,20 @@ const l = T({
|
|
|
235
238
|
children: m
|
|
236
239
|
}
|
|
237
240
|
),
|
|
238
|
-
/* @__PURE__ */ e(
|
|
239
|
-
|
|
241
|
+
/* @__PURE__ */ e(V, { disabled: !n, container: w, children: /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(k, { className: o.content, children: /* @__PURE__ */ e(T, { children: l.items.map((s, _) => /* @__PURE__ */ e(q, { item: s, children: /* @__PURE__ */ e(
|
|
242
|
+
N,
|
|
240
243
|
{
|
|
241
244
|
title: s.label,
|
|
242
245
|
value: s.value,
|
|
243
246
|
className: o.item,
|
|
244
247
|
size: t.size == "small" ? "small" : void 0
|
|
245
248
|
}
|
|
246
|
-
) },
|
|
249
|
+
) }, _)) }) }) }) })
|
|
247
250
|
]
|
|
248
251
|
}
|
|
249
252
|
);
|
|
250
253
|
};
|
|
251
254
|
export {
|
|
252
|
-
|
|
253
|
-
|
|
255
|
+
de as Select,
|
|
256
|
+
c as SelectStyle
|
|
254
257
|
};
|