design-zystem 1.0.292 → 1.0.294
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 +92 -81
- package/dist/index.mjs +14 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3015,6 +3015,7 @@ var Input = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
3015
3015
|
Input.displayName = "Input";
|
|
3016
3016
|
|
|
3017
3017
|
// src/Components/Checkbox/Checkbox.tsx
|
|
3018
|
+
var import_react13 = require("react");
|
|
3018
3019
|
var import_styled_components21 = __toESM(require("styled-components"));
|
|
3019
3020
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3020
3021
|
var CheckboxContainer = import_styled_components21.default.div`
|
|
@@ -3042,7 +3043,8 @@ var Checkbox = ({
|
|
|
3042
3043
|
size = "m",
|
|
3043
3044
|
variant = "blue_700"
|
|
3044
3045
|
}) => {
|
|
3045
|
-
const
|
|
3046
|
+
const generatedId = (0, import_react13.useId)();
|
|
3047
|
+
const uniqueId = `checkbox-${generatedId}`;
|
|
3046
3048
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(CheckboxContainer, { children: [
|
|
3047
3049
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3048
3050
|
StyledCheckbox,
|
|
@@ -3059,7 +3061,7 @@ var Checkbox = ({
|
|
|
3059
3061
|
};
|
|
3060
3062
|
|
|
3061
3063
|
// src/Components/Radio/Radio.tsx
|
|
3062
|
-
var
|
|
3064
|
+
var import_react14 = require("react");
|
|
3063
3065
|
var import_styled_components22 = __toESM(require("styled-components"));
|
|
3064
3066
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3065
3067
|
var RadioContainer = import_styled_components22.default.div`
|
|
@@ -3116,7 +3118,7 @@ var Radio = ({
|
|
|
3116
3118
|
value
|
|
3117
3119
|
}) => {
|
|
3118
3120
|
const color = colors[variant] || colors.blue_950;
|
|
3119
|
-
const generatedId = (0,
|
|
3121
|
+
const generatedId = (0, import_react14.useId)();
|
|
3120
3122
|
const uniqueId = `radio-${generatedId}`;
|
|
3121
3123
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RadioContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(StyledLabel2, { htmlFor: uniqueId, disabled, children: [
|
|
3122
3124
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
@@ -3136,7 +3138,7 @@ var Radio = ({
|
|
|
3136
3138
|
};
|
|
3137
3139
|
|
|
3138
3140
|
// src/Components/Accordion/Accordion.tsx
|
|
3139
|
-
var
|
|
3141
|
+
var import_react15 = require("react");
|
|
3140
3142
|
var import_styled_components23 = __toESM(require("styled-components"));
|
|
3141
3143
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3142
3144
|
var Wrapper4 = import_styled_components23.default.div`
|
|
@@ -3197,8 +3199,8 @@ var Accordion = ({
|
|
|
3197
3199
|
backgroundHeader = colors.white
|
|
3198
3200
|
}) => {
|
|
3199
3201
|
const resolvedBackgroundHeader = typeof backgroundHeader === "string" && backgroundHeader in colors ? colors[backgroundHeader] : backgroundHeader;
|
|
3200
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
3201
|
-
const [internalOpenId, setInternalOpenId] = (0,
|
|
3202
|
+
const [internalOpen, setInternalOpen] = (0, import_react15.useState)(defaultOpen);
|
|
3203
|
+
const [internalOpenId, setInternalOpenId] = (0, import_react15.useState)(
|
|
3202
3204
|
null
|
|
3203
3205
|
);
|
|
3204
3206
|
const isControlled = controlledOpen !== void 0;
|
|
@@ -3213,7 +3215,7 @@ var Accordion = ({
|
|
|
3213
3215
|
setInternalOpen((prev) => !prev);
|
|
3214
3216
|
}
|
|
3215
3217
|
};
|
|
3216
|
-
const toggleItem = (0,
|
|
3218
|
+
const toggleItem = (0, import_react15.useCallback)(
|
|
3217
3219
|
(id) => {
|
|
3218
3220
|
if (disabled) return;
|
|
3219
3221
|
const nextId2 = activeItemId === id ? null : id;
|
|
@@ -3280,7 +3282,7 @@ var Accordion = ({
|
|
|
3280
3282
|
};
|
|
3281
3283
|
|
|
3282
3284
|
// src/Components/ColorPicker/ColorPicker.tsx
|
|
3283
|
-
var
|
|
3285
|
+
var import_react16 = require("react");
|
|
3284
3286
|
var import_styled_components24 = __toESM(require("styled-components"));
|
|
3285
3287
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3286
3288
|
var SIZES = {
|
|
@@ -3357,7 +3359,7 @@ var TEXT_SIZE_MAP = {
|
|
|
3357
3359
|
m: "xs",
|
|
3358
3360
|
l: "s"
|
|
3359
3361
|
};
|
|
3360
|
-
var ColorPicker = (0,
|
|
3362
|
+
var ColorPicker = (0, import_react16.forwardRef)(
|
|
3361
3363
|
({
|
|
3362
3364
|
label,
|
|
3363
3365
|
value,
|
|
@@ -3366,11 +3368,11 @@ var ColorPicker = (0, import_react15.forwardRef)(
|
|
|
3366
3368
|
disabled = false,
|
|
3367
3369
|
size = "m"
|
|
3368
3370
|
}, ref) => {
|
|
3369
|
-
const innerRef = (0,
|
|
3370
|
-
const [internalColor, setInternalColor] = (0,
|
|
3371
|
+
const innerRef = (0, import_react16.useRef)(null);
|
|
3372
|
+
const [internalColor, setInternalColor] = (0, import_react16.useState)(defaultValue);
|
|
3371
3373
|
const currentColor = value !== void 0 ? value : internalColor;
|
|
3372
3374
|
const dims = SIZES[size];
|
|
3373
|
-
(0,
|
|
3375
|
+
(0, import_react16.useEffect)(() => {
|
|
3374
3376
|
if (!ref) return;
|
|
3375
3377
|
if (typeof ref === "function") {
|
|
3376
3378
|
ref(innerRef.current);
|
|
@@ -3416,7 +3418,7 @@ var ColorPicker = (0, import_react15.forwardRef)(
|
|
|
3416
3418
|
ColorPicker.displayName = "ColorPicker";
|
|
3417
3419
|
|
|
3418
3420
|
// src/Components/SliderInput/SliderInput.tsx
|
|
3419
|
-
var
|
|
3421
|
+
var import_react17 = require("react");
|
|
3420
3422
|
var import_styled_components25 = __toESM(require("styled-components"));
|
|
3421
3423
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3422
3424
|
var Container3 = import_styled_components25.default.label`
|
|
@@ -3498,7 +3500,7 @@ var MinMaxRow = import_styled_components25.default.span`
|
|
|
3498
3500
|
justify-content: space-between;
|
|
3499
3501
|
align-items: center;
|
|
3500
3502
|
`;
|
|
3501
|
-
var SliderInput = (0,
|
|
3503
|
+
var SliderInput = (0, import_react17.forwardRef)(
|
|
3502
3504
|
({
|
|
3503
3505
|
value,
|
|
3504
3506
|
onChange,
|
|
@@ -3633,7 +3635,7 @@ var ListItem = (props) => {
|
|
|
3633
3635
|
};
|
|
3634
3636
|
|
|
3635
3637
|
// src/Components/Table/Table.tsx
|
|
3636
|
-
var
|
|
3638
|
+
var import_react18 = require("react");
|
|
3637
3639
|
var import_styled_components28 = __toESM(require("styled-components"));
|
|
3638
3640
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3639
3641
|
var shouldForwardPropTable = (prop) => ![
|
|
@@ -3669,7 +3671,7 @@ var StyledContainer3 = import_styled_components28.default.div.withConfig({
|
|
|
3669
3671
|
border: 1.4px solid ${colors.grey_200};
|
|
3670
3672
|
box-shadow: ${(props) => props.hasShadow ? "0 2px 12px 0 rgba(198, 198, 198, 0.25)" : "none"};
|
|
3671
3673
|
`;
|
|
3672
|
-
var Table = (0,
|
|
3674
|
+
var Table = (0, import_react18.forwardRef)((props, ref) => {
|
|
3673
3675
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
3674
3676
|
const safeChildren = children;
|
|
3675
3677
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(StyledContainer3, __spreadProps(__spreadValues({}, otherProps), { ref, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(StyledTable, __spreadProps(__spreadValues({}, otherProps), { children: safeChildren })) }));
|
|
@@ -3699,7 +3701,7 @@ var TableHeader = (props) => {
|
|
|
3699
3701
|
};
|
|
3700
3702
|
|
|
3701
3703
|
// src/Components/Table/TableBody/TableBody.tsx
|
|
3702
|
-
var
|
|
3704
|
+
var import_react19 = require("react");
|
|
3703
3705
|
var import_styled_components30 = __toESM(require("styled-components"));
|
|
3704
3706
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3705
3707
|
var shouldForwardPropTableBody = (prop) => !["backgroundColor", "useEvenBackground", "fixedHeight", "color"].includes(
|
|
@@ -3718,7 +3720,7 @@ var StyledTableBody = import_styled_components30.default.div.withConfig({
|
|
|
3718
3720
|
background-color: ${(props) => props.useEvenBackground ? "#f2f2f2" : ""};
|
|
3719
3721
|
}
|
|
3720
3722
|
`;
|
|
3721
|
-
var TableBody = (0,
|
|
3723
|
+
var TableBody = (0, import_react19.forwardRef)(
|
|
3722
3724
|
(props, ref) => {
|
|
3723
3725
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
3724
3726
|
const safeChildren = children;
|
|
@@ -3793,7 +3795,7 @@ var TableCell = (props) => {
|
|
|
3793
3795
|
};
|
|
3794
3796
|
|
|
3795
3797
|
// src/Components/Table/TableHeaderCell/TableHeaderCell.tsx
|
|
3796
|
-
var
|
|
3798
|
+
var import_react20 = require("react");
|
|
3797
3799
|
var import_styled_components33 = __toESM(require("styled-components"));
|
|
3798
3800
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3799
3801
|
var shouldForwardPropTableHeaderCell = (prop) => ![
|
|
@@ -3837,7 +3839,7 @@ var SortArrow = import_styled_components33.default.span`
|
|
|
3837
3839
|
`;
|
|
3838
3840
|
var TableHeaderCell = (props) => {
|
|
3839
3841
|
const _a = props, { children, useSort, isSort, sortOrder } = _a, otherProps = __objRest(_a, ["children", "useSort", "isSort", "sortOrder"]);
|
|
3840
|
-
const [hovered, setHovered] = (0,
|
|
3842
|
+
const [hovered, setHovered] = (0, import_react20.useState)(false);
|
|
3841
3843
|
const showArrow = useSort && (isSort || hovered);
|
|
3842
3844
|
const arrowChar = isSort && sortOrder === "asc" ? "\u2191" : "\u2193";
|
|
3843
3845
|
const arrowOpacity = isSort ? 1 : 0.35;
|
|
@@ -3985,7 +3987,7 @@ var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ (0, import_jsx_runtime42.
|
|
|
3985
3987
|
] });
|
|
3986
3988
|
|
|
3987
3989
|
// src/Components/Switch/Switch.tsx
|
|
3988
|
-
var
|
|
3990
|
+
var import_react21 = require("react");
|
|
3989
3991
|
var import_styled_components38 = __toESM(require("styled-components"));
|
|
3990
3992
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3991
3993
|
var BASE = {
|
|
@@ -4066,7 +4068,7 @@ var Knob = import_styled_components38.default.span`
|
|
|
4066
4068
|
transform: translateY(-50%) scale(0.96);
|
|
4067
4069
|
}
|
|
4068
4070
|
`;
|
|
4069
|
-
var Switch = (0,
|
|
4071
|
+
var Switch = (0, import_react21.forwardRef)(
|
|
4070
4072
|
(_a, ref) => {
|
|
4071
4073
|
var _b = _a, {
|
|
4072
4074
|
checked,
|
|
@@ -4122,7 +4124,7 @@ var CardSkeleton = () => {
|
|
|
4122
4124
|
};
|
|
4123
4125
|
|
|
4124
4126
|
// src/Components/Options/Options.tsx
|
|
4125
|
-
var
|
|
4127
|
+
var import_react22 = require("react");
|
|
4126
4128
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4127
4129
|
var Options = ({
|
|
4128
4130
|
icon,
|
|
@@ -4132,8 +4134,8 @@ var Options = ({
|
|
|
4132
4134
|
onChange,
|
|
4133
4135
|
disabled = false
|
|
4134
4136
|
}) => {
|
|
4135
|
-
const [state, setState] = (0,
|
|
4136
|
-
(0,
|
|
4137
|
+
const [state, setState] = (0, import_react22.useState)(0);
|
|
4138
|
+
(0, import_react22.useEffect)(() => {
|
|
4137
4139
|
if (defaultId) {
|
|
4138
4140
|
const defaultIndex = options.findIndex(
|
|
4139
4141
|
(option) => option.id === defaultId
|
|
@@ -4191,7 +4193,7 @@ var Options = ({
|
|
|
4191
4193
|
};
|
|
4192
4194
|
|
|
4193
4195
|
// src/Components/Stepper/Stepper.tsx
|
|
4194
|
-
var
|
|
4196
|
+
var import_react23 = require("react");
|
|
4195
4197
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
4196
4198
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4197
4199
|
var Wrapper5 = import_styled_components39.default.nav`
|
|
@@ -4230,7 +4232,7 @@ var Stepper = ({
|
|
|
4230
4232
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Wrapper5, { "aria-label": "progression", className, children: Array.from({ length: numberOfSteps }, (_, i) => {
|
|
4231
4233
|
const isActive = i === current;
|
|
4232
4234
|
const isCompleted = i < current;
|
|
4233
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
4235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react23.Fragment, { children: [
|
|
4234
4236
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4235
4237
|
Circle,
|
|
4236
4238
|
{
|
|
@@ -4247,7 +4249,7 @@ var Stepper = ({
|
|
|
4247
4249
|
};
|
|
4248
4250
|
|
|
4249
4251
|
// src/Components/Tabs/Tabs.tsx
|
|
4250
|
-
var
|
|
4252
|
+
var import_react24 = require("react");
|
|
4251
4253
|
var import_styled_components40 = __toESM(require("styled-components"));
|
|
4252
4254
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4253
4255
|
var TOKENS = {
|
|
@@ -4463,13 +4465,13 @@ var Tabs = (_a) => {
|
|
|
4463
4465
|
"size",
|
|
4464
4466
|
"activeColor"
|
|
4465
4467
|
]);
|
|
4466
|
-
const rootRef = (0,
|
|
4467
|
-
const refsMap = (0,
|
|
4468
|
-
const [bar, setBar] = (0,
|
|
4468
|
+
const rootRef = (0, import_react24.useRef)(null);
|
|
4469
|
+
const refsMap = (0, import_react24.useRef)(/* @__PURE__ */ new Map());
|
|
4470
|
+
const [bar, setBar] = (0, import_react24.useState)({ left: 0, width: 0 });
|
|
4469
4471
|
const setTabRef = (id) => (el) => {
|
|
4470
4472
|
if (el) refsMap.current.set(id, el);
|
|
4471
4473
|
};
|
|
4472
|
-
const updateBar = (0,
|
|
4474
|
+
const updateBar = (0, import_react24.useCallback)(() => {
|
|
4473
4475
|
const root = rootRef.current;
|
|
4474
4476
|
const activeEl = value !== void 0 ? refsMap.current.get(value) : void 0;
|
|
4475
4477
|
if (!root || !activeEl) return;
|
|
@@ -4477,7 +4479,7 @@ var Tabs = (_a) => {
|
|
|
4477
4479
|
const box = activeEl.getBoundingClientRect();
|
|
4478
4480
|
setBar({ left: box.left - rootBox.left, width: box.width });
|
|
4479
4481
|
}, [value]);
|
|
4480
|
-
(0,
|
|
4482
|
+
(0, import_react24.useEffect)(() => {
|
|
4481
4483
|
updateBar();
|
|
4482
4484
|
const ro = new ResizeObserver(updateBar);
|
|
4483
4485
|
const activeEl = value !== void 0 ? refsMap.current.get(value) : void 0;
|
|
@@ -4485,14 +4487,14 @@ var Tabs = (_a) => {
|
|
|
4485
4487
|
if (activeEl) ro.observe(activeEl);
|
|
4486
4488
|
return () => ro.disconnect();
|
|
4487
4489
|
}, [value, updateBar]);
|
|
4488
|
-
const handleSelect = (0,
|
|
4490
|
+
const handleSelect = (0, import_react24.useCallback)(
|
|
4489
4491
|
(id) => {
|
|
4490
4492
|
if (id !== value && onChange) onChange(id);
|
|
4491
4493
|
},
|
|
4492
4494
|
[onChange, value]
|
|
4493
4495
|
);
|
|
4494
4496
|
const isPillsFullWidth = variant === "pills" && align === "start";
|
|
4495
|
-
const rendered = (0,
|
|
4497
|
+
const rendered = (0, import_react24.useMemo)(() => {
|
|
4496
4498
|
if (items && items.length) {
|
|
4497
4499
|
return items.map((it) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4498
4500
|
Tab,
|
|
@@ -4524,12 +4526,12 @@ var Tabs = (_a) => {
|
|
|
4524
4526
|
it.id
|
|
4525
4527
|
));
|
|
4526
4528
|
}
|
|
4527
|
-
return
|
|
4529
|
+
return import_react24.Children.map(children, (child) => {
|
|
4528
4530
|
var _a2;
|
|
4529
|
-
if (!(0,
|
|
4531
|
+
if (!(0, import_react24.isValidElement)(child)) return child;
|
|
4530
4532
|
const id = (_a2 = child.props.id) != null ? _a2 : child.key;
|
|
4531
4533
|
const active = id === value;
|
|
4532
|
-
return (0,
|
|
4534
|
+
return (0, import_react24.cloneElement)(child, {
|
|
4533
4535
|
active,
|
|
4534
4536
|
variant,
|
|
4535
4537
|
fullWidth: isPillsFullWidth,
|
|
@@ -4577,7 +4579,7 @@ var Tabs = (_a) => {
|
|
|
4577
4579
|
};
|
|
4578
4580
|
|
|
4579
4581
|
// src/Components/MultiSelect/MultiSelect.tsx
|
|
4580
|
-
var
|
|
4582
|
+
var import_react25 = require("react");
|
|
4581
4583
|
var import_styled_components41 = __toESM(require("styled-components"));
|
|
4582
4584
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4583
4585
|
var Container5 = import_styled_components41.default.div`
|
|
@@ -4620,8 +4622,8 @@ var MultiSelect = ({
|
|
|
4620
4622
|
width,
|
|
4621
4623
|
align = "left"
|
|
4622
4624
|
}) => {
|
|
4623
|
-
const [isOpen, setIsOpen] = (0,
|
|
4624
|
-
const dropdownRef = (0,
|
|
4625
|
+
const [isOpen, setIsOpen] = (0, import_react25.useState)(false);
|
|
4626
|
+
const dropdownRef = (0, import_react25.useRef)(null);
|
|
4625
4627
|
const toggleOption = (value) => {
|
|
4626
4628
|
if (!onChange) return;
|
|
4627
4629
|
if (selectedValues.includes(value)) {
|
|
@@ -4631,7 +4633,7 @@ var MultiSelect = ({
|
|
|
4631
4633
|
onChange([...selectedValues, value]);
|
|
4632
4634
|
}
|
|
4633
4635
|
};
|
|
4634
|
-
(0,
|
|
4636
|
+
(0, import_react25.useEffect)(() => {
|
|
4635
4637
|
const handleClickOutside = (e) => {
|
|
4636
4638
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
4637
4639
|
setIsOpen(false);
|
|
@@ -4673,7 +4675,7 @@ var MultiSelect = ({
|
|
|
4673
4675
|
};
|
|
4674
4676
|
|
|
4675
4677
|
// src/Components/DatePicker/DatePicker.tsx
|
|
4676
|
-
var
|
|
4678
|
+
var import_react26 = require("react");
|
|
4677
4679
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4678
4680
|
var LOCALE_MAP = {
|
|
4679
4681
|
fr: "fr-FR",
|
|
@@ -4744,28 +4746,28 @@ var DatePicker = (props) => {
|
|
|
4744
4746
|
const resolvedLocale = resolveLocale(locale);
|
|
4745
4747
|
const monthNames = getMonthNames(resolvedLocale);
|
|
4746
4748
|
const dayNames = getDayNames(resolvedLocale);
|
|
4747
|
-
const [isOpen, setIsOpen] = (0,
|
|
4748
|
-
const [currentMonth, setCurrentMonth] = (0,
|
|
4749
|
-
const [isSelectingEnd, setIsSelectingEnd] = (0,
|
|
4750
|
-
const [singleDate, setSingleDate] = (0,
|
|
4749
|
+
const [isOpen, setIsOpen] = (0, import_react26.useState)(defaultOpen);
|
|
4750
|
+
const [currentMonth, setCurrentMonth] = (0, import_react26.useState)(/* @__PURE__ */ new Date());
|
|
4751
|
+
const [isSelectingEnd, setIsSelectingEnd] = (0, import_react26.useState)(false);
|
|
4752
|
+
const [singleDate, setSingleDate] = (0, import_react26.useState)(
|
|
4751
4753
|
isSingle ? (_a = props.value) != null ? _a : null : null
|
|
4752
4754
|
);
|
|
4753
|
-
const [startDate, setStartDate] = (0,
|
|
4755
|
+
const [startDate, setStartDate] = (0, import_react26.useState)(
|
|
4754
4756
|
!isSingle ? (_c = (_b = props.value) == null ? void 0 : _b.start) != null ? _c : null : null
|
|
4755
4757
|
);
|
|
4756
|
-
const [endDate, setEndDate] = (0,
|
|
4758
|
+
const [endDate, setEndDate] = (0, import_react26.useState)(
|
|
4757
4759
|
!isSingle ? (_e = (_d = props.value) == null ? void 0 : _d.end) != null ? _e : null : null
|
|
4758
4760
|
);
|
|
4759
|
-
const ref = (0,
|
|
4761
|
+
const ref = (0, import_react26.useRef)(null);
|
|
4760
4762
|
const singleValueMs = isSingle ? (_f = props.value) == null ? void 0 : _f.getTime() : void 0;
|
|
4761
4763
|
const rangeStartMs = !isSingle ? (_h = (_g = props.value) == null ? void 0 : _g.start) == null ? void 0 : _h.getTime() : void 0;
|
|
4762
4764
|
const rangeEndMs = !isSingle ? (_j = (_i = props.value) == null ? void 0 : _i.end) == null ? void 0 : _j.getTime() : void 0;
|
|
4763
|
-
(0,
|
|
4765
|
+
(0, import_react26.useEffect)(() => {
|
|
4764
4766
|
if (!isSingle) return;
|
|
4765
4767
|
const v = props.value;
|
|
4766
4768
|
if (v !== void 0) setSingleDate(v);
|
|
4767
4769
|
}, [singleValueMs]);
|
|
4768
|
-
(0,
|
|
4770
|
+
(0, import_react26.useEffect)(() => {
|
|
4769
4771
|
var _a2, _b2;
|
|
4770
4772
|
if (isSingle) return;
|
|
4771
4773
|
const v = props.value;
|
|
@@ -4773,7 +4775,7 @@ var DatePicker = (props) => {
|
|
|
4773
4775
|
setStartDate((_a2 = v == null ? void 0 : v.start) != null ? _a2 : null);
|
|
4774
4776
|
setEndDate((_b2 = v == null ? void 0 : v.end) != null ? _b2 : null);
|
|
4775
4777
|
}, [rangeStartMs, rangeEndMs]);
|
|
4776
|
-
(0,
|
|
4778
|
+
(0, import_react26.useEffect)(() => {
|
|
4777
4779
|
const handleClickOutside = (e) => {
|
|
4778
4780
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
4779
4781
|
setIsOpen(false);
|
|
@@ -5057,7 +5059,7 @@ var DatePicker = (props) => {
|
|
|
5057
5059
|
};
|
|
5058
5060
|
|
|
5059
5061
|
// src/Components/IconTabs/IconTabs.tsx
|
|
5060
|
-
var
|
|
5062
|
+
var import_react27 = require("react");
|
|
5061
5063
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
5062
5064
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5063
5065
|
var TabsContainer = import_styled_components42.default.div`
|
|
@@ -5119,10 +5121,10 @@ var IconTabs = ({
|
|
|
5119
5121
|
defaultTabIndex = 0
|
|
5120
5122
|
}) => {
|
|
5121
5123
|
var _a;
|
|
5122
|
-
const [selectedTab, setSelectedTab] = (0,
|
|
5123
|
-
const sliderRef = (0,
|
|
5124
|
-
const tabRefs = (0,
|
|
5125
|
-
(0,
|
|
5124
|
+
const [selectedTab, setSelectedTab] = (0, import_react27.useState)(defaultTabIndex);
|
|
5125
|
+
const sliderRef = (0, import_react27.useRef)(null);
|
|
5126
|
+
const tabRefs = (0, import_react27.useRef)([]);
|
|
5127
|
+
(0, import_react27.useEffect)(() => {
|
|
5126
5128
|
if (defaultTabIndex >= 0 && defaultTabIndex !== selectedTab) {
|
|
5127
5129
|
setSelectedTab(defaultTabIndex);
|
|
5128
5130
|
}
|
|
@@ -5133,7 +5135,7 @@ var IconTabs = ({
|
|
|
5133
5135
|
onTabChange(index);
|
|
5134
5136
|
}
|
|
5135
5137
|
};
|
|
5136
|
-
(0,
|
|
5138
|
+
(0, import_react27.useEffect)(() => {
|
|
5137
5139
|
if (sliderRef.current && tabRefs.current[selectedTab]) {
|
|
5138
5140
|
const selectedTabRect = tabRefs.current[selectedTab].getBoundingClientRect();
|
|
5139
5141
|
const parentRect = tabRefs.current[selectedTab].parentElement.getBoundingClientRect();
|
|
@@ -5172,7 +5174,7 @@ var IconTabs = ({
|
|
|
5172
5174
|
};
|
|
5173
5175
|
|
|
5174
5176
|
// src/Components/Popover/Popover.tsx
|
|
5175
|
-
var
|
|
5177
|
+
var import_react28 = require("react");
|
|
5176
5178
|
var import_react_dom3 = require("react-dom");
|
|
5177
5179
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
5178
5180
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
@@ -5218,15 +5220,15 @@ var Popover = ({
|
|
|
5218
5220
|
align = "right",
|
|
5219
5221
|
fullWidth = false
|
|
5220
5222
|
}) => {
|
|
5221
|
-
const [open, setOpen] = (0,
|
|
5222
|
-
const ref = (0,
|
|
5223
|
-
const menuRef = (0,
|
|
5224
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
5223
|
+
const [open, setOpen] = (0, import_react28.useState)(false);
|
|
5224
|
+
const ref = (0, import_react28.useRef)(null);
|
|
5225
|
+
const menuRef = (0, import_react28.useRef)(null);
|
|
5226
|
+
const [menuPosition, setMenuPosition] = (0, import_react28.useState)({
|
|
5225
5227
|
mode: "default",
|
|
5226
5228
|
top: 0,
|
|
5227
5229
|
left: 0
|
|
5228
5230
|
});
|
|
5229
|
-
const updatePosition = (0,
|
|
5231
|
+
const updatePosition = (0, import_react28.useCallback)(() => {
|
|
5230
5232
|
var _a;
|
|
5231
5233
|
if (!ref.current) return;
|
|
5232
5234
|
if (anchorRef == null ? void 0 : anchorRef.current) {
|
|
@@ -5255,7 +5257,7 @@ var Popover = ({
|
|
|
5255
5257
|
});
|
|
5256
5258
|
}
|
|
5257
5259
|
}, [items.length, anchorRef, offsetY, align]);
|
|
5258
|
-
(0,
|
|
5260
|
+
(0, import_react28.useEffect)(() => {
|
|
5259
5261
|
const handleClickOutside = (event) => {
|
|
5260
5262
|
var _a, _b;
|
|
5261
5263
|
const isInTrigger = (_a = ref.current) == null ? void 0 : _a.contains(event.target);
|
|
@@ -5420,6 +5422,13 @@ var PRESET_STYLES = {
|
|
|
5420
5422
|
badgeBackground: "#FCDDDE",
|
|
5421
5423
|
badgeColor: colors.red_950,
|
|
5422
5424
|
accent: colors.red_950
|
|
5425
|
+
},
|
|
5426
|
+
purple: {
|
|
5427
|
+
background: "rgba(237, 233, 254, 0.4)",
|
|
5428
|
+
borderColor: "#DDD6FE",
|
|
5429
|
+
badgeBackground: colors.purple_50,
|
|
5430
|
+
badgeColor: colors.purple_700,
|
|
5431
|
+
accent: colors.purple_700
|
|
5423
5432
|
}
|
|
5424
5433
|
};
|
|
5425
5434
|
var resolveStyle = (variant, filled) => {
|
|
@@ -5583,7 +5592,7 @@ var Banner = ({
|
|
|
5583
5592
|
};
|
|
5584
5593
|
|
|
5585
5594
|
// src/Components/Tooltip/Tooltip.tsx
|
|
5586
|
-
var
|
|
5595
|
+
var import_react29 = require("react");
|
|
5587
5596
|
var import_styled_components46 = __toESM(require("styled-components"));
|
|
5588
5597
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5589
5598
|
var StyledTooltipWrapper = import_styled_components46.default.div`
|
|
@@ -5687,7 +5696,7 @@ var Tooltip = ({
|
|
|
5687
5696
|
direction = "top",
|
|
5688
5697
|
children
|
|
5689
5698
|
}) => {
|
|
5690
|
-
const [isVisible, setIsVisible] = (0,
|
|
5699
|
+
const [isVisible, setIsVisible] = (0, import_react29.useState)(false);
|
|
5691
5700
|
const handleMouseEnter = () => setIsVisible(true);
|
|
5692
5701
|
const handleMouseLeave = () => setIsVisible(false);
|
|
5693
5702
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
@@ -5714,7 +5723,7 @@ var Tooltip = ({
|
|
|
5714
5723
|
};
|
|
5715
5724
|
|
|
5716
5725
|
// src/Components/Pagination/Pagination.tsx
|
|
5717
|
-
var
|
|
5726
|
+
var import_react30 = require("react");
|
|
5718
5727
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5719
5728
|
var getPageNumbers = (current, total) => {
|
|
5720
5729
|
if (total <= 5) {
|
|
@@ -5738,7 +5747,7 @@ var Pagination = ({
|
|
|
5738
5747
|
summaryLabel
|
|
5739
5748
|
}) => {
|
|
5740
5749
|
const totalPages = Math.max(1, Math.ceil(totalItems / itemsPerPage));
|
|
5741
|
-
const pages = (0,
|
|
5750
|
+
const pages = (0, import_react30.useMemo)(
|
|
5742
5751
|
() => getPageNumbers(currentPage, totalPages),
|
|
5743
5752
|
[currentPage, totalPages]
|
|
5744
5753
|
);
|
|
@@ -5792,7 +5801,7 @@ var Pagination = ({
|
|
|
5792
5801
|
};
|
|
5793
5802
|
|
|
5794
5803
|
// src/Components/FileUploadZone/FileUploadZone.tsx
|
|
5795
|
-
var
|
|
5804
|
+
var import_react31 = require("react");
|
|
5796
5805
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
5797
5806
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5798
5807
|
var ACCEPT_MAP = {
|
|
@@ -5879,19 +5888,19 @@ var FileUploadZone = ({
|
|
|
5879
5888
|
icon = "cloud-arrow-up",
|
|
5880
5889
|
showFileName = false
|
|
5881
5890
|
}) => {
|
|
5882
|
-
const [isDragging, setIsDragging] = (0,
|
|
5883
|
-
const [internalPreviewUrl, setInternalPreviewUrl] = (0,
|
|
5891
|
+
const [isDragging, setIsDragging] = (0, import_react31.useState)(false);
|
|
5892
|
+
const [internalPreviewUrl, setInternalPreviewUrl] = (0, import_react31.useState)(
|
|
5884
5893
|
null
|
|
5885
5894
|
);
|
|
5886
|
-
const [fileType, setFileType] = (0,
|
|
5887
|
-
const [fileName, setFileName] = (0,
|
|
5888
|
-
const [inlineError, setInlineError] = (0,
|
|
5889
|
-
const inputRef = (0,
|
|
5895
|
+
const [fileType, setFileType] = (0, import_react31.useState)(null);
|
|
5896
|
+
const [fileName, setFileName] = (0, import_react31.useState)(null);
|
|
5897
|
+
const [inlineError, setInlineError] = (0, import_react31.useState)(null);
|
|
5898
|
+
const inputRef = (0, import_react31.useRef)(null);
|
|
5890
5899
|
const resolvedAccept = acceptOnlyPdf ? PDF_ONLY : accept;
|
|
5891
5900
|
const mimeTypes = getMimeTypes(resolvedAccept);
|
|
5892
5901
|
const acceptString = mimeTypes.join(",");
|
|
5893
5902
|
const previewUrl = multiple ? null : controlledPreviewUrl || (showPreview ? internalPreviewUrl : null);
|
|
5894
|
-
const emitError = (0,
|
|
5903
|
+
const emitError = (0, import_react31.useCallback)(
|
|
5895
5904
|
(message) => {
|
|
5896
5905
|
if (onError) {
|
|
5897
5906
|
onError(message);
|
|
@@ -5901,7 +5910,7 @@ var FileUploadZone = ({
|
|
|
5901
5910
|
},
|
|
5902
5911
|
[onError]
|
|
5903
5912
|
);
|
|
5904
|
-
const validateFile = (0,
|
|
5913
|
+
const validateFile = (0, import_react31.useCallback)(
|
|
5905
5914
|
(file) => {
|
|
5906
5915
|
if (!mimeTypes.includes(file.type)) {
|
|
5907
5916
|
return { ok: false, error: "Format de fichier non accept\xE9." };
|
|
@@ -5916,7 +5925,7 @@ var FileUploadZone = ({
|
|
|
5916
5925
|
},
|
|
5917
5926
|
[mimeTypes, maxSizeMB]
|
|
5918
5927
|
);
|
|
5919
|
-
const processFile = (0,
|
|
5928
|
+
const processFile = (0, import_react31.useCallback)(
|
|
5920
5929
|
(file) => {
|
|
5921
5930
|
setInlineError(null);
|
|
5922
5931
|
const result = validateFile(file);
|
|
@@ -5934,7 +5943,7 @@ var FileUploadZone = ({
|
|
|
5934
5943
|
},
|
|
5935
5944
|
[validateFile, onSave, showPreview, emitError]
|
|
5936
5945
|
);
|
|
5937
|
-
const processFiles = (0,
|
|
5946
|
+
const processFiles = (0, import_react31.useCallback)(
|
|
5938
5947
|
(files) => {
|
|
5939
5948
|
setInlineError(null);
|
|
5940
5949
|
for (const file of files) {
|
|
@@ -6702,6 +6711,8 @@ var formatDate = (dateString, type = "date", language = "en") => {
|
|
|
6702
6711
|
}
|
|
6703
6712
|
case "longDate":
|
|
6704
6713
|
return format({ day: "numeric", month: "long", year: "numeric" });
|
|
6714
|
+
case "monthYear":
|
|
6715
|
+
return format({ month: "long", year: "numeric" });
|
|
6705
6716
|
default:
|
|
6706
6717
|
return format({ day: "2-digit", month: "2-digit", year: "numeric" });
|
|
6707
6718
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -2882,6 +2882,7 @@ var Input = forwardRef3((props, ref) => {
|
|
|
2882
2882
|
Input.displayName = "Input";
|
|
2883
2883
|
|
|
2884
2884
|
// src/Components/Checkbox/Checkbox.tsx
|
|
2885
|
+
import { useId } from "react";
|
|
2885
2886
|
import styled21 from "styled-components";
|
|
2886
2887
|
import { jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2887
2888
|
var CheckboxContainer = styled21.div`
|
|
@@ -2909,7 +2910,8 @@ var Checkbox = ({
|
|
|
2909
2910
|
size = "m",
|
|
2910
2911
|
variant = "blue_700"
|
|
2911
2912
|
}) => {
|
|
2912
|
-
const
|
|
2913
|
+
const generatedId = useId();
|
|
2914
|
+
const uniqueId = `checkbox-${generatedId}`;
|
|
2913
2915
|
return /* @__PURE__ */ jsxs12(CheckboxContainer, { children: [
|
|
2914
2916
|
/* @__PURE__ */ jsx25(
|
|
2915
2917
|
StyledCheckbox,
|
|
@@ -2926,7 +2928,7 @@ var Checkbox = ({
|
|
|
2926
2928
|
};
|
|
2927
2929
|
|
|
2928
2930
|
// src/Components/Radio/Radio.tsx
|
|
2929
|
-
import { useId } from "react";
|
|
2931
|
+
import { useId as useId2 } from "react";
|
|
2930
2932
|
import styled22 from "styled-components";
|
|
2931
2933
|
import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2932
2934
|
var RadioContainer = styled22.div`
|
|
@@ -2983,7 +2985,7 @@ var Radio = ({
|
|
|
2983
2985
|
value
|
|
2984
2986
|
}) => {
|
|
2985
2987
|
const color = colors[variant] || colors.blue_950;
|
|
2986
|
-
const generatedId =
|
|
2988
|
+
const generatedId = useId2();
|
|
2987
2989
|
const uniqueId = `radio-${generatedId}`;
|
|
2988
2990
|
return /* @__PURE__ */ jsx26(RadioContainer, { children: /* @__PURE__ */ jsxs13(StyledLabel2, { htmlFor: uniqueId, disabled, children: [
|
|
2989
2991
|
/* @__PURE__ */ jsx26(
|
|
@@ -5301,6 +5303,13 @@ var PRESET_STYLES = {
|
|
|
5301
5303
|
badgeBackground: "#FCDDDE",
|
|
5302
5304
|
badgeColor: colors.red_950,
|
|
5303
5305
|
accent: colors.red_950
|
|
5306
|
+
},
|
|
5307
|
+
purple: {
|
|
5308
|
+
background: "rgba(237, 233, 254, 0.4)",
|
|
5309
|
+
borderColor: "#DDD6FE",
|
|
5310
|
+
badgeBackground: colors.purple_50,
|
|
5311
|
+
badgeColor: colors.purple_700,
|
|
5312
|
+
accent: colors.purple_700
|
|
5304
5313
|
}
|
|
5305
5314
|
};
|
|
5306
5315
|
var resolveStyle = (variant, filled) => {
|
|
@@ -6583,6 +6592,8 @@ var formatDate = (dateString, type = "date", language = "en") => {
|
|
|
6583
6592
|
}
|
|
6584
6593
|
case "longDate":
|
|
6585
6594
|
return format({ day: "numeric", month: "long", year: "numeric" });
|
|
6595
|
+
case "monthYear":
|
|
6596
|
+
return format({ month: "long", year: "numeric" });
|
|
6586
6597
|
default:
|
|
6587
6598
|
return format({ day: "2-digit", month: "2-digit", year: "numeric" });
|
|
6588
6599
|
}
|