@serendie/ui 2.3.0 → 2.4.0-dev.202601080931
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 +2 -2
- 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
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ export default function ClientComponent() {
|
|
|
79
79
|
|
|
80
80
|
### テーマ切り替え
|
|
81
81
|
|
|
82
|
-
Serendie Design Systemには5つのカラーテーマがあり、デザイントークンもそれに対応します。htmlタグなどに、`data-panda-theme`属性 (`konjo`, `asagi`, `sumire`, `
|
|
82
|
+
Serendie Design Systemには5つのカラーテーマがあり、デザイントークンもそれに対応します。htmlタグなどに、`data-panda-theme`属性 (`konjo`, `asagi`, `sumire`, `tsutsuji`, `kurikawa`)を付与することでカラーテーマを切り替えることができます。
|
|
83
83
|
各テーマについては[こちら](https://serendie.design/foundations/theming/)を参照してください。
|
|
84
84
|
|
|
85
85
|
```html
|
|
@@ -214,7 +214,7 @@ export const dictionary = {
|
|
|
214
214
|
```env
|
|
215
215
|
FIGMA_ACCESS_TOKEN="YOUR_TOKEN"
|
|
216
216
|
FIGMA_FILE_KEY="YOUR_FILE_KEY"
|
|
217
|
-
# FIGMA_TRANSLATION_COLLECTION="
|
|
217
|
+
# FIGMA_TRANSLATION_COLLECTION="_i18n" # オプション(デフォルト: _i18n)
|
|
218
218
|
```
|
|
219
219
|
|
|
220
220
|
#### 翻訳管理コマンド
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
1
|
+
import { default as React, ComponentProps } from 'react';
|
|
2
|
+
import { RecipeVariantProps } from '../../../styled-system/types';
|
|
2
3
|
export declare const ButtonStyle: import('../../../styled-system/types').RecipeRuntimeFn<{
|
|
3
4
|
styleType: {
|
|
4
5
|
filled: {
|
|
@@ -112,9 +113,19 @@ export declare const ButtonStyle: import('../../../styled-system/types').RecipeR
|
|
|
112
113
|
};
|
|
113
114
|
};
|
|
114
115
|
}>;
|
|
116
|
+
type ExclusiveIconProps = ({
|
|
117
|
+
leftIcon?: React.ReactElement;
|
|
118
|
+
} & {
|
|
119
|
+
rightIcon?: never;
|
|
120
|
+
}) | ({
|
|
121
|
+
leftIcon?: never;
|
|
122
|
+
} & {
|
|
123
|
+
rightIcon?: React.ReactElement;
|
|
124
|
+
});
|
|
115
125
|
type ButtonLoadingProps = {
|
|
116
126
|
isLoading?: boolean;
|
|
117
127
|
};
|
|
128
|
+
export type ButtonProps = ComponentProps<"button"> & RecipeVariantProps<typeof ButtonStyle> & ExclusiveIconProps & ButtonLoadingProps;
|
|
118
129
|
export declare const Button: React.ForwardRefExoticComponent<(Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
119
130
|
styleType?: "filled" | "outlined" | "ghost" | "rectangle" | undefined;
|
|
120
131
|
size?: "small" | "medium" | undefined;
|
|
@@ -11,4 +11,11 @@ export declare const DatePicker: import('react').ForwardRefExoticComponent<ArkDa
|
|
|
11
11
|
startPlaceholder?: string;
|
|
12
12
|
endPlaceholder?: string;
|
|
13
13
|
isCalendarOnly?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Portalを使用するかどうか
|
|
16
|
+
* - `true` (デフォルト): body直下にポータルする。ModalDialog/Drawer内にある場合は自動的にそのコンテンツ内にポータルされる
|
|
17
|
+
* - `false`: ポータルを使用せず、その場にレンダリングする
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
portalled?: boolean;
|
|
14
21
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,206 +1,216 @@
|
|
|
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 {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import { SerendieSymbolCalendar as B, SerendieSymbolArrowRight as J, SerendieSymbolChevronDown as Y, SerendieSymbolChevronLeft as _, SerendieSymbolChevronRight as z } from "@serendie/symbols";
|
|
3
|
+
import { forwardRef as E, useState as G } from "react";
|
|
4
|
+
import { datePickerStyles as S } from "./styles.js";
|
|
5
|
+
import { textFieldRecipe as C } from "../../recipes/textFieldRecipe.js";
|
|
6
|
+
import { useAutoPortalContainer as K } from "../../hooks/useAutoPortalContainer.js";
|
|
7
|
+
import { useTranslations as Q } from "../../i18n/index.js";
|
|
8
|
+
import { Portal as U } from "../../node_modules/@ark-ui/react/dist/components/portal/portal.js";
|
|
9
|
+
import { DatePickerRoot as y } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js";
|
|
10
|
+
import { DatePickerLabel as X } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js";
|
|
11
|
+
import { DatePickerControl as Z } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js";
|
|
12
|
+
import { cx as f } from "../../styled-system/css/cx.js";
|
|
13
|
+
import { DatePickerTrigger as $ } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js";
|
|
14
|
+
import { css as i } from "../../styled-system/css/css.js";
|
|
15
|
+
import { DatePickerInput as P } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js";
|
|
16
|
+
import { DatePickerPositioner as M } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js";
|
|
17
|
+
import { DatePickerContent as ee } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js";
|
|
18
|
+
import { DatePickerView as re } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js";
|
|
19
|
+
import { DatePickerContext as te } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js";
|
|
20
|
+
import { DatePickerViewControl as ae } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js";
|
|
21
|
+
import { DatePickerYearSelect as ie } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js";
|
|
22
|
+
import { DatePickerPrevTrigger as oe } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js";
|
|
23
|
+
import { DatePickerMonthSelect as le } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js";
|
|
24
|
+
import { DatePickerNextTrigger as ne } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js";
|
|
25
|
+
import { DatePickerTable as se } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js";
|
|
26
|
+
import { DatePickerTableHead as ce } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js";
|
|
27
|
+
import { DatePickerTableRow as v } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js";
|
|
28
|
+
import { DatePickerTableHeader as me } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js";
|
|
29
|
+
import { DatePickerTableBody as de } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js";
|
|
30
|
+
import { DatePickerTableCell as pe } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js";
|
|
31
|
+
import { DatePickerTableCellTrigger as he } from "../../node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js";
|
|
32
|
+
const Ee = E(
|
|
31
33
|
({
|
|
32
|
-
placeholder: r
|
|
34
|
+
placeholder: r,
|
|
33
35
|
label: o,
|
|
34
36
|
required: l,
|
|
35
|
-
requiredLabel:
|
|
36
|
-
invalid:
|
|
37
|
-
invalidMessage:
|
|
38
|
-
selectionMode:
|
|
39
|
-
startPlaceholder:
|
|
40
|
-
endPlaceholder:
|
|
41
|
-
locale:
|
|
42
|
-
isCalendarOnly:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
requiredLabel: n,
|
|
38
|
+
invalid: s,
|
|
39
|
+
invalidMessage: m,
|
|
40
|
+
selectionMode: h = "single",
|
|
41
|
+
startPlaceholder: w,
|
|
42
|
+
endPlaceholder: R,
|
|
43
|
+
locale: u = "ja-JP",
|
|
44
|
+
isCalendarOnly: F = !1,
|
|
45
|
+
portalled: g = !0,
|
|
46
|
+
...c
|
|
47
|
+
}, k) => {
|
|
48
|
+
const d = Q(), I = r ?? d("datePicker.selectDate"), W = w ?? d("datePicker.startDate"), O = R ?? d("datePicker.endDate"), j = S(), [A, H] = C.splitVariantProps({
|
|
49
|
+
...c
|
|
50
|
+
}), t = C(A), [N, p] = G(!1), V = h === "range", { triggerRef: q, portalContainerRef: L } = K(g);
|
|
51
|
+
return F ? /* @__PURE__ */ e(
|
|
52
|
+
y,
|
|
50
53
|
{
|
|
51
|
-
locale:
|
|
52
|
-
...
|
|
53
|
-
ref:
|
|
54
|
-
selectionMode:
|
|
54
|
+
locale: u,
|
|
55
|
+
...H,
|
|
56
|
+
ref: k,
|
|
57
|
+
selectionMode: h,
|
|
55
58
|
open: !0,
|
|
56
|
-
className:
|
|
57
|
-
children: /* @__PURE__ */ e(
|
|
59
|
+
className: t.root,
|
|
60
|
+
children: /* @__PURE__ */ e(x, {})
|
|
58
61
|
}
|
|
59
62
|
) : /* @__PURE__ */ a(
|
|
60
|
-
|
|
63
|
+
y,
|
|
61
64
|
{
|
|
62
|
-
locale:
|
|
63
|
-
...
|
|
64
|
-
ref:
|
|
65
|
-
selectionMode:
|
|
66
|
-
className:
|
|
67
|
-
open:
|
|
68
|
-
onOpenChange: (
|
|
69
|
-
var
|
|
70
|
-
|
|
65
|
+
locale: u,
|
|
66
|
+
...c,
|
|
67
|
+
ref: k,
|
|
68
|
+
selectionMode: h,
|
|
69
|
+
className: t.root,
|
|
70
|
+
open: N,
|
|
71
|
+
onOpenChange: (D) => {
|
|
72
|
+
var b;
|
|
73
|
+
p(D.open), (b = c.onOpenChange) == null || b.call(c, D);
|
|
71
74
|
},
|
|
72
75
|
children: [
|
|
73
|
-
/* @__PURE__ */ a(
|
|
74
|
-
o && /* @__PURE__ */ a(
|
|
76
|
+
/* @__PURE__ */ a(T, { children: [
|
|
77
|
+
o && /* @__PURE__ */ a(X, { className: t.label, children: [
|
|
75
78
|
o,
|
|
76
|
-
l && /* @__PURE__ */ e("span", { className:
|
|
79
|
+
l && /* @__PURE__ */ e("span", { className: t.labelRequired, children: n ?? d("common.required") })
|
|
77
80
|
] }),
|
|
78
81
|
/* @__PURE__ */ a(
|
|
79
|
-
|
|
82
|
+
Z,
|
|
80
83
|
{
|
|
81
|
-
className:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
className: f(
|
|
85
|
+
t.inputWrapper,
|
|
86
|
+
i({
|
|
84
87
|
_expanded: {
|
|
85
88
|
outlineWidth: "sd.system.dimension.border.thick",
|
|
86
89
|
outlineColor: "sd.system.color.impression.primary"
|
|
87
90
|
}
|
|
88
91
|
})
|
|
89
92
|
),
|
|
90
|
-
"data-expanded":
|
|
91
|
-
"data-Invalid":
|
|
93
|
+
"data-expanded": N ? !0 : void 0,
|
|
94
|
+
"data-Invalid": s,
|
|
92
95
|
children: [
|
|
93
|
-
/* @__PURE__ */ e("div", { className:
|
|
94
|
-
|
|
96
|
+
/* @__PURE__ */ e("div", { className: t.leftContent, children: /* @__PURE__ */ e(
|
|
97
|
+
$,
|
|
98
|
+
{
|
|
99
|
+
className: i({ display: "flex" }),
|
|
100
|
+
ref: q,
|
|
101
|
+
children: /* @__PURE__ */ e(B, {})
|
|
102
|
+
}
|
|
103
|
+
) }),
|
|
104
|
+
V ? /* @__PURE__ */ a(
|
|
95
105
|
"div",
|
|
96
106
|
{
|
|
97
|
-
className:
|
|
107
|
+
className: i({
|
|
98
108
|
display: "grid",
|
|
99
109
|
gridTemplateColumns: "1fr auto 1fr",
|
|
100
110
|
alignItems: "center"
|
|
101
111
|
}),
|
|
102
112
|
children: [
|
|
103
113
|
/* @__PURE__ */ e(
|
|
104
|
-
|
|
114
|
+
P,
|
|
105
115
|
{
|
|
106
116
|
index: 0,
|
|
107
|
-
placeholder:
|
|
108
|
-
className:
|
|
109
|
-
|
|
110
|
-
|
|
117
|
+
placeholder: W,
|
|
118
|
+
className: f(
|
|
119
|
+
t.input,
|
|
120
|
+
i({
|
|
111
121
|
minWidth: "100%",
|
|
112
122
|
borderRadius: "sd.system.dimension.radius.medium"
|
|
113
123
|
})
|
|
114
124
|
),
|
|
115
|
-
onFocus: () =>
|
|
125
|
+
onFocus: () => p(!0)
|
|
116
126
|
}
|
|
117
127
|
),
|
|
118
|
-
/* @__PURE__ */ e(
|
|
128
|
+
/* @__PURE__ */ e(J, {}),
|
|
119
129
|
/* @__PURE__ */ e(
|
|
120
|
-
|
|
130
|
+
P,
|
|
121
131
|
{
|
|
122
132
|
index: 1,
|
|
123
|
-
placeholder:
|
|
124
|
-
className:
|
|
125
|
-
|
|
126
|
-
|
|
133
|
+
placeholder: O,
|
|
134
|
+
className: f(
|
|
135
|
+
t.input,
|
|
136
|
+
i({
|
|
127
137
|
minWidth: "100%",
|
|
128
138
|
borderRadius: "sd.system.dimension.radius.medium"
|
|
129
139
|
})
|
|
130
140
|
),
|
|
131
|
-
onFocus: () =>
|
|
141
|
+
onFocus: () => p(!0)
|
|
132
142
|
}
|
|
133
143
|
)
|
|
134
144
|
]
|
|
135
145
|
}
|
|
136
146
|
) : /* @__PURE__ */ e(
|
|
137
|
-
|
|
147
|
+
P,
|
|
138
148
|
{
|
|
139
|
-
placeholder:
|
|
140
|
-
className:
|
|
141
|
-
onFocus: () =>
|
|
149
|
+
placeholder: I,
|
|
150
|
+
className: t.input,
|
|
151
|
+
onFocus: () => p(!0)
|
|
142
152
|
}
|
|
143
153
|
),
|
|
144
154
|
/* @__PURE__ */ e("div", {})
|
|
145
155
|
]
|
|
146
156
|
}
|
|
147
157
|
),
|
|
148
|
-
|
|
158
|
+
s && m && /* @__PURE__ */ e("div", { className: t.messageField, children: /* @__PURE__ */ e("p", { className: t.invalidMessage, children: m }) })
|
|
149
159
|
] }),
|
|
150
|
-
/* @__PURE__ */ e(
|
|
160
|
+
/* @__PURE__ */ e(U, { disabled: !g, container: L, children: /* @__PURE__ */ e(M, { className: j.positioner, children: /* @__PURE__ */ e(x, {}) }) })
|
|
151
161
|
]
|
|
152
162
|
}
|
|
153
163
|
);
|
|
154
164
|
}
|
|
155
|
-
),
|
|
156
|
-
const r =
|
|
157
|
-
return /* @__PURE__ */ e(
|
|
158
|
-
/* @__PURE__ */ a(
|
|
165
|
+
), x = () => {
|
|
166
|
+
const r = S();
|
|
167
|
+
return /* @__PURE__ */ e(ee, { className: r.content, children: /* @__PURE__ */ e(re, { view: "day", className: r.view, children: /* @__PURE__ */ e(te, { children: (o) => /* @__PURE__ */ a(T, { children: [
|
|
168
|
+
/* @__PURE__ */ a(ae, { className: r.viewControl, children: [
|
|
159
169
|
/* @__PURE__ */ a("div", { className: r.selectWrapper, children: [
|
|
160
|
-
/* @__PURE__ */ e(
|
|
161
|
-
/* @__PURE__ */ e(
|
|
170
|
+
/* @__PURE__ */ e(ie, { className: r.select }),
|
|
171
|
+
/* @__PURE__ */ e(Y, { className: r.selectIcon })
|
|
162
172
|
] }),
|
|
163
|
-
/* @__PURE__ */ a("div", { className:
|
|
164
|
-
/* @__PURE__ */ e(
|
|
173
|
+
/* @__PURE__ */ a("div", { className: i({ display: "flex", alignItems: "center" }), children: [
|
|
174
|
+
/* @__PURE__ */ e(oe, { className: r.prevTrigger, children: /* @__PURE__ */ e(_, {}) }),
|
|
165
175
|
/* @__PURE__ */ e(
|
|
166
|
-
|
|
176
|
+
le,
|
|
167
177
|
{
|
|
168
|
-
className:
|
|
178
|
+
className: i({
|
|
169
179
|
appearance: "none",
|
|
170
180
|
textAlign: "center"
|
|
171
181
|
})
|
|
172
182
|
}
|
|
173
183
|
),
|
|
174
|
-
/* @__PURE__ */ e(
|
|
184
|
+
/* @__PURE__ */ e(ne, { className: r.nextTrigger, children: /* @__PURE__ */ e(z, {}) })
|
|
175
185
|
] })
|
|
176
186
|
] }),
|
|
177
|
-
/* @__PURE__ */ a(
|
|
178
|
-
/* @__PURE__ */ e(
|
|
179
|
-
|
|
187
|
+
/* @__PURE__ */ a(se, { className: r.table, children: [
|
|
188
|
+
/* @__PURE__ */ e(ce, { children: /* @__PURE__ */ e(v, { children: o.weekDays.map((l, n) => /* @__PURE__ */ e(
|
|
189
|
+
me,
|
|
180
190
|
{
|
|
181
191
|
className: r.tableHeader,
|
|
182
192
|
children: l.narrow
|
|
183
193
|
},
|
|
184
|
-
|
|
194
|
+
n
|
|
185
195
|
)) }) }),
|
|
186
|
-
/* @__PURE__ */ e(
|
|
187
|
-
|
|
196
|
+
/* @__PURE__ */ e(de, { children: o.weeks.map((l, n) => /* @__PURE__ */ e(v, { children: l.map((s, m) => /* @__PURE__ */ e(
|
|
197
|
+
pe,
|
|
188
198
|
{
|
|
189
|
-
value:
|
|
199
|
+
value: s,
|
|
190
200
|
className: r.tableCell,
|
|
191
201
|
children: /* @__PURE__ */ e(
|
|
192
|
-
|
|
202
|
+
he,
|
|
193
203
|
{
|
|
194
204
|
className: r.tableCellTrigger,
|
|
195
|
-
children:
|
|
205
|
+
children: s.day
|
|
196
206
|
}
|
|
197
207
|
)
|
|
198
208
|
},
|
|
199
|
-
|
|
200
|
-
)) },
|
|
209
|
+
m
|
|
210
|
+
)) }, n)) })
|
|
201
211
|
] })
|
|
202
212
|
] }) }) }) });
|
|
203
213
|
};
|
|
204
214
|
export {
|
|
205
|
-
|
|
215
|
+
Ee as DatePicker
|
|
206
216
|
};
|
|
@@ -11,5 +11,12 @@ export type DropdownMenuProps = {
|
|
|
11
11
|
items: MenuItemProps[];
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
icon?: React.ReactElement;
|
|
14
|
+
/**
|
|
15
|
+
* Portalを使用するかどうか
|
|
16
|
+
* - `true` (デフォルト): body直下にポータルする。ModalDialog/Drawer内にある場合は自動的にそのコンテンツ内にポータルされる
|
|
17
|
+
* - `false`: ポータルを使用せず、その場にレンダリングする
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
portalled?: boolean;
|
|
14
21
|
};
|
|
15
22
|
export declare const DropdownMenu: React.FC<DropdownMenuProps & MenuRootProps>;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { SerendieSymbolMenu as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { IconButton as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
1
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { SerendieSymbolMenu as u, SerendieSymbolChevronDown as y } from "@serendie/symbols";
|
|
3
|
+
import { Button as g } from "../Button/Button.js";
|
|
4
|
+
import { IconButton as h } from "../IconButton/IconButton.js";
|
|
5
|
+
import { useAutoPortalContainer as f } from "../../hooks/useAutoPortalContainer.js";
|
|
6
|
+
import { Portal as x } from "../../node_modules/@ark-ui/react/dist/components/portal/portal.js";
|
|
7
|
+
import { sva as b } from "../../styled-system/css/sva.js";
|
|
8
|
+
import { MenuRoot as S } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-root.js";
|
|
9
|
+
import { MenuTrigger as I } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-trigger.js";
|
|
10
|
+
import { MenuPositioner as v } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-positioner.js";
|
|
11
|
+
import { MenuContent as _ } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-content.js";
|
|
12
|
+
import { MenuItemGroup as C } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js";
|
|
13
|
+
import { MenuItem as M } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-item.js";
|
|
14
|
+
const w = b({
|
|
14
15
|
slots: ["content", "itemGroup", "item", "itemIcon", "button", "buttonIcon"],
|
|
15
16
|
base: {
|
|
16
17
|
content: {
|
|
@@ -18,7 +19,8 @@ const I = g({
|
|
|
18
19
|
borderRadius: "sd.system.dimension.radius.medium",
|
|
19
20
|
bg: "sd.system.color.component.surface",
|
|
20
21
|
boxShadow: "sd.system.elevation.shadow.level1",
|
|
21
|
-
outline: "none"
|
|
22
|
+
outline: "none",
|
|
23
|
+
zIndex: "sd.system.elevation.zIndex.dropdown"
|
|
22
24
|
},
|
|
23
25
|
itemGroup: {
|
|
24
26
|
width: 240
|
|
@@ -81,17 +83,18 @@ const I = g({
|
|
|
81
83
|
transition: "transform 0.2s"
|
|
82
84
|
}
|
|
83
85
|
}
|
|
84
|
-
}),
|
|
85
|
-
styleType:
|
|
86
|
-
title:
|
|
87
|
-
items:
|
|
88
|
-
disabled:
|
|
89
|
-
icon:
|
|
90
|
-
|
|
86
|
+
}), O = ({
|
|
87
|
+
styleType: d = "default",
|
|
88
|
+
title: n,
|
|
89
|
+
items: a,
|
|
90
|
+
disabled: s,
|
|
91
|
+
icon: l,
|
|
92
|
+
portalled: i = !0,
|
|
93
|
+
...c
|
|
91
94
|
}) => {
|
|
92
|
-
const o =
|
|
93
|
-
return /* @__PURE__ */
|
|
94
|
-
|
|
95
|
+
const o = w(), { triggerRef: r, portalContainerRef: p } = f(i);
|
|
96
|
+
return /* @__PURE__ */ m(
|
|
97
|
+
S,
|
|
95
98
|
{
|
|
96
99
|
positioning: {
|
|
97
100
|
offset: {
|
|
@@ -99,30 +102,32 @@ const I = g({
|
|
|
99
102
|
crossAxis: 0
|
|
100
103
|
}
|
|
101
104
|
},
|
|
102
|
-
...
|
|
105
|
+
...c,
|
|
103
106
|
children: [
|
|
104
|
-
/* @__PURE__ */ e(
|
|
105
|
-
|
|
107
|
+
/* @__PURE__ */ e(I, { asChild: !0, children: d === "iconButton" ? /* @__PURE__ */ e(
|
|
108
|
+
h,
|
|
106
109
|
{
|
|
107
|
-
|
|
110
|
+
ref: r,
|
|
111
|
+
icon: l || /* @__PURE__ */ e(u, { className: o.buttonIcon }),
|
|
108
112
|
shape: "rectangle",
|
|
109
|
-
disabled:
|
|
113
|
+
disabled: s,
|
|
110
114
|
styleType: "outlined",
|
|
111
|
-
title:
|
|
115
|
+
title: n
|
|
112
116
|
}
|
|
113
117
|
) : /* @__PURE__ */ e(
|
|
114
|
-
|
|
118
|
+
g,
|
|
115
119
|
{
|
|
120
|
+
ref: r,
|
|
116
121
|
styleType: "rectangle",
|
|
117
122
|
size: "medium",
|
|
118
|
-
disabled:
|
|
119
|
-
rightIcon: /* @__PURE__ */ e(
|
|
123
|
+
disabled: s,
|
|
124
|
+
rightIcon: /* @__PURE__ */ e(y, { className: o.buttonIcon }),
|
|
120
125
|
className: o.button,
|
|
121
|
-
children:
|
|
126
|
+
children: n
|
|
122
127
|
}
|
|
123
128
|
) }),
|
|
124
|
-
/* @__PURE__ */ e(
|
|
125
|
-
|
|
129
|
+
/* @__PURE__ */ e(x, { disabled: !i, container: p, children: /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(_, { className: o.content, children: /* @__PURE__ */ e(C, { className: o.itemGroup, children: a.map((t) => /* @__PURE__ */ m(
|
|
130
|
+
M,
|
|
126
131
|
{
|
|
127
132
|
value: t.value,
|
|
128
133
|
className: o.item,
|
|
@@ -138,6 +143,6 @@ const I = g({
|
|
|
138
143
|
);
|
|
139
144
|
};
|
|
140
145
|
export {
|
|
141
|
-
|
|
142
|
-
|
|
146
|
+
O as DropdownMenu,
|
|
147
|
+
w as DropdownMenuStyle
|
|
143
148
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DialogRootProps } from '@ark-ui/react';
|
|
2
2
|
import { RecipeVariantProps } from '../../../styled-system/css';
|
|
3
|
+
import { ButtonProps } from '../Button';
|
|
3
4
|
declare const ModalDialogStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"title" | "description" | "content" | "backdrop" | "contentInner" | "closeTrigger" | "buttonWrapper", import('../../../styled-system/types').SlotRecipeVariantRecord<"title" | "description" | "content" | "backdrop" | "contentInner" | "closeTrigger" | "buttonWrapper">>;
|
|
4
5
|
type Props = {
|
|
5
6
|
isOpen: boolean;
|
|
@@ -9,6 +10,7 @@ type Props = {
|
|
|
9
10
|
cancelButtonLabel?: string;
|
|
10
11
|
submitButtonLabel: string;
|
|
11
12
|
onButtonClick: () => void;
|
|
13
|
+
submitButtonProps?: ButtonProps;
|
|
12
14
|
};
|
|
13
15
|
export type ModalDialogProps = Props & DialogRootProps & RecipeVariantProps<typeof ModalDialogStyle>;
|
|
14
16
|
export declare const ModalDialog: React.FC<ModalDialogProps>;
|