@grandbazar/ui-baza 1.2.21 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.cjs +392 -95
- package/dist/index.d.ts +60 -4
- package/dist/index.js +392 -96
- package/dist/style.css +163 -24
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -51,19 +51,19 @@ function omit(object, ...keys) {
|
|
|
51
51
|
return Object.fromEntries(filteredEntries);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
const badge = "
|
|
55
|
-
const primary$4 = "
|
|
56
|
-
const secondary$5 = "
|
|
57
|
-
const accent$3 = "
|
|
58
|
-
const violet = "
|
|
59
|
-
const pink = "
|
|
60
|
-
const red$1 = "
|
|
61
|
-
const orange = "
|
|
62
|
-
const green = "
|
|
63
|
-
const neutral$3 = "
|
|
64
|
-
const lg$7 = "
|
|
65
|
-
const md$a = "
|
|
66
|
-
const styles$
|
|
54
|
+
const badge = "_badge_1s8y9_2";
|
|
55
|
+
const primary$4 = "_primary_1s8y9_9";
|
|
56
|
+
const secondary$5 = "_secondary_1s8y9_13";
|
|
57
|
+
const accent$3 = "_accent_1s8y9_18";
|
|
58
|
+
const violet = "_violet_1s8y9_23";
|
|
59
|
+
const pink = "_pink_1s8y9_28";
|
|
60
|
+
const red$1 = "_red_1s8y9_33";
|
|
61
|
+
const orange = "_orange_1s8y9_38";
|
|
62
|
+
const green = "_green_1s8y9_43";
|
|
63
|
+
const neutral$3 = "_neutral_1s8y9_48";
|
|
64
|
+
const lg$7 = "_lg_1s8y9_53";
|
|
65
|
+
const md$a = "_md_1s8y9_60";
|
|
66
|
+
const styles$x = {
|
|
67
67
|
badge: badge,
|
|
68
68
|
primary: primary$4,
|
|
69
69
|
secondary: secondary$5,
|
|
@@ -79,13 +79,13 @@ const styles$w = {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
function Badge({ children, className, size = "lg", color = "accent", mode = "primary", ...props }) {
|
|
82
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$
|
|
82
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$x.badge, styles$x[size], styles$x[color], styles$x[mode], className), ...props, children });
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
const badgeTabsItem = "_badgeTabsItem_10lit_2";
|
|
86
86
|
const primary$3 = "_primary_10lit_18";
|
|
87
87
|
const secondary$4 = "_secondary_10lit_36";
|
|
88
|
-
const styles$
|
|
88
|
+
const styles$w = {
|
|
89
89
|
badgeTabsItem: badgeTabsItem,
|
|
90
90
|
primary: primary$3,
|
|
91
91
|
secondary: secondary$4
|
|
@@ -98,7 +98,7 @@ function BadgeTabsItem({ className, children, isActive, mode = "primary", ...pro
|
|
|
98
98
|
type: "button",
|
|
99
99
|
role: "tab",
|
|
100
100
|
"aria-selected": Boolean(isActive),
|
|
101
|
-
className: classNames(styles$
|
|
101
|
+
className: classNames(styles$w.badgeTabsItem, styles$w[mode], className),
|
|
102
102
|
...props,
|
|
103
103
|
children
|
|
104
104
|
}
|
|
@@ -106,12 +106,12 @@ function BadgeTabsItem({ className, children, isActive, mode = "primary", ...pro
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
const badgeTabsRoot = "_badgeTabsRoot_1qkat_2";
|
|
109
|
-
const styles$
|
|
109
|
+
const styles$v = {
|
|
110
110
|
badgeTabsRoot: badgeTabsRoot
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
function BadgeTabsRoot({ className, children, ...props }) {
|
|
114
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "tablist", className: classNames(styles$
|
|
114
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "tablist", className: classNames(styles$v.badgeTabsRoot, className), ...props, children });
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
function BadgeTabs(props) {
|
|
@@ -1068,7 +1068,7 @@ function IconXMarkCircle(props) {
|
|
|
1068
1068
|
const breadcrumbs = "_breadcrumbs_1bfmb_2";
|
|
1069
1069
|
const breadcrumbsItem = "_breadcrumbsItem_1bfmb_8";
|
|
1070
1070
|
const defaultSeparator = "_defaultSeparator_1bfmb_14";
|
|
1071
|
-
const styles$
|
|
1071
|
+
const styles$u = {
|
|
1072
1072
|
breadcrumbs: breadcrumbs,
|
|
1073
1073
|
breadcrumbsItem: breadcrumbsItem,
|
|
1074
1074
|
defaultSeparator: defaultSeparator
|
|
@@ -1117,7 +1117,7 @@ function Slot({
|
|
|
1117
1117
|
}
|
|
1118
1118
|
|
|
1119
1119
|
const breadcrumbItem = "_breadcrumbItem_cua4v_2";
|
|
1120
|
-
const styles$
|
|
1120
|
+
const styles$t = {
|
|
1121
1121
|
breadcrumbItem: breadcrumbItem
|
|
1122
1122
|
};
|
|
1123
1123
|
|
|
@@ -1128,7 +1128,7 @@ function BreadcrumbItem({ children, className, isActive, asChild, ...props }) {
|
|
|
1128
1128
|
{
|
|
1129
1129
|
"data-active": isActive,
|
|
1130
1130
|
"data-disabled": props.disabled,
|
|
1131
|
-
className: classNames(styles$
|
|
1131
|
+
className: classNames(styles$t.breadcrumbItem, className),
|
|
1132
1132
|
...isActive && { "aria-current": "page" },
|
|
1133
1133
|
...!asChild && { type: "button" },
|
|
1134
1134
|
...props,
|
|
@@ -1140,13 +1140,13 @@ function BreadcrumbItem({ children, className, isActive, asChild, ...props }) {
|
|
|
1140
1140
|
function Breadcrumbs({
|
|
1141
1141
|
className,
|
|
1142
1142
|
children,
|
|
1143
|
-
separator = /* @__PURE__ */ jsxRuntime.jsx(IconChevron, { className: styles$
|
|
1143
|
+
separator = /* @__PURE__ */ jsxRuntime.jsx(IconChevron, { className: styles$u.defaultSeparator })
|
|
1144
1144
|
}) {
|
|
1145
1145
|
const childrenArray = Array.isArray(children) ? children : [children];
|
|
1146
1146
|
const lastIndex = childrenArray.length - 1;
|
|
1147
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "breadcrumb", className, children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: styles$
|
|
1148
|
-
/* @__PURE__ */ jsxRuntime.jsx("li", { className: styles$
|
|
1149
|
-
index < lastIndex && /* @__PURE__ */ jsxRuntime.jsx("li", { className: styles$
|
|
1147
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "breadcrumb", className, children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: styles$u.breadcrumbs, children: childrenArray.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
|
|
1148
|
+
/* @__PURE__ */ jsxRuntime.jsx("li", { className: styles$u.breadcrumbsItem, children: item }),
|
|
1149
|
+
index < lastIndex && /* @__PURE__ */ jsxRuntime.jsx("li", { className: styles$u.breadcrumbsItem, "aria-hidden": "true", children: separator })
|
|
1150
1150
|
] }, index)) }) });
|
|
1151
1151
|
}
|
|
1152
1152
|
Breadcrumbs.Item = BreadcrumbItem;
|
|
@@ -1161,7 +1161,7 @@ const neutral$2 = "_neutral_1waqk_78";
|
|
|
1161
1161
|
const lg$6 = "_lg_1waqk_145";
|
|
1162
1162
|
const md$9 = "_md_1waqk_153";
|
|
1163
1163
|
const sm$4 = "_sm_1waqk_161";
|
|
1164
|
-
const styles$
|
|
1164
|
+
const styles$s = {
|
|
1165
1165
|
button: button,
|
|
1166
1166
|
accent: accent$2,
|
|
1167
1167
|
primary: primary$2,
|
|
@@ -1179,7 +1179,7 @@ const accent$1 = "_accent_o8iku_10";
|
|
|
1179
1179
|
const neutral$1 = "_neutral_o8iku_22";
|
|
1180
1180
|
const lg$5 = "_lg_o8iku_41";
|
|
1181
1181
|
const md$8 = "_md_o8iku_46";
|
|
1182
|
-
const styles$
|
|
1182
|
+
const styles$r = {
|
|
1183
1183
|
buttonFunction: buttonFunction,
|
|
1184
1184
|
accent: accent$1,
|
|
1185
1185
|
neutral: neutral$1,
|
|
@@ -1199,7 +1199,7 @@ function ButtonFunction({
|
|
|
1199
1199
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1200
1200
|
Component,
|
|
1201
1201
|
{
|
|
1202
|
-
className: classNames(styles$
|
|
1202
|
+
className: classNames(styles$r.buttonFunction, styles$r[color], styles$r[size], className),
|
|
1203
1203
|
...props.disabled && { "data-disabled": true },
|
|
1204
1204
|
...!asChild && { type: "button" },
|
|
1205
1205
|
...props,
|
|
@@ -1221,7 +1221,7 @@ function Button({
|
|
|
1221
1221
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1222
1222
|
Component,
|
|
1223
1223
|
{
|
|
1224
|
-
className: classNames(styles$
|
|
1224
|
+
className: classNames(styles$s.button, styles$s[color], styles$s[size], styles$s[mode], className),
|
|
1225
1225
|
...!asChild && { type: "button" },
|
|
1226
1226
|
...props,
|
|
1227
1227
|
children
|
|
@@ -1233,7 +1233,7 @@ Button.Function = ButtonFunction;
|
|
|
1233
1233
|
const checkboxWrapper = "_checkboxWrapper_k1shg_2";
|
|
1234
1234
|
const icon$2 = "_icon_k1shg_23";
|
|
1235
1235
|
const checkbox = "_checkbox_k1shg_2";
|
|
1236
|
-
const styles$
|
|
1236
|
+
const styles$q = {
|
|
1237
1237
|
checkboxWrapper: checkboxWrapper,
|
|
1238
1238
|
icon: icon$2,
|
|
1239
1239
|
checkbox: checkbox
|
|
@@ -1246,11 +1246,11 @@ function Checkbox({ className, label, indeterminate, ...props }) {
|
|
|
1246
1246
|
{
|
|
1247
1247
|
"data-disabled": `${Boolean(props.disabled)}`,
|
|
1248
1248
|
"data-state": dataState,
|
|
1249
|
-
className: classNames(styles$
|
|
1249
|
+
className: classNames(styles$q.checkboxWrapper, className),
|
|
1250
1250
|
children: [
|
|
1251
|
-
dataState === "checked" && /* @__PURE__ */ jsxRuntime.jsx(IconCheck, { "data-disabled": `${Boolean(props.disabled)}`, className: styles$
|
|
1252
|
-
dataState === "indeterminate" && /* @__PURE__ */ jsxRuntime.jsx(IconMinus, { "data-disabled": `${Boolean(props.disabled)}`, className: styles$
|
|
1253
|
-
/* @__PURE__ */ jsxRuntime.jsx("input", { "data-state": dataState, type: "checkbox", className: styles$
|
|
1251
|
+
dataState === "checked" && /* @__PURE__ */ jsxRuntime.jsx(IconCheck, { "data-disabled": `${Boolean(props.disabled)}`, className: styles$q.icon }),
|
|
1252
|
+
dataState === "indeterminate" && /* @__PURE__ */ jsxRuntime.jsx(IconMinus, { "data-disabled": `${Boolean(props.disabled)}`, className: styles$q.icon }),
|
|
1253
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", { "data-state": dataState, type: "checkbox", className: styles$q.checkbox, ...props }),
|
|
1254
1254
|
label
|
|
1255
1255
|
]
|
|
1256
1256
|
}
|
|
@@ -1258,7 +1258,7 @@ function Checkbox({ className, label, indeterminate, ...props }) {
|
|
|
1258
1258
|
}
|
|
1259
1259
|
|
|
1260
1260
|
const chip = "_chip_dj4kw_2";
|
|
1261
|
-
const styles$
|
|
1261
|
+
const styles$p = {
|
|
1262
1262
|
chip: chip
|
|
1263
1263
|
};
|
|
1264
1264
|
|
|
@@ -1266,7 +1266,7 @@ function Chip({ isSelected, children, className, disabled, ...props }) {
|
|
|
1266
1266
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1267
1267
|
"div",
|
|
1268
1268
|
{
|
|
1269
|
-
className: classNames(styles$
|
|
1269
|
+
className: classNames(styles$p.chip, className),
|
|
1270
1270
|
"data-selected": isSelected,
|
|
1271
1271
|
"data-disabled": disabled,
|
|
1272
1272
|
"aria-disabled": disabled,
|
|
@@ -1284,7 +1284,7 @@ const accent = "_accent_ww0fb_37";
|
|
|
1284
1284
|
const neutral = "_neutral_ww0fb_42";
|
|
1285
1285
|
const secondary$2 = "_secondary_ww0fb_47";
|
|
1286
1286
|
const white = "_white_ww0fb_52";
|
|
1287
|
-
const styles$
|
|
1287
|
+
const styles$o = {
|
|
1288
1288
|
root: root$1,
|
|
1289
1289
|
lg: lg$4,
|
|
1290
1290
|
md: md$7,
|
|
@@ -1296,7 +1296,7 @@ const styles$n = {
|
|
|
1296
1296
|
};
|
|
1297
1297
|
|
|
1298
1298
|
function Counter({ className, size = "lg", color = "red", ...props }) {
|
|
1299
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$
|
|
1299
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$o.root, styles$o[size], styles$o[color], className), ...props });
|
|
1300
1300
|
}
|
|
1301
1301
|
|
|
1302
1302
|
const LOCALE_FIRST_DAY_OF_WEEK = {
|
|
@@ -1306,7 +1306,7 @@ const LOCALE_FIRST_DAY_OF_WEEK = {
|
|
|
1306
1306
|
|
|
1307
1307
|
const datePickerCellWrapper = "_datePickerCellWrapper_np1gx_2";
|
|
1308
1308
|
const datePickerCell = "_datePickerCell_np1gx_2";
|
|
1309
|
-
const styles$
|
|
1309
|
+
const styles$n = {
|
|
1310
1310
|
datePickerCellWrapper: datePickerCellWrapper,
|
|
1311
1311
|
datePickerCell: datePickerCell,
|
|
1312
1312
|
"radius-none": "_radius-none_np1gx_83",
|
|
@@ -1316,10 +1316,10 @@ const styles$m = {
|
|
|
1316
1316
|
};
|
|
1317
1317
|
|
|
1318
1318
|
function DatePickerCell({ children, className, state, isCurrent, radius = "both", ...props }) {
|
|
1319
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$
|
|
1319
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$n.datePickerCellWrapper, styles$n[`radius-${radius}`]), "data-state": state, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1320
1320
|
"button",
|
|
1321
1321
|
{
|
|
1322
|
-
className: classNames(styles$
|
|
1322
|
+
className: classNames(styles$n.datePickerCell, styles$n[`radius-${radius}`], className),
|
|
1323
1323
|
type: "button",
|
|
1324
1324
|
role: "gridcell",
|
|
1325
1325
|
"aria-selected": state === "selected",
|
|
@@ -1389,7 +1389,7 @@ function normalizeDateRange(firstDate, secondDate) {
|
|
|
1389
1389
|
const datePickerField = "_datePickerField_1qk8s_2";
|
|
1390
1390
|
const datePickerFieldCalendar = "_datePickerFieldCalendar_1qk8s_8";
|
|
1391
1391
|
const datePickerFieldWeek = "_datePickerFieldWeek_1qk8s_14";
|
|
1392
|
-
const styles$
|
|
1392
|
+
const styles$m = {
|
|
1393
1393
|
datePickerField: datePickerField,
|
|
1394
1394
|
datePickerFieldCalendar: datePickerFieldCalendar,
|
|
1395
1395
|
datePickerFieldWeek: datePickerFieldWeek
|
|
@@ -1404,9 +1404,9 @@ function DatePickerField({
|
|
|
1404
1404
|
firstDayOfWeek = LOCALE_FIRST_DAY_OF_WEEK.ru
|
|
1405
1405
|
}) {
|
|
1406
1406
|
const weeks = React.useMemo(() => getCalendarGrid(month, year, firstDayOfWeek), [month, year, firstDayOfWeek]);
|
|
1407
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames(styles$
|
|
1407
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames(styles$m.datePickerField, className), role: "grid", children: [
|
|
1408
1408
|
renderWeekdays?.(),
|
|
1409
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$
|
|
1409
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$m.datePickerFieldCalendar, role: "rowgroup", children: weeks.map((week, weekIndex) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$m.datePickerFieldWeek, role: "row", "aria-rowindex": weekIndex + 1, children: week.map((day, dayIndex) => /* @__PURE__ */ jsxRuntime.jsx(Slot, { role: "gridcell", "aria-colindex": dayIndex + 1, children: children(day) }, `${day.year}-${day.month}-${day.date}`)) }, weekIndex)) })
|
|
1410
1410
|
] });
|
|
1411
1411
|
}
|
|
1412
1412
|
|
|
@@ -1447,13 +1447,13 @@ const I18N_MONTH_LABELS = {
|
|
|
1447
1447
|
|
|
1448
1448
|
const datePickerWeekdays = "_datePickerWeekdays_p8tsm_2";
|
|
1449
1449
|
const datePickerWeekday = "_datePickerWeekday_p8tsm_2";
|
|
1450
|
-
const styles$
|
|
1450
|
+
const styles$l = {
|
|
1451
1451
|
datePickerWeekdays: datePickerWeekdays,
|
|
1452
1452
|
datePickerWeekday: datePickerWeekday
|
|
1453
1453
|
};
|
|
1454
1454
|
|
|
1455
1455
|
function DatePickerWeekDays({ className, locale = "ru" }) {
|
|
1456
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$
|
|
1456
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$l.datePickerWeekdays, className), role: "row", children: I18N_WEEKDAY_LABELS[locale].map((label) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$l.datePickerWeekday, role: "columnheader", children: label }, label)) });
|
|
1457
1457
|
}
|
|
1458
1458
|
|
|
1459
1459
|
function DatePicker() {
|
|
@@ -1689,21 +1689,21 @@ const DROPDOWN_PORTAL_SIDE_CONFIG = {
|
|
|
1689
1689
|
};
|
|
1690
1690
|
|
|
1691
1691
|
const dropdownContent = "_dropdownContent_12tkb_2";
|
|
1692
|
-
const styles$
|
|
1692
|
+
const styles$k = {
|
|
1693
1693
|
dropdownContent: dropdownContent
|
|
1694
1694
|
};
|
|
1695
1695
|
|
|
1696
1696
|
function DropdownContent({ className, children, ...props }) {
|
|
1697
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$
|
|
1697
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$k.dropdownContent, className), ...props, children });
|
|
1698
1698
|
}
|
|
1699
1699
|
|
|
1700
1700
|
const dropdownItem = "_dropdownItem_msc4i_2";
|
|
1701
|
-
const styles$
|
|
1701
|
+
const styles$j = {
|
|
1702
1702
|
dropdownItem: dropdownItem
|
|
1703
1703
|
};
|
|
1704
1704
|
|
|
1705
1705
|
function DropdownItem({ className, children, disabled, ...props }) {
|
|
1706
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$
|
|
1706
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$j.dropdownItem, className), role: "menuitem", "data-disabled": disabled, ...props, children });
|
|
1707
1707
|
}
|
|
1708
1708
|
|
|
1709
1709
|
const CLICK_OUTSIDE_IGNORE_DATA_NAME = "data-clickoutside-ignore";
|
|
@@ -2131,7 +2131,7 @@ function useTriggerHandlersByEventTrigger() {
|
|
|
2131
2131
|
}
|
|
2132
2132
|
|
|
2133
2133
|
const dropdownPortal = "_dropdownPortal_p3tdk_2";
|
|
2134
|
-
const styles$
|
|
2134
|
+
const styles$i = {
|
|
2135
2135
|
dropdownPortal: dropdownPortal
|
|
2136
2136
|
};
|
|
2137
2137
|
|
|
@@ -2171,7 +2171,7 @@ function DropdownPortal({
|
|
|
2171
2171
|
...style
|
|
2172
2172
|
},
|
|
2173
2173
|
ref: portalRef,
|
|
2174
|
-
className: classNames(styles$
|
|
2174
|
+
className: classNames(styles$i.dropdownPortal, className),
|
|
2175
2175
|
...handlersByTrigger[triggerEvent],
|
|
2176
2176
|
...isNested && { [CLICK_OUTSIDE_IGNORE_DATA_NAME]: "true" },
|
|
2177
2177
|
children
|
|
@@ -2224,7 +2224,7 @@ const BOUNDARY_PAGES = 2;
|
|
|
2224
2224
|
const paginationItem = "_paginationItem_1ll6p_2";
|
|
2225
2225
|
const md$6 = "_md_1ll6p_46";
|
|
2226
2226
|
const sm$3 = "_sm_1ll6p_60";
|
|
2227
|
-
const styles$
|
|
2227
|
+
const styles$h = {
|
|
2228
2228
|
paginationItem: paginationItem,
|
|
2229
2229
|
md: md$6,
|
|
2230
2230
|
sm: sm$3
|
|
@@ -2236,7 +2236,7 @@ function PaginationItem({ className, children, size = "md", isCurrent, ...props
|
|
|
2236
2236
|
{
|
|
2237
2237
|
type: "button",
|
|
2238
2238
|
...isCurrent && { "aria-current": "page" },
|
|
2239
|
-
className: classNames(styles$
|
|
2239
|
+
className: classNames(styles$h.paginationItem, styles$h[size], className),
|
|
2240
2240
|
...props,
|
|
2241
2241
|
children
|
|
2242
2242
|
}
|
|
@@ -2273,7 +2273,7 @@ function getVisiblePages(totalPages, maxVisiblePagesWithEllipsis, currentPage) {
|
|
|
2273
2273
|
const paginationRoot = "_paginationRoot_c5fwx_2";
|
|
2274
2274
|
const paginationList = "_paginationList_c5fwx_7";
|
|
2275
2275
|
const arrowLeft = "_arrowLeft_c5fwx_13";
|
|
2276
|
-
const styles$
|
|
2276
|
+
const styles$g = {
|
|
2277
2277
|
paginationRoot: paginationRoot,
|
|
2278
2278
|
paginationList: paginationList,
|
|
2279
2279
|
arrowLeft: arrowLeft
|
|
@@ -2300,9 +2300,9 @@ function PaginationRoot({
|
|
|
2300
2300
|
{
|
|
2301
2301
|
"aria-label": "pagination navigation",
|
|
2302
2302
|
role: "navigation",
|
|
2303
|
-
className: classNames(styles$
|
|
2303
|
+
className: classNames(styles$g.paginationRoot, className),
|
|
2304
2304
|
...props,
|
|
2305
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: styles$
|
|
2305
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: styles$g.paginationList, children: [
|
|
2306
2306
|
showArrows && /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2307
2307
|
PaginationItem$1,
|
|
2308
2308
|
{
|
|
@@ -2310,7 +2310,7 @@ function PaginationRoot({
|
|
|
2310
2310
|
onClick: () => onPageChange(currentPage - 1),
|
|
2311
2311
|
disabled: isFirstPage,
|
|
2312
2312
|
size,
|
|
2313
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(IconChevron$1, { className: styles$
|
|
2313
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(IconChevron$1, { className: styles$g.arrowLeft })
|
|
2314
2314
|
}
|
|
2315
2315
|
) }),
|
|
2316
2316
|
visiblePages.map((page, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: page === ELLIPSIS_SYMBOL ? /* @__PURE__ */ jsxRuntime.jsx(PaginationItem$1, { "aria-label": "More pages", disabled: true, size, children: /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, {}) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2346,15 +2346,15 @@ Pagination.Item = PaginationItem;
|
|
|
2346
2346
|
const root = "_root_33gbh_2";
|
|
2347
2347
|
const segment = "_segment_33gbh_10";
|
|
2348
2348
|
const flexGrow = "_flexGrow_33gbh_19";
|
|
2349
|
-
const fill = "_fill_33gbh_23";
|
|
2349
|
+
const fill$1 = "_fill_33gbh_23";
|
|
2350
2350
|
const trail = "_trail_33gbh_28";
|
|
2351
2351
|
const sm$2 = "_sm_33gbh_32";
|
|
2352
2352
|
const md$5 = "_md_33gbh_36";
|
|
2353
|
-
const styles$
|
|
2353
|
+
const styles$f = {
|
|
2354
2354
|
root: root,
|
|
2355
2355
|
segment: segment,
|
|
2356
2356
|
flexGrow: flexGrow,
|
|
2357
|
-
fill: fill,
|
|
2357
|
+
fill: fill$1,
|
|
2358
2358
|
trail: trail,
|
|
2359
2359
|
sm: sm$2,
|
|
2360
2360
|
md: md$5
|
|
@@ -2371,7 +2371,7 @@ function ProgressBarLinear({
|
|
|
2371
2371
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2372
2372
|
"div",
|
|
2373
2373
|
{
|
|
2374
|
-
className: classNames(styles$
|
|
2374
|
+
className: classNames(styles$f.root, styles$f[size], className),
|
|
2375
2375
|
role: "progressbar",
|
|
2376
2376
|
"aria-valuenow": clampedPercent,
|
|
2377
2377
|
"aria-valuemin": 0,
|
|
@@ -2383,14 +2383,14 @@ function ProgressBarLinear({
|
|
|
2383
2383
|
(Boolean(clampedPercent) || showFillOnZero) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2384
2384
|
"div",
|
|
2385
2385
|
{
|
|
2386
|
-
className: classNames(styles$
|
|
2386
|
+
className: classNames(styles$f.segment, styles$f.fill),
|
|
2387
2387
|
style: {
|
|
2388
2388
|
"--clamped-percent": `${clampedPercent}%`
|
|
2389
2389
|
},
|
|
2390
2390
|
"aria-hidden": "true"
|
|
2391
2391
|
}
|
|
2392
2392
|
),
|
|
2393
|
-
clampedPercent < 100 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$
|
|
2393
|
+
clampedPercent < 100 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$f.segment, styles$f.flexGrow, styles$f.trail), "aria-hidden": "true" })
|
|
2394
2394
|
]
|
|
2395
2395
|
}
|
|
2396
2396
|
);
|
|
@@ -2410,7 +2410,7 @@ function ProgressBarSteps({
|
|
|
2410
2410
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2411
2411
|
"div",
|
|
2412
2412
|
{
|
|
2413
|
-
className: classNames(styles$
|
|
2413
|
+
className: classNames(styles$f.segment, styles$f.flexGrow, isFilled ? styles$f.fill : styles$f.trail),
|
|
2414
2414
|
"aria-hidden": "true"
|
|
2415
2415
|
},
|
|
2416
2416
|
index
|
|
@@ -2419,7 +2419,7 @@ function ProgressBarSteps({
|
|
|
2419
2419
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2420
2420
|
"div",
|
|
2421
2421
|
{
|
|
2422
|
-
className: classNames(styles$
|
|
2422
|
+
className: classNames(styles$f.root, styles$f[size], className),
|
|
2423
2423
|
role: "progressbar",
|
|
2424
2424
|
"aria-valuenow": clampedCurrent,
|
|
2425
2425
|
"aria-valuemin": 0,
|
|
@@ -2439,14 +2439,14 @@ ProgressBar.Steps = ProgressBarSteps;
|
|
|
2439
2439
|
|
|
2440
2440
|
const radioWrapper = "_radioWrapper_13xie_2";
|
|
2441
2441
|
const radio = "_radio_13xie_2";
|
|
2442
|
-
const styles$
|
|
2442
|
+
const styles$e = {
|
|
2443
2443
|
radioWrapper: radioWrapper,
|
|
2444
2444
|
radio: radio
|
|
2445
2445
|
};
|
|
2446
2446
|
|
|
2447
2447
|
function RadioButton({ className, label, ...props }) {
|
|
2448
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("label", { "data-disabled": `${Boolean(props.disabled)}`, className: classNames(styles$
|
|
2449
|
-
/* @__PURE__ */ jsxRuntime.jsx("input", { type: "radio", className: styles$
|
|
2448
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { "data-disabled": `${Boolean(props.disabled)}`, className: classNames(styles$e.radioWrapper, className), children: [
|
|
2449
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", { type: "radio", className: styles$e.radio, ...props }),
|
|
2450
2450
|
label
|
|
2451
2451
|
] });
|
|
2452
2452
|
}
|
|
@@ -2457,7 +2457,7 @@ const textFieldAreaWrapper = "_textFieldAreaWrapper_pia91_2";
|
|
|
2457
2457
|
const textFieldAreaLabel = "_textFieldAreaLabel_pia91_14";
|
|
2458
2458
|
const textFieldAreaLabelSuffix = "_textFieldAreaLabelSuffix_pia91_24";
|
|
2459
2459
|
const textFieldArea = "_textFieldArea_pia91_2";
|
|
2460
|
-
const styles$
|
|
2460
|
+
const styles$d = {
|
|
2461
2461
|
textFieldAreaWrapper: textFieldAreaWrapper,
|
|
2462
2462
|
textFieldAreaLabel: textFieldAreaLabel,
|
|
2463
2463
|
textFieldAreaLabelSuffix: textFieldAreaLabelSuffix,
|
|
@@ -2478,14 +2478,14 @@ function TextFieldArea({
|
|
|
2478
2478
|
"data-invalid": isInvalid,
|
|
2479
2479
|
"aria-invalid": isInvalid,
|
|
2480
2480
|
"data-element": "field",
|
|
2481
|
-
className: classNames(styles$
|
|
2481
|
+
className: classNames(styles$d.textFieldArea, className),
|
|
2482
2482
|
placeholder,
|
|
2483
2483
|
...props
|
|
2484
2484
|
}
|
|
2485
2485
|
);
|
|
2486
|
-
return floatingLabel ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$
|
|
2487
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: props.id, className: styles$
|
|
2488
|
-
floatingLabelSuffix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$
|
|
2486
|
+
return floatingLabel ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$d.textFieldAreaWrapper, children: [
|
|
2487
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: props.id, className: styles$d.textFieldAreaLabel, "data-element": "label", children: floatingLabel }),
|
|
2488
|
+
floatingLabelSuffix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$d.textFieldAreaLabelSuffix, "data-element": "label-suffix", children: floatingLabelSuffix }),
|
|
2489
2489
|
textFieldArea
|
|
2490
2490
|
] }) : textFieldArea;
|
|
2491
2491
|
}
|
|
@@ -2493,7 +2493,7 @@ function TextFieldArea({
|
|
|
2493
2493
|
const textFieldInputWrapper = "_textFieldInputWrapper_1m8sa_2";
|
|
2494
2494
|
const textFieldInputLabel = "_textFieldInputLabel_1m8sa_9";
|
|
2495
2495
|
const textFieldInput = "_textFieldInput_1m8sa_2";
|
|
2496
|
-
const styles$
|
|
2496
|
+
const styles$c = {
|
|
2497
2497
|
textFieldInputWrapper: textFieldInputWrapper,
|
|
2498
2498
|
textFieldInputLabel: textFieldInputLabel,
|
|
2499
2499
|
textFieldInput: textFieldInput
|
|
@@ -2512,37 +2512,37 @@ function TextFieldInput({
|
|
|
2512
2512
|
"data-invalid": isInvalid,
|
|
2513
2513
|
"aria-invalid": isInvalid,
|
|
2514
2514
|
"data-element": "field",
|
|
2515
|
-
className: classNames(styles$
|
|
2515
|
+
className: classNames(styles$c.textFieldInput, className),
|
|
2516
2516
|
placeholder,
|
|
2517
2517
|
...props
|
|
2518
2518
|
}
|
|
2519
2519
|
);
|
|
2520
|
-
return floatingLabel ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$
|
|
2521
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: props.id, className: styles$
|
|
2520
|
+
return floatingLabel ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$c.textFieldInputWrapper, children: [
|
|
2521
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: props.id, className: styles$c.textFieldInputLabel, "data-element": "label", children: floatingLabel }),
|
|
2522
2522
|
textFieldInput
|
|
2523
2523
|
] }) : textFieldInput;
|
|
2524
2524
|
}
|
|
2525
2525
|
|
|
2526
|
-
const textFieldLabel = "
|
|
2527
|
-
const styles$
|
|
2526
|
+
const textFieldLabel = "_textFieldLabel_1xy6x_2";
|
|
2527
|
+
const styles$b = {
|
|
2528
2528
|
textFieldLabel: textFieldLabel
|
|
2529
2529
|
};
|
|
2530
2530
|
|
|
2531
2531
|
function TextFieldLabel({ className, children, isRequired, ...props }) {
|
|
2532
|
-
return /* @__PURE__ */ jsxRuntime.jsx("label", { className: classNames(styles$
|
|
2532
|
+
return /* @__PURE__ */ jsxRuntime.jsx("label", { className: classNames(styles$b.textFieldLabel, className), "data-required": isRequired, ...props, children });
|
|
2533
2533
|
}
|
|
2534
2534
|
|
|
2535
2535
|
const textFieldRoot = "_textFieldRoot_cs7mv_2";
|
|
2536
2536
|
const lg$3 = "_lg_cs7mv_38";
|
|
2537
2537
|
const md$4 = "_md_cs7mv_70";
|
|
2538
|
-
const styles$
|
|
2538
|
+
const styles$a = {
|
|
2539
2539
|
textFieldRoot: textFieldRoot,
|
|
2540
2540
|
lg: lg$3,
|
|
2541
2541
|
md: md$4
|
|
2542
2542
|
};
|
|
2543
2543
|
|
|
2544
2544
|
function TextFieldRoot({ className, size = "lg", ...props }) {
|
|
2545
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$
|
|
2545
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$a.textFieldRoot, styles$a[size], className), ...props });
|
|
2546
2546
|
}
|
|
2547
2547
|
|
|
2548
2548
|
function TextField() {
|
|
@@ -2557,7 +2557,7 @@ const custom = "_custom_gh87y_15";
|
|
|
2557
2557
|
const icon$1 = "_icon_gh87y_25";
|
|
2558
2558
|
const inputCustomWrapper = "_inputCustomWrapper_gh87y_34";
|
|
2559
2559
|
const customButton = "_customButton_gh87y_49";
|
|
2560
|
-
const styles$
|
|
2560
|
+
const styles$9 = {
|
|
2561
2561
|
search: search,
|
|
2562
2562
|
"default": "_default_gh87y_10",
|
|
2563
2563
|
custom: custom,
|
|
@@ -2583,7 +2583,7 @@ function Search(props) {
|
|
|
2583
2583
|
value && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2584
2584
|
IconXMark.Small,
|
|
2585
2585
|
{
|
|
2586
|
-
className: styles$
|
|
2586
|
+
className: styles$9.icon,
|
|
2587
2587
|
"aria-label": "clear search",
|
|
2588
2588
|
role: "button",
|
|
2589
2589
|
onClick: () => {
|
|
@@ -2597,13 +2597,13 @@ function Search(props) {
|
|
|
2597
2597
|
}
|
|
2598
2598
|
)
|
|
2599
2599
|
] });
|
|
2600
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(TextField.Root, { size: "md", className: classNames(styles$
|
|
2600
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(TextField.Root, { size: "md", className: classNames(styles$9.search, styles$9[mode], className), children: [
|
|
2601
2601
|
mode === "default" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2602
|
-
/* @__PURE__ */ jsxRuntime.jsx(IconSearch, { className: styles$
|
|
2602
|
+
/* @__PURE__ */ jsxRuntime.jsx(IconSearch, { className: styles$9.icon, "data-element": "icon" }),
|
|
2603
2603
|
inputField
|
|
2604
2604
|
] }),
|
|
2605
2605
|
mode === "custom" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2606
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$
|
|
2606
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$9.inputCustomWrapper, children: inputField }),
|
|
2607
2607
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2608
2608
|
"button",
|
|
2609
2609
|
{
|
|
@@ -2611,11 +2611,11 @@ function Search(props) {
|
|
|
2611
2611
|
type: "button",
|
|
2612
2612
|
onClick: props.onSearch,
|
|
2613
2613
|
"data-element": "custom-button",
|
|
2614
|
-
className: styles$
|
|
2614
|
+
className: styles$9.customButton,
|
|
2615
2615
|
style: {
|
|
2616
2616
|
"--custom-button-width": `${props.buttonWidth ?? DEFAULT_CUSTOM_SEARCH_BUTTON_WIDTH}px`
|
|
2617
2617
|
},
|
|
2618
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(IconSearch, { className: classNames(styles$
|
|
2618
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(IconSearch, { className: classNames(styles$9.icon), "data-element": "icon" })
|
|
2619
2619
|
}
|
|
2620
2620
|
)
|
|
2621
2621
|
] })
|
|
@@ -2641,7 +2641,7 @@ function useSegmentControlContext() {
|
|
|
2641
2641
|
const segmentControlItem = "_segmentControlItem_178px_2";
|
|
2642
2642
|
const lg$2 = "_lg_178px_23";
|
|
2643
2643
|
const md$3 = "_md_178px_28";
|
|
2644
|
-
const styles$
|
|
2644
|
+
const styles$8 = {
|
|
2645
2645
|
segmentControlItem: segmentControlItem,
|
|
2646
2646
|
lg: lg$2,
|
|
2647
2647
|
md: md$3
|
|
@@ -2657,7 +2657,7 @@ function SegmentControlItem({ className, children, value, ...props }) {
|
|
|
2657
2657
|
"aria-checked": value === activeValue,
|
|
2658
2658
|
"data-state": value === activeValue ? "on" : "off",
|
|
2659
2659
|
"data-value": value,
|
|
2660
|
-
className: classNames(styles$
|
|
2660
|
+
className: classNames(styles$8.segmentControlItem, styles$8[size], className),
|
|
2661
2661
|
...props,
|
|
2662
2662
|
children
|
|
2663
2663
|
}
|
|
@@ -2694,7 +2694,7 @@ const showAfterDelay = "_showAfterDelay_pulca_1";
|
|
|
2694
2694
|
const lg$1 = "_lg_pulca_19";
|
|
2695
2695
|
const md$2 = "_md_pulca_23";
|
|
2696
2696
|
const indicator$1 = "_indicator_pulca_28";
|
|
2697
|
-
const styles$
|
|
2697
|
+
const styles$7 = {
|
|
2698
2698
|
segmentControlRoot: segmentControlRoot,
|
|
2699
2699
|
showAfterDelay: showAfterDelay,
|
|
2700
2700
|
lg: lg$1,
|
|
@@ -2709,11 +2709,11 @@ function SegmentControlRoot({ className, children, value, size = "md", ...props
|
|
|
2709
2709
|
{
|
|
2710
2710
|
ref: rootRef,
|
|
2711
2711
|
role: "radiogroup",
|
|
2712
|
-
className: classNames(styles$
|
|
2712
|
+
className: classNames(styles$7.segmentControlRoot, styles$7[size], className),
|
|
2713
2713
|
...props,
|
|
2714
2714
|
children: [
|
|
2715
2715
|
children,
|
|
2716
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$
|
|
2716
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$7.indicator, styles$7[size]), style: indicatorStyle })
|
|
2717
2717
|
]
|
|
2718
2718
|
}
|
|
2719
2719
|
) });
|
|
@@ -2724,6 +2724,302 @@ function SegmentControl(props) {
|
|
|
2724
2724
|
}
|
|
2725
2725
|
SegmentControl.Item = SegmentControlItem;
|
|
2726
2726
|
|
|
2727
|
+
const SLIDER_DEFAULT_MIN = 0;
|
|
2728
|
+
const SLIDER_DEFAULT_MAX = 100;
|
|
2729
|
+
const SLIDER_DEFAULT_STEP = 1;
|
|
2730
|
+
const SLIDER_PAGE_STEP_MULTIPLIER = 10;
|
|
2731
|
+
const SLIDER_STEP_MULTIPLIER_BY_KEY = {
|
|
2732
|
+
ArrowRight: 1,
|
|
2733
|
+
ArrowUp: 1,
|
|
2734
|
+
ArrowLeft: -1,
|
|
2735
|
+
ArrowDown: -1,
|
|
2736
|
+
PageUp: SLIDER_PAGE_STEP_MULTIPLIER,
|
|
2737
|
+
PageDown: -SLIDER_PAGE_STEP_MULTIPLIER
|
|
2738
|
+
};
|
|
2739
|
+
|
|
2740
|
+
function getNearestHandleIndex(target, values) {
|
|
2741
|
+
let nearestIndex = 0;
|
|
2742
|
+
let nearestDistance = Number.POSITIVE_INFINITY;
|
|
2743
|
+
values.forEach((value, index) => {
|
|
2744
|
+
const distance = Math.abs(value - target);
|
|
2745
|
+
const isCloser = distance < nearestDistance;
|
|
2746
|
+
const isTieResolvedByDirection = distance === nearestDistance && target > value;
|
|
2747
|
+
if (isCloser || isTieResolvedByDirection) {
|
|
2748
|
+
nearestDistance = distance;
|
|
2749
|
+
nearestIndex = index;
|
|
2750
|
+
}
|
|
2751
|
+
});
|
|
2752
|
+
return nearestIndex;
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
function getPercent(value, bounds) {
|
|
2756
|
+
const { min, max } = bounds;
|
|
2757
|
+
if (max <= min) {
|
|
2758
|
+
return 0;
|
|
2759
|
+
}
|
|
2760
|
+
return Math.min(Math.max((value - min) / (max - min) * 100, 0), 100);
|
|
2761
|
+
}
|
|
2762
|
+
|
|
2763
|
+
function getFractionLength(value) {
|
|
2764
|
+
return String(value).split(".")[1]?.length ?? 0;
|
|
2765
|
+
}
|
|
2766
|
+
function snapToStep(value, bounds) {
|
|
2767
|
+
const { min, max, step } = bounds;
|
|
2768
|
+
const clamped = Math.min(Math.max(value, min), max);
|
|
2769
|
+
if (step <= 0) {
|
|
2770
|
+
return clamped;
|
|
2771
|
+
}
|
|
2772
|
+
const snapped = min + Math.round((clamped - min) / step) * step;
|
|
2773
|
+
const precision = Math.max(getFractionLength(step), getFractionLength(min));
|
|
2774
|
+
return Number(Math.min(Math.max(snapped, min), max).toFixed(precision));
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
function getValueFromPointer(params) {
|
|
2778
|
+
const { clientX, trackStart, trackWidth, min, max, step } = params;
|
|
2779
|
+
if (trackWidth <= 0) {
|
|
2780
|
+
return min;
|
|
2781
|
+
}
|
|
2782
|
+
const ratio = (clientX - trackStart) / trackWidth;
|
|
2783
|
+
return snapToStep(min + ratio * (max - min), { min, max, step });
|
|
2784
|
+
}
|
|
2785
|
+
|
|
2786
|
+
function normalizeMark(mark) {
|
|
2787
|
+
if (typeof mark === "number") {
|
|
2788
|
+
return { value: mark, label: mark };
|
|
2789
|
+
}
|
|
2790
|
+
return { value: mark.value, label: mark.label };
|
|
2791
|
+
}
|
|
2792
|
+
|
|
2793
|
+
function updateHandleValue(params) {
|
|
2794
|
+
const { values, index, next, min, max, step } = params;
|
|
2795
|
+
const lowerBound = values[index - 1] ?? min;
|
|
2796
|
+
const upperBound = values[index + 1] ?? max;
|
|
2797
|
+
const snapped = snapToStep(next, { min, max, step });
|
|
2798
|
+
const nextValues = [...values];
|
|
2799
|
+
nextValues[index] = Math.min(Math.max(snapped, lowerBound), upperBound);
|
|
2800
|
+
return nextValues;
|
|
2801
|
+
}
|
|
2802
|
+
|
|
2803
|
+
const slider = "_slider_vuele_2";
|
|
2804
|
+
const fill = "_fill_vuele_20";
|
|
2805
|
+
const rail = "_rail_vuele_26";
|
|
2806
|
+
const handle = "_handle_vuele_34";
|
|
2807
|
+
const mark = "_mark_vuele_39";
|
|
2808
|
+
const markDot = "_markDot_vuele_43";
|
|
2809
|
+
const track = "_track_vuele_56";
|
|
2810
|
+
const marks = "_marks_vuele_106";
|
|
2811
|
+
const styles$6 = {
|
|
2812
|
+
slider: slider,
|
|
2813
|
+
fill: fill,
|
|
2814
|
+
rail: rail,
|
|
2815
|
+
handle: handle,
|
|
2816
|
+
mark: mark,
|
|
2817
|
+
markDot: markDot,
|
|
2818
|
+
track: track,
|
|
2819
|
+
marks: marks
|
|
2820
|
+
};
|
|
2821
|
+
|
|
2822
|
+
function SliderMarks({ marks, min, max, activeFrom, activeTo }) {
|
|
2823
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$6.marks, children: marks.map(({ value, label }) => {
|
|
2824
|
+
const isActive = value >= activeFrom && value <= activeTo;
|
|
2825
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2826
|
+
"div",
|
|
2827
|
+
{
|
|
2828
|
+
"data-state": isActive ? "active" : "default",
|
|
2829
|
+
className: styles$6.mark,
|
|
2830
|
+
style: { insetInlineStart: `${getPercent(value, { min, max })}%` },
|
|
2831
|
+
children: [
|
|
2832
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$6.markDot }),
|
|
2833
|
+
label
|
|
2834
|
+
]
|
|
2835
|
+
},
|
|
2836
|
+
value
|
|
2837
|
+
);
|
|
2838
|
+
}) });
|
|
2839
|
+
}
|
|
2840
|
+
|
|
2841
|
+
function SliderBase({
|
|
2842
|
+
values,
|
|
2843
|
+
onValuesChange,
|
|
2844
|
+
min = SLIDER_DEFAULT_MIN,
|
|
2845
|
+
max = SLIDER_DEFAULT_MAX,
|
|
2846
|
+
step = SLIDER_DEFAULT_STEP,
|
|
2847
|
+
marks,
|
|
2848
|
+
disabled,
|
|
2849
|
+
className,
|
|
2850
|
+
"aria-label": ariaLabel,
|
|
2851
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2852
|
+
"aria-describedby": ariaDescribedBy,
|
|
2853
|
+
...props
|
|
2854
|
+
}) {
|
|
2855
|
+
const railRef = React.useRef(null);
|
|
2856
|
+
const handleRefs = React.useRef([]);
|
|
2857
|
+
const dragRef = React.useRef(null);
|
|
2858
|
+
const normalizedMarks = React.useMemo(() => marks?.map(normalizeMark) ?? [], [marks]);
|
|
2859
|
+
const fillFrom = values.length > 1 ? values[0] ?? min : min;
|
|
2860
|
+
const fillTo = values.at(-1) ?? min;
|
|
2861
|
+
const toPercent = (value) => getPercent(value, { min, max });
|
|
2862
|
+
const resolveKeyValue = (key, current) => {
|
|
2863
|
+
const multiplier = SLIDER_STEP_MULTIPLIER_BY_KEY[key];
|
|
2864
|
+
if (multiplier !== void 0) {
|
|
2865
|
+
return current + step * multiplier;
|
|
2866
|
+
}
|
|
2867
|
+
if (key === "Home") {
|
|
2868
|
+
return min;
|
|
2869
|
+
}
|
|
2870
|
+
return key === "End" ? max : null;
|
|
2871
|
+
};
|
|
2872
|
+
const resolveValueText = (value) => {
|
|
2873
|
+
const { label } = normalizedMarks.find((mark) => mark.value === value) ?? {};
|
|
2874
|
+
const text = typeof label === "string" || typeof label === "number" ? String(label) : void 0;
|
|
2875
|
+
return text === String(value) ? void 0 : text;
|
|
2876
|
+
};
|
|
2877
|
+
const commit = (index, next) => {
|
|
2878
|
+
const nextValues = updateHandleValue({ values, index, next, min, max, step });
|
|
2879
|
+
if (nextValues[index] === values[index]) {
|
|
2880
|
+
return;
|
|
2881
|
+
}
|
|
2882
|
+
onValuesChange(nextValues);
|
|
2883
|
+
};
|
|
2884
|
+
const readPointerValue = (clientX) => {
|
|
2885
|
+
if (!railRef.current) {
|
|
2886
|
+
return null;
|
|
2887
|
+
}
|
|
2888
|
+
const rect = railRef.current.getBoundingClientRect();
|
|
2889
|
+
return getValueFromPointer({ clientX, trackStart: rect.left, trackWidth: rect.width, min, max, step });
|
|
2890
|
+
};
|
|
2891
|
+
const handleKeyDown = (event, index) => {
|
|
2892
|
+
const current = values[index];
|
|
2893
|
+
if (disabled || current === void 0) {
|
|
2894
|
+
return;
|
|
2895
|
+
}
|
|
2896
|
+
const next = resolveKeyValue(event.key, current);
|
|
2897
|
+
if (next === null) {
|
|
2898
|
+
return;
|
|
2899
|
+
}
|
|
2900
|
+
event.preventDefault();
|
|
2901
|
+
commit(index, next);
|
|
2902
|
+
};
|
|
2903
|
+
const handlePointerDown = (event) => {
|
|
2904
|
+
if (disabled || event.button !== 0 || !event.isPrimary) {
|
|
2905
|
+
return;
|
|
2906
|
+
}
|
|
2907
|
+
const grabbedIndex = handleRefs.current.findIndex((handle) => handle === event.target);
|
|
2908
|
+
if (grabbedIndex >= 0) {
|
|
2909
|
+
const isAmbiguousGrab = values.filter((value) => value === values[grabbedIndex]).length > 1;
|
|
2910
|
+
dragRef.current = { pointerId: event.pointerId, index: isAmbiguousGrab ? null : grabbedIndex };
|
|
2911
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
2912
|
+
return;
|
|
2913
|
+
}
|
|
2914
|
+
const pointerValue = readPointerValue(event.clientX);
|
|
2915
|
+
if (pointerValue === null) {
|
|
2916
|
+
return;
|
|
2917
|
+
}
|
|
2918
|
+
const nearestIndex = getNearestHandleIndex(pointerValue, values);
|
|
2919
|
+
dragRef.current = { pointerId: event.pointerId, index: nearestIndex };
|
|
2920
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
2921
|
+
handleRefs.current[nearestIndex]?.focus();
|
|
2922
|
+
commit(nearestIndex, pointerValue);
|
|
2923
|
+
};
|
|
2924
|
+
const handlePointerMove = (event) => {
|
|
2925
|
+
const drag = dragRef.current;
|
|
2926
|
+
if (!drag || drag.pointerId !== event.pointerId || disabled) {
|
|
2927
|
+
return;
|
|
2928
|
+
}
|
|
2929
|
+
const pointerValue = readPointerValue(event.clientX);
|
|
2930
|
+
if (pointerValue === null) {
|
|
2931
|
+
return;
|
|
2932
|
+
}
|
|
2933
|
+
const index = drag.index ?? getNearestHandleIndex(pointerValue, values);
|
|
2934
|
+
dragRef.current = { pointerId: drag.pointerId, index };
|
|
2935
|
+
handleRefs.current[index]?.focus();
|
|
2936
|
+
commit(index, pointerValue);
|
|
2937
|
+
};
|
|
2938
|
+
const stopDragging = (event) => {
|
|
2939
|
+
if (dragRef.current?.pointerId !== event.pointerId) {
|
|
2940
|
+
return;
|
|
2941
|
+
}
|
|
2942
|
+
dragRef.current = null;
|
|
2943
|
+
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
2944
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
2945
|
+
}
|
|
2946
|
+
};
|
|
2947
|
+
const handleLostPointerCapture = (event) => {
|
|
2948
|
+
if (dragRef.current?.pointerId === event.pointerId) {
|
|
2949
|
+
dragRef.current = null;
|
|
2950
|
+
}
|
|
2951
|
+
};
|
|
2952
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2953
|
+
"div",
|
|
2954
|
+
{
|
|
2955
|
+
className: classNames(styles$6.slider, className),
|
|
2956
|
+
"data-disabled": disabled,
|
|
2957
|
+
"data-marks": Boolean(marks?.length),
|
|
2958
|
+
...props,
|
|
2959
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2960
|
+
"div",
|
|
2961
|
+
{
|
|
2962
|
+
ref: railRef,
|
|
2963
|
+
className: styles$6.rail,
|
|
2964
|
+
onPointerDown: handlePointerDown,
|
|
2965
|
+
onPointerMove: handlePointerMove,
|
|
2966
|
+
onPointerUp: stopDragging,
|
|
2967
|
+
onPointerCancel: stopDragging,
|
|
2968
|
+
onLostPointerCapture: handleLostPointerCapture,
|
|
2969
|
+
children: [
|
|
2970
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$6.track }),
|
|
2971
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2972
|
+
"div",
|
|
2973
|
+
{
|
|
2974
|
+
className: styles$6.fill,
|
|
2975
|
+
style: { insetInlineStart: `${toPercent(fillFrom)}%`, insetInlineEnd: `${100 - toPercent(fillTo)}%` }
|
|
2976
|
+
}
|
|
2977
|
+
),
|
|
2978
|
+
normalizedMarks.length ? /* @__PURE__ */ jsxRuntime.jsx(SliderMarks, { marks: normalizedMarks, min, max, activeFrom: fillFrom, activeTo: fillTo }) : null,
|
|
2979
|
+
values.map((value, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2980
|
+
"div",
|
|
2981
|
+
{
|
|
2982
|
+
ref: (element) => {
|
|
2983
|
+
handleRefs.current[index] = element;
|
|
2984
|
+
},
|
|
2985
|
+
role: "slider",
|
|
2986
|
+
tabIndex: disabled ? -1 : 0,
|
|
2987
|
+
"aria-valuemin": min,
|
|
2988
|
+
"aria-valuemax": max,
|
|
2989
|
+
"aria-valuenow": value,
|
|
2990
|
+
"aria-valuetext": resolveValueText(value),
|
|
2991
|
+
"aria-label": ariaLabel,
|
|
2992
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2993
|
+
"aria-describedby": ariaDescribedBy,
|
|
2994
|
+
"aria-disabled": disabled,
|
|
2995
|
+
"aria-orientation": "horizontal",
|
|
2996
|
+
className: styles$6.handle,
|
|
2997
|
+
style: { insetInlineStart: `${toPercent(value)}%` },
|
|
2998
|
+
onKeyDown: (event) => handleKeyDown(event, index)
|
|
2999
|
+
},
|
|
3000
|
+
index
|
|
3001
|
+
))
|
|
3002
|
+
]
|
|
3003
|
+
}
|
|
3004
|
+
)
|
|
3005
|
+
}
|
|
3006
|
+
);
|
|
3007
|
+
}
|
|
3008
|
+
|
|
3009
|
+
function SliderRange({ value, onChange, ...props }) {
|
|
3010
|
+
const handleValuesChange = (nextValues) => {
|
|
3011
|
+
const [from = value[0], to = value[1]] = nextValues;
|
|
3012
|
+
onChange([from, to]);
|
|
3013
|
+
};
|
|
3014
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SliderBase, { values: value, onValuesChange: handleValuesChange, ...props });
|
|
3015
|
+
}
|
|
3016
|
+
|
|
3017
|
+
function Slider({ value, onChange, ...props }) {
|
|
3018
|
+
const handleValuesChange = ([next = value]) => onChange(next);
|
|
3019
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SliderBase, { values: [value], onValuesChange: handleValuesChange, ...props });
|
|
3020
|
+
}
|
|
3021
|
+
Slider.Range = SliderRange;
|
|
3022
|
+
|
|
2727
3023
|
const stepper = "_stepper_103n3_2";
|
|
2728
3024
|
const sm$1 = "_sm_103n3_10";
|
|
2729
3025
|
const md$1 = "_md_103n3_17";
|
|
@@ -3118,6 +3414,7 @@ exports.ProgressBar = ProgressBar;
|
|
|
3118
3414
|
exports.RadioButton = RadioButton;
|
|
3119
3415
|
exports.Search = Search;
|
|
3120
3416
|
exports.SegmentControl = SegmentControl;
|
|
3417
|
+
exports.Slider = Slider;
|
|
3121
3418
|
exports.Stepper = Stepper;
|
|
3122
3419
|
exports.Switch = Switch;
|
|
3123
3420
|
exports.Tabs = Tabs;
|