@vygruppen/spor-react 12.24.13 → 12.24.15
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/.turbo/turbo-build.log +12 -12
- package/.turbo/turbo-postinstall.log +4 -3
- package/CHANGELOG.md +13 -0
- package/dist/index.cjs +201 -163
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -14
- package/dist/index.d.ts +15 -14
- package/dist/index.mjs +202 -164
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/calendar/CalendarCell.tsx +58 -32
- package/src/calendar/CalendarContext.tsx +9 -0
- package/src/calendar/ScrollCalendar.tsx +14 -4
- package/src/input/Autocomplete.tsx +105 -98
- package/src/stepper/StepperStep.tsx +2 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @vygruppen/spor-react@12.24.
|
|
2
|
+
> @vygruppen/spor-react@12.24.15 build /home/runner/work/spor/spor/packages/spor-react
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx, src/icons/index.tsx
|
|
@@ -11,18 +11,18 @@
|
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
13
|
[34mDTS[39m Build start
|
|
14
|
-
[
|
|
15
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m334.83 KB[39m
|
|
16
|
-
[32mESM[39m [1mdist/icons/index.mjs.map [22m[32m157.00 B[39m
|
|
17
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[32m706.26 KB[39m
|
|
18
|
-
[32mESM[39m ⚡️ Build success in 2652ms
|
|
19
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m359.00 KB[39m
|
|
14
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m360.22 KB[39m
|
|
20
15
|
[32mCJS[39m [1mdist/icons/index.cjs [22m[32m381.00 B[39m
|
|
21
|
-
[32mCJS[39m [1mdist/index.cjs.map [22m[
|
|
16
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m708.58 KB[39m
|
|
22
17
|
[32mCJS[39m [1mdist/icons/index.cjs.map [22m[32m157.00 B[39m
|
|
23
|
-
[32mCJS[39m ⚡️ Build success in
|
|
24
|
-
[
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 2636ms
|
|
19
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m336.04 KB[39m
|
|
20
|
+
[32mESM[39m [1mdist/icons/index.mjs [22m[32m110.00 B[39m
|
|
21
|
+
[32mESM[39m [1mdist/icons/index.mjs.map [22m[32m157.00 B[39m
|
|
22
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m708.58 KB[39m
|
|
23
|
+
[32mESM[39m ⚡️ Build success in 2638ms
|
|
24
|
+
[32mDTS[39m ⚡️ Build success in 20314ms
|
|
25
25
|
[32mDTS[39m [1mdist/icons/index.d.ts [22m[32m44.00 B[39m
|
|
26
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m147.
|
|
26
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m147.61 KB[39m
|
|
27
27
|
[32mDTS[39m [1mdist/icons/index.d.cts [22m[32m44.00 B[39m
|
|
28
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[32m147.
|
|
28
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m147.61 KB[39m
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
> @vygruppen/spor-react@12.24.
|
|
2
|
+
> @vygruppen/spor-react@12.24.15 postinstall /home/runner/work/spor/spor/packages/spor-react
|
|
3
3
|
> chakra typegen src/theme/index.ts
|
|
4
4
|
|
|
5
|
-
[dotenv@17.3.1] injecting env (0) from .env -- tip:
|
|
5
|
+
[dotenv@17.3.1] injecting env (0) from .env -- tip: ⚙️ enable debug logging with { debug: true }
|
|
6
6
|
[90m┌[39m Chakra CLI ⚡️
|
|
7
7
|
[?25l[90m│[39m
|
|
8
|
-
[
|
|
8
|
+
[35m◒[39m Generating conditions types...
|
|
9
|
+
[999D[J[32m◇[39m ✅ Generated conditions typings
|
|
9
10
|
[?25h[?25l[90m│[39m
|
|
10
11
|
[35m◒[39m Generating recipe types...
|
|
11
12
|
[999D[J[32m◇[39m ✅ Generated recipe typings
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @vygruppen/spor-react
|
|
2
2
|
|
|
3
|
+
## 12.24.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2efa3ee: fix(calendar): iOS 26 pointer bug with range selection
|
|
8
|
+
- f7f40c2: feat(autocomplete): Added ref and css props
|
|
9
|
+
|
|
10
|
+
## 12.24.14
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- a79c7e3: Fix contrast on stepper in darkmode
|
|
15
|
+
|
|
3
16
|
## 12.24.13
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -66,9 +66,9 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
66
66
|
var warnAboutMismatchingIcon = ({
|
|
67
67
|
icon
|
|
68
68
|
}) => {
|
|
69
|
-
var
|
|
69
|
+
var _a6, _b5;
|
|
70
70
|
if (process.env.NODE_ENV !== "production") {
|
|
71
|
-
const displayName = (
|
|
71
|
+
const displayName = (_b5 = (_a6 = icon == null ? void 0 : icon.type) == null ? void 0 : _a6.render) == null ? void 0 : _b5.displayName;
|
|
72
72
|
if (!displayName) {
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
@@ -1524,21 +1524,26 @@ function CalendarProvider(props) {
|
|
|
1524
1524
|
ref
|
|
1525
1525
|
);
|
|
1526
1526
|
const getRangeStartValue = () => {
|
|
1527
|
-
var
|
|
1528
|
-
if ((
|
|
1527
|
+
var _a6, _b5;
|
|
1528
|
+
if ((_a6 = rangeState.highlightedRange) == null ? void 0 : _a6.start) {
|
|
1529
1529
|
return date.toCalendarDate(rangeState.highlightedRange.start);
|
|
1530
1530
|
}
|
|
1531
|
-
if ((
|
|
1531
|
+
if ((_b5 = rangeState == null ? void 0 : rangeState.value) == null ? void 0 : _b5.start) {
|
|
1532
1532
|
return date.toCalendarDate(rangeState.value.start);
|
|
1533
1533
|
}
|
|
1534
1534
|
return null;
|
|
1535
1535
|
};
|
|
1536
1536
|
const getRangeEndValue = () => {
|
|
1537
|
-
var
|
|
1538
|
-
if ((
|
|
1537
|
+
var _a6, _b5;
|
|
1538
|
+
if ((_a6 = rangeState.highlightedRange) == null ? void 0 : _a6.end) {
|
|
1539
|
+
if (rangeState.anchorDate && rangeState.highlightedRange.start && rangeState.highlightedRange.end.compare(
|
|
1540
|
+
rangeState.highlightedRange.start
|
|
1541
|
+
) === 0) {
|
|
1542
|
+
return null;
|
|
1543
|
+
}
|
|
1539
1544
|
return date.toCalendarDate(rangeState.highlightedRange.end);
|
|
1540
1545
|
}
|
|
1541
|
-
if ((
|
|
1546
|
+
if ((_b5 = rangeState == null ? void 0 : rangeState.value) == null ? void 0 : _b5.end) {
|
|
1542
1547
|
return date.toCalendarDate(rangeState.value.end);
|
|
1543
1548
|
}
|
|
1544
1549
|
return null;
|
|
@@ -1639,16 +1644,36 @@ var StaticCard = React20.forwardRef(
|
|
|
1639
1644
|
}
|
|
1640
1645
|
);
|
|
1641
1646
|
StaticCard.displayName = "StaticCard";
|
|
1647
|
+
var _a2, _b;
|
|
1648
|
+
var IS_TOUCH_PRIMARY = globalThis.window !== void 0 && ((_b = (_a2 = globalThis.window).matchMedia) == null ? void 0 : _b.call(_a2, "(pointer: coarse)").matches);
|
|
1649
|
+
function isPhantomPointer(event) {
|
|
1650
|
+
return IS_TOUCH_PRIMARY && event.pointerType === "mouse";
|
|
1651
|
+
}
|
|
1642
1652
|
function CalendarCell({ date: date$1, currentMonth }) {
|
|
1643
|
-
var
|
|
1653
|
+
var _a6, _b5;
|
|
1644
1654
|
const { mode, state } = useCalendar();
|
|
1645
1655
|
const ref = React20.useRef(null);
|
|
1646
1656
|
const { cellProps, buttonProps, isSelected, isDisabled, formattedDate } = reactAria.useCalendarCell({ date: date$1 }, state, ref);
|
|
1647
1657
|
const isOutsideMonth = !date.isSameMonth(currentMonth, date$1);
|
|
1648
|
-
const isSelectionStart = mode === "range" && ((
|
|
1649
|
-
const isSelectionEnd = mode === "range" && ((
|
|
1650
|
-
const
|
|
1658
|
+
const isSelectionStart = mode === "range" && ((_a6 = state.highlightedRange) == null ? void 0 : _a6.start) ? date.isSameDay(date$1, state.highlightedRange.start) : false;
|
|
1659
|
+
const isSelectionEnd = mode === "range" && ((_b5 = state.highlightedRange) == null ? void 0 : _b5.end) ? date.isSameDay(date$1, state.highlightedRange.end) : false;
|
|
1660
|
+
const isEdge = mode === "single" && isSelected || isSelectionStart || isSelectionEnd;
|
|
1661
|
+
const isMiddle = isSelected && !isEdge && mode === "range";
|
|
1651
1662
|
const { focusProps, isFocusVisible } = reactAria.useFocusRing();
|
|
1663
|
+
const merged = reactAria.mergeProps(buttonProps, focusProps);
|
|
1664
|
+
const interactionProps = mode === "range" && IS_TOUCH_PRIMARY ? {
|
|
1665
|
+
...merged,
|
|
1666
|
+
onPointerEnter: (event) => {
|
|
1667
|
+
var _a7;
|
|
1668
|
+
if (!isPhantomPointer(event))
|
|
1669
|
+
(_a7 = merged.onPointerEnter) == null ? void 0 : _a7.call(merged, event);
|
|
1670
|
+
},
|
|
1671
|
+
onPointerMove: (event) => {
|
|
1672
|
+
var _a7;
|
|
1673
|
+
if (!isPhantomPointer(event))
|
|
1674
|
+
(_a7 = merged.onPointerMove) == null ? void 0 : _a7.call(merged, event);
|
|
1675
|
+
}
|
|
1676
|
+
} : merged;
|
|
1652
1677
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1653
1678
|
"td",
|
|
1654
1679
|
{
|
|
@@ -1660,7 +1685,7 @@ function CalendarCell({ date: date$1, currentMonth }) {
|
|
|
1660
1685
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1661
1686
|
react.Box,
|
|
1662
1687
|
{
|
|
1663
|
-
...
|
|
1688
|
+
...interactionProps,
|
|
1664
1689
|
ref,
|
|
1665
1690
|
hidden: isOutsideMonth,
|
|
1666
1691
|
width: ["54px", null, "70px"],
|
|
@@ -1676,32 +1701,10 @@ function CalendarCell({ date: date$1, currentMonth }) {
|
|
|
1676
1701
|
alignItems: "center",
|
|
1677
1702
|
justifyContent: "center",
|
|
1678
1703
|
borderRadius: "sm",
|
|
1679
|
-
css:
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
...isSingleModeSelected && {
|
|
1684
|
-
backgroundColor: "brand.surface",
|
|
1685
|
-
color: "text.inverted"
|
|
1686
|
-
},
|
|
1687
|
-
// Range mode: Selection start/end styling
|
|
1688
|
-
...(isSelectionStart || isSelectionEnd) && {
|
|
1689
|
-
backgroundColor: "brand.surface",
|
|
1690
|
-
color: "text.inverted"
|
|
1691
|
-
},
|
|
1692
|
-
// Range mode: Middle range styling
|
|
1693
|
-
...isSelected && !(isSelectionStart || isSelectionEnd) && mode === "range" && {
|
|
1694
|
-
backgroundColor: "surface.secondary",
|
|
1695
|
-
color: "text"
|
|
1696
|
-
},
|
|
1697
|
-
// Non-selected hover state
|
|
1698
|
-
...!isSelected && !isDisabled && {
|
|
1699
|
-
"&:hover": {
|
|
1700
|
-
backgroundColor: "surface.secondary",
|
|
1701
|
-
color: "text"
|
|
1702
|
-
}
|
|
1703
|
-
}
|
|
1704
|
-
},
|
|
1704
|
+
css: cellStyles,
|
|
1705
|
+
"data-disabled": isDisabled || void 0,
|
|
1706
|
+
"data-edge": isEdge || void 0,
|
|
1707
|
+
"data-middle": isMiddle || void 0,
|
|
1705
1708
|
children: /* @__PURE__ */ jsxRuntime.jsx(Text3, { variant: "sm", children: formattedDate })
|
|
1706
1709
|
}
|
|
1707
1710
|
)
|
|
@@ -1710,6 +1713,30 @@ function CalendarCell({ date: date$1, currentMonth }) {
|
|
|
1710
1713
|
}
|
|
1711
1714
|
);
|
|
1712
1715
|
}
|
|
1716
|
+
var cellStyles = {
|
|
1717
|
+
cursor: "pointer",
|
|
1718
|
+
// Disabled
|
|
1719
|
+
"&[data-disabled]": {
|
|
1720
|
+
color: "text.disabled"
|
|
1721
|
+
},
|
|
1722
|
+
// Selection edge (single-mode selected OR range start/end)
|
|
1723
|
+
"&[data-edge]": {
|
|
1724
|
+
backgroundColor: "brand.surface",
|
|
1725
|
+
color: "text.inverted"
|
|
1726
|
+
},
|
|
1727
|
+
// Range middle
|
|
1728
|
+
"&[data-middle]": {
|
|
1729
|
+
backgroundColor: "surface.secondary",
|
|
1730
|
+
color: "text"
|
|
1731
|
+
},
|
|
1732
|
+
// Hover for non-selected, non-disabled cells on devices that support hover
|
|
1733
|
+
"@media (hover: hover)": {
|
|
1734
|
+
"&:not([data-edge]):not([data-middle]):not([data-disabled]):hover": {
|
|
1735
|
+
backgroundColor: "surface.secondary",
|
|
1736
|
+
color: "text"
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
};
|
|
1713
1740
|
var weekDays = {
|
|
1714
1741
|
nb: ["Ma", "Ti", "On", "To", "Fr", "L\xF8", "S\xF8"],
|
|
1715
1742
|
nn: ["Ma", "Ti", "On", "To", "Fr", "L\xF8", "S\xF8"],
|
|
@@ -1912,10 +1939,20 @@ function ScrollCalendar(boxProps) {
|
|
|
1912
1939
|
if (monthIndex > 0 && monthIndex < monthCount) {
|
|
1913
1940
|
const element = monthReferences.current[monthIndex];
|
|
1914
1941
|
if (element) {
|
|
1915
|
-
element.
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1942
|
+
const selectedCell = element.querySelector(
|
|
1943
|
+
'[aria-selected="true"]'
|
|
1944
|
+
);
|
|
1945
|
+
if (selectedCell) {
|
|
1946
|
+
selectedCell.scrollIntoView({
|
|
1947
|
+
behavior: "instant",
|
|
1948
|
+
block: "center"
|
|
1949
|
+
});
|
|
1950
|
+
} else {
|
|
1951
|
+
element.scrollIntoView({
|
|
1952
|
+
behavior: "instant",
|
|
1953
|
+
block: "start"
|
|
1954
|
+
});
|
|
1955
|
+
}
|
|
1919
1956
|
}
|
|
1920
1957
|
}
|
|
1921
1958
|
hasScrolledRef.current = true;
|
|
@@ -2149,8 +2186,8 @@ function CalendarCell2({
|
|
|
2149
2186
|
stateProps["data-unavailable"] = true;
|
|
2150
2187
|
}
|
|
2151
2188
|
React20.useEffect(() => {
|
|
2152
|
-
var
|
|
2153
|
-
(
|
|
2189
|
+
var _a6;
|
|
2190
|
+
(_a6 = ref.current) == null ? void 0 : _a6.addEventListener(
|
|
2154
2191
|
"touchend",
|
|
2155
2192
|
(event) => {
|
|
2156
2193
|
event.preventDefault();
|
|
@@ -2486,7 +2523,7 @@ function createCalendar3(identifier) {
|
|
|
2486
2523
|
}
|
|
2487
2524
|
var DateField = React20.forwardRef(
|
|
2488
2525
|
(props, externalRef) => {
|
|
2489
|
-
var
|
|
2526
|
+
var _a6;
|
|
2490
2527
|
const locale = useCurrentLocale();
|
|
2491
2528
|
const recipe = react.useSlotRecipe({
|
|
2492
2529
|
key: "datePicker"
|
|
@@ -2524,7 +2561,7 @@ var DateField = React20.forwardRef(
|
|
|
2524
2561
|
"input",
|
|
2525
2562
|
{
|
|
2526
2563
|
type: "hidden",
|
|
2527
|
-
value: ((
|
|
2564
|
+
value: ((_a6 = state.value) == null ? void 0 : _a6.toString()) ?? "",
|
|
2528
2565
|
name: props.name,
|
|
2529
2566
|
id: props.id
|
|
2530
2567
|
}
|
|
@@ -2641,11 +2678,11 @@ var DatePicker = React20.forwardRef(
|
|
|
2641
2678
|
const locale = useCurrentLocale();
|
|
2642
2679
|
const shouldShowCalendar = state.isOpen && !props.isDisabled && !props.noCalendar;
|
|
2643
2680
|
const onFieldClick = () => {
|
|
2644
|
-
var
|
|
2681
|
+
var _a6;
|
|
2645
2682
|
if (!props.noCalendar) {
|
|
2646
2683
|
state.setOpen(true);
|
|
2647
2684
|
}
|
|
2648
|
-
(
|
|
2685
|
+
(_a6 = props.onClick) == null ? void 0 : _a6.call(props);
|
|
2649
2686
|
};
|
|
2650
2687
|
const popoverContent = /* @__PURE__ */ jsxRuntime.jsx(react.Popover.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Popover.Content, { css: styles.calendarPopover, children: /* @__PURE__ */ jsxRuntime.jsx(react.Popover.Body, { minWidth: "20rem", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2651
2688
|
Calendar2,
|
|
@@ -3419,91 +3456,95 @@ var Input = React20.forwardRef(
|
|
|
3419
3456
|
}
|
|
3420
3457
|
);
|
|
3421
3458
|
Input.displayName = "Input";
|
|
3422
|
-
var Autocomplete = (
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
onFocus,
|
|
3437
|
-
openOnClick = true,
|
|
3438
|
-
openOnFocus = true,
|
|
3439
|
-
...rest
|
|
3440
|
-
}) => {
|
|
3441
|
-
const { contains } = react.useFilter({ sensitivity: "base" });
|
|
3442
|
-
const { t } = useTranslation();
|
|
3443
|
-
const extractedItems = React20__namespace.default.useMemo(
|
|
3444
|
-
() => extractItemsFromChildren(children),
|
|
3445
|
-
[children]
|
|
3446
|
-
);
|
|
3447
|
-
const { collection, filter, reset } = react.useListCollection({
|
|
3448
|
-
initialItems: extractedItems,
|
|
3449
|
-
filter: filteredExternally ? void 0 : contains
|
|
3450
|
-
});
|
|
3451
|
-
React20__namespace.default.useEffect(() => {
|
|
3452
|
-
if (filteredExternally)
|
|
3453
|
-
reset();
|
|
3454
|
-
}, [extractedItems, reset, filteredExternally]);
|
|
3455
|
-
const filteredChildren = React20__namespace.default.useMemo(
|
|
3456
|
-
() => filterChildren(children, collection.items),
|
|
3457
|
-
[children, collection.items]
|
|
3458
|
-
);
|
|
3459
|
-
const combobox = react.useCombobox({
|
|
3460
|
-
collection,
|
|
3461
|
-
openOnClick: filteredChildren.length > 0 ? openOnClick : false,
|
|
3462
|
-
onInputValueChange: (event) => {
|
|
3463
|
-
if (!filteredExternally) {
|
|
3464
|
-
filter(event.inputValue);
|
|
3465
|
-
}
|
|
3466
|
-
onInputValueChange == null ? void 0 : onInputValueChange(event);
|
|
3467
|
-
},
|
|
3468
|
-
positioning: {
|
|
3469
|
-
placement: "bottom",
|
|
3470
|
-
offset: {
|
|
3471
|
-
mainAxis: 3,
|
|
3472
|
-
crossAxis: -1
|
|
3473
|
-
},
|
|
3474
|
-
flip: false
|
|
3475
|
-
},
|
|
3459
|
+
var Autocomplete = React20.forwardRef(
|
|
3460
|
+
function Autocomplete2({
|
|
3461
|
+
variant = "core",
|
|
3462
|
+
children,
|
|
3463
|
+
css,
|
|
3464
|
+
label,
|
|
3465
|
+
leftIcon,
|
|
3466
|
+
onInputValueChange,
|
|
3467
|
+
invalid,
|
|
3468
|
+
helperText,
|
|
3469
|
+
errorText,
|
|
3470
|
+
required,
|
|
3471
|
+
filteredExternally,
|
|
3472
|
+
loading,
|
|
3476
3473
|
disabled,
|
|
3474
|
+
emptyLabel,
|
|
3475
|
+
onFocus,
|
|
3476
|
+
openOnClick = true,
|
|
3477
|
+
openOnFocus = true,
|
|
3477
3478
|
...rest
|
|
3478
|
-
})
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3479
|
+
}, ref) {
|
|
3480
|
+
const { contains } = react.useFilter({ sensitivity: "base" });
|
|
3481
|
+
const { t } = useTranslation();
|
|
3482
|
+
const extractedItems = React20__namespace.default.useMemo(
|
|
3483
|
+
() => extractItemsFromChildren(children),
|
|
3484
|
+
[children]
|
|
3485
|
+
);
|
|
3486
|
+
const { collection, filter, reset } = react.useListCollection({
|
|
3487
|
+
initialItems: extractedItems,
|
|
3488
|
+
filter: filteredExternally ? void 0 : contains
|
|
3489
|
+
});
|
|
3490
|
+
React20__namespace.default.useEffect(() => {
|
|
3491
|
+
if (filteredExternally)
|
|
3492
|
+
reset();
|
|
3493
|
+
}, [extractedItems, reset, filteredExternally]);
|
|
3494
|
+
const filteredChildren = React20__namespace.default.useMemo(
|
|
3495
|
+
() => filterChildren(children, collection.items),
|
|
3496
|
+
[children, collection.items]
|
|
3497
|
+
);
|
|
3498
|
+
const combobox = react.useCombobox({
|
|
3499
|
+
collection,
|
|
3500
|
+
openOnClick: filteredChildren.length > 0 ? openOnClick : false,
|
|
3501
|
+
onInputValueChange: (event) => {
|
|
3502
|
+
if (!filteredExternally) {
|
|
3503
|
+
filter(event.inputValue);
|
|
3504
|
+
}
|
|
3505
|
+
onInputValueChange == null ? void 0 : onInputValueChange(event);
|
|
3506
|
+
},
|
|
3507
|
+
positioning: {
|
|
3508
|
+
placement: "bottom",
|
|
3509
|
+
offset: {
|
|
3510
|
+
mainAxis: 3,
|
|
3511
|
+
crossAxis: -1
|
|
3512
|
+
},
|
|
3513
|
+
flip: false
|
|
3514
|
+
},
|
|
3515
|
+
disabled,
|
|
3516
|
+
...rest
|
|
3517
|
+
});
|
|
3518
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.RootProvider, { value: combobox, children: [
|
|
3519
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.Control, { css, children: [
|
|
3520
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Input, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3521
|
+
Input,
|
|
3522
|
+
{
|
|
3523
|
+
ref,
|
|
3524
|
+
label: /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Label, { children: label }),
|
|
3525
|
+
variant,
|
|
3526
|
+
labelAsChild: true,
|
|
3527
|
+
startElement: leftIcon,
|
|
3528
|
+
invalid,
|
|
3529
|
+
helperText,
|
|
3530
|
+
errorText,
|
|
3531
|
+
required,
|
|
3532
|
+
onFocus: (event) => {
|
|
3533
|
+
onFocus == null ? void 0 : onFocus(event);
|
|
3534
|
+
if (openOnFocus && filteredChildren.length > 0)
|
|
3535
|
+
combobox.setOpen(true);
|
|
3536
|
+
}
|
|
3496
3537
|
}
|
|
3497
|
-
}
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
] })
|
|
3505
|
-
|
|
3506
|
-
|
|
3538
|
+
) }),
|
|
3539
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Combobox.IndicatorGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.ClearTrigger, { asChild: true, "aria-label": t(texts14.clearValue), children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { size: "xs", tabIndex: 0 }) }) })
|
|
3540
|
+
] }),
|
|
3541
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.Content, { children: [
|
|
3542
|
+
!loading && /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Empty, { children: emptyLabel ?? t(texts14.noItemsFound) }),
|
|
3543
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx(ColorSpinner, { width: "1.5rem", p: "2" }) : filteredChildren
|
|
3544
|
+
] }) })
|
|
3545
|
+
] });
|
|
3546
|
+
}
|
|
3547
|
+
);
|
|
3507
3548
|
var AutocompleteItemGroup = react.Combobox.ItemGroup;
|
|
3508
3549
|
var AutocompleteItemGroupLabel = react.Combobox.ItemGroupLabel;
|
|
3509
3550
|
var AutocompleteItem = React20.forwardRef(
|
|
@@ -3521,7 +3562,7 @@ var AutocompleteItem = React20.forwardRef(
|
|
|
3521
3562
|
var filterChildren = (children, collectionItems) => {
|
|
3522
3563
|
const collectionValues = new Set(collectionItems.map((item) => item.value));
|
|
3523
3564
|
return React20__namespace.default.Children.toArray(children).map((child) => {
|
|
3524
|
-
var
|
|
3565
|
+
var _a6;
|
|
3525
3566
|
if (!React20__namespace.default.isValidElement(child))
|
|
3526
3567
|
return null;
|
|
3527
3568
|
if (child.type === AutocompleteItemGroup) {
|
|
@@ -3540,7 +3581,7 @@ var filterChildren = (children, collectionItems) => {
|
|
|
3540
3581
|
children: filteredGroupChildren
|
|
3541
3582
|
});
|
|
3542
3583
|
}
|
|
3543
|
-
const itemProps = (
|
|
3584
|
+
const itemProps = (_a6 = child.props) == null ? void 0 : _a6.item;
|
|
3544
3585
|
if (itemProps) {
|
|
3545
3586
|
return collectionValues.has(itemProps.value) ? child : null;
|
|
3546
3587
|
}
|
|
@@ -3681,7 +3722,7 @@ var Popover = React20.forwardRef(
|
|
|
3681
3722
|
hasBackdrop = true,
|
|
3682
3723
|
containerPadding = 12
|
|
3683
3724
|
}, ref) => {
|
|
3684
|
-
var
|
|
3725
|
+
var _a6;
|
|
3685
3726
|
const internalRef = React20.useRef(null);
|
|
3686
3727
|
const popoverRef = ref ?? internalRef;
|
|
3687
3728
|
const { popoverProps, underlayProps } = reactAria.usePopover(
|
|
@@ -3702,7 +3743,7 @@ var Popover = React20.forwardRef(
|
|
|
3702
3743
|
{
|
|
3703
3744
|
...popoverProps,
|
|
3704
3745
|
ref: popoverRef,
|
|
3705
|
-
minWidth: ((
|
|
3746
|
+
minWidth: ((_a6 = triggerRef.current) == null ? void 0 : _a6.clientWidth) ?? "auto",
|
|
3706
3747
|
children: [
|
|
3707
3748
|
/* @__PURE__ */ jsxRuntime.jsx(reactAria.DismissButton, { onDismiss: state.close }),
|
|
3708
3749
|
children,
|
|
@@ -3997,8 +4038,8 @@ function Option({ item, state }) {
|
|
|
3997
4038
|
dataFields["data-focus-visible"] = true;
|
|
3998
4039
|
}
|
|
3999
4040
|
React20.useEffect(() => {
|
|
4000
|
-
var
|
|
4001
|
-
(
|
|
4041
|
+
var _a6;
|
|
4042
|
+
(_a6 = ref == null ? void 0 : ref.current) == null ? void 0 : _a6.addEventListener(
|
|
4002
4043
|
"touchend",
|
|
4003
4044
|
(event) => {
|
|
4004
4045
|
event.preventDefault();
|
|
@@ -4027,7 +4068,7 @@ var useOptionContext = () => {
|
|
|
4027
4068
|
return React20.useContext(OptionContext);
|
|
4028
4069
|
};
|
|
4029
4070
|
function ListBoxSection({ section, state }) {
|
|
4030
|
-
var
|
|
4071
|
+
var _a6, _b5;
|
|
4031
4072
|
const { itemProps, headingProps, groupProps } = reactAria.useListBoxSection({
|
|
4032
4073
|
heading: section.rendered,
|
|
4033
4074
|
"aria-label": section["aria-label"]
|
|
@@ -4049,7 +4090,7 @@ function ListBoxSection({ section, state }) {
|
|
|
4049
4090
|
children: section.rendered
|
|
4050
4091
|
}
|
|
4051
4092
|
),
|
|
4052
|
-
/* @__PURE__ */ jsxRuntime.jsx(List, { ...groupProps, padding: 0, listStyleType: "none", children: Array.from(((
|
|
4093
|
+
/* @__PURE__ */ jsxRuntime.jsx(List, { ...groupProps, padding: 0, listStyleType: "none", children: Array.from(((_b5 = (_a6 = state.collection).getChildren) == null ? void 0 : _b5.call(_a6, section.key)) ?? []).map(
|
|
4053
4094
|
(item) => /* @__PURE__ */ jsxRuntime.jsx(Option, { item, state }, item.key)
|
|
4054
4095
|
) })
|
|
4055
4096
|
] }) });
|
|
@@ -4135,8 +4176,8 @@ var NumericStepper = React20__namespace.default.forwardRef((props, ref) => {
|
|
|
4135
4176
|
});
|
|
4136
4177
|
const clampedStepSize = Math.max(Math.min(stepSize, 10), 1);
|
|
4137
4178
|
const focusOnAddButton = () => {
|
|
4138
|
-
var
|
|
4139
|
-
(
|
|
4179
|
+
var _a6;
|
|
4180
|
+
(_a6 = addButtonRef.current) == null ? void 0 : _a6.focus();
|
|
4140
4181
|
};
|
|
4141
4182
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4142
4183
|
Field3,
|
|
@@ -4408,8 +4449,8 @@ var CountryCodeSelect = React20.forwardRef((props, ref) => {
|
|
|
4408
4449
|
return allCallingCodes;
|
|
4409
4450
|
const filteredItems = allCallingCodes.items.filter(
|
|
4410
4451
|
(callingCode) => {
|
|
4411
|
-
var
|
|
4412
|
-
return (
|
|
4452
|
+
var _a6;
|
|
4453
|
+
return (_a6 = props.allowedCountryCodes) == null ? void 0 : _a6.includes(callingCode.label);
|
|
4413
4454
|
}
|
|
4414
4455
|
);
|
|
4415
4456
|
return react.createListCollection({ items: filteredItems });
|
|
@@ -4910,8 +4951,8 @@ var LinjeTagIcon = ({
|
|
|
4910
4951
|
size,
|
|
4911
4952
|
css
|
|
4912
4953
|
}) => {
|
|
4913
|
-
var
|
|
4914
|
-
const IconComponent2 = ((
|
|
4954
|
+
var _a6;
|
|
4955
|
+
const IconComponent2 = ((_a6 = icons[variant]) == null ? void 0 : _a6[size]) ?? react.Box;
|
|
4915
4956
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { css, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent2, {}) });
|
|
4916
4957
|
};
|
|
4917
4958
|
var LineIcon = React20.forwardRef(
|
|
@@ -6365,11 +6406,8 @@ var StepperStep = ({
|
|
|
6365
6406
|
const state = getState(stepNumber, activeStep);
|
|
6366
6407
|
const recipe = react.useSlotRecipe({ key: "stepper" });
|
|
6367
6408
|
const style = recipe({ variant });
|
|
6368
|
-
const disabledTextColor = "text.
|
|
6369
|
-
const iconColor =
|
|
6370
|
-
_light: "blackAlpha.200",
|
|
6371
|
-
_dark: "whiteAlpha.200"
|
|
6372
|
-
};
|
|
6409
|
+
const disabledTextColor = "text.tertiary";
|
|
6410
|
+
const iconColor = "text.tertiary";
|
|
6373
6411
|
const disabled = state !== "active" && disabledOverride || state === "disabled";
|
|
6374
6412
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { css: style.stepContainer, "data-part": "step-container", children: [
|
|
6375
6413
|
stepNumber > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6435,15 +6473,15 @@ var getNextSortState = (current, columnIndex) => {
|
|
|
6435
6473
|
return { direction: "asc", columnIndex: null };
|
|
6436
6474
|
};
|
|
6437
6475
|
var getColumnIndex = (element) => {
|
|
6438
|
-
var
|
|
6439
|
-
return Array.prototype.indexOf.call((
|
|
6476
|
+
var _a6;
|
|
6477
|
+
return Array.prototype.indexOf.call((_a6 = element.parentElement) == null ? void 0 : _a6.children, element);
|
|
6440
6478
|
};
|
|
6441
6479
|
var getCellSortText = (row, columnIndex) => {
|
|
6442
|
-
var
|
|
6480
|
+
var _a6;
|
|
6443
6481
|
const cell = row.cells[columnIndex];
|
|
6444
6482
|
if (!cell)
|
|
6445
6483
|
return "";
|
|
6446
|
-
return cell.dataset.sort || ((
|
|
6484
|
+
return cell.dataset.sort || ((_a6 = cell.textContent) == null ? void 0 : _a6.trim()) || "";
|
|
6447
6485
|
};
|
|
6448
6486
|
var applyDomSort = (tbody, sortState, originalRows) => {
|
|
6449
6487
|
if (sortState.columnIndex == null) {
|
|
@@ -7207,7 +7245,7 @@ var staticCardRecipe = react.defineRecipe({
|
|
|
7207
7245
|
colorPalette: "white"
|
|
7208
7246
|
}
|
|
7209
7247
|
});
|
|
7210
|
-
var
|
|
7248
|
+
var _a3, _b2;
|
|
7211
7249
|
var textareaRecipe = react.defineRecipe({
|
|
7212
7250
|
className: "spor-textarea",
|
|
7213
7251
|
base: {
|
|
@@ -7224,10 +7262,10 @@ var textareaRecipe = react.defineRecipe({
|
|
|
7224
7262
|
variants: {
|
|
7225
7263
|
variant: {
|
|
7226
7264
|
core: {
|
|
7227
|
-
...(
|
|
7265
|
+
...(_a3 = inputRecipe.variants) == null ? void 0 : _a3.variant.core
|
|
7228
7266
|
},
|
|
7229
7267
|
floating: {
|
|
7230
|
-
...(
|
|
7268
|
+
...(_b2 = inputRecipe.variants) == null ? void 0 : _b2.variant.floating
|
|
7231
7269
|
}
|
|
7232
7270
|
}
|
|
7233
7271
|
}
|
|
@@ -9439,7 +9477,7 @@ var travelTagSlotRecipe = react.defineSlotRecipe({
|
|
|
9439
9477
|
});
|
|
9440
9478
|
|
|
9441
9479
|
// src/theme/slot-recipes/info-tag.ts
|
|
9442
|
-
var
|
|
9480
|
+
var _a4, _b3, _c, _d;
|
|
9443
9481
|
var infoTagSlotRecipe = react.defineSlotRecipe({
|
|
9444
9482
|
slots: infoTagAnatomy.keys(),
|
|
9445
9483
|
className: "spor-info-tag",
|
|
@@ -9476,9 +9514,9 @@ var infoTagSlotRecipe = react.defineSlotRecipe({
|
|
|
9476
9514
|
"local-bus": {}
|
|
9477
9515
|
},
|
|
9478
9516
|
size: {
|
|
9479
|
-
...(
|
|
9517
|
+
...(_a4 = travelTagSlotRecipe.variants) == null ? void 0 : _a4.size,
|
|
9480
9518
|
sm: {
|
|
9481
|
-
...(
|
|
9519
|
+
...(_b3 = travelTagSlotRecipe.variants) == null ? void 0 : _b3.size.sm,
|
|
9482
9520
|
iconContainer: {
|
|
9483
9521
|
borderRadius: "0.375rem"
|
|
9484
9522
|
}
|
|
@@ -9852,7 +9890,7 @@ var mediaControllerSlotRecipe = react.defineSlotRecipe({
|
|
|
9852
9890
|
}
|
|
9853
9891
|
]
|
|
9854
9892
|
});
|
|
9855
|
-
var
|
|
9893
|
+
var _a5, _b4;
|
|
9856
9894
|
var nativeSelectSlotRecipe = react.defineSlotRecipe({
|
|
9857
9895
|
slots: NativeSelectAnatomy.keys(),
|
|
9858
9896
|
className: "spor-nativeSelect",
|
|
@@ -9896,12 +9934,12 @@ var nativeSelectSlotRecipe = react.defineSlotRecipe({
|
|
|
9896
9934
|
variant: {
|
|
9897
9935
|
core: {
|
|
9898
9936
|
field: {
|
|
9899
|
-
...(
|
|
9937
|
+
...(_a5 = inputRecipe.variants) == null ? void 0 : _a5.variant.core
|
|
9900
9938
|
}
|
|
9901
9939
|
},
|
|
9902
9940
|
floating: {
|
|
9903
9941
|
field: {
|
|
9904
|
-
...(
|
|
9942
|
+
...(_b4 = inputRecipe.variants) == null ? void 0 : _b4.variant.floating
|
|
9905
9943
|
}
|
|
9906
9944
|
}
|
|
9907
9945
|
}
|