@marigold/components 6.5.1 → 6.6.0
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.d.mts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +520 -437
- package/dist/index.mjs +537 -454
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -977,11 +977,12 @@ import { Button } from "react-aria-components";
|
|
|
977
977
|
import { cn as cn11, useClassNames as useClassNames9 } from "@marigold/system";
|
|
978
978
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
979
979
|
var _Button = forwardRef8(
|
|
980
|
-
({ children, variant, size, disabled, fullWidth, ...props }, ref) => {
|
|
980
|
+
({ children, variant, size, className, disabled, fullWidth, ...props }, ref) => {
|
|
981
981
|
const classNames2 = useClassNames9({
|
|
982
982
|
component: "Button",
|
|
983
983
|
variant,
|
|
984
|
-
size
|
|
984
|
+
size,
|
|
985
|
+
className
|
|
985
986
|
});
|
|
986
987
|
return /* @__PURE__ */ jsx22(
|
|
987
988
|
Button,
|
|
@@ -1263,6 +1264,7 @@ var _Checkbox = forwardRef9(
|
|
|
1263
1264
|
isReadOnly: readOnly,
|
|
1264
1265
|
isRequired: required,
|
|
1265
1266
|
isInvalid: error,
|
|
1267
|
+
isSelected: checked,
|
|
1266
1268
|
defaultSelected: defaultChecked,
|
|
1267
1269
|
...rest
|
|
1268
1270
|
};
|
|
@@ -1450,24 +1452,25 @@ import {
|
|
|
1450
1452
|
} from "react";
|
|
1451
1453
|
import { useButton as useButton3 } from "@react-aria/button";
|
|
1452
1454
|
import { useDialog } from "@react-aria/dialog";
|
|
1453
|
-
import { cn as
|
|
1455
|
+
import { cn as cn19, useClassNames as useClassNames17 } from "@marigold/system";
|
|
1454
1456
|
|
|
1455
1457
|
// src/Header/Header.tsx
|
|
1456
|
-
import {
|
|
1458
|
+
import { Header } from "react-aria-components";
|
|
1459
|
+
import { useClassNames as useClassNames15 } from "@marigold/system";
|
|
1457
1460
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1458
|
-
var
|
|
1461
|
+
var _Header = ({ variant, size, ...props }) => {
|
|
1459
1462
|
const classNames2 = useClassNames15({
|
|
1460
1463
|
component: "Header",
|
|
1461
1464
|
variant,
|
|
1462
1465
|
size
|
|
1463
1466
|
});
|
|
1464
|
-
return /* @__PURE__ */ jsx33(
|
|
1467
|
+
return /* @__PURE__ */ jsx33(Header, { className: classNames2, ...props, children: props.children });
|
|
1465
1468
|
};
|
|
1466
1469
|
|
|
1467
1470
|
// src/Headline/Headline.tsx
|
|
1468
1471
|
import { Heading } from "react-aria-components";
|
|
1469
1472
|
import {
|
|
1470
|
-
cn as
|
|
1473
|
+
cn as cn18,
|
|
1471
1474
|
createVar as createVar8,
|
|
1472
1475
|
get,
|
|
1473
1476
|
textAlign,
|
|
@@ -1495,7 +1498,7 @@ var _Headline = ({
|
|
|
1495
1498
|
{
|
|
1496
1499
|
level: Number(level),
|
|
1497
1500
|
...props,
|
|
1498
|
-
className:
|
|
1501
|
+
className: cn18(classNames2, "text-[--color]", textAlign[align]),
|
|
1499
1502
|
style: createVar8({
|
|
1500
1503
|
color: color && theme.colors && get(
|
|
1501
1504
|
theme.colors,
|
|
@@ -1592,7 +1595,7 @@ var CloseButton = ({ className }) => {
|
|
|
1592
1595
|
return /* @__PURE__ */ jsx37("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx37(
|
|
1593
1596
|
"button",
|
|
1594
1597
|
{
|
|
1595
|
-
className:
|
|
1598
|
+
className: cn19(
|
|
1596
1599
|
"h-4 w-4 cursor-pointer border-none p-0 leading-normal outline-0",
|
|
1597
1600
|
className
|
|
1598
1601
|
),
|
|
@@ -1612,7 +1615,7 @@ var CloseButton = ({ className }) => {
|
|
|
1612
1615
|
var addTitleProps = (children, titleProps) => {
|
|
1613
1616
|
const childs = Children5.toArray(children);
|
|
1614
1617
|
const titleIndex = childs.findIndex(
|
|
1615
|
-
(child) => isValidElement3(child) && (child.type ===
|
|
1618
|
+
(child) => isValidElement3(child) && (child.type === _Header || child.type === _Headline)
|
|
1616
1619
|
);
|
|
1617
1620
|
if (titleIndex < 0) {
|
|
1618
1621
|
console.warn(
|
|
@@ -1665,7 +1668,7 @@ var Footer = ({ children, variant, size, ...props }) => {
|
|
|
1665
1668
|
|
|
1666
1669
|
// src/Image/Image.tsx
|
|
1667
1670
|
import {
|
|
1668
|
-
cn as
|
|
1671
|
+
cn as cn20,
|
|
1669
1672
|
objectFit,
|
|
1670
1673
|
objectPosition,
|
|
1671
1674
|
useClassNames as useClassNames20
|
|
@@ -1684,7 +1687,7 @@ var Image = ({
|
|
|
1684
1687
|
{
|
|
1685
1688
|
...props,
|
|
1686
1689
|
alt: props.alt,
|
|
1687
|
-
className:
|
|
1690
|
+
className: cn20(
|
|
1688
1691
|
fit !== "none" && "h-full w-full",
|
|
1689
1692
|
classNames2,
|
|
1690
1693
|
objectFit[fit],
|
|
@@ -1697,7 +1700,7 @@ var Image = ({
|
|
|
1697
1700
|
// src/Inline/Inline.tsx
|
|
1698
1701
|
import {
|
|
1699
1702
|
alignment as alignment2,
|
|
1700
|
-
cn as
|
|
1703
|
+
cn as cn21,
|
|
1701
1704
|
gapSpace as gapSpace5
|
|
1702
1705
|
} from "@marigold/system";
|
|
1703
1706
|
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
@@ -1714,7 +1717,7 @@ var Inline = ({
|
|
|
1714
1717
|
"div",
|
|
1715
1718
|
{
|
|
1716
1719
|
...props,
|
|
1717
|
-
className:
|
|
1720
|
+
className: cn21(
|
|
1718
1721
|
"flex flex-wrap",
|
|
1719
1722
|
gapSpace5[space],
|
|
1720
1723
|
alignX && ((_b2 = (_a2 = alignment2) == null ? void 0 : _a2.horizontal) == null ? void 0 : _b2.alignmentX[alignX]),
|
|
@@ -1734,14 +1737,14 @@ import { useLocale } from "@react-aria/i18n";
|
|
|
1734
1737
|
import { useHover as useHover2 } from "@react-aria/interactions";
|
|
1735
1738
|
import { mergeProps as mergeProps7 } from "@react-aria/utils";
|
|
1736
1739
|
import { useDateFieldState } from "@react-stately/datepicker";
|
|
1737
|
-
import { cn as
|
|
1740
|
+
import { cn as cn23, useClassNames as useClassNames21, useStateProps as useStateProps6 } from "@marigold/system";
|
|
1738
1741
|
|
|
1739
1742
|
// src/DateField/DateSegment.tsx
|
|
1740
1743
|
import { useRef as useRef10 } from "react";
|
|
1741
1744
|
import { useDateSegment } from "@react-aria/datepicker";
|
|
1742
1745
|
import { useFocusRing as useFocusRing3 } from "@react-aria/focus";
|
|
1743
1746
|
import { mergeProps as mergeProps6 } from "@react-aria/utils";
|
|
1744
|
-
import { cn as
|
|
1747
|
+
import { cn as cn22, useStateProps as useStateProps5 } from "@marigold/system";
|
|
1745
1748
|
import { jsx as jsx42, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1746
1749
|
var DateSegment = ({
|
|
1747
1750
|
className,
|
|
@@ -1765,7 +1768,7 @@ var DateSegment = ({
|
|
|
1765
1768
|
{
|
|
1766
1769
|
...mergeProps6(segmentProps, stateProps, focusProps),
|
|
1767
1770
|
ref,
|
|
1768
|
-
className:
|
|
1771
|
+
className: cn22(
|
|
1769
1772
|
"group/segment",
|
|
1770
1773
|
"text-center leading-none outline-0",
|
|
1771
1774
|
type !== "literal" && "p-0.5",
|
|
@@ -1780,7 +1783,7 @@ var DateSegment = ({
|
|
|
1780
1783
|
"span",
|
|
1781
1784
|
{
|
|
1782
1785
|
"aria-hidden": "true",
|
|
1783
|
-
className:
|
|
1786
|
+
className: cn22(
|
|
1784
1787
|
isPlaceholder ? "visible block" : "invisible hidden",
|
|
1785
1788
|
"pointer-events-none w-full text-center"
|
|
1786
1789
|
),
|
|
@@ -1863,7 +1866,7 @@ var DateField = ({
|
|
|
1863
1866
|
"div",
|
|
1864
1867
|
{
|
|
1865
1868
|
...mergeProps7(fieldProps, focusProps, stateProps, hoverProps),
|
|
1866
|
-
className:
|
|
1869
|
+
className: cn23(
|
|
1867
1870
|
"relative flex flex-row flex-nowrap",
|
|
1868
1871
|
"cursor-text aria-disabled:cursor-not-allowed",
|
|
1869
1872
|
classNames2.field
|
|
@@ -1888,7 +1891,7 @@ var DateField = ({
|
|
|
1888
1891
|
"svg",
|
|
1889
1892
|
{
|
|
1890
1893
|
"data-testid": "action",
|
|
1891
|
-
className:
|
|
1894
|
+
className: cn23(classNames2.action),
|
|
1892
1895
|
viewBox: "0 0 24 24",
|
|
1893
1896
|
width: 24,
|
|
1894
1897
|
height: 24,
|
|
@@ -1904,14 +1907,14 @@ var DateField = ({
|
|
|
1904
1907
|
|
|
1905
1908
|
// src/Calendar/Calendar.tsx
|
|
1906
1909
|
import { createCalendar as createCalendar2 } from "@internationalized/date";
|
|
1907
|
-
import { useRef as useRef14 } from "react";
|
|
1910
|
+
import { useRef as useRef14, useState } from "react";
|
|
1908
1911
|
import {
|
|
1909
1912
|
useCalendar
|
|
1910
1913
|
} from "@react-aria/calendar";
|
|
1911
|
-
import { useLocale as useLocale3 } from "@react-aria/i18n";
|
|
1914
|
+
import { useDateFormatter as useDateFormatter3, useLocale as useLocale3 } from "@react-aria/i18n";
|
|
1912
1915
|
import { useCalendarState } from "@react-stately/calendar";
|
|
1913
|
-
import { ChevronLeft, ChevronRight } from "@marigold/icons";
|
|
1914
|
-
import { cn as
|
|
1916
|
+
import { ChevronDown as ChevronDown2, ChevronLeft, ChevronRight } from "@marigold/icons";
|
|
1917
|
+
import { cn as cn25, useClassNames as useClassNames23, useStateProps as useStateProps8 } from "@marigold/system";
|
|
1915
1918
|
|
|
1916
1919
|
// src/Calendar/CalendarGrid.tsx
|
|
1917
1920
|
import { getWeeksInMonth, startOfWeek, today } from "@internationalized/date";
|
|
@@ -1925,7 +1928,7 @@ import { useRef as useRef12 } from "react";
|
|
|
1925
1928
|
import { useCalendarCell } from "@react-aria/calendar";
|
|
1926
1929
|
import { useHover as useHover3 } from "@react-aria/interactions";
|
|
1927
1930
|
import { mergeProps as mergeProps8 } from "@react-aria/utils";
|
|
1928
|
-
import { cn as
|
|
1931
|
+
import { cn as cn24, useClassNames as useClassNames22, useStateProps as useStateProps7 } from "@marigold/system";
|
|
1929
1932
|
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
1930
1933
|
var CalendarCell = (props) => {
|
|
1931
1934
|
const ref = useRef12(null);
|
|
@@ -1946,7 +1949,7 @@ var CalendarCell = (props) => {
|
|
|
1946
1949
|
return /* @__PURE__ */ jsx44("td", { className: "group/cell", ...cellProps, children: /* @__PURE__ */ jsx44(
|
|
1947
1950
|
"div",
|
|
1948
1951
|
{
|
|
1949
|
-
className:
|
|
1952
|
+
className: cn24(
|
|
1950
1953
|
"flex h-[30px] w-[30px] cursor-pointer items-center justify-center rounded-full p-[5.3px] text-sm font-normal aria-disabled:cursor-default",
|
|
1951
1954
|
classNames2.calendarCell
|
|
1952
1955
|
),
|
|
@@ -2003,193 +2006,49 @@ var CalendarGrid = ({ state, ...props }) => {
|
|
|
2003
2006
|
};
|
|
2004
2007
|
|
|
2005
2008
|
// src/Calendar/MonthDropdown.tsx
|
|
2006
|
-
import {
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
} from "react";
|
|
2013
|
-
import { useButton as useButton4 } from "@react-aria/button";
|
|
2014
|
-
import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
|
|
2015
|
-
import { useLocalizedStringFormatter } from "@react-aria/i18n";
|
|
2016
|
-
import { HiddenSelect, useSelect } from "@react-aria/select";
|
|
2017
|
-
import { mergeProps as mergeProps9, useObjectRef as useObjectRef4 } from "@react-aria/utils";
|
|
2018
|
-
import { Item as Item4, Section } from "@react-stately/collections";
|
|
2019
|
-
import { useSelectState } from "@react-stately/select";
|
|
2020
|
-
import {
|
|
2021
|
-
cn as cn26,
|
|
2022
|
-
useClassNames as useClassNames23,
|
|
2023
|
-
useSmallScreen,
|
|
2024
|
-
useStateProps as useStateProps8
|
|
2025
|
-
} from "@marigold/system";
|
|
2026
|
-
|
|
2027
|
-
// src/Select/intl.ts
|
|
2028
|
-
var messages = {
|
|
2029
|
-
"en-US": {
|
|
2030
|
-
placeholder: "Select an option\u2026"
|
|
2031
|
-
},
|
|
2032
|
-
"de-DE": {
|
|
2033
|
-
placeholder: "Option ausw\xE4hlen\u2026"
|
|
2034
|
-
}
|
|
2035
|
-
};
|
|
2036
|
-
|
|
2037
|
-
// src/Select/Select.tsx
|
|
2038
|
-
import { jsx as jsx46, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2039
|
-
var Select = forwardRef10(
|
|
2040
|
-
({
|
|
2041
|
-
variant,
|
|
2042
|
-
size,
|
|
2043
|
-
width,
|
|
2044
|
-
open,
|
|
2045
|
-
disabled,
|
|
2046
|
-
required,
|
|
2047
|
-
error,
|
|
2048
|
-
onChange,
|
|
2049
|
-
...rest
|
|
2050
|
-
}, ref) => {
|
|
2051
|
-
const formatMessage = useLocalizedStringFormatter(messages);
|
|
2052
|
-
const props = {
|
|
2053
|
-
isOpen: open,
|
|
2054
|
-
isDisabled: disabled,
|
|
2055
|
-
isRequired: required,
|
|
2056
|
-
validationState: error ? "invalid" : "valid",
|
|
2057
|
-
placeholder: rest.placeholder || formatMessage.format("placeholder"),
|
|
2058
|
-
onSelectionChange: onChange,
|
|
2059
|
-
...rest
|
|
2060
|
-
};
|
|
2061
|
-
const buttonRef = useObjectRef4(ref);
|
|
2062
|
-
const listboxRef = useRef13(null);
|
|
2063
|
-
const state = useSelectState(props);
|
|
2064
|
-
const {
|
|
2065
|
-
labelProps,
|
|
2066
|
-
triggerProps,
|
|
2067
|
-
valueProps,
|
|
2068
|
-
menuProps,
|
|
2069
|
-
descriptionProps,
|
|
2070
|
-
errorMessageProps
|
|
2071
|
-
} = useSelect(props, state, buttonRef);
|
|
2072
|
-
const { buttonProps } = useButton4(
|
|
2073
|
-
{ isDisabled: disabled, ...triggerProps },
|
|
2074
|
-
buttonRef
|
|
2075
|
-
);
|
|
2076
|
-
const { focusProps, isFocusVisible } = useFocusRing5();
|
|
2077
|
-
const classNames2 = useClassNames23({ component: "Select", variant, size });
|
|
2078
|
-
const isSmallScreen = useSmallScreen();
|
|
2079
|
-
const stateProps = useStateProps8({
|
|
2080
|
-
disabled,
|
|
2081
|
-
error,
|
|
2082
|
-
focusVisible: isFocusVisible,
|
|
2083
|
-
expanded: state.isOpen,
|
|
2084
|
-
required
|
|
2085
|
-
});
|
|
2086
|
-
return /* @__PURE__ */ jsxs19(
|
|
2087
|
-
FieldBase,
|
|
2088
|
-
{
|
|
2089
|
-
variant,
|
|
2090
|
-
size,
|
|
2091
|
-
width,
|
|
2092
|
-
label: props.label,
|
|
2093
|
-
labelProps: { elementType: "span", ...labelProps },
|
|
2094
|
-
description: props.description,
|
|
2095
|
-
descriptionProps,
|
|
2096
|
-
error,
|
|
2097
|
-
errorMessage: props.errorMessage,
|
|
2098
|
-
errorMessageProps,
|
|
2099
|
-
stateProps,
|
|
2100
|
-
disabled,
|
|
2101
|
-
children: [
|
|
2102
|
-
/* @__PURE__ */ jsx46(
|
|
2103
|
-
HiddenSelect,
|
|
2104
|
-
{
|
|
2105
|
-
state,
|
|
2106
|
-
triggerRef: buttonRef,
|
|
2107
|
-
label: props.label,
|
|
2108
|
-
name: props.name,
|
|
2109
|
-
isDisabled: disabled
|
|
2110
|
-
}
|
|
2111
|
-
),
|
|
2112
|
-
/* @__PURE__ */ jsxs19(
|
|
2113
|
-
"button",
|
|
2114
|
-
{
|
|
2115
|
-
className: cn26(
|
|
2116
|
-
"flex w-full items-center justify-between gap-1 overflow-hidden",
|
|
2117
|
-
classNames2.select
|
|
2118
|
-
),
|
|
2119
|
-
ref: buttonRef,
|
|
2120
|
-
...mergeProps9(buttonProps, focusProps),
|
|
2121
|
-
...stateProps,
|
|
2122
|
-
children: [
|
|
2123
|
-
/* @__PURE__ */ jsx46("div", { className: "overflow-hidden whitespace-nowrap", ...valueProps, children: state.selectedItem ? state.selectedItem.rendered : props.placeholder }),
|
|
2124
|
-
/* @__PURE__ */ jsx46(ChevronDown, { className: "h-4 w-4" })
|
|
2125
|
-
]
|
|
2126
|
-
}
|
|
2127
|
-
),
|
|
2128
|
-
isSmallScreen ? /* @__PURE__ */ jsx46(Tray, { state, children: /* @__PURE__ */ jsx46(
|
|
2129
|
-
ListBox,
|
|
2130
|
-
{
|
|
2131
|
-
ref: listboxRef,
|
|
2132
|
-
state,
|
|
2133
|
-
variant,
|
|
2134
|
-
size,
|
|
2135
|
-
...menuProps
|
|
2136
|
-
}
|
|
2137
|
-
) }) : /* @__PURE__ */ jsx46(Popover, { state, triggerRef: buttonRef, scrollRef: listboxRef, children: /* @__PURE__ */ jsx46(
|
|
2138
|
-
ListBox,
|
|
2139
|
-
{
|
|
2140
|
-
ref: listboxRef,
|
|
2141
|
-
state,
|
|
2142
|
-
variant,
|
|
2143
|
-
size,
|
|
2144
|
-
...menuProps
|
|
2145
|
-
}
|
|
2146
|
-
) })
|
|
2147
|
-
]
|
|
2148
|
-
}
|
|
2149
|
-
);
|
|
2150
|
-
}
|
|
2151
|
-
);
|
|
2152
|
-
Select.Option = Item4;
|
|
2153
|
-
Select.Section = Section;
|
|
2154
|
-
|
|
2155
|
-
// src/Calendar/MonthDropdown.tsx
|
|
2156
|
-
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
2157
|
-
var MonthDropdown = ({ state }) => {
|
|
2158
|
-
let months = [];
|
|
2159
|
-
let formatter = useDateFormatter2({
|
|
2160
|
-
month: "long",
|
|
2161
|
-
timeZone: state.timeZone
|
|
2162
|
-
});
|
|
2163
|
-
let numMonths = state.focusedDate.calendar.getMonthsInYear(state.focusedDate);
|
|
2164
|
-
for (let i = 1; i <= numMonths; i++) {
|
|
2165
|
-
let date = state.focusedDate.set({ month: i });
|
|
2166
|
-
months.push(formatter.format(date.toDate(state.timeZone)));
|
|
2167
|
-
}
|
|
2009
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
2010
|
+
var MonthDropdown = ({
|
|
2011
|
+
state,
|
|
2012
|
+
setSelectedDropdown,
|
|
2013
|
+
months
|
|
2014
|
+
}) => {
|
|
2168
2015
|
let onChange = (index) => {
|
|
2169
|
-
let value = Number(index);
|
|
2016
|
+
let value = Number(index) + 1;
|
|
2170
2017
|
let date = state.focusedDate.set({ month: value });
|
|
2171
2018
|
state.setFocusedDate(date);
|
|
2172
2019
|
};
|
|
2173
|
-
return /* @__PURE__ */
|
|
2174
|
-
|
|
2020
|
+
return /* @__PURE__ */ jsx46(
|
|
2021
|
+
"ul",
|
|
2175
2022
|
{
|
|
2176
|
-
"
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2023
|
+
"data-testid": "monthOptions",
|
|
2024
|
+
className: "grid h-full max-h-[300px] min-w-[300px] grid-cols-3 gap-y-10 overflow-y-scroll p-2",
|
|
2025
|
+
children: months.map((month, index) => {
|
|
2026
|
+
return /* @__PURE__ */ jsx46("li", { className: "flex justify-center", children: /* @__PURE__ */ jsx46(
|
|
2027
|
+
_Button,
|
|
2028
|
+
{
|
|
2029
|
+
variant: index === state.focusedDate.month - 1 ? "secondary" : "text",
|
|
2030
|
+
size: "small",
|
|
2031
|
+
onPress: () => {
|
|
2032
|
+
onChange(index);
|
|
2033
|
+
setSelectedDropdown(void 0);
|
|
2034
|
+
},
|
|
2035
|
+
children: month.substring(0, 3)
|
|
2036
|
+
},
|
|
2037
|
+
index + 1
|
|
2038
|
+
) }, index);
|
|
2039
|
+
})
|
|
2182
2040
|
}
|
|
2183
2041
|
);
|
|
2184
2042
|
};
|
|
2185
2043
|
var MonthDropdown_default = MonthDropdown;
|
|
2186
2044
|
|
|
2187
2045
|
// src/Calendar/YearDropdown.tsx
|
|
2188
|
-
import {
|
|
2189
|
-
import {
|
|
2190
|
-
|
|
2046
|
+
import { useEffect as useEffect2, useRef as useRef13 } from "react";
|
|
2047
|
+
import { useDateFormatter as useDateFormatter2 } from "@react-aria/i18n";
|
|
2048
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
2049
|
+
var YearDropdown = ({ state, setSelectedDropdown }) => {
|
|
2191
2050
|
const years = [];
|
|
2192
|
-
let formatter =
|
|
2051
|
+
let formatter = useDateFormatter2({
|
|
2193
2052
|
year: "numeric",
|
|
2194
2053
|
timeZone: state.timeZone
|
|
2195
2054
|
});
|
|
@@ -2200,27 +2059,59 @@ var YearDropdown = ({ state }) => {
|
|
|
2200
2059
|
formatted: formatter.format(date.toDate(state.timeZone))
|
|
2201
2060
|
});
|
|
2202
2061
|
}
|
|
2062
|
+
const activeButtonRef = useRef13(null);
|
|
2063
|
+
useEffect2(() => {
|
|
2064
|
+
if (activeButtonRef.current) {
|
|
2065
|
+
const activeButton = activeButtonRef.current;
|
|
2066
|
+
activeButton == null ? void 0 : activeButton.scrollIntoView({
|
|
2067
|
+
behavior: "instant",
|
|
2068
|
+
block: "center"
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
}, [state.focusedDate]);
|
|
2203
2072
|
let onChange = (key) => {
|
|
2204
2073
|
let index = Number(key);
|
|
2205
2074
|
let date = years[index].value;
|
|
2206
2075
|
state.setFocusedDate(date);
|
|
2207
2076
|
};
|
|
2208
|
-
return /* @__PURE__ */
|
|
2209
|
-
|
|
2077
|
+
return /* @__PURE__ */ jsx47(
|
|
2078
|
+
"ul",
|
|
2210
2079
|
{
|
|
2211
|
-
"
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2080
|
+
"data-testid": "yearOptions",
|
|
2081
|
+
className: "grid h-full max-h-[300px] min-w-[300px] grid-cols-3 gap-y-10 overflow-y-scroll p-2",
|
|
2082
|
+
children: years.map((year, index) => {
|
|
2083
|
+
const isActive = +year.formatted === state.focusedDate.year;
|
|
2084
|
+
return /* @__PURE__ */ jsx47("li", { className: "flex justify-center", children: /* @__PURE__ */ jsx47(
|
|
2085
|
+
"div",
|
|
2086
|
+
{
|
|
2087
|
+
ref: isActive ? activeButtonRef : null,
|
|
2088
|
+
style: { height: "100%", width: "100%" },
|
|
2089
|
+
children: /* @__PURE__ */ jsx47(
|
|
2090
|
+
_Button,
|
|
2091
|
+
{
|
|
2092
|
+
disabled: state.isDisabled,
|
|
2093
|
+
variant: isActive ? "secondary" : "text",
|
|
2094
|
+
size: "small",
|
|
2095
|
+
onPress: () => {
|
|
2096
|
+
onChange(index);
|
|
2097
|
+
setSelectedDropdown(void 0);
|
|
2098
|
+
},
|
|
2099
|
+
"data-value": year.formatted,
|
|
2100
|
+
children: year.formatted
|
|
2101
|
+
},
|
|
2102
|
+
index
|
|
2103
|
+
)
|
|
2104
|
+
}
|
|
2105
|
+
) }, index);
|
|
2106
|
+
})
|
|
2217
2107
|
}
|
|
2218
2108
|
);
|
|
2219
2109
|
};
|
|
2220
2110
|
var YearDropdown_default = YearDropdown;
|
|
2221
2111
|
|
|
2222
2112
|
// src/Calendar/Calendar.tsx
|
|
2223
|
-
import { jsx as
|
|
2113
|
+
import { Fragment as Fragment5, jsx as jsx48, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2114
|
+
var buttonStyles = "flex items-center justify-between gap-1 overflow-hidden";
|
|
2224
2115
|
var Calendar = ({
|
|
2225
2116
|
disabled,
|
|
2226
2117
|
readOnly,
|
|
@@ -2254,51 +2145,97 @@ var Calendar = ({
|
|
|
2254
2145
|
onFocusChange: nextFocusChange,
|
|
2255
2146
|
...nextPropsRest
|
|
2256
2147
|
} = nextButtonProps;
|
|
2257
|
-
const calendarState =
|
|
2148
|
+
const calendarState = useStateProps8({
|
|
2258
2149
|
disabled: state.isDisabled,
|
|
2259
2150
|
focusVisible: state.isFocused
|
|
2260
2151
|
});
|
|
2261
|
-
const classNames2 =
|
|
2262
|
-
|
|
2152
|
+
const classNames2 = useClassNames23({ component: "Calendar" });
|
|
2153
|
+
const { select: selectClassNames } = useClassNames23({ component: "Select" });
|
|
2154
|
+
const [selectedDropdown, setSelectedDropdown] = useState();
|
|
2155
|
+
let months = [];
|
|
2156
|
+
let formatter = useDateFormatter3({
|
|
2157
|
+
month: "long",
|
|
2158
|
+
timeZone: state.timeZone
|
|
2159
|
+
});
|
|
2160
|
+
let numMonths = state.focusedDate.calendar.getMonthsInYear(state.focusedDate);
|
|
2161
|
+
for (let i = 1; i <= numMonths; i++) {
|
|
2162
|
+
let date = state.focusedDate.set({ month: i });
|
|
2163
|
+
months.push(formatter.format(date.toDate(state.timeZone)));
|
|
2164
|
+
}
|
|
2165
|
+
const selectedValue = {
|
|
2166
|
+
month: months[state.focusedDate.month - 1].substring(0, 3),
|
|
2167
|
+
year: state.focusedDate.year
|
|
2168
|
+
};
|
|
2169
|
+
return /* @__PURE__ */ jsx48(
|
|
2263
2170
|
"div",
|
|
2264
2171
|
{
|
|
2265
2172
|
tabIndex: -1,
|
|
2266
|
-
className:
|
|
2267
|
-
"flex w-[360px] flex-col rounded-sm p-4
|
|
2173
|
+
className: cn25(
|
|
2174
|
+
"flex min-h-[350px] w-[360px] flex-col rounded-sm p-4 shadow-[0_4px_4px_rgba(165,165,165,0.25)]",
|
|
2268
2175
|
classNames2.calendar
|
|
2269
2176
|
),
|
|
2270
2177
|
...calendarProps,
|
|
2271
2178
|
...calendarState,
|
|
2272
2179
|
ref,
|
|
2273
|
-
children:
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2180
|
+
children: selectedDropdown ? selectedDropdown === "month" ? /* @__PURE__ */ jsx48(
|
|
2181
|
+
MonthDropdown_default,
|
|
2182
|
+
{
|
|
2183
|
+
setSelectedDropdown,
|
|
2184
|
+
months,
|
|
2185
|
+
state
|
|
2186
|
+
}
|
|
2187
|
+
) : /* @__PURE__ */ jsx48(
|
|
2188
|
+
YearDropdown_default,
|
|
2189
|
+
{
|
|
2190
|
+
setSelectedDropdown,
|
|
2191
|
+
state
|
|
2192
|
+
}
|
|
2193
|
+
) : /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
2194
|
+
/* @__PURE__ */ jsxs19("div", { className: "mb-4 flex items-center justify-between", children: [
|
|
2195
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex w-full gap-4", children: [
|
|
2196
|
+
/* @__PURE__ */ jsxs19(
|
|
2197
|
+
"button",
|
|
2282
2198
|
{
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2199
|
+
disabled: state.isDisabled,
|
|
2200
|
+
onClick: () => setSelectedDropdown("month"),
|
|
2201
|
+
className: cn25(buttonStyles, selectClassNames),
|
|
2202
|
+
"data-testid": "month",
|
|
2203
|
+
children: [
|
|
2204
|
+
selectedValue.month,
|
|
2205
|
+
/* @__PURE__ */ jsx48(ChevronDown2, {})
|
|
2206
|
+
]
|
|
2287
2207
|
}
|
|
2288
2208
|
),
|
|
2289
|
-
/* @__PURE__ */
|
|
2290
|
-
|
|
2209
|
+
/* @__PURE__ */ jsxs19(
|
|
2210
|
+
"button",
|
|
2291
2211
|
{
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2212
|
+
disabled: state.isDisabled,
|
|
2213
|
+
onClick: () => setSelectedDropdown("year"),
|
|
2214
|
+
className: cn25(buttonStyles, selectClassNames),
|
|
2215
|
+
"data-testid": "year",
|
|
2216
|
+
children: [
|
|
2217
|
+
selectedValue.year,
|
|
2218
|
+
/* @__PURE__ */ jsx48(ChevronDown2, {})
|
|
2219
|
+
]
|
|
2296
2220
|
}
|
|
2297
2221
|
)
|
|
2298
|
-
] })
|
|
2222
|
+
] }),
|
|
2223
|
+
/* @__PURE__ */ jsxs19(
|
|
2224
|
+
"div",
|
|
2225
|
+
{
|
|
2226
|
+
className: cn25(
|
|
2227
|
+
"flex w-full flex-nowrap justify-end gap-[10px] [&_button:disabled]:cursor-not-allowed [&_button]:px-2 [&_button]:py-1",
|
|
2228
|
+
classNames2.calendarControllers
|
|
2229
|
+
),
|
|
2230
|
+
children: [
|
|
2231
|
+
/* @__PURE__ */ jsx48(_Button, { ...prevPropsRest, disabled: prevIsDisabled, children: /* @__PURE__ */ jsx48(ChevronLeft, {}) }),
|
|
2232
|
+
/* @__PURE__ */ jsx48(_Button, { ...nextPropsRest, disabled: nextIsDisabled, children: /* @__PURE__ */ jsx48(ChevronRight, {}) })
|
|
2233
|
+
]
|
|
2234
|
+
}
|
|
2235
|
+
)
|
|
2299
2236
|
] }),
|
|
2300
|
-
/* @__PURE__ */
|
|
2301
|
-
]
|
|
2237
|
+
/* @__PURE__ */ jsx48(CalendarGrid, { state })
|
|
2238
|
+
] })
|
|
2302
2239
|
}
|
|
2303
2240
|
);
|
|
2304
2241
|
};
|
|
@@ -2306,10 +2243,10 @@ var Calendar = ({
|
|
|
2306
2243
|
// src/DatePicker/DatePicker.tsx
|
|
2307
2244
|
import { useRef as useRef15 } from "react";
|
|
2308
2245
|
import { useDatePicker } from "@react-aria/datepicker";
|
|
2309
|
-
import { mergeProps as
|
|
2246
|
+
import { mergeProps as mergeProps9 } from "@react-aria/utils";
|
|
2310
2247
|
import { useDatePickerState } from "@react-stately/datepicker";
|
|
2311
|
-
import {
|
|
2312
|
-
import { Fragment as
|
|
2248
|
+
import { useClassNames as useClassNames24, useStateProps as useStateProps9 } from "@marigold/system";
|
|
2249
|
+
import { Fragment as Fragment6, jsx as jsx49, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2313
2250
|
var DatePicker = ({
|
|
2314
2251
|
disabled,
|
|
2315
2252
|
required,
|
|
@@ -2334,7 +2271,7 @@ var DatePicker = ({
|
|
|
2334
2271
|
...props
|
|
2335
2272
|
});
|
|
2336
2273
|
const ref = useRef15(null);
|
|
2337
|
-
const stateProps =
|
|
2274
|
+
const stateProps = useStateProps9({
|
|
2338
2275
|
focus: state.isOpen
|
|
2339
2276
|
});
|
|
2340
2277
|
const { groupProps, fieldProps, buttonProps, calendarProps } = useDatePicker(
|
|
@@ -2343,13 +2280,13 @@ var DatePicker = ({
|
|
|
2343
2280
|
ref
|
|
2344
2281
|
);
|
|
2345
2282
|
const { isDisabled, errorMessage, description, label } = props;
|
|
2346
|
-
const classNames2 =
|
|
2283
|
+
const classNames2 = useClassNames24({
|
|
2347
2284
|
component: "DatePicker",
|
|
2348
2285
|
size,
|
|
2349
2286
|
variant
|
|
2350
2287
|
});
|
|
2351
|
-
return /* @__PURE__ */
|
|
2352
|
-
/* @__PURE__ */
|
|
2288
|
+
return /* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
2289
|
+
/* @__PURE__ */ jsx49("div", { className: "flex w-full min-w-[300px]", ...groupProps, children: /* @__PURE__ */ jsx49(
|
|
2353
2290
|
DateField,
|
|
2354
2291
|
{
|
|
2355
2292
|
...fieldProps,
|
|
@@ -2362,42 +2299,41 @@ var DatePicker = ({
|
|
|
2362
2299
|
description: !state.isOpen && description,
|
|
2363
2300
|
triggerRef: ref,
|
|
2364
2301
|
width,
|
|
2365
|
-
action: /* @__PURE__ */
|
|
2302
|
+
action: /* @__PURE__ */ jsx49("div", { className: classNames2.container, children: /* @__PURE__ */ jsx49(
|
|
2366
2303
|
_Button,
|
|
2367
2304
|
{
|
|
2368
|
-
...
|
|
2369
|
-
className: cn28("absolute right-0 top-0", classNames2.button),
|
|
2305
|
+
...mergeProps9(buttonProps, stateProps),
|
|
2370
2306
|
disabled: isDisabled,
|
|
2371
|
-
children: /* @__PURE__ */
|
|
2307
|
+
children: /* @__PURE__ */ jsx49(
|
|
2372
2308
|
"svg",
|
|
2373
2309
|
{
|
|
2374
2310
|
width: "24",
|
|
2375
2311
|
height: "24",
|
|
2376
2312
|
viewBox: "0 0 24 24",
|
|
2377
2313
|
fill: "currentColor",
|
|
2378
|
-
children: /* @__PURE__ */
|
|
2314
|
+
children: /* @__PURE__ */ jsx49("path", { d: "M20.0906 19.2V6.6C20.0906 5.61 19.2806 4.8 18.2906 4.8H17.3906V3H15.5906V4.8H8.39062V3H6.59062V4.8H5.69063C4.69163 4.8 3.89962 5.61 3.89962 6.6L3.89062 19.2C3.89062 20.19 4.69163 21 5.69063 21H18.2906C19.2806 21 20.0906 20.19 20.0906 19.2ZM9.29062 11.1001H7.49061V12.9001H9.29062V11.1001ZM5.69062 8.40009H18.2906V6.60008H5.69062V8.40009ZM18.2906 10.2V19.2H5.69062V10.2H18.2906ZM14.6906 12.9001H16.4906V11.1001H14.6906V12.9001ZM12.8906 12.9001H11.0906V11.1001H12.8906V12.9001Z" })
|
|
2379
2315
|
}
|
|
2380
2316
|
)
|
|
2381
2317
|
}
|
|
2382
2318
|
) })
|
|
2383
2319
|
}
|
|
2384
2320
|
) }),
|
|
2385
|
-
state.isOpen && /* @__PURE__ */
|
|
2321
|
+
state.isOpen && /* @__PURE__ */ jsx49(Popover, { triggerRef: ref, state, children: /* @__PURE__ */ jsx49(Calendar, { disabled, ...calendarProps }) })
|
|
2386
2322
|
] });
|
|
2387
2323
|
};
|
|
2388
2324
|
|
|
2389
2325
|
// src/Inset/Inset.tsx
|
|
2390
2326
|
import {
|
|
2391
|
-
cn as
|
|
2327
|
+
cn as cn26,
|
|
2392
2328
|
paddingSpace as paddingSpace2,
|
|
2393
2329
|
paddingSpaceX as paddingSpaceX2,
|
|
2394
2330
|
paddingSpaceY as paddingSpaceY2
|
|
2395
2331
|
} from "@marigold/system";
|
|
2396
|
-
import { jsx as
|
|
2397
|
-
var Inset = ({ space, spaceX, spaceY, children }) => /* @__PURE__ */
|
|
2332
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
2333
|
+
var Inset = ({ space, spaceX, spaceY, children }) => /* @__PURE__ */ jsx50(
|
|
2398
2334
|
"div",
|
|
2399
2335
|
{
|
|
2400
|
-
className:
|
|
2336
|
+
className: cn26(
|
|
2401
2337
|
space && paddingSpace2[space],
|
|
2402
2338
|
!space && spaceX && paddingSpaceX2[spaceX],
|
|
2403
2339
|
!space && spaceY && paddingSpaceY2[spaceY]
|
|
@@ -2407,23 +2343,23 @@ var Inset = ({ space, spaceX, spaceY, children }) => /* @__PURE__ */ jsx51(
|
|
|
2407
2343
|
);
|
|
2408
2344
|
|
|
2409
2345
|
// src/Link/Link.tsx
|
|
2410
|
-
import { forwardRef as
|
|
2346
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
2411
2347
|
import { Link } from "react-aria-components";
|
|
2412
|
-
import { useClassNames as
|
|
2413
|
-
import { jsx as
|
|
2414
|
-
var _Link =
|
|
2348
|
+
import { useClassNames as useClassNames25 } from "@marigold/system";
|
|
2349
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2350
|
+
var _Link = forwardRef10(
|
|
2415
2351
|
({ variant, size, disabled, children, ...props }, ref) => {
|
|
2416
|
-
const classNames2 =
|
|
2352
|
+
const classNames2 = useClassNames25({
|
|
2417
2353
|
component: "Link",
|
|
2418
2354
|
variant,
|
|
2419
2355
|
size
|
|
2420
2356
|
});
|
|
2421
|
-
return /* @__PURE__ */
|
|
2357
|
+
return /* @__PURE__ */ jsx51(Link, { ...props, ref, className: classNames2, isDisabled: disabled, children });
|
|
2422
2358
|
}
|
|
2423
2359
|
);
|
|
2424
2360
|
|
|
2425
2361
|
// src/List/List.tsx
|
|
2426
|
-
import { useClassNames as
|
|
2362
|
+
import { useClassNames as useClassNames26 } from "@marigold/system";
|
|
2427
2363
|
|
|
2428
2364
|
// src/List/Context.ts
|
|
2429
2365
|
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
@@ -2431,14 +2367,14 @@ var ListContext = createContext5({});
|
|
|
2431
2367
|
var useListContext = () => useContext5(ListContext);
|
|
2432
2368
|
|
|
2433
2369
|
// src/List/ListItem.tsx
|
|
2434
|
-
import { jsx as
|
|
2370
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
2435
2371
|
var ListItem = ({ children, ...props }) => {
|
|
2436
2372
|
const { classNames: classNames2 } = useListContext();
|
|
2437
|
-
return /* @__PURE__ */
|
|
2373
|
+
return /* @__PURE__ */ jsx52("li", { ...props, className: classNames2, children });
|
|
2438
2374
|
};
|
|
2439
2375
|
|
|
2440
2376
|
// src/List/List.tsx
|
|
2441
|
-
import { jsx as
|
|
2377
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2442
2378
|
var List = ({
|
|
2443
2379
|
as = "ul",
|
|
2444
2380
|
children,
|
|
@@ -2447,8 +2383,8 @@ var List = ({
|
|
|
2447
2383
|
...props
|
|
2448
2384
|
}) => {
|
|
2449
2385
|
const Component = as;
|
|
2450
|
-
const classNames2 =
|
|
2451
|
-
return /* @__PURE__ */
|
|
2386
|
+
const classNames2 = useClassNames26({ component: "List", variant, size });
|
|
2387
|
+
return /* @__PURE__ */ jsx53(Component, { ...props, className: classNames2[as], children: /* @__PURE__ */ jsx53(ListContext.Provider, { value: { classNames: classNames2.item }, children }) });
|
|
2452
2388
|
};
|
|
2453
2389
|
List.Item = ListItem;
|
|
2454
2390
|
|
|
@@ -2456,9 +2392,9 @@ List.Item = ListItem;
|
|
|
2456
2392
|
import { useRef as useRef18 } from "react";
|
|
2457
2393
|
import { useMenu } from "@react-aria/menu";
|
|
2458
2394
|
import { useSyncRef } from "@react-aria/utils";
|
|
2459
|
-
import { Item as
|
|
2395
|
+
import { Item as Item4, Section } from "@react-stately/collections";
|
|
2460
2396
|
import { useTreeState as useTreeState2 } from "@react-stately/tree";
|
|
2461
|
-
import { useClassNames as
|
|
2397
|
+
import { useClassNames as useClassNames28 } from "@marigold/system";
|
|
2462
2398
|
|
|
2463
2399
|
// src/Menu/Context.ts
|
|
2464
2400
|
import {
|
|
@@ -2470,11 +2406,11 @@ var useMenuContext = () => useContext6(MenuContext);
|
|
|
2470
2406
|
|
|
2471
2407
|
// src/Menu/MenuItem.tsx
|
|
2472
2408
|
import { useRef as useRef16 } from "react";
|
|
2473
|
-
import { useFocusRing as
|
|
2409
|
+
import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
|
|
2474
2410
|
import { useMenuItem } from "@react-aria/menu";
|
|
2475
|
-
import { mergeProps as
|
|
2476
|
-
import { useStateProps as
|
|
2477
|
-
import { jsx as
|
|
2411
|
+
import { mergeProps as mergeProps10 } from "@react-aria/utils";
|
|
2412
|
+
import { useStateProps as useStateProps10 } from "@marigold/system";
|
|
2413
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
2478
2414
|
var MenuItem = ({
|
|
2479
2415
|
item,
|
|
2480
2416
|
state,
|
|
@@ -2492,17 +2428,17 @@ var MenuItem = ({
|
|
|
2492
2428
|
state,
|
|
2493
2429
|
ref
|
|
2494
2430
|
);
|
|
2495
|
-
const { isFocusVisible, focusProps } =
|
|
2496
|
-
const stateProps =
|
|
2431
|
+
const { isFocusVisible, focusProps } = useFocusRing5();
|
|
2432
|
+
const stateProps = useStateProps10({
|
|
2497
2433
|
focus: isFocusVisible
|
|
2498
2434
|
});
|
|
2499
2435
|
const { onPointerUp, ...props } = menuItemProps;
|
|
2500
|
-
return /* @__PURE__ */
|
|
2436
|
+
return /* @__PURE__ */ jsx54(
|
|
2501
2437
|
"li",
|
|
2502
2438
|
{
|
|
2503
2439
|
ref,
|
|
2504
2440
|
className,
|
|
2505
|
-
...
|
|
2441
|
+
...mergeProps10(
|
|
2506
2442
|
props,
|
|
2507
2443
|
{ onPointerDown: onPointerUp },
|
|
2508
2444
|
stateProps,
|
|
@@ -2515,19 +2451,19 @@ var MenuItem = ({
|
|
|
2515
2451
|
|
|
2516
2452
|
// src/Menu/MenuSection.tsx
|
|
2517
2453
|
import { useMenuSection } from "@react-aria/menu";
|
|
2518
|
-
import { useClassNames as
|
|
2519
|
-
import { Fragment as
|
|
2454
|
+
import { useClassNames as useClassNames27 } from "@marigold/system";
|
|
2455
|
+
import { Fragment as Fragment7, jsx as jsx55, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2520
2456
|
var MenuSection = ({ onAction, item, state }) => {
|
|
2521
2457
|
let { itemProps, headingProps, groupProps } = useMenuSection({
|
|
2522
2458
|
heading: item.rendered,
|
|
2523
2459
|
"aria-label": item["aria-label"]
|
|
2524
2460
|
});
|
|
2525
|
-
const className =
|
|
2526
|
-
return /* @__PURE__ */
|
|
2527
|
-
item.key !== state.collection.getFirstKey() && /* @__PURE__ */
|
|
2528
|
-
/* @__PURE__ */
|
|
2529
|
-
item.rendered && /* @__PURE__ */
|
|
2530
|
-
/* @__PURE__ */
|
|
2461
|
+
const className = useClassNames27({ component: "Menu" });
|
|
2462
|
+
return /* @__PURE__ */ jsxs21(Fragment7, { children: [
|
|
2463
|
+
item.key !== state.collection.getFirstKey() && /* @__PURE__ */ jsx55("li", { children: /* @__PURE__ */ jsx55(_Divider, { variant: "section" }) }),
|
|
2464
|
+
/* @__PURE__ */ jsxs21("li", { ...itemProps, children: [
|
|
2465
|
+
item.rendered && /* @__PURE__ */ jsx55("span", { ...headingProps, className: className.section, children: item.rendered }),
|
|
2466
|
+
/* @__PURE__ */ jsx55("ul", { ...groupProps, className: "pb-1", children: [...item.props.children].map((node) => /* @__PURE__ */ jsx55(
|
|
2531
2467
|
MenuItem,
|
|
2532
2468
|
{
|
|
2533
2469
|
item: node,
|
|
@@ -2546,10 +2482,10 @@ var MenuSection_default = MenuSection;
|
|
|
2546
2482
|
import { Children as Children6, useRef as useRef17 } from "react";
|
|
2547
2483
|
import { PressResponder as PressResponder2 } from "@react-aria/interactions";
|
|
2548
2484
|
import { useMenuTrigger } from "@react-aria/menu";
|
|
2549
|
-
import { useObjectRef as
|
|
2485
|
+
import { useObjectRef as useObjectRef4 } from "@react-aria/utils";
|
|
2550
2486
|
import { useMenuTriggerState } from "@react-stately/menu";
|
|
2551
|
-
import { useSmallScreen
|
|
2552
|
-
import { jsx as
|
|
2487
|
+
import { useSmallScreen } from "@marigold/system";
|
|
2488
|
+
import { jsx as jsx56, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2553
2489
|
var MenuTrigger = ({
|
|
2554
2490
|
disabled,
|
|
2555
2491
|
open,
|
|
@@ -2558,7 +2494,7 @@ var MenuTrigger = ({
|
|
|
2558
2494
|
}) => {
|
|
2559
2495
|
const [menuTrigger, menu] = Children6.toArray(children);
|
|
2560
2496
|
const menuTriggerRef = useRef17(null);
|
|
2561
|
-
const menuRef =
|
|
2497
|
+
const menuRef = useObjectRef4();
|
|
2562
2498
|
const state = useMenuTriggerState({
|
|
2563
2499
|
isOpen: open,
|
|
2564
2500
|
onOpenChange
|
|
@@ -2575,9 +2511,9 @@ var MenuTrigger = ({
|
|
|
2575
2511
|
onClose: state.close,
|
|
2576
2512
|
autoFocus: state.focusStrategy
|
|
2577
2513
|
};
|
|
2578
|
-
const isSmallScreen =
|
|
2579
|
-
return /* @__PURE__ */
|
|
2580
|
-
/* @__PURE__ */
|
|
2514
|
+
const isSmallScreen = useSmallScreen();
|
|
2515
|
+
return /* @__PURE__ */ jsxs22(MenuContext.Provider, { value: menuContext, children: [
|
|
2516
|
+
/* @__PURE__ */ jsx56(
|
|
2581
2517
|
PressResponder2,
|
|
2582
2518
|
{
|
|
2583
2519
|
...menuTriggerProps,
|
|
@@ -2586,12 +2522,12 @@ var MenuTrigger = ({
|
|
|
2586
2522
|
children: menuTrigger
|
|
2587
2523
|
}
|
|
2588
2524
|
),
|
|
2589
|
-
isSmallScreen ? /* @__PURE__ */
|
|
2525
|
+
isSmallScreen ? /* @__PURE__ */ jsx56(Tray, { state, children: menu }) : /* @__PURE__ */ jsx56(Popover, { triggerRef: menuTriggerRef, scrollRef: menuRef, state, children: menu })
|
|
2590
2526
|
] });
|
|
2591
2527
|
};
|
|
2592
2528
|
|
|
2593
2529
|
// src/Menu/Menu.tsx
|
|
2594
|
-
import { jsx as
|
|
2530
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
2595
2531
|
var Menu = ({ variant, size, ...props }) => {
|
|
2596
2532
|
const { ref: scrollRef, ...menuContext } = useMenuContext();
|
|
2597
2533
|
const ownProps = { ...props, ...menuContext };
|
|
@@ -2599,10 +2535,10 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
2599
2535
|
const state = useTreeState2({ ...ownProps, selectionMode: "none" });
|
|
2600
2536
|
const { menuProps } = useMenu(ownProps, state, ref);
|
|
2601
2537
|
useSyncRef({ ref: scrollRef }, ref);
|
|
2602
|
-
const classNames2 =
|
|
2603
|
-
return /* @__PURE__ */
|
|
2538
|
+
const classNames2 = useClassNames28({ component: "Menu", variant, size });
|
|
2539
|
+
return /* @__PURE__ */ jsx57("ul", { ref, className: classNames2.container, ...menuProps, children: [...state.collection].map((item) => {
|
|
2604
2540
|
if (item.type === "section") {
|
|
2605
|
-
return /* @__PURE__ */
|
|
2541
|
+
return /* @__PURE__ */ jsx57(
|
|
2606
2542
|
MenuSection_default,
|
|
2607
2543
|
{
|
|
2608
2544
|
item,
|
|
@@ -2612,7 +2548,7 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
2612
2548
|
item.key
|
|
2613
2549
|
);
|
|
2614
2550
|
}
|
|
2615
|
-
return /* @__PURE__ */
|
|
2551
|
+
return /* @__PURE__ */ jsx57(
|
|
2616
2552
|
MenuItem,
|
|
2617
2553
|
{
|
|
2618
2554
|
item,
|
|
@@ -2625,30 +2561,30 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
2625
2561
|
}) });
|
|
2626
2562
|
};
|
|
2627
2563
|
Menu.Trigger = MenuTrigger;
|
|
2628
|
-
Menu.Item =
|
|
2629
|
-
Menu.Section =
|
|
2564
|
+
Menu.Item = Item4;
|
|
2565
|
+
Menu.Section = Section;
|
|
2630
2566
|
|
|
2631
2567
|
// src/Menu/ActionMenu.tsx
|
|
2632
2568
|
import { SVG as SVG5 } from "@marigold/system";
|
|
2633
|
-
import { jsx as
|
|
2569
|
+
import { jsx as jsx58, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2634
2570
|
var ActionMenu = (props) => {
|
|
2635
|
-
return /* @__PURE__ */
|
|
2636
|
-
/* @__PURE__ */
|
|
2637
|
-
/* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ jsxs23(Menu.Trigger, { children: [
|
|
2572
|
+
/* @__PURE__ */ jsx58(_Button, { variant: "menu", size: "small", children: /* @__PURE__ */ jsx58(SVG5, { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx58("path", { d: "M12.0117 7.47656C13.2557 7.47656 14.2734 6.45879 14.2734 5.21484C14.2734 3.9709 13.2557 2.95312 12.0117 2.95312C10.7678 2.95312 9.75 3.9709 9.75 5.21484C9.75 6.45879 10.7678 7.47656 12.0117 7.47656ZM12.0117 9.73828C10.7678 9.73828 9.75 10.7561 9.75 12C9.75 13.2439 10.7678 14.2617 12.0117 14.2617C13.2557 14.2617 14.2734 13.2439 14.2734 12C14.2734 10.7561 13.2557 9.73828 12.0117 9.73828ZM12.0117 16.5234C10.7678 16.5234 9.75 17.5412 9.75 18.7852C9.75 20.0291 10.7678 21.0469 12.0117 21.0469C13.2557 21.0469 14.2734 20.0291 14.2734 18.7852C14.2734 17.5412 13.2557 16.5234 12.0117 16.5234Z" }) }) }),
|
|
2573
|
+
/* @__PURE__ */ jsx58(Menu, { ...props })
|
|
2638
2574
|
] });
|
|
2639
2575
|
};
|
|
2640
2576
|
|
|
2641
2577
|
// src/Message/Message.tsx
|
|
2642
|
-
import { cn as
|
|
2643
|
-
import { jsx as
|
|
2578
|
+
import { cn as cn27, useClassNames as useClassNames29 } from "@marigold/system";
|
|
2579
|
+
import { jsx as jsx59, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2644
2580
|
var icons = {
|
|
2645
|
-
info: () => /* @__PURE__ */
|
|
2581
|
+
info: () => /* @__PURE__ */ jsx59(
|
|
2646
2582
|
"svg",
|
|
2647
2583
|
{
|
|
2648
2584
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2649
2585
|
viewBox: "0 0 24 24",
|
|
2650
2586
|
fill: "currentColor",
|
|
2651
|
-
children: /* @__PURE__ */
|
|
2587
|
+
children: /* @__PURE__ */ jsx59(
|
|
2652
2588
|
"path",
|
|
2653
2589
|
{
|
|
2654
2590
|
fillRule: "evenodd",
|
|
@@ -2658,13 +2594,13 @@ var icons = {
|
|
|
2658
2594
|
)
|
|
2659
2595
|
}
|
|
2660
2596
|
),
|
|
2661
|
-
warning: () => /* @__PURE__ */
|
|
2597
|
+
warning: () => /* @__PURE__ */ jsx59(
|
|
2662
2598
|
"svg",
|
|
2663
2599
|
{
|
|
2664
2600
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2665
2601
|
viewBox: "0 0 24 24",
|
|
2666
2602
|
fill: "currentColor",
|
|
2667
|
-
children: /* @__PURE__ */
|
|
2603
|
+
children: /* @__PURE__ */ jsx59(
|
|
2668
2604
|
"path",
|
|
2669
2605
|
{
|
|
2670
2606
|
fillRule: "evenodd",
|
|
@@ -2674,13 +2610,13 @@ var icons = {
|
|
|
2674
2610
|
)
|
|
2675
2611
|
}
|
|
2676
2612
|
),
|
|
2677
|
-
error: () => /* @__PURE__ */
|
|
2613
|
+
error: () => /* @__PURE__ */ jsx59(
|
|
2678
2614
|
"svg",
|
|
2679
2615
|
{
|
|
2680
2616
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2681
2617
|
viewBox: "0 0 24 24",
|
|
2682
2618
|
fill: "currentColor",
|
|
2683
|
-
children: /* @__PURE__ */
|
|
2619
|
+
children: /* @__PURE__ */ jsx59(
|
|
2684
2620
|
"path",
|
|
2685
2621
|
{
|
|
2686
2622
|
fillRule: "evenodd",
|
|
@@ -2698,49 +2634,49 @@ var Message = ({
|
|
|
2698
2634
|
children,
|
|
2699
2635
|
...props
|
|
2700
2636
|
}) => {
|
|
2701
|
-
const classNames2 =
|
|
2637
|
+
const classNames2 = useClassNames29({ component: "Message", variant, size });
|
|
2702
2638
|
const Icon3 = icons[variant];
|
|
2703
|
-
return /* @__PURE__ */
|
|
2639
|
+
return /* @__PURE__ */ jsxs24(
|
|
2704
2640
|
"div",
|
|
2705
2641
|
{
|
|
2706
|
-
className:
|
|
2642
|
+
className: cn27(
|
|
2707
2643
|
"grid auto-rows-min grid-cols-[min-content_auto] gap-1",
|
|
2708
2644
|
classNames2.container
|
|
2709
2645
|
),
|
|
2710
2646
|
...props,
|
|
2711
2647
|
children: [
|
|
2712
|
-
/* @__PURE__ */
|
|
2713
|
-
/* @__PURE__ */
|
|
2648
|
+
/* @__PURE__ */ jsx59("div", { className: cn27("col-span-1 h-5 w-5 self-center", classNames2.icon), children: /* @__PURE__ */ jsx59(Icon3, {}) }),
|
|
2649
|
+
/* @__PURE__ */ jsx59(
|
|
2714
2650
|
"div",
|
|
2715
2651
|
{
|
|
2716
|
-
className:
|
|
2652
|
+
className: cn27("col-start-2 row-start-1 self-center", classNames2.title),
|
|
2717
2653
|
children: messageTitle
|
|
2718
2654
|
}
|
|
2719
2655
|
),
|
|
2720
|
-
/* @__PURE__ */
|
|
2656
|
+
/* @__PURE__ */ jsx59("div", { className: cn27("col-start-2", classNames2.content), children })
|
|
2721
2657
|
]
|
|
2722
2658
|
}
|
|
2723
2659
|
);
|
|
2724
2660
|
};
|
|
2725
2661
|
|
|
2726
2662
|
// src/NumberField/NumberField.tsx
|
|
2727
|
-
import { forwardRef as
|
|
2728
|
-
import { useFocusRing as
|
|
2663
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
2664
|
+
import { useFocusRing as useFocusRing6 } from "@react-aria/focus";
|
|
2729
2665
|
import { useLocale as useLocale4 } from "@react-aria/i18n";
|
|
2730
2666
|
import { useHover as useHover5 } from "@react-aria/interactions";
|
|
2731
2667
|
import { useNumberField } from "@react-aria/numberfield";
|
|
2732
|
-
import { mergeProps as
|
|
2668
|
+
import { mergeProps as mergeProps12, useObjectRef as useObjectRef5 } from "@react-aria/utils";
|
|
2733
2669
|
import { useNumberFieldState } from "@react-stately/numberfield";
|
|
2734
|
-
import { cn as
|
|
2670
|
+
import { cn as cn29, useClassNames as useClassNames30, useStateProps as useStateProps12 } from "@marigold/system";
|
|
2735
2671
|
|
|
2736
2672
|
// src/NumberField/StepButton.tsx
|
|
2737
2673
|
import { useRef as useRef19 } from "react";
|
|
2738
|
-
import { useButton as
|
|
2674
|
+
import { useButton as useButton4 } from "@react-aria/button";
|
|
2739
2675
|
import { useHover as useHover4 } from "@react-aria/interactions";
|
|
2740
|
-
import { mergeProps as
|
|
2741
|
-
import { cn as
|
|
2742
|
-
import { jsx as
|
|
2743
|
-
var Plus = () => /* @__PURE__ */
|
|
2676
|
+
import { mergeProps as mergeProps11 } from "@react-aria/utils";
|
|
2677
|
+
import { cn as cn28, useStateProps as useStateProps11 } from "@marigold/system";
|
|
2678
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
2679
|
+
var Plus = () => /* @__PURE__ */ jsx60("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx60(
|
|
2744
2680
|
"path",
|
|
2745
2681
|
{
|
|
2746
2682
|
fillRule: "evenodd",
|
|
@@ -2748,7 +2684,7 @@ var Plus = () => /* @__PURE__ */ jsx61("svg", { width: 16, height: 16, viewBox:
|
|
|
2748
2684
|
d: "M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z"
|
|
2749
2685
|
}
|
|
2750
2686
|
) });
|
|
2751
|
-
var Minus = () => /* @__PURE__ */
|
|
2687
|
+
var Minus = () => /* @__PURE__ */ jsx60("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx60(
|
|
2752
2688
|
"path",
|
|
2753
2689
|
{
|
|
2754
2690
|
fillRule: "evenodd",
|
|
@@ -2762,37 +2698,37 @@ var StepButton = ({
|
|
|
2762
2698
|
...props
|
|
2763
2699
|
}) => {
|
|
2764
2700
|
const ref = useRef19(null);
|
|
2765
|
-
const { buttonProps, isPressed } =
|
|
2701
|
+
const { buttonProps, isPressed } = useButton4(
|
|
2766
2702
|
{ ...props, elementType: "div" },
|
|
2767
2703
|
ref
|
|
2768
2704
|
);
|
|
2769
2705
|
const { hoverProps, isHovered } = useHover4(props);
|
|
2770
|
-
const stateProps =
|
|
2706
|
+
const stateProps = useStateProps11({
|
|
2771
2707
|
active: isPressed,
|
|
2772
2708
|
hover: isHovered,
|
|
2773
2709
|
disabled: props.isDisabled
|
|
2774
2710
|
});
|
|
2775
2711
|
const Icon3 = direction === "up" ? Plus : Minus;
|
|
2776
|
-
return /* @__PURE__ */
|
|
2712
|
+
return /* @__PURE__ */ jsx60(
|
|
2777
2713
|
"div",
|
|
2778
2714
|
{
|
|
2779
|
-
className:
|
|
2715
|
+
className: cn28(
|
|
2780
2716
|
[
|
|
2781
2717
|
"flex items-center justify-center",
|
|
2782
2718
|
"cursor-pointer data-[disabled]:cursor-not-allowed"
|
|
2783
2719
|
],
|
|
2784
2720
|
className
|
|
2785
2721
|
),
|
|
2786
|
-
...
|
|
2722
|
+
...mergeProps11(buttonProps, hoverProps),
|
|
2787
2723
|
...stateProps,
|
|
2788
|
-
children: /* @__PURE__ */
|
|
2724
|
+
children: /* @__PURE__ */ jsx60(Icon3, {})
|
|
2789
2725
|
}
|
|
2790
2726
|
);
|
|
2791
2727
|
};
|
|
2792
2728
|
|
|
2793
2729
|
// src/NumberField/NumberField.tsx
|
|
2794
|
-
import { jsx as
|
|
2795
|
-
var NumberField =
|
|
2730
|
+
import { jsx as jsx61, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2731
|
+
var NumberField = forwardRef11(
|
|
2796
2732
|
({
|
|
2797
2733
|
variant,
|
|
2798
2734
|
size,
|
|
@@ -2813,7 +2749,7 @@ var NumberField = forwardRef12(
|
|
|
2813
2749
|
};
|
|
2814
2750
|
const showStepper = !hideStepper;
|
|
2815
2751
|
const { locale } = useLocale4();
|
|
2816
|
-
const inputRef =
|
|
2752
|
+
const inputRef = useObjectRef5(ref);
|
|
2817
2753
|
const state = useNumberFieldState({ ...props, locale });
|
|
2818
2754
|
const {
|
|
2819
2755
|
labelProps,
|
|
@@ -2825,12 +2761,12 @@ var NumberField = forwardRef12(
|
|
|
2825
2761
|
decrementButtonProps
|
|
2826
2762
|
} = useNumberField(props, state, inputRef);
|
|
2827
2763
|
const { hoverProps, isHovered } = useHover5({ isDisabled: disabled });
|
|
2828
|
-
const { focusProps, isFocused } =
|
|
2764
|
+
const { focusProps, isFocused } = useFocusRing6({
|
|
2829
2765
|
within: true,
|
|
2830
2766
|
isTextInput: true,
|
|
2831
2767
|
autoFocus: props.autoFocus
|
|
2832
2768
|
});
|
|
2833
|
-
const stateProps =
|
|
2769
|
+
const stateProps = useStateProps12({
|
|
2834
2770
|
hover: isHovered,
|
|
2835
2771
|
focus: isFocused,
|
|
2836
2772
|
disabled,
|
|
@@ -2838,12 +2774,12 @@ var NumberField = forwardRef12(
|
|
|
2838
2774
|
readOnly,
|
|
2839
2775
|
required
|
|
2840
2776
|
});
|
|
2841
|
-
const classNames2 =
|
|
2777
|
+
const classNames2 = useClassNames30({
|
|
2842
2778
|
component: "NumberField",
|
|
2843
2779
|
size,
|
|
2844
2780
|
variant
|
|
2845
2781
|
});
|
|
2846
|
-
return /* @__PURE__ */
|
|
2782
|
+
return /* @__PURE__ */ jsx61(
|
|
2847
2783
|
FieldBase,
|
|
2848
2784
|
{
|
|
2849
2785
|
label: props.label,
|
|
@@ -2857,16 +2793,16 @@ var NumberField = forwardRef12(
|
|
|
2857
2793
|
variant,
|
|
2858
2794
|
size,
|
|
2859
2795
|
width,
|
|
2860
|
-
children: /* @__PURE__ */
|
|
2796
|
+
children: /* @__PURE__ */ jsxs25(
|
|
2861
2797
|
"div",
|
|
2862
2798
|
{
|
|
2863
2799
|
"data-group": true,
|
|
2864
|
-
className:
|
|
2800
|
+
className: cn29("flex items-stretch", classNames2.group),
|
|
2865
2801
|
"data-testid": "number-field-container",
|
|
2866
|
-
...
|
|
2802
|
+
...mergeProps12(groupProps, focusProps, hoverProps),
|
|
2867
2803
|
...stateProps,
|
|
2868
2804
|
children: [
|
|
2869
|
-
showStepper && /* @__PURE__ */
|
|
2805
|
+
showStepper && /* @__PURE__ */ jsx61(
|
|
2870
2806
|
StepButton,
|
|
2871
2807
|
{
|
|
2872
2808
|
className: classNames2.stepper,
|
|
@@ -2874,7 +2810,7 @@ var NumberField = forwardRef12(
|
|
|
2874
2810
|
...decrementButtonProps
|
|
2875
2811
|
}
|
|
2876
2812
|
),
|
|
2877
|
-
/* @__PURE__ */
|
|
2813
|
+
/* @__PURE__ */ jsx61("div", { className: "flex-1", children: /* @__PURE__ */ jsx61(
|
|
2878
2814
|
Input,
|
|
2879
2815
|
{
|
|
2880
2816
|
ref: inputRef,
|
|
@@ -2884,7 +2820,7 @@ var NumberField = forwardRef12(
|
|
|
2884
2820
|
...stateProps
|
|
2885
2821
|
}
|
|
2886
2822
|
) }),
|
|
2887
|
-
showStepper && /* @__PURE__ */
|
|
2823
|
+
showStepper && /* @__PURE__ */ jsx61(
|
|
2888
2824
|
StepButton,
|
|
2889
2825
|
{
|
|
2890
2826
|
className: classNames2.stepper,
|
|
@@ -2910,22 +2846,22 @@ import {
|
|
|
2910
2846
|
defaultTheme,
|
|
2911
2847
|
useTheme as useTheme3
|
|
2912
2848
|
} from "@marigold/system";
|
|
2913
|
-
import { jsx as
|
|
2849
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
2914
2850
|
function MarigoldProvider({
|
|
2915
2851
|
children,
|
|
2916
2852
|
theme
|
|
2917
2853
|
}) {
|
|
2918
2854
|
const outerTheme = useTheme3();
|
|
2919
2855
|
const isTopLevel = outerTheme === defaultTheme;
|
|
2920
|
-
return /* @__PURE__ */
|
|
2856
|
+
return /* @__PURE__ */ jsx62(ThemeProvider, { theme, children: isTopLevel ? /* @__PURE__ */ jsx62(OverlayProvider, { children }) : children });
|
|
2921
2857
|
}
|
|
2922
2858
|
|
|
2923
2859
|
// src/Radio/Radio.tsx
|
|
2924
2860
|
import {
|
|
2925
|
-
forwardRef as
|
|
2861
|
+
forwardRef as forwardRef13
|
|
2926
2862
|
} from "react";
|
|
2927
2863
|
import { Radio } from "react-aria-components";
|
|
2928
|
-
import { cn as
|
|
2864
|
+
import { cn as cn33, useClassNames as useClassNames34 } from "@marigold/system";
|
|
2929
2865
|
|
|
2930
2866
|
// src/Radio/Context.ts
|
|
2931
2867
|
import { createContext as createContext7, useContext as useContext7 } from "react";
|
|
@@ -2936,16 +2872,16 @@ var useRadioGroupContext = () => useContext7(RadioGroupContext);
|
|
|
2936
2872
|
|
|
2937
2873
|
// src/Radio/RadioGroup.tsx
|
|
2938
2874
|
import { RadioGroup } from "react-aria-components";
|
|
2939
|
-
import { cn as
|
|
2875
|
+
import { cn as cn32, useClassNames as useClassNames33 } from "@marigold/system";
|
|
2940
2876
|
|
|
2941
2877
|
// src/FieldBase/_FieldBase.tsx
|
|
2942
|
-
import { forwardRef as
|
|
2943
|
-
import { cn as
|
|
2878
|
+
import { forwardRef as forwardRef12 } from "react";
|
|
2879
|
+
import { cn as cn31, width as twWidth2, useClassNames as useClassNames32 } from "@marigold/system";
|
|
2944
2880
|
|
|
2945
2881
|
// src/HelpText/_HelpText.tsx
|
|
2946
2882
|
import { Text } from "react-aria-components";
|
|
2947
|
-
import { cn as
|
|
2948
|
-
import { Fragment as
|
|
2883
|
+
import { cn as cn30, useClassNames as useClassNames31 } from "@marigold/system";
|
|
2884
|
+
import { Fragment as Fragment8, jsx as jsx63, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2949
2885
|
var HelpText2 = ({
|
|
2950
2886
|
variant,
|
|
2951
2887
|
size,
|
|
@@ -2955,7 +2891,7 @@ var HelpText2 = ({
|
|
|
2955
2891
|
...props
|
|
2956
2892
|
}) => {
|
|
2957
2893
|
const hasErrorMessage = errorMessage && error;
|
|
2958
|
-
const classNames2 =
|
|
2894
|
+
const classNames2 = useClassNames31({
|
|
2959
2895
|
component: "HelpText",
|
|
2960
2896
|
variant,
|
|
2961
2897
|
size
|
|
@@ -2963,20 +2899,20 @@ var HelpText2 = ({
|
|
|
2963
2899
|
if (!description && !errorMessage) {
|
|
2964
2900
|
return null;
|
|
2965
2901
|
}
|
|
2966
|
-
return /* @__PURE__ */
|
|
2902
|
+
return /* @__PURE__ */ jsx63(
|
|
2967
2903
|
Text,
|
|
2968
2904
|
{
|
|
2969
2905
|
...props,
|
|
2970
2906
|
slot: hasErrorMessage ? "errorMessage" : "description",
|
|
2971
|
-
className:
|
|
2972
|
-
children: hasErrorMessage ? /* @__PURE__ */
|
|
2973
|
-
/* @__PURE__ */
|
|
2907
|
+
className: cn30("flex items-center gap-1", classNames2.container),
|
|
2908
|
+
children: hasErrorMessage ? /* @__PURE__ */ jsxs26(Fragment8, { children: [
|
|
2909
|
+
/* @__PURE__ */ jsx63(
|
|
2974
2910
|
"svg",
|
|
2975
2911
|
{
|
|
2976
|
-
className:
|
|
2912
|
+
className: cn30("h-4 w-4", classNames2.icon),
|
|
2977
2913
|
viewBox: "0 0 24 24",
|
|
2978
2914
|
role: "presentation",
|
|
2979
|
-
children: /* @__PURE__ */
|
|
2915
|
+
children: /* @__PURE__ */ jsx63("path", { d: "M2.25 20.3097H21.75L12 3.46875L2.25 20.3097ZM12.8864 17.2606H11.1136V15.4879H12.8864V17.2606ZM12.8864 13.7151H11.1136V10.1697H12.8864V13.7151Z" })
|
|
2980
2916
|
}
|
|
2981
2917
|
),
|
|
2982
2918
|
errorMessage
|
|
@@ -2986,8 +2922,8 @@ var HelpText2 = ({
|
|
|
2986
2922
|
};
|
|
2987
2923
|
|
|
2988
2924
|
// src/FieldBase/_FieldBase.tsx
|
|
2989
|
-
import { jsx as
|
|
2990
|
-
var fixedForwardRef =
|
|
2925
|
+
import { jsx as jsx64, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2926
|
+
var fixedForwardRef = forwardRef12;
|
|
2991
2927
|
var _FieldBase = (props, ref) => {
|
|
2992
2928
|
const {
|
|
2993
2929
|
as: Component = "div",
|
|
@@ -3000,21 +2936,21 @@ var _FieldBase = (props, ref) => {
|
|
|
3000
2936
|
errorMessage,
|
|
3001
2937
|
...rest
|
|
3002
2938
|
} = props;
|
|
3003
|
-
const classNames2 =
|
|
2939
|
+
const classNames2 = useClassNames32({
|
|
3004
2940
|
component: "Field",
|
|
3005
2941
|
variant,
|
|
3006
2942
|
size
|
|
3007
2943
|
});
|
|
3008
|
-
return /* @__PURE__ */
|
|
2944
|
+
return /* @__PURE__ */ jsxs27(
|
|
3009
2945
|
Component,
|
|
3010
2946
|
{
|
|
3011
2947
|
ref,
|
|
3012
|
-
className:
|
|
2948
|
+
className: cn31("group/field", twWidth2[width], classNames2),
|
|
3013
2949
|
...rest,
|
|
3014
2950
|
children: [
|
|
3015
|
-
label ? /* @__PURE__ */
|
|
2951
|
+
label ? /* @__PURE__ */ jsx64(_Label, { variant, size, children: label }) : /* @__PURE__ */ jsx64("span", { "aria-hidden": "true" }),
|
|
3016
2952
|
children,
|
|
3017
|
-
/* @__PURE__ */
|
|
2953
|
+
/* @__PURE__ */ jsx64(
|
|
3018
2954
|
HelpText2,
|
|
3019
2955
|
{
|
|
3020
2956
|
variant,
|
|
@@ -3031,7 +2967,7 @@ var _FieldBase = (props, ref) => {
|
|
|
3031
2967
|
var FieldBase2 = fixedForwardRef(_FieldBase);
|
|
3032
2968
|
|
|
3033
2969
|
// src/Radio/RadioGroup.tsx
|
|
3034
|
-
import { jsx as
|
|
2970
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
3035
2971
|
var _RadioGroup = ({
|
|
3036
2972
|
variant,
|
|
3037
2973
|
size,
|
|
@@ -3047,7 +2983,7 @@ var _RadioGroup = ({
|
|
|
3047
2983
|
width,
|
|
3048
2984
|
...rest
|
|
3049
2985
|
}) => {
|
|
3050
|
-
const classNames2 =
|
|
2986
|
+
const classNames2 = useClassNames33({ component: "Radio", variant, size });
|
|
3051
2987
|
const props = {
|
|
3052
2988
|
isDisabled: disabled,
|
|
3053
2989
|
isReadOnly: readOnly,
|
|
@@ -3055,7 +2991,7 @@ var _RadioGroup = ({
|
|
|
3055
2991
|
isInvalid: error,
|
|
3056
2992
|
...rest
|
|
3057
2993
|
};
|
|
3058
|
-
return /* @__PURE__ */
|
|
2994
|
+
return /* @__PURE__ */ jsx65(
|
|
3059
2995
|
FieldBase2,
|
|
3060
2996
|
{
|
|
3061
2997
|
as: RadioGroup,
|
|
@@ -3066,18 +3002,18 @@ var _RadioGroup = ({
|
|
|
3066
3002
|
variant,
|
|
3067
3003
|
size,
|
|
3068
3004
|
...props,
|
|
3069
|
-
children: /* @__PURE__ */
|
|
3005
|
+
children: /* @__PURE__ */ jsx65(
|
|
3070
3006
|
"div",
|
|
3071
3007
|
{
|
|
3072
3008
|
role: "presentation",
|
|
3073
3009
|
"data-testid": "group",
|
|
3074
3010
|
"data-orientation": orientation,
|
|
3075
|
-
className:
|
|
3011
|
+
className: cn32(
|
|
3076
3012
|
classNames2.group,
|
|
3077
3013
|
"flex items-start",
|
|
3078
3014
|
orientation === "vertical" ? "flex-col gap-[0.5ch]" : "flex-row gap-[1.5ch]"
|
|
3079
3015
|
),
|
|
3080
|
-
children: /* @__PURE__ */
|
|
3016
|
+
children: /* @__PURE__ */ jsx65(RadioGroupContext.Provider, { value: { width, variant, size }, children })
|
|
3081
3017
|
}
|
|
3082
3018
|
)
|
|
3083
3019
|
}
|
|
@@ -3085,33 +3021,33 @@ var _RadioGroup = ({
|
|
|
3085
3021
|
};
|
|
3086
3022
|
|
|
3087
3023
|
// src/Radio/Radio.tsx
|
|
3088
|
-
import { Fragment as
|
|
3089
|
-
var Dot = () => /* @__PURE__ */
|
|
3090
|
-
var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */
|
|
3024
|
+
import { Fragment as Fragment9, jsx as jsx66, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3025
|
+
var Dot = () => /* @__PURE__ */ jsx66("svg", { viewBox: "0 0 6 6", children: /* @__PURE__ */ jsx66("circle", { fill: "currentColor", cx: "3", cy: "3", r: "3" }) });
|
|
3026
|
+
var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */ jsx66(
|
|
3091
3027
|
"div",
|
|
3092
3028
|
{
|
|
3093
|
-
className:
|
|
3029
|
+
className: cn33(
|
|
3094
3030
|
"bg-secondary-50 flex h-4 w-4 items-center justify-center rounded-[50%] border p-1",
|
|
3095
3031
|
className
|
|
3096
3032
|
),
|
|
3097
3033
|
"aria-hidden": "true",
|
|
3098
3034
|
...props,
|
|
3099
|
-
children: checked ? /* @__PURE__ */
|
|
3035
|
+
children: checked ? /* @__PURE__ */ jsx66(Dot, {}) : null
|
|
3100
3036
|
}
|
|
3101
3037
|
);
|
|
3102
|
-
var _Radio =
|
|
3038
|
+
var _Radio = forwardRef13(
|
|
3103
3039
|
({ value, disabled, width, children, ...props }, ref) => {
|
|
3104
3040
|
const { variant, size, width: groupWidth } = useRadioGroupContext();
|
|
3105
|
-
const classNames2 =
|
|
3041
|
+
const classNames2 = useClassNames34({
|
|
3106
3042
|
component: "Radio",
|
|
3107
3043
|
variant: variant || props.variant,
|
|
3108
3044
|
size: size || props.size
|
|
3109
3045
|
});
|
|
3110
|
-
return /* @__PURE__ */
|
|
3046
|
+
return /* @__PURE__ */ jsx66(
|
|
3111
3047
|
Radio,
|
|
3112
3048
|
{
|
|
3113
3049
|
ref,
|
|
3114
|
-
className:
|
|
3050
|
+
className: cn33(
|
|
3115
3051
|
"group/radio",
|
|
3116
3052
|
"relative flex items-center gap-[1ch]",
|
|
3117
3053
|
width || groupWidth || "w-full",
|
|
@@ -3120,18 +3056,18 @@ var _Radio = forwardRef14(
|
|
|
3120
3056
|
value,
|
|
3121
3057
|
isDisabled: disabled,
|
|
3122
3058
|
...props,
|
|
3123
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
3124
|
-
/* @__PURE__ */
|
|
3059
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsxs28(Fragment9, { children: [
|
|
3060
|
+
/* @__PURE__ */ jsx66(
|
|
3125
3061
|
Icon2,
|
|
3126
3062
|
{
|
|
3127
3063
|
checked: isSelected,
|
|
3128
|
-
className:
|
|
3064
|
+
className: cn33(
|
|
3129
3065
|
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
3130
3066
|
classNames2.radio
|
|
3131
3067
|
)
|
|
3132
3068
|
}
|
|
3133
3069
|
),
|
|
3134
|
-
/* @__PURE__ */
|
|
3070
|
+
/* @__PURE__ */ jsx66("div", { className: classNames2.label, children })
|
|
3135
3071
|
] })
|
|
3136
3072
|
}
|
|
3137
3073
|
);
|
|
@@ -3139,6 +3075,153 @@ var _Radio = forwardRef14(
|
|
|
3139
3075
|
);
|
|
3140
3076
|
_Radio.Group = _RadioGroup;
|
|
3141
3077
|
|
|
3078
|
+
// src/Select/Select.tsx
|
|
3079
|
+
import {
|
|
3080
|
+
forwardRef as forwardRef14,
|
|
3081
|
+
useRef as useRef20
|
|
3082
|
+
} from "react";
|
|
3083
|
+
import { useButton as useButton5 } from "@react-aria/button";
|
|
3084
|
+
import { useFocusRing as useFocusRing7 } from "@react-aria/focus";
|
|
3085
|
+
import { useLocalizedStringFormatter } from "@react-aria/i18n";
|
|
3086
|
+
import { HiddenSelect, useSelect } from "@react-aria/select";
|
|
3087
|
+
import { mergeProps as mergeProps13, useObjectRef as useObjectRef6 } from "@react-aria/utils";
|
|
3088
|
+
import { Item as Item5, Section as Section2 } from "@react-stately/collections";
|
|
3089
|
+
import { useSelectState } from "@react-stately/select";
|
|
3090
|
+
import {
|
|
3091
|
+
cn as cn34,
|
|
3092
|
+
useClassNames as useClassNames35,
|
|
3093
|
+
useSmallScreen as useSmallScreen2,
|
|
3094
|
+
useStateProps as useStateProps13
|
|
3095
|
+
} from "@marigold/system";
|
|
3096
|
+
|
|
3097
|
+
// src/Select/intl.ts
|
|
3098
|
+
var messages = {
|
|
3099
|
+
"en-US": {
|
|
3100
|
+
placeholder: "Select an option\u2026"
|
|
3101
|
+
},
|
|
3102
|
+
"de-DE": {
|
|
3103
|
+
placeholder: "Option ausw\xE4hlen\u2026"
|
|
3104
|
+
}
|
|
3105
|
+
};
|
|
3106
|
+
|
|
3107
|
+
// src/Select/Select.tsx
|
|
3108
|
+
import { jsx as jsx67, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3109
|
+
var Select = forwardRef14(
|
|
3110
|
+
({
|
|
3111
|
+
variant,
|
|
3112
|
+
size,
|
|
3113
|
+
width,
|
|
3114
|
+
open,
|
|
3115
|
+
disabled,
|
|
3116
|
+
required,
|
|
3117
|
+
error,
|
|
3118
|
+
onChange,
|
|
3119
|
+
...rest
|
|
3120
|
+
}, ref) => {
|
|
3121
|
+
const formatMessage = useLocalizedStringFormatter(messages);
|
|
3122
|
+
const props = {
|
|
3123
|
+
isOpen: open,
|
|
3124
|
+
isDisabled: disabled,
|
|
3125
|
+
isRequired: required,
|
|
3126
|
+
validationState: error ? "invalid" : "valid",
|
|
3127
|
+
placeholder: rest.placeholder || formatMessage.format("placeholder"),
|
|
3128
|
+
onSelectionChange: onChange,
|
|
3129
|
+
...rest
|
|
3130
|
+
};
|
|
3131
|
+
const buttonRef = useObjectRef6(ref);
|
|
3132
|
+
const listboxRef = useRef20(null);
|
|
3133
|
+
const state = useSelectState(props);
|
|
3134
|
+
const {
|
|
3135
|
+
labelProps,
|
|
3136
|
+
triggerProps,
|
|
3137
|
+
valueProps,
|
|
3138
|
+
menuProps,
|
|
3139
|
+
descriptionProps,
|
|
3140
|
+
errorMessageProps
|
|
3141
|
+
} = useSelect(props, state, buttonRef);
|
|
3142
|
+
const { buttonProps } = useButton5(
|
|
3143
|
+
{ isDisabled: disabled, ...triggerProps },
|
|
3144
|
+
buttonRef
|
|
3145
|
+
);
|
|
3146
|
+
const { focusProps, isFocusVisible } = useFocusRing7();
|
|
3147
|
+
const classNames2 = useClassNames35({ component: "Select", variant, size });
|
|
3148
|
+
const isSmallScreen = useSmallScreen2();
|
|
3149
|
+
const stateProps = useStateProps13({
|
|
3150
|
+
disabled,
|
|
3151
|
+
error,
|
|
3152
|
+
focusVisible: isFocusVisible,
|
|
3153
|
+
expanded: state.isOpen,
|
|
3154
|
+
required
|
|
3155
|
+
});
|
|
3156
|
+
return /* @__PURE__ */ jsxs29(
|
|
3157
|
+
FieldBase,
|
|
3158
|
+
{
|
|
3159
|
+
variant,
|
|
3160
|
+
size,
|
|
3161
|
+
width,
|
|
3162
|
+
label: props.label,
|
|
3163
|
+
labelProps: { elementType: "span", ...labelProps },
|
|
3164
|
+
description: props.description,
|
|
3165
|
+
descriptionProps,
|
|
3166
|
+
error,
|
|
3167
|
+
errorMessage: props.errorMessage,
|
|
3168
|
+
errorMessageProps,
|
|
3169
|
+
stateProps,
|
|
3170
|
+
disabled,
|
|
3171
|
+
children: [
|
|
3172
|
+
/* @__PURE__ */ jsx67(
|
|
3173
|
+
HiddenSelect,
|
|
3174
|
+
{
|
|
3175
|
+
state,
|
|
3176
|
+
triggerRef: buttonRef,
|
|
3177
|
+
label: props.label,
|
|
3178
|
+
name: props.name,
|
|
3179
|
+
isDisabled: disabled
|
|
3180
|
+
}
|
|
3181
|
+
),
|
|
3182
|
+
/* @__PURE__ */ jsxs29(
|
|
3183
|
+
"button",
|
|
3184
|
+
{
|
|
3185
|
+
className: cn34(
|
|
3186
|
+
"flex w-full items-center justify-between gap-1 overflow-hidden",
|
|
3187
|
+
classNames2.select
|
|
3188
|
+
),
|
|
3189
|
+
ref: buttonRef,
|
|
3190
|
+
...mergeProps13(buttonProps, focusProps),
|
|
3191
|
+
...stateProps,
|
|
3192
|
+
children: [
|
|
3193
|
+
/* @__PURE__ */ jsx67("div", { className: "overflow-hidden whitespace-nowrap", ...valueProps, children: state.selectedItem ? state.selectedItem.rendered : props.placeholder }),
|
|
3194
|
+
/* @__PURE__ */ jsx67(ChevronDown, { className: "h-4 w-4" })
|
|
3195
|
+
]
|
|
3196
|
+
}
|
|
3197
|
+
),
|
|
3198
|
+
isSmallScreen ? /* @__PURE__ */ jsx67(Tray, { state, children: /* @__PURE__ */ jsx67(
|
|
3199
|
+
ListBox,
|
|
3200
|
+
{
|
|
3201
|
+
ref: listboxRef,
|
|
3202
|
+
state,
|
|
3203
|
+
variant,
|
|
3204
|
+
size,
|
|
3205
|
+
...menuProps
|
|
3206
|
+
}
|
|
3207
|
+
) }) : /* @__PURE__ */ jsx67(Popover, { state, triggerRef: buttonRef, scrollRef: listboxRef, children: /* @__PURE__ */ jsx67(
|
|
3208
|
+
ListBox,
|
|
3209
|
+
{
|
|
3210
|
+
ref: listboxRef,
|
|
3211
|
+
state,
|
|
3212
|
+
variant,
|
|
3213
|
+
size,
|
|
3214
|
+
...menuProps
|
|
3215
|
+
}
|
|
3216
|
+
) })
|
|
3217
|
+
]
|
|
3218
|
+
}
|
|
3219
|
+
);
|
|
3220
|
+
}
|
|
3221
|
+
);
|
|
3222
|
+
Select.Option = Item5;
|
|
3223
|
+
Select.Section = Section2;
|
|
3224
|
+
|
|
3142
3225
|
// src/Slider/Slider.tsx
|
|
3143
3226
|
import { forwardRef as forwardRef15 } from "react";
|
|
3144
3227
|
import {
|
|
@@ -3148,7 +3231,7 @@ import {
|
|
|
3148
3231
|
SliderTrack
|
|
3149
3232
|
} from "react-aria-components";
|
|
3150
3233
|
import {
|
|
3151
|
-
cn as
|
|
3234
|
+
cn as cn35,
|
|
3152
3235
|
width as twWidth3,
|
|
3153
3236
|
useClassNames as useClassNames36
|
|
3154
3237
|
} from "@marigold/system";
|
|
@@ -3174,7 +3257,7 @@ var _Slider = forwardRef15(
|
|
|
3174
3257
|
return /* @__PURE__ */ jsxs30(
|
|
3175
3258
|
Slider,
|
|
3176
3259
|
{
|
|
3177
|
-
className:
|
|
3260
|
+
className: cn35(
|
|
3178
3261
|
"grid grid-cols-[auto_1fr] gap-y-1",
|
|
3179
3262
|
classNames2.container,
|
|
3180
3263
|
twWidth3[width]
|
|
@@ -3183,15 +3266,15 @@ var _Slider = forwardRef15(
|
|
|
3183
3266
|
...props,
|
|
3184
3267
|
children: [
|
|
3185
3268
|
/* @__PURE__ */ jsx68(_Label, { children: props.children }),
|
|
3186
|
-
/* @__PURE__ */ jsx68(SliderOutput, { className:
|
|
3269
|
+
/* @__PURE__ */ jsx68(SliderOutput, { className: cn35("flex justify-end", classNames2.output), children: ({ state }) => state.values.map((_, i) => state.getThumbValueLabel(i)).join(" \u2013 ") }),
|
|
3187
3270
|
/* @__PURE__ */ jsx68(
|
|
3188
3271
|
SliderTrack,
|
|
3189
3272
|
{
|
|
3190
|
-
className:
|
|
3273
|
+
className: cn35("relative col-span-2 h-2 w-full", classNames2.track),
|
|
3191
3274
|
children: ({ state }) => state.values.map((_, i) => /* @__PURE__ */ jsx68(
|
|
3192
3275
|
SliderThumb,
|
|
3193
3276
|
{
|
|
3194
|
-
className:
|
|
3277
|
+
className: cn35("top-1/2 cursor-pointer", classNames2.thumb),
|
|
3195
3278
|
index: i,
|
|
3196
3279
|
"aria-label": thumbLabels == null ? void 0 : thumbLabels[i]
|
|
3197
3280
|
},
|
|
@@ -3212,7 +3295,7 @@ var Split = (props) => /* @__PURE__ */ jsx69("div", { ...props, role: "separator
|
|
|
3212
3295
|
// src/Stack/Stack.tsx
|
|
3213
3296
|
import {
|
|
3214
3297
|
alignment as alignment3,
|
|
3215
|
-
cn as
|
|
3298
|
+
cn as cn36,
|
|
3216
3299
|
gapSpace as gapSpace6
|
|
3217
3300
|
} from "@marigold/system";
|
|
3218
3301
|
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
@@ -3229,7 +3312,7 @@ var Stack = ({
|
|
|
3229
3312
|
return /* @__PURE__ */ jsx70(
|
|
3230
3313
|
"div",
|
|
3231
3314
|
{
|
|
3232
|
-
className:
|
|
3315
|
+
className: cn36(
|
|
3233
3316
|
"flex flex-col",
|
|
3234
3317
|
gapSpace6[space],
|
|
3235
3318
|
alignX && ((_b = (_a = alignment3) == null ? void 0 : _a.vertical) == null ? void 0 : _b.alignmentX[alignX]),
|
|
@@ -3246,7 +3329,7 @@ var Stack = ({
|
|
|
3246
3329
|
import { forwardRef as forwardRef16 } from "react";
|
|
3247
3330
|
import { Switch } from "react-aria-components";
|
|
3248
3331
|
import {
|
|
3249
|
-
cn as
|
|
3332
|
+
cn as cn37,
|
|
3250
3333
|
width as twWidth4,
|
|
3251
3334
|
useClassNames as useClassNames37
|
|
3252
3335
|
} from "@marigold/system";
|
|
@@ -3268,7 +3351,7 @@ var _Switch = forwardRef16(
|
|
|
3268
3351
|
{
|
|
3269
3352
|
...props,
|
|
3270
3353
|
ref,
|
|
3271
|
-
className:
|
|
3354
|
+
className: cn37(
|
|
3272
3355
|
twWidth4[width],
|
|
3273
3356
|
"group/switch",
|
|
3274
3357
|
"flex items-center justify-between gap-[1ch]",
|
|
@@ -3281,14 +3364,14 @@ var _Switch = forwardRef16(
|
|
|
3281
3364
|
/* @__PURE__ */ jsx71("div", { className: " relative", children: /* @__PURE__ */ jsx71(
|
|
3282
3365
|
"div",
|
|
3283
3366
|
{
|
|
3284
|
-
className:
|
|
3367
|
+
className: cn37(
|
|
3285
3368
|
"h-6 w-12 basis-12 rounded-3xl group-disabled/switch:cursor-not-allowed ",
|
|
3286
3369
|
classNames2.track
|
|
3287
3370
|
),
|
|
3288
3371
|
children: /* @__PURE__ */ jsx71(
|
|
3289
3372
|
"div",
|
|
3290
3373
|
{
|
|
3291
|
-
className:
|
|
3374
|
+
className: cn37(
|
|
3292
3375
|
"h-[22px] w-[22px]",
|
|
3293
3376
|
"cubic-bezier(.7,0,.3,1)",
|
|
3294
3377
|
"absolute left-0 top-px",
|
|
@@ -3307,7 +3390,7 @@ var _Switch = forwardRef16(
|
|
|
3307
3390
|
);
|
|
3308
3391
|
|
|
3309
3392
|
// src/Table/Table.tsx
|
|
3310
|
-
import { useRef as
|
|
3393
|
+
import { useRef as useRef27 } from "react";
|
|
3311
3394
|
import { useTable } from "@react-aria/table";
|
|
3312
3395
|
import {
|
|
3313
3396
|
TableBody as Body2,
|
|
@@ -3317,7 +3400,7 @@ import {
|
|
|
3317
3400
|
Row,
|
|
3318
3401
|
useTableState
|
|
3319
3402
|
} from "@react-stately/table";
|
|
3320
|
-
import { cn as
|
|
3403
|
+
import { cn as cn42, useClassNames as useClassNames39 } from "@marigold/system";
|
|
3321
3404
|
|
|
3322
3405
|
// src/Table/Context.tsx
|
|
3323
3406
|
import { createContext as createContext8, useContext as useContext8 } from "react";
|
|
@@ -3333,14 +3416,14 @@ var TableBody = ({ children }) => {
|
|
|
3333
3416
|
};
|
|
3334
3417
|
|
|
3335
3418
|
// src/Table/TableCell.tsx
|
|
3336
|
-
import { useRef as
|
|
3419
|
+
import { useRef as useRef21 } from "react";
|
|
3337
3420
|
import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
|
|
3338
3421
|
import { useTableCell } from "@react-aria/table";
|
|
3339
3422
|
import { mergeProps as mergeProps14 } from "@react-aria/utils";
|
|
3340
3423
|
import { useStateProps as useStateProps14 } from "@marigold/system";
|
|
3341
3424
|
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
3342
3425
|
var TableCell = ({ cell }) => {
|
|
3343
|
-
const ref =
|
|
3426
|
+
const ref = useRef21(null);
|
|
3344
3427
|
const { interactive, state, classNames: classNames2 } = useTableContext();
|
|
3345
3428
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
3346
3429
|
const { gridCellProps } = useTableCell(
|
|
@@ -3374,11 +3457,11 @@ var TableCell = ({ cell }) => {
|
|
|
3374
3457
|
};
|
|
3375
3458
|
|
|
3376
3459
|
// src/Table/TableCheckboxCell.tsx
|
|
3377
|
-
import { useRef as
|
|
3460
|
+
import { useRef as useRef22 } from "react";
|
|
3378
3461
|
import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
|
|
3379
3462
|
import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
|
|
3380
3463
|
import { mergeProps as mergeProps15 } from "@react-aria/utils";
|
|
3381
|
-
import { cn as
|
|
3464
|
+
import { cn as cn38, useStateProps as useStateProps15 } from "@marigold/system";
|
|
3382
3465
|
|
|
3383
3466
|
// src/Table/utils.ts
|
|
3384
3467
|
var mapCheckboxProps = ({
|
|
@@ -3403,7 +3486,7 @@ var mapCheckboxProps = ({
|
|
|
3403
3486
|
// src/Table/TableCheckboxCell.tsx
|
|
3404
3487
|
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
3405
3488
|
var TableCheckboxCell = ({ cell }) => {
|
|
3406
|
-
const ref =
|
|
3489
|
+
const ref = useRef22(null);
|
|
3407
3490
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3408
3491
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
3409
3492
|
const { gridCellProps } = useTableCell2(
|
|
@@ -3422,7 +3505,7 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
3422
3505
|
"td",
|
|
3423
3506
|
{
|
|
3424
3507
|
ref,
|
|
3425
|
-
className:
|
|
3508
|
+
className: cn38("text-center align-middle leading-none", classNames2 == null ? void 0 : classNames2.cell),
|
|
3426
3509
|
...mergeProps15(gridCellProps, focusProps),
|
|
3427
3510
|
...stateProps,
|
|
3428
3511
|
children: /* @__PURE__ */ jsx74(_Checkbox, { ...checkboxProps })
|
|
@@ -3431,13 +3514,13 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
3431
3514
|
};
|
|
3432
3515
|
|
|
3433
3516
|
// src/Table/TableColumnHeader.tsx
|
|
3434
|
-
import { useRef as
|
|
3517
|
+
import { useRef as useRef23 } from "react";
|
|
3435
3518
|
import { useFocusRing as useFocusRing10 } from "@react-aria/focus";
|
|
3436
3519
|
import { useHover as useHover6 } from "@react-aria/interactions";
|
|
3437
3520
|
import { useTableColumnHeader } from "@react-aria/table";
|
|
3438
3521
|
import { mergeProps as mergeProps16 } from "@react-aria/utils";
|
|
3439
3522
|
import { SortDown, SortUp } from "@marigold/icons";
|
|
3440
|
-
import { cn as
|
|
3523
|
+
import { cn as cn39, useStateProps as useStateProps16 } from "@marigold/system";
|
|
3441
3524
|
import { width as twWidth5 } from "@marigold/system";
|
|
3442
3525
|
import { jsx as jsx75, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3443
3526
|
var TableColumnHeader = ({
|
|
@@ -3445,7 +3528,7 @@ var TableColumnHeader = ({
|
|
|
3445
3528
|
width = "auto"
|
|
3446
3529
|
}) => {
|
|
3447
3530
|
var _a, _b;
|
|
3448
|
-
const ref =
|
|
3531
|
+
const ref = useRef23(null);
|
|
3449
3532
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3450
3533
|
const { columnHeaderProps } = useTableColumnHeader(
|
|
3451
3534
|
{
|
|
@@ -3465,7 +3548,7 @@ var TableColumnHeader = ({
|
|
|
3465
3548
|
{
|
|
3466
3549
|
colSpan: column.colspan,
|
|
3467
3550
|
ref,
|
|
3468
|
-
className:
|
|
3551
|
+
className: cn39("cursor-default", twWidth5[width], classNames2 == null ? void 0 : classNames2.header),
|
|
3469
3552
|
...mergeProps16(columnHeaderProps, hoverProps, focusProps),
|
|
3470
3553
|
...stateProps,
|
|
3471
3554
|
children: [
|
|
@@ -3485,26 +3568,26 @@ var TableHeader = ({ children }) => {
|
|
|
3485
3568
|
};
|
|
3486
3569
|
|
|
3487
3570
|
// src/Table/TableHeaderRow.tsx
|
|
3488
|
-
import { useRef as
|
|
3571
|
+
import { useRef as useRef24 } from "react";
|
|
3489
3572
|
import { useTableHeaderRow } from "@react-aria/table";
|
|
3490
3573
|
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
3491
3574
|
var TableHeaderRow = ({ item, children }) => {
|
|
3492
3575
|
const { state } = useTableContext();
|
|
3493
|
-
const ref =
|
|
3576
|
+
const ref = useRef24(null);
|
|
3494
3577
|
const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
|
|
3495
3578
|
return /* @__PURE__ */ jsx77("tr", { ...rowProps, ref, children });
|
|
3496
3579
|
};
|
|
3497
3580
|
|
|
3498
3581
|
// src/Table/TableRow.tsx
|
|
3499
|
-
import { useRef as
|
|
3582
|
+
import { useRef as useRef25 } from "react";
|
|
3500
3583
|
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
3501
3584
|
import { useHover as useHover7 } from "@react-aria/interactions";
|
|
3502
3585
|
import { useTableRow } from "@react-aria/table";
|
|
3503
3586
|
import { mergeProps as mergeProps17 } from "@react-aria/utils";
|
|
3504
|
-
import { cn as
|
|
3587
|
+
import { cn as cn40, useClassNames as useClassNames38, useStateProps as useStateProps17 } from "@marigold/system";
|
|
3505
3588
|
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
3506
3589
|
var TableRow = ({ children, row }) => {
|
|
3507
|
-
const ref =
|
|
3590
|
+
const ref = useRef25(null);
|
|
3508
3591
|
const { interactive, state, ...ctx } = useTableContext();
|
|
3509
3592
|
const { variant, size } = row.props;
|
|
3510
3593
|
const classNames2 = useClassNames38({
|
|
@@ -3536,7 +3619,7 @@ var TableRow = ({ children, row }) => {
|
|
|
3536
3619
|
"tr",
|
|
3537
3620
|
{
|
|
3538
3621
|
ref,
|
|
3539
|
-
className:
|
|
3622
|
+
className: cn40(
|
|
3540
3623
|
[
|
|
3541
3624
|
!interactive ? "cursor-text" : disabled ? "cursor-default" : "cursor-pointer"
|
|
3542
3625
|
],
|
|
@@ -3550,7 +3633,7 @@ var TableRow = ({ children, row }) => {
|
|
|
3550
3633
|
};
|
|
3551
3634
|
|
|
3552
3635
|
// src/Table/TableSelectAllCell.tsx
|
|
3553
|
-
import { useRef as
|
|
3636
|
+
import { useRef as useRef26 } from "react";
|
|
3554
3637
|
import { useFocusRing as useFocusRing12 } from "@react-aria/focus";
|
|
3555
3638
|
import { useHover as useHover8 } from "@react-aria/interactions";
|
|
3556
3639
|
import {
|
|
@@ -3559,7 +3642,7 @@ import {
|
|
|
3559
3642
|
} from "@react-aria/table";
|
|
3560
3643
|
import { mergeProps as mergeProps18 } from "@react-aria/utils";
|
|
3561
3644
|
import {
|
|
3562
|
-
cn as
|
|
3645
|
+
cn as cn41,
|
|
3563
3646
|
width as twWidth6,
|
|
3564
3647
|
useStateProps as useStateProps18
|
|
3565
3648
|
} from "@marigold/system";
|
|
@@ -3568,7 +3651,7 @@ var TableSelectAllCell = ({
|
|
|
3568
3651
|
column,
|
|
3569
3652
|
width = "auto"
|
|
3570
3653
|
}) => {
|
|
3571
|
-
const ref =
|
|
3654
|
+
const ref = useRef26(null);
|
|
3572
3655
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3573
3656
|
const { columnHeaderProps } = useTableColumnHeader2(
|
|
3574
3657
|
{
|
|
@@ -3588,7 +3671,7 @@ var TableSelectAllCell = ({
|
|
|
3588
3671
|
"th",
|
|
3589
3672
|
{
|
|
3590
3673
|
ref,
|
|
3591
|
-
className:
|
|
3674
|
+
className: cn41(
|
|
3592
3675
|
twWidth6[width],
|
|
3593
3676
|
["text-center align-middle leading-none"],
|
|
3594
3677
|
classNames2 == null ? void 0 : classNames2.header
|
|
@@ -3610,7 +3693,7 @@ var Table = ({
|
|
|
3610
3693
|
...props
|
|
3611
3694
|
}) => {
|
|
3612
3695
|
const interactive = selectionMode !== "none";
|
|
3613
|
-
const tableRef =
|
|
3696
|
+
const tableRef = useRef27(null);
|
|
3614
3697
|
const state = useTableState({
|
|
3615
3698
|
...props,
|
|
3616
3699
|
selectionMode,
|
|
@@ -3632,7 +3715,7 @@ var Table = ({
|
|
|
3632
3715
|
"table",
|
|
3633
3716
|
{
|
|
3634
3717
|
ref: tableRef,
|
|
3635
|
-
className:
|
|
3718
|
+
className: cn42(
|
|
3636
3719
|
"group/table",
|
|
3637
3720
|
"border-collapse overflow-auto whitespace-nowrap",
|
|
3638
3721
|
stretch ? "table w-full" : "block",
|
|
@@ -3684,7 +3767,7 @@ Table.Row = Row;
|
|
|
3684
3767
|
|
|
3685
3768
|
// src/Text/Text.tsx
|
|
3686
3769
|
import {
|
|
3687
|
-
cn as
|
|
3770
|
+
cn as cn43,
|
|
3688
3771
|
createVar as createVar9,
|
|
3689
3772
|
cursorStyle,
|
|
3690
3773
|
fontWeight,
|
|
@@ -3718,7 +3801,7 @@ var Text2 = ({
|
|
|
3718
3801
|
"p",
|
|
3719
3802
|
{
|
|
3720
3803
|
...props,
|
|
3721
|
-
className:
|
|
3804
|
+
className: cn43(
|
|
3722
3805
|
classNames2,
|
|
3723
3806
|
"text-[--color] outline-[--outline]",
|
|
3724
3807
|
fontStyle && textStyle[fontStyle],
|
|
@@ -3878,7 +3961,7 @@ var TextField = forwardRef18(
|
|
|
3878
3961
|
);
|
|
3879
3962
|
|
|
3880
3963
|
// src/Tiles/Tiles.tsx
|
|
3881
|
-
import { cn as
|
|
3964
|
+
import { cn as cn44, createVar as createVar10, gapSpace as gapSpace7 } from "@marigold/system";
|
|
3882
3965
|
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
3883
3966
|
var Tiles = ({
|
|
3884
3967
|
space = 0,
|
|
@@ -3896,7 +3979,7 @@ var Tiles = ({
|
|
|
3896
3979
|
"div",
|
|
3897
3980
|
{
|
|
3898
3981
|
...props,
|
|
3899
|
-
className:
|
|
3982
|
+
className: cn44(
|
|
3900
3983
|
"grid",
|
|
3901
3984
|
gapSpace7[space],
|
|
3902
3985
|
"grid-cols-[repeat(auto-fit,var(--column))]",
|
|
@@ -3910,7 +3993,7 @@ var Tiles = ({
|
|
|
3910
3993
|
|
|
3911
3994
|
// src/Tooltip/Tooltip.tsx
|
|
3912
3995
|
import { useTooltip } from "@react-aria/tooltip";
|
|
3913
|
-
import { cn as
|
|
3996
|
+
import { cn as cn45, useClassNames as useClassNames42 } from "@marigold/system";
|
|
3914
3997
|
|
|
3915
3998
|
// src/Tooltip/Context.ts
|
|
3916
3999
|
import { createContext as createContext9, useContext as useContext9 } from "react";
|
|
@@ -3918,7 +4001,7 @@ var TooltipContext = createContext9({});
|
|
|
3918
4001
|
var useTooltipContext = () => useContext9(TooltipContext);
|
|
3919
4002
|
|
|
3920
4003
|
// src/Tooltip/TooltipTrigger.tsx
|
|
3921
|
-
import { Children as Children7, useRef as
|
|
4004
|
+
import { Children as Children7, useRef as useRef28 } from "react";
|
|
3922
4005
|
import { FocusableProvider } from "@react-aria/focus";
|
|
3923
4006
|
import { useOverlayPosition } from "@react-aria/overlays";
|
|
3924
4007
|
import { useTooltipTrigger } from "@react-aria/tooltip";
|
|
@@ -3940,8 +4023,8 @@ var TooltipTrigger = ({
|
|
|
3940
4023
|
delay,
|
|
3941
4024
|
placement
|
|
3942
4025
|
};
|
|
3943
|
-
const tooltipTriggerRef =
|
|
3944
|
-
const overlayRef =
|
|
4026
|
+
const tooltipTriggerRef = useRef28(null);
|
|
4027
|
+
const overlayRef = useRef28(null);
|
|
3945
4028
|
const state = useTooltipTriggerState(props);
|
|
3946
4029
|
const { triggerProps, tooltipProps } = useTooltipTrigger(
|
|
3947
4030
|
props,
|
|
@@ -3991,7 +4074,7 @@ var Tooltip = ({ children, variant, size }) => {
|
|
|
3991
4074
|
...tooltipProps,
|
|
3992
4075
|
...rest,
|
|
3993
4076
|
ref: overlayRef,
|
|
3994
|
-
className:
|
|
4077
|
+
className: cn45("group/tooltip", classNames2.container),
|
|
3995
4078
|
"data-placement": placement,
|
|
3996
4079
|
children: [
|
|
3997
4080
|
/* @__PURE__ */ jsx86("div", { children }),
|
|
@@ -3999,7 +4082,7 @@ var Tooltip = ({ children, variant, size }) => {
|
|
|
3999
4082
|
"div",
|
|
4000
4083
|
{
|
|
4001
4084
|
...arrowProps,
|
|
4002
|
-
className:
|
|
4085
|
+
className: cn45("absolute h-0 w-0", classNames2.arrow)
|
|
4003
4086
|
}
|
|
4004
4087
|
)
|
|
4005
4088
|
]
|
|
@@ -4012,21 +4095,21 @@ Tooltip.Trigger = TooltipTrigger;
|
|
|
4012
4095
|
import { Item as Item6 } from "@react-stately/collections";
|
|
4013
4096
|
|
|
4014
4097
|
// src/TagGroup/TagGroup.tsx
|
|
4015
|
-
import { useRef as
|
|
4098
|
+
import { useRef as useRef30 } from "react";
|
|
4016
4099
|
import { useTagGroup } from "@react-aria/tag";
|
|
4017
4100
|
import { useListState } from "@react-stately/list";
|
|
4018
4101
|
import { useStateProps as useStateProps21 } from "@marigold/system";
|
|
4019
4102
|
|
|
4020
4103
|
// src/TagGroup/Tag.tsx
|
|
4021
|
-
import React3, { useRef as
|
|
4104
|
+
import React3, { useRef as useRef29 } from "react";
|
|
4022
4105
|
import { useButton as useButton6 } from "@react-aria/button";
|
|
4023
4106
|
import { useFocusRing as useFocusRing15 } from "@react-aria/focus";
|
|
4024
4107
|
import { useTag } from "@react-aria/tag";
|
|
4025
4108
|
import { mergeProps as mergeProps20 } from "@react-aria/utils";
|
|
4026
|
-
import { cn as
|
|
4109
|
+
import { cn as cn46, useClassNames as useClassNames43 } from "@marigold/system";
|
|
4027
4110
|
import { jsx as jsx87, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4028
4111
|
var CloseButton2 = ({ className, ...props }) => {
|
|
4029
|
-
const ref =
|
|
4112
|
+
const ref = useRef29(null);
|
|
4030
4113
|
const { buttonProps } = useButton6({ ...props }, ref);
|
|
4031
4114
|
return /* @__PURE__ */ jsx87("button", { className, ...buttonProps, children: /* @__PURE__ */ jsx87("svg", { viewBox: "0 0 20 20", fill: "currentColor", width: 20, height: 20, children: /* @__PURE__ */ jsx87("path", { d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" }) }) });
|
|
4032
4115
|
};
|
|
@@ -4058,7 +4141,7 @@ var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
|
4058
4141
|
CloseButton2,
|
|
4059
4142
|
{
|
|
4060
4143
|
...removeButtonProps,
|
|
4061
|
-
className:
|
|
4144
|
+
className: cn46("flex items-center", classNames2.closeButton)
|
|
4062
4145
|
}
|
|
4063
4146
|
)
|
|
4064
4147
|
] })
|
|
@@ -4081,7 +4164,7 @@ var TagGroup = ({
|
|
|
4081
4164
|
validationState: error ? "invalid" : "valid",
|
|
4082
4165
|
...rest
|
|
4083
4166
|
};
|
|
4084
|
-
const inputRef =
|
|
4167
|
+
const inputRef = useRef30(null);
|
|
4085
4168
|
const state = useListState(props);
|
|
4086
4169
|
const { gridProps, labelProps, descriptionProps, errorMessageProps } = useTagGroup(props, state, inputRef);
|
|
4087
4170
|
const stateProps = useStateProps21({
|
|
@@ -4350,11 +4433,11 @@ var XLoader = forwardRef19((props, ref) => /* @__PURE__ */ jsxs37(
|
|
|
4350
4433
|
));
|
|
4351
4434
|
|
|
4352
4435
|
// src/Tabs/Tabs.tsx
|
|
4353
|
-
import { useRef as
|
|
4436
|
+
import { useRef as useRef33 } from "react";
|
|
4354
4437
|
import { useTabList } from "@react-aria/tabs";
|
|
4355
4438
|
import { Item as Item7 } from "@react-stately/collections";
|
|
4356
4439
|
import { useTabListState } from "@react-stately/tabs";
|
|
4357
|
-
import { cn as
|
|
4440
|
+
import { cn as cn49, gapSpace as gapSpace8, useClassNames as useClassNames44 } from "@marigold/system";
|
|
4358
4441
|
|
|
4359
4442
|
// src/Tabs/Context.ts
|
|
4360
4443
|
import { createContext as createContext10, useContext as useContext10 } from "react";
|
|
@@ -4362,15 +4445,15 @@ var TabContext = createContext10({});
|
|
|
4362
4445
|
var useTabContext = () => useContext10(TabContext);
|
|
4363
4446
|
|
|
4364
4447
|
// src/Tabs/Tab.tsx
|
|
4365
|
-
import { useRef as
|
|
4448
|
+
import { useRef as useRef31 } from "react";
|
|
4366
4449
|
import { useFocus, useHover as useHover11 } from "@react-aria/interactions";
|
|
4367
4450
|
import { useTab } from "@react-aria/tabs";
|
|
4368
4451
|
import { mergeProps as mergeProps21 } from "@react-aria/utils";
|
|
4369
|
-
import { cn as
|
|
4452
|
+
import { cn as cn47, useStateProps as useStateProps22 } from "@marigold/system";
|
|
4370
4453
|
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
4371
4454
|
var Tab = ({ item, state }) => {
|
|
4372
4455
|
const { key, rendered } = item;
|
|
4373
|
-
const ref =
|
|
4456
|
+
const ref = useRef31(null);
|
|
4374
4457
|
const { tabProps, isSelected } = useTab({ key }, state, ref);
|
|
4375
4458
|
const disabled = tabProps["aria-disabled"];
|
|
4376
4459
|
const { hoverProps, isHovered } = useHover11({
|
|
@@ -4382,7 +4465,7 @@ var Tab = ({ item, state }) => {
|
|
|
4382
4465
|
return /* @__PURE__ */ jsx90(
|
|
4383
4466
|
"div",
|
|
4384
4467
|
{
|
|
4385
|
-
className:
|
|
4468
|
+
className: cn47(
|
|
4386
4469
|
"flex cursor-pointer justify-center aria-disabled:cursor-not-allowed",
|
|
4387
4470
|
classNames2.tab
|
|
4388
4471
|
),
|
|
@@ -4394,17 +4477,17 @@ var Tab = ({ item, state }) => {
|
|
|
4394
4477
|
};
|
|
4395
4478
|
|
|
4396
4479
|
// src/Tabs/TabPanel.tsx
|
|
4397
|
-
import { useRef as
|
|
4480
|
+
import { useRef as useRef32 } from "react";
|
|
4398
4481
|
import { useTabPanel } from "@react-aria/tabs";
|
|
4399
|
-
import { cn as
|
|
4482
|
+
import { cn as cn48 } from "@marigold/system";
|
|
4400
4483
|
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
4401
4484
|
var TabPanel = ({ state, ...props }) => {
|
|
4402
4485
|
var _a;
|
|
4403
|
-
const ref =
|
|
4486
|
+
const ref = useRef32(null);
|
|
4404
4487
|
const { tabPanelProps } = useTabPanel(props, state, ref);
|
|
4405
4488
|
const selectedItemProps = (_a = state.selectedItem) == null ? void 0 : _a.props;
|
|
4406
4489
|
const { classNames: classNames2 } = useTabContext();
|
|
4407
|
-
return /* @__PURE__ */ jsx91("div", { className:
|
|
4490
|
+
return /* @__PURE__ */ jsx91("div", { className: cn48(classNames2.tabpanel), ref, ...tabPanelProps, children: selectedItemProps == null ? void 0 : selectedItemProps.children });
|
|
4408
4491
|
};
|
|
4409
4492
|
|
|
4410
4493
|
// src/Tabs/Tabs.tsx
|
|
@@ -4417,7 +4500,7 @@ var Tabs = ({
|
|
|
4417
4500
|
...rest
|
|
4418
4501
|
}) => {
|
|
4419
4502
|
var _a;
|
|
4420
|
-
const ref =
|
|
4503
|
+
const ref = useRef33(null);
|
|
4421
4504
|
const props = {
|
|
4422
4505
|
isDisabled: disabled,
|
|
4423
4506
|
...rest
|
|
@@ -4429,11 +4512,11 @@ var Tabs = ({
|
|
|
4429
4512
|
size,
|
|
4430
4513
|
variant
|
|
4431
4514
|
});
|
|
4432
|
-
return /* @__PURE__ */ jsx92(TabContext.Provider, { value: { classNames: classNames2 }, children: /* @__PURE__ */ jsxs38("div", { className:
|
|
4515
|
+
return /* @__PURE__ */ jsx92(TabContext.Provider, { value: { classNames: classNames2 }, children: /* @__PURE__ */ jsxs38("div", { className: cn49(classNames2.container), children: [
|
|
4433
4516
|
/* @__PURE__ */ jsx92(
|
|
4434
4517
|
"div",
|
|
4435
4518
|
{
|
|
4436
|
-
className:
|
|
4519
|
+
className: cn49("flex", gapSpace8[space], classNames2.tabs),
|
|
4437
4520
|
...tabListProps,
|
|
4438
4521
|
ref,
|
|
4439
4522
|
children: [...state.collection].map((item) => {
|
|
@@ -4475,7 +4558,7 @@ export {
|
|
|
4475
4558
|
FieldGroup,
|
|
4476
4559
|
FieldGroupContext,
|
|
4477
4560
|
Footer,
|
|
4478
|
-
Header,
|
|
4561
|
+
_Header as Header,
|
|
4479
4562
|
_Headline as Headline,
|
|
4480
4563
|
Image,
|
|
4481
4564
|
Inline,
|