@lindle/linoardo 1.0.40 → 1.0.41
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/{ExpansionPanelItem-CFm8a8R_.d.ts → ExpansionPanelItem-C4-2nlhq.d.ts} +1 -1
- package/dist/{ExpansionPanelItem-ufS2RIZf.d.cts → ExpansionPanelItem-CEhDj2Uw.d.cts} +1 -1
- package/dist/badge.d.cts +1 -1
- package/dist/badge.d.ts +1 -1
- package/dist/block.d.cts +1 -1
- package/dist/block.d.ts +1 -1
- package/dist/button.d.cts +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/card.d.cts +1 -1
- package/dist/card.d.ts +1 -1
- package/dist/chip.d.cts +12 -12
- package/dist/chip.d.ts +12 -12
- package/dist/expansion-panel/item.d.cts +2 -2
- package/dist/expansion-panel/item.d.ts +2 -2
- package/dist/expansion-panel.d.cts +3 -3
- package/dist/expansion-panel.d.ts +3 -3
- package/dist/{global.types-D-o85tuX.d.cts → global.types-gx9A7mUe.d.cts} +1 -1
- package/dist/{global.types-D-o85tuX.d.ts → global.types-gx9A7mUe.d.ts} +1 -1
- package/dist/hero.d.cts +1 -1
- package/dist/hero.d.ts +1 -1
- package/dist/icon.d.cts +1 -1
- package/dist/icon.d.ts +1 -1
- package/dist/{index-B7xZzSwm.d.cts → index-BDrBOeFI.d.cts} +1 -1
- package/dist/{index-BhfThlf0.d.ts → index-CNwl6vmH.d.ts} +1 -1
- package/dist/index.cjs +412 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -6
- package/dist/index.d.ts +60 -6
- package/dist/index.js +405 -3
- package/dist/index.js.map +1 -1
- package/dist/input.d.cts +2 -2
- package/dist/input.d.ts +2 -2
- package/dist/list/item.d.cts +2 -2
- package/dist/list/item.d.ts +2 -2
- package/dist/list.d.cts +3 -3
- package/dist/list.d.ts +3 -3
- package/dist/notification.d.cts +1 -1
- package/dist/notification.d.ts +1 -1
- package/dist/profileCard.d.cts +1 -1
- package/dist/profileCard.d.ts +1 -1
- package/dist/select.d.cts +2 -2
- package/dist/select.d.ts +2 -2
- package/dist/slider.d.cts +1 -1
- package/dist/slider.d.ts +1 -1
- package/dist/styles.css +34 -0
- package/dist/switch.d.cts +1 -1
- package/dist/switch.d.ts +1 -1
- package/dist/timeline.d.cts +1 -1
- package/dist/timeline.d.ts +1 -1
- package/dist/{types-DqPSePni.d.cts → types-CJ0zqPXF.d.cts} +1 -1
- package/dist/{types-CbQEphC3.d.ts → types-DaTHYIPO.d.ts} +1 -1
- package/package.json +7 -1
package/dist/index.cjs
CHANGED
|
@@ -1843,6 +1843,405 @@ function resolveItemContent(item, index, renderItem) {
|
|
|
1843
1843
|
}
|
|
1844
1844
|
return item;
|
|
1845
1845
|
}
|
|
1846
|
+
var TABS_TAB_MARKER = "__isTabsTab";
|
|
1847
|
+
var hasMarker2 = (type) => {
|
|
1848
|
+
if (!type || typeof type !== "function" && typeof type !== "object") {
|
|
1849
|
+
return false;
|
|
1850
|
+
}
|
|
1851
|
+
if (type[TABS_TAB_MARKER]) {
|
|
1852
|
+
return true;
|
|
1853
|
+
}
|
|
1854
|
+
const innerType = type.type;
|
|
1855
|
+
if (innerType && innerType !== type) {
|
|
1856
|
+
return hasMarker2(innerType);
|
|
1857
|
+
}
|
|
1858
|
+
return false;
|
|
1859
|
+
};
|
|
1860
|
+
var isTabsTabElement = (element) => {
|
|
1861
|
+
if (!React4.isValidElement(element)) {
|
|
1862
|
+
return false;
|
|
1863
|
+
}
|
|
1864
|
+
return hasMarker2(element.type);
|
|
1865
|
+
};
|
|
1866
|
+
var markTabsTab = (component) => {
|
|
1867
|
+
if (typeof component !== "function" && (typeof component !== "object" || component === null)) {
|
|
1868
|
+
return;
|
|
1869
|
+
}
|
|
1870
|
+
component[TABS_TAB_MARKER] = true;
|
|
1871
|
+
};
|
|
1872
|
+
var sizeClasses2 = {
|
|
1873
|
+
"x-small": { tab: "h-7 px-2 text-xs", icon: "text-sm" },
|
|
1874
|
+
small: { tab: "h-8 px-2.5 text-sm", icon: "text-base" },
|
|
1875
|
+
medium: { tab: "h-9 px-3 text-sm", icon: "text-base" },
|
|
1876
|
+
large: { tab: "h-10 px-3.5 text-base", icon: "text-lg" },
|
|
1877
|
+
"x-large": { tab: "h-11 px-4 text-base", icon: "text-lg" }
|
|
1878
|
+
};
|
|
1879
|
+
var variantListClasses = {
|
|
1880
|
+
line: "border-b border-gray-200",
|
|
1881
|
+
card: "rounded-xl bg-gray-100 p-1",
|
|
1882
|
+
pill: "rounded-full bg-gray-100/80 p-1"
|
|
1883
|
+
};
|
|
1884
|
+
var variantTabBaseClasses = {
|
|
1885
|
+
line: "border-b-2 border-transparent -mb-px",
|
|
1886
|
+
card: "rounded-lg border border-transparent bg-white/70",
|
|
1887
|
+
pill: "rounded-full"
|
|
1888
|
+
};
|
|
1889
|
+
var paletteClasses = {
|
|
1890
|
+
primary: {
|
|
1891
|
+
text: "text-primary",
|
|
1892
|
+
border: "border-primary",
|
|
1893
|
+
bg: "bg-primary/10",
|
|
1894
|
+
ring: "ring-primary/30",
|
|
1895
|
+
ink: "bg-primary"
|
|
1896
|
+
},
|
|
1897
|
+
neutral: {
|
|
1898
|
+
text: "text-gray-900",
|
|
1899
|
+
border: "border-gray-900",
|
|
1900
|
+
bg: "bg-gray-100",
|
|
1901
|
+
ring: "ring-gray-900/20",
|
|
1902
|
+
ink: "bg-gray-900"
|
|
1903
|
+
},
|
|
1904
|
+
info: {
|
|
1905
|
+
text: "text-sky-600",
|
|
1906
|
+
border: "border-sky-500",
|
|
1907
|
+
bg: "bg-sky-50",
|
|
1908
|
+
ring: "ring-sky-500/20",
|
|
1909
|
+
ink: "bg-sky-500"
|
|
1910
|
+
},
|
|
1911
|
+
success: {
|
|
1912
|
+
text: "text-emerald-600",
|
|
1913
|
+
border: "border-emerald-500",
|
|
1914
|
+
bg: "bg-emerald-50",
|
|
1915
|
+
ring: "ring-emerald-500/20",
|
|
1916
|
+
ink: "bg-emerald-500"
|
|
1917
|
+
},
|
|
1918
|
+
warning: {
|
|
1919
|
+
text: "text-amber-600",
|
|
1920
|
+
border: "border-amber-500",
|
|
1921
|
+
bg: "bg-amber-50",
|
|
1922
|
+
ring: "ring-amber-500/20",
|
|
1923
|
+
ink: "bg-amber-500"
|
|
1924
|
+
},
|
|
1925
|
+
danger: {
|
|
1926
|
+
text: "text-red-600",
|
|
1927
|
+
border: "border-red-500",
|
|
1928
|
+
bg: "bg-red-50",
|
|
1929
|
+
ring: "ring-red-500/20",
|
|
1930
|
+
ink: "bg-red-500"
|
|
1931
|
+
},
|
|
1932
|
+
surface: {
|
|
1933
|
+
text: "text-gray-900",
|
|
1934
|
+
border: "border-gray-300",
|
|
1935
|
+
bg: "bg-white",
|
|
1936
|
+
ring: "ring-gray-300/30",
|
|
1937
|
+
ink: "bg-gray-400"
|
|
1938
|
+
},
|
|
1939
|
+
bw: {
|
|
1940
|
+
text: "text-black",
|
|
1941
|
+
border: "border-black",
|
|
1942
|
+
bg: "bg-black/10",
|
|
1943
|
+
ring: "ring-black/20",
|
|
1944
|
+
ink: "bg-black"
|
|
1945
|
+
}
|
|
1946
|
+
};
|
|
1947
|
+
var panelVariantClasses = {
|
|
1948
|
+
line: "pt-4",
|
|
1949
|
+
card: "mt-3 rounded-xl border border-gray-200 bg-white p-4 shadow-sm",
|
|
1950
|
+
pill: "mt-3 rounded-2xl border border-gray-200 bg-white/90 p-4"
|
|
1951
|
+
};
|
|
1952
|
+
var isExtraContentObject = (value) => {
|
|
1953
|
+
return !!value && typeof value === "object" && !React4__namespace.isValidElement(value) && ("left" in value || "right" in value);
|
|
1954
|
+
};
|
|
1955
|
+
var resolveFirstEnabledTab = (tabs) => tabs.find((tab) => !tab.disabled)?.value;
|
|
1956
|
+
var clampActive = (value, tabs) => {
|
|
1957
|
+
if (value === void 0) {
|
|
1958
|
+
return resolveFirstEnabledTab(tabs);
|
|
1959
|
+
}
|
|
1960
|
+
const match = tabs.find((tab) => tab.value === value);
|
|
1961
|
+
if (!match || match.disabled) {
|
|
1962
|
+
return resolveFirstEnabledTab(tabs);
|
|
1963
|
+
}
|
|
1964
|
+
return value;
|
|
1965
|
+
};
|
|
1966
|
+
var resolveIconNode = (icon, size) => {
|
|
1967
|
+
if (!icon) return null;
|
|
1968
|
+
const iconClass = resolveIconClassName2(icon);
|
|
1969
|
+
return iconClass ? /* @__PURE__ */ jsxRuntime.jsx("i", { className: tailwindMerge.twMerge(iconClass, size ? sizeClasses2[size].icon : void 0), "aria-hidden": true }) : null;
|
|
1970
|
+
};
|
|
1971
|
+
var collectTabs = (children, tabsId) => {
|
|
1972
|
+
const tabs = [];
|
|
1973
|
+
let index = 0;
|
|
1974
|
+
const walk = (node) => {
|
|
1975
|
+
if (Array.isArray(node)) {
|
|
1976
|
+
node.forEach(walk);
|
|
1977
|
+
return;
|
|
1978
|
+
}
|
|
1979
|
+
if (!isTabsTabElement(node)) {
|
|
1980
|
+
if (React4__namespace.isValidElement(node)) {
|
|
1981
|
+
const props = node.props;
|
|
1982
|
+
if (props && Object.prototype.hasOwnProperty.call(props, "children")) {
|
|
1983
|
+
walk(props.children);
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
return;
|
|
1987
|
+
}
|
|
1988
|
+
const tabIndex = index++;
|
|
1989
|
+
const value = node.props.value ?? tabIndex;
|
|
1990
|
+
const tabId = `${tabsId}-tab-${tabIndex}`;
|
|
1991
|
+
const panelId = `${tabsId}-panel-${tabIndex}`;
|
|
1992
|
+
tabs.push({
|
|
1993
|
+
element: node,
|
|
1994
|
+
index: tabIndex,
|
|
1995
|
+
value,
|
|
1996
|
+
label: node.props.label,
|
|
1997
|
+
disabled: node.props.disabled,
|
|
1998
|
+
icon: node.props.icon,
|
|
1999
|
+
badge: node.props.badge,
|
|
2000
|
+
tabClassName: node.props.tabClassName,
|
|
2001
|
+
panelClassName: node.props.panelClassName,
|
|
2002
|
+
tabId,
|
|
2003
|
+
panelId,
|
|
2004
|
+
forceRender: node.props.forceRender
|
|
2005
|
+
});
|
|
2006
|
+
};
|
|
2007
|
+
walk(children);
|
|
2008
|
+
return tabs;
|
|
2009
|
+
};
|
|
2010
|
+
var injectTabs = (children, context, tabs) => {
|
|
2011
|
+
let index = 0;
|
|
2012
|
+
const walk = (node) => {
|
|
2013
|
+
if (Array.isArray(node)) {
|
|
2014
|
+
let changed = false;
|
|
2015
|
+
const next = node.map((child) => {
|
|
2016
|
+
const mapped = walk(child);
|
|
2017
|
+
if (mapped !== child) {
|
|
2018
|
+
changed = true;
|
|
2019
|
+
}
|
|
2020
|
+
return mapped;
|
|
2021
|
+
});
|
|
2022
|
+
return changed ? next : node;
|
|
2023
|
+
}
|
|
2024
|
+
if (!React4__namespace.isValidElement(node)) {
|
|
2025
|
+
return node;
|
|
2026
|
+
}
|
|
2027
|
+
if (isTabsTabElement(node)) {
|
|
2028
|
+
const tab = tabs[index++];
|
|
2029
|
+
if (!tab) {
|
|
2030
|
+
return node;
|
|
2031
|
+
}
|
|
2032
|
+
const injectedProps = {
|
|
2033
|
+
value: tab.value,
|
|
2034
|
+
__tabsContext: context,
|
|
2035
|
+
__tabsValue: tab.value,
|
|
2036
|
+
__tabsIndex: tab.index,
|
|
2037
|
+
__tabsTabId: tab.tabId,
|
|
2038
|
+
__tabsPanelId: tab.panelId
|
|
2039
|
+
};
|
|
2040
|
+
return React4__namespace.cloneElement(node, injectedProps);
|
|
2041
|
+
}
|
|
2042
|
+
if (node.props) {
|
|
2043
|
+
const props = node.props;
|
|
2044
|
+
if (props && Object.prototype.hasOwnProperty.call(props, "children")) {
|
|
2045
|
+
const mappedChildren = walk(props.children);
|
|
2046
|
+
if (mappedChildren !== props.children) {
|
|
2047
|
+
return React4__namespace.cloneElement(node, void 0, mappedChildren);
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
return node;
|
|
2052
|
+
};
|
|
2053
|
+
return walk(children);
|
|
2054
|
+
};
|
|
2055
|
+
var handleTabListKeyDown = (event) => {
|
|
2056
|
+
const { key } = event;
|
|
2057
|
+
if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(key)) {
|
|
2058
|
+
return;
|
|
2059
|
+
}
|
|
2060
|
+
const tabs = Array.from(event.currentTarget.querySelectorAll('[role="tab"]')).filter((tab) => !tab.disabled);
|
|
2061
|
+
if (!tabs.length) {
|
|
2062
|
+
return;
|
|
2063
|
+
}
|
|
2064
|
+
const currentIndex = tabs.findIndex((tab) => tab === document.activeElement);
|
|
2065
|
+
let nextIndex = currentIndex;
|
|
2066
|
+
if (key === "ArrowRight") {
|
|
2067
|
+
nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % tabs.length;
|
|
2068
|
+
}
|
|
2069
|
+
if (key === "ArrowLeft") {
|
|
2070
|
+
nextIndex = currentIndex === -1 ? tabs.length - 1 : (currentIndex - 1 + tabs.length) % tabs.length;
|
|
2071
|
+
}
|
|
2072
|
+
if (key === "Home") {
|
|
2073
|
+
nextIndex = 0;
|
|
2074
|
+
}
|
|
2075
|
+
if (key === "End") {
|
|
2076
|
+
nextIndex = tabs.length - 1;
|
|
2077
|
+
}
|
|
2078
|
+
tabs[nextIndex]?.focus();
|
|
2079
|
+
event.preventDefault();
|
|
2080
|
+
};
|
|
2081
|
+
var Tabs = React4__namespace.forwardRef((props, ref) => {
|
|
2082
|
+
const {
|
|
2083
|
+
activeKey,
|
|
2084
|
+
defaultActiveKey,
|
|
2085
|
+
onChange,
|
|
2086
|
+
variant = "line",
|
|
2087
|
+
size = "medium",
|
|
2088
|
+
color = "primary",
|
|
2089
|
+
align = "start",
|
|
2090
|
+
tabBarGutter = 8,
|
|
2091
|
+
tabBarExtraContent,
|
|
2092
|
+
tabBarClassName,
|
|
2093
|
+
destroyInactiveTabPane = false,
|
|
2094
|
+
keepMounted = false,
|
|
2095
|
+
className,
|
|
2096
|
+
children,
|
|
2097
|
+
id,
|
|
2098
|
+
...rest
|
|
2099
|
+
} = props;
|
|
2100
|
+
const tabsId = typeof id === "string" && id.trim().length ? id : "tabs";
|
|
2101
|
+
const tabs = collectTabs(children, tabsId);
|
|
2102
|
+
const resolvedActive = clampActive(activeKey ?? defaultActiveKey, tabs);
|
|
2103
|
+
const handleActivate = (value) => {
|
|
2104
|
+
onChange?.(value);
|
|
2105
|
+
};
|
|
2106
|
+
const extraContent = tabBarExtraContent;
|
|
2107
|
+
const extraLeft = isExtraContentObject(extraContent) ? extraContent.left : null;
|
|
2108
|
+
const extraRight = isExtraContentObject(extraContent) ? extraContent.right : extraContent;
|
|
2109
|
+
const palette = paletteClasses[color] ?? paletteClasses.primary;
|
|
2110
|
+
const context = {
|
|
2111
|
+
activeKey: resolvedActive,
|
|
2112
|
+
onChange: handleActivate,
|
|
2113
|
+
variant,
|
|
2114
|
+
size,
|
|
2115
|
+
color,
|
|
2116
|
+
destroyInactiveTabPane,
|
|
2117
|
+
keepMounted
|
|
2118
|
+
};
|
|
2119
|
+
const enhancedChildren = injectTabs(children, context, tabs);
|
|
2120
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2121
|
+
"div",
|
|
2122
|
+
{
|
|
2123
|
+
...rest,
|
|
2124
|
+
id,
|
|
2125
|
+
ref,
|
|
2126
|
+
className: tailwindMerge.twMerge("tabs flex w-full flex-col text-gray-900", className),
|
|
2127
|
+
children: [
|
|
2128
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2129
|
+
extraLeft ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: extraLeft }) : null,
|
|
2130
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2131
|
+
"div",
|
|
2132
|
+
{
|
|
2133
|
+
role: "tablist",
|
|
2134
|
+
"aria-orientation": "horizontal",
|
|
2135
|
+
onKeyDown: handleTabListKeyDown,
|
|
2136
|
+
className: tailwindMerge.twMerge(
|
|
2137
|
+
"flex min-w-0 flex-1 items-center gap-2 overflow-x-auto",
|
|
2138
|
+
align === "center" ? "justify-center" : align === "end" ? "justify-end" : void 0,
|
|
2139
|
+
variantListClasses[variant],
|
|
2140
|
+
tabBarClassName
|
|
2141
|
+
),
|
|
2142
|
+
style: { gap: tabBarGutter },
|
|
2143
|
+
children: tabs.map((tab) => {
|
|
2144
|
+
const isActive = tab.value === resolvedActive;
|
|
2145
|
+
const sizeClass = sizeClasses2[size] ?? sizeClasses2.medium;
|
|
2146
|
+
const iconNode = resolveIconNode(tab.icon, size);
|
|
2147
|
+
const badgeNode = tab.badge ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-gray-200 px-1.5 py-0.5 text-[0.6rem] font-semibold text-gray-700", children: tab.badge }) : null;
|
|
2148
|
+
const activeText = isActive ? palette.text : "text-gray-600";
|
|
2149
|
+
const activeBorder = isActive ? palette.border : "border-transparent";
|
|
2150
|
+
const activeBg = isActive ? palette.bg : void 0;
|
|
2151
|
+
const activeRing = isActive ? palette.ring : void 0;
|
|
2152
|
+
const variantClasses5 = {
|
|
2153
|
+
line: tailwindMerge.twMerge(activeText, activeBorder),
|
|
2154
|
+
card: tailwindMerge.twMerge(activeText, activeBg, activeBorder, isActive ? "shadow-sm" : void 0),
|
|
2155
|
+
pill: tailwindMerge.twMerge(activeText, activeBg)
|
|
2156
|
+
};
|
|
2157
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2158
|
+
"button",
|
|
2159
|
+
{
|
|
2160
|
+
type: "button",
|
|
2161
|
+
role: "tab",
|
|
2162
|
+
id: tab.tabId,
|
|
2163
|
+
"aria-selected": isActive,
|
|
2164
|
+
"aria-controls": tab.panelId,
|
|
2165
|
+
"aria-disabled": tab.disabled || void 0,
|
|
2166
|
+
disabled: tab.disabled,
|
|
2167
|
+
tabIndex: isActive ? 0 : -1,
|
|
2168
|
+
onClick: () => {
|
|
2169
|
+
if (!tab.disabled) {
|
|
2170
|
+
handleActivate(tab.value);
|
|
2171
|
+
}
|
|
2172
|
+
},
|
|
2173
|
+
className: tailwindMerge.twMerge(
|
|
2174
|
+
"inline-flex items-center gap-2 whitespace-nowrap font-medium transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2",
|
|
2175
|
+
sizeClass.tab,
|
|
2176
|
+
variantTabBaseClasses[variant],
|
|
2177
|
+
variantClasses5[variant],
|
|
2178
|
+
activeRing ? `ring-1 ${activeRing}` : void 0,
|
|
2179
|
+
tab.disabled ? "cursor-not-allowed text-gray-400 opacity-60" : "hover:text-gray-900",
|
|
2180
|
+
tab.tabClassName
|
|
2181
|
+
),
|
|
2182
|
+
"data-state": isActive ? "active" : "inactive",
|
|
2183
|
+
children: [
|
|
2184
|
+
iconNode,
|
|
2185
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: tab.label }),
|
|
2186
|
+
badgeNode
|
|
2187
|
+
]
|
|
2188
|
+
},
|
|
2189
|
+
tab.value
|
|
2190
|
+
);
|
|
2191
|
+
})
|
|
2192
|
+
}
|
|
2193
|
+
),
|
|
2194
|
+
extraRight ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: extraRight }) : null
|
|
2195
|
+
] }),
|
|
2196
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindMerge.twMerge("min-h-0", panelVariantClasses[variant]), children: enhancedChildren })
|
|
2197
|
+
]
|
|
2198
|
+
}
|
|
2199
|
+
);
|
|
2200
|
+
});
|
|
2201
|
+
Tabs.displayName = "Tabs";
|
|
2202
|
+
var Tab = React4__namespace.forwardRef((props, ref) => {
|
|
2203
|
+
const {
|
|
2204
|
+
label: _label,
|
|
2205
|
+
value,
|
|
2206
|
+
disabled,
|
|
2207
|
+
forceRender,
|
|
2208
|
+
tabClassName: _tabClassName,
|
|
2209
|
+
panelClassName,
|
|
2210
|
+
className,
|
|
2211
|
+
children,
|
|
2212
|
+
__tabsContext,
|
|
2213
|
+
__tabsValue,
|
|
2214
|
+
__tabsTabId,
|
|
2215
|
+
__tabsPanelId,
|
|
2216
|
+
...rest
|
|
2217
|
+
} = props;
|
|
2218
|
+
const context = __tabsContext;
|
|
2219
|
+
const resolvedValue = value ?? __tabsValue;
|
|
2220
|
+
const isActive = context ? context.activeKey === resolvedValue : true;
|
|
2221
|
+
const shouldRender = !context || isActive || context.keepMounted || !context.destroyInactiveTabPane || forceRender;
|
|
2222
|
+
if (!shouldRender) {
|
|
2223
|
+
return null;
|
|
2224
|
+
}
|
|
2225
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2226
|
+
"div",
|
|
2227
|
+
{
|
|
2228
|
+
...rest,
|
|
2229
|
+
ref,
|
|
2230
|
+
role: "tabpanel",
|
|
2231
|
+
id: __tabsPanelId,
|
|
2232
|
+
"aria-labelledby": __tabsTabId,
|
|
2233
|
+
"aria-hidden": context ? !isActive : void 0,
|
|
2234
|
+
hidden: context ? !isActive : void 0,
|
|
2235
|
+
className: tailwindMerge.twMerge("tabs-panel text-gray-900", className, panelClassName),
|
|
2236
|
+
"data-state": isActive ? "active" : "inactive",
|
|
2237
|
+
"data-disabled": disabled || void 0,
|
|
2238
|
+
children
|
|
2239
|
+
}
|
|
2240
|
+
);
|
|
2241
|
+
});
|
|
2242
|
+
Tab.displayName = "Tab";
|
|
2243
|
+
markTabsTab(Tab);
|
|
2244
|
+
var Tabs_default = Tabs;
|
|
1846
2245
|
var positionClasses = {
|
|
1847
2246
|
fixed: "fixed inset-x-0 top-0",
|
|
1848
2247
|
absolute: "absolute inset-x-0 top-0",
|
|
@@ -2320,7 +2719,7 @@ var Input = React4__namespace.default.forwardRef(
|
|
|
2320
2719
|
underlined: "rounded-none border-0 border-b border-gray-300 px-0 bg-transparent focus-visible:border-primary focus-visible:ring-0 focus-visible:ring-transparent dark:border-b-gray-600 dark:focus-visible:border-primary/70",
|
|
2321
2720
|
rounded: "rounded-full px-4 border border-gray-300 bg-white focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 shadow-sm dark:border-gray-600 dark:bg-slate-900 dark:focus-visible:border-primary/70 dark:focus-visible:ring-primary/30 dark:shadow-black/20"
|
|
2322
2721
|
};
|
|
2323
|
-
const
|
|
2722
|
+
const sizeClasses5 = {
|
|
2324
2723
|
"x-small": {
|
|
2325
2724
|
paddingY: "py-2",
|
|
2326
2725
|
paddingLeft: "pl-2",
|
|
@@ -2386,7 +2785,7 @@ var Input = React4__namespace.default.forwardRef(
|
|
|
2386
2785
|
const hasLeadingIcon = Boolean(prependIconClass);
|
|
2387
2786
|
const hasLeadingAdornment = hasLeadingIcon || hasPrefix;
|
|
2388
2787
|
const hasTrailingAdornment = hasSuffix;
|
|
2389
|
-
const sizeConfig =
|
|
2788
|
+
const sizeConfig = sizeClasses5[size] ?? sizeClasses5.medium;
|
|
2390
2789
|
const leftPaddingClass = hasPrefix ? sizeConfig.paddingLeftLeadingDouble : hasLeadingAdornment ? sizeConfig.paddingLeftLeading : sizeConfig.paddingLeft;
|
|
2391
2790
|
const rightPaddingClass = hasTrailingAdornment ? sizeConfig.paddingRightTrailing : sizeConfig.paddingRight;
|
|
2392
2791
|
const sizeClass = [sizeConfig.paddingY, leftPaddingClass, rightPaddingClass, sizeConfig.text].join(" ");
|
|
@@ -2949,7 +3348,7 @@ var variantClasses4 = {
|
|
|
2949
3348
|
underlined: "rounded-none border-0 border-b border-gray-300 pl-0 pr-10 bg-transparent focus-visible:border-primary focus-visible:ring-0 focus-visible:ring-transparent dark:border-b-gray-300 dark:focus-visible:border-primary/70",
|
|
2950
3349
|
rounded: "rounded-full pl-4 pr-10 border border-gray-300 bg-white focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 shadow-sm dark:border-gray-600 dark:bg-slate-900 dark:focus-visible:border-primary/70 dark:focus-visible:ring-primary/30 dark:shadow-black/20"
|
|
2951
3350
|
};
|
|
2952
|
-
var
|
|
3351
|
+
var sizeClasses3 = {
|
|
2953
3352
|
"x-small": { padding: "pl-2 pr-8 py-2", text: "text-xs" },
|
|
2954
3353
|
small: { padding: "pl-2.5 pr-9 py-2.5", text: "text-sm" },
|
|
2955
3354
|
medium: { padding: "pl-3 pr-10 py-3", text: "text-base" },
|
|
@@ -3015,7 +3414,7 @@ var Select = React4__namespace.default.forwardRef(({
|
|
|
3015
3414
|
const selectId = id || name || generateString();
|
|
3016
3415
|
const inputName = name || selectId;
|
|
3017
3416
|
const variantClass = variantClasses4[variant] ?? variantClasses4.outline;
|
|
3018
|
-
const sizeConfig =
|
|
3417
|
+
const sizeConfig = sizeClasses3[size] ?? sizeClasses3.medium;
|
|
3019
3418
|
const sizeClass = `${sizeConfig.padding} ${sizeConfig.text}`;
|
|
3020
3419
|
const normalizedOptions = options.map(normalizeOption);
|
|
3021
3420
|
const selectedValueList = value !== void 0 ? (Array.isArray(value) ? value : [value]).map(String) : defaultValue !== void 0 ? (Array.isArray(defaultValue) ? defaultValue : [defaultValue]).map(String) : [];
|
|
@@ -3376,7 +3775,7 @@ var Switch = React4.forwardRef(
|
|
|
3376
3775
|
);
|
|
3377
3776
|
Switch.displayName = "Switch";
|
|
3378
3777
|
var Switch_default = Switch;
|
|
3379
|
-
var
|
|
3778
|
+
var sizeClasses4 = {
|
|
3380
3779
|
"x-small": "text-xs",
|
|
3381
3780
|
small: "text-sm",
|
|
3382
3781
|
medium: "text-base",
|
|
@@ -3414,7 +3813,7 @@ var Icon = ({ className, icon, size, color, ...rest }) => {
|
|
|
3414
3813
|
}
|
|
3415
3814
|
}
|
|
3416
3815
|
const classBase = "mdi";
|
|
3417
|
-
const sizeClass = size ?
|
|
3816
|
+
const sizeClass = size ? sizeClasses4[size] ?? sizeClasses4.medium : void 0;
|
|
3418
3817
|
const colorClass = color ? colorClasses2[color] ?? colorClasses2.primary : void 0;
|
|
3419
3818
|
return /* @__PURE__ */ jsxRuntime.jsx("i", { ...rest, className: tailwindMerge.twMerge(classBase, iconValue, sizeClass, colorClass, className) });
|
|
3420
3819
|
};
|
|
@@ -3537,7 +3936,7 @@ var resolveIconClassName6 = (icon) => {
|
|
|
3537
3936
|
const normalized = iconName?.startsWith("mdi-") ? iconName : `mdi-${iconName}`;
|
|
3538
3937
|
return `mdi ${library} ${normalized}`.trim();
|
|
3539
3938
|
};
|
|
3540
|
-
var
|
|
3939
|
+
var resolveIconNode2 = (icon, fallbackClassName) => {
|
|
3541
3940
|
if (React4__namespace.isValidElement(icon)) return icon;
|
|
3542
3941
|
const iconClassName = resolveIconClassName6(icon) ?? fallbackClassName;
|
|
3543
3942
|
if (!iconClassName) return null;
|
|
@@ -3568,8 +3967,8 @@ var NotificationCard = ({ item }) => {
|
|
|
3568
3967
|
const hasDescription = description !== void 0 && description !== null;
|
|
3569
3968
|
const hasContent = hasMessage || hasDescription;
|
|
3570
3969
|
const accentClass = type ? typeAccentMap[type] : void 0;
|
|
3571
|
-
const iconNode =
|
|
3572
|
-
const closeIconNode =
|
|
3970
|
+
const iconNode = resolveIconNode2(icon, type ? `mdi ${typeIconMap[type]}` : void 0);
|
|
3971
|
+
const closeIconNode = resolveIconNode2(closeIcon, "mdi mdi-close");
|
|
3573
3972
|
const variantClass = resolveVariantClass3(variant, type);
|
|
3574
3973
|
const toneIconBg = type ? typeTone[type]?.iconBg : void 0;
|
|
3575
3974
|
const toneIconText = type ? typeTone[type]?.iconText : void 0;
|
|
@@ -4060,7 +4459,7 @@ var resolveSide = (side, index) => {
|
|
|
4060
4459
|
}
|
|
4061
4460
|
return side;
|
|
4062
4461
|
};
|
|
4063
|
-
var
|
|
4462
|
+
var resolveIconNode3 = (icon) => {
|
|
4064
4463
|
if (!icon) return null;
|
|
4065
4464
|
const iconClass = resolveIconClassName2(icon);
|
|
4066
4465
|
return iconClass ? /* @__PURE__ */ jsxRuntime.jsx("i", { className: iconClass, "aria-hidden": true }) : null;
|
|
@@ -4099,7 +4498,7 @@ var TimeLineItem = React4__namespace.forwardRef((props, ref) => {
|
|
|
4099
4498
|
const resolvedColor = color ?? __timelineColor;
|
|
4100
4499
|
const dotSizeClass = dotSizeClasses[__timelineDotSize] ?? dotSizeClasses.md;
|
|
4101
4500
|
const dotPalette = resolveDotPalette(resolvedColor, variant);
|
|
4102
|
-
const iconNode =
|
|
4501
|
+
const iconNode = resolveIconNode3(icon);
|
|
4103
4502
|
const isLast = __timelineIndex >= __timelineCount - 1;
|
|
4104
4503
|
const showLine = !hideLine && !isLast;
|
|
4105
4504
|
const lineStyle = {
|
|
@@ -4226,6 +4625,8 @@ exports.Progress = Progress_default;
|
|
|
4226
4625
|
exports.Select = Select_default;
|
|
4227
4626
|
exports.Slider = Slider_default;
|
|
4228
4627
|
exports.Switch = Switch_default;
|
|
4628
|
+
exports.Tab = Tab;
|
|
4629
|
+
exports.Tabs = Tabs_default;
|
|
4229
4630
|
exports.TextArea = TextArea_default;
|
|
4230
4631
|
exports.TimeLine = TimeLine_default;
|
|
4231
4632
|
exports.TimeLineItem = TimeLineItem;
|