@serendie/ui 2.2.2 → 2.2.3-dev.202510020518
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DatePicker/DatePicker.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.js +98 -97
- package/dist/components/Select/Select.d.ts +1 -0
- package/dist/components/Select/Select.js +36 -36
- package/dist/components/TextArea/TextArea.d.ts +1 -0
- package/dist/components/TextArea/TextArea.js +16 -15
- package/dist/components/TextField/TextField.d.ts +1 -0
- package/dist/components/TextField/TextField.js +22 -21
- package/package.json +1 -1
|
@@ -1,81 +1,82 @@
|
|
|
1
|
-
import { jsx as e, jsxs as a, Fragment as
|
|
2
|
-
import { SerendieSymbolCalendar as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { datePickerStyles as
|
|
5
|
-
import { textFieldRecipe as
|
|
6
|
-
import { Portal as
|
|
7
|
-
import { DatePickerRoot as
|
|
8
|
-
import { DatePickerLabel as
|
|
9
|
-
import { DatePickerControl as
|
|
10
|
-
import { cx as
|
|
11
|
-
import { DatePickerTrigger as
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as C } from "react/jsx-runtime";
|
|
2
|
+
import { SerendieSymbolCalendar as F, SerendieSymbolArrowRight as I, SerendieSymbolChevronDown as W, SerendieSymbolChevronLeft as O, SerendieSymbolChevronRight as j } from "@serendie/symbols";
|
|
3
|
+
import { forwardRef as H, useState as A } from "react";
|
|
4
|
+
import { datePickerStyles as v } from "./styles.js";
|
|
5
|
+
import { textFieldRecipe as L } from "../../styled-system/recipes/text-field-recipe.js";
|
|
6
|
+
import { Portal as V } from "../../node_modules/@ark-ui/react/dist/components/portal/portal.js";
|
|
7
|
+
import { DatePickerRoot as D } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js";
|
|
8
|
+
import { DatePickerLabel as q } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js";
|
|
9
|
+
import { DatePickerControl as B } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js";
|
|
10
|
+
import { cx as h } from "../../styled-system/css/cx.js";
|
|
11
|
+
import { DatePickerTrigger as J } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js";
|
|
12
12
|
import { css as t } from "../../styled-system/css/css.js";
|
|
13
|
-
import { DatePickerInput as
|
|
14
|
-
import { DatePickerPositioner as
|
|
15
|
-
import { DatePickerContent as
|
|
16
|
-
import { DatePickerView as
|
|
17
|
-
import { DatePickerContext as
|
|
18
|
-
import { DatePickerViewControl as
|
|
19
|
-
import { DatePickerYearSelect as
|
|
20
|
-
import { DatePickerPrevTrigger as
|
|
21
|
-
import { DatePickerMonthSelect as
|
|
22
|
-
import { DatePickerNextTrigger as
|
|
23
|
-
import { DatePickerTable as
|
|
24
|
-
import { DatePickerTableHead as
|
|
25
|
-
import { DatePickerTableRow as
|
|
26
|
-
import { DatePickerTableHeader as
|
|
27
|
-
import { DatePickerTableBody as
|
|
28
|
-
import { DatePickerTableCell as
|
|
29
|
-
import { DatePickerTableCellTrigger as
|
|
30
|
-
const
|
|
13
|
+
import { DatePickerInput as f } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js";
|
|
14
|
+
import { DatePickerPositioner as Y } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js";
|
|
15
|
+
import { DatePickerContent as _ } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js";
|
|
16
|
+
import { DatePickerView as z } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js";
|
|
17
|
+
import { DatePickerContext as E } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js";
|
|
18
|
+
import { DatePickerViewControl as G } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js";
|
|
19
|
+
import { DatePickerYearSelect as K } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js";
|
|
20
|
+
import { DatePickerPrevTrigger as Q } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js";
|
|
21
|
+
import { DatePickerMonthSelect as U } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js";
|
|
22
|
+
import { DatePickerNextTrigger as X } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js";
|
|
23
|
+
import { DatePickerTable as Z } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js";
|
|
24
|
+
import { DatePickerTableHead as $ } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js";
|
|
25
|
+
import { DatePickerTableRow as b } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js";
|
|
26
|
+
import { DatePickerTableHeader as M } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js";
|
|
27
|
+
import { DatePickerTableBody as ee } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js";
|
|
28
|
+
import { DatePickerTableCell as re } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js";
|
|
29
|
+
import { DatePickerTableCellTrigger as ie } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js";
|
|
30
|
+
const We = H(
|
|
31
31
|
({
|
|
32
32
|
placeholder: r = "日付を選択",
|
|
33
|
-
label:
|
|
34
|
-
required:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
label: o,
|
|
34
|
+
required: l,
|
|
35
|
+
requiredLabel: m,
|
|
36
|
+
invalid: n,
|
|
37
|
+
invalidMessage: c,
|
|
38
|
+
selectionMode: p = "single",
|
|
39
|
+
startPlaceholder: x = "開始日",
|
|
40
|
+
endPlaceholder: S = "終了日",
|
|
41
|
+
locale: N = "ja-JP",
|
|
42
|
+
isCalendarOnly: T = !1,
|
|
43
|
+
...s
|
|
44
|
+
}, g) => {
|
|
45
|
+
const w = v(), i = L(), [u, d] = A(!1), R = p === "range";
|
|
46
|
+
return T ? /* @__PURE__ */ e(
|
|
47
|
+
D,
|
|
47
48
|
{
|
|
48
|
-
locale:
|
|
49
|
-
...
|
|
50
|
-
ref:
|
|
51
|
-
selectionMode:
|
|
49
|
+
locale: N,
|
|
50
|
+
...s,
|
|
51
|
+
ref: g,
|
|
52
|
+
selectionMode: p,
|
|
52
53
|
open: !0,
|
|
53
54
|
className: i.root,
|
|
54
|
-
children: /* @__PURE__ */ e(
|
|
55
|
+
children: /* @__PURE__ */ e(y, {})
|
|
55
56
|
}
|
|
56
57
|
) : /* @__PURE__ */ a(
|
|
57
|
-
|
|
58
|
+
D,
|
|
58
59
|
{
|
|
59
|
-
locale:
|
|
60
|
-
...
|
|
61
|
-
ref:
|
|
62
|
-
selectionMode:
|
|
60
|
+
locale: N,
|
|
61
|
+
...s,
|
|
62
|
+
ref: g,
|
|
63
|
+
selectionMode: p,
|
|
63
64
|
className: i.root,
|
|
64
|
-
open:
|
|
65
|
-
onOpenChange: (
|
|
66
|
-
var
|
|
67
|
-
d(
|
|
65
|
+
open: u,
|
|
66
|
+
onOpenChange: (P) => {
|
|
67
|
+
var k;
|
|
68
|
+
d(P.open), (k = s.onOpenChange) == null || k.call(s, P);
|
|
68
69
|
},
|
|
69
70
|
children: [
|
|
70
|
-
/* @__PURE__ */ a(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
/* @__PURE__ */ a(C, { children: [
|
|
72
|
+
o && /* @__PURE__ */ a(q, { className: i.label, children: [
|
|
73
|
+
o,
|
|
74
|
+
l && /* @__PURE__ */ e("span", { className: i.labelRequired, children: m ?? "必須" })
|
|
74
75
|
] }),
|
|
75
76
|
/* @__PURE__ */ a(
|
|
76
|
-
|
|
77
|
+
B,
|
|
77
78
|
{
|
|
78
|
-
className:
|
|
79
|
+
className: h(
|
|
79
80
|
i.inputWrapper,
|
|
80
81
|
t({
|
|
81
82
|
_expanded: {
|
|
@@ -84,11 +85,11 @@ const Ie = j(
|
|
|
84
85
|
}
|
|
85
86
|
})
|
|
86
87
|
),
|
|
87
|
-
"data-expanded":
|
|
88
|
-
"data-Invalid":
|
|
88
|
+
"data-expanded": u ? !0 : void 0,
|
|
89
|
+
"data-Invalid": n,
|
|
89
90
|
children: [
|
|
90
|
-
/* @__PURE__ */ e("div", { className: i.leftContent, children: /* @__PURE__ */ e(
|
|
91
|
-
|
|
91
|
+
/* @__PURE__ */ e("div", { className: i.leftContent, children: /* @__PURE__ */ e(J, { className: t({ display: "flex" }), children: /* @__PURE__ */ e(F, {}) }) }),
|
|
92
|
+
R ? /* @__PURE__ */ a(
|
|
92
93
|
"div",
|
|
93
94
|
{
|
|
94
95
|
className: t({
|
|
@@ -98,11 +99,11 @@ const Ie = j(
|
|
|
98
99
|
}),
|
|
99
100
|
children: [
|
|
100
101
|
/* @__PURE__ */ e(
|
|
101
|
-
|
|
102
|
+
f,
|
|
102
103
|
{
|
|
103
104
|
index: 0,
|
|
104
|
-
placeholder:
|
|
105
|
-
className:
|
|
105
|
+
placeholder: x,
|
|
106
|
+
className: h(
|
|
106
107
|
i.input,
|
|
107
108
|
t({
|
|
108
109
|
minWidth: "100%",
|
|
@@ -112,13 +113,13 @@ const Ie = j(
|
|
|
112
113
|
onFocus: () => d(!0)
|
|
113
114
|
}
|
|
114
115
|
),
|
|
115
|
-
/* @__PURE__ */ e(
|
|
116
|
+
/* @__PURE__ */ e(I, {}),
|
|
116
117
|
/* @__PURE__ */ e(
|
|
117
|
-
|
|
118
|
+
f,
|
|
118
119
|
{
|
|
119
120
|
index: 1,
|
|
120
|
-
placeholder:
|
|
121
|
-
className:
|
|
121
|
+
placeholder: S,
|
|
122
|
+
className: h(
|
|
122
123
|
i.input,
|
|
123
124
|
t({
|
|
124
125
|
minWidth: "100%",
|
|
@@ -131,7 +132,7 @@ const Ie = j(
|
|
|
131
132
|
]
|
|
132
133
|
}
|
|
133
134
|
) : /* @__PURE__ */ e(
|
|
134
|
-
|
|
135
|
+
f,
|
|
135
136
|
{
|
|
136
137
|
placeholder: r,
|
|
137
138
|
className: i.input,
|
|
@@ -142,25 +143,25 @@ const Ie = j(
|
|
|
142
143
|
]
|
|
143
144
|
}
|
|
144
145
|
),
|
|
145
|
-
|
|
146
|
+
n && c && /* @__PURE__ */ e("div", { className: i.messageField, children: /* @__PURE__ */ e("p", { className: i.invalidMessage, children: c }) })
|
|
146
147
|
] }),
|
|
147
|
-
/* @__PURE__ */ e(
|
|
148
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(Y, { className: w.positioner, children: /* @__PURE__ */ e(y, {}) }) })
|
|
148
149
|
]
|
|
149
150
|
}
|
|
150
151
|
);
|
|
151
152
|
}
|
|
152
|
-
),
|
|
153
|
-
const r =
|
|
154
|
-
return /* @__PURE__ */ e(
|
|
155
|
-
/* @__PURE__ */ a(
|
|
153
|
+
), y = () => {
|
|
154
|
+
const r = v();
|
|
155
|
+
return /* @__PURE__ */ e(_, { className: r.content, children: /* @__PURE__ */ e(z, { view: "day", className: r.view, children: /* @__PURE__ */ e(E, { children: (o) => /* @__PURE__ */ a(C, { children: [
|
|
156
|
+
/* @__PURE__ */ a(G, { className: r.viewControl, children: [
|
|
156
157
|
/* @__PURE__ */ a("div", { className: r.selectWrapper, children: [
|
|
157
|
-
/* @__PURE__ */ e(
|
|
158
|
-
/* @__PURE__ */ e(
|
|
158
|
+
/* @__PURE__ */ e(K, { className: r.select }),
|
|
159
|
+
/* @__PURE__ */ e(W, { className: r.selectIcon })
|
|
159
160
|
] }),
|
|
160
161
|
/* @__PURE__ */ a("div", { className: t({ display: "flex", alignItems: "center" }), children: [
|
|
161
|
-
/* @__PURE__ */ e(
|
|
162
|
+
/* @__PURE__ */ e(Q, { className: r.prevTrigger, children: /* @__PURE__ */ e(O, {}) }),
|
|
162
163
|
/* @__PURE__ */ e(
|
|
163
|
-
|
|
164
|
+
U,
|
|
164
165
|
{
|
|
165
166
|
className: t({
|
|
166
167
|
appearance: "none",
|
|
@@ -168,36 +169,36 @@ const Ie = j(
|
|
|
168
169
|
})
|
|
169
170
|
}
|
|
170
171
|
),
|
|
171
|
-
/* @__PURE__ */ e(
|
|
172
|
+
/* @__PURE__ */ e(X, { className: r.nextTrigger, children: /* @__PURE__ */ e(j, {}) })
|
|
172
173
|
] })
|
|
173
174
|
] }),
|
|
174
|
-
/* @__PURE__ */ a(
|
|
175
|
-
/* @__PURE__ */ e(
|
|
176
|
-
|
|
175
|
+
/* @__PURE__ */ a(Z, { className: r.table, children: [
|
|
176
|
+
/* @__PURE__ */ e($, { children: /* @__PURE__ */ e(b, { children: o.weekDays.map((l, m) => /* @__PURE__ */ e(
|
|
177
|
+
M,
|
|
177
178
|
{
|
|
178
179
|
className: r.tableHeader,
|
|
179
|
-
children:
|
|
180
|
+
children: l.narrow
|
|
180
181
|
},
|
|
181
|
-
|
|
182
|
+
m
|
|
182
183
|
)) }) }),
|
|
183
|
-
/* @__PURE__ */ e(
|
|
184
|
-
|
|
184
|
+
/* @__PURE__ */ e(ee, { children: o.weeks.map((l, m) => /* @__PURE__ */ e(b, { children: l.map((n, c) => /* @__PURE__ */ e(
|
|
185
|
+
re,
|
|
185
186
|
{
|
|
186
187
|
value: n,
|
|
187
188
|
className: r.tableCell,
|
|
188
189
|
children: /* @__PURE__ */ e(
|
|
189
|
-
|
|
190
|
+
ie,
|
|
190
191
|
{
|
|
191
192
|
className: r.tableCellTrigger,
|
|
192
193
|
children: n.day
|
|
193
194
|
}
|
|
194
195
|
)
|
|
195
196
|
},
|
|
196
|
-
|
|
197
|
-
)) },
|
|
197
|
+
c
|
|
198
|
+
)) }, m)) })
|
|
198
199
|
] })
|
|
199
200
|
] }) }) }) });
|
|
200
201
|
};
|
|
201
202
|
export {
|
|
202
|
-
|
|
203
|
+
We as DatePicker
|
|
203
204
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
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 { createListCollection as
|
|
6
|
-
import { Portal as
|
|
7
|
-
import { sva as
|
|
8
|
-
import { SelectRoot as
|
|
9
|
-
import { cx as
|
|
10
|
-
import { SelectLabel as
|
|
2
|
+
import { SerendieSymbolChevronDown as f } from "@serendie/symbols";
|
|
3
|
+
import { List as v } from "../List/List.js";
|
|
4
|
+
import { ListItem as w } from "../List/ListItem.js";
|
|
5
|
+
import { createListCollection as _ } from "../../node_modules/@ark-ui/react/dist/components/collection/list-collection.js";
|
|
6
|
+
import { Portal as C } from "../../node_modules/@ark-ui/react/dist/components/portal/portal.js";
|
|
7
|
+
import { sva as T } from "../../styled-system/css/sva.js";
|
|
8
|
+
import { SelectRoot as N } from "../../node_modules/@ark-ui/react/dist/components/select/select-root.js";
|
|
9
|
+
import { cx as z } from "../../styled-system/css/cx.js";
|
|
10
|
+
import { SelectLabel as R } from "../../node_modules/@ark-ui/react/dist/components/select/select-label.js";
|
|
11
11
|
import { css as d } from "../../styled-system/css/css.js";
|
|
12
|
-
import { SelectControl as
|
|
13
|
-
import { SelectTrigger as
|
|
14
|
-
import { SelectValueText as
|
|
15
|
-
import { SelectPositioner as
|
|
16
|
-
import { SelectContent as
|
|
17
|
-
import { SelectItem as
|
|
18
|
-
const n =
|
|
12
|
+
import { SelectControl as V } from "../../node_modules/@ark-ui/react/dist/components/select/select-control.js";
|
|
13
|
+
import { SelectTrigger as L } from "../../node_modules/@ark-ui/react/dist/components/select/select-trigger.js";
|
|
14
|
+
import { SelectValueText as P } from "../../node_modules/@ark-ui/react/dist/components/select/select-value-text.js";
|
|
15
|
+
import { SelectPositioner as B } from "../../node_modules/@ark-ui/react/dist/components/select/select-positioner.js";
|
|
16
|
+
import { SelectContent as I } from "../../node_modules/@ark-ui/react/dist/components/select/select-content.js";
|
|
17
|
+
import { SelectItem as O } from "../../node_modules/@ark-ui/react/dist/components/select/select-item.js";
|
|
18
|
+
const n = T({
|
|
19
19
|
slots: ["root", "valueText", "trigger", "content", "item", "iconBox"],
|
|
20
20
|
base: {
|
|
21
21
|
root: {
|
|
@@ -152,28 +152,29 @@ const n = C({
|
|
|
152
152
|
defaultVariants: {
|
|
153
153
|
size: "medium"
|
|
154
154
|
}
|
|
155
|
-
}),
|
|
155
|
+
}), M = ({
|
|
156
156
|
placeholder: c = "",
|
|
157
157
|
label: r,
|
|
158
158
|
required: p,
|
|
159
|
+
requiredLabel: y,
|
|
159
160
|
invalid: a,
|
|
160
161
|
invalidMessage: m,
|
|
161
|
-
className:
|
|
162
|
-
items:
|
|
163
|
-
...
|
|
162
|
+
className: g,
|
|
163
|
+
items: u = [],
|
|
164
|
+
...x
|
|
164
165
|
}) => {
|
|
165
|
-
const [t,
|
|
166
|
-
items:
|
|
166
|
+
const [t, h] = n.splitVariantProps(x), o = n(t), { collection: j, ...b } = h, l = _({
|
|
167
|
+
items: u,
|
|
167
168
|
itemToString: (s) => s.label,
|
|
168
169
|
itemToValue: (s) => s.value
|
|
169
170
|
});
|
|
170
171
|
return /* @__PURE__ */ i(
|
|
171
|
-
|
|
172
|
+
N,
|
|
172
173
|
{
|
|
173
|
-
...
|
|
174
|
+
...b,
|
|
174
175
|
collection: l,
|
|
175
176
|
invalid: a,
|
|
176
|
-
className:
|
|
177
|
+
className: z(o.root, g),
|
|
177
178
|
positioning: {
|
|
178
179
|
sameWidth: !0,
|
|
179
180
|
offset: {
|
|
@@ -184,7 +185,7 @@ const n = C({
|
|
|
184
185
|
children: [
|
|
185
186
|
r && t.size != "small" && // smallの場合はラベルを表示しない
|
|
186
187
|
/* @__PURE__ */ i(
|
|
187
|
-
|
|
188
|
+
R,
|
|
188
189
|
{
|
|
189
190
|
className: d({
|
|
190
191
|
textStyle: {
|
|
@@ -194,29 +195,28 @@ const n = C({
|
|
|
194
195
|
}),
|
|
195
196
|
children: [
|
|
196
197
|
r,
|
|
197
|
-
p &&
|
|
198
|
-
/* @__PURE__ */ e(
|
|
198
|
+
p && /* @__PURE__ */ e(
|
|
199
199
|
"span",
|
|
200
200
|
{
|
|
201
201
|
className: d({
|
|
202
202
|
pl: "sd.system.dimension.spacing.extraSmall",
|
|
203
203
|
color: "sd.system.color.impression.negative"
|
|
204
204
|
}),
|
|
205
|
-
children: "必須"
|
|
205
|
+
children: y ?? "必須"
|
|
206
206
|
}
|
|
207
207
|
)
|
|
208
208
|
]
|
|
209
209
|
}
|
|
210
210
|
),
|
|
211
|
-
/* @__PURE__ */ e(
|
|
211
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ i(L, { className: o.trigger, children: [
|
|
212
212
|
/* @__PURE__ */ e(
|
|
213
|
-
|
|
213
|
+
P,
|
|
214
214
|
{
|
|
215
215
|
placeholder: c,
|
|
216
216
|
className: o.valueText
|
|
217
217
|
}
|
|
218
218
|
),
|
|
219
|
-
/* @__PURE__ */ e(
|
|
219
|
+
/* @__PURE__ */ e(f, { className: o.iconBox })
|
|
220
220
|
] }) }),
|
|
221
221
|
a && m && /* @__PURE__ */ e(
|
|
222
222
|
"div",
|
|
@@ -231,20 +231,20 @@ const n = C({
|
|
|
231
231
|
children: m
|
|
232
232
|
}
|
|
233
233
|
),
|
|
234
|
-
/* @__PURE__ */ e(
|
|
235
|
-
|
|
234
|
+
/* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(I, { className: o.content, children: /* @__PURE__ */ e(v, { children: l.items.map((s, S) => /* @__PURE__ */ e(O, { item: s, children: /* @__PURE__ */ e(
|
|
235
|
+
w,
|
|
236
236
|
{
|
|
237
237
|
title: s.label,
|
|
238
238
|
value: s.value,
|
|
239
239
|
className: o.item,
|
|
240
240
|
size: t.size == "small" ? "small" : void 0
|
|
241
241
|
}
|
|
242
|
-
) },
|
|
242
|
+
) }, S)) }) }) }) })
|
|
243
243
|
]
|
|
244
244
|
}
|
|
245
245
|
);
|
|
246
246
|
};
|
|
247
247
|
export {
|
|
248
|
-
|
|
248
|
+
M as Select,
|
|
249
249
|
n as SelectStyle
|
|
250
250
|
};
|
|
@@ -5,4 +5,5 @@ export declare const TextArea: React.ForwardRefExoticComponent<{
|
|
|
5
5
|
invalid?: boolean;
|
|
6
6
|
invalidMessage?: string;
|
|
7
7
|
autoAdjustHeight?: boolean;
|
|
8
|
+
requiredLabel?: string;
|
|
8
9
|
} & Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as i, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import c, { forwardRef as
|
|
4
|
-
import { sva as
|
|
5
|
-
import { cx as
|
|
6
|
-
const p =
|
|
2
|
+
import _ from "../../node_modules/merge-refs/dist/esm/index.js";
|
|
3
|
+
import c, { forwardRef as w } from "react";
|
|
4
|
+
import { sva as C } from "../../styled-system/css/sva.js";
|
|
5
|
+
import { cx as N } from "../../styled-system/css/cx.js";
|
|
6
|
+
const p = C({
|
|
7
7
|
slots: [
|
|
8
8
|
"root",
|
|
9
9
|
"label",
|
|
@@ -95,23 +95,24 @@ const p = w({
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
}),
|
|
98
|
+
}), W = w(
|
|
99
99
|
({
|
|
100
100
|
placeholder: y,
|
|
101
101
|
label: r,
|
|
102
102
|
description: t,
|
|
103
103
|
required: d,
|
|
104
|
+
requiredLabel: u,
|
|
104
105
|
invalidMessage: o,
|
|
105
106
|
invalid: a,
|
|
106
107
|
disabled: n,
|
|
107
|
-
className:
|
|
108
|
+
className: g,
|
|
108
109
|
...l
|
|
109
|
-
},
|
|
110
|
-
const
|
|
111
|
-
return /* @__PURE__ */ i("div", { className:
|
|
110
|
+
}, x) => {
|
|
111
|
+
const h = c.useRef(null), b = _(h, x), [f, S] = p.splitVariantProps(l), e = p(f), v = t || a && o, m = l.id || c.useId();
|
|
112
|
+
return /* @__PURE__ */ i("div", { className: N(e.root, g), children: [
|
|
112
113
|
r ? /* @__PURE__ */ i("label", { className: e.label, htmlFor: m, children: [
|
|
113
114
|
r,
|
|
114
|
-
d && /* @__PURE__ */ s("span", { className: e.required, children: "必須" })
|
|
115
|
+
d && /* @__PURE__ */ s("span", { className: e.required, children: u ?? "必須" })
|
|
115
116
|
] }) : null,
|
|
116
117
|
/* @__PURE__ */ s(
|
|
117
118
|
"div",
|
|
@@ -122,18 +123,18 @@ const p = w({
|
|
|
122
123
|
children: /* @__PURE__ */ s(
|
|
123
124
|
"textarea",
|
|
124
125
|
{
|
|
125
|
-
ref:
|
|
126
|
+
ref: b,
|
|
126
127
|
id: m,
|
|
127
128
|
placeholder: y,
|
|
128
129
|
required: d,
|
|
129
130
|
disabled: n,
|
|
130
131
|
className: e.textarea,
|
|
131
|
-
...
|
|
132
|
+
...S
|
|
132
133
|
}
|
|
133
134
|
)
|
|
134
135
|
}
|
|
135
136
|
),
|
|
136
|
-
|
|
137
|
+
v && /* @__PURE__ */ i("div", { className: e.messageField, children: [
|
|
137
138
|
t && /* @__PURE__ */ s("p", { className: e.description, children: t }),
|
|
138
139
|
a && o && /* @__PURE__ */ s("p", { className: e.invalidMessage, children: o })
|
|
139
140
|
] })
|
|
@@ -141,5 +142,5 @@ const p = w({
|
|
|
141
142
|
}
|
|
142
143
|
);
|
|
143
144
|
export {
|
|
144
|
-
|
|
145
|
+
W as TextArea
|
|
145
146
|
};
|
|
@@ -6,4 +6,5 @@ export declare const TextField: React.ForwardRefExoticComponent<{
|
|
|
6
6
|
invalidMessage?: string;
|
|
7
7
|
leftContent?: React.ReactNode;
|
|
8
8
|
rightContent?: React.ReactNode;
|
|
9
|
+
requiredLabel?: string;
|
|
9
10
|
} & Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { SerendieSymbolAlertCircle as
|
|
3
|
-
import
|
|
4
|
-
import m, { forwardRef as
|
|
2
|
+
import { SerendieSymbolAlertCircle as T, SerendieSymbolClose as W } from "@serendie/symbols";
|
|
3
|
+
import q from "../../node_modules/merge-refs/dist/esm/index.js";
|
|
4
|
+
import m, { forwardRef as z } from "react";
|
|
5
5
|
import { textFieldRecipe as x } from "../../styled-system/recipes/text-field-recipe.js";
|
|
6
|
-
import { cx as
|
|
6
|
+
import { cx as B } from "../../styled-system/css/cx.js";
|
|
7
7
|
import { css as b } from "../../styled-system/css/css.js";
|
|
8
|
-
const
|
|
8
|
+
const M = z(
|
|
9
9
|
({
|
|
10
10
|
placeholder: F,
|
|
11
11
|
label: d,
|
|
12
12
|
description: i,
|
|
13
13
|
required: u,
|
|
14
|
+
requiredLabel: S,
|
|
14
15
|
invalidMessage: c,
|
|
15
16
|
invalid: a,
|
|
16
|
-
type:
|
|
17
|
+
type: V = "text",
|
|
17
18
|
disabled: n,
|
|
18
19
|
onChange: h,
|
|
19
20
|
value: f,
|
|
20
|
-
className:
|
|
21
|
+
className: w,
|
|
21
22
|
leftContent: N,
|
|
22
23
|
rightContent: p,
|
|
23
24
|
...l
|
|
24
|
-
},
|
|
25
|
-
const o = m.useRef(null),
|
|
25
|
+
}, y) => {
|
|
26
|
+
const o = m.useRef(null), C = q(o, y), [P, _] = x.splitVariantProps(l), t = x(P), j = i || a && c, [I, k] = m.useState(l.defaultValue || f), v = l.id || m.useId(), A = () => {
|
|
26
27
|
var R;
|
|
27
28
|
const s = {
|
|
28
29
|
target: { value: "" }
|
|
29
30
|
};
|
|
30
31
|
g(s), (R = l.onReset) == null || R.call(l, s), o.current && (o.current.value = "");
|
|
31
32
|
}, g = (s) => {
|
|
32
|
-
|
|
33
|
+
k(s.target.value), h && h(s);
|
|
33
34
|
};
|
|
34
|
-
return /* @__PURE__ */ r("div", { className:
|
|
35
|
+
return /* @__PURE__ */ r("div", { className: B(t.root, w), children: [
|
|
35
36
|
d ? /* @__PURE__ */ r("label", { className: t.label, htmlFor: v, children: [
|
|
36
37
|
d,
|
|
37
|
-
u && /* @__PURE__ */ e("span", { className: t.labelRequired, children: "必須" })
|
|
38
|
+
u && /* @__PURE__ */ e("span", { className: t.labelRequired, children: S ?? "必須" })
|
|
38
39
|
] }) : null,
|
|
39
40
|
/* @__PURE__ */ r(
|
|
40
41
|
"div",
|
|
@@ -47,16 +48,16 @@ const L = q(
|
|
|
47
48
|
/* @__PURE__ */ e(
|
|
48
49
|
"input",
|
|
49
50
|
{
|
|
50
|
-
ref:
|
|
51
|
+
ref: C,
|
|
51
52
|
id: v,
|
|
52
53
|
placeholder: F,
|
|
53
54
|
required: u,
|
|
54
55
|
disabled: n,
|
|
55
56
|
value: f,
|
|
56
|
-
type:
|
|
57
|
+
type: V,
|
|
57
58
|
className: t.input,
|
|
58
59
|
onChange: g,
|
|
59
|
-
...
|
|
60
|
+
..._
|
|
60
61
|
}
|
|
61
62
|
),
|
|
62
63
|
p ? /* @__PURE__ */ e("div", { className: t.rightContent, children: p }) : /* @__PURE__ */ e("div", { className: t.icon, children: !n && /* disabledの場合はアイコンを表示しない */
|
|
@@ -66,21 +67,21 @@ const L = q(
|
|
|
66
67
|
className: b({
|
|
67
68
|
color: "sd.system.color.impression.negative"
|
|
68
69
|
}),
|
|
69
|
-
children: /* @__PURE__ */ e(
|
|
70
|
+
children: /* @__PURE__ */ e(T, { width: 20, height: 20 })
|
|
70
71
|
}
|
|
71
|
-
) :
|
|
72
|
+
) : I ? /* @__PURE__ */ e(
|
|
72
73
|
"button",
|
|
73
74
|
{
|
|
74
75
|
className: b({ cursor: "pointer" }),
|
|
75
|
-
onClick:
|
|
76
|
+
onClick: A,
|
|
76
77
|
"aria-label": "値をクリア",
|
|
77
|
-
children: /* @__PURE__ */ e(
|
|
78
|
+
children: /* @__PURE__ */ e(W, { width: 20, height: 20 })
|
|
78
79
|
}
|
|
79
80
|
) : null) })
|
|
80
81
|
]
|
|
81
82
|
}
|
|
82
83
|
),
|
|
83
|
-
|
|
84
|
+
j && /* @__PURE__ */ r("div", { className: t.messageField, children: [
|
|
84
85
|
i && /* @__PURE__ */ e("p", { className: t.description, children: i }),
|
|
85
86
|
a && c && /* @__PURE__ */ e("p", { className: t.invalidMessage, children: c })
|
|
86
87
|
] })
|
|
@@ -88,5 +89,5 @@ const L = q(
|
|
|
88
89
|
}
|
|
89
90
|
);
|
|
90
91
|
export {
|
|
91
|
-
|
|
92
|
+
M as TextField
|
|
92
93
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@serendie/ui",
|
|
3
3
|
"description": "Adaptive UI component library as part of Serendie Design System by Mitsubishi Electric",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "2.2.
|
|
5
|
+
"version": "2.2.3-dev.202510020518",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"sideEffects": [
|