@charcoal-ui/react-sandbox 3.0.0-beta.2 → 3.0.0-beta.4
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/_lib/compat.d.ts +1 -1
- package/dist/_lib/compat.d.ts.map +1 -1
- package/dist/components/Carousel/index.d.ts +1 -1
- package/dist/components/Carousel/index.d.ts.map +1 -1
- package/dist/components/Carousel/index.story.d.ts.map +1 -1
- package/dist/components/CarouselButton/index.d.ts.map +1 -1
- package/dist/components/CarouselButton/index.story.d.ts.map +1 -1
- package/dist/components/Filter/index.d.ts +1 -1
- package/dist/components/Filter/index.d.ts.map +1 -1
- package/dist/components/Filter/index.story.d.ts.map +1 -1
- package/dist/components/HintText/index.d.ts +1 -1
- package/dist/components/HintText/index.d.ts.map +1 -1
- package/dist/components/HintText/index.story.d.ts.map +1 -1
- package/dist/components/Layout/index.d.ts +1 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/LeftMenu/index.d.ts.map +1 -1
- package/dist/components/MenuListItem/index.d.ts +1 -1
- package/dist/components/MenuListItem/index.d.ts.map +1 -1
- package/dist/components/MenuListItem/index.story.d.ts.map +1 -1
- package/dist/components/Pager/index.d.ts +1 -2
- package/dist/components/Pager/index.d.ts.map +1 -1
- package/dist/components/Pager/index.story.d.ts +1 -2
- package/dist/components/Pager/index.story.d.ts.map +1 -1
- package/dist/components/SwitchCheckbox/index.d.ts +1 -1
- package/dist/components/SwitchCheckbox/index.d.ts.map +1 -1
- package/dist/components/SwitchCheckbox/index.story.d.ts +1 -2
- package/dist/components/SwitchCheckbox/index.story.d.ts.map +1 -1
- package/dist/components/TextEllipsis/index.story.d.ts.map +1 -1
- package/dist/components/WithIcon/index.d.ts +1 -1
- package/dist/components/WithIcon/index.d.ts.map +1 -1
- package/dist/components/WithIcon/index.story.d.ts +1 -1
- package/dist/components/WithIcon/index.story.d.ts.map +1 -1
- package/dist/components/icons/Base.d.ts +1 -1
- package/dist/components/icons/Base.d.ts.map +1 -1
- package/dist/components/icons/DotsIcon.d.ts.map +1 -1
- package/dist/components/icons/InfoIcon.d.ts.map +1 -1
- package/dist/components/icons/NextIcon.d.ts.map +1 -1
- package/dist/components/icons/WedgeIcon.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/index.cjs.js +309 -247
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +249 -187
- package/dist/index.esm.js.map +1 -1
- package/dist/styled.d.ts +9 -9
- package/package.json +8 -8
- package/src/_lib/compat.ts +1 -1
- package/src/components/Carousel/index.story.tsx +0 -1
- package/src/components/Carousel/index.tsx +2 -1
- package/src/components/CarouselButton/index.story.tsx +0 -1
- package/src/components/CarouselButton/index.tsx +0 -1
- package/src/components/Filter/index.story.tsx +0 -1
- package/src/components/Filter/index.tsx +1 -1
- package/src/components/HintText/index.story.tsx +0 -1
- package/src/components/HintText/index.tsx +1 -1
- package/src/components/Layout/index.story.tsx +1 -1
- package/src/components/Layout/index.tsx +2 -1
- package/src/components/LeftMenu/index.tsx +0 -1
- package/src/components/MenuListItem/index.story.tsx +0 -1
- package/src/components/MenuListItem/index.tsx +2 -1
- package/src/components/Pager/index.story.tsx +1 -1
- package/src/components/Pager/index.tsx +2 -6
- package/src/components/SwitchCheckbox/index.story.tsx +0 -1
- package/src/components/SwitchCheckbox/index.tsx +1 -1
- package/src/components/TextEllipsis/index.story.tsx +0 -1
- package/src/components/WithIcon/index.story.tsx +1 -1
- package/src/components/WithIcon/index.tsx +2 -1
- package/src/components/icons/Base.tsx +1 -1
- package/src/components/icons/DotsIcon.tsx +0 -1
- package/src/components/icons/InfoIcon.tsx +0 -1
- package/src/components/icons/NextIcon.tsx +0 -1
- package/src/components/icons/WedgeIcon.tsx +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// src/components/Filter/index.tsx
|
|
2
|
-
import React from "react";
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
import styled, { css } from "styled-components";
|
|
4
4
|
import { useComponentAbstraction } from "@charcoal-ui/react";
|
|
5
5
|
import { maxWidth } from "@charcoal-ui/utils";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
var FilterButton = React.forwardRef(function FilterButton2({
|
|
7
8
|
onClick,
|
|
8
9
|
children,
|
|
@@ -10,16 +11,16 @@ var FilterButton = React.forwardRef(function FilterButton2({
|
|
|
10
11
|
hover,
|
|
11
12
|
reactive = false
|
|
12
13
|
}, ref) {
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
14
15
|
ButtonLike,
|
|
15
16
|
{
|
|
16
17
|
active,
|
|
17
18
|
reactive,
|
|
18
19
|
hover,
|
|
19
20
|
onClick: active && !reactive ? void 0 : onClick,
|
|
20
|
-
ref
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
ref,
|
|
22
|
+
children
|
|
23
|
+
}
|
|
23
24
|
);
|
|
24
25
|
});
|
|
25
26
|
var FilterIconButton = React.forwardRef(function FilterIconButton2({
|
|
@@ -31,7 +32,7 @@ var FilterIconButton = React.forwardRef(function FilterIconButton2({
|
|
|
31
32
|
width,
|
|
32
33
|
height
|
|
33
34
|
}, ref) {
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
35
36
|
StyledButtonLike,
|
|
36
37
|
{
|
|
37
38
|
active,
|
|
@@ -40,9 +41,9 @@ var FilterIconButton = React.forwardRef(function FilterIconButton2({
|
|
|
40
41
|
onClick: active && !reactive ? void 0 : onClick,
|
|
41
42
|
ref,
|
|
42
43
|
buttonWidth: width,
|
|
43
|
-
buttonHeight: height
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
buttonHeight: height,
|
|
45
|
+
children
|
|
46
|
+
}
|
|
46
47
|
);
|
|
47
48
|
});
|
|
48
49
|
var FilterLink = React.forwardRef(function FilterLink2({
|
|
@@ -55,18 +56,18 @@ var FilterLink = React.forwardRef(function FilterLink2({
|
|
|
55
56
|
}, ref) {
|
|
56
57
|
const { Link } = useComponentAbstraction();
|
|
57
58
|
if (active && !reactive) {
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ jsx(PlainElement, { active: true, hover, ref, children });
|
|
59
60
|
} else {
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ jsx(Link, { ...props, onClick, children: /* @__PURE__ */ jsx(
|
|
61
62
|
PlainElement,
|
|
62
63
|
{
|
|
63
64
|
active,
|
|
64
65
|
reactive,
|
|
65
66
|
hover,
|
|
66
|
-
ref
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
));
|
|
67
|
+
ref,
|
|
68
|
+
children
|
|
69
|
+
}
|
|
70
|
+
) });
|
|
70
71
|
}
|
|
71
72
|
});
|
|
72
73
|
var buttonCss = css`
|
|
@@ -129,7 +130,6 @@ var Filter = styled.div`
|
|
|
129
130
|
var Filter_default = Filter;
|
|
130
131
|
|
|
131
132
|
// src/components/HintText/index.tsx
|
|
132
|
-
import React4 from "react";
|
|
133
133
|
import styled5, { css as css2 } from "styled-components";
|
|
134
134
|
|
|
135
135
|
// src/styled.ts
|
|
@@ -138,12 +138,11 @@ import { createTheme } from "@charcoal-ui/styled";
|
|
|
138
138
|
var theme = createTheme(styled2);
|
|
139
139
|
|
|
140
140
|
// src/components/icons/InfoIcon.tsx
|
|
141
|
-
import React3 from "react";
|
|
142
141
|
import styled4 from "styled-components";
|
|
143
142
|
|
|
144
143
|
// src/components/icons/Base.tsx
|
|
145
|
-
import React2 from "react";
|
|
146
144
|
import styled3 from "styled-components";
|
|
145
|
+
import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
|
|
147
146
|
function IconBase({
|
|
148
147
|
size: size3 = 24,
|
|
149
148
|
viewBoxSize,
|
|
@@ -153,22 +152,22 @@ function IconBase({
|
|
|
153
152
|
fillRule,
|
|
154
153
|
clipRule
|
|
155
154
|
}) {
|
|
156
|
-
return /* @__PURE__ */
|
|
155
|
+
return /* @__PURE__ */ jsx2(
|
|
157
156
|
Icon,
|
|
158
157
|
{
|
|
159
158
|
viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`,
|
|
160
159
|
size: size3,
|
|
161
|
-
currentColor
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
160
|
+
currentColor,
|
|
161
|
+
children: /* @__PURE__ */ jsx2(
|
|
162
|
+
IconBasePath,
|
|
163
|
+
{
|
|
164
|
+
path: path2,
|
|
165
|
+
transform,
|
|
166
|
+
fillRule,
|
|
167
|
+
clipRule
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
}
|
|
172
171
|
);
|
|
173
172
|
}
|
|
174
173
|
var Icon = styled3.svg`
|
|
@@ -187,7 +186,7 @@ var IconBasePath = ({
|
|
|
187
186
|
clipRule
|
|
188
187
|
}) => {
|
|
189
188
|
if (typeof path2 === "string") {
|
|
190
|
-
return /* @__PURE__ */
|
|
189
|
+
return /* @__PURE__ */ jsx2(
|
|
191
190
|
"path",
|
|
192
191
|
{
|
|
193
192
|
d: path2,
|
|
@@ -197,25 +196,29 @@ var IconBasePath = ({
|
|
|
197
196
|
}
|
|
198
197
|
);
|
|
199
198
|
} else {
|
|
200
|
-
return /* @__PURE__ */
|
|
199
|
+
return /* @__PURE__ */ jsx2(Fragment, { children: path2 });
|
|
201
200
|
}
|
|
202
201
|
};
|
|
203
202
|
|
|
204
203
|
// src/components/icons/InfoIcon.tsx
|
|
204
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
205
205
|
var size = 16;
|
|
206
206
|
function InfoIcon() {
|
|
207
|
-
const path2 = /* @__PURE__ */
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
207
|
+
const path2 = /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
208
|
+
/* @__PURE__ */ jsx3(
|
|
209
|
+
"path",
|
|
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
|
+
)
|
|
220
|
+
] });
|
|
221
|
+
return /* @__PURE__ */ jsx3(IconBase, { viewBoxSize: size, size, currentColor: true, path: path2 });
|
|
219
222
|
}
|
|
220
223
|
var Path = styled4.path`
|
|
221
224
|
fill: ${({ theme: theme2 }) => theme2.color.surface1};
|
|
@@ -224,8 +227,12 @@ var Path = styled4.path`
|
|
|
224
227
|
|
|
225
228
|
// src/components/HintText/index.tsx
|
|
226
229
|
import { maxWidth as maxWidth2 } from "@charcoal-ui/utils";
|
|
230
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
227
231
|
function HintText({ children, context, className }) {
|
|
228
|
-
return /* @__PURE__ */
|
|
232
|
+
return /* @__PURE__ */ jsxs2(Container, { className, context, children: [
|
|
233
|
+
/* @__PURE__ */ jsx4(IconWrap, { children: /* @__PURE__ */ jsx4(InfoIcon, {}) }),
|
|
234
|
+
/* @__PURE__ */ jsx4(Text, { children })
|
|
235
|
+
] });
|
|
229
236
|
}
|
|
230
237
|
var Container = styled5.div.attrs(
|
|
231
238
|
styledProps
|
|
@@ -292,7 +299,8 @@ function contextToProps(context) {
|
|
|
292
299
|
}
|
|
293
300
|
|
|
294
301
|
// src/components/Layout/index.tsx
|
|
295
|
-
import
|
|
302
|
+
import { useContext } from "react";
|
|
303
|
+
import * as React2 from "react";
|
|
296
304
|
import styled6, { createGlobalStyle, css as css3 } from "styled-components";
|
|
297
305
|
|
|
298
306
|
// src/foundation/contants.ts
|
|
@@ -423,7 +431,8 @@ function useDebounceAnimationState(defaultValue) {
|
|
|
423
431
|
// src/components/Layout/index.tsx
|
|
424
432
|
import { columnSystem as columnSystem2, COLUMN_UNIT as COLUMN_UNIT2, GUTTER_UNIT as GUTTER_UNIT2 } from "@charcoal-ui/foundation";
|
|
425
433
|
import { maxWidth as maxWidth4 } from "@charcoal-ui/utils";
|
|
426
|
-
|
|
434
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
435
|
+
var LayoutConfigContext = React2.createContext({
|
|
427
436
|
wide: false,
|
|
428
437
|
center: false,
|
|
429
438
|
withLeft: false
|
|
@@ -441,7 +450,17 @@ function Layout({
|
|
|
441
450
|
wide: center ? true : wide ?? false,
|
|
442
451
|
withLeft: menu != null && !isHeaderTopMenu
|
|
443
452
|
};
|
|
444
|
-
return /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ jsxs3(LayoutRoot, { children: [
|
|
454
|
+
/* @__PURE__ */ jsxs3(LayoutConfigContext.Provider, { value: config, children: [
|
|
455
|
+
config.withLeft && /* @__PURE__ */ jsx5(LeftArea, { children: menu }),
|
|
456
|
+
/* @__PURE__ */ jsxs3(MainArea, { center, children: [
|
|
457
|
+
header != null && /* @__PURE__ */ jsx5(Header, { children: header }),
|
|
458
|
+
isHeaderTopMenu && /* @__PURE__ */ jsx5(HeaderTopMenuContainer, { children: menu }),
|
|
459
|
+
/* @__PURE__ */ jsx5(Grid, { children })
|
|
460
|
+
] })
|
|
461
|
+
] }),
|
|
462
|
+
/* @__PURE__ */ jsx5(GlobalStyle, {})
|
|
463
|
+
] });
|
|
445
464
|
}
|
|
446
465
|
var HeaderTopMenuContainer = styled6.div`
|
|
447
466
|
margin-bottom: 40px;
|
|
@@ -525,10 +544,10 @@ var Grid = styled6.div`
|
|
|
525
544
|
padding-bottom: 60px;
|
|
526
545
|
}
|
|
527
546
|
`;
|
|
528
|
-
var LayoutItem =
|
|
547
|
+
var LayoutItem = React2.forwardRef(
|
|
529
548
|
function LayoutItem2({ span, children }, ref) {
|
|
530
549
|
const { withLeft } = useContext(LayoutConfigContext);
|
|
531
|
-
return /* @__PURE__ */
|
|
550
|
+
return /* @__PURE__ */ jsx5(StyledLayoutItem, { span, withLeft, ref, children });
|
|
532
551
|
}
|
|
533
552
|
);
|
|
534
553
|
var StyledLayoutItem = styled6.div`
|
|
@@ -557,7 +576,7 @@ var StyledLayoutItem = styled6.div`
|
|
|
557
576
|
`;
|
|
558
577
|
function LayoutItemHeader({ children }) {
|
|
559
578
|
const { wide, center } = useContext(LayoutConfigContext);
|
|
560
|
-
return /* @__PURE__ */
|
|
579
|
+
return /* @__PURE__ */ jsx5(StyledLayoutItemHeader, { wide, center, children });
|
|
561
580
|
}
|
|
562
581
|
var StyledLayoutItemHeader = styled6.div`
|
|
563
582
|
padding: 0 ${(p) => p.wide ? 40 : 24}px;
|
|
@@ -616,7 +635,7 @@ function LayoutItemBody({
|
|
|
616
635
|
narrow = false
|
|
617
636
|
}) {
|
|
618
637
|
const { wide } = useContext(LayoutConfigContext);
|
|
619
|
-
return /* @__PURE__ */
|
|
638
|
+
return /* @__PURE__ */ jsx5(StyledLayoutItemBody, { wide, horizontal, narrow, children });
|
|
620
639
|
}
|
|
621
640
|
var StyledLayoutItemBody = styled6.div`
|
|
622
641
|
padding: ${(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`};
|
|
@@ -637,7 +656,7 @@ function CancelLayoutItemBodyPadding({
|
|
|
637
656
|
cancelTop
|
|
638
657
|
}) {
|
|
639
658
|
const { wide } = useContext(LayoutConfigContext);
|
|
640
|
-
return /* @__PURE__ */
|
|
659
|
+
return /* @__PURE__ */ jsx5(StyledCancelLayoutItemBodyPadding, { wide, cancelTop, children });
|
|
641
660
|
}
|
|
642
661
|
var StyledCancelLayoutItemBodyPadding = styled6.div`
|
|
643
662
|
margin: 0 -${(p) => p.wide ? LAYOUT_ITEM_BODY_PADDING.wide.x : LAYOUT_ITEM_BODY_PADDING.default.x}px;
|
|
@@ -650,11 +669,11 @@ var StyledCancelLayoutItemBodyPadding = styled6.div`
|
|
|
650
669
|
`;
|
|
651
670
|
|
|
652
671
|
// src/components/LeftMenu/index.tsx
|
|
653
|
-
import React7 from "react";
|
|
654
672
|
import styled9 from "styled-components";
|
|
655
673
|
|
|
656
674
|
// src/components/MenuListItem/index.tsx
|
|
657
|
-
import
|
|
675
|
+
import { useContext as useContext2 } from "react";
|
|
676
|
+
import * as React3 from "react";
|
|
658
677
|
import styled8, { css as css5 } from "styled-components";
|
|
659
678
|
|
|
660
679
|
// src/components/TextEllipsis/index.tsx
|
|
@@ -721,7 +740,8 @@ var TextEllipsis = styled7.div.attrs(
|
|
|
721
740
|
// src/components/MenuListItem/index.tsx
|
|
722
741
|
import { useComponentAbstraction as useComponentAbstraction2 } from "@charcoal-ui/react";
|
|
723
742
|
import { disabledSelector } from "@charcoal-ui/utils";
|
|
724
|
-
|
|
743
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
744
|
+
var MenuListItemContext = React3.createContext({ padding: 24 });
|
|
725
745
|
function MenuListItem({
|
|
726
746
|
primary,
|
|
727
747
|
secondary,
|
|
@@ -732,7 +752,7 @@ function MenuListItem({
|
|
|
732
752
|
children
|
|
733
753
|
}) {
|
|
734
754
|
const { padding } = useContext2(MenuListItemContext);
|
|
735
|
-
return /* @__PURE__ */
|
|
755
|
+
return /* @__PURE__ */ jsxs4(
|
|
736
756
|
Item,
|
|
737
757
|
{
|
|
738
758
|
hasSubLabel: secondary !== void 0,
|
|
@@ -742,10 +762,15 @@ function MenuListItem({
|
|
|
742
762
|
noClick: onClick === void 0,
|
|
743
763
|
"aria-disabled": disabled,
|
|
744
764
|
role: onClick !== void 0 ? "button" : void 0,
|
|
745
|
-
className: gtmClass !== void 0 ? `gtm-${gtmClass}` : void 0
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
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
|
+
}
|
|
749
774
|
);
|
|
750
775
|
}
|
|
751
776
|
var Item = styled8.div`
|
|
@@ -810,7 +835,7 @@ function MenuListLinkItem({
|
|
|
810
835
|
noHover,
|
|
811
836
|
children
|
|
812
837
|
};
|
|
813
|
-
return disabled ? /* @__PURE__ */
|
|
838
|
+
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 }) });
|
|
814
839
|
}
|
|
815
840
|
var A = styled8.a`
|
|
816
841
|
display: block;
|
|
@@ -820,16 +845,22 @@ function MenuListLinkItemWithIcon({
|
|
|
820
845
|
primary: text,
|
|
821
846
|
...props
|
|
822
847
|
}) {
|
|
823
|
-
const primary = /* @__PURE__ */
|
|
824
|
-
|
|
848
|
+
const primary = /* @__PURE__ */ jsxs4(IconContainer, { children: [
|
|
849
|
+
/* @__PURE__ */ jsx6(Icon2, { children: icon }),
|
|
850
|
+
text
|
|
851
|
+
] });
|
|
852
|
+
return /* @__PURE__ */ jsx6(MenuListLinkItem, { primary, ...props });
|
|
825
853
|
}
|
|
826
854
|
function MenuListItemWithIcon({
|
|
827
855
|
icon,
|
|
828
856
|
primary: text,
|
|
829
857
|
...props
|
|
830
858
|
}) {
|
|
831
|
-
const primary = /* @__PURE__ */
|
|
832
|
-
|
|
859
|
+
const primary = /* @__PURE__ */ jsxs4(IconContainer, { children: [
|
|
860
|
+
/* @__PURE__ */ jsx6(Icon2, { children: icon }),
|
|
861
|
+
text
|
|
862
|
+
] });
|
|
863
|
+
return /* @__PURE__ */ jsx6(MenuListItem, { primary, ...props });
|
|
833
864
|
}
|
|
834
865
|
var IconContainer = styled8.div`
|
|
835
866
|
display: grid;
|
|
@@ -855,15 +886,16 @@ var MenuListLabel = styled8.div`
|
|
|
855
886
|
|
|
856
887
|
// src/components/LeftMenu/index.tsx
|
|
857
888
|
import { useComponentAbstraction as useComponentAbstraction3 } from "@charcoal-ui/react";
|
|
889
|
+
import { Fragment as Fragment3, jsx as jsx7 } from "react/jsx-runtime";
|
|
858
890
|
function LeftMenu({
|
|
859
891
|
links,
|
|
860
892
|
active
|
|
861
893
|
}) {
|
|
862
894
|
const { Link } = useComponentAbstraction3();
|
|
863
|
-
return /* @__PURE__ */
|
|
895
|
+
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)) });
|
|
864
896
|
}
|
|
865
897
|
function LeftMenuContent({ links }) {
|
|
866
|
-
return /* @__PURE__ */
|
|
898
|
+
return /* @__PURE__ */ jsx7(Fragment3, { children: links.map((link, index) => /* @__PURE__ */ jsx7(MenuListLinkItem, { link: link.to, primary: link.text }, index)) });
|
|
867
899
|
}
|
|
868
900
|
var Container2 = styled9.div`
|
|
869
901
|
display: flex;
|
|
@@ -892,10 +924,11 @@ var LinkItem = styled9.div`
|
|
|
892
924
|
`;
|
|
893
925
|
|
|
894
926
|
// src/components/SwitchCheckbox/index.tsx
|
|
895
|
-
import
|
|
927
|
+
import * as React4 from "react";
|
|
896
928
|
import styled10, { css as css6 } from "styled-components";
|
|
897
929
|
import { applyEffect } from "@charcoal-ui/utils";
|
|
898
|
-
|
|
930
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
931
|
+
var SwitchCheckbox_default = React4.forwardRef(function SwitchCheckbox({
|
|
899
932
|
gtmClass,
|
|
900
933
|
flex = false,
|
|
901
934
|
rowReverse = false,
|
|
@@ -903,16 +936,21 @@ var SwitchCheckbox_default = React8.forwardRef(function SwitchCheckbox({
|
|
|
903
936
|
disabled,
|
|
904
937
|
...props
|
|
905
938
|
}, ref) {
|
|
906
|
-
return /* @__PURE__ */
|
|
939
|
+
return /* @__PURE__ */ jsxs5(
|
|
907
940
|
Label,
|
|
908
941
|
{
|
|
909
942
|
className: gtmClass !== void 0 ? `gtm-${gtmClass}` : "",
|
|
910
943
|
flex,
|
|
911
944
|
rowReverse,
|
|
912
|
-
"aria-disabled": disabled
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
945
|
+
"aria-disabled": disabled,
|
|
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
|
+
}
|
|
916
954
|
);
|
|
917
955
|
});
|
|
918
956
|
var Children2 = styled10.span`
|
|
@@ -1010,9 +1048,11 @@ var SwitchInput = styled10.input.attrs({
|
|
|
1010
1048
|
`;
|
|
1011
1049
|
|
|
1012
1050
|
// src/components/WithIcon/index.tsx
|
|
1013
|
-
import
|
|
1051
|
+
import { useRef as useRef2 } from "react";
|
|
1052
|
+
import * as React5 from "react";
|
|
1014
1053
|
import styled11, { css as css7 } from "styled-components";
|
|
1015
|
-
|
|
1054
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1055
|
+
var WithIcon_default = React5.memo(function WithIcon({
|
|
1016
1056
|
children,
|
|
1017
1057
|
icon,
|
|
1018
1058
|
show = true,
|
|
@@ -1021,8 +1061,12 @@ var WithIcon_default = React9.memo(function WithIcon({
|
|
|
1021
1061
|
fit = false,
|
|
1022
1062
|
fixed = false
|
|
1023
1063
|
}) {
|
|
1024
|
-
const node = fit ? width === void 0 ? /* @__PURE__ */
|
|
1025
|
-
return /* @__PURE__ */
|
|
1064
|
+
const node = fit ? width === void 0 ? /* @__PURE__ */ jsx9(AutoWidthIconAnchor, { show, pre, children: icon }) : /* @__PURE__ */ jsx9(IconAnchor, { width, show, pre, children: /* @__PURE__ */ jsx9(Icon3, { children: icon }) }) : /* @__PURE__ */ jsx9(IconAnchorNaive, { show, pre, children: /* @__PURE__ */ jsx9(IconNaive, { children: icon }) });
|
|
1065
|
+
return /* @__PURE__ */ jsxs6(Root, { children: [
|
|
1066
|
+
pre && node,
|
|
1067
|
+
/* @__PURE__ */ jsx9(Text2, { fixed, children }),
|
|
1068
|
+
!pre && node
|
|
1069
|
+
] });
|
|
1026
1070
|
});
|
|
1027
1071
|
var Root = styled11.div`
|
|
1028
1072
|
display: flex;
|
|
@@ -1043,7 +1087,7 @@ function AutoWidthIconAnchor({
|
|
|
1043
1087
|
}) {
|
|
1044
1088
|
const ref = useRef2(null);
|
|
1045
1089
|
const width = useElementSize(ref, [null])?.width ?? 0;
|
|
1046
|
-
return /* @__PURE__ */
|
|
1090
|
+
return /* @__PURE__ */ jsx9(IconAnchor, { width, show, pre, children: /* @__PURE__ */ jsx9(Icon3, { ref, children }) });
|
|
1047
1091
|
}
|
|
1048
1092
|
var forceCenteringCss = css7`
|
|
1049
1093
|
> svg {
|
|
@@ -1098,7 +1142,7 @@ import {
|
|
|
1098
1142
|
} from "@charcoal-ui/react";
|
|
1099
1143
|
|
|
1100
1144
|
// src/components/Carousel/index.tsx
|
|
1101
|
-
import
|
|
1145
|
+
import { useEffect as useEffect2, useState as useState2, useCallback as useCallback2, useRef as useRef3 } from "react";
|
|
1102
1146
|
import { animated, useSpring } from "react-spring";
|
|
1103
1147
|
import styled13, { css as css9 } from "styled-components";
|
|
1104
1148
|
|
|
@@ -1130,7 +1174,6 @@ import { useLayoutEffect as useLayoutEffect2, useEffect } from "react";
|
|
|
1130
1174
|
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect2 : useEffect;
|
|
1131
1175
|
|
|
1132
1176
|
// src/components/CarouselButton/index.tsx
|
|
1133
|
-
import React11 from "react";
|
|
1134
1177
|
import styled12, { css as css8 } from "styled-components";
|
|
1135
1178
|
|
|
1136
1179
|
// src/foundation/utils.ts
|
|
@@ -1141,12 +1184,12 @@ function unreachable(value) {
|
|
|
1141
1184
|
}
|
|
1142
1185
|
|
|
1143
1186
|
// src/components/icons/NextIcon.tsx
|
|
1144
|
-
import
|
|
1187
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1145
1188
|
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`;
|
|
1146
1189
|
var size2 = 24;
|
|
1147
1190
|
function NextIcon({ direction }) {
|
|
1148
1191
|
const transform = directionToTransform(direction);
|
|
1149
|
-
return /* @__PURE__ */
|
|
1192
|
+
return /* @__PURE__ */ jsx10(
|
|
1150
1193
|
IconBase,
|
|
1151
1194
|
{
|
|
1152
1195
|
viewBoxSize: size2,
|
|
@@ -1174,6 +1217,7 @@ function directionToTransform(direction) {
|
|
|
1174
1217
|
|
|
1175
1218
|
// src/components/CarouselButton/index.tsx
|
|
1176
1219
|
import { applyEffect as applyEffect2 } from "@charcoal-ui/utils";
|
|
1220
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1177
1221
|
function CarouselButton({
|
|
1178
1222
|
direction,
|
|
1179
1223
|
show,
|
|
@@ -1192,21 +1236,21 @@ function CarouselButton({
|
|
|
1192
1236
|
paddingRight: Math.max(padding, 0),
|
|
1193
1237
|
paddingBottom: bottom
|
|
1194
1238
|
};
|
|
1195
|
-
return /* @__PURE__ */
|
|
1239
|
+
return /* @__PURE__ */ jsx11(
|
|
1196
1240
|
Button,
|
|
1197
1241
|
{
|
|
1198
1242
|
type: "button",
|
|
1199
1243
|
onClick,
|
|
1200
1244
|
hide: !show,
|
|
1201
1245
|
style: offsetStyle,
|
|
1202
|
-
css: onlyNonTouchDevice
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
}
|
|
1209
|
-
|
|
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
|
+
}
|
|
1210
1254
|
);
|
|
1211
1255
|
}
|
|
1212
1256
|
var CAROUSEL_BUTTON_SIZE = 40;
|
|
@@ -1274,6 +1318,7 @@ var onlyNonTouchDevice = css8`
|
|
|
1274
1318
|
`;
|
|
1275
1319
|
|
|
1276
1320
|
// src/components/Carousel/index.tsx
|
|
1321
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1277
1322
|
var GRADIENT_WIDTH = 72;
|
|
1278
1323
|
var SCROLL_AMOUNT_COEF = 0.75;
|
|
1279
1324
|
function Carousel({
|
|
@@ -1413,67 +1458,79 @@ function Carousel({
|
|
|
1413
1458
|
if (!disableGradient && options.hasGradient === true) {
|
|
1414
1459
|
const fadeInGradient = options.fadeInGradient ?? false;
|
|
1415
1460
|
const overflowGradient = !fadeInGradient;
|
|
1416
|
-
return /* @__PURE__ */
|
|
1461
|
+
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
|
+
) }) }) }),
|
|
1471
|
+
/* @__PURE__ */ jsxs7(ButtonsContainer, { children: [
|
|
1472
|
+
/* @__PURE__ */ jsx12(
|
|
1473
|
+
CarouselButton,
|
|
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
|
+
)
|
|
1496
|
+
] })
|
|
1497
|
+
] });
|
|
1498
|
+
}
|
|
1499
|
+
return /* @__PURE__ */ jsxs7(Container3, { ref: visibleAreaRef, children: [
|
|
1500
|
+
/* @__PURE__ */ jsx12(
|
|
1417
1501
|
ScrollArea,
|
|
1418
1502
|
{
|
|
1419
1503
|
ref,
|
|
1420
1504
|
scrollLeft: styles.scroll,
|
|
1421
|
-
onScroll: handleScrollMove
|
|
1422
|
-
|
|
1423
|
-
/* @__PURE__ */ React12.createElement(CarouselContainer, { ref: innerRef, centerItems }, children)
|
|
1424
|
-
)))), /* @__PURE__ */ React12.createElement(ButtonsContainer, null, /* @__PURE__ */ React12.createElement(
|
|
1425
|
-
CarouselButton,
|
|
1426
|
-
{
|
|
1427
|
-
direction: "left" /* Left */,
|
|
1428
|
-
show: leftShow,
|
|
1429
|
-
offset: buttonOffset,
|
|
1430
|
-
bottomOffset,
|
|
1431
|
-
padding: buttonPadding,
|
|
1432
|
-
gradient: overflowGradient,
|
|
1433
|
-
onClick: handleLeft
|
|
1434
|
-
}
|
|
1435
|
-
), /* @__PURE__ */ React12.createElement(
|
|
1436
|
-
CarouselButton,
|
|
1437
|
-
{
|
|
1438
|
-
direction: "right" /* Right */,
|
|
1439
|
-
show: rightShow,
|
|
1440
|
-
offset: buttonOffset,
|
|
1441
|
-
bottomOffset,
|
|
1442
|
-
padding: buttonPadding,
|
|
1443
|
-
gradient: true,
|
|
1444
|
-
onClick: handleRight
|
|
1505
|
+
onScroll: handleScrollMove,
|
|
1506
|
+
children: /* @__PURE__ */ jsx12(CarouselContainer, { ref: innerRef, centerItems, children })
|
|
1445
1507
|
}
|
|
1446
|
-
)
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
bottomOffset,
|
|
1473
|
-
padding: buttonPadding,
|
|
1474
|
-
onClick: handleRight
|
|
1475
|
-
}
|
|
1476
|
-
)));
|
|
1508
|
+
),
|
|
1509
|
+
/* @__PURE__ */ jsxs7(ButtonsContainer, { children: [
|
|
1510
|
+
/* @__PURE__ */ jsx12(
|
|
1511
|
+
CarouselButton,
|
|
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
|
+
)
|
|
1532
|
+
] })
|
|
1533
|
+
] });
|
|
1477
1534
|
}
|
|
1478
1535
|
var CarouselContainer = styled13.ul`
|
|
1479
1536
|
vertical-align: top;
|
|
@@ -1552,15 +1609,15 @@ var LeftGradient = styled13.div`
|
|
|
1552
1609
|
`;
|
|
1553
1610
|
|
|
1554
1611
|
// src/components/Pager/index.tsx
|
|
1555
|
-
import
|
|
1612
|
+
import { memo as memo2, useCallback as useCallback3, useDebugValue as useDebugValue2, useMemo as useMemo2 } from "react";
|
|
1556
1613
|
import styled16, { css as css10 } from "styled-components";
|
|
1557
1614
|
import warning from "warning";
|
|
1558
1615
|
|
|
1559
1616
|
// src/components/icons/DotsIcon.tsx
|
|
1560
|
-
import React13 from "react";
|
|
1561
1617
|
import styled14 from "styled-components";
|
|
1618
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1562
1619
|
function DotsIcon({ size: size3 }) {
|
|
1563
|
-
return /* @__PURE__ */
|
|
1620
|
+
return /* @__PURE__ */ jsx13(StyledSVG, { viewBox: "0 0 20 6", width: size3, height: size3, children: /* @__PURE__ */ jsx13(
|
|
1564
1621
|
"path",
|
|
1565
1622
|
{
|
|
1566
1623
|
fillRule: "evenodd",
|
|
@@ -1572,7 +1629,7 @@ function DotsIcon({ size: size3 }) {
|
|
|
1572
1629
|
C20.3807119,9.5 21.5,10.6192881 21.5,12 C21.5,13.3807119 20.3807119,14.5 19,14.5 Z`,
|
|
1573
1630
|
transform: "translate(-2 -9)"
|
|
1574
1631
|
}
|
|
1575
|
-
));
|
|
1632
|
+
) });
|
|
1576
1633
|
}
|
|
1577
1634
|
DotsIcon.defaultProps = {
|
|
1578
1635
|
size: 16
|
|
@@ -1582,17 +1639,17 @@ var StyledSVG = styled14.svg`
|
|
|
1582
1639
|
`;
|
|
1583
1640
|
|
|
1584
1641
|
// src/components/icons/WedgeIcon.tsx
|
|
1585
|
-
import React14 from "react";
|
|
1586
1642
|
import styled15 from "styled-components";
|
|
1643
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1587
1644
|
function WedgeIcon({ size: size3, direction }) {
|
|
1588
|
-
return /* @__PURE__ */
|
|
1645
|
+
return /* @__PURE__ */ jsx14("svg", { viewBox: "0 0 10 8", width: size3, height: size3, children: /* @__PURE__ */ jsx14(
|
|
1589
1646
|
StyledPolyline,
|
|
1590
1647
|
{
|
|
1591
1648
|
strokeWidth: "2",
|
|
1592
1649
|
points: "1,2 5,6 9,2",
|
|
1593
1650
|
transform: directionToTransform2(direction)
|
|
1594
1651
|
}
|
|
1595
|
-
));
|
|
1652
|
+
) });
|
|
1596
1653
|
}
|
|
1597
1654
|
WedgeIcon.defaultProps = {
|
|
1598
1655
|
size: 16,
|
|
@@ -1622,6 +1679,7 @@ var StyledPolyline = styled15.polyline`
|
|
|
1622
1679
|
|
|
1623
1680
|
// src/components/Pager/index.tsx
|
|
1624
1681
|
import { useComponentAbstraction as useComponentAbstraction4 } from "@charcoal-ui/react";
|
|
1682
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1625
1683
|
function usePagerWindow(page, pageCount, windowSize = 7) {
|
|
1626
1684
|
if (process.env.NODE_ENV !== "production") {
|
|
1627
1685
|
warning((page | 0) === page, `\`page\` must be interger (${page})`);
|
|
@@ -1656,11 +1714,7 @@ function usePagerWindow(page, pageCount, windowSize = 7) {
|
|
|
1656
1714
|
useDebugValue2(window2);
|
|
1657
1715
|
return window2;
|
|
1658
1716
|
}
|
|
1659
|
-
var Pager_default =
|
|
1660
|
-
page,
|
|
1661
|
-
pageCount,
|
|
1662
|
-
onChange
|
|
1663
|
-
}) {
|
|
1717
|
+
var Pager_default = memo2(function Pager({ page, pageCount, onChange }) {
|
|
1664
1718
|
const window2 = usePagerWindow(page, pageCount);
|
|
1665
1719
|
const makeClickHandler = useCallback3(
|
|
1666
1720
|
(value) => () => {
|
|
@@ -1670,38 +1724,46 @@ var Pager_default = React15.memo(function Pager({
|
|
|
1670
1724
|
);
|
|
1671
1725
|
const hasNext = page < pageCount;
|
|
1672
1726
|
const hasPrev = page > 1;
|
|
1673
|
-
return /* @__PURE__ */
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1727
|
+
return /* @__PURE__ */ jsxs8(PagerContainer, { children: [
|
|
1728
|
+
/* @__PURE__ */ jsx15(
|
|
1729
|
+
CircleButton,
|
|
1730
|
+
{
|
|
1731
|
+
type: "button",
|
|
1732
|
+
hidden: !hasPrev,
|
|
1733
|
+
disabled: !hasPrev,
|
|
1734
|
+
onClick: makeClickHandler(Math.max(1, page - 1)),
|
|
1735
|
+
noBackground: true,
|
|
1736
|
+
children: /* @__PURE__ */ jsx15(WedgeIcon, { size: 16, direction: "left" /* Left */ })
|
|
1737
|
+
}
|
|
1738
|
+
),
|
|
1739
|
+
window2.map(
|
|
1740
|
+
(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)
|
|
1741
|
+
),
|
|
1742
|
+
/* @__PURE__ */ jsx15(
|
|
1743
|
+
CircleButton,
|
|
1744
|
+
{
|
|
1745
|
+
type: "button",
|
|
1746
|
+
hidden: !hasNext,
|
|
1747
|
+
disabled: !hasNext,
|
|
1748
|
+
onClick: makeClickHandler(Math.min(pageCount, page + 1)),
|
|
1749
|
+
noBackground: true,
|
|
1750
|
+
children: /* @__PURE__ */ jsx15(WedgeIcon, { size: 16, direction: "right" /* Right */ })
|
|
1751
|
+
}
|
|
1752
|
+
)
|
|
1753
|
+
] });
|
|
1696
1754
|
});
|
|
1697
1755
|
function LinkPager({ page, pageCount, makeUrl }) {
|
|
1698
1756
|
const { Link } = useComponentAbstraction4();
|
|
1699
1757
|
const window2 = usePagerWindow(page, pageCount);
|
|
1700
1758
|
const hasNext = page < pageCount;
|
|
1701
1759
|
const hasPrev = page > 1;
|
|
1702
|
-
return /* @__PURE__ */
|
|
1703
|
-
|
|
1704
|
-
|
|
1760
|
+
return /* @__PURE__ */ jsxs8(PagerContainer, { children: [
|
|
1761
|
+
/* @__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 */ }) }) }),
|
|
1762
|
+
window2.map(
|
|
1763
|
+
(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)
|
|
1764
|
+
),
|
|
1765
|
+
/* @__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 */ }) }) })
|
|
1766
|
+
] });
|
|
1705
1767
|
}
|
|
1706
1768
|
var PagerContainer = styled16.nav`
|
|
1707
1769
|
display: flex;
|