design-zystem 1.0.523 → 1.0.524
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.js +348 -277
- package/dist/index.mjs +316 -245
- package/dist/ui/index.js +922 -890
- package/dist/ui/index.mjs +823 -791
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4046,7 +4046,8 @@ var TableRow = (props) => {
|
|
|
4046
4046
|
var import_styled_components33 = __toESM(require("styled-components"));
|
|
4047
4047
|
|
|
4048
4048
|
// src/ui/components/ui/OverflowTooltip.tsx
|
|
4049
|
-
var
|
|
4049
|
+
var import_react23 = require("react");
|
|
4050
|
+
var import_react_dom3 = require("react-dom");
|
|
4050
4051
|
|
|
4051
4052
|
// src/ui/components/ui/Tooltip.tsx
|
|
4052
4053
|
var import_react21 = require("react");
|
|
@@ -4121,6 +4122,75 @@ var Tooltip2 = (0, import_react21.forwardRef)(
|
|
|
4121
4122
|
);
|
|
4122
4123
|
Tooltip2.displayName = "Tooltip";
|
|
4123
4124
|
|
|
4125
|
+
// src/ui/components/ui/AnchoredTooltip.tsx
|
|
4126
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4127
|
+
var AnchoredTooltip = ({
|
|
4128
|
+
text,
|
|
4129
|
+
rect,
|
|
4130
|
+
onClose
|
|
4131
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4132
|
+
Tooltip2,
|
|
4133
|
+
{
|
|
4134
|
+
content: text,
|
|
4135
|
+
open: true,
|
|
4136
|
+
onOpenChange: (open) => !open && onClose(),
|
|
4137
|
+
className: "max-w-[320px] whitespace-pre-line break-words",
|
|
4138
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4139
|
+
"span",
|
|
4140
|
+
{
|
|
4141
|
+
"aria-hidden": true,
|
|
4142
|
+
style: {
|
|
4143
|
+
position: "fixed",
|
|
4144
|
+
left: rect.left,
|
|
4145
|
+
top: rect.top,
|
|
4146
|
+
width: rect.width,
|
|
4147
|
+
height: rect.height,
|
|
4148
|
+
pointerEvents: "none"
|
|
4149
|
+
}
|
|
4150
|
+
}
|
|
4151
|
+
)
|
|
4152
|
+
}
|
|
4153
|
+
);
|
|
4154
|
+
|
|
4155
|
+
// src/ui/hooks/useAnchoredTooltip.ts
|
|
4156
|
+
var import_react22 = require("react");
|
|
4157
|
+
var OPEN_DELAY_MS = 200;
|
|
4158
|
+
var useAnchoredTooltip = () => {
|
|
4159
|
+
const tracking = (0, import_react22.useRef)();
|
|
4160
|
+
const openTimer = (0, import_react22.useRef)();
|
|
4161
|
+
const [anchor, setAnchor] = (0, import_react22.useState)(null);
|
|
4162
|
+
const dismiss = (0, import_react22.useCallback)(() => {
|
|
4163
|
+
clearTimeout(openTimer.current);
|
|
4164
|
+
setAnchor(null);
|
|
4165
|
+
}, []);
|
|
4166
|
+
const hide = (0, import_react22.useCallback)(() => {
|
|
4167
|
+
var _a;
|
|
4168
|
+
(_a = tracking.current) == null ? void 0 : _a.scroll.abort();
|
|
4169
|
+
tracking.current = void 0;
|
|
4170
|
+
dismiss();
|
|
4171
|
+
}, [dismiss]);
|
|
4172
|
+
const openAfterDelay = (0, import_react22.useCallback)(
|
|
4173
|
+
(element, readText) => {
|
|
4174
|
+
var _a;
|
|
4175
|
+
if (((_a = tracking.current) == null ? void 0 : _a.element) === element) return;
|
|
4176
|
+
hide();
|
|
4177
|
+
const scroll = new AbortController();
|
|
4178
|
+
window.addEventListener("scroll", hide, {
|
|
4179
|
+
capture: true,
|
|
4180
|
+
signal: scroll.signal
|
|
4181
|
+
});
|
|
4182
|
+
tracking.current = { element, scroll };
|
|
4183
|
+
openTimer.current = setTimeout(() => {
|
|
4184
|
+
const text = readText();
|
|
4185
|
+
if (text) setAnchor({ text, rect: element.getBoundingClientRect() });
|
|
4186
|
+
}, OPEN_DELAY_MS);
|
|
4187
|
+
},
|
|
4188
|
+
[hide]
|
|
4189
|
+
);
|
|
4190
|
+
(0, import_react22.useEffect)(() => hide, [hide]);
|
|
4191
|
+
return { anchor, openAfterDelay, hide, dismiss };
|
|
4192
|
+
};
|
|
4193
|
+
|
|
4124
4194
|
// src/ui/lib/isTruncated.ts
|
|
4125
4195
|
var isTruncated = (element) => {
|
|
4126
4196
|
const style2 = getComputedStyle(element);
|
|
@@ -4139,9 +4209,8 @@ var getVisibleText = (element) => {
|
|
|
4139
4209
|
};
|
|
4140
4210
|
|
|
4141
4211
|
// src/ui/components/ui/OverflowTooltip.tsx
|
|
4142
|
-
var
|
|
4212
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4143
4213
|
var getTruncatedText = (root) => {
|
|
4144
|
-
if (!root) return "";
|
|
4145
4214
|
const truncated = [
|
|
4146
4215
|
root,
|
|
4147
4216
|
...Array.from(root.querySelectorAll("*"))
|
|
@@ -4152,30 +4221,32 @@ var getTruncatedText = (root) => {
|
|
|
4152
4221
|
const texts = innermost.map(getVisibleText).filter(Boolean);
|
|
4153
4222
|
return Array.from(new Set(texts)).join("\n");
|
|
4154
4223
|
};
|
|
4155
|
-
var
|
|
4156
|
-
if (event.target instanceof Element && event.target.closest("[data-tooltip-trigger]") !== event.currentTarget)
|
|
4157
|
-
event.preventDefault();
|
|
4158
|
-
};
|
|
4224
|
+
var isOnNestedTrigger = (event) => event.target instanceof Element && event.target.closest("[data-tooltip-trigger]") !== event.currentTarget;
|
|
4159
4225
|
var OverflowTooltip = ({ children }) => {
|
|
4160
|
-
const
|
|
4161
|
-
const
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
onFocus:
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4226
|
+
const { anchor, openAfterDelay, hide, dismiss } = useAnchoredTooltip();
|
|
4227
|
+
const showAfterDelay = (event) => {
|
|
4228
|
+
if (isOnNestedTrigger(event)) return hide();
|
|
4229
|
+
const cell = event.currentTarget;
|
|
4230
|
+
openAfterDelay(cell, () => getTruncatedText(cell));
|
|
4231
|
+
};
|
|
4232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
4233
|
+
(0, import_react23.cloneElement)(children, {
|
|
4234
|
+
"data-tooltip-trigger": "",
|
|
4235
|
+
onPointerOver: showAfterDelay,
|
|
4236
|
+
onFocus: showAfterDelay,
|
|
4237
|
+
onPointerLeave: hide,
|
|
4238
|
+
onPointerDown: dismiss,
|
|
4239
|
+
onBlur: hide
|
|
4240
|
+
}),
|
|
4241
|
+
anchor && (0, import_react_dom3.createPortal)(
|
|
4242
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AnchoredTooltip, __spreadProps(__spreadValues({}, anchor), { onClose: dismiss })),
|
|
4243
|
+
document.body
|
|
4244
|
+
)
|
|
4245
|
+
] });
|
|
4175
4246
|
};
|
|
4176
4247
|
|
|
4177
4248
|
// src/ui-legacy/Components/Table/TableCell/TableCell.tsx
|
|
4178
|
-
var
|
|
4249
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4179
4250
|
var shouldForwardPropTableCell = (prop) => ![
|
|
4180
4251
|
"backgroundColor",
|
|
4181
4252
|
"flexGrow",
|
|
@@ -4210,13 +4281,13 @@ var StyledTableCell = import_styled_components33.default.div.withConfig({
|
|
|
4210
4281
|
`;
|
|
4211
4282
|
var TableCell = (props) => {
|
|
4212
4283
|
const _a = props, { centerContent, children } = _a, otherProps = __objRest(_a, ["centerContent", "children"]);
|
|
4213
|
-
return /* @__PURE__ */ (0,
|
|
4284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OverflowTooltip, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(StyledTableCell, __spreadProps(__spreadValues({}, otherProps), { children: centerContent ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { style: { display: "flex", justifyContent: "center" }, children }) : children })) });
|
|
4214
4285
|
};
|
|
4215
4286
|
|
|
4216
4287
|
// src/ui-legacy/Components/Table/TableHeaderCell/TableHeaderCell.tsx
|
|
4217
|
-
var
|
|
4288
|
+
var import_react24 = require("react");
|
|
4218
4289
|
var import_styled_components34 = __toESM(require("styled-components"));
|
|
4219
|
-
var
|
|
4290
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4220
4291
|
var shouldForwardPropTableHeaderCell = (prop) => ![
|
|
4221
4292
|
"useSort",
|
|
4222
4293
|
"isSort",
|
|
@@ -4259,11 +4330,11 @@ var SortArrow = import_styled_components34.default.span`
|
|
|
4259
4330
|
`;
|
|
4260
4331
|
var TableHeaderCell = (props) => {
|
|
4261
4332
|
const _a = props, { children, useSort, isSort, sortOrder } = _a, otherProps = __objRest(_a, ["children", "useSort", "isSort", "sortOrder"]);
|
|
4262
|
-
const [hovered, setHovered] = (0,
|
|
4333
|
+
const [hovered, setHovered] = (0, import_react24.useState)(false);
|
|
4263
4334
|
const showArrow = useSort && (isSort || hovered);
|
|
4264
4335
|
const arrowChar = isSort && sortOrder === "asc" ? "\u2191" : "\u2193";
|
|
4265
4336
|
const arrowOpacity = isSort ? 1 : 0.35;
|
|
4266
|
-
return /* @__PURE__ */ (0,
|
|
4337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4267
4338
|
StyledTableHeaderCell,
|
|
4268
4339
|
__spreadProps(__spreadValues({}, otherProps), {
|
|
4269
4340
|
useSort,
|
|
@@ -4278,9 +4349,9 @@ var TableHeaderCell = (props) => {
|
|
|
4278
4349
|
if (useSort) setHovered(false);
|
|
4279
4350
|
(_a2 = otherProps.onMouseLeave) == null ? void 0 : _a2.call(otherProps, e);
|
|
4280
4351
|
},
|
|
4281
|
-
children: useSort ? /* @__PURE__ */ (0,
|
|
4352
|
+
children: useSort ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(SortingButton, { children: [
|
|
4282
4353
|
children,
|
|
4283
|
-
showArrow && /* @__PURE__ */ (0,
|
|
4354
|
+
showArrow && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SortArrow, { $opacity: arrowOpacity, children: arrowChar })
|
|
4284
4355
|
] }) : children
|
|
4285
4356
|
})
|
|
4286
4357
|
);
|
|
@@ -4288,7 +4359,7 @@ var TableHeaderCell = (props) => {
|
|
|
4288
4359
|
|
|
4289
4360
|
// src/ui-legacy/Components/Table/TableHeaderRow/TableHeaderRow.tsx
|
|
4290
4361
|
var import_styled_components35 = __toESM(require("styled-components"));
|
|
4291
|
-
var
|
|
4362
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4292
4363
|
var shouldForwardPropTableHeaderRow = (prop) => !["backgroundColor"].includes(prop);
|
|
4293
4364
|
var StyledTableHeaderRow = import_styled_components35.default.div.withConfig({
|
|
4294
4365
|
shouldForwardProp: shouldForwardPropTableHeaderRow
|
|
@@ -4300,12 +4371,12 @@ var StyledTableHeaderRow = import_styled_components35.default.div.withConfig({
|
|
|
4300
4371
|
`;
|
|
4301
4372
|
var TableHeaderRow = (props) => {
|
|
4302
4373
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
4303
|
-
return /* @__PURE__ */ (0,
|
|
4374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(StyledTableHeaderRow, __spreadProps(__spreadValues({}, otherProps), { children }));
|
|
4304
4375
|
};
|
|
4305
4376
|
|
|
4306
4377
|
// src/ui-legacy/Components/Table/TableFooter/TableFooter.tsx
|
|
4307
4378
|
var import_styled_components36 = __toESM(require("styled-components"));
|
|
4308
|
-
var
|
|
4379
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4309
4380
|
var shouldForwardPropTableFooter = (prop) => !["backgroundColor"].includes(prop);
|
|
4310
4381
|
var StyledTableFooter = import_styled_components36.default.div.withConfig({
|
|
4311
4382
|
shouldForwardProp: shouldForwardPropTableFooter
|
|
@@ -4322,12 +4393,12 @@ var StyledTableFooter = import_styled_components36.default.div.withConfig({
|
|
|
4322
4393
|
`;
|
|
4323
4394
|
var TableFooter = (props) => {
|
|
4324
4395
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
4325
|
-
return /* @__PURE__ */ (0,
|
|
4396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(StyledTableFooter, __spreadProps(__spreadValues({}, otherProps), { children }));
|
|
4326
4397
|
};
|
|
4327
4398
|
|
|
4328
4399
|
// src/ui-legacy/Components/Table/TableFooterRow/TableFooterRow.tsx
|
|
4329
4400
|
var import_styled_components37 = __toESM(require("styled-components"));
|
|
4330
|
-
var
|
|
4401
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4331
4402
|
var shouldForwardPropTableFooterRow = (prop) => !["backgroundColor"].includes(prop);
|
|
4332
4403
|
var StyledTableFooterRow = import_styled_components37.default.div.withConfig({
|
|
4333
4404
|
shouldForwardProp: shouldForwardPropTableFooterRow
|
|
@@ -4339,12 +4410,12 @@ var StyledTableFooterRow = import_styled_components37.default.div.withConfig({
|
|
|
4339
4410
|
`;
|
|
4340
4411
|
var TableFooterRow = (props) => {
|
|
4341
4412
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
4342
|
-
return /* @__PURE__ */ (0,
|
|
4413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(StyledTableFooterRow, __spreadProps(__spreadValues({}, otherProps), { children }));
|
|
4343
4414
|
};
|
|
4344
4415
|
|
|
4345
4416
|
// src/ui-legacy/Components/Table/TableFooterCell/TableFooterCell.tsx
|
|
4346
4417
|
var import_styled_components38 = __toESM(require("styled-components"));
|
|
4347
|
-
var
|
|
4418
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4348
4419
|
var shouldForwardPropTableFooterCell = (prop) => !["useSort", "flexGrow", "flexShrink", "width"].includes(prop);
|
|
4349
4420
|
var StyledTableFooterCell = import_styled_components38.default.div.withConfig({
|
|
4350
4421
|
shouldForwardProp: shouldForwardPropTableFooterCell
|
|
@@ -4372,17 +4443,17 @@ var StyledTableFooterCell = import_styled_components38.default.div.withConfig({
|
|
|
4372
4443
|
`;
|
|
4373
4444
|
var TableFooterCell = (props) => {
|
|
4374
4445
|
const _a = props, { children, useSort } = _a, otherProps = __objRest(_a, ["children", "useSort"]);
|
|
4375
|
-
return /* @__PURE__ */ (0,
|
|
4446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4376
4447
|
StyledTableFooterCell,
|
|
4377
4448
|
__spreadProps(__spreadValues({}, otherProps), {
|
|
4378
4449
|
useSort,
|
|
4379
|
-
children: useSort ? /* @__PURE__ */ (0,
|
|
4450
|
+
children: useSort ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "sortingButton", children }) : children
|
|
4380
4451
|
})
|
|
4381
4452
|
);
|
|
4382
4453
|
};
|
|
4383
4454
|
|
|
4384
4455
|
// src/ui-legacy/Components/Table/SkeletonRow/SkeletonRow.tsx
|
|
4385
|
-
var
|
|
4456
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4386
4457
|
var style = `
|
|
4387
4458
|
.skeleton-loader {
|
|
4388
4459
|
width: 100%;
|
|
@@ -4401,15 +4472,15 @@ var style = `
|
|
|
4401
4472
|
}
|
|
4402
4473
|
}
|
|
4403
4474
|
`;
|
|
4404
|
-
var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ (0,
|
|
4405
|
-
/* @__PURE__ */ (0,
|
|
4406
|
-
/* @__PURE__ */ (0,
|
|
4475
|
+
var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
4476
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("style", { children: style }),
|
|
4477
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableRow, { children: Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "skeleton-loader" }) }, index)) })
|
|
4407
4478
|
] });
|
|
4408
4479
|
|
|
4409
4480
|
// src/ui-legacy/Components/Switch/Switch.tsx
|
|
4410
|
-
var
|
|
4481
|
+
var import_react25 = require("react");
|
|
4411
4482
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
4412
|
-
var
|
|
4483
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4413
4484
|
var BASE = {
|
|
4414
4485
|
s: { w: 36, h: 20, knob: 16, pad: 2 },
|
|
4415
4486
|
m: { w: 48, h: 28, knob: 24, pad: 2 },
|
|
@@ -4488,7 +4559,7 @@ var Knob = import_styled_components39.default.span`
|
|
|
4488
4559
|
transform: translateY(-50%) scale(0.96);
|
|
4489
4560
|
}
|
|
4490
4561
|
`;
|
|
4491
|
-
var Switch = (0,
|
|
4562
|
+
var Switch = (0, import_react25.forwardRef)(
|
|
4492
4563
|
(_a, ref) => {
|
|
4493
4564
|
var _b = _a, {
|
|
4494
4565
|
checked,
|
|
@@ -4510,8 +4581,8 @@ var Switch = (0, import_react24.forwardRef)(
|
|
|
4510
4581
|
if (disabled) return;
|
|
4511
4582
|
onChange == null ? void 0 : onChange(!!e.target.checked, e);
|
|
4512
4583
|
};
|
|
4513
|
-
return /* @__PURE__ */ (0,
|
|
4514
|
-
/* @__PURE__ */ (0,
|
|
4584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Container4, { $disabled: disabled, htmlFor: id, children: [
|
|
4585
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4515
4586
|
HiddenCheckbox,
|
|
4516
4587
|
__spreadValues({
|
|
4517
4588
|
id,
|
|
@@ -4524,16 +4595,16 @@ var Switch = (0, import_react24.forwardRef)(
|
|
|
4524
4595
|
ref
|
|
4525
4596
|
}, rest)
|
|
4526
4597
|
),
|
|
4527
|
-
/* @__PURE__ */ (0,
|
|
4598
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Track, { $checked: !!checked, $size: size, $color: color, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Knob, { $checked: !!checked, $size: size }) })
|
|
4528
4599
|
] });
|
|
4529
4600
|
}
|
|
4530
4601
|
);
|
|
4531
4602
|
Switch.displayName = "Switch";
|
|
4532
4603
|
|
|
4533
4604
|
// src/ui-legacy/Components/CardSkeleton/CardSkeleton.tsx
|
|
4534
|
-
var
|
|
4605
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4535
4606
|
var CardSkeleton = () => {
|
|
4536
|
-
return /* @__PURE__ */ (0,
|
|
4607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4537
4608
|
Box,
|
|
4538
4609
|
{
|
|
4539
4610
|
fullWidth: true,
|
|
@@ -4544,8 +4615,8 @@ var CardSkeleton = () => {
|
|
|
4544
4615
|
};
|
|
4545
4616
|
|
|
4546
4617
|
// src/ui-legacy/Components/Options/Options.tsx
|
|
4547
|
-
var
|
|
4548
|
-
var
|
|
4618
|
+
var import_react26 = require("react");
|
|
4619
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4549
4620
|
var Options = ({
|
|
4550
4621
|
icon,
|
|
4551
4622
|
options,
|
|
@@ -4554,8 +4625,8 @@ var Options = ({
|
|
|
4554
4625
|
onChange,
|
|
4555
4626
|
disabled = false
|
|
4556
4627
|
}) => {
|
|
4557
|
-
const [state, setState] = (0,
|
|
4558
|
-
(0,
|
|
4628
|
+
const [state, setState] = (0, import_react26.useState)(0);
|
|
4629
|
+
(0, import_react26.useEffect)(() => {
|
|
4559
4630
|
if (defaultId) {
|
|
4560
4631
|
const defaultIndex = options.findIndex(
|
|
4561
4632
|
(option) => option.id === defaultId
|
|
@@ -4576,7 +4647,7 @@ var Options = ({
|
|
|
4576
4647
|
}
|
|
4577
4648
|
};
|
|
4578
4649
|
const { label, color } = options[state] || options[0];
|
|
4579
|
-
return /* @__PURE__ */ (0,
|
|
4650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4580
4651
|
"div",
|
|
4581
4652
|
{
|
|
4582
4653
|
onClick: disabled ? void 0 : handleClick,
|
|
@@ -4604,18 +4675,18 @@ var Options = ({
|
|
|
4604
4675
|
e.currentTarget.style.transform = "translateY(0px)";
|
|
4605
4676
|
}
|
|
4606
4677
|
},
|
|
4607
|
-
children: /* @__PURE__ */ (0,
|
|
4608
|
-
/* @__PURE__ */ (0,
|
|
4609
|
-
/* @__PURE__ */ (0,
|
|
4678
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Row_default, { gap: "8", alignItems: "center", justifyContent: "center", children: [
|
|
4679
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Col_default, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon_default, { name: icon, color: "#414652" }) }),
|
|
4680
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Col_default, { children: label })
|
|
4610
4681
|
] })
|
|
4611
4682
|
}
|
|
4612
4683
|
);
|
|
4613
4684
|
};
|
|
4614
4685
|
|
|
4615
4686
|
// src/ui-legacy/Components/Stepper/Stepper.tsx
|
|
4616
|
-
var
|
|
4687
|
+
var import_react27 = require("react");
|
|
4617
4688
|
var import_styled_components40 = __toESM(require("styled-components"));
|
|
4618
|
-
var
|
|
4689
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4619
4690
|
var Wrapper5 = import_styled_components40.default.nav`
|
|
4620
4691
|
width: 100%;
|
|
4621
4692
|
display: flex;
|
|
@@ -4649,29 +4720,29 @@ var Stepper = ({
|
|
|
4649
4720
|
size = 28,
|
|
4650
4721
|
className
|
|
4651
4722
|
}) => {
|
|
4652
|
-
return /* @__PURE__ */ (0,
|
|
4723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Wrapper5, { "aria-label": "progression", className, children: Array.from({ length: numberOfSteps }, (_, i) => {
|
|
4653
4724
|
const isActive = i === current;
|
|
4654
4725
|
const isCompleted = i < current;
|
|
4655
|
-
return /* @__PURE__ */ (0,
|
|
4656
|
-
/* @__PURE__ */ (0,
|
|
4726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_react27.Fragment, { children: [
|
|
4727
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4657
4728
|
Circle,
|
|
4658
4729
|
{
|
|
4659
4730
|
size,
|
|
4660
4731
|
active: isActive,
|
|
4661
4732
|
completed: isCompleted,
|
|
4662
4733
|
"aria-hidden": true,
|
|
4663
|
-
children: isCompleted ? /* @__PURE__ */ (0,
|
|
4734
|
+
children: isCompleted ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Icon, { name: "check", size: "xs", color: "white" }) : i + 1
|
|
4664
4735
|
}
|
|
4665
4736
|
),
|
|
4666
|
-
i < numberOfSteps - 1 && /* @__PURE__ */ (0,
|
|
4737
|
+
i < numberOfSteps - 1 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Connector, {})
|
|
4667
4738
|
] }, i);
|
|
4668
4739
|
}) });
|
|
4669
4740
|
};
|
|
4670
4741
|
|
|
4671
4742
|
// src/ui-legacy/Components/Tabs/Tabs.tsx
|
|
4672
|
-
var
|
|
4743
|
+
var import_react28 = require("react");
|
|
4673
4744
|
var import_styled_components41 = __toESM(require("styled-components"));
|
|
4674
|
-
var
|
|
4745
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4675
4746
|
var TOKENS = {
|
|
4676
4747
|
fontFamily: '"Open Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif'
|
|
4677
4748
|
};
|
|
@@ -4840,7 +4911,7 @@ var Tab = (_a) => {
|
|
|
4840
4911
|
"size",
|
|
4841
4912
|
"activeColor"
|
|
4842
4913
|
]);
|
|
4843
|
-
return /* @__PURE__ */ (0,
|
|
4914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4844
4915
|
TabButton,
|
|
4845
4916
|
__spreadProps(__spreadValues({
|
|
4846
4917
|
ref: innerRef,
|
|
@@ -4885,13 +4956,13 @@ var Tabs = (_a) => {
|
|
|
4885
4956
|
"size",
|
|
4886
4957
|
"activeColor"
|
|
4887
4958
|
]);
|
|
4888
|
-
const rootRef = (0,
|
|
4889
|
-
const refsMap = (0,
|
|
4890
|
-
const [bar, setBar] = (0,
|
|
4959
|
+
const rootRef = (0, import_react28.useRef)(null);
|
|
4960
|
+
const refsMap = (0, import_react28.useRef)(/* @__PURE__ */ new Map());
|
|
4961
|
+
const [bar, setBar] = (0, import_react28.useState)({ left: 0, width: 0 });
|
|
4891
4962
|
const setTabRef = (id) => (el) => {
|
|
4892
4963
|
if (el) refsMap.current.set(id, el);
|
|
4893
4964
|
};
|
|
4894
|
-
const updateBar = (0,
|
|
4965
|
+
const updateBar = (0, import_react28.useCallback)(() => {
|
|
4895
4966
|
const root = rootRef.current;
|
|
4896
4967
|
const activeEl = value !== void 0 ? refsMap.current.get(value) : void 0;
|
|
4897
4968
|
if (!root || !activeEl) return;
|
|
@@ -4899,7 +4970,7 @@ var Tabs = (_a) => {
|
|
|
4899
4970
|
const box = activeEl.getBoundingClientRect();
|
|
4900
4971
|
setBar({ left: box.left - rootBox.left, width: box.width });
|
|
4901
4972
|
}, [value]);
|
|
4902
|
-
(0,
|
|
4973
|
+
(0, import_react28.useEffect)(() => {
|
|
4903
4974
|
updateBar();
|
|
4904
4975
|
const ro = new ResizeObserver(updateBar);
|
|
4905
4976
|
const activeEl = value !== void 0 ? refsMap.current.get(value) : void 0;
|
|
@@ -4907,16 +4978,16 @@ var Tabs = (_a) => {
|
|
|
4907
4978
|
if (activeEl) ro.observe(activeEl);
|
|
4908
4979
|
return () => ro.disconnect();
|
|
4909
4980
|
}, [value, updateBar]);
|
|
4910
|
-
const handleSelect = (0,
|
|
4981
|
+
const handleSelect = (0, import_react28.useCallback)(
|
|
4911
4982
|
(id) => {
|
|
4912
4983
|
if (id !== value && onChange) onChange(id);
|
|
4913
4984
|
},
|
|
4914
4985
|
[onChange, value]
|
|
4915
4986
|
);
|
|
4916
4987
|
const isPillsFullWidth = variant === "pills" && align === "start";
|
|
4917
|
-
const rendered = (0,
|
|
4988
|
+
const rendered = (0, import_react28.useMemo)(() => {
|
|
4918
4989
|
if (items && items.length) {
|
|
4919
|
-
return items.map((it) => /* @__PURE__ */ (0,
|
|
4990
|
+
return items.map((it) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
4920
4991
|
Tab,
|
|
4921
4992
|
{
|
|
4922
4993
|
id: it.id,
|
|
@@ -4930,8 +5001,8 @@ var Tabs = (_a) => {
|
|
|
4930
5001
|
activeColor,
|
|
4931
5002
|
children: [
|
|
4932
5003
|
it.label,
|
|
4933
|
-
it.dot && /* @__PURE__ */ (0,
|
|
4934
|
-
Boolean(it.bubbleActive || it.bubbleNumber) && /* @__PURE__ */ (0,
|
|
5004
|
+
it.dot && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TabDot, { $color: it.dotColor }),
|
|
5005
|
+
Boolean(it.bubbleActive || it.bubbleNumber) && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4935
5006
|
TabBubble,
|
|
4936
5007
|
{
|
|
4937
5008
|
size: "xs",
|
|
@@ -4946,12 +5017,12 @@ var Tabs = (_a) => {
|
|
|
4946
5017
|
it.id
|
|
4947
5018
|
));
|
|
4948
5019
|
}
|
|
4949
|
-
return
|
|
5020
|
+
return import_react28.Children.map(children, (child) => {
|
|
4950
5021
|
var _a2;
|
|
4951
|
-
if (!(0,
|
|
5022
|
+
if (!(0, import_react28.isValidElement)(child)) return child;
|
|
4952
5023
|
const id = (_a2 = child.props.id) != null ? _a2 : child.key;
|
|
4953
5024
|
const active = id === value;
|
|
4954
|
-
return (0,
|
|
5025
|
+
return (0, import_react28.cloneElement)(child, {
|
|
4955
5026
|
active,
|
|
4956
5027
|
variant,
|
|
4957
5028
|
fullWidth: isPillsFullWidth,
|
|
@@ -4971,7 +5042,7 @@ var Tabs = (_a) => {
|
|
|
4971
5042
|
size,
|
|
4972
5043
|
activeColor
|
|
4973
5044
|
]);
|
|
4974
|
-
return /* @__PURE__ */ (0,
|
|
5045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
4975
5046
|
TabsRoot,
|
|
4976
5047
|
__spreadProps(__spreadValues({
|
|
4977
5048
|
ref: rootRef,
|
|
@@ -4982,7 +5053,7 @@ var Tabs = (_a) => {
|
|
|
4982
5053
|
variant
|
|
4983
5054
|
}, rest), {
|
|
4984
5055
|
children: [
|
|
4985
|
-
/* @__PURE__ */ (0,
|
|
5056
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4986
5057
|
TabsList,
|
|
4987
5058
|
{
|
|
4988
5059
|
align,
|
|
@@ -4992,16 +5063,16 @@ var Tabs = (_a) => {
|
|
|
4992
5063
|
children: rendered
|
|
4993
5064
|
}
|
|
4994
5065
|
),
|
|
4995
|
-
variant === "line" && showBaseline && /* @__PURE__ */ (0,
|
|
5066
|
+
variant === "line" && showBaseline && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ActiveBar, { style: { left: bar.left, width: bar.width } })
|
|
4996
5067
|
]
|
|
4997
5068
|
})
|
|
4998
5069
|
);
|
|
4999
5070
|
};
|
|
5000
5071
|
|
|
5001
5072
|
// src/ui-legacy/Components/MultiSelect/MultiSelect.tsx
|
|
5002
|
-
var
|
|
5073
|
+
var import_react29 = require("react");
|
|
5003
5074
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
5004
|
-
var
|
|
5075
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5005
5076
|
var Container5 = import_styled_components42.default.div`
|
|
5006
5077
|
position: relative;
|
|
5007
5078
|
display: inline-block;
|
|
@@ -5042,8 +5113,8 @@ var MultiSelect = ({
|
|
|
5042
5113
|
width,
|
|
5043
5114
|
align = "left"
|
|
5044
5115
|
}) => {
|
|
5045
|
-
const [isOpen, setIsOpen] = (0,
|
|
5046
|
-
const dropdownRef = (0,
|
|
5116
|
+
const [isOpen, setIsOpen] = (0, import_react29.useState)(false);
|
|
5117
|
+
const dropdownRef = (0, import_react29.useRef)(null);
|
|
5047
5118
|
const toggleOption = (value) => {
|
|
5048
5119
|
if (!onChange) return;
|
|
5049
5120
|
if (selectedValues.includes(value)) {
|
|
@@ -5053,7 +5124,7 @@ var MultiSelect = ({
|
|
|
5053
5124
|
onChange([...selectedValues, value]);
|
|
5054
5125
|
}
|
|
5055
5126
|
};
|
|
5056
|
-
(0,
|
|
5127
|
+
(0, import_react29.useEffect)(() => {
|
|
5057
5128
|
const handleClickOutside = (e) => {
|
|
5058
5129
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
5059
5130
|
setIsOpen(false);
|
|
@@ -5062,8 +5133,8 @@ var MultiSelect = ({
|
|
|
5062
5133
|
document.addEventListener("mousedown", handleClickOutside);
|
|
5063
5134
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
5064
5135
|
}, []);
|
|
5065
|
-
return /* @__PURE__ */ (0,
|
|
5066
|
-
/* @__PURE__ */ (0,
|
|
5136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Container5, { ref: dropdownRef, children: [
|
|
5137
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5067
5138
|
Button,
|
|
5068
5139
|
{
|
|
5069
5140
|
onClick: () => setIsOpen((p) => !p),
|
|
@@ -5073,11 +5144,11 @@ var MultiSelect = ({
|
|
|
5073
5144
|
disabled
|
|
5074
5145
|
}
|
|
5075
5146
|
),
|
|
5076
|
-
isOpen && /* @__PURE__ */ (0,
|
|
5147
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Dropdown2, { $width: width, $align: align, children: [
|
|
5077
5148
|
options.map(({ label: optLabel, value }) => {
|
|
5078
5149
|
const active = selectedValues.includes(value);
|
|
5079
|
-
return /* @__PURE__ */ (0,
|
|
5080
|
-
/* @__PURE__ */ (0,
|
|
5150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Item, { onClick: () => toggleOption(value), children: [
|
|
5151
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5081
5152
|
Icon,
|
|
5082
5153
|
{
|
|
5083
5154
|
name: "check",
|
|
@@ -5085,17 +5156,17 @@ var MultiSelect = ({
|
|
|
5085
5156
|
color: active ? colors.blue_700 : colors.transparent
|
|
5086
5157
|
}
|
|
5087
5158
|
),
|
|
5088
|
-
/* @__PURE__ */ (0,
|
|
5159
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text, { size: "xs", color: active ? "blue_700" : "grey_700", children: optLabel })
|
|
5089
5160
|
] }, String(value));
|
|
5090
5161
|
}),
|
|
5091
|
-
options.length === 0 && /* @__PURE__ */ (0,
|
|
5162
|
+
options.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Item, { as: "div", style: { cursor: "default" }, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text, { size: "xs", color: "grey_500", children: "Aucune option" }) })
|
|
5092
5163
|
] })
|
|
5093
5164
|
] });
|
|
5094
5165
|
};
|
|
5095
5166
|
|
|
5096
5167
|
// src/ui-legacy/Components/DatePicker/DatePicker.tsx
|
|
5097
|
-
var
|
|
5098
|
-
var
|
|
5168
|
+
var import_react30 = require("react");
|
|
5169
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5099
5170
|
var LOCALE_MAP = {
|
|
5100
5171
|
fr: "fr-FR",
|
|
5101
5172
|
en: "en-GB",
|
|
@@ -5165,28 +5236,28 @@ var DatePicker = (props) => {
|
|
|
5165
5236
|
const resolvedLocale = resolveLocale(locale);
|
|
5166
5237
|
const monthNames = getMonthNames(resolvedLocale);
|
|
5167
5238
|
const dayNames = getDayNames(resolvedLocale);
|
|
5168
|
-
const [isOpen, setIsOpen] = (0,
|
|
5169
|
-
const [currentMonth, setCurrentMonth] = (0,
|
|
5170
|
-
const [isSelectingEnd, setIsSelectingEnd] = (0,
|
|
5171
|
-
const [singleDate, setSingleDate] = (0,
|
|
5239
|
+
const [isOpen, setIsOpen] = (0, import_react30.useState)(defaultOpen);
|
|
5240
|
+
const [currentMonth, setCurrentMonth] = (0, import_react30.useState)(/* @__PURE__ */ new Date());
|
|
5241
|
+
const [isSelectingEnd, setIsSelectingEnd] = (0, import_react30.useState)(false);
|
|
5242
|
+
const [singleDate, setSingleDate] = (0, import_react30.useState)(
|
|
5172
5243
|
isSingle ? (_a = props.value) != null ? _a : null : null
|
|
5173
5244
|
);
|
|
5174
|
-
const [startDate, setStartDate] = (0,
|
|
5245
|
+
const [startDate, setStartDate] = (0, import_react30.useState)(
|
|
5175
5246
|
!isSingle ? (_c = (_b = props.value) == null ? void 0 : _b.start) != null ? _c : null : null
|
|
5176
5247
|
);
|
|
5177
|
-
const [endDate, setEndDate] = (0,
|
|
5248
|
+
const [endDate, setEndDate] = (0, import_react30.useState)(
|
|
5178
5249
|
!isSingle ? (_e = (_d = props.value) == null ? void 0 : _d.end) != null ? _e : null : null
|
|
5179
5250
|
);
|
|
5180
|
-
const ref = (0,
|
|
5251
|
+
const ref = (0, import_react30.useRef)(null);
|
|
5181
5252
|
const singleValueMs = isSingle ? (_f = props.value) == null ? void 0 : _f.getTime() : void 0;
|
|
5182
5253
|
const rangeStartMs = !isSingle ? (_h = (_g = props.value) == null ? void 0 : _g.start) == null ? void 0 : _h.getTime() : void 0;
|
|
5183
5254
|
const rangeEndMs = !isSingle ? (_j = (_i = props.value) == null ? void 0 : _i.end) == null ? void 0 : _j.getTime() : void 0;
|
|
5184
|
-
(0,
|
|
5255
|
+
(0, import_react30.useEffect)(() => {
|
|
5185
5256
|
if (!isSingle) return;
|
|
5186
5257
|
const v = props.value;
|
|
5187
5258
|
if (v !== void 0) setSingleDate(v);
|
|
5188
5259
|
}, [singleValueMs]);
|
|
5189
|
-
(0,
|
|
5260
|
+
(0, import_react30.useEffect)(() => {
|
|
5190
5261
|
var _a2, _b2;
|
|
5191
5262
|
if (isSingle) return;
|
|
5192
5263
|
const v = props.value;
|
|
@@ -5194,7 +5265,7 @@ var DatePicker = (props) => {
|
|
|
5194
5265
|
setStartDate((_a2 = v == null ? void 0 : v.start) != null ? _a2 : null);
|
|
5195
5266
|
setEndDate((_b2 = v == null ? void 0 : v.end) != null ? _b2 : null);
|
|
5196
5267
|
}, [rangeStartMs, rangeEndMs]);
|
|
5197
|
-
(0,
|
|
5268
|
+
(0, import_react30.useEffect)(() => {
|
|
5198
5269
|
const handleClickOutside = (e) => {
|
|
5199
5270
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
5200
5271
|
setIsOpen(false);
|
|
@@ -5283,28 +5354,28 @@ var DatePicker = (props) => {
|
|
|
5283
5354
|
}).format(date);
|
|
5284
5355
|
const inputLabel = isSingle ? singleDate ? formatShort(singleDate) : "S\xE9lectionner une date" : startDate && endDate ? `${formatShort(startDate)} \u2014 ${formatShort(endDate)}` : "S\xE9lectionner une p\xE9riode";
|
|
5285
5356
|
const inputHasValue = isSingle ? !!singleDate : !!startDate && !!endDate;
|
|
5286
|
-
return /* @__PURE__ */ (0,
|
|
5357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
5287
5358
|
"div",
|
|
5288
5359
|
{
|
|
5289
5360
|
className: "date-picker-container",
|
|
5290
5361
|
ref,
|
|
5291
5362
|
style: width ? { width } : void 0,
|
|
5292
5363
|
children: [
|
|
5293
|
-
variant === "input" ? /* @__PURE__ */ (0,
|
|
5364
|
+
variant === "input" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
5294
5365
|
"button",
|
|
5295
5366
|
{
|
|
5296
5367
|
className: `date-picker-input-trigger${inputHasValue ? " date-picker-input-trigger--filled" : ""}`,
|
|
5297
5368
|
onClick: () => setIsOpen((prev) => !prev),
|
|
5298
5369
|
disabled,
|
|
5299
5370
|
children: [
|
|
5300
|
-
/* @__PURE__ */ (0,
|
|
5371
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5301
5372
|
"span",
|
|
5302
5373
|
{
|
|
5303
5374
|
className: inputHasValue ? "" : "date-picker-input-placeholder",
|
|
5304
5375
|
children: inputLabel
|
|
5305
5376
|
}
|
|
5306
5377
|
),
|
|
5307
|
-
inputHasValue && /* @__PURE__ */ (0,
|
|
5378
|
+
inputHasValue && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5308
5379
|
"span",
|
|
5309
5380
|
{
|
|
5310
5381
|
className: "date-picker-input-clear",
|
|
@@ -5312,13 +5383,13 @@ var DatePicker = (props) => {
|
|
|
5312
5383
|
e.stopPropagation();
|
|
5313
5384
|
reset();
|
|
5314
5385
|
},
|
|
5315
|
-
children: /* @__PURE__ */ (0,
|
|
5386
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon, { name: "xmark", size: "s", color: colors.grey_400 })
|
|
5316
5387
|
}
|
|
5317
5388
|
)
|
|
5318
5389
|
]
|
|
5319
5390
|
}
|
|
5320
|
-
) : /* @__PURE__ */ (0,
|
|
5321
|
-
/* @__PURE__ */ (0,
|
|
5391
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
5392
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5322
5393
|
Button,
|
|
5323
5394
|
{
|
|
5324
5395
|
onClick: () => setIsOpen((prev) => !prev),
|
|
@@ -5327,7 +5398,7 @@ var DatePicker = (props) => {
|
|
|
5327
5398
|
disabled
|
|
5328
5399
|
}
|
|
5329
5400
|
),
|
|
5330
|
-
isFiltered && /* @__PURE__ */ (0,
|
|
5401
|
+
isFiltered && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5331
5402
|
"span",
|
|
5332
5403
|
{
|
|
5333
5404
|
style: {
|
|
@@ -5345,17 +5416,17 @@ var DatePicker = (props) => {
|
|
|
5345
5416
|
cursor: "pointer"
|
|
5346
5417
|
},
|
|
5347
5418
|
onClick: reset,
|
|
5348
|
-
children: /* @__PURE__ */ (0,
|
|
5419
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon, { name: "xmark", size: "s", color: colors.white })
|
|
5349
5420
|
}
|
|
5350
5421
|
)
|
|
5351
5422
|
] }),
|
|
5352
|
-
isOpen && /* @__PURE__ */ (0,
|
|
5423
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5353
5424
|
"div",
|
|
5354
5425
|
{
|
|
5355
5426
|
className: "date-picker-popup",
|
|
5356
5427
|
style: align === "right" ? { left: "auto", right: 0 } : void 0,
|
|
5357
|
-
children: /* @__PURE__ */ (0,
|
|
5358
|
-
hasPresets && /* @__PURE__ */ (0,
|
|
5428
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "date-picker-content", children: [
|
|
5429
|
+
hasPresets && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "date-picker-presets", children: rangeProps.presets.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5359
5430
|
"button",
|
|
5360
5431
|
{
|
|
5361
5432
|
onClick: () => handlePreset(preset),
|
|
@@ -5364,21 +5435,21 @@ var DatePicker = (props) => {
|
|
|
5364
5435
|
},
|
|
5365
5436
|
preset.label
|
|
5366
5437
|
)) }),
|
|
5367
|
-
/* @__PURE__ */ (0,
|
|
5368
|
-
/* @__PURE__ */ (0,
|
|
5369
|
-
/* @__PURE__ */ (0,
|
|
5438
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "calendar-container", children: [
|
|
5439
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "calendar-header", children: [
|
|
5440
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5370
5441
|
"button",
|
|
5371
5442
|
{
|
|
5372
5443
|
onClick: () => navigateMonth(-1),
|
|
5373
5444
|
className: "calendar-nav-button",
|
|
5374
|
-
children: /* @__PURE__ */ (0,
|
|
5445
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5375
5446
|
"svg",
|
|
5376
5447
|
{
|
|
5377
5448
|
className: "calendar-nav-icon",
|
|
5378
5449
|
fill: "none",
|
|
5379
5450
|
stroke: "currentColor",
|
|
5380
5451
|
viewBox: "0 0 24 24",
|
|
5381
|
-
children: /* @__PURE__ */ (0,
|
|
5452
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5382
5453
|
"path",
|
|
5383
5454
|
{
|
|
5384
5455
|
strokeLinecap: "round",
|
|
@@ -5391,24 +5462,24 @@ var DatePicker = (props) => {
|
|
|
5391
5462
|
)
|
|
5392
5463
|
}
|
|
5393
5464
|
),
|
|
5394
|
-
/* @__PURE__ */ (0,
|
|
5465
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("h3", { className: "calendar-month-title", children: [
|
|
5395
5466
|
monthNames[currentMonth.getMonth()],
|
|
5396
5467
|
" ",
|
|
5397
5468
|
currentMonth.getFullYear()
|
|
5398
5469
|
] }),
|
|
5399
|
-
/* @__PURE__ */ (0,
|
|
5470
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5400
5471
|
"button",
|
|
5401
5472
|
{
|
|
5402
5473
|
onClick: () => navigateMonth(1),
|
|
5403
5474
|
className: "calendar-nav-button",
|
|
5404
|
-
children: /* @__PURE__ */ (0,
|
|
5475
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5405
5476
|
"svg",
|
|
5406
5477
|
{
|
|
5407
5478
|
className: "calendar-nav-icon",
|
|
5408
5479
|
fill: "none",
|
|
5409
5480
|
stroke: "currentColor",
|
|
5410
5481
|
viewBox: "0 0 24 24",
|
|
5411
|
-
children: /* @__PURE__ */ (0,
|
|
5482
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5412
5483
|
"path",
|
|
5413
5484
|
{
|
|
5414
5485
|
strokeLinecap: "round",
|
|
@@ -5422,8 +5493,8 @@ var DatePicker = (props) => {
|
|
|
5422
5493
|
}
|
|
5423
5494
|
)
|
|
5424
5495
|
] }),
|
|
5425
|
-
/* @__PURE__ */ (0,
|
|
5426
|
-
/* @__PURE__ */ (0,
|
|
5496
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "calendar-days-header", children: dayNames.map((day) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "calendar-day-name", children: day }, day)) }),
|
|
5497
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "calendar-days-grid", children: getDaysInMonth(currentMonth).map((day, index) => {
|
|
5427
5498
|
const disabled2 = !day.isCurrentMonth || isDateDisabled(day.date);
|
|
5428
5499
|
const isToday = sameDay(day.date, today);
|
|
5429
5500
|
const isStart = isSingle ? false : !!startDate && sameDay(day.date, startDate);
|
|
@@ -5445,28 +5516,28 @@ var DatePicker = (props) => {
|
|
|
5445
5516
|
if (isToday && !isStart && !isEnd && !isSingleSelected)
|
|
5446
5517
|
classes.push("calendar-day-today");
|
|
5447
5518
|
}
|
|
5448
|
-
return /* @__PURE__ */ (0,
|
|
5519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5449
5520
|
"button",
|
|
5450
5521
|
{
|
|
5451
5522
|
onClick: () => !disabled2 && handleDateSelect(day.date),
|
|
5452
5523
|
className: classes.join(" "),
|
|
5453
5524
|
disabled: disabled2,
|
|
5454
|
-
children: /* @__PURE__ */ (0,
|
|
5525
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: day.date.getDate() })
|
|
5455
5526
|
},
|
|
5456
5527
|
index
|
|
5457
5528
|
);
|
|
5458
5529
|
}) }),
|
|
5459
|
-
!isSingle && /* @__PURE__ */ (0,
|
|
5460
|
-
/* @__PURE__ */ (0,
|
|
5461
|
-
/* @__PURE__ */ (0,
|
|
5530
|
+
!isSingle && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "calendar-footer", children: [
|
|
5531
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "calendar-footer-dates", children: startDate && endDate ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
5532
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("strong", { children: "Du" }),
|
|
5462
5533
|
" ",
|
|
5463
5534
|
formatDate(startDate, "weekday", "fr"),
|
|
5464
5535
|
" ",
|
|
5465
|
-
/* @__PURE__ */ (0,
|
|
5536
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("strong", { children: "au" }),
|
|
5466
5537
|
" ",
|
|
5467
5538
|
formatDate(endDate, "weekday", "fr")
|
|
5468
|
-
] }) : startDate ? /* @__PURE__ */ (0,
|
|
5469
|
-
/* @__PURE__ */ (0,
|
|
5539
|
+
] }) : startDate ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "calendar-footer-hint", children: "S\xE9lectionnez la date de fin" }) : null }),
|
|
5540
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("button", { onClick: reset, className: "calendar-reset-button", children: "R\xE9initialiser" })
|
|
5470
5541
|
] })
|
|
5471
5542
|
] })
|
|
5472
5543
|
] })
|
|
@@ -5478,9 +5549,9 @@ var DatePicker = (props) => {
|
|
|
5478
5549
|
};
|
|
5479
5550
|
|
|
5480
5551
|
// src/ui-legacy/Components/IconTabs/IconTabs.tsx
|
|
5481
|
-
var
|
|
5552
|
+
var import_react31 = require("react");
|
|
5482
5553
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
5483
|
-
var
|
|
5554
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5484
5555
|
var TabsContainer = import_styled_components43.default.div`
|
|
5485
5556
|
display: flex;
|
|
5486
5557
|
flex-direction: column;
|
|
@@ -5541,10 +5612,10 @@ var IconTabs = ({
|
|
|
5541
5612
|
defaultTabIndex = 0
|
|
5542
5613
|
}) => {
|
|
5543
5614
|
var _a;
|
|
5544
|
-
const [selectedTab, setSelectedTab] = (0,
|
|
5545
|
-
const sliderRef = (0,
|
|
5546
|
-
const tabRefs = (0,
|
|
5547
|
-
(0,
|
|
5615
|
+
const [selectedTab, setSelectedTab] = (0, import_react31.useState)(defaultTabIndex);
|
|
5616
|
+
const sliderRef = (0, import_react31.useRef)(null);
|
|
5617
|
+
const tabRefs = (0, import_react31.useRef)([]);
|
|
5618
|
+
(0, import_react31.useEffect)(() => {
|
|
5548
5619
|
if (defaultTabIndex >= 0 && defaultTabIndex !== selectedTab) {
|
|
5549
5620
|
setSelectedTab(defaultTabIndex);
|
|
5550
5621
|
}
|
|
@@ -5555,7 +5626,7 @@ var IconTabs = ({
|
|
|
5555
5626
|
onTabChange(index);
|
|
5556
5627
|
}
|
|
5557
5628
|
};
|
|
5558
|
-
(0,
|
|
5629
|
+
(0, import_react31.useEffect)(() => {
|
|
5559
5630
|
if (sliderRef.current && tabRefs.current[selectedTab]) {
|
|
5560
5631
|
const selectedTabRect = tabRefs.current[selectedTab].getBoundingClientRect();
|
|
5561
5632
|
const parentRect = tabRefs.current[selectedTab].parentElement.getBoundingClientRect();
|
|
@@ -5564,9 +5635,9 @@ var IconTabs = ({
|
|
|
5564
5635
|
sliderRef.current.style.backgroundColor = colors[selectedColor];
|
|
5565
5636
|
}
|
|
5566
5637
|
}, [selectedTab, selectedColor]);
|
|
5567
|
-
return /* @__PURE__ */ (0,
|
|
5568
|
-
/* @__PURE__ */ (0,
|
|
5569
|
-
items.map((item, index) => /* @__PURE__ */ (0,
|
|
5638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(TabsContainer, { children: [
|
|
5639
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(IconsRow, { children: [
|
|
5640
|
+
items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5570
5641
|
Tab2,
|
|
5571
5642
|
{
|
|
5572
5643
|
selected: selectedTab === index,
|
|
@@ -5575,7 +5646,7 @@ var IconTabs = ({
|
|
|
5575
5646
|
ref: (el) => {
|
|
5576
5647
|
tabRefs.current[index] = el;
|
|
5577
5648
|
},
|
|
5578
|
-
children: item.icon && /* @__PURE__ */ (0,
|
|
5649
|
+
children: item.icon && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5579
5650
|
Icon,
|
|
5580
5651
|
{
|
|
5581
5652
|
name: item.icon,
|
|
@@ -5586,17 +5657,17 @@ var IconTabs = ({
|
|
|
5586
5657
|
},
|
|
5587
5658
|
index
|
|
5588
5659
|
)),
|
|
5589
|
-
/* @__PURE__ */ (0,
|
|
5660
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TabSlider, { ref: sliderRef })
|
|
5590
5661
|
] }),
|
|
5591
|
-
/* @__PURE__ */ (0,
|
|
5662
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Text, { align: "center", size: "xs", children: (_a = items[selectedTab]) == null ? void 0 : _a.label })
|
|
5592
5663
|
] });
|
|
5593
5664
|
};
|
|
5594
5665
|
|
|
5595
5666
|
// src/ui-legacy/Components/Popover/Popover.tsx
|
|
5596
|
-
var
|
|
5597
|
-
var
|
|
5667
|
+
var import_react32 = require("react");
|
|
5668
|
+
var import_react_dom4 = require("react-dom");
|
|
5598
5669
|
var import_styled_components44 = __toESM(require("styled-components"));
|
|
5599
|
-
var
|
|
5670
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5600
5671
|
var PopoverWrapper = import_styled_components44.default.div`
|
|
5601
5672
|
position: relative;
|
|
5602
5673
|
display: ${({ $fullWidth }) => $fullWidth ? "block" : "inline-block"};
|
|
@@ -5645,15 +5716,15 @@ var Popover = ({
|
|
|
5645
5716
|
fullWidth = false
|
|
5646
5717
|
}) => {
|
|
5647
5718
|
const isHorizontal = direction === "horizontal";
|
|
5648
|
-
const [open, setOpen] = (0,
|
|
5649
|
-
const ref = (0,
|
|
5650
|
-
const menuRef = (0,
|
|
5651
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
5719
|
+
const [open, setOpen] = (0, import_react32.useState)(false);
|
|
5720
|
+
const ref = (0, import_react32.useRef)(null);
|
|
5721
|
+
const menuRef = (0, import_react32.useRef)(null);
|
|
5722
|
+
const [menuPosition, setMenuPosition] = (0, import_react32.useState)({
|
|
5652
5723
|
mode: "default",
|
|
5653
5724
|
top: 0,
|
|
5654
5725
|
left: 0
|
|
5655
5726
|
});
|
|
5656
|
-
const updatePosition = (0,
|
|
5727
|
+
const updatePosition = (0, import_react32.useCallback)(() => {
|
|
5657
5728
|
var _a;
|
|
5658
5729
|
if (!ref.current) return;
|
|
5659
5730
|
if (anchorRef == null ? void 0 : anchorRef.current) {
|
|
@@ -5683,7 +5754,7 @@ var Popover = ({
|
|
|
5683
5754
|
});
|
|
5684
5755
|
}
|
|
5685
5756
|
}, [items.length, anchorRef, offsetY, align, fullWidth, isHorizontal]);
|
|
5686
|
-
(0,
|
|
5757
|
+
(0, import_react32.useEffect)(() => {
|
|
5687
5758
|
const handleClickOutside = (event) => {
|
|
5688
5759
|
var _a, _b;
|
|
5689
5760
|
const isInTrigger = (_a = ref.current) == null ? void 0 : _a.contains(event.target);
|
|
@@ -5717,17 +5788,17 @@ var Popover = ({
|
|
|
5717
5788
|
minWidth: menuPosition.width,
|
|
5718
5789
|
transform: align === "left" ? "none" : "translateX(-100%)"
|
|
5719
5790
|
};
|
|
5720
|
-
return /* @__PURE__ */ (0,
|
|
5721
|
-
/* @__PURE__ */ (0,
|
|
5722
|
-
open && (0,
|
|
5723
|
-
/* @__PURE__ */ (0,
|
|
5791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(PopoverWrapper, { ref, $fullWidth: fullWidth, children: [
|
|
5792
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PopoverTrigger, { $fullWidth: fullWidth, onClick: () => setOpen((o) => !o), children }),
|
|
5793
|
+
open && (0, import_react_dom4.createPortal)(
|
|
5794
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5724
5795
|
PopoverMenu,
|
|
5725
5796
|
{
|
|
5726
5797
|
ref: menuRef,
|
|
5727
5798
|
"data-drawer-keep-open": true,
|
|
5728
5799
|
style: menuStyle,
|
|
5729
5800
|
$horizontal: isHorizontal,
|
|
5730
|
-
children: items.map((item, idx) => /* @__PURE__ */ (0,
|
|
5801
|
+
children: items.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5731
5802
|
PopoverItem,
|
|
5732
5803
|
{
|
|
5733
5804
|
isLast: idx === items.length - 1,
|
|
@@ -5749,7 +5820,7 @@ var Popover = ({
|
|
|
5749
5820
|
};
|
|
5750
5821
|
|
|
5751
5822
|
// src/ui-legacy/Components/MetricCard/MetricCard.tsx
|
|
5752
|
-
var
|
|
5823
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5753
5824
|
var MetricCard = ({
|
|
5754
5825
|
icon,
|
|
5755
5826
|
title,
|
|
@@ -5764,7 +5835,7 @@ var MetricCard = ({
|
|
|
5764
5835
|
checked = false,
|
|
5765
5836
|
children
|
|
5766
5837
|
}) => {
|
|
5767
|
-
return /* @__PURE__ */ (0,
|
|
5838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5768
5839
|
Box,
|
|
5769
5840
|
{
|
|
5770
5841
|
padding: "16px",
|
|
@@ -5777,8 +5848,8 @@ var MetricCard = ({
|
|
|
5777
5848
|
cursor: onClick ? "pointer" : "default"
|
|
5778
5849
|
},
|
|
5779
5850
|
onClick,
|
|
5780
|
-
children: /* @__PURE__ */ (0,
|
|
5781
|
-
/* @__PURE__ */ (0,
|
|
5851
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Row, { alignItems: "center", gap: "12", fullWidth: true, children: [
|
|
5852
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5782
5853
|
Box,
|
|
5783
5854
|
{
|
|
5784
5855
|
alignItems: "center",
|
|
@@ -5789,17 +5860,17 @@ var MetricCard = ({
|
|
|
5789
5860
|
height: 40,
|
|
5790
5861
|
borderRadius: 50
|
|
5791
5862
|
},
|
|
5792
|
-
children: /* @__PURE__ */ (0,
|
|
5863
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon, { name: icon, size: "m", color: iconColor })
|
|
5793
5864
|
}
|
|
5794
5865
|
),
|
|
5795
|
-
children ? children : contentLayout === "row" ? /* @__PURE__ */ (0,
|
|
5796
|
-
/* @__PURE__ */ (0,
|
|
5797
|
-
/* @__PURE__ */ (0,
|
|
5798
|
-
] }) : /* @__PURE__ */ (0,
|
|
5799
|
-
/* @__PURE__ */ (0,
|
|
5800
|
-
/* @__PURE__ */ (0,
|
|
5801
|
-
/* @__PURE__ */ (0,
|
|
5802
|
-
subtitle && /* @__PURE__ */ (0,
|
|
5866
|
+
children ? children : contentLayout === "row" ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Row, { gap: "6", alignItems: "center", children: [
|
|
5867
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Text, { size: "s", weight: "bold", variant: valueColor || "grey_600", children: value }),
|
|
5868
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Text, { size: "s", variant: "grey_600", children: title })
|
|
5869
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Col, { gap: "4", children: [
|
|
5870
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Text, { size: "s", variant: "grey_600", children: title }),
|
|
5871
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Row, { gap: "6", alignItems: "baseline", children: [
|
|
5872
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Text, { size: "s", weight: "bold", variant: valueColor || "grey_600", children: value }),
|
|
5873
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Text, { size: "xs", variant: "grey_600", children: subtitle })
|
|
5803
5874
|
] })
|
|
5804
5875
|
] })
|
|
5805
5876
|
] })
|
|
@@ -5809,7 +5880,7 @@ var MetricCard = ({
|
|
|
5809
5880
|
|
|
5810
5881
|
// src/ui-legacy/Components/Card/Card.tsx
|
|
5811
5882
|
var import_styled_components45 = __toESM(require("styled-components"));
|
|
5812
|
-
var
|
|
5883
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5813
5884
|
var StyledCard = import_styled_components45.default.div`
|
|
5814
5885
|
overflow: hidden;
|
|
5815
5886
|
transition: box-shadow 0.15s ease;
|
|
@@ -5832,7 +5903,7 @@ var Card2 = ({
|
|
|
5832
5903
|
padding = "10px 12px",
|
|
5833
5904
|
borderRadius = "8px",
|
|
5834
5905
|
flexShrink
|
|
5835
|
-
}) => /* @__PURE__ */ (0,
|
|
5906
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5836
5907
|
StyledCard,
|
|
5837
5908
|
{
|
|
5838
5909
|
$clickable: !!onClick,
|
|
@@ -5841,13 +5912,13 @@ var Card2 = ({
|
|
|
5841
5912
|
$accentColor: accentColor,
|
|
5842
5913
|
$flexShrink: flexShrink,
|
|
5843
5914
|
onClick,
|
|
5844
|
-
children: /* @__PURE__ */ (0,
|
|
5915
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(StyledCardInner, { $padding: padding, children })
|
|
5845
5916
|
}
|
|
5846
5917
|
);
|
|
5847
5918
|
|
|
5848
5919
|
// src/ui-legacy/Components/Banner/Banner.tsx
|
|
5849
5920
|
var import_styled_components46 = __toESM(require("styled-components"));
|
|
5850
|
-
var
|
|
5921
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5851
5922
|
var PRESET_STYLES = {
|
|
5852
5923
|
blue: {
|
|
5853
5924
|
background: "rgba(219, 233, 254, 0.4)",
|
|
@@ -5965,7 +6036,7 @@ var Banner = ({
|
|
|
5965
6036
|
}) => {
|
|
5966
6037
|
const style2 = resolveStyle(variant, filled);
|
|
5967
6038
|
if (children) {
|
|
5968
|
-
return /* @__PURE__ */ (0,
|
|
6039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5969
6040
|
StyledBanner,
|
|
5970
6041
|
{
|
|
5971
6042
|
$background: style2.background,
|
|
@@ -5975,16 +6046,16 @@ var Banner = ({
|
|
|
5975
6046
|
}
|
|
5976
6047
|
);
|
|
5977
6048
|
}
|
|
5978
|
-
return /* @__PURE__ */ (0,
|
|
6049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
5979
6050
|
StyledBanner,
|
|
5980
6051
|
{
|
|
5981
6052
|
$background: style2.background,
|
|
5982
6053
|
$borderColor: style2.borderColor,
|
|
5983
6054
|
$shimmer: shimmer,
|
|
5984
6055
|
children: [
|
|
5985
|
-
/* @__PURE__ */ (0,
|
|
5986
|
-
/* @__PURE__ */ (0,
|
|
5987
|
-
badge && /* @__PURE__ */ (0,
|
|
6056
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Content3, { children: message ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { size: "s", children: message }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
6057
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Heading, { children: [
|
|
6058
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5988
6059
|
Bubble,
|
|
5989
6060
|
{
|
|
5990
6061
|
backgroundColor: style2.badgeBackground,
|
|
@@ -5995,7 +6066,7 @@ var Banner = ({
|
|
|
5995
6066
|
children: badge
|
|
5996
6067
|
}
|
|
5997
6068
|
),
|
|
5998
|
-
title && /* @__PURE__ */ (0,
|
|
6069
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5999
6070
|
Text,
|
|
6000
6071
|
{
|
|
6001
6072
|
size: "s",
|
|
@@ -6005,9 +6076,9 @@ var Banner = ({
|
|
|
6005
6076
|
}
|
|
6006
6077
|
)
|
|
6007
6078
|
] }),
|
|
6008
|
-
subtitle && /* @__PURE__ */ (0,
|
|
6079
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { size: "xs", color: toggle ? style2.accent : void 0, children: subtitle })
|
|
6009
6080
|
] }) }),
|
|
6010
|
-
toggle ? /* @__PURE__ */ (0,
|
|
6081
|
+
toggle ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6011
6082
|
Switch,
|
|
6012
6083
|
{
|
|
6013
6084
|
checked: toggle.checked,
|
|
@@ -6015,7 +6086,7 @@ var Banner = ({
|
|
|
6015
6086
|
disabled: toggle.disabled,
|
|
6016
6087
|
color: style2.accent
|
|
6017
6088
|
}
|
|
6018
|
-
) : action && /* @__PURE__ */ (0,
|
|
6089
|
+
) : action && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6019
6090
|
Button,
|
|
6020
6091
|
{
|
|
6021
6092
|
outline: true,
|
|
@@ -6032,8 +6103,8 @@ var Banner = ({
|
|
|
6032
6103
|
};
|
|
6033
6104
|
|
|
6034
6105
|
// src/ui-legacy/Components/Pagination/Pagination.tsx
|
|
6035
|
-
var
|
|
6036
|
-
var
|
|
6106
|
+
var import_react33 = require("react");
|
|
6107
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
6037
6108
|
var getPageNumbers = (current, total) => {
|
|
6038
6109
|
if (total <= 5) {
|
|
6039
6110
|
return Array.from({ length: total }, (_, i) => i + 1);
|
|
@@ -6056,22 +6127,22 @@ var Pagination = ({
|
|
|
6056
6127
|
summaryLabel
|
|
6057
6128
|
}) => {
|
|
6058
6129
|
const totalPages = Math.max(1, Math.ceil(totalItems / itemsPerPage));
|
|
6059
|
-
const pages = (0,
|
|
6130
|
+
const pages = (0, import_react33.useMemo)(
|
|
6060
6131
|
() => getPageNumbers(currentPage, totalPages),
|
|
6061
6132
|
[currentPage, totalPages]
|
|
6062
6133
|
);
|
|
6063
6134
|
const startItem = (currentPage - 1) * itemsPerPage + 1;
|
|
6064
6135
|
const endItem = Math.min(currentPage * itemsPerPage, totalItems);
|
|
6065
6136
|
const summary = summaryLabel || defaultSummary(startItem, endItem, totalItems);
|
|
6066
|
-
return /* @__PURE__ */ (0,
|
|
6137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
6067
6138
|
Row,
|
|
6068
6139
|
{
|
|
6069
6140
|
justifyContent: showSummary ? "space-between" : "flex-end",
|
|
6070
6141
|
alignItems: "center",
|
|
6071
6142
|
children: [
|
|
6072
|
-
showSummary && /* @__PURE__ */ (0,
|
|
6073
|
-
/* @__PURE__ */ (0,
|
|
6074
|
-
/* @__PURE__ */ (0,
|
|
6143
|
+
showSummary && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text, { size: "s", color: colors.grey_500, children: summary }),
|
|
6144
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Row, { gap: "4", alignItems: "center", style: { width: "fit-content" }, children: [
|
|
6145
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6075
6146
|
Button,
|
|
6076
6147
|
{
|
|
6077
6148
|
size: "xs",
|
|
@@ -6082,7 +6153,7 @@ var Pagination = ({
|
|
|
6082
6153
|
}
|
|
6083
6154
|
),
|
|
6084
6155
|
pages.map(
|
|
6085
|
-
(page, index) => page === "..." ? /* @__PURE__ */ (0,
|
|
6156
|
+
(page, index) => page === "..." ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text, { size: "s", color: colors.grey_500, children: "..." }, `ellipsis-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6086
6157
|
Button,
|
|
6087
6158
|
{
|
|
6088
6159
|
size: "xs",
|
|
@@ -6093,7 +6164,7 @@ var Pagination = ({
|
|
|
6093
6164
|
page
|
|
6094
6165
|
)
|
|
6095
6166
|
),
|
|
6096
|
-
/* @__PURE__ */ (0,
|
|
6167
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6097
6168
|
Button,
|
|
6098
6169
|
{
|
|
6099
6170
|
size: "xs",
|
|
@@ -6110,9 +6181,9 @@ var Pagination = ({
|
|
|
6110
6181
|
};
|
|
6111
6182
|
|
|
6112
6183
|
// src/ui-legacy/Components/FileUploadZone/FileUploadZone.tsx
|
|
6113
|
-
var
|
|
6184
|
+
var import_react34 = require("react");
|
|
6114
6185
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
6115
|
-
var
|
|
6186
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
6116
6187
|
var ACCEPT_MAP = {
|
|
6117
6188
|
png: "image/png",
|
|
6118
6189
|
jpg: "image/jpeg",
|
|
@@ -6197,19 +6268,19 @@ var FileUploadZone = ({
|
|
|
6197
6268
|
icon = "cloud-arrow-up",
|
|
6198
6269
|
showFileName = false
|
|
6199
6270
|
}) => {
|
|
6200
|
-
const [isDragging, setIsDragging] = (0,
|
|
6201
|
-
const [internalPreviewUrl, setInternalPreviewUrl] = (0,
|
|
6271
|
+
const [isDragging, setIsDragging] = (0, import_react34.useState)(false);
|
|
6272
|
+
const [internalPreviewUrl, setInternalPreviewUrl] = (0, import_react34.useState)(
|
|
6202
6273
|
null
|
|
6203
6274
|
);
|
|
6204
|
-
const [fileType, setFileType] = (0,
|
|
6205
|
-
const [fileName, setFileName] = (0,
|
|
6206
|
-
const [inlineError, setInlineError] = (0,
|
|
6207
|
-
const inputRef = (0,
|
|
6275
|
+
const [fileType, setFileType] = (0, import_react34.useState)(null);
|
|
6276
|
+
const [fileName, setFileName] = (0, import_react34.useState)(null);
|
|
6277
|
+
const [inlineError, setInlineError] = (0, import_react34.useState)(null);
|
|
6278
|
+
const inputRef = (0, import_react34.useRef)(null);
|
|
6208
6279
|
const resolvedAccept = acceptOnlyPdf ? PDF_ONLY : accept;
|
|
6209
6280
|
const mimeTypes = getMimeTypes(resolvedAccept);
|
|
6210
6281
|
const acceptString = mimeTypes.join(",");
|
|
6211
6282
|
const previewUrl = multiple ? null : controlledPreviewUrl || (showPreview ? internalPreviewUrl : null);
|
|
6212
|
-
const emitError = (0,
|
|
6283
|
+
const emitError = (0, import_react34.useCallback)(
|
|
6213
6284
|
(message) => {
|
|
6214
6285
|
if (onError) {
|
|
6215
6286
|
onError(message);
|
|
@@ -6219,7 +6290,7 @@ var FileUploadZone = ({
|
|
|
6219
6290
|
},
|
|
6220
6291
|
[onError]
|
|
6221
6292
|
);
|
|
6222
|
-
const validateFile = (0,
|
|
6293
|
+
const validateFile = (0, import_react34.useCallback)(
|
|
6223
6294
|
(file) => {
|
|
6224
6295
|
if (!mimeTypes.includes(file.type)) {
|
|
6225
6296
|
return { ok: false, error: "Format de fichier non accept\xE9." };
|
|
@@ -6234,7 +6305,7 @@ var FileUploadZone = ({
|
|
|
6234
6305
|
},
|
|
6235
6306
|
[mimeTypes, maxSizeMB]
|
|
6236
6307
|
);
|
|
6237
|
-
const processFile = (0,
|
|
6308
|
+
const processFile = (0, import_react34.useCallback)(
|
|
6238
6309
|
(file) => {
|
|
6239
6310
|
setInlineError(null);
|
|
6240
6311
|
const result = validateFile(file);
|
|
@@ -6252,7 +6323,7 @@ var FileUploadZone = ({
|
|
|
6252
6323
|
},
|
|
6253
6324
|
[validateFile, onSave, showPreview, emitError]
|
|
6254
6325
|
);
|
|
6255
|
-
const processFiles = (0,
|
|
6326
|
+
const processFiles = (0, import_react34.useCallback)(
|
|
6256
6327
|
(files) => {
|
|
6257
6328
|
setInlineError(null);
|
|
6258
6329
|
for (const file of files) {
|
|
@@ -6310,9 +6381,9 @@ var FileUploadZone = ({
|
|
|
6310
6381
|
onRemove == null ? void 0 : onRemove();
|
|
6311
6382
|
};
|
|
6312
6383
|
if (previewUrl) {
|
|
6313
|
-
return /* @__PURE__ */ (0,
|
|
6314
|
-
fileType && isPdf(fileType) ? /* @__PURE__ */ (0,
|
|
6315
|
-
/* @__PURE__ */ (0,
|
|
6384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(StyledPreview, { $fullWidth: fullWidth, children: [
|
|
6385
|
+
fileType && isPdf(fileType) ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(StyledEmbed, { src: previewUrl, type: "application/pdf" }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(StyledImage2, { src: previewUrl, alt: "Aper\xE7u du fichier" }),
|
|
6386
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Row, { gap: "8", justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6316
6387
|
Button,
|
|
6317
6388
|
{
|
|
6318
6389
|
onClick: handleRemove,
|
|
@@ -6326,8 +6397,8 @@ var FileUploadZone = ({
|
|
|
6326
6397
|
}
|
|
6327
6398
|
const showIcon = icon !== false;
|
|
6328
6399
|
const showBrowse = !compact && browseLabel !== false;
|
|
6329
|
-
return /* @__PURE__ */ (0,
|
|
6330
|
-
/* @__PURE__ */ (0,
|
|
6400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Col, { gap: "4", fullWidth, children: [
|
|
6401
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
6331
6402
|
StyledDropZone,
|
|
6332
6403
|
{
|
|
6333
6404
|
$isDragging: isDragging,
|
|
@@ -6338,7 +6409,7 @@ var FileUploadZone = ({
|
|
|
6338
6409
|
onDragLeave: handleDragLeave,
|
|
6339
6410
|
onDrop: handleDrop,
|
|
6340
6411
|
children: [
|
|
6341
|
-
/* @__PURE__ */ (0,
|
|
6412
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6342
6413
|
HiddenInput2,
|
|
6343
6414
|
{
|
|
6344
6415
|
ref: inputRef,
|
|
@@ -6349,10 +6420,10 @@ var FileUploadZone = ({
|
|
|
6349
6420
|
multiple
|
|
6350
6421
|
}
|
|
6351
6422
|
),
|
|
6352
|
-
showIcon && /* @__PURE__ */ (0,
|
|
6353
|
-
/* @__PURE__ */ (0,
|
|
6354
|
-
showBrowse && /* @__PURE__ */ (0,
|
|
6355
|
-
showBrowse && /* @__PURE__ */ (0,
|
|
6423
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: icon, size: "xl", color: "blue_700" }),
|
|
6424
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { size: "s", variant: "grey_600", align: "center", children: label }),
|
|
6425
|
+
showBrowse && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { size: "xs", variant: "grey_600", align: "center", children: "ou" }),
|
|
6426
|
+
showBrowse && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6356
6427
|
Button,
|
|
6357
6428
|
{
|
|
6358
6429
|
outline: true,
|
|
@@ -6365,21 +6436,21 @@ var FileUploadZone = ({
|
|
|
6365
6436
|
}
|
|
6366
6437
|
}
|
|
6367
6438
|
),
|
|
6368
|
-
sublabel && /* @__PURE__ */ (0,
|
|
6439
|
+
sublabel && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { size: "xs", variant: "grey_500", align: "center", children: sublabel })
|
|
6369
6440
|
]
|
|
6370
6441
|
}
|
|
6371
6442
|
),
|
|
6372
|
-
showFileName && fileName && /* @__PURE__ */ (0,
|
|
6373
|
-
/* @__PURE__ */ (0,
|
|
6374
|
-
/* @__PURE__ */ (0,
|
|
6443
|
+
showFileName && fileName && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Row, { gap: "8", alignItems: "center", justifyContent: "center", children: [
|
|
6444
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: "file", size: "s", color: "green_700" }),
|
|
6445
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { size: "s", color: "green_700", children: fileName })
|
|
6375
6446
|
] }),
|
|
6376
|
-
inlineError && /* @__PURE__ */ (0,
|
|
6447
|
+
inlineError && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { size: "s", color: "danger", align: "center", children: inlineError })
|
|
6377
6448
|
] });
|
|
6378
6449
|
};
|
|
6379
6450
|
|
|
6380
6451
|
// src/ui-legacy/Components/Spinner/Spinner.tsx
|
|
6381
6452
|
var import_styled_components48 = __toESM(require("styled-components"));
|
|
6382
|
-
var
|
|
6453
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
6383
6454
|
var SIZES3 = {
|
|
6384
6455
|
s: 20,
|
|
6385
6456
|
m: 32,
|
|
@@ -6402,7 +6473,7 @@ var StyledSpinner = import_styled_components48.default.span`
|
|
|
6402
6473
|
var Spinner = ({ size = "m", color = "primary" }) => {
|
|
6403
6474
|
const resolvedSize = SIZES3[size];
|
|
6404
6475
|
const resolvedColor = colors[color] || color || colors.primary;
|
|
6405
|
-
return /* @__PURE__ */ (0,
|
|
6476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6406
6477
|
StyledSpinner,
|
|
6407
6478
|
{
|
|
6408
6479
|
$size: resolvedSize,
|
|
@@ -6414,7 +6485,7 @@ var Spinner = ({ size = "m", color = "primary" }) => {
|
|
|
6414
6485
|
};
|
|
6415
6486
|
|
|
6416
6487
|
// src/ui-legacy/Components/EmptyState/EmptyState.tsx
|
|
6417
|
-
var
|
|
6488
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
6418
6489
|
var EmptyState = ({
|
|
6419
6490
|
icon = "inbox",
|
|
6420
6491
|
title = "Aucun r\xE9sultat",
|
|
@@ -6422,7 +6493,7 @@ var EmptyState = ({
|
|
|
6422
6493
|
actionLabel,
|
|
6423
6494
|
onAction
|
|
6424
6495
|
}) => {
|
|
6425
|
-
return /* @__PURE__ */ (0,
|
|
6496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
6426
6497
|
Col,
|
|
6427
6498
|
{
|
|
6428
6499
|
fullWidth: true,
|
|
@@ -6431,12 +6502,12 @@ var EmptyState = ({
|
|
|
6431
6502
|
gap: "24",
|
|
6432
6503
|
padding: "24px 16px",
|
|
6433
6504
|
children: [
|
|
6434
|
-
/* @__PURE__ */ (0,
|
|
6435
|
-
/* @__PURE__ */ (0,
|
|
6436
|
-
/* @__PURE__ */ (0,
|
|
6437
|
-
description && /* @__PURE__ */ (0,
|
|
6505
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Icon, { name: icon, size: "xxl", color: "grey_300" }),
|
|
6506
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Col, { alignItems: "center", gap: "4", style: { maxWidth: "360px" }, children: [
|
|
6507
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Text, { size: "m", weight: "600", variant: "grey_600", align: "center", children: title }),
|
|
6508
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Text, { size: "s", variant: "grey_500", align: "center", children: description })
|
|
6438
6509
|
] }),
|
|
6439
|
-
actionLabel && onAction && /* @__PURE__ */ (0,
|
|
6510
|
+
actionLabel && onAction && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { label: actionLabel, onClick: onAction })
|
|
6440
6511
|
]
|
|
6441
6512
|
}
|
|
6442
6513
|
);
|
|
@@ -6444,7 +6515,7 @@ var EmptyState = ({
|
|
|
6444
6515
|
|
|
6445
6516
|
// src/ui-legacy/Components/FloatingButton/FloatingButton.tsx
|
|
6446
6517
|
var import_styled_components49 = __toESM(require("styled-components"));
|
|
6447
|
-
var
|
|
6518
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
6448
6519
|
var FloatingButton = ({
|
|
6449
6520
|
isOpen,
|
|
6450
6521
|
onToggle,
|
|
@@ -6456,10 +6527,10 @@ var FloatingButton = ({
|
|
|
6456
6527
|
variant = "blue_700"
|
|
6457
6528
|
}) => {
|
|
6458
6529
|
const accent = colors[variant];
|
|
6459
|
-
return /* @__PURE__ */ (0,
|
|
6530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Container6, { children: [
|
|
6460
6531
|
actions.map((action, index) => {
|
|
6461
6532
|
var _a;
|
|
6462
|
-
return /* @__PURE__ */ (0,
|
|
6533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
6463
6534
|
SubButton,
|
|
6464
6535
|
{
|
|
6465
6536
|
type: "button",
|
|
@@ -6468,14 +6539,14 @@ var FloatingButton = ({
|
|
|
6468
6539
|
$transform: arcTransform(index, actions.length),
|
|
6469
6540
|
onClick: action.onClick,
|
|
6470
6541
|
children: [
|
|
6471
|
-
/* @__PURE__ */ (0,
|
|
6472
|
-
((_a = action.badge) != null ? _a : 0) > 0 && /* @__PURE__ */ (0,
|
|
6542
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Icon, { name: action.icon, size: "s", color: accent }),
|
|
6543
|
+
((_a = action.badge) != null ? _a : 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CountBadge, { children: action.badge })
|
|
6473
6544
|
]
|
|
6474
6545
|
},
|
|
6475
6546
|
action.id
|
|
6476
6547
|
);
|
|
6477
6548
|
}),
|
|
6478
|
-
/* @__PURE__ */ (0,
|
|
6549
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
6479
6550
|
MainButton,
|
|
6480
6551
|
{
|
|
6481
6552
|
type: "button",
|
|
@@ -6484,8 +6555,8 @@ var FloatingButton = ({
|
|
|
6484
6555
|
$accent: accent,
|
|
6485
6556
|
onClick: onToggle,
|
|
6486
6557
|
children: [
|
|
6487
|
-
/* @__PURE__ */ (0,
|
|
6488
|
-
!isOpen && mainBadge > 0 && /* @__PURE__ */ (0,
|
|
6558
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Icon, { name: isOpen ? openIcon : icon, size: "m", color: colors.white }),
|
|
6559
|
+
!isOpen && mainBadge > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CountBadge, { children: mainBadge })
|
|
6489
6560
|
]
|
|
6490
6561
|
}
|
|
6491
6562
|
)
|
|
@@ -6568,7 +6639,7 @@ var CountBadge = import_styled_components49.default.span`
|
|
|
6568
6639
|
|
|
6569
6640
|
// src/ui-legacy/Components/ProgressBar/ProgressBar.tsx
|
|
6570
6641
|
var import_styled_components50 = __toESM(require("styled-components"));
|
|
6571
|
-
var
|
|
6642
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
6572
6643
|
var clampPercent = (value) => Math.max(0, Math.min(100, value));
|
|
6573
6644
|
var stackSegments = (segments) => {
|
|
6574
6645
|
let remaining = 100;
|
|
@@ -6616,8 +6687,8 @@ var ProgressBar2 = ({
|
|
|
6616
6687
|
}) => {
|
|
6617
6688
|
const stacked = segments ? stackSegments(segments) : null;
|
|
6618
6689
|
const percent = stacked ? stacked.reduce((total, segment) => total + segment.width, 0) : clampPercent(value);
|
|
6619
|
-
return /* @__PURE__ */ (0,
|
|
6620
|
-
/* @__PURE__ */ (0,
|
|
6690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Wrapper6, { children: [
|
|
6691
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Track2, { $height: height, $trackColor: trackColor, children: stacked ? stacked.map((segment, index) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6621
6692
|
Segment,
|
|
6622
6693
|
{
|
|
6623
6694
|
$color: segment.color,
|
|
@@ -6625,8 +6696,8 @@ var ProgressBar2 = ({
|
|
|
6625
6696
|
title: segment.label
|
|
6626
6697
|
},
|
|
6627
6698
|
`${segment.color}-${index}`
|
|
6628
|
-
)) : /* @__PURE__ */ (0,
|
|
6629
|
-
showLabel && /* @__PURE__ */ (0,
|
|
6699
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Fill, { $height: height, $color: color, $percent: percent }) }),
|
|
6700
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Text, { size: "s", weight: "600", children: [
|
|
6630
6701
|
Math.round(percent),
|
|
6631
6702
|
" %"
|
|
6632
6703
|
] })
|
|
@@ -6635,7 +6706,7 @@ var ProgressBar2 = ({
|
|
|
6635
6706
|
|
|
6636
6707
|
// src/ui-legacy/Components/Timeline/Timeline.tsx
|
|
6637
6708
|
var import_styled_components51 = __toESM(require("styled-components"));
|
|
6638
|
-
var
|
|
6709
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
6639
6710
|
var List2 = import_styled_components51.default.div`
|
|
6640
6711
|
display: flex;
|
|
6641
6712
|
flex-direction: column;
|
|
@@ -6677,21 +6748,21 @@ var Timeline = ({
|
|
|
6677
6748
|
emptyLabel = "Aucun \xE9v\xE9nement"
|
|
6678
6749
|
}) => {
|
|
6679
6750
|
if (items.length === 0) {
|
|
6680
|
-
return /* @__PURE__ */ (0,
|
|
6751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Text, { size: "s", color: colors.grey_600, children: emptyLabel });
|
|
6681
6752
|
}
|
|
6682
|
-
return /* @__PURE__ */ (0,
|
|
6753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(List2, { children: items.map((item, index) => {
|
|
6683
6754
|
var _a;
|
|
6684
6755
|
const isLast = index === items.length - 1;
|
|
6685
6756
|
const dotColor = (_a = item.color) != null ? _a : colors.blue_700;
|
|
6686
|
-
return /* @__PURE__ */ (0,
|
|
6687
|
-
/* @__PURE__ */ (0,
|
|
6688
|
-
/* @__PURE__ */ (0,
|
|
6689
|
-
!isLast && /* @__PURE__ */ (0,
|
|
6757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Item2, { children: [
|
|
6758
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Rail, { children: [
|
|
6759
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Dot2, { $color: dotColor }),
|
|
6760
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Line, { $color: lineColor })
|
|
6690
6761
|
] }),
|
|
6691
|
-
/* @__PURE__ */ (0,
|
|
6692
|
-
/* @__PURE__ */ (0,
|
|
6693
|
-
item.subtitle && /* @__PURE__ */ (0,
|
|
6694
|
-
item.description && /* @__PURE__ */ (0,
|
|
6762
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Content4, { $last: isLast, children: [
|
|
6763
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Text, { size: "s", weight: item.highlighted ? "700" : "600", children: item.title }),
|
|
6764
|
+
item.subtitle && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Text, { size: "xs", color: colors.grey_600, children: item.subtitle }),
|
|
6765
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Text, { size: "xs", fontStyle: "italic", children: item.description })
|
|
6695
6766
|
] })
|
|
6696
6767
|
] }, item.id);
|
|
6697
6768
|
}) });
|
|
@@ -6699,7 +6770,7 @@ var Timeline = ({
|
|
|
6699
6770
|
|
|
6700
6771
|
// src/ui-legacy/Components/Gantt/Gantt.tsx
|
|
6701
6772
|
var import_styled_components52 = __toESM(require("styled-components"));
|
|
6702
|
-
var
|
|
6773
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
6703
6774
|
var Root2 = import_styled_components52.default.div`
|
|
6704
6775
|
--dz-gantt-label-w: ${(p) => p.$labelWidth}px;
|
|
6705
6776
|
--dz-gantt-max-h: ${(p) => p.$maxHeight}px;
|
|
@@ -6875,10 +6946,10 @@ var Gantt = ({
|
|
|
6875
6946
|
}) => {
|
|
6876
6947
|
const bodyHeight = rows.length * rowHeight;
|
|
6877
6948
|
const clickable = Boolean(onRowClick);
|
|
6878
|
-
return /* @__PURE__ */ (0,
|
|
6879
|
-
/* @__PURE__ */ (0,
|
|
6880
|
-
/* @__PURE__ */ (0,
|
|
6881
|
-
/* @__PURE__ */ (0,
|
|
6949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(Root2, { $labelWidth: labelWidth, $maxHeight: maxHeight, children: [
|
|
6950
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(Axis, { children: [
|
|
6951
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(AxisLabel, { children: labelHeader }),
|
|
6952
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(AxisDays, { children: days.map((day) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6882
6953
|
AxisDay,
|
|
6883
6954
|
{
|
|
6884
6955
|
$leftPct: day.leftPct,
|
|
@@ -6888,8 +6959,8 @@ var Gantt = ({
|
|
|
6888
6959
|
day.key
|
|
6889
6960
|
)) })
|
|
6890
6961
|
] }),
|
|
6891
|
-
/* @__PURE__ */ (0,
|
|
6892
|
-
/* @__PURE__ */ (0,
|
|
6962
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(Body, { children: [
|
|
6963
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Labels, { children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6893
6964
|
LabelRow,
|
|
6894
6965
|
{
|
|
6895
6966
|
$rowHeight: rowHeight,
|
|
@@ -6900,8 +6971,8 @@ var Gantt = ({
|
|
|
6900
6971
|
},
|
|
6901
6972
|
row.key
|
|
6902
6973
|
)) }),
|
|
6903
|
-
/* @__PURE__ */ (0,
|
|
6904
|
-
days.map((day, i) => /* @__PURE__ */ (0,
|
|
6974
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TimelineCol, { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(Timeline2, { $height: bodyHeight, children: [
|
|
6975
|
+
days.map((day, i) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6905
6976
|
Day,
|
|
6906
6977
|
{
|
|
6907
6978
|
$leftPct: day.leftPct,
|
|
@@ -6910,7 +6981,7 @@ var Gantt = ({
|
|
|
6910
6981
|
},
|
|
6911
6982
|
day.key
|
|
6912
6983
|
)),
|
|
6913
|
-
bands.map((band) => /* @__PURE__ */ (0,
|
|
6984
|
+
bands.map((band) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6914
6985
|
Band,
|
|
6915
6986
|
{
|
|
6916
6987
|
title: band.title,
|
|
@@ -6921,13 +6992,13 @@ var Gantt = ({
|
|
|
6921
6992
|
)),
|
|
6922
6993
|
rows.map((row, i) => {
|
|
6923
6994
|
var _a, _b, _c;
|
|
6924
|
-
return /* @__PURE__ */ (0,
|
|
6995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6925
6996
|
Track3,
|
|
6926
6997
|
{
|
|
6927
6998
|
$top: i * rowHeight,
|
|
6928
6999
|
$rowHeight: rowHeight,
|
|
6929
7000
|
$first: i === 0,
|
|
6930
|
-
children: row.bar && /* @__PURE__ */ (0,
|
|
7001
|
+
children: row.bar && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6931
7002
|
Bar,
|
|
6932
7003
|
{
|
|
6933
7004
|
title: (_b = (_a = row.bar.title) != null ? _a : row.bar.label) != null ? _b : void 0,
|
|
@@ -6935,7 +7006,7 @@ var Gantt = ({
|
|
|
6935
7006
|
$widthPct: row.bar.widthPct,
|
|
6936
7007
|
$color: row.bar.color,
|
|
6937
7008
|
$dashed: Boolean(row.bar.dashed),
|
|
6938
|
-
children: row.bar.label && /* @__PURE__ */ (0,
|
|
7009
|
+
children: row.bar.label && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(BarLabel, { $textColor: (_c = row.bar.textColor) != null ? _c : colors.white, children: row.bar.label })
|
|
6939
7010
|
}
|
|
6940
7011
|
)
|
|
6941
7012
|
},
|
|
@@ -6946,11 +7017,11 @@ var Gantt = ({
|
|
|
6946
7017
|
] })
|
|
6947
7018
|
] });
|
|
6948
7019
|
};
|
|
6949
|
-
var GanttDot = ({ color }) => /* @__PURE__ */ (0,
|
|
7020
|
+
var GanttDot = ({ color }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Dot3, { $color: color });
|
|
6950
7021
|
var GanttSwatch = ({
|
|
6951
7022
|
color,
|
|
6952
7023
|
filled = true
|
|
6953
|
-
}) => /* @__PURE__ */ (0,
|
|
7024
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Swatch2, { $color: color, $filled: filled });
|
|
6954
7025
|
|
|
6955
7026
|
// src/ui-legacy/data/globalMethods.ts
|
|
6956
7027
|
var formatDate = (dateString, type = "date", language = "en") => {
|