@charcoal-ui/react-sandbox 3.7.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +518 -1089
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +521 -1106
- package/dist/index.esm.js.map +1 -1
- package/package.json +8 -7
- package/src/components/Carousel/__snapshots__/index.story.storyshot +1 -1
- package/src/components/CarouselButton/__snapshots__/index.story.storyshot +2 -2
- package/src/components/Filter/__snapshots__/index.story.storyshot +3 -3
- package/src/components/HintText/__snapshots__/index.story.storyshot +1 -1
- package/src/components/Layout/__snapshots__/index.story.storyshot +4 -4
- package/src/components/MenuListItem/__snapshots__/index.story.storyshot +11 -11
- package/src/components/Pager/__snapshots__/index.story.storyshot +7 -7
- package/src/components/SwitchCheckbox/__snapshots__/index.story.storyshot +4 -4
- package/src/components/TextEllipsis/__snapshots__/index.story.storyshot +1 -1
- package/src/components/WithIcon/__snapshots__/index.story.storyshot +8 -8
package/dist/index.esm.js
CHANGED
|
@@ -11,17 +11,7 @@ var FilterButton = React.forwardRef(function FilterButton2({
|
|
|
11
11
|
hover,
|
|
12
12
|
reactive = false
|
|
13
13
|
}, ref) {
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
15
|
-
ButtonLike,
|
|
16
|
-
{
|
|
17
|
-
active,
|
|
18
|
-
reactive,
|
|
19
|
-
hover,
|
|
20
|
-
onClick: active && !reactive ? void 0 : onClick,
|
|
21
|
-
ref,
|
|
22
|
-
children
|
|
23
|
-
}
|
|
24
|
-
);
|
|
14
|
+
return /* @__PURE__ */ jsx(ButtonLike, { active, reactive, hover, onClick: active && !reactive ? void 0 : onClick, ref, children });
|
|
25
15
|
});
|
|
26
16
|
var FilterIconButton = React.forwardRef(function FilterIconButton2({
|
|
27
17
|
onClick,
|
|
@@ -32,19 +22,7 @@ var FilterIconButton = React.forwardRef(function FilterIconButton2({
|
|
|
32
22
|
width,
|
|
33
23
|
height
|
|
34
24
|
}, ref) {
|
|
35
|
-
return /* @__PURE__ */ jsx(
|
|
36
|
-
StyledButtonLike,
|
|
37
|
-
{
|
|
38
|
-
active,
|
|
39
|
-
reactive,
|
|
40
|
-
hover,
|
|
41
|
-
onClick: active && !reactive ? void 0 : onClick,
|
|
42
|
-
ref,
|
|
43
|
-
buttonWidth: width,
|
|
44
|
-
buttonHeight: height,
|
|
45
|
-
children
|
|
46
|
-
}
|
|
47
|
-
);
|
|
25
|
+
return /* @__PURE__ */ jsx(StyledButtonLike, { active, reactive, hover, onClick: active && !reactive ? void 0 : onClick, ref, buttonWidth: width, buttonHeight: height, children });
|
|
48
26
|
});
|
|
49
27
|
var FilterLink = React.forwardRef(function FilterLink2({
|
|
50
28
|
onClick,
|
|
@@ -54,79 +32,50 @@ var FilterLink = React.forwardRef(function FilterLink2({
|
|
|
54
32
|
reactive = false,
|
|
55
33
|
...props
|
|
56
34
|
}, ref) {
|
|
57
|
-
const {
|
|
35
|
+
const {
|
|
36
|
+
Link
|
|
37
|
+
} = useComponentAbstraction();
|
|
58
38
|
if (active && !reactive) {
|
|
59
39
|
return /* @__PURE__ */ jsx(PlainElement, { active: true, hover, ref, children });
|
|
60
40
|
} else {
|
|
61
|
-
return /* @__PURE__ */ jsx(Link, { ...props, onClick, children: /* @__PURE__ */ jsx(
|
|
62
|
-
PlainElement,
|
|
63
|
-
{
|
|
64
|
-
active,
|
|
65
|
-
reactive,
|
|
66
|
-
hover,
|
|
67
|
-
ref,
|
|
68
|
-
children
|
|
69
|
-
}
|
|
70
|
-
) });
|
|
41
|
+
return /* @__PURE__ */ jsx(Link, { ...props, onClick, children: /* @__PURE__ */ jsx(PlainElement, { active, reactive, hover, ref, children }) });
|
|
71
42
|
}
|
|
72
43
|
});
|
|
73
|
-
var buttonCss = css
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
`;
|
|
109
|
-
var padding0Css = css`
|
|
110
|
-
padding: 0;
|
|
111
|
-
|
|
112
|
-
@media ${({ theme: theme2 }) => maxWidth(theme2.breakpoint.screen1)} {
|
|
113
|
-
padding: 0;
|
|
114
|
-
}
|
|
115
|
-
`;
|
|
116
|
-
var ButtonLike = styled.button`
|
|
117
|
-
${buttonCss}
|
|
118
|
-
`;
|
|
119
|
-
var PlainElement = styled.span`
|
|
120
|
-
${buttonCss}
|
|
121
|
-
`;
|
|
122
|
-
var StyledButtonLike = styled(ButtonLike)`
|
|
123
|
-
${padding0Css};
|
|
124
|
-
${(p) => p.buttonWidth !== void 0 && `width: ${p.buttonWidth}px;`}
|
|
125
|
-
${(p) => p.buttonHeight !== void 0 && `height: ${p.buttonHeight}px;`}
|
|
126
|
-
`;
|
|
127
|
-
var Filter = styled.div`
|
|
128
|
-
display: flex;
|
|
129
|
-
`;
|
|
44
|
+
var buttonCss = css(["display:block;outline:none;border:none;padding:9px 24px;font-size:14px;line-height:22px;font-weight:bold;border-radius:2000px;transition:color 0.2s;color:", ";cursor:pointer;user-select:none;background-color:transparent;&:hover{color:", ";}", " ", " ", " @media ", "{padding:5px 16px;}"], ({
|
|
45
|
+
theme: theme2
|
|
46
|
+
}) => theme2.color.text3, ({
|
|
47
|
+
theme: theme2
|
|
48
|
+
}) => theme2.color.text2, ({
|
|
49
|
+
hover = false
|
|
50
|
+
}) => hover && css(["color:", ";"], ({
|
|
51
|
+
theme: theme2
|
|
52
|
+
}) => theme2.color.text2), ({
|
|
53
|
+
active = false
|
|
54
|
+
}) => active && css(["background-color:", ";color:", ";"], ({
|
|
55
|
+
theme: theme2
|
|
56
|
+
}) => theme2.color.surface3, ({
|
|
57
|
+
theme: theme2
|
|
58
|
+
}) => theme2.color.text2), ({
|
|
59
|
+
active = false,
|
|
60
|
+
reactive = false
|
|
61
|
+
}) => active && !reactive && css(["cursor:default;"]), ({
|
|
62
|
+
theme: theme2
|
|
63
|
+
}) => maxWidth(theme2.breakpoint.screen1));
|
|
64
|
+
var padding0Css = css(["padding:0;@media ", "{padding:0;}"], ({
|
|
65
|
+
theme: theme2
|
|
66
|
+
}) => maxWidth(theme2.breakpoint.screen1));
|
|
67
|
+
var ButtonLike = styled.button.withConfig({
|
|
68
|
+
componentId: "ccl__sc-g0cfzt-0"
|
|
69
|
+
})(["", ""], buttonCss);
|
|
70
|
+
var PlainElement = styled.span.withConfig({
|
|
71
|
+
componentId: "ccl__sc-g0cfzt-1"
|
|
72
|
+
})(["", ""], buttonCss);
|
|
73
|
+
var StyledButtonLike = styled(ButtonLike).withConfig({
|
|
74
|
+
componentId: "ccl__sc-g0cfzt-2"
|
|
75
|
+
})(["", ";", " ", ""], padding0Css, (p) => p.buttonWidth !== void 0 && `width: ${p.buttonWidth}px;`, (p) => p.buttonHeight !== void 0 && `height: ${p.buttonHeight}px;`);
|
|
76
|
+
var Filter = styled.div.withConfig({
|
|
77
|
+
componentId: "ccl__sc-g0cfzt-3"
|
|
78
|
+
})(["display:flex;"]);
|
|
130
79
|
var Filter_default = Filter;
|
|
131
80
|
|
|
132
81
|
// src/components/HintText/index.tsx
|
|
@@ -152,33 +101,14 @@ function IconBase({
|
|
|
152
101
|
fillRule,
|
|
153
102
|
clipRule
|
|
154
103
|
}) {
|
|
155
|
-
return /* @__PURE__ */ jsx2(
|
|
156
|
-
Icon,
|
|
157
|
-
{
|
|
158
|
-
viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`,
|
|
159
|
-
size: size3,
|
|
160
|
-
currentColor,
|
|
161
|
-
children: /* @__PURE__ */ jsx2(
|
|
162
|
-
IconBasePath,
|
|
163
|
-
{
|
|
164
|
-
path: path2,
|
|
165
|
-
transform,
|
|
166
|
-
fillRule,
|
|
167
|
-
clipRule
|
|
168
|
-
}
|
|
169
|
-
)
|
|
170
|
-
}
|
|
171
|
-
);
|
|
104
|
+
return /* @__PURE__ */ jsx2(Icon, { viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`, size: size3, currentColor, children: /* @__PURE__ */ jsx2(IconBasePath, { path: path2, transform, fillRule, clipRule }) });
|
|
172
105
|
}
|
|
173
|
-
var Icon = styled3.svg
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
font-size: 0;
|
|
180
|
-
vertical-align: middle;
|
|
181
|
-
`;
|
|
106
|
+
var Icon = styled3.svg.withConfig({
|
|
107
|
+
componentId: "ccl__sc-ifc22c-0"
|
|
108
|
+
})(["stroke:none;fill:", ";width:", "px;height:", "px;line-height:0;font-size:0;vertical-align:middle;"], ({
|
|
109
|
+
currentColor = false,
|
|
110
|
+
theme: theme2
|
|
111
|
+
}) => currentColor ? "currentColor" : theme2.color.text2, (props) => props.size, (props) => props.size);
|
|
182
112
|
var IconBasePath = ({
|
|
183
113
|
path: path2,
|
|
184
114
|
transform,
|
|
@@ -186,15 +116,7 @@ var IconBasePath = ({
|
|
|
186
116
|
clipRule
|
|
187
117
|
}) => {
|
|
188
118
|
if (typeof path2 === "string") {
|
|
189
|
-
return /* @__PURE__ */ jsx2(
|
|
190
|
-
"path",
|
|
191
|
-
{
|
|
192
|
-
d: path2,
|
|
193
|
-
transform,
|
|
194
|
-
fillRule,
|
|
195
|
-
clipRule
|
|
196
|
-
}
|
|
197
|
-
);
|
|
119
|
+
return /* @__PURE__ */ jsx2("path", { d: path2, transform, fillRule, clipRule });
|
|
198
120
|
} else {
|
|
199
121
|
return /* @__PURE__ */ jsx2(Fragment, { children: path2 });
|
|
200
122
|
}
|
|
@@ -205,71 +127,46 @@ import { Fragment as Fragment2, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
|
205
127
|
var size = 16;
|
|
206
128
|
function InfoIcon() {
|
|
207
129
|
const path2 = /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
208
|
-
/* @__PURE__ */ jsx3(
|
|
209
|
-
|
|
210
|
-
{
|
|
211
|
-
d: "M8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183\n 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16Z"
|
|
212
|
-
}
|
|
213
|
-
),
|
|
214
|
-
/* @__PURE__ */ jsx3(
|
|
215
|
-
Path,
|
|
216
|
-
{
|
|
217
|
-
d: "M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629\n 4.68629 2 8 2C11.3137 2 14 4.68629 14 8ZM8 6.25C8.69036 6.25 9.25 5.69036\n 9.25 5C9.25 4.30964 8.69036 3.75 8 3.75C7.30964 3.75 6.75 4.30964 6.75\n 5C6.75 5.69036 7.30964 6.25 8 6.25ZM7 7.75V11.25C7 11.8023 7.44772 12.25\n 8 12.25C8.55228 12.25 9 11.8023 9 11.25V7.75C9 7.19772 8.55228 6.75 8\n 6.75C7.44772 6.75 7 7.19772 7 7.75Z"
|
|
218
|
-
}
|
|
219
|
-
)
|
|
130
|
+
/* @__PURE__ */ jsx3("path", { d: "M8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183\n 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16Z" }),
|
|
131
|
+
/* @__PURE__ */ jsx3(Path, { d: "M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629\n 4.68629 2 8 2C11.3137 2 14 4.68629 14 8ZM8 6.25C8.69036 6.25 9.25 5.69036\n 9.25 5C9.25 4.30964 8.69036 3.75 8 3.75C7.30964 3.75 6.75 4.30964 6.75\n 5C6.75 5.69036 7.30964 6.25 8 6.25ZM7 7.75V11.25C7 11.8023 7.44772 12.25\n 8 12.25C8.55228 12.25 9 11.8023 9 11.25V7.75C9 7.19772 8.55228 6.75 8\n 6.75C7.44772 6.75 7 7.19772 7 7.75Z" })
|
|
220
132
|
] });
|
|
221
133
|
return /* @__PURE__ */ jsx3(IconBase, { viewBoxSize: size, size, currentColor: true, path: path2 });
|
|
222
134
|
}
|
|
223
|
-
var Path = styled4.path
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
135
|
+
var Path = styled4.path.withConfig({
|
|
136
|
+
componentId: "ccl__sc-1yb63qx-0"
|
|
137
|
+
})(["fill:", ";fill-rule:evenodd;"], ({
|
|
138
|
+
theme: theme2
|
|
139
|
+
}) => theme2.color.surface1);
|
|
227
140
|
|
|
228
141
|
// src/components/HintText/index.tsx
|
|
229
142
|
import { maxWidth as maxWidth2 } from "@charcoal-ui/utils";
|
|
230
143
|
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
231
|
-
function HintText({
|
|
144
|
+
function HintText({
|
|
145
|
+
children,
|
|
146
|
+
context,
|
|
147
|
+
className
|
|
148
|
+
}) {
|
|
232
149
|
return /* @__PURE__ */ jsxs2(Container, { className, context, children: [
|
|
233
150
|
/* @__PURE__ */ jsx4(IconWrap, { children: /* @__PURE__ */ jsx4(InfoIcon, {}) }),
|
|
234
151
|
/* @__PURE__ */ jsx4(Text, { children })
|
|
235
152
|
] });
|
|
236
153
|
}
|
|
237
|
-
var Container = styled5.div.attrs(
|
|
238
|
-
|
|
239
|
-
)
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
${(p) => theme((o) => [
|
|
249
|
-
o.padding.vertical(p.screen1.vertical),
|
|
250
|
-
o.padding.horizontal(p.screen1.horizontal)
|
|
251
|
-
])}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
display: flex;
|
|
255
|
-
align-items: flex-start;
|
|
256
|
-
${(p) => p.context === "page" && css2`
|
|
257
|
-
justify-content: center;
|
|
258
|
-
`}
|
|
259
|
-
`;
|
|
260
|
-
var IconWrap = styled5.div`
|
|
261
|
-
display: flex;
|
|
262
|
-
align-items: center;
|
|
263
|
-
color: ${(p) => p.theme.color.text4};
|
|
264
|
-
height: 22px;
|
|
265
|
-
margin: -4px 4px -4px 0;
|
|
266
|
-
`;
|
|
267
|
-
var Text = styled5.p`
|
|
268
|
-
${theme((o) => [o.font.text2, o.typography(14)])}
|
|
269
|
-
margin: 0;
|
|
270
|
-
`;
|
|
154
|
+
var Container = styled5.div.attrs(styledProps).withConfig({
|
|
155
|
+
componentId: "ccl__sc-nb0aj3-0"
|
|
156
|
+
})(["", " @media ", "{", "}display:flex;align-items:flex-start;", ""], (p) => theme((o) => [o.bg.surface3, o.borderRadius(8), o.padding.vertical(p.default.vertical), o.padding.horizontal(p.default.horizontal)]), ({
|
|
157
|
+
theme: t
|
|
158
|
+
}) => maxWidth2(t.breakpoint.screen1), (p) => theme((o) => [o.padding.vertical(p.screen1.vertical), o.padding.horizontal(p.screen1.horizontal)]), (p) => p.context === "page" && css2(["justify-content:center;"]));
|
|
159
|
+
var IconWrap = styled5.div.withConfig({
|
|
160
|
+
componentId: "ccl__sc-nb0aj3-1"
|
|
161
|
+
})(["display:flex;align-items:center;color:", ";height:22px;margin:-4px 4px -4px 0;"], (p) => p.theme.color.text4);
|
|
162
|
+
var Text = styled5.p.withConfig({
|
|
163
|
+
componentId: "ccl__sc-nb0aj3-2"
|
|
164
|
+
})(["", " margin:0;"], theme((o) => [o.font.text2, o.typography(14)]));
|
|
271
165
|
function styledProps(props) {
|
|
272
|
-
return {
|
|
166
|
+
return {
|
|
167
|
+
...props,
|
|
168
|
+
...contextToProps(props.context)
|
|
169
|
+
};
|
|
273
170
|
}
|
|
274
171
|
function contextToProps(context) {
|
|
275
172
|
switch (context) {
|
|
@@ -307,22 +204,10 @@ import styled6, { createGlobalStyle, css as css3 } from "styled-components";
|
|
|
307
204
|
import { columnSystem, COLUMN_UNIT, GUTTER_UNIT } from "@charcoal-ui/foundation";
|
|
308
205
|
var MAIN_COLUMN_HORIZONTAL_MIN_MARGIN = 72;
|
|
309
206
|
var RESPONSIVE_LEFT_WIDTH = columnSystem(2, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT;
|
|
310
|
-
var RESPONSIVE_MAIN_MAX_WIDTH = columnSystem(
|
|
311
|
-
12,
|
|
312
|
-
COLUMN_UNIT,
|
|
313
|
-
GUTTER_UNIT
|
|
314
|
-
);
|
|
207
|
+
var RESPONSIVE_MAIN_MAX_WIDTH = columnSystem(12, COLUMN_UNIT, GUTTER_UNIT);
|
|
315
208
|
|
|
316
209
|
// src/foundation/hooks.ts
|
|
317
|
-
import {
|
|
318
|
-
useCallback,
|
|
319
|
-
useDebugValue,
|
|
320
|
-
useLayoutEffect,
|
|
321
|
-
useMemo,
|
|
322
|
-
useReducer,
|
|
323
|
-
useRef,
|
|
324
|
-
useState
|
|
325
|
-
} from "react";
|
|
210
|
+
import { useCallback, useDebugValue, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
326
211
|
import ReactDOM from "react-dom";
|
|
327
212
|
import { useTheme } from "styled-components";
|
|
328
213
|
import { maxWidth as maxWidth3 } from "@charcoal-ui/utils";
|
|
@@ -330,16 +215,13 @@ function useMediaScreen1() {
|
|
|
330
215
|
return useMedia(maxWidth3(useTheme().breakpoint.screen1));
|
|
331
216
|
}
|
|
332
217
|
function useMedia(query) {
|
|
333
|
-
const matcher = useMemo(
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
} : matchMedia(query),
|
|
341
|
-
[query]
|
|
342
|
-
);
|
|
218
|
+
const matcher = useMemo(() => __TEST__ ? {
|
|
219
|
+
matches: false,
|
|
220
|
+
addListener: () => {
|
|
221
|
+
},
|
|
222
|
+
removeListener: () => {
|
|
223
|
+
}
|
|
224
|
+
} : matchMedia(query), [query]);
|
|
343
225
|
const [matches, setMatches] = useState(matcher.matches);
|
|
344
226
|
if (matcher.matches !== matches) {
|
|
345
227
|
setMatches(matcher.matches);
|
|
@@ -367,18 +249,15 @@ function measure(ref) {
|
|
|
367
249
|
return ref !== null ? ref.getBoundingClientRect() : void 0;
|
|
368
250
|
}
|
|
369
251
|
function useElementSize(ref, deps = []) {
|
|
370
|
-
const [size3, setSize] = useReducer(
|
|
371
|
-
(state
|
|
372
|
-
if (state === void 0 || next === void 0) {
|
|
373
|
-
return next;
|
|
374
|
-
}
|
|
375
|
-
if (state.height === next.height && state.width === next.width) {
|
|
376
|
-
return state;
|
|
377
|
-
}
|
|
252
|
+
const [size3, setSize] = useReducer((state, next) => {
|
|
253
|
+
if (state === void 0 || next === void 0) {
|
|
378
254
|
return next;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
|
|
255
|
+
}
|
|
256
|
+
if (state.height === next.height && state.width === next.width) {
|
|
257
|
+
return state;
|
|
258
|
+
}
|
|
259
|
+
return next;
|
|
260
|
+
}, void 0);
|
|
382
261
|
const [watch, setWatch] = useState(null);
|
|
383
262
|
useLayoutEffect(() => {
|
|
384
263
|
if (watch === null) {
|
|
@@ -462,149 +341,91 @@ function Layout({
|
|
|
462
341
|
/* @__PURE__ */ jsx5(GlobalStyle, {})
|
|
463
342
|
] });
|
|
464
343
|
}
|
|
465
|
-
var HeaderTopMenuContainer = styled6.div
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
grid-auto-rows: auto;
|
|
540
|
-
|
|
541
|
-
@media ${({ theme: theme2 }) => maxWidth4(theme2.breakpoint.screen1)} {
|
|
542
|
-
gap: 0;
|
|
543
|
-
background-color: ${({ theme: theme2 }) => theme2.color.background1};
|
|
544
|
-
padding-bottom: 60px;
|
|
545
|
-
}
|
|
546
|
-
`;
|
|
547
|
-
var LayoutItem = React2.forwardRef(
|
|
548
|
-
function LayoutItem2({ span, children }, ref) {
|
|
549
|
-
const { withLeft } = useContext(LayoutConfigContext);
|
|
550
|
-
return /* @__PURE__ */ jsx5(StyledLayoutItem, { span, withLeft, ref, children });
|
|
551
|
-
}
|
|
552
|
-
);
|
|
553
|
-
var StyledLayoutItem = styled6.div`
|
|
554
|
-
grid-column-start: auto;
|
|
555
|
-
grid-column-end: span ${(p) => p.span};
|
|
556
|
-
border-radius: 24px;
|
|
557
|
-
color: ${({ theme: theme2 }) => theme2.color.text2};
|
|
558
|
-
background-color: ${({ theme: theme2 }) => theme2.color.background1};
|
|
559
|
-
/* https://www.w3.org/TR/css-grid-1/#min-size-auto */
|
|
560
|
-
min-width: 0;
|
|
561
|
-
|
|
562
|
-
@media ${(p) => p.withLeft ? p.theme.breakpoint.screen4 : p.theme.breakpoint.screen3} {
|
|
563
|
-
${(p) => p.span > 2 && css3`
|
|
564
|
-
grid-column-end: span 2;
|
|
565
|
-
`}
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
@media ${({ theme: theme2 }) => maxWidth4(theme2.breakpoint.screen1)} {
|
|
569
|
-
${(p) => p.span > 1 && css3`
|
|
570
|
-
grid-column-end: span 1;
|
|
571
|
-
`}
|
|
572
|
-
|
|
573
|
-
border-radius: 0;
|
|
574
|
-
padding-bottom: 40px;
|
|
575
|
-
}
|
|
576
|
-
`;
|
|
577
|
-
function LayoutItemHeader({ children }) {
|
|
578
|
-
const { wide, center } = useContext(LayoutConfigContext);
|
|
344
|
+
var HeaderTopMenuContainer = styled6.div.withConfig({
|
|
345
|
+
componentId: "ccl__sc-j6bt5m-0"
|
|
346
|
+
})(["margin-bottom:40px;overflow-x:auto;word-break:keep-all;@media ", "{margin-bottom:0;padding-left:16px;padding-bottom:16px;background-color:", ";}"], ({
|
|
347
|
+
theme: theme2
|
|
348
|
+
}) => maxWidth4(theme2.breakpoint.screen1), ({
|
|
349
|
+
theme: theme2
|
|
350
|
+
}) => theme2.color.surface2);
|
|
351
|
+
var GlobalStyle = createGlobalStyle([":root{background-color:", ";@media ", "{background-color:", ";}}"], ({
|
|
352
|
+
theme: theme2
|
|
353
|
+
}) => theme2.color.background2, ({
|
|
354
|
+
theme: theme2
|
|
355
|
+
}) => maxWidth4(theme2.breakpoint.screen1), ({
|
|
356
|
+
theme: theme2
|
|
357
|
+
}) => theme2.color.background1);
|
|
358
|
+
var LayoutRoot = styled6.div.withConfig({
|
|
359
|
+
componentId: "ccl__sc-j6bt5m-1"
|
|
360
|
+
})(["display:flex;background-color:", ";@media ", "{background-color:", ";}"], ({
|
|
361
|
+
theme: theme2
|
|
362
|
+
}) => theme2.color.background2, ({
|
|
363
|
+
theme: theme2
|
|
364
|
+
}) => maxWidth4(theme2.breakpoint.screen1), ({
|
|
365
|
+
theme: theme2
|
|
366
|
+
}) => theme2.color.background1);
|
|
367
|
+
var LeftArea = styled6.div.withConfig({
|
|
368
|
+
componentId: "ccl__sc-j6bt5m-2"
|
|
369
|
+
})(["min-width:", "px;padding:40px 0 40px ", "px;box-sizing:border-box;@media ", "{display:none;}"], RESPONSIVE_LEFT_WIDTH, GUTTER_UNIT2, ({
|
|
370
|
+
theme: theme2
|
|
371
|
+
}) => theme2.breakpoint.screen3);
|
|
372
|
+
var MainArea = styled6.div.withConfig({
|
|
373
|
+
componentId: "ccl__sc-j6bt5m-3"
|
|
374
|
+
})(["flex-grow:1;min-width:0;max-width:", "px;padding:40px ", "px;margin:0 auto;display:flex;flex-direction:column;@media ", "{padding:0;}"], (p) => p.center ? columnSystem2(6, COLUMN_UNIT2, GUTTER_UNIT2) : RESPONSIVE_MAIN_MAX_WIDTH, MAIN_COLUMN_HORIZONTAL_MIN_MARGIN, ({
|
|
375
|
+
theme: theme2
|
|
376
|
+
}) => maxWidth4(theme2.breakpoint.screen1));
|
|
377
|
+
var Header = styled6.div.withConfig({
|
|
378
|
+
componentId: "ccl__sc-j6bt5m-4"
|
|
379
|
+
})(["font-weight:bold;margin-bottom:12px;font-size:20px;line-height:28px;color:", ";@media ", "{margin-bottom:0;padding:12px;font-size:16px;line-height:24px;display:flex;justify-content:center;background-color:", ";}"], ({
|
|
380
|
+
theme: theme2
|
|
381
|
+
}) => theme2.color.text2, ({
|
|
382
|
+
theme: theme2
|
|
383
|
+
}) => maxWidth4(theme2.breakpoint.screen1), ({
|
|
384
|
+
theme: theme2
|
|
385
|
+
}) => theme2.color.surface2);
|
|
386
|
+
var Grid = styled6.div.withConfig({
|
|
387
|
+
componentId: "ccl__sc-j6bt5m-5"
|
|
388
|
+
})(["display:grid;gap:", "px;grid-template-columns:1fr;grid-auto-columns:1fr;grid-auto-rows:auto;@media ", "{gap:0;background-color:", ";padding-bottom:60px;}"], GUTTER_UNIT2, ({
|
|
389
|
+
theme: theme2
|
|
390
|
+
}) => maxWidth4(theme2.breakpoint.screen1), ({
|
|
391
|
+
theme: theme2
|
|
392
|
+
}) => theme2.color.background1);
|
|
393
|
+
var LayoutItem = React2.forwardRef(function LayoutItem2({
|
|
394
|
+
span,
|
|
395
|
+
children
|
|
396
|
+
}, ref) {
|
|
397
|
+
const {
|
|
398
|
+
withLeft
|
|
399
|
+
} = useContext(LayoutConfigContext);
|
|
400
|
+
return /* @__PURE__ */ jsx5(StyledLayoutItem, { span, withLeft, ref, children });
|
|
401
|
+
});
|
|
402
|
+
var StyledLayoutItem = styled6.div.withConfig({
|
|
403
|
+
componentId: "ccl__sc-j6bt5m-6"
|
|
404
|
+
})(["grid-column-start:auto;grid-column-end:span ", ";border-radius:24px;color:", ";background-color:", ";min-width:0;@media ", "{", "}@media ", "{", " border-radius:0;padding-bottom:40px;}"], (p) => p.span, ({
|
|
405
|
+
theme: theme2
|
|
406
|
+
}) => theme2.color.text2, ({
|
|
407
|
+
theme: theme2
|
|
408
|
+
}) => theme2.color.background1, (p) => p.withLeft ? p.theme.breakpoint.screen4 : p.theme.breakpoint.screen3, (p) => p.span > 2 && css3(["grid-column-end:span 2;"]), ({
|
|
409
|
+
theme: theme2
|
|
410
|
+
}) => maxWidth4(theme2.breakpoint.screen1), (p) => p.span > 1 && css3(["grid-column-end:span 1;"]));
|
|
411
|
+
function LayoutItemHeader({
|
|
412
|
+
children
|
|
413
|
+
}) {
|
|
414
|
+
const {
|
|
415
|
+
wide,
|
|
416
|
+
center
|
|
417
|
+
} = useContext(LayoutConfigContext);
|
|
579
418
|
return /* @__PURE__ */ jsx5(StyledLayoutItemHeader, { wide, center, children });
|
|
580
419
|
}
|
|
581
|
-
var StyledLayoutItemHeader = styled6.div
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
color: ${({ theme: theme2 }) => theme2.color.text2};
|
|
591
|
-
border-radius: 24px 24px 0 0;
|
|
592
|
-
${(p) => p.center && css3`
|
|
593
|
-
justify-content: center;
|
|
594
|
-
`}
|
|
595
|
-
|
|
596
|
-
@media ${({ theme: theme2 }) => maxWidth4(theme2.breakpoint.screen1)} {
|
|
597
|
-
margin-top: 4px;
|
|
598
|
-
padding: 0 16px;
|
|
599
|
-
background: none;
|
|
600
|
-
overflow-x: auto;
|
|
601
|
-
border-radius: unset;
|
|
602
|
-
${(p) => p.wide && css3`
|
|
603
|
-
height: 48px;
|
|
604
|
-
margin-top: 0;
|
|
605
|
-
`}
|
|
606
|
-
}
|
|
607
|
-
`;
|
|
420
|
+
var StyledLayoutItemHeader = styled6.div.withConfig({
|
|
421
|
+
componentId: "ccl__sc-j6bt5m-7"
|
|
422
|
+
})(["padding:0 ", "px;height:", "px;display:grid;align-items:center;font-size:16px;line-height:24px;font-weight:bold;background-color:", ";color:", ";border-radius:24px 24px 0 0;", " @media ", "{margin-top:4px;padding:0 16px;background:none;overflow-x:auto;border-radius:unset;", "}"], (p) => p.wide ? 40 : 24, (p) => p.wide ? 64 : 48, ({
|
|
423
|
+
theme: theme2
|
|
424
|
+
}) => theme2.color.surface2, ({
|
|
425
|
+
theme: theme2
|
|
426
|
+
}) => theme2.color.text2, (p) => p.center && css3(["justify-content:center;"]), ({
|
|
427
|
+
theme: theme2
|
|
428
|
+
}) => maxWidth4(theme2.breakpoint.screen1), (p) => p.wide && css3(["height:48px;margin-top:0;"]));
|
|
608
429
|
var LAYOUT_ITEM_BODY_PADDING = {
|
|
609
430
|
wide: {
|
|
610
431
|
x: 40,
|
|
@@ -634,39 +455,41 @@ function LayoutItemBody({
|
|
|
634
455
|
horizontal = false,
|
|
635
456
|
narrow = false
|
|
636
457
|
}) {
|
|
637
|
-
const {
|
|
458
|
+
const {
|
|
459
|
+
wide
|
|
460
|
+
} = useContext(LayoutConfigContext);
|
|
638
461
|
return /* @__PURE__ */ jsx5(StyledLayoutItemBody, { wide, horizontal, narrow, children });
|
|
639
462
|
}
|
|
640
|
-
var StyledLayoutItemBody = styled6.div
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
width: 100%;
|
|
648
|
-
box-sizing: border-box;
|
|
649
|
-
`;
|
|
463
|
+
var StyledLayoutItemBody = styled6.div.withConfig({
|
|
464
|
+
componentId: "ccl__sc-j6bt5m-8"
|
|
465
|
+
})(["padding:", ";@media ", "{padding:", ";}width:100%;box-sizing:border-box;"], (p) => p.narrow ? `${LAYOUT_ITEM_BODY_PADDING.narrow.yTop}px ${p.horizontal ? 0 : LAYOUT_ITEM_BODY_PADDING.narrow.x}px ${LAYOUT_ITEM_BODY_PADDING.narrow.yBottom}px` : p.wide ? `${p.horizontal ? 0 : LAYOUT_ITEM_BODY_PADDING.wide.y}px ${LAYOUT_ITEM_BODY_PADDING.wide.x}px` : `${p.horizontal ? 0 : LAYOUT_ITEM_BODY_PADDING.default.y}px ${LAYOUT_ITEM_BODY_PADDING.default.x}px`, ({
|
|
466
|
+
theme: theme2
|
|
467
|
+
}) => maxWidth4(theme2.breakpoint.screen1), (p) => p.narrow ? `${LAYOUT_ITEM_BODY_PADDING.narrowColumn1.yTop}px ${p.horizontal ? 0 : LAYOUT_ITEM_BODY_PADDING.narrowColumn1.x}px ${LAYOUT_ITEM_BODY_PADDING.narrowColumn1.yBottom}px` : `${LAYOUT_ITEM_BODY_PADDING.column1.y}px ${LAYOUT_ITEM_BODY_PADDING.column1.x}px ${0}`);
|
|
650
468
|
function useLayoutItemBodyPadding() {
|
|
651
|
-
const {
|
|
469
|
+
const {
|
|
470
|
+
wide
|
|
471
|
+
} = useContext(LayoutConfigContext);
|
|
652
472
|
return useMediaScreen1() ? LAYOUT_ITEM_BODY_PADDING.column1 : wide ? LAYOUT_ITEM_BODY_PADDING.wide : LAYOUT_ITEM_BODY_PADDING.default;
|
|
653
473
|
}
|
|
654
474
|
function CancelLayoutItemBodyPadding({
|
|
655
475
|
children,
|
|
656
476
|
cancelTop
|
|
657
477
|
}) {
|
|
658
|
-
const {
|
|
478
|
+
const {
|
|
479
|
+
wide
|
|
480
|
+
} = useContext(LayoutConfigContext);
|
|
659
481
|
return /* @__PURE__ */ jsx5(StyledCancelLayoutItemBodyPadding, { wide, cancelTop, children });
|
|
660
482
|
}
|
|
661
|
-
var StyledCancelLayoutItemBodyPadding = styled6.div
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
483
|
+
var StyledCancelLayoutItemBodyPadding = styled6.div.withConfig({
|
|
484
|
+
componentId: "ccl__sc-j6bt5m-9"
|
|
485
|
+
})(["margin:0 -", "px;margin-top:-", "px;@media ", "{margin:0 -", "px;margin-top:-", "px;}"], (p) => p.wide ? LAYOUT_ITEM_BODY_PADDING.wide.x : LAYOUT_ITEM_BODY_PADDING.default.x, ({
|
|
486
|
+
cancelTop = false,
|
|
487
|
+
wide
|
|
488
|
+
}) => !cancelTop ? 0 : wide ? LAYOUT_ITEM_BODY_PADDING.wide.y : LAYOUT_ITEM_BODY_PADDING.default.y, ({
|
|
489
|
+
theme: theme2
|
|
490
|
+
}) => maxWidth4(theme2.breakpoint.screen1), LAYOUT_ITEM_BODY_PADDING.column1.x, ({
|
|
491
|
+
cancelTop = false
|
|
492
|
+
}) => !cancelTop ? 0 : LAYOUT_ITEM_BODY_PADDING.column1.x);
|
|
670
493
|
|
|
671
494
|
// src/components/LeftMenu/index.tsx
|
|
672
495
|
import styled9 from "styled-components";
|
|
@@ -680,10 +503,7 @@ import styled8, { css as css5 } from "styled-components";
|
|
|
680
503
|
import styled7, { css as css4 } from "styled-components";
|
|
681
504
|
|
|
682
505
|
// src/components/TextEllipsis/helper.ts
|
|
683
|
-
import {
|
|
684
|
-
Children,
|
|
685
|
-
isValidElement
|
|
686
|
-
} from "react";
|
|
506
|
+
import { Children, isValidElement } from "react";
|
|
687
507
|
var hasChildren = (element) => isValidElement(element) && Boolean(element.props.children);
|
|
688
508
|
var childToString = (child) => {
|
|
689
509
|
if (typeof child === "undefined" || child === null || typeof child === "boolean") {
|
|
@@ -698,50 +518,39 @@ var onlyText = (children) => {
|
|
|
698
518
|
if (!Array.isArray(children) && !isValidElement(children)) {
|
|
699
519
|
return childToString(children);
|
|
700
520
|
}
|
|
701
|
-
return Children.toArray(children).reduce(
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
},
|
|
713
|
-
""
|
|
714
|
-
);
|
|
521
|
+
return Children.toArray(children).reduce((text, child) => {
|
|
522
|
+
let newText = "";
|
|
523
|
+
if (isValidElement(child) && hasChildren(child)) {
|
|
524
|
+
newText = onlyText(child.props.children);
|
|
525
|
+
} else if (isValidElement(child) && !hasChildren(child)) {
|
|
526
|
+
newText = "";
|
|
527
|
+
} else {
|
|
528
|
+
newText = childToString(child);
|
|
529
|
+
}
|
|
530
|
+
return text.concat(newText);
|
|
531
|
+
}, "");
|
|
715
532
|
};
|
|
716
533
|
|
|
717
534
|
// src/components/TextEllipsis/index.tsx
|
|
718
|
-
var TextEllipsis = styled7.div.attrs(
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
text-overflow: ellipsis;
|
|
730
|
-
white-space: nowrap;
|
|
731
|
-
` : css4`
|
|
732
|
-
display: -webkit-box;
|
|
733
|
-
-webkit-box-orient: vertical;
|
|
734
|
-
-webkit-line-clamp: ${lineLimit};
|
|
735
|
-
/* Fallback for -webkit-line-clamp */
|
|
736
|
-
max-height: ${lineHeight * lineLimit}px;
|
|
737
|
-
`}
|
|
738
|
-
`;
|
|
535
|
+
var TextEllipsis = styled7.div.attrs(({
|
|
536
|
+
children,
|
|
537
|
+
title = onlyText(children)
|
|
538
|
+
}) => ({
|
|
539
|
+
title: title !== "" ? title : void 0
|
|
540
|
+
})).withConfig({
|
|
541
|
+
componentId: "ccl__sc-1pyqrbe-0"
|
|
542
|
+
})(["overflow:hidden;line-height:", "px;overflow-wrap:break-word;", ""], (props) => props.lineHeight, ({
|
|
543
|
+
lineLimit = 1,
|
|
544
|
+
lineHeight
|
|
545
|
+
}) => lineLimit === 1 ? css4(["text-overflow:ellipsis;white-space:nowrap;"]) : css4(["display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:", ";max-height:", "px;"], lineLimit, lineHeight * lineLimit));
|
|
739
546
|
|
|
740
547
|
// src/components/MenuListItem/index.tsx
|
|
741
548
|
import { useComponentAbstraction as useComponentAbstraction2 } from "@charcoal-ui/react";
|
|
742
549
|
import { disabledSelector } from "@charcoal-ui/utils";
|
|
743
550
|
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
744
|
-
var MenuListItemContext = React3.createContext({
|
|
551
|
+
var MenuListItemContext = React3.createContext({
|
|
552
|
+
padding: 24
|
|
553
|
+
});
|
|
745
554
|
function MenuListItem({
|
|
746
555
|
primary,
|
|
747
556
|
secondary,
|
|
@@ -751,70 +560,31 @@ function MenuListItem({
|
|
|
751
560
|
gtmClass,
|
|
752
561
|
children
|
|
753
562
|
}) {
|
|
754
|
-
const {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
role: onClick !== void 0 ? "button" : void 0,
|
|
765
|
-
className: gtmClass !== void 0 ? `gtm-${gtmClass}` : void 0,
|
|
766
|
-
children: [
|
|
767
|
-
/* @__PURE__ */ jsxs4(Labels, { children: [
|
|
768
|
-
/* @__PURE__ */ jsx6(PrimaryText, { children: /* @__PURE__ */ jsx6(TextEllipsis, { lineHeight: 22, lineLimit: 1, children: primary }) }),
|
|
769
|
-
secondary !== void 0 && /* @__PURE__ */ jsx6(SecondaryText, { children: /* @__PURE__ */ jsx6(TextEllipsis, { lineHeight: 22, lineLimit: 1, children: secondary }) })
|
|
770
|
-
] }),
|
|
771
|
-
children
|
|
772
|
-
]
|
|
773
|
-
}
|
|
774
|
-
);
|
|
563
|
+
const {
|
|
564
|
+
padding
|
|
565
|
+
} = useContext2(MenuListItemContext);
|
|
566
|
+
return /* @__PURE__ */ jsxs4(Item, { hasSubLabel: secondary !== void 0, onClick: (e) => !disabled && onClick && onClick(e), sidePadding: padding, noHover, noClick: onClick === void 0, "aria-disabled": disabled, role: onClick !== void 0 ? "button" : void 0, className: gtmClass !== void 0 ? `gtm-${gtmClass}` : void 0, children: [
|
|
567
|
+
/* @__PURE__ */ jsxs4(Labels, { children: [
|
|
568
|
+
/* @__PURE__ */ jsx6(PrimaryText, { children: /* @__PURE__ */ jsx6(TextEllipsis, { lineHeight: 22, lineLimit: 1, children: primary }) }),
|
|
569
|
+
secondary !== void 0 && /* @__PURE__ */ jsx6(SecondaryText, { children: /* @__PURE__ */ jsx6(TextEllipsis, { lineHeight: 22, lineLimit: 1, children: secondary }) })
|
|
570
|
+
] }),
|
|
571
|
+
children
|
|
572
|
+
] });
|
|
775
573
|
}
|
|
776
|
-
var Item = styled8.div
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
${theme((o) => o.disabled)}
|
|
793
|
-
|
|
794
|
-
${disabledSelector} {
|
|
795
|
-
cursor: default;
|
|
796
|
-
pointer-events: none;
|
|
797
|
-
|
|
798
|
-
&:hover {
|
|
799
|
-
background-color: unset;
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
`;
|
|
803
|
-
var Labels = styled8.div`
|
|
804
|
-
display: flex;
|
|
805
|
-
flex-direction: column;
|
|
806
|
-
`;
|
|
807
|
-
var PrimaryText = styled8.div`
|
|
808
|
-
color: ${(p) => p.theme.color.text2};
|
|
809
|
-
line-height: 22px;
|
|
810
|
-
font-size: 14px;
|
|
811
|
-
display: grid;
|
|
812
|
-
`;
|
|
813
|
-
var SecondaryText = styled8.div`
|
|
814
|
-
color: ${(p) => p.theme.color.text3};
|
|
815
|
-
line-height: 18px;
|
|
816
|
-
font-size: 10px;
|
|
817
|
-
`;
|
|
574
|
+
var Item = styled8.div.withConfig({
|
|
575
|
+
componentId: "ccl__sc-1sufjh-0"
|
|
576
|
+
})(["display:flex;height:", "px;align-items:center;justify-content:space-between;padding:0 ", "px;user-select:none;cursor:", ";transition:0.2s background-color;&:hover{", "}", " ", "{cursor:default;pointer-events:none;&:hover{background-color:unset;}}"], (p) => p.hasSubLabel ? 56 : 40, (p) => p.sidePadding, (p) => p.noClick ? "default" : "pointer", (p) => !p.noHover && css5(["background-color:", ";"], ({
|
|
577
|
+
theme: theme2
|
|
578
|
+
}) => theme2.color.surface3), theme((o) => o.disabled), disabledSelector);
|
|
579
|
+
var Labels = styled8.div.withConfig({
|
|
580
|
+
componentId: "ccl__sc-1sufjh-1"
|
|
581
|
+
})(["display:flex;flex-direction:column;"]);
|
|
582
|
+
var PrimaryText = styled8.div.withConfig({
|
|
583
|
+
componentId: "ccl__sc-1sufjh-2"
|
|
584
|
+
})(["color:", ";line-height:22px;font-size:14px;display:grid;"], (p) => p.theme.color.text2);
|
|
585
|
+
var SecondaryText = styled8.div.withConfig({
|
|
586
|
+
componentId: "ccl__sc-1sufjh-3"
|
|
587
|
+
})(["color:", ";line-height:18px;font-size:10px;"], (p) => p.theme.color.text3);
|
|
818
588
|
function MenuListLinkItem({
|
|
819
589
|
link,
|
|
820
590
|
onClick,
|
|
@@ -826,7 +596,9 @@ function MenuListLinkItem({
|
|
|
826
596
|
children,
|
|
827
597
|
...linkProps
|
|
828
598
|
}) {
|
|
829
|
-
const {
|
|
599
|
+
const {
|
|
600
|
+
Link
|
|
601
|
+
} = useComponentAbstraction2();
|
|
830
602
|
const props = {
|
|
831
603
|
disabled,
|
|
832
604
|
primary,
|
|
@@ -837,9 +609,9 @@ function MenuListLinkItem({
|
|
|
837
609
|
};
|
|
838
610
|
return disabled ? /* @__PURE__ */ jsx6("span", { onClick, children: /* @__PURE__ */ jsx6(MenuListItem, { ...props }) }) : /* @__PURE__ */ jsx6(A, { as: Link, to: link, onClick, ...linkProps, children: /* @__PURE__ */ jsx6(MenuListItem, { onClick: () => void 0, ...props }) });
|
|
839
611
|
}
|
|
840
|
-
var A = styled8.a
|
|
841
|
-
|
|
842
|
-
|
|
612
|
+
var A = styled8.a.withConfig({
|
|
613
|
+
componentId: "ccl__sc-1sufjh-4"
|
|
614
|
+
})(["display:block;"]);
|
|
843
615
|
function MenuListLinkItemWithIcon({
|
|
844
616
|
icon,
|
|
845
617
|
primary: text,
|
|
@@ -862,27 +634,22 @@ function MenuListItemWithIcon({
|
|
|
862
634
|
] });
|
|
863
635
|
return /* @__PURE__ */ jsx6(MenuListItem, { primary, ...props });
|
|
864
636
|
}
|
|
865
|
-
var IconContainer = styled8.div
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
line-height: 16px;
|
|
882
|
-
color: ${({ theme: theme2 }) => theme2.color.text3};
|
|
883
|
-
margin-top: -2px;
|
|
884
|
-
margin-bottom: 6px;
|
|
885
|
-
`;
|
|
637
|
+
var IconContainer = styled8.div.withConfig({
|
|
638
|
+
componentId: "ccl__sc-1sufjh-5"
|
|
639
|
+
})(["display:grid;gap:8px;grid-auto-flow:column;align-items:center;"]);
|
|
640
|
+
var Icon2 = styled8.div.withConfig({
|
|
641
|
+
componentId: "ccl__sc-1sufjh-6"
|
|
642
|
+
})(["color:", ";display:flex;"], ({
|
|
643
|
+
theme: theme2
|
|
644
|
+
}) => theme2.color.text3);
|
|
645
|
+
var MenuListSpacer = styled8.div.withConfig({
|
|
646
|
+
componentId: "ccl__sc-1sufjh-7"
|
|
647
|
+
})(["height:24px;"]);
|
|
648
|
+
var MenuListLabel = styled8.div.withConfig({
|
|
649
|
+
componentId: "ccl__sc-1sufjh-8"
|
|
650
|
+
})(["padding:0 16px;font-size:12px;line-height:16px;color:", ";margin-top:-2px;margin-bottom:6px;"], ({
|
|
651
|
+
theme: theme2
|
|
652
|
+
}) => theme2.color.text3);
|
|
886
653
|
|
|
887
654
|
// src/components/LeftMenu/index.tsx
|
|
888
655
|
import { useComponentAbstraction as useComponentAbstraction3 } from "@charcoal-ui/react";
|
|
@@ -891,37 +658,30 @@ function LeftMenu({
|
|
|
891
658
|
links,
|
|
892
659
|
active
|
|
893
660
|
}) {
|
|
894
|
-
const {
|
|
661
|
+
const {
|
|
662
|
+
Link
|
|
663
|
+
} = useComponentAbstraction3();
|
|
895
664
|
return /* @__PURE__ */ jsx7(Container2, { children: links.map((link, index) => /* @__PURE__ */ jsx7(Link, { to: link.to, children: /* @__PURE__ */ jsx7(LinkItem, { "aria-current": link.id === active || void 0, children: link.text }) }, index)) });
|
|
896
665
|
}
|
|
897
|
-
function LeftMenuContent({
|
|
666
|
+
function LeftMenuContent({
|
|
667
|
+
links
|
|
668
|
+
}) {
|
|
898
669
|
return /* @__PURE__ */ jsx7(Fragment3, { children: links.map((link, index) => /* @__PURE__ */ jsx7(MenuListLinkItem, { link: link.to, primary: link.text }, index)) });
|
|
899
670
|
}
|
|
900
|
-
var Container2 = styled9.div
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
height: 40px;
|
|
915
|
-
transition: 0.2s color;
|
|
916
|
-
&:hover {
|
|
917
|
-
transition: 0.2s color;
|
|
918
|
-
color: ${({ theme: theme2 }) => theme2.color.text2};
|
|
919
|
-
}
|
|
920
|
-
&[aria-current] {
|
|
921
|
-
color: ${({ theme: theme2 }) => theme2.color.text2};
|
|
922
|
-
background-color: ${({ theme: theme2 }) => theme2.color.surface3};
|
|
923
|
-
}
|
|
924
|
-
`;
|
|
671
|
+
var Container2 = styled9.div.withConfig({
|
|
672
|
+
componentId: "ccl__sc-t7vwxn-0"
|
|
673
|
+
})(["display:flex;flex-direction:column;align-items:flex-start;"]);
|
|
674
|
+
var LinkItem = styled9.div.withConfig({
|
|
675
|
+
componentId: "ccl__sc-t7vwxn-1"
|
|
676
|
+
})(["display:flex;align-items:center;color:", ";border-radius:24px;font-weight:bold;font-size:14px;line-height:22px;padding:0 16px;height:40px;transition:0.2s color;&:hover{transition:0.2s color;color:", ";}&[aria-current]{color:", ";background-color:", ";}"], ({
|
|
677
|
+
theme: theme2
|
|
678
|
+
}) => theme2.color.text3, ({
|
|
679
|
+
theme: theme2
|
|
680
|
+
}) => theme2.color.text2, ({
|
|
681
|
+
theme: theme2
|
|
682
|
+
}) => theme2.color.text2, ({
|
|
683
|
+
theme: theme2
|
|
684
|
+
}) => theme2.color.surface3);
|
|
925
685
|
|
|
926
686
|
// src/components/SwitchCheckbox/index.tsx
|
|
927
687
|
import * as React4 from "react";
|
|
@@ -936,116 +696,48 @@ var SwitchCheckbox_default = React4.forwardRef(function SwitchCheckbox({
|
|
|
936
696
|
disabled,
|
|
937
697
|
...props
|
|
938
698
|
}, ref) {
|
|
939
|
-
return /* @__PURE__ */ jsxs5(
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
children: [
|
|
947
|
-
/* @__PURE__ */ jsxs5(SwitchOuter, { children: [
|
|
948
|
-
/* @__PURE__ */ jsx8(SwitchInput, { ...props, disabled, ref }),
|
|
949
|
-
/* @__PURE__ */ jsx8(SwitchInner, { children: /* @__PURE__ */ jsx8(SwitchInnerKnob, {}) })
|
|
950
|
-
] }),
|
|
951
|
-
children != null && /* @__PURE__ */ jsx8(Children2, { rowReverse, children })
|
|
952
|
-
]
|
|
953
|
-
}
|
|
954
|
-
);
|
|
699
|
+
return /* @__PURE__ */ jsxs5(Label, { className: gtmClass !== void 0 ? `gtm-${gtmClass}` : "", flex, rowReverse, "aria-disabled": disabled, children: [
|
|
700
|
+
/* @__PURE__ */ jsxs5(SwitchOuter, { children: [
|
|
701
|
+
/* @__PURE__ */ jsx8(SwitchInput, { ...props, disabled, ref }),
|
|
702
|
+
/* @__PURE__ */ jsx8(SwitchInner, { children: /* @__PURE__ */ jsx8(SwitchInnerKnob, {}) })
|
|
703
|
+
] }),
|
|
704
|
+
children != null && /* @__PURE__ */ jsx8(Children2, { rowReverse, children })
|
|
705
|
+
] });
|
|
955
706
|
});
|
|
956
|
-
var Children2 = styled10.span
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
`;
|
|
980
|
-
var SwitchOuter = styled10.span`
|
|
981
|
-
display: inline-flex;
|
|
982
|
-
position: relative;
|
|
983
|
-
z-index: 0;
|
|
984
|
-
`;
|
|
985
|
-
var SwitchInner = styled10.div`
|
|
986
|
-
position: relative;
|
|
987
|
-
box-sizing: border-box;
|
|
988
|
-
width: 28px;
|
|
989
|
-
height: 16px;
|
|
990
|
-
border-radius: 16px;
|
|
991
|
-
border: 2px solid transparent;
|
|
992
|
-
background: ${({ theme: theme2 }) => theme2.color.text4};
|
|
993
|
-
transition: box-shadow 0.2s, background-color 0.2s;
|
|
994
|
-
`;
|
|
995
|
-
var SwitchInnerKnob = styled10.div`
|
|
996
|
-
position: absolute;
|
|
997
|
-
display: block;
|
|
998
|
-
top: 0;
|
|
999
|
-
left: 0;
|
|
1000
|
-
width: 12px;
|
|
1001
|
-
height: 12px;
|
|
1002
|
-
background-color: ${({ theme: theme2 }) => theme2.color.text5};
|
|
1003
|
-
border-radius: 50%;
|
|
1004
|
-
transform: translateX(0);
|
|
1005
|
-
transition: transform 0.2s;
|
|
1006
|
-
`;
|
|
707
|
+
var Children2 = styled10.span.withConfig({
|
|
708
|
+
componentId: "ccl__sc-vg0z5k-0"
|
|
709
|
+
})(["", ""], (p) => p.rowReverse ? css6(["margin-right:8px;"]) : css6(["margin-left:8px;"]));
|
|
710
|
+
var Label = styled10.label.withConfig({
|
|
711
|
+
componentId: "ccl__sc-vg0z5k-1"
|
|
712
|
+
})(["display:inline-flex;align-items:center;", " ", " cursor:pointer;outline:0;&[aria-disabled='true']{cursor:auto;}"], ({
|
|
713
|
+
flex
|
|
714
|
+
}) => flex && css6(["display:flex;justify-content:space-between;"]), ({
|
|
715
|
+
rowReverse
|
|
716
|
+
}) => css6(["flex-direction:", ";"], rowReverse ? "row-reverse" : "row"));
|
|
717
|
+
var SwitchOuter = styled10.span.withConfig({
|
|
718
|
+
componentId: "ccl__sc-vg0z5k-2"
|
|
719
|
+
})(["display:inline-flex;position:relative;z-index:0;"]);
|
|
720
|
+
var SwitchInner = styled10.div.withConfig({
|
|
721
|
+
componentId: "ccl__sc-vg0z5k-3"
|
|
722
|
+
})(["position:relative;box-sizing:border-box;width:28px;height:16px;border-radius:16px;border:2px solid transparent;background:", ";transition:box-shadow 0.2s,background-color 0.2s;"], ({
|
|
723
|
+
theme: theme2
|
|
724
|
+
}) => theme2.color.text4);
|
|
725
|
+
var SwitchInnerKnob = styled10.div.withConfig({
|
|
726
|
+
componentId: "ccl__sc-vg0z5k-4"
|
|
727
|
+
})(["position:absolute;display:block;top:0;left:0;width:12px;height:12px;background-color:", ";border-radius:50%;transform:translateX(0);transition:transform 0.2s;"], ({
|
|
728
|
+
theme: theme2
|
|
729
|
+
}) => theme2.color.text5);
|
|
1007
730
|
var SwitchInput = styled10.input.attrs({
|
|
1008
731
|
type: "checkbox"
|
|
1009
|
-
})
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
border-radius: 16px;
|
|
1019
|
-
opacity: 0;
|
|
1020
|
-
appearance: none;
|
|
1021
|
-
outline: none;
|
|
1022
|
-
cursor: pointer;
|
|
1023
|
-
|
|
1024
|
-
&:checked {
|
|
1025
|
-
~ ${SwitchInner} {
|
|
1026
|
-
background-color: ${({ theme: theme2 }) => theme2.color.brand};
|
|
1027
|
-
|
|
1028
|
-
${SwitchInnerKnob} {
|
|
1029
|
-
transform: translateX(12px);
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
&:disabled {
|
|
1035
|
-
cursor: auto;
|
|
1036
|
-
|
|
1037
|
-
~ ${SwitchInner} {
|
|
1038
|
-
opacity: ${({ theme: theme2 }) => theme2.elementEffect.disabled.opacity};
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
&:not(:disabled):focus {
|
|
1043
|
-
~ ${SwitchInner} {
|
|
1044
|
-
box-shadow: 0 0 0 4px
|
|
1045
|
-
${({ theme: theme2 }) => applyEffect(theme2.color.brand, theme2.elementEffect.disabled)};
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
`;
|
|
732
|
+
}).withConfig({
|
|
733
|
+
componentId: "ccl__sc-vg0z5k-5"
|
|
734
|
+
})(["position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;border-radius:16px;opacity:0;appearance:none;outline:none;cursor:pointer;&:checked{~ ", "{background-color:", ";", "{transform:translateX(12px);}}}&:disabled{cursor:auto;~ ", "{opacity:", ";}}&:not(:disabled):focus{~ ", "{box-shadow:0 0 0 4px ", ";}}"], SwitchInner, ({
|
|
735
|
+
theme: theme2
|
|
736
|
+
}) => theme2.color.brand, SwitchInnerKnob, SwitchInner, ({
|
|
737
|
+
theme: theme2
|
|
738
|
+
}) => theme2.elementEffect.disabled.opacity, SwitchInner, ({
|
|
739
|
+
theme: theme2
|
|
740
|
+
}) => applyEffect(theme2.color.brand, theme2.elementEffect.disabled));
|
|
1049
741
|
|
|
1050
742
|
// src/components/WithIcon/index.tsx
|
|
1051
743
|
import { useRef as useRef2 } from "react";
|
|
@@ -1068,18 +760,12 @@ var WithIcon_default = React5.memo(function WithIcon({
|
|
|
1068
760
|
!pre && node
|
|
1069
761
|
] });
|
|
1070
762
|
});
|
|
1071
|
-
var Root = styled11.div
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
min-width: 0;
|
|
1078
|
-
overflow: hidden;
|
|
1079
|
-
`}
|
|
1080
|
-
white-space: nowrap;
|
|
1081
|
-
text-overflow: ellipsis;
|
|
1082
|
-
`;
|
|
763
|
+
var Root = styled11.div.withConfig({
|
|
764
|
+
componentId: "ccl__sc-12w6fz6-0"
|
|
765
|
+
})(["display:flex;align-items:center;"]);
|
|
766
|
+
var Text2 = styled11.div.withConfig({
|
|
767
|
+
componentId: "ccl__sc-12w6fz6-1"
|
|
768
|
+
})(["", " white-space:nowrap;text-overflow:ellipsis;"], (p) => !p.fixed && css7(["min-width:0;overflow:hidden;"]));
|
|
1083
769
|
function AutoWidthIconAnchor({
|
|
1084
770
|
children,
|
|
1085
771
|
show,
|
|
@@ -1089,57 +775,23 @@ function AutoWidthIconAnchor({
|
|
|
1089
775
|
const width = useElementSize(ref, [null])?.width ?? 0;
|
|
1090
776
|
return /* @__PURE__ */ jsx9(IconAnchor, { width, show, pre, children: /* @__PURE__ */ jsx9(Icon3, { ref, children }) });
|
|
1091
777
|
}
|
|
1092
|
-
var forceCenteringCss = css7
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
var
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
margin-left: 4px;
|
|
1107
|
-
`}
|
|
1108
|
-
`;
|
|
1109
|
-
var IconAnchorNaive = styled11.div`
|
|
1110
|
-
display: flex;
|
|
1111
|
-
align-items: center;
|
|
1112
|
-
|
|
1113
|
-
${iconAnchorCss}
|
|
1114
|
-
`;
|
|
1115
|
-
var IconNaive = styled11.div`
|
|
1116
|
-
display: inline-flex;
|
|
1117
|
-
|
|
1118
|
-
${forceCenteringCss}
|
|
1119
|
-
`;
|
|
1120
|
-
var IconAnchor = styled11.div`
|
|
1121
|
-
display: flex;
|
|
1122
|
-
position: relative;
|
|
1123
|
-
/* Iconをline-heightに関与させない */
|
|
1124
|
-
height: 0;
|
|
1125
|
-
/* 横方向の領域は確保する */
|
|
1126
|
-
width: ${(p) => p.width}px;
|
|
1127
|
-
|
|
1128
|
-
${iconAnchorCss}
|
|
1129
|
-
`;
|
|
1130
|
-
var Icon3 = styled11.div`
|
|
1131
|
-
display: inline-flex;
|
|
1132
|
-
position: absolute;
|
|
1133
|
-
transform: translateY(-50%);
|
|
1134
|
-
|
|
1135
|
-
${forceCenteringCss}
|
|
1136
|
-
`;
|
|
778
|
+
var forceCenteringCss = css7(["> svg{display:block;}"]);
|
|
779
|
+
var iconAnchorCss = css7(["", ";", ""], (p) => p.show === "collapse" ? css7(["display:none;"]) : css7(["visibility:", ";"], p.show ? "visible" : "hidden"), (p) => p.pre ? css7(["margin-right:4px;"]) : css7(["margin-left:4px;"]));
|
|
780
|
+
var IconAnchorNaive = styled11.div.withConfig({
|
|
781
|
+
componentId: "ccl__sc-12w6fz6-2"
|
|
782
|
+
})(["display:flex;align-items:center;", ""], iconAnchorCss);
|
|
783
|
+
var IconNaive = styled11.div.withConfig({
|
|
784
|
+
componentId: "ccl__sc-12w6fz6-3"
|
|
785
|
+
})(["display:inline-flex;", ""], forceCenteringCss);
|
|
786
|
+
var IconAnchor = styled11.div.withConfig({
|
|
787
|
+
componentId: "ccl__sc-12w6fz6-4"
|
|
788
|
+
})(["display:flex;position:relative;height:0;width:", "px;", ""], (p) => p.width, iconAnchorCss);
|
|
789
|
+
var Icon3 = styled11.div.withConfig({
|
|
790
|
+
componentId: "ccl__sc-12w6fz6-5"
|
|
791
|
+
})(["display:inline-flex;position:absolute;transform:translateY(-50%);", ""], forceCenteringCss);
|
|
1137
792
|
|
|
1138
793
|
// src/index.ts
|
|
1139
|
-
import {
|
|
1140
|
-
ComponentAbstraction,
|
|
1141
|
-
useComponentAbstraction as useComponentAbstraction5
|
|
1142
|
-
} from "@charcoal-ui/react";
|
|
794
|
+
import { ComponentAbstraction, useComponentAbstraction as useComponentAbstraction5 } from "@charcoal-ui/react";
|
|
1143
795
|
|
|
1144
796
|
// src/components/Carousel/index.tsx
|
|
1145
797
|
import { useEffect as useEffect2, useState as useState2, useCallback as useCallback2, useRef as useRef3 } from "react";
|
|
@@ -1178,27 +830,18 @@ import styled12, { css as css8 } from "styled-components";
|
|
|
1178
830
|
|
|
1179
831
|
// src/foundation/utils.ts
|
|
1180
832
|
function unreachable(value) {
|
|
1181
|
-
throw new Error(
|
|
1182
|
-
arguments.length === 0 ? "unreachable" : `unreachable (${JSON.stringify(value)})`
|
|
1183
|
-
);
|
|
833
|
+
throw new Error(arguments.length === 0 ? "unreachable" : `unreachable (${JSON.stringify(value)})`);
|
|
1184
834
|
}
|
|
1185
835
|
|
|
1186
836
|
// src/components/icons/NextIcon.tsx
|
|
1187
837
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1188
838
|
var path = `M8.08579 16.5858C7.30474 17.3668 7.30474 18.6332 8.08579 19.4142C8.86684 20.1953 10.1332 20.1953 10.9142 19.4142L18.3284 12L10.9142 4.58579C10.1332 3.80474 8.86684 3.80474 8.08579 4.58579C7.30474 5.36684 7.30474 6.63317 8.08579 7.41421L12.6716 12L8.08579 16.5858Z`;
|
|
1189
839
|
var size2 = 24;
|
|
1190
|
-
function NextIcon({
|
|
840
|
+
function NextIcon({
|
|
841
|
+
direction
|
|
842
|
+
}) {
|
|
1191
843
|
const transform = directionToTransform(direction);
|
|
1192
|
-
return /* @__PURE__ */ jsx10(
|
|
1193
|
-
IconBase,
|
|
1194
|
-
{
|
|
1195
|
-
viewBoxSize: size2,
|
|
1196
|
-
size: size2,
|
|
1197
|
-
currentColor: true,
|
|
1198
|
-
path,
|
|
1199
|
-
transform
|
|
1200
|
-
}
|
|
1201
|
-
);
|
|
844
|
+
return /* @__PURE__ */ jsx10(IconBase, { viewBoxSize: size2, size: size2, currentColor: true, path, transform });
|
|
1202
845
|
}
|
|
1203
846
|
function directionToTransform(direction) {
|
|
1204
847
|
switch (direction) {
|
|
@@ -1236,86 +879,42 @@ function CarouselButton({
|
|
|
1236
879
|
paddingRight: Math.max(padding, 0),
|
|
1237
880
|
paddingBottom: bottom
|
|
1238
881
|
};
|
|
1239
|
-
return /* @__PURE__ */ jsx11(
|
|
1240
|
-
Button,
|
|
1241
|
-
{
|
|
1242
|
-
type: "button",
|
|
1243
|
-
onClick,
|
|
1244
|
-
hide: !show,
|
|
1245
|
-
style: offsetStyle,
|
|
1246
|
-
css: onlyNonTouchDevice,
|
|
1247
|
-
children: /* @__PURE__ */ jsx11(CarouselButtonIcon, { children: /* @__PURE__ */ jsx11(
|
|
1248
|
-
NextIcon,
|
|
1249
|
-
{
|
|
1250
|
-
direction: direction === "right" /* Right */ ? "right" /* Right */ : direction === "left" /* Left */ ? "left" /* Left */ : unreachable()
|
|
1251
|
-
}
|
|
1252
|
-
) })
|
|
1253
|
-
}
|
|
1254
|
-
);
|
|
882
|
+
return /* @__PURE__ */ jsx11(_StyledButton, { type: "button", onClick, hide: !show, style: offsetStyle, children: /* @__PURE__ */ jsx11(CarouselButtonIcon, { children: /* @__PURE__ */ jsx11(NextIcon, { direction: direction === "right" /* Right */ ? "right" /* Right */ : direction === "left" /* Left */ ? "left" /* Left */ : unreachable() }) }) });
|
|
1255
883
|
}
|
|
1256
884
|
var CAROUSEL_BUTTON_SIZE = 40;
|
|
1257
|
-
var CarouselButtonIcon = styled12.div
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
&:active ${CarouselButtonIcon} {
|
|
1291
|
-
background-color: ${({ theme: theme2 }) => applyEffect2(theme2.color.surface4, theme2.effect.press)};
|
|
1292
|
-
color: ${({ theme: theme2 }) => applyEffect2(theme2.color.text5, theme2.effect.press)};
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
${(p) => p.hide && css8`
|
|
1296
|
-
visibility: hidden;
|
|
1297
|
-
opacity: 0;
|
|
1298
|
-
pointer-events: none;
|
|
1299
|
-
`}
|
|
1300
|
-
`;
|
|
1301
|
-
var ScrollHintIcon = styled12(CarouselButtonIcon)`
|
|
1302
|
-
cursor: pointer;
|
|
1303
|
-
|
|
1304
|
-
&:hover {
|
|
1305
|
-
background-color: ${({ theme: theme2 }) => applyEffect2(theme2.color.surface4, theme2.effect.hover)};
|
|
1306
|
-
color: ${({ theme: theme2 }) => applyEffect2(theme2.color.text5, theme2.effect.hover)};
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
&:active {
|
|
1310
|
-
background-color: ${({ theme: theme2 }) => applyEffect2(theme2.color.surface4, theme2.effect.press)};
|
|
1311
|
-
color: ${({ theme: theme2 }) => applyEffect2(theme2.color.text5, theme2.effect.press)};
|
|
1312
|
-
}
|
|
1313
|
-
`;
|
|
1314
|
-
var onlyNonTouchDevice = css8`
|
|
1315
|
-
@media (hover: none) and (pointer: coarse) {
|
|
1316
|
-
display: none;
|
|
1317
|
-
}
|
|
1318
|
-
`;
|
|
885
|
+
var CarouselButtonIcon = styled12.div.withConfig({
|
|
886
|
+
componentId: "ccl__sc-gjlnt0-0"
|
|
887
|
+
})(["display:flex;align-items:center;justify-content:center;width:", "px;height:", "px;border-radius:50%;background-color:", ";transition:0.4s visibility,0.4s opacity,0.2s background-color,0.2s color;color:", ";"], CAROUSEL_BUTTON_SIZE, CAROUSEL_BUTTON_SIZE, ({
|
|
888
|
+
theme: theme2
|
|
889
|
+
}) => theme2.color.surface4, ({
|
|
890
|
+
theme: theme2
|
|
891
|
+
}) => theme2.color.text5);
|
|
892
|
+
var Button = styled12.button.withConfig({
|
|
893
|
+
componentId: "ccl__sc-gjlnt0-1"
|
|
894
|
+
})(["position:absolute;top:0;bottom:0;display:flex;align-items:center;padding:0;min-width:40px;border:none;outline:0;background:transparent;cursor:pointer;transition:0.4s visibility,0.4s opacity;z-index:1;&:hover ", "{background-color:", ";color:", ";}&:active ", "{background-color:", ";color:", ";}", ""], CarouselButtonIcon, ({
|
|
895
|
+
theme: theme2
|
|
896
|
+
}) => applyEffect2(theme2.color.surface4, theme2.effect.hover), ({
|
|
897
|
+
theme: theme2
|
|
898
|
+
}) => applyEffect2(theme2.color.text5, theme2.effect.hover), CarouselButtonIcon, ({
|
|
899
|
+
theme: theme2
|
|
900
|
+
}) => applyEffect2(theme2.color.surface4, theme2.effect.press), ({
|
|
901
|
+
theme: theme2
|
|
902
|
+
}) => applyEffect2(theme2.color.text5, theme2.effect.press), (p) => p.hide && css8(["visibility:hidden;opacity:0;pointer-events:none;"]));
|
|
903
|
+
var _StyledButton = styled12(Button).withConfig({
|
|
904
|
+
componentId: "ccl__sc-gjlnt0-2"
|
|
905
|
+
})(["", ""], onlyNonTouchDevice);
|
|
906
|
+
var ScrollHintIcon = styled12(CarouselButtonIcon).withConfig({
|
|
907
|
+
componentId: "ccl__sc-gjlnt0-3"
|
|
908
|
+
})(["cursor:pointer;&:hover{background-color:", ";color:", ";}&:active{background-color:", ";color:", ";}"], ({
|
|
909
|
+
theme: theme2
|
|
910
|
+
}) => applyEffect2(theme2.color.surface4, theme2.effect.hover), ({
|
|
911
|
+
theme: theme2
|
|
912
|
+
}) => applyEffect2(theme2.color.text5, theme2.effect.hover), ({
|
|
913
|
+
theme: theme2
|
|
914
|
+
}) => applyEffect2(theme2.color.surface4, theme2.effect.press), ({
|
|
915
|
+
theme: theme2
|
|
916
|
+
}) => applyEffect2(theme2.color.text5, theme2.effect.press));
|
|
917
|
+
var onlyNonTouchDevice = css8(["@media (hover:none) and (pointer:coarse){display:none;}"]);
|
|
1319
918
|
|
|
1320
919
|
// src/components/Carousel/index.tsx
|
|
1321
920
|
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
@@ -1325,7 +924,10 @@ function Carousel({
|
|
|
1325
924
|
buttonOffset = 0,
|
|
1326
925
|
buttonPadding = 16,
|
|
1327
926
|
bottomOffset = 0,
|
|
1328
|
-
defaultScroll: {
|
|
927
|
+
defaultScroll: {
|
|
928
|
+
align = "left",
|
|
929
|
+
offset: scrollOffset = 0
|
|
930
|
+
} = {},
|
|
1329
931
|
onScroll,
|
|
1330
932
|
onResize,
|
|
1331
933
|
children,
|
|
@@ -1339,7 +941,9 @@ function Carousel({
|
|
|
1339
941
|
const [maxScrollLeft, setMaxScrollLeft] = useState2(0);
|
|
1340
942
|
const [leftShow, setLeftShow] = useState2(false);
|
|
1341
943
|
const [rightShow, setRightShow] = useState2(false);
|
|
1342
|
-
const [styles, set] = useSpring(() => ({
|
|
944
|
+
const [styles, set] = useSpring(() => ({
|
|
945
|
+
scroll: 0
|
|
946
|
+
}));
|
|
1343
947
|
const ref = useRef3(null);
|
|
1344
948
|
const visibleAreaRef = useRef3(null);
|
|
1345
949
|
const innerRef = useRef3(null);
|
|
@@ -1347,30 +951,36 @@ function Carousel({
|
|
|
1347
951
|
if (visibleAreaRef.current === null) {
|
|
1348
952
|
return;
|
|
1349
953
|
}
|
|
1350
|
-
const {
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
);
|
|
954
|
+
const {
|
|
955
|
+
clientWidth
|
|
956
|
+
} = visibleAreaRef.current;
|
|
957
|
+
const scroll = Math.min(scrollLeft + clientWidth * scrollAmountCoef, maxScrollLeft);
|
|
1355
958
|
setScrollLeft(scroll, true);
|
|
1356
|
-
set({
|
|
959
|
+
set({
|
|
960
|
+
scroll,
|
|
961
|
+
from: {
|
|
962
|
+
scroll: scrollLeft
|
|
963
|
+
},
|
|
964
|
+
reset: !animation.current
|
|
965
|
+
});
|
|
1357
966
|
animation.current = true;
|
|
1358
|
-
}, [
|
|
1359
|
-
animation,
|
|
1360
|
-
maxScrollLeft,
|
|
1361
|
-
scrollLeft,
|
|
1362
|
-
set,
|
|
1363
|
-
scrollAmountCoef,
|
|
1364
|
-
setScrollLeft
|
|
1365
|
-
]);
|
|
967
|
+
}, [animation, maxScrollLeft, scrollLeft, set, scrollAmountCoef, setScrollLeft]);
|
|
1366
968
|
const handleLeft = useCallback2(() => {
|
|
1367
969
|
if (visibleAreaRef.current === null) {
|
|
1368
970
|
return;
|
|
1369
971
|
}
|
|
1370
|
-
const {
|
|
972
|
+
const {
|
|
973
|
+
clientWidth
|
|
974
|
+
} = visibleAreaRef.current;
|
|
1371
975
|
const scroll = Math.max(scrollLeft - clientWidth * scrollAmountCoef, 0);
|
|
1372
976
|
setScrollLeft(scroll, true);
|
|
1373
|
-
set({
|
|
977
|
+
set({
|
|
978
|
+
scroll,
|
|
979
|
+
from: {
|
|
980
|
+
scroll: scrollLeft
|
|
981
|
+
},
|
|
982
|
+
reset: !animation.current
|
|
983
|
+
});
|
|
1374
984
|
animation.current = true;
|
|
1375
985
|
}, [animation, scrollLeft, set, scrollAmountCoef, setScrollLeft]);
|
|
1376
986
|
useEffect2(() => {
|
|
@@ -1397,7 +1007,10 @@ function Carousel({
|
|
|
1397
1007
|
if (ref.current === null) {
|
|
1398
1008
|
return;
|
|
1399
1009
|
}
|
|
1400
|
-
const {
|
|
1010
|
+
const {
|
|
1011
|
+
clientWidth,
|
|
1012
|
+
scrollWidth
|
|
1013
|
+
} = ref.current;
|
|
1401
1014
|
const newMaxScrollLeft = scrollWidth - clientWidth;
|
|
1402
1015
|
setMaxScrollLeft(newMaxScrollLeft);
|
|
1403
1016
|
if (onResize) {
|
|
@@ -1410,11 +1023,9 @@ function Carousel({
|
|
|
1410
1023
|
if (elm === null || innerElm === null) {
|
|
1411
1024
|
return;
|
|
1412
1025
|
}
|
|
1413
|
-
elm.addEventListener(
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
passiveEvents() && { passive: true }
|
|
1417
|
-
);
|
|
1026
|
+
elm.addEventListener("wheel", handleScroll, passiveEvents() && {
|
|
1027
|
+
passive: true
|
|
1028
|
+
});
|
|
1418
1029
|
const resizeObserver = new ResizeObserver(handleResize);
|
|
1419
1030
|
resizeObserver.observe(elm);
|
|
1420
1031
|
const resizeObserverInner = new ResizeObserver(handleResize);
|
|
@@ -1429,13 +1040,7 @@ function Carousel({
|
|
|
1429
1040
|
if (align !== "left" || scrollOffset !== 0) {
|
|
1430
1041
|
const scroll = ref.current;
|
|
1431
1042
|
if (scroll !== null) {
|
|
1432
|
-
const scrollLength = Math.max(
|
|
1433
|
-
0,
|
|
1434
|
-
Math.min(
|
|
1435
|
-
align === "left" && scrollOffset > 0 ? scrollOffset : align === "center" ? maxScrollLeft / 2 + scrollOffset : align === "right" && scrollOffset <= maxScrollLeft ? maxScrollLeft - scrollOffset / 2 : 0,
|
|
1436
|
-
maxScrollLeft
|
|
1437
|
-
)
|
|
1438
|
-
);
|
|
1043
|
+
const scrollLength = Math.max(0, Math.min(align === "left" && scrollOffset > 0 ? scrollOffset : align === "center" ? maxScrollLeft / 2 + scrollOffset : align === "right" && scrollOffset <= maxScrollLeft ? maxScrollLeft - scrollOffset / 2 : 0, maxScrollLeft));
|
|
1439
1044
|
scroll.scrollLeft = scrollLength;
|
|
1440
1045
|
setScrollLeft(scrollLength, true);
|
|
1441
1046
|
}
|
|
@@ -1459,40 +1064,10 @@ function Carousel({
|
|
|
1459
1064
|
const fadeInGradient = options.fadeInGradient ?? false;
|
|
1460
1065
|
const overflowGradient = !fadeInGradient;
|
|
1461
1066
|
return /* @__PURE__ */ jsxs7(Container3, { ref: visibleAreaRef, children: [
|
|
1462
|
-
/* @__PURE__ */ jsx12(GradientContainer, { fadeInGradient, children: /* @__PURE__ */ jsx12(RightGradient, { children: /* @__PURE__ */ jsx12(LeftGradient, { show: overflowGradient || scrollLeft > 0, children: /* @__PURE__ */ jsx12(
|
|
1463
|
-
ScrollArea,
|
|
1464
|
-
{
|
|
1465
|
-
ref,
|
|
1466
|
-
scrollLeft: styles.scroll,
|
|
1467
|
-
onScroll: handleScrollMove,
|
|
1468
|
-
children: /* @__PURE__ */ jsx12(CarouselContainer, { ref: innerRef, centerItems, children })
|
|
1469
|
-
}
|
|
1470
|
-
) }) }) }),
|
|
1067
|
+
/* @__PURE__ */ jsx12(GradientContainer, { fadeInGradient, children: /* @__PURE__ */ jsx12(RightGradient, { children: /* @__PURE__ */ jsx12(LeftGradient, { show: overflowGradient || scrollLeft > 0, children: /* @__PURE__ */ jsx12(ScrollArea, { ref, scrollLeft: styles.scroll, onScroll: handleScrollMove, children: /* @__PURE__ */ jsx12(CarouselContainer, { ref: innerRef, centerItems, children }) }) }) }) }),
|
|
1471
1068
|
/* @__PURE__ */ jsxs7(ButtonsContainer, { children: [
|
|
1472
|
-
/* @__PURE__ */ jsx12(
|
|
1473
|
-
|
|
1474
|
-
{
|
|
1475
|
-
direction: "left" /* Left */,
|
|
1476
|
-
show: leftShow,
|
|
1477
|
-
offset: buttonOffset,
|
|
1478
|
-
bottomOffset,
|
|
1479
|
-
padding: buttonPadding,
|
|
1480
|
-
gradient: overflowGradient,
|
|
1481
|
-
onClick: handleLeft
|
|
1482
|
-
}
|
|
1483
|
-
),
|
|
1484
|
-
/* @__PURE__ */ jsx12(
|
|
1485
|
-
CarouselButton,
|
|
1486
|
-
{
|
|
1487
|
-
direction: "right" /* Right */,
|
|
1488
|
-
show: rightShow,
|
|
1489
|
-
offset: buttonOffset,
|
|
1490
|
-
bottomOffset,
|
|
1491
|
-
padding: buttonPadding,
|
|
1492
|
-
gradient: true,
|
|
1493
|
-
onClick: handleRight
|
|
1494
|
-
}
|
|
1495
|
-
)
|
|
1069
|
+
/* @__PURE__ */ jsx12(CarouselButton, { direction: "left" /* Left */, show: leftShow, offset: buttonOffset, bottomOffset, padding: buttonPadding, gradient: overflowGradient, onClick: handleLeft }),
|
|
1070
|
+
/* @__PURE__ */ jsx12(CarouselButton, { direction: "right" /* Right */, show: rightShow, offset: buttonOffset, bottomOffset, padding: buttonPadding, gradient: true, onClick: handleRight })
|
|
1496
1071
|
] })
|
|
1497
1072
|
] });
|
|
1498
1073
|
}
|
|
@@ -1507,106 +1082,34 @@ function Carousel({
|
|
|
1507
1082
|
}
|
|
1508
1083
|
),
|
|
1509
1084
|
/* @__PURE__ */ jsxs7(ButtonsContainer, { children: [
|
|
1510
|
-
/* @__PURE__ */ jsx12(
|
|
1511
|
-
|
|
1512
|
-
{
|
|
1513
|
-
direction: "left" /* Left */,
|
|
1514
|
-
show: leftShow,
|
|
1515
|
-
offset: buttonOffset,
|
|
1516
|
-
bottomOffset,
|
|
1517
|
-
padding: buttonPadding,
|
|
1518
|
-
onClick: handleLeft
|
|
1519
|
-
}
|
|
1520
|
-
),
|
|
1521
|
-
/* @__PURE__ */ jsx12(
|
|
1522
|
-
CarouselButton,
|
|
1523
|
-
{
|
|
1524
|
-
direction: "right" /* Right */,
|
|
1525
|
-
show: rightShow,
|
|
1526
|
-
offset: buttonOffset,
|
|
1527
|
-
bottomOffset,
|
|
1528
|
-
padding: buttonPadding,
|
|
1529
|
-
onClick: handleRight
|
|
1530
|
-
}
|
|
1531
|
-
)
|
|
1085
|
+
/* @__PURE__ */ jsx12(CarouselButton, { direction: "left" /* Left */, show: leftShow, offset: buttonOffset, bottomOffset, padding: buttonPadding, onClick: handleLeft }),
|
|
1086
|
+
/* @__PURE__ */ jsx12(CarouselButton, { direction: "right" /* Right */, show: rightShow, offset: buttonOffset, bottomOffset, padding: buttonPadding, onClick: handleRight })
|
|
1532
1087
|
] })
|
|
1533
1088
|
] });
|
|
1534
1089
|
}
|
|
1535
|
-
var CarouselContainer = styled13.ul
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
var Container3 = styled13.div`
|
|
1559
|
-
&:hover ${ButtonsContainer} {
|
|
1560
|
-
opacity: 1;
|
|
1561
|
-
}
|
|
1562
|
-
|
|
1563
|
-
/* CarouselButtonの中にz-index:1があるのでここでコンテキストを切る */
|
|
1564
|
-
position: relative;
|
|
1565
|
-
z-index: 0;
|
|
1566
|
-
`;
|
|
1567
|
-
var ScrollArea = styled13(animated.div)`
|
|
1568
|
-
overflow-x: auto;
|
|
1569
|
-
padding: 0;
|
|
1570
|
-
margin: 0;
|
|
1571
|
-
|
|
1572
|
-
&::-webkit-scrollbar {
|
|
1573
|
-
display: none;
|
|
1574
|
-
}
|
|
1575
|
-
|
|
1576
|
-
scrollbar-width: none;
|
|
1577
|
-
`;
|
|
1578
|
-
var GradientContainer = styled13.div`
|
|
1579
|
-
/* NOTE: LeftGradientがはみ出るためhidden */
|
|
1580
|
-
overflow: hidden;
|
|
1581
|
-
${(p) => !p.fadeInGradient && css9`
|
|
1582
|
-
margin-left: ${-GRADIENT_WIDTH}px;
|
|
1583
|
-
${CarouselContainer} {
|
|
1584
|
-
padding-left: ${GRADIENT_WIDTH}px;
|
|
1585
|
-
}
|
|
1586
|
-
`}
|
|
1587
|
-
|
|
1588
|
-
margin-right: ${-GRADIENT_WIDTH}px;
|
|
1589
|
-
/* stylelint-disable-next-line no-duplicate-selectors */
|
|
1590
|
-
${CarouselContainer} {
|
|
1591
|
-
padding-right: ${GRADIENT_WIDTH}px;
|
|
1592
|
-
}
|
|
1593
|
-
`;
|
|
1594
|
-
var RightGradient = styled13.div`
|
|
1595
|
-
mask-image: linear-gradient(
|
|
1596
|
-
to right,
|
|
1597
|
-
#000 calc(100% - ${GRADIENT_WIDTH}px),
|
|
1598
|
-
transparent
|
|
1599
|
-
);
|
|
1600
|
-
`;
|
|
1601
|
-
var LeftGradient = styled13.div`
|
|
1602
|
-
/* NOTE: mask-position が left → negative px の時、right → abs(negative px) の位置に表示されるため */
|
|
1603
|
-
margin-right: ${-GRADIENT_WIDTH}px;
|
|
1604
|
-
padding-right: ${GRADIENT_WIDTH}px;
|
|
1605
|
-
/* NOTE: mask-position に transition をつけたいが vender prefixes 対策で all につける */
|
|
1606
|
-
transition: 0.2s all ease-in;
|
|
1607
|
-
mask: linear-gradient(to right, transparent, #000 ${GRADIENT_WIDTH}px)
|
|
1608
|
-
${(p) => p.show ? 0 : -GRADIENT_WIDTH}px 0;
|
|
1609
|
-
`;
|
|
1090
|
+
var CarouselContainer = styled13.ul.withConfig({
|
|
1091
|
+
componentId: "ccl__sc-1qkjnfo-0"
|
|
1092
|
+
})(["vertical-align:top;overflow:hidden;list-style:none;padding:0;min-width:100%;box-sizing:border-box;", ""], ({
|
|
1093
|
+
centerItems = false
|
|
1094
|
+
}) => centerItems ? css9(["display:flex;width:max-content;margin:0 auto;"]) : css9(["display:inline-flex;margin:0;"]));
|
|
1095
|
+
var ButtonsContainer = styled13.div.withConfig({
|
|
1096
|
+
componentId: "ccl__sc-1qkjnfo-1"
|
|
1097
|
+
})(["opacity:0;transition:0.4s opacity;"]);
|
|
1098
|
+
var Container3 = styled13.div.withConfig({
|
|
1099
|
+
componentId: "ccl__sc-1qkjnfo-2"
|
|
1100
|
+
})(["&:hover ", "{opacity:1;}position:relative;z-index:0;"], ButtonsContainer);
|
|
1101
|
+
var ScrollArea = styled13(animated.div).withConfig({
|
|
1102
|
+
componentId: "ccl__sc-1qkjnfo-3"
|
|
1103
|
+
})(["overflow-x:auto;padding:0;margin:0;&::-webkit-scrollbar{display:none;}scrollbar-width:none;"]);
|
|
1104
|
+
var GradientContainer = styled13.div.withConfig({
|
|
1105
|
+
componentId: "ccl__sc-1qkjnfo-4"
|
|
1106
|
+
})(["overflow:hidden;", " margin-right:", "px;", "{padding-right:", "px;}"], (p) => !p.fadeInGradient && css9(["margin-left:", "px;", "{padding-left:", "px;}"], -GRADIENT_WIDTH, CarouselContainer, GRADIENT_WIDTH), -GRADIENT_WIDTH, CarouselContainer, GRADIENT_WIDTH);
|
|
1107
|
+
var RightGradient = styled13.div.withConfig({
|
|
1108
|
+
componentId: "ccl__sc-1qkjnfo-5"
|
|
1109
|
+
})(["mask-image:linear-gradient( to right,#000 calc(100% - ", "px),transparent );"], GRADIENT_WIDTH);
|
|
1110
|
+
var LeftGradient = styled13.div.withConfig({
|
|
1111
|
+
componentId: "ccl__sc-1qkjnfo-6"
|
|
1112
|
+
})(["margin-right:", "px;padding-right:", "px;transition:0.2s all ease-in;mask:linear-gradient(to right,transparent,#000 ", "px) ", "px 0;"], -GRADIENT_WIDTH, GRADIENT_WIDTH, GRADIENT_WIDTH, (p) => p.show ? 0 : -GRADIENT_WIDTH);
|
|
1610
1113
|
|
|
1611
1114
|
// src/components/Pager/index.tsx
|
|
1612
1115
|
import { memo as memo2, useCallback as useCallback3, useDebugValue as useDebugValue2, useMemo as useMemo2 } from "react";
|
|
@@ -1616,40 +1119,31 @@ import warning from "warning";
|
|
|
1616
1119
|
// src/components/icons/DotsIcon.tsx
|
|
1617
1120
|
import styled14 from "styled-components";
|
|
1618
1121
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1619
|
-
function DotsIcon({
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
fillRule: "evenodd",
|
|
1624
|
-
d: `M5,14.5 C3.61928813,14.5 2.5,13.3807119 2.5,12 C2.5,10.6192881 3.61928813,9.5 5,9.5
|
|
1122
|
+
function DotsIcon({
|
|
1123
|
+
size: size3
|
|
1124
|
+
}) {
|
|
1125
|
+
return /* @__PURE__ */ jsx13(StyledSVG, { viewBox: "0 0 20 6", width: size3, height: size3, children: /* @__PURE__ */ jsx13("path", { fillRule: "evenodd", d: `M5,14.5 C3.61928813,14.5 2.5,13.3807119 2.5,12 C2.5,10.6192881 3.61928813,9.5 5,9.5
|
|
1625
1126
|
C6.38071187,9.5 7.5,10.6192881 7.5,12 C7.5,13.3807119 6.38071187,14.5 5,14.5 Z M12,14.5
|
|
1626
1127
|
C10.6192881,14.5 9.5,13.3807119 9.5,12 C9.5,10.6192881 10.6192881,9.5 12,9.5
|
|
1627
1128
|
C13.3807119,9.5 14.5,10.6192881 14.5,12 C14.5,13.3807119 13.3807119,14.5 12,14.5 Z M19,14.5
|
|
1628
1129
|
C17.6192881,14.5 16.5,13.3807119 16.5,12 C16.5,10.6192881 17.6192881,9.5 19,9.5
|
|
1629
|
-
C20.3807119,9.5 21.5,10.6192881 21.5,12 C21.5,13.3807119 20.3807119,14.5 19,14.5 Z`,
|
|
1630
|
-
transform: "translate(-2 -9)"
|
|
1631
|
-
}
|
|
1632
|
-
) });
|
|
1130
|
+
C20.3807119,9.5 21.5,10.6192881 21.5,12 C21.5,13.3807119 20.3807119,14.5 19,14.5 Z`, transform: "translate(-2 -9)" }) });
|
|
1633
1131
|
}
|
|
1634
1132
|
DotsIcon.defaultProps = {
|
|
1635
1133
|
size: 16
|
|
1636
1134
|
};
|
|
1637
|
-
var StyledSVG = styled14.svg
|
|
1638
|
-
|
|
1639
|
-
|
|
1135
|
+
var StyledSVG = styled14.svg.withConfig({
|
|
1136
|
+
componentId: "ccl__sc-1ma336a-0"
|
|
1137
|
+
})(["fill:currentColor;"]);
|
|
1640
1138
|
|
|
1641
1139
|
// src/components/icons/WedgeIcon.tsx
|
|
1642
1140
|
import styled15 from "styled-components";
|
|
1643
1141
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1644
|
-
function WedgeIcon({
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
points: "1,2 5,6 9,2",
|
|
1650
|
-
transform: directionToTransform2(direction)
|
|
1651
|
-
}
|
|
1652
|
-
) });
|
|
1142
|
+
function WedgeIcon({
|
|
1143
|
+
size: size3,
|
|
1144
|
+
direction
|
|
1145
|
+
}) {
|
|
1146
|
+
return /* @__PURE__ */ jsx14("svg", { viewBox: "0 0 10 8", width: size3, height: size3, children: /* @__PURE__ */ jsx14(StyledPolyline, { strokeWidth: "2", points: "1,2 5,6 9,2", transform: directionToTransform2(direction) }) });
|
|
1653
1147
|
}
|
|
1654
1148
|
WedgeIcon.defaultProps = {
|
|
1655
1149
|
size: 16,
|
|
@@ -1670,12 +1164,9 @@ function directionToTransform2(direction) {
|
|
|
1670
1164
|
return unreachable(direction);
|
|
1671
1165
|
}
|
|
1672
1166
|
}
|
|
1673
|
-
var StyledPolyline = styled15.polyline
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
stroke-linecap: round;
|
|
1677
|
-
stroke: currentColor;
|
|
1678
|
-
`;
|
|
1167
|
+
var StyledPolyline = styled15.polyline.withConfig({
|
|
1168
|
+
componentId: "ccl__sc-617sjj-0"
|
|
1169
|
+
})(["fill:none;stroke-linejoin:round;stroke-linecap:round;stroke:currentColor;"]);
|
|
1679
1170
|
|
|
1680
1171
|
// src/components/Pager/index.tsx
|
|
1681
1172
|
import { useComponentAbstraction as useComponentAbstraction4 } from "@charcoal-ui/react";
|
|
@@ -1683,36 +1174,25 @@ import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
|
1683
1174
|
function usePagerWindow(page, pageCount, pageRangeDisplayed = 7) {
|
|
1684
1175
|
if (process.env.NODE_ENV !== "production") {
|
|
1685
1176
|
warning((page | 0) === page, `\`page\` must be integer (${page})`);
|
|
1686
|
-
warning(
|
|
1687
|
-
|
|
1688
|
-
`\`pageCount\` must be integer (${pageCount})`
|
|
1689
|
-
);
|
|
1690
|
-
warning(
|
|
1691
|
-
(pageRangeDisplayed | 0) === pageRangeDisplayed,
|
|
1692
|
-
`\`pageRangeDisplayed\` must be integer (${pageRangeDisplayed})`
|
|
1693
|
-
);
|
|
1177
|
+
warning((pageCount | 0) === pageCount, `\`pageCount\` must be integer (${pageCount})`);
|
|
1178
|
+
warning((pageRangeDisplayed | 0) === pageRangeDisplayed, `\`pageRangeDisplayed\` must be integer (${pageRangeDisplayed})`);
|
|
1694
1179
|
warning(pageRangeDisplayed > 2, `\`windowSize\` must be greater than 2`);
|
|
1695
1180
|
}
|
|
1696
1181
|
const window2 = useMemo2(() => {
|
|
1697
1182
|
const visibleFirstPage = 1;
|
|
1698
|
-
const visibleLastPage = Math.min(
|
|
1699
|
-
pageCount,
|
|
1700
|
-
Math.max(page + Math.floor(pageRangeDisplayed / 2), pageRangeDisplayed)
|
|
1701
|
-
);
|
|
1183
|
+
const visibleLastPage = Math.min(pageCount, Math.max(page + Math.floor(pageRangeDisplayed / 2), pageRangeDisplayed));
|
|
1702
1184
|
if (visibleLastPage <= pageRangeDisplayed) {
|
|
1703
|
-
return Array.from(
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
);
|
|
1185
|
+
return Array.from({
|
|
1186
|
+
length: 1 + visibleLastPage - visibleFirstPage
|
|
1187
|
+
}, (_, i) => visibleFirstPage + i);
|
|
1707
1188
|
} else {
|
|
1708
1189
|
const start = visibleLastPage - (pageRangeDisplayed - 1) + 2;
|
|
1709
1190
|
return [
|
|
1710
1191
|
visibleFirstPage,
|
|
1711
1192
|
"...",
|
|
1712
|
-
...Array.from(
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
)
|
|
1193
|
+
...Array.from({
|
|
1194
|
+
length: 1 + visibleLastPage - start
|
|
1195
|
+
}, (_, i) => start + i)
|
|
1716
1196
|
];
|
|
1717
1197
|
}
|
|
1718
1198
|
}, [page, pageCount, pageRangeDisplayed]);
|
|
@@ -1726,40 +1206,15 @@ var Pager_default = memo2(function Pager({
|
|
|
1726
1206
|
onChange
|
|
1727
1207
|
}) {
|
|
1728
1208
|
const window2 = usePagerWindow(page, pageCount, pageRangeDisplayed);
|
|
1729
|
-
const makeClickHandler = useCallback3(
|
|
1730
|
-
(value)
|
|
1731
|
-
|
|
1732
|
-
},
|
|
1733
|
-
[onChange]
|
|
1734
|
-
);
|
|
1209
|
+
const makeClickHandler = useCallback3((value) => () => {
|
|
1210
|
+
onChange(value);
|
|
1211
|
+
}, [onChange]);
|
|
1735
1212
|
const hasNext = page < pageCount;
|
|
1736
1213
|
const hasPrev = page > 1;
|
|
1737
1214
|
return /* @__PURE__ */ jsxs8(PagerContainer, { children: [
|
|
1738
|
-
/* @__PURE__ */ jsx15(
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
type: "button",
|
|
1742
|
-
hidden: !hasPrev,
|
|
1743
|
-
disabled: !hasPrev,
|
|
1744
|
-
onClick: makeClickHandler(Math.max(1, page - 1)),
|
|
1745
|
-
noBackground: true,
|
|
1746
|
-
children: /* @__PURE__ */ jsx15(WedgeIcon, { size: 16, direction: "left" /* Left */ })
|
|
1747
|
-
}
|
|
1748
|
-
),
|
|
1749
|
-
window2.map(
|
|
1750
|
-
(p) => p === "..." ? /* @__PURE__ */ jsx15(Spacer, { children: /* @__PURE__ */ jsx15(DotsIcon, { size: 20 }) }, p) : p === page ? /* @__PURE__ */ jsx15(CircleButton, { type: "button", "aria-current": true, children: /* @__PURE__ */ jsx15(Text3, { children: p }) }, p) : /* @__PURE__ */ jsx15(CircleButton, { type: "button", onClick: makeClickHandler(p), children: /* @__PURE__ */ jsx15(Text3, { children: p }) }, p)
|
|
1751
|
-
),
|
|
1752
|
-
/* @__PURE__ */ jsx15(
|
|
1753
|
-
CircleButton,
|
|
1754
|
-
{
|
|
1755
|
-
type: "button",
|
|
1756
|
-
hidden: !hasNext,
|
|
1757
|
-
disabled: !hasNext,
|
|
1758
|
-
onClick: makeClickHandler(Math.min(pageCount, page + 1)),
|
|
1759
|
-
noBackground: true,
|
|
1760
|
-
children: /* @__PURE__ */ jsx15(WedgeIcon, { size: 16, direction: "right" /* Right */ })
|
|
1761
|
-
}
|
|
1762
|
-
)
|
|
1215
|
+
/* @__PURE__ */ jsx15(CircleButton, { type: "button", hidden: !hasPrev, disabled: !hasPrev, onClick: makeClickHandler(Math.max(1, page - 1)), noBackground: true, children: /* @__PURE__ */ jsx15(WedgeIcon, { size: 16, direction: "left" /* Left */ }) }),
|
|
1216
|
+
window2.map((p) => p === "..." ? /* @__PURE__ */ jsx15(Spacer, { children: /* @__PURE__ */ jsx15(DotsIcon, { size: 20 }) }, p) : p === page ? /* @__PURE__ */ jsx15(CircleButton, { type: "button", "aria-current": true, children: /* @__PURE__ */ jsx15(Text3, { children: p }) }, p) : /* @__PURE__ */ jsx15(CircleButton, { type: "button", onClick: makeClickHandler(p), children: /* @__PURE__ */ jsx15(Text3, { children: p }) }, p)),
|
|
1217
|
+
/* @__PURE__ */ jsx15(CircleButton, { type: "button", hidden: !hasNext, disabled: !hasNext, onClick: makeClickHandler(Math.min(pageCount, page + 1)), noBackground: true, children: /* @__PURE__ */ jsx15(WedgeIcon, { size: 16, direction: "right" /* Right */ }) })
|
|
1763
1218
|
] });
|
|
1764
1219
|
});
|
|
1765
1220
|
function LinkPager({
|
|
@@ -1768,88 +1223,48 @@ function LinkPager({
|
|
|
1768
1223
|
pageRangeDisplayed,
|
|
1769
1224
|
makeUrl
|
|
1770
1225
|
}) {
|
|
1771
|
-
const {
|
|
1226
|
+
const {
|
|
1227
|
+
Link
|
|
1228
|
+
} = useComponentAbstraction4();
|
|
1772
1229
|
const window2 = usePagerWindow(page, pageCount, pageRangeDisplayed);
|
|
1773
1230
|
const hasNext = page < pageCount;
|
|
1774
1231
|
const hasPrev = page > 1;
|
|
1775
1232
|
return /* @__PURE__ */ jsxs8(PagerContainer, { children: [
|
|
1776
1233
|
/* @__PURE__ */ jsx15(Link, { to: makeUrl(Math.max(1, page - 1)), children: /* @__PURE__ */ jsx15(CircleButton, { hidden: !hasPrev, "aria-disabled": !hasPrev, noBackground: true, children: /* @__PURE__ */ jsx15(WedgeIcon, { size: 16, direction: "left" /* Left */ }) }) }),
|
|
1777
|
-
window2.map(
|
|
1778
|
-
(p) => p === "..." ? /* @__PURE__ */ jsx15(Spacer, { children: /* @__PURE__ */ jsx15(DotsIcon, { size: 20, subLink: true }) }, p) : p === page ? /* @__PURE__ */ jsx15(CircleButton, { type: "button", "aria-current": true, children: /* @__PURE__ */ jsx15(Text3, { children: p }) }, p) : /* @__PURE__ */ jsx15(Link, { to: makeUrl(p), children: /* @__PURE__ */ jsx15(CircleButton, { type: "button", children: /* @__PURE__ */ jsx15(Text3, { children: p }) }) }, p)
|
|
1779
|
-
),
|
|
1234
|
+
window2.map((p) => p === "..." ? /* @__PURE__ */ jsx15(Spacer, { children: /* @__PURE__ */ jsx15(DotsIcon, { size: 20, subLink: true }) }, p) : p === page ? /* @__PURE__ */ jsx15(CircleButton, { type: "button", "aria-current": true, children: /* @__PURE__ */ jsx15(Text3, { children: p }) }, p) : /* @__PURE__ */ jsx15(Link, { to: makeUrl(p), children: /* @__PURE__ */ jsx15(CircleButton, { type: "button", children: /* @__PURE__ */ jsx15(Text3, { children: p }) }) }, p)),
|
|
1780
1235
|
/* @__PURE__ */ jsx15(Link, { to: makeUrl(Math.min(pageCount, page + 1)), children: /* @__PURE__ */ jsx15(CircleButton, { hidden: !hasNext, "aria-disabled": !hasNext, noBackground: true, children: /* @__PURE__ */ jsx15(WedgeIcon, { size: 16, direction: "right" /* Right */ }) }) })
|
|
1781
1236
|
] });
|
|
1782
1237
|
}
|
|
1783
|
-
var PagerContainer = styled16.nav
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
-webkit-transform: translateZ(0);
|
|
1814
|
-
|
|
1815
|
-
&[hidden] {
|
|
1816
|
-
visibility: hidden;
|
|
1817
|
-
display: block;
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
border-radius: 48px;
|
|
1821
|
-
|
|
1822
|
-
background: transparent;
|
|
1823
|
-
color: ${({ theme: theme2 }) => theme2.color.text3};
|
|
1824
|
-
|
|
1825
|
-
&:hover {
|
|
1826
|
-
background: ${({ theme: theme2 }) => theme2.color.surface3};
|
|
1827
|
-
color: ${({ theme: theme2 }) => theme2.color.text2};
|
|
1828
|
-
}
|
|
1829
|
-
|
|
1830
|
-
&[aria-current] {
|
|
1831
|
-
background-color: ${({ theme: theme2 }) => theme2.color.surface6};
|
|
1832
|
-
color: ${({ theme: theme2 }) => theme2.color.text5};
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
&[aria-current]:hover {
|
|
1836
|
-
background-color: ${({ theme: theme2 }) => theme2.color.surface6};
|
|
1837
|
-
color: ${({ theme: theme2 }) => theme2.color.text5};
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
${({ noBackground = false }) => noBackground && css10`
|
|
1841
|
-
/* stylelint-disable-next-line no-duplicate-selectors */
|
|
1842
|
-
&:hover {
|
|
1843
|
-
background: transparent;
|
|
1844
|
-
}
|
|
1845
|
-
`}
|
|
1846
|
-
`;
|
|
1847
|
-
var Spacer = styled16(CircleButton).attrs({ type: "button", disabled: true })`
|
|
1848
|
-
&& {
|
|
1849
|
-
color: ${({ theme: theme2 }) => theme2.color.text3};
|
|
1850
|
-
background: none;
|
|
1851
|
-
}
|
|
1852
|
-
`;
|
|
1238
|
+
var PagerContainer = styled16.nav.withConfig({
|
|
1239
|
+
componentId: "ccl__sc-1bh6g9v-0"
|
|
1240
|
+
})(["display:flex;justify-content:center;align-items:center;"]);
|
|
1241
|
+
var CircleButton = styled16.button.withConfig({
|
|
1242
|
+
componentId: "ccl__sc-1bh6g9v-1"
|
|
1243
|
+
})(["font-size:1rem;line-height:calc(1em + 8px);text-decoration:none;border:none;outline:none;touch-action:manipulation;user-select:none;transition:box-shadow 0.2s ease 0s,color 0.2s ease 0s,background 0.2s ease 0s,opacity 0.2s ease 0s;display:flex;justify-content:center;align-items:center;box-sizing:content-box;min-width:24px;min-height:24px;padding:8px;cursor:pointer;font-weight:bold;-webkit-transform:translateZ(0);&[hidden]{visibility:hidden;display:block;}border-radius:48px;background:transparent;color:", ";&:hover{background:", ";color:", ";}&[aria-current]{background-color:", ";color:", ";}&[aria-current]:hover{background-color:", ";color:", ";}", ""], ({
|
|
1244
|
+
theme: theme2
|
|
1245
|
+
}) => theme2.color.text3, ({
|
|
1246
|
+
theme: theme2
|
|
1247
|
+
}) => theme2.color.surface3, ({
|
|
1248
|
+
theme: theme2
|
|
1249
|
+
}) => theme2.color.text2, ({
|
|
1250
|
+
theme: theme2
|
|
1251
|
+
}) => theme2.color.surface6, ({
|
|
1252
|
+
theme: theme2
|
|
1253
|
+
}) => theme2.color.text5, ({
|
|
1254
|
+
theme: theme2
|
|
1255
|
+
}) => theme2.color.surface6, ({
|
|
1256
|
+
theme: theme2
|
|
1257
|
+
}) => theme2.color.text5, ({
|
|
1258
|
+
noBackground = false
|
|
1259
|
+
}) => noBackground && css10(["&:hover{background:transparent;}"]));
|
|
1260
|
+
var Spacer = styled16(CircleButton).attrs({
|
|
1261
|
+
type: "button",
|
|
1262
|
+
disabled: true
|
|
1263
|
+
}).withConfig({
|
|
1264
|
+
componentId: "ccl__sc-1bh6g9v-2"
|
|
1265
|
+
})(["&&{color:", ";background:none;}"], ({
|
|
1266
|
+
theme: theme2
|
|
1267
|
+
}) => theme2.color.text3);
|
|
1853
1268
|
var Text3 = "span";
|
|
1854
1269
|
export {
|
|
1855
1270
|
CancelLayoutItemBodyPadding,
|