@beweco/aurora-ui 0.1.47 → 0.1.49
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/assets/css/styles.css +1 -1
- package/dist/index.cjs.js +462 -280
- package/dist/index.esm.js +462 -282
- package/dist/types/components/assistant-orb/AssistantOrb.d.ts +11 -0
- package/dist/types/components/assistant-orb/AssistantOrb.d.ts.map +1 -0
- package/dist/types/components/assistant-orb/AssistantOrb.types.d.ts +30 -0
- package/dist/types/components/assistant-orb/AssistantOrb.types.d.ts.map +1 -0
- package/dist/types/components/assistant-orb/_internal/AuraGlow.d.ts +11 -0
- package/dist/types/components/assistant-orb/_internal/AuraGlow.d.ts.map +1 -0
- package/dist/types/components/assistant-orb/_internal/SpeechBubble.d.ts +12 -0
- package/dist/types/components/assistant-orb/_internal/SpeechBubble.d.ts.map +1 -0
- package/dist/types/components/assistant-orb/_internal/index.d.ts +3 -0
- package/dist/types/components/assistant-orb/_internal/index.d.ts.map +1 -0
- package/dist/types/components/assistant-orb/assistant-orb.constants.d.ts +9 -0
- package/dist/types/components/assistant-orb/assistant-orb.constants.d.ts.map +1 -0
- package/dist/types/components/assistant-orb/index.d.ts +3 -0
- package/dist/types/components/assistant-orb/index.d.ts.map +1 -0
- package/dist/types/components/menu/_internal/menu-nav-list/MenuNavList.d.ts.map +1 -1
- package/dist/types/components/two-column-layout-agent/TwoColumnLayoutAgent.d.ts +4 -0
- package/dist/types/components/two-column-layout-agent/TwoColumnLayoutAgent.d.ts.map +1 -0
- package/dist/types/components/two-column-layout-agent/TwoColumnLayoutAgent.types.d.ts +35 -0
- package/dist/types/components/two-column-layout-agent/TwoColumnLayoutAgent.types.d.ts.map +1 -0
- package/dist/types/components/two-column-layout-agent/index.d.ts +3 -0
- package/dist/types/components/two-column-layout-agent/index.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/useMediaQuery.d.ts +5 -0
- package/dist/types/hooks/useMediaQuery.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1822,7 +1822,7 @@ KanbanColumn.displayName = "KanbanColumn";
|
|
|
1822
1822
|
* Traducciones por defecto en español.
|
|
1823
1823
|
* Se mezclan con las traducciones proporcionadas por el usuario.
|
|
1824
1824
|
*/
|
|
1825
|
-
var DEFAULT_TRANSLATIONS$
|
|
1825
|
+
var DEFAULT_TRANSLATIONS$2 = {
|
|
1826
1826
|
dropHere: "Soltar aquí",
|
|
1827
1827
|
emptyMessage: "No hay elementos",
|
|
1828
1828
|
};
|
|
@@ -1856,7 +1856,7 @@ var columnGapClasses = {
|
|
|
1856
1856
|
var KanbanComponent = function (_a) {
|
|
1857
1857
|
var columns = _a.columns, renderItem = _a.renderItem, onCardClick = _a.onCardClick, onItemMove = _a.onItemMove, isDraggable = _a.isDraggable, cardClassName = _a.cardClassName, isCardClickable = _a.isCardClickable, className = _a.className, _b = _a.columnWidth, columnWidth = _b === void 0 ? "280px" : _b, _c = _a.columnGap, columnGap = _c === void 0 ? "md" : _c, _d = _a.horizontalScroll, horizontalScroll = _d === void 0 ? true : _d, columnMaxHeight = _a.columnMaxHeight, renderColumnHeader = _a.renderColumnHeader, renderEmptyState = _a.renderEmptyState, _e = _a.translations, translations = _e === void 0 ? {} : _e, onLoadMore = _a.onLoadMore;
|
|
1858
1858
|
// Mezclar traducciones del usuario con las por defecto
|
|
1859
|
-
var t = __assign(__assign({}, DEFAULT_TRANSLATIONS$
|
|
1859
|
+
var t = __assign(__assign({}, DEFAULT_TRANSLATIONS$2), translations);
|
|
1860
1860
|
// Determinar si drag está habilitado
|
|
1861
1861
|
var dragEnabled = isDraggable !== null && isDraggable !== void 0 ? isDraggable : !!onItemMove;
|
|
1862
1862
|
// Estado del drag actual
|
|
@@ -1964,264 +1964,6 @@ var ImagePreview = function (_a) {
|
|
|
1964
1964
|
: undefined, role: isClickable ? "button" : undefined, tabIndex: isClickable ? 0 : undefined, "aria-label": isClickable ? t.clickableImageAriaLabel : undefined }), showRemoveButton && onRemove && (jsxRuntime.jsx("button", { type: "button", onClick: function () { return handleRemove(image.id || "", index); }, "aria-label": t.removeButtonAriaLabel, className: "\n\t\t\t\t\t\t\t\t\tabsolute -top-2 -right-2 \n\t\t\t\t\t\t\t\t\tp-1 rounded-full \n\t\t\t\t\t\t\t\t\tbg-danger-500 hover:bg-danger-600 \n\t\t\t\t\t\t\t\t\ttext-white \n\t\t\t\t\t\t\t\t\tcursor-pointer \n\t\t\t\t\t\t\t\t\ttransition-colors\n\t\t\t\t\t\t\t\t\tfocus:outline-none \n\t\t\t\t\t\t\t\t\tfocus:ring-2 \n\t\t\t\t\t\t\t\t\tfocus:ring-danger-400 \n\t\t\t\t\t\t\t\t\tfocus:ring-offset-2\n\t\t\t\t\t\t\t\t", children: jsxRuntime.jsx(IconComponent, { size: size === "micro" ? "sm" : "md", icon: "solar:trash-bin-minimalistic-outline" }) }))] }) }, image.id || index)); }) }));
|
|
1965
1965
|
};
|
|
1966
1966
|
|
|
1967
|
-
/*
|
|
1968
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
1969
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
1970
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
1971
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
1972
|
-
*
|
|
1973
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
1974
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
1975
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1976
|
-
* governing permissions and limitations under the License.
|
|
1977
|
-
*/ function $7215afc6de606d6b$export$de79e2c695e052f3(element) {
|
|
1978
|
-
if ($7215afc6de606d6b$var$supportsPreventScroll()) element.focus({
|
|
1979
|
-
preventScroll: true
|
|
1980
|
-
});
|
|
1981
|
-
else {
|
|
1982
|
-
let scrollableElements = $7215afc6de606d6b$var$getScrollableElements(element);
|
|
1983
|
-
element.focus();
|
|
1984
|
-
$7215afc6de606d6b$var$restoreScrollPosition(scrollableElements);
|
|
1985
|
-
}
|
|
1986
|
-
}
|
|
1987
|
-
let $7215afc6de606d6b$var$supportsPreventScrollCached = null;
|
|
1988
|
-
function $7215afc6de606d6b$var$supportsPreventScroll() {
|
|
1989
|
-
if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) {
|
|
1990
|
-
$7215afc6de606d6b$var$supportsPreventScrollCached = false;
|
|
1991
|
-
try {
|
|
1992
|
-
let focusElem = document.createElement('div');
|
|
1993
|
-
focusElem.focus({
|
|
1994
|
-
get preventScroll () {
|
|
1995
|
-
$7215afc6de606d6b$var$supportsPreventScrollCached = true;
|
|
1996
|
-
return true;
|
|
1997
|
-
}
|
|
1998
|
-
});
|
|
1999
|
-
} catch {
|
|
2000
|
-
// Ignore
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
|
-
return $7215afc6de606d6b$var$supportsPreventScrollCached;
|
|
2004
|
-
}
|
|
2005
|
-
function $7215afc6de606d6b$var$getScrollableElements(element) {
|
|
2006
|
-
let parent = element.parentNode;
|
|
2007
|
-
let scrollableElements = [];
|
|
2008
|
-
let rootScrollingElement = document.scrollingElement || document.documentElement;
|
|
2009
|
-
while(parent instanceof HTMLElement && parent !== rootScrollingElement){
|
|
2010
|
-
if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
|
|
2011
|
-
element: parent,
|
|
2012
|
-
scrollTop: parent.scrollTop,
|
|
2013
|
-
scrollLeft: parent.scrollLeft
|
|
2014
|
-
});
|
|
2015
|
-
parent = parent.parentNode;
|
|
2016
|
-
}
|
|
2017
|
-
if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
|
|
2018
|
-
element: rootScrollingElement,
|
|
2019
|
-
scrollTop: rootScrollingElement.scrollTop,
|
|
2020
|
-
scrollLeft: rootScrollingElement.scrollLeft
|
|
2021
|
-
});
|
|
2022
|
-
return scrollableElements;
|
|
2023
|
-
}
|
|
2024
|
-
function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
|
|
2025
|
-
for (let { element: element, scrollTop: scrollTop, scrollLeft: scrollLeft } of scrollableElements){
|
|
2026
|
-
element.scrollTop = scrollTop;
|
|
2027
|
-
element.scrollLeft = scrollLeft;
|
|
2028
|
-
}
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
|
-
/*
|
|
2032
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
2033
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
2034
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
2035
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
2036
|
-
*
|
|
2037
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
2038
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
2039
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
2040
|
-
* governing permissions and limitations under the License.
|
|
2041
|
-
*/ function $c87311424ea30a05$var$testUserAgent(re) {
|
|
2042
|
-
var _window_navigator_userAgentData;
|
|
2043
|
-
if (typeof window === 'undefined' || window.navigator == null) return false;
|
|
2044
|
-
return ((_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands.some((brand)=>re.test(brand.brand))) || re.test(window.navigator.userAgent);
|
|
2045
|
-
}
|
|
2046
|
-
function $c87311424ea30a05$var$testPlatform(re) {
|
|
2047
|
-
var _window_navigator_userAgentData;
|
|
2048
|
-
return typeof window !== 'undefined' && window.navigator != null ? re.test(((_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : false;
|
|
2049
|
-
}
|
|
2050
|
-
function $c87311424ea30a05$var$cached(fn) {
|
|
2051
|
-
if (process.env.NODE_ENV === 'test') return fn;
|
|
2052
|
-
let res = null;
|
|
2053
|
-
return ()=>{
|
|
2054
|
-
if (res == null) res = fn();
|
|
2055
|
-
return res;
|
|
2056
|
-
};
|
|
2057
|
-
}
|
|
2058
|
-
const $c87311424ea30a05$export$9ac100e40613ea10 = $c87311424ea30a05$var$cached(function() {
|
|
2059
|
-
return $c87311424ea30a05$var$testPlatform(/^Mac/i);
|
|
2060
|
-
});
|
|
2061
|
-
const $c87311424ea30a05$export$186c6964ca17d99 = $c87311424ea30a05$var$cached(function() {
|
|
2062
|
-
return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
|
|
2063
|
-
});
|
|
2064
|
-
const $c87311424ea30a05$export$7bef049ce92e4224 = $c87311424ea30a05$var$cached(function() {
|
|
2065
|
-
return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
2066
|
-
$c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
|
|
2067
|
-
});
|
|
2068
|
-
const $c87311424ea30a05$export$fedb369cb70207f1 = $c87311424ea30a05$var$cached(function() {
|
|
2069
|
-
return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
|
|
2070
|
-
});
|
|
2071
|
-
$c87311424ea30a05$var$cached(function() {
|
|
2072
|
-
return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
|
|
2073
|
-
});
|
|
2074
|
-
const $c87311424ea30a05$export$78551043582a6a98 = $c87311424ea30a05$var$cached(function() {
|
|
2075
|
-
return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
|
|
2076
|
-
});
|
|
2077
|
-
const $c87311424ea30a05$export$6446a186d09e379e = $c87311424ea30a05$var$cached(function() {
|
|
2078
|
-
return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
|
|
2079
|
-
});
|
|
2080
|
-
$c87311424ea30a05$var$cached(function() {
|
|
2081
|
-
return $c87311424ea30a05$var$testUserAgent(/Android/i);
|
|
2082
|
-
});
|
|
2083
|
-
const $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(function() {
|
|
2084
|
-
return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
|
|
2085
|
-
});
|
|
2086
|
-
|
|
2087
|
-
/*
|
|
2088
|
-
* Copyright 2023 Adobe. All rights reserved.
|
|
2089
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
2090
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
2091
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
2092
|
-
*
|
|
2093
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
2094
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
2095
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
2096
|
-
* governing permissions and limitations under the License.
|
|
2097
|
-
*/
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
const $ea8dcbcb9ea1b556$var$RouterContext = /*#__PURE__*/ (React.createContext)({
|
|
2101
|
-
isNative: true,
|
|
2102
|
-
open: $ea8dcbcb9ea1b556$var$openSyntheticLink,
|
|
2103
|
-
useHref: (href)=>href
|
|
2104
|
-
});
|
|
2105
|
-
function $ea8dcbcb9ea1b556$export$9a302a45f65d0572() {
|
|
2106
|
-
return (React.useContext)($ea8dcbcb9ea1b556$var$RouterContext);
|
|
2107
|
-
}
|
|
2108
|
-
function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
|
|
2109
|
-
var _window_event_type, _window_event;
|
|
2110
|
-
let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
|
|
2111
|
-
// Firefox does not recognize keyboard events as a user action by default, and the popup blocker
|
|
2112
|
-
// will prevent links with target="_blank" from opening. However, it does allow the event if the
|
|
2113
|
-
// Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
|
|
2114
|
-
// See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
|
|
2115
|
-
if (($c87311424ea30a05$export$b7d78993b74f766d)() && ((_window_event = window.event) === null || _window_event === void 0 ? void 0 : (_window_event_type = _window_event.type) === null || _window_event_type === void 0 ? void 0 : _window_event_type.startsWith('key')) && target.target === '_blank') {
|
|
2116
|
-
if (($c87311424ea30a05$export$9ac100e40613ea10)()) metaKey = true;
|
|
2117
|
-
else ctrlKey = true;
|
|
2118
|
-
}
|
|
2119
|
-
// WebKit does not support firing click events with modifier keys, but does support keyboard events.
|
|
2120
|
-
// https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
|
|
2121
|
-
let event = ($c87311424ea30a05$export$78551043582a6a98)() && ($c87311424ea30a05$export$9ac100e40613ea10)() && !($c87311424ea30a05$export$7bef049ce92e4224)() && process.env.NODE_ENV !== 'test' ? new KeyboardEvent('keydown', {
|
|
2122
|
-
keyIdentifier: 'Enter',
|
|
2123
|
-
metaKey: metaKey,
|
|
2124
|
-
ctrlKey: ctrlKey,
|
|
2125
|
-
altKey: altKey,
|
|
2126
|
-
shiftKey: shiftKey
|
|
2127
|
-
}) : new MouseEvent('click', {
|
|
2128
|
-
metaKey: metaKey,
|
|
2129
|
-
ctrlKey: ctrlKey,
|
|
2130
|
-
altKey: altKey,
|
|
2131
|
-
shiftKey: shiftKey,
|
|
2132
|
-
bubbles: true,
|
|
2133
|
-
cancelable: true
|
|
2134
|
-
});
|
|
2135
|
-
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening;
|
|
2136
|
-
($7215afc6de606d6b$export$de79e2c695e052f3)(target);
|
|
2137
|
-
target.dispatchEvent(event);
|
|
2138
|
-
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
|
|
2139
|
-
}
|
|
2140
|
-
// https://github.com/parcel-bundler/parcel/issues/8724
|
|
2141
|
-
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
|
|
2142
|
-
function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
|
|
2143
|
-
if (target instanceof HTMLAnchorElement) open(target);
|
|
2144
|
-
else if (target.hasAttribute('data-href')) {
|
|
2145
|
-
let link = document.createElement('a');
|
|
2146
|
-
link.href = target.getAttribute('data-href');
|
|
2147
|
-
if (target.hasAttribute('data-target')) link.target = target.getAttribute('data-target');
|
|
2148
|
-
if (target.hasAttribute('data-rel')) link.rel = target.getAttribute('data-rel');
|
|
2149
|
-
if (target.hasAttribute('data-download')) link.download = target.getAttribute('data-download');
|
|
2150
|
-
if (target.hasAttribute('data-ping')) link.ping = target.getAttribute('data-ping');
|
|
2151
|
-
if (target.hasAttribute('data-referrer-policy')) link.referrerPolicy = target.getAttribute('data-referrer-policy');
|
|
2152
|
-
target.appendChild(link);
|
|
2153
|
-
open(link);
|
|
2154
|
-
target.removeChild(link);
|
|
2155
|
-
}
|
|
2156
|
-
}
|
|
2157
|
-
function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
|
|
2158
|
-
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>$ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers));
|
|
2159
|
-
}
|
|
2160
|
-
|
|
2161
|
-
/*
|
|
2162
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
2163
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
2164
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
2165
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
2166
|
-
*
|
|
2167
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
2168
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
2169
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
2170
|
-
* governing permissions and limitations under the License.
|
|
2171
|
-
*/
|
|
2172
|
-
function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange) {
|
|
2173
|
-
let [stateValue, setStateValue] = (React.useState)(value || defaultValue);
|
|
2174
|
-
let isControlledRef = (React.useRef)(value !== undefined);
|
|
2175
|
-
let isControlled = value !== undefined;
|
|
2176
|
-
(React.useEffect)(()=>{
|
|
2177
|
-
let wasControlled = isControlledRef.current;
|
|
2178
|
-
if (wasControlled !== isControlled && process.env.NODE_ENV !== 'production') console.warn(`WARN: A component changed from ${wasControlled ? 'controlled' : 'uncontrolled'} to ${isControlled ? 'controlled' : 'uncontrolled'}.`);
|
|
2179
|
-
isControlledRef.current = isControlled;
|
|
2180
|
-
}, [
|
|
2181
|
-
isControlled
|
|
2182
|
-
]);
|
|
2183
|
-
let currentValue = isControlled ? value : stateValue;
|
|
2184
|
-
let setValue = (React.useCallback)((value, ...args)=>{
|
|
2185
|
-
let onChangeCaller = (value, ...onChangeArgs)=>{
|
|
2186
|
-
if (onChange) {
|
|
2187
|
-
if (!Object.is(currentValue, value)) onChange(value, ...onChangeArgs);
|
|
2188
|
-
}
|
|
2189
|
-
if (!isControlled) // If uncontrolled, mutate the currentValue local variable so that
|
|
2190
|
-
// calling setState multiple times with the same value only emits onChange once.
|
|
2191
|
-
// We do not use a ref for this because we specifically _do_ want the value to
|
|
2192
|
-
// reset every render, and assigning to a ref in render breaks aborted suspended renders.
|
|
2193
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2194
|
-
currentValue = value;
|
|
2195
|
-
};
|
|
2196
|
-
if (typeof value === 'function') {
|
|
2197
|
-
if (process.env.NODE_ENV !== 'production') console.warn('We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320');
|
|
2198
|
-
// this supports functional updates https://reactjs.org/docs/hooks-reference.html#functional-updates
|
|
2199
|
-
// when someone using useControlledState calls setControlledState(myFunc)
|
|
2200
|
-
// this will call our useState setState with a function as well which invokes myFunc and calls onChange with the value from myFunc
|
|
2201
|
-
// if we're in an uncontrolled state, then we also return the value of myFunc which to setState looks as though it was just called with myFunc from the beginning
|
|
2202
|
-
// otherwise we just return the controlled value, which won't cause a rerender because React knows to bail out when the value is the same
|
|
2203
|
-
let updateFunction = (oldValue, ...functionArgs)=>{
|
|
2204
|
-
let interceptedValue = value(isControlled ? currentValue : oldValue, ...functionArgs);
|
|
2205
|
-
onChangeCaller(interceptedValue, ...args);
|
|
2206
|
-
if (!isControlled) return interceptedValue;
|
|
2207
|
-
return oldValue;
|
|
2208
|
-
};
|
|
2209
|
-
setStateValue(updateFunction);
|
|
2210
|
-
} else {
|
|
2211
|
-
if (!isControlled) setStateValue(value);
|
|
2212
|
-
onChangeCaller(value, ...args);
|
|
2213
|
-
}
|
|
2214
|
-
}, [
|
|
2215
|
-
isControlled,
|
|
2216
|
-
currentValue,
|
|
2217
|
-
onChange
|
|
2218
|
-
]);
|
|
2219
|
-
return [
|
|
2220
|
-
currentValue,
|
|
2221
|
-
setValue
|
|
2222
|
-
];
|
|
2223
|
-
}
|
|
2224
|
-
|
|
2225
1967
|
function normalizeClass(value) {
|
|
2226
1968
|
if (typeof value === "string") {
|
|
2227
1969
|
return value || undefined;
|
|
@@ -2279,37 +2021,25 @@ var EnumMenuNavListItem;
|
|
|
2279
2021
|
* @forwardRef
|
|
2280
2022
|
*/
|
|
2281
2023
|
var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
2282
|
-
var items = _a.items, isCollapsed = _a.isCollapsed, defaultSelectedKey = _a.defaultSelectedKey
|
|
2024
|
+
var items = _a.items, isCollapsed = _a.isCollapsed, defaultSelectedKey = _a.defaultSelectedKey; _a.onSelect; var hideEndContent = _a.hideEndContent, _b = _a.sectionClasses, sectionClassesProp = _b === void 0 ? {} : _b, _c = _a.itemClasses, itemClassesProp = _c === void 0 ? {} : _c, iconClassName = _a.iconClassName, classNames = _a.classNames, className = _a.className, props = __rest(_a, ["items", "isCollapsed", "defaultSelectedKey", "onSelect", "hideEndContent", "sectionClasses", "itemClasses", "iconClassName", "classNames", "className"]);
|
|
2283
2025
|
var _d = React.useState(defaultSelectedKey), selected = _d[0], setSelected = _d[1];
|
|
2284
|
-
var router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
2285
2026
|
// Component styles
|
|
2286
2027
|
var sectionClasses = getSectionClasses(isCollapsed, sectionClassesProp);
|
|
2287
2028
|
var itemClasses = getItemClasses(isCollapsed, itemClassesProp);
|
|
2288
|
-
// Handles the click event on an item, updating the selection state
|
|
2029
|
+
// Handles the click event on an item, updating the selection state.
|
|
2289
2030
|
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
|
|
2290
2031
|
var handleItemPress = React.useCallback(function (item, parentKey) {
|
|
2291
2032
|
var keySelected = typeof parentKey === "string" ? parentKey : item.key;
|
|
2292
2033
|
setSelected(keySelected);
|
|
2293
|
-
onSelect === null || onSelect === void 0 ? void 0 : onSelect(keySelected);
|
|
2294
|
-
// Use the router provider for client-side navigation (avoids full page reload)
|
|
2295
|
-
if (item.href && item.href !== "#") {
|
|
2296
|
-
if (!router.isNative) {
|
|
2297
|
-
router.open(document.activeElement, new MouseEvent("click"), item.href);
|
|
2298
|
-
}
|
|
2299
|
-
else {
|
|
2300
|
-
window.location.href = item.href;
|
|
2301
|
-
}
|
|
2302
|
-
}
|
|
2303
2034
|
// Force blur to remove hover state after click.
|
|
2304
2035
|
if (document.activeElement instanceof HTMLElement) {
|
|
2305
2036
|
document.activeElement.blur();
|
|
2306
2037
|
}
|
|
2307
|
-
}, [setSelected
|
|
2038
|
+
}, [setSelected]);
|
|
2308
2039
|
// Renders the item displayed inside the Popover when the menu is collapsed.
|
|
2309
2040
|
var renderCompactItem = React.useCallback(function (item, parentKey) {
|
|
2310
2041
|
var _a, _b;
|
|
2311
|
-
item.
|
|
2312
|
-
return (React.createElement(react.ListboxItem, __assign({}, itemWithoutHref, { key: item.key, endContent: (_a = item.endContent) !== null && _a !== void 0 ? _a : null, startContent: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_b = item.startContent) !== null && _b !== void 0 ? _b : null)), textValue: item.title, title: item.title, className: "data-[hover=true]:text-default-600", onPress: function () { return handleItemPress(item, parentKey); } })));
|
|
2042
|
+
return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, endContent: (_a = item.endContent) !== null && _a !== void 0 ? _a : null, startContent: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_b = item.startContent) !== null && _b !== void 0 ? _b : null)), textValue: item.title, title: item.title, className: "data-[hover=true]:text-default-600", onPress: function () { return handleItemPress(item, parentKey); } })));
|
|
2313
2043
|
}, [handleItemPress, iconClassName]);
|
|
2314
2044
|
// Renders a nested item, i.e., an item that has sub-items.
|
|
2315
2045
|
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
|
|
@@ -2318,8 +2048,10 @@ var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
|
2318
2048
|
var isNestType = item.items &&
|
|
2319
2049
|
((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
2320
2050
|
(item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem.Nest;
|
|
2321
|
-
|
|
2322
|
-
|
|
2051
|
+
if (isNestType) {
|
|
2052
|
+
item.href = undefined;
|
|
2053
|
+
}
|
|
2054
|
+
return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, classNames: {
|
|
2323
2055
|
base: react.cn({
|
|
2324
2056
|
"h-auto p-0": !isCollapsed && isNestType,
|
|
2325
2057
|
}, {
|
|
@@ -2356,8 +2088,7 @@ var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
|
2356
2088
|
return renderNestItem(item);
|
|
2357
2089
|
}
|
|
2358
2090
|
var isItemSelected = selected === item.key;
|
|
2359
|
-
item.
|
|
2360
|
-
return (React.createElement(react.ListboxItem, __assign({}, itemWithoutHref, { key: item.key, endContent: isCollapsed || hideEndContent ? null : ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed ? null : item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), textValue: item.title, title: isCollapsed ? null : item.title, onPress: function () { return handleItemPress(item, parentKey); }, "aria-selected": isItemSelected, "aria-label": item.title || "Menu item ".concat(item.key) }), isCollapsed ? (jsxRuntime.jsx(react.Tooltip, { content: item.title, placement: "right", closeDelay: 200, shouldCloseOnBlur: false, classNames: {
|
|
2091
|
+
return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, endContent: isCollapsed || hideEndContent ? null : ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed ? null : item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), textValue: item.title, title: isCollapsed ? null : item.title, onPress: function () { return handleItemPress(item, parentKey); }, "aria-selected": isItemSelected, "aria-label": item.title || "Menu item ".concat(item.key) }), isCollapsed ? (jsxRuntime.jsx(react.Tooltip, { content: item.title, placement: "right", closeDelay: 200, shouldCloseOnBlur: false, classNames: {
|
|
2361
2092
|
base: "text-default-500",
|
|
2362
2093
|
}, children: jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", "aria-hidden": "true", children: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_d = item.startContent) !== null && _d !== void 0 ? _d : null)) }) })) : null));
|
|
2363
2094
|
},
|
|
@@ -2429,6 +2160,70 @@ var StepIndicator = function (_a) {
|
|
|
2429
2160
|
return (jsxRuntime.jsxs("div", __assign({ className: react.cn("w-full", className) }, props, { children: [showStepText && (jsxRuntime.jsx("div", { className: "text-center text-sm font-medium text-default-400 mb-3", children: stepText })), jsxRuntime.jsx("div", { className: "w-full bg-content2 rounded-full h-2 overflow-hidden", children: jsxRuntime.jsx("div", { className: react.cn("h-full transition-all duration-300 ease-out rounded-full", colorClasses[color]), style: { width: "".concat(progressPercentage, "%") } }) })] })));
|
|
2430
2161
|
};
|
|
2431
2162
|
|
|
2163
|
+
/*
|
|
2164
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
2165
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
2166
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
2167
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
2168
|
+
*
|
|
2169
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
2170
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
2171
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
2172
|
+
* governing permissions and limitations under the License.
|
|
2173
|
+
*/
|
|
2174
|
+
function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange) {
|
|
2175
|
+
let [stateValue, setStateValue] = (React.useState)(value || defaultValue);
|
|
2176
|
+
let isControlledRef = (React.useRef)(value !== undefined);
|
|
2177
|
+
let isControlled = value !== undefined;
|
|
2178
|
+
(React.useEffect)(()=>{
|
|
2179
|
+
let wasControlled = isControlledRef.current;
|
|
2180
|
+
if (wasControlled !== isControlled && process.env.NODE_ENV !== 'production') console.warn(`WARN: A component changed from ${wasControlled ? 'controlled' : 'uncontrolled'} to ${isControlled ? 'controlled' : 'uncontrolled'}.`);
|
|
2181
|
+
isControlledRef.current = isControlled;
|
|
2182
|
+
}, [
|
|
2183
|
+
isControlled
|
|
2184
|
+
]);
|
|
2185
|
+
let currentValue = isControlled ? value : stateValue;
|
|
2186
|
+
let setValue = (React.useCallback)((value, ...args)=>{
|
|
2187
|
+
let onChangeCaller = (value, ...onChangeArgs)=>{
|
|
2188
|
+
if (onChange) {
|
|
2189
|
+
if (!Object.is(currentValue, value)) onChange(value, ...onChangeArgs);
|
|
2190
|
+
}
|
|
2191
|
+
if (!isControlled) // If uncontrolled, mutate the currentValue local variable so that
|
|
2192
|
+
// calling setState multiple times with the same value only emits onChange once.
|
|
2193
|
+
// We do not use a ref for this because we specifically _do_ want the value to
|
|
2194
|
+
// reset every render, and assigning to a ref in render breaks aborted suspended renders.
|
|
2195
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2196
|
+
currentValue = value;
|
|
2197
|
+
};
|
|
2198
|
+
if (typeof value === 'function') {
|
|
2199
|
+
if (process.env.NODE_ENV !== 'production') console.warn('We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320');
|
|
2200
|
+
// this supports functional updates https://reactjs.org/docs/hooks-reference.html#functional-updates
|
|
2201
|
+
// when someone using useControlledState calls setControlledState(myFunc)
|
|
2202
|
+
// this will call our useState setState with a function as well which invokes myFunc and calls onChange with the value from myFunc
|
|
2203
|
+
// if we're in an uncontrolled state, then we also return the value of myFunc which to setState looks as though it was just called with myFunc from the beginning
|
|
2204
|
+
// otherwise we just return the controlled value, which won't cause a rerender because React knows to bail out when the value is the same
|
|
2205
|
+
let updateFunction = (oldValue, ...functionArgs)=>{
|
|
2206
|
+
let interceptedValue = value(isControlled ? currentValue : oldValue, ...functionArgs);
|
|
2207
|
+
onChangeCaller(interceptedValue, ...args);
|
|
2208
|
+
if (!isControlled) return interceptedValue;
|
|
2209
|
+
return oldValue;
|
|
2210
|
+
};
|
|
2211
|
+
setStateValue(updateFunction);
|
|
2212
|
+
} else {
|
|
2213
|
+
if (!isControlled) setStateValue(value);
|
|
2214
|
+
onChangeCaller(value, ...args);
|
|
2215
|
+
}
|
|
2216
|
+
}, [
|
|
2217
|
+
isControlled,
|
|
2218
|
+
currentValue,
|
|
2219
|
+
onChange
|
|
2220
|
+
]);
|
|
2221
|
+
return [
|
|
2222
|
+
currentValue,
|
|
2223
|
+
setValue
|
|
2224
|
+
];
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2432
2227
|
var defaultTranslations$7 = {
|
|
2433
2228
|
checkIconTitle: "Check",
|
|
2434
2229
|
};
|
|
@@ -3887,6 +3682,391 @@ function GlobalToast() {
|
|
|
3887
3682
|
return (jsxRuntime.jsx("div", { className: "fixed top-4 right-4 z-[2000] w-full max-w-sm", children: jsxRuntime.jsx(react.Alert, { hideIconWrapper: true, color: toast.color, variant: "flat", title: toast.title, description: toast.description, isClosable: true, onClose: hideToast }) }));
|
|
3888
3683
|
}
|
|
3889
3684
|
|
|
3685
|
+
/**
|
|
3686
|
+
* Subscribe to a CSS media query and return its current match state.
|
|
3687
|
+
*/
|
|
3688
|
+
var useMediaQuery = function (query, initialValue) {
|
|
3689
|
+
if (initialValue === void 0) { initialValue = true; }
|
|
3690
|
+
var _a = React.useState(function () {
|
|
3691
|
+
if (typeof window === "undefined") {
|
|
3692
|
+
return initialValue;
|
|
3693
|
+
}
|
|
3694
|
+
return window.matchMedia(query).matches;
|
|
3695
|
+
}), matches = _a[0], setMatches = _a[1];
|
|
3696
|
+
React.useEffect(function () {
|
|
3697
|
+
if (typeof window === "undefined") {
|
|
3698
|
+
return;
|
|
3699
|
+
}
|
|
3700
|
+
var mediaQuery = window.matchMedia(query);
|
|
3701
|
+
var onMediaQueryChange = function (event) {
|
|
3702
|
+
setMatches(event.matches);
|
|
3703
|
+
};
|
|
3704
|
+
setMatches(mediaQuery.matches);
|
|
3705
|
+
if (typeof mediaQuery.addEventListener === "function") {
|
|
3706
|
+
mediaQuery.addEventListener("change", onMediaQueryChange);
|
|
3707
|
+
return function () { return mediaQuery.removeEventListener("change", onMediaQueryChange); };
|
|
3708
|
+
}
|
|
3709
|
+
var legacyMediaQuery = mediaQuery;
|
|
3710
|
+
legacyMediaQuery.addListener(onMediaQueryChange);
|
|
3711
|
+
return function () { return legacyMediaQuery.removeListener(onMediaQueryChange); };
|
|
3712
|
+
}, [query]);
|
|
3713
|
+
return matches;
|
|
3714
|
+
};
|
|
3715
|
+
|
|
3716
|
+
/** Default typing speed in milliseconds per character */
|
|
3717
|
+
var DEFAULT_TYPING_SPEED_MS = 20;
|
|
3718
|
+
/** Default system primary color token for the aura glow */
|
|
3719
|
+
var DEFAULT_AURA_COLOR = "hsl(var(--heroui-primary))";
|
|
3720
|
+
/** Default max width for the speech bubble */
|
|
3721
|
+
var DEFAULT_MAX_WIDTH = 420;
|
|
3722
|
+
/** Orb dimensions by size variant */
|
|
3723
|
+
var ORB_SIZES = {
|
|
3724
|
+
sm: 96,
|
|
3725
|
+
md: 128,
|
|
3726
|
+
lg: 160,
|
|
3727
|
+
xl: 192,
|
|
3728
|
+
};
|
|
3729
|
+
|
|
3730
|
+
var isHexColor = function (value) {
|
|
3731
|
+
var normalized = value.startsWith("#") ? value.slice(1) : value;
|
|
3732
|
+
return /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(normalized);
|
|
3733
|
+
};
|
|
3734
|
+
var hexToRgba = function (hexColor, alpha) {
|
|
3735
|
+
var hex = hexColor.replace("#", "");
|
|
3736
|
+
var parsed = hex.length === 3
|
|
3737
|
+
? hex
|
|
3738
|
+
.split("")
|
|
3739
|
+
.map(function (c) { return c + c; })
|
|
3740
|
+
.join("")
|
|
3741
|
+
: hex;
|
|
3742
|
+
var r = parseInt(parsed.slice(0, 2), 16);
|
|
3743
|
+
var g = parseInt(parsed.slice(2, 4), 16);
|
|
3744
|
+
var b = parseInt(parsed.slice(4, 6), 16);
|
|
3745
|
+
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")");
|
|
3746
|
+
};
|
|
3747
|
+
var colorWithAlpha = function (color, alpha) {
|
|
3748
|
+
if (isHexColor(color)) {
|
|
3749
|
+
var normalized = color.startsWith("#") ? color : "#".concat(color);
|
|
3750
|
+
return hexToRgba(normalized, alpha);
|
|
3751
|
+
}
|
|
3752
|
+
return "color-mix(in srgb, ".concat(color, " ").concat(Math.round(alpha * 100), "%, transparent)");
|
|
3753
|
+
};
|
|
3754
|
+
var STATE_ANIMATIONS = {
|
|
3755
|
+
excited: {
|
|
3756
|
+
scale: [1, 1.05, 1],
|
|
3757
|
+
rotate: [0, 5, -5, 0],
|
|
3758
|
+
},
|
|
3759
|
+
thinking: {
|
|
3760
|
+
scale: [1, 0.95, 1],
|
|
3761
|
+
rotate: [0, 360],
|
|
3762
|
+
transition: {
|
|
3763
|
+
rotate: { duration: 8, repeat: Infinity, ease: "linear" },
|
|
3764
|
+
},
|
|
3765
|
+
},
|
|
3766
|
+
happy: {
|
|
3767
|
+
y: [0, -10, 0],
|
|
3768
|
+
},
|
|
3769
|
+
concerned: {
|
|
3770
|
+
scale: [1, 0.9, 1],
|
|
3771
|
+
opacity: [1, 0.8, 1],
|
|
3772
|
+
},
|
|
3773
|
+
learning: {
|
|
3774
|
+
scale: [1, 1.1, 1],
|
|
3775
|
+
rotate: [0, -5, 5, 0],
|
|
3776
|
+
},
|
|
3777
|
+
surprised: {
|
|
3778
|
+
scale: [1, 1.2, 1],
|
|
3779
|
+
y: [0, -15, 0],
|
|
3780
|
+
},
|
|
3781
|
+
inspired: {
|
|
3782
|
+
scale: [1, 1.15, 1],
|
|
3783
|
+
},
|
|
3784
|
+
};
|
|
3785
|
+
var AuraGlow = function (_a) {
|
|
3786
|
+
var _b;
|
|
3787
|
+
var _c = _a.state, state = _c === void 0 ? "happy" : _c, _d = _a.size, size = _d === void 0 ? "xl" : _d, _e = _a.animated, animated = _e === void 0 ? true : _e, _f = _a.className, className = _f === void 0 ? "" : _f;
|
|
3788
|
+
var auraBaseColor = DEFAULT_AURA_COLOR;
|
|
3789
|
+
var auraStrong = colorWithAlpha(auraBaseColor, 0.6);
|
|
3790
|
+
var auraMedium = colorWithAlpha(auraBaseColor, 0.45);
|
|
3791
|
+
var auraSoft = colorWithAlpha(auraBaseColor, 0.25);
|
|
3792
|
+
var auraGlow = colorWithAlpha(auraBaseColor, 0.8);
|
|
3793
|
+
var animations = animated && STATE_ANIMATIONS[state] ? STATE_ANIMATIONS[state] : {};
|
|
3794
|
+
var dimension = (_b = ORB_SIZES[size]) !== null && _b !== void 0 ? _b : ORB_SIZES.xl;
|
|
3795
|
+
return (jsxRuntime.jsxs(framerMotion.motion.div, { animate: animated
|
|
3796
|
+
? __assign({ y: [0, -12, 0] }, animations) : {}, transition: {
|
|
3797
|
+
y: { duration: 5, repeat: Infinity, ease: "easeInOut" },
|
|
3798
|
+
default: { duration: 0.5 },
|
|
3799
|
+
}, className: className, style: {
|
|
3800
|
+
width: "".concat(dimension, "px"),
|
|
3801
|
+
height: "".concat(dimension, "px"),
|
|
3802
|
+
position: "relative",
|
|
3803
|
+
background: "none",
|
|
3804
|
+
border: "none",
|
|
3805
|
+
boxShadow: "none",
|
|
3806
|
+
outline: "none",
|
|
3807
|
+
}, children: [jsxRuntime.jsx(framerMotion.motion.div, { animate: {
|
|
3808
|
+
opacity: [0.2, 0.5, 0.2],
|
|
3809
|
+
scale: [1, 1.3, 1],
|
|
3810
|
+
rotate: [0, 180, 360],
|
|
3811
|
+
}, transition: {
|
|
3812
|
+
duration: 8,
|
|
3813
|
+
repeat: Infinity,
|
|
3814
|
+
ease: "easeInOut",
|
|
3815
|
+
}, className: "pointer-events-none", style: {
|
|
3816
|
+
position: "absolute",
|
|
3817
|
+
top: "-50%",
|
|
3818
|
+
left: "-50%",
|
|
3819
|
+
right: "-50%",
|
|
3820
|
+
bottom: "-50%",
|
|
3821
|
+
background: "radial-gradient(circle, ".concat(auraMedium, " 0%, ").concat(auraSoft, " 50%, transparent 70%)"),
|
|
3822
|
+
filter: "blur(40px)",
|
|
3823
|
+
borderRadius: "9999px",
|
|
3824
|
+
border: "none",
|
|
3825
|
+
boxShadow: "none",
|
|
3826
|
+
} }), jsxRuntime.jsx(framerMotion.motion.div, { animate: {
|
|
3827
|
+
opacity: [0.4, 0.7, 0.4],
|
|
3828
|
+
scale: [1.1, 1.25, 1.1],
|
|
3829
|
+
rotate: [360, 0],
|
|
3830
|
+
}, transition: {
|
|
3831
|
+
duration: 10,
|
|
3832
|
+
repeat: Infinity,
|
|
3833
|
+
ease: "linear",
|
|
3834
|
+
}, className: "pointer-events-none", style: {
|
|
3835
|
+
position: "absolute",
|
|
3836
|
+
top: "-30%",
|
|
3837
|
+
left: "-30%",
|
|
3838
|
+
right: "-30%",
|
|
3839
|
+
bottom: "-30%",
|
|
3840
|
+
background: "radial-gradient(ellipse, ".concat(auraStrong, " 0%, ").concat(auraMedium, " 40%, ").concat(auraSoft, " 70%, transparent 100%)"),
|
|
3841
|
+
filter: "blur(30px)",
|
|
3842
|
+
borderRadius: "9999px",
|
|
3843
|
+
border: "none",
|
|
3844
|
+
boxShadow: "none",
|
|
3845
|
+
} }), jsxRuntime.jsx(framerMotion.motion.div, { animate: {
|
|
3846
|
+
opacity: [0.6, 1, 0.6],
|
|
3847
|
+
scale: [0.9, 1.1, 0.9],
|
|
3848
|
+
}, transition: {
|
|
3849
|
+
duration: 3,
|
|
3850
|
+
repeat: Infinity,
|
|
3851
|
+
ease: "easeInOut",
|
|
3852
|
+
}, className: "pointer-events-none", style: {
|
|
3853
|
+
position: "absolute",
|
|
3854
|
+
top: 0,
|
|
3855
|
+
left: 0,
|
|
3856
|
+
right: 0,
|
|
3857
|
+
bottom: 0,
|
|
3858
|
+
background: "radial-gradient(circle, ".concat(auraGlow, " 0%, ").concat(auraStrong, " 30%, ").concat(auraSoft, " 60%, transparent 100%)"),
|
|
3859
|
+
filter: "blur(20px)",
|
|
3860
|
+
borderRadius: "9999px",
|
|
3861
|
+
border: "none",
|
|
3862
|
+
boxShadow: "none",
|
|
3863
|
+
} }), jsxRuntime.jsx(framerMotion.motion.div, { animate: {
|
|
3864
|
+
opacity: [0.3, 0.8, 0.3],
|
|
3865
|
+
rotate: [0, -360],
|
|
3866
|
+
scale: [1, 1.15, 1],
|
|
3867
|
+
}, transition: {
|
|
3868
|
+
duration: 12,
|
|
3869
|
+
repeat: Infinity,
|
|
3870
|
+
ease: "linear",
|
|
3871
|
+
}, className: "pointer-events-none", style: {
|
|
3872
|
+
position: "absolute",
|
|
3873
|
+
top: "10%",
|
|
3874
|
+
left: "10%",
|
|
3875
|
+
right: "10%",
|
|
3876
|
+
bottom: "10%",
|
|
3877
|
+
background: "conic-gradient(from 0deg, transparent 0deg, ".concat(auraMedium, " 90deg, ").concat(auraSoft, " 180deg, ").concat(auraMedium, " 270deg, transparent 360deg)"),
|
|
3878
|
+
filter: "blur(15px)",
|
|
3879
|
+
mixBlendMode: "screen",
|
|
3880
|
+
borderRadius: "9999px",
|
|
3881
|
+
border: "none",
|
|
3882
|
+
boxShadow: "none",
|
|
3883
|
+
} }), __spreadArray([], Array(3), true).map(function (_, i) { return (jsxRuntime.jsx(framerMotion.motion.div, { animate: {
|
|
3884
|
+
opacity: [0, 0.6, 0],
|
|
3885
|
+
scale: [0.5, 1.5, 0.5],
|
|
3886
|
+
x: [0, (i % 2 === 0 ? 1 : -1) * (15 + i * 5)],
|
|
3887
|
+
y: [0, (i % 2 === 0 ? -1 : 1) * (15 + i * 5)],
|
|
3888
|
+
}, transition: {
|
|
3889
|
+
duration: 4 + i,
|
|
3890
|
+
repeat: Infinity,
|
|
3891
|
+
delay: i * 1.5,
|
|
3892
|
+
ease: "easeInOut",
|
|
3893
|
+
}, className: "absolute w-4 h-4 rounded-full", style: {
|
|
3894
|
+
top: "".concat(30 + i * 20, "%"),
|
|
3895
|
+
left: "".concat(30 + i * 20, "%"),
|
|
3896
|
+
background: i % 2 === 0
|
|
3897
|
+
? "radial-gradient(circle, ".concat(auraGlow, ", transparent)")
|
|
3898
|
+
: "radial-gradient(circle, ".concat(auraMedium, ", transparent)"),
|
|
3899
|
+
filter: "blur(8px)",
|
|
3900
|
+
} }, i)); })] }));
|
|
3901
|
+
};
|
|
3902
|
+
|
|
3903
|
+
var toGraphemes = function (value) {
|
|
3904
|
+
var IntlWithSegmenter = Intl;
|
|
3905
|
+
if (typeof Intl !== "undefined" && IntlWithSegmenter.Segmenter) {
|
|
3906
|
+
var seg = new IntlWithSegmenter.Segmenter("es", { granularity: "grapheme" });
|
|
3907
|
+
return Array.from(seg.segment(value), function (s) { return s.segment; });
|
|
3908
|
+
}
|
|
3909
|
+
return Array.from(value); // fallback
|
|
3910
|
+
};
|
|
3911
|
+
var SpeechBubble = React.memo(function (_a) {
|
|
3912
|
+
var text = _a.text, _b = _a.typing, typing = _b === void 0 ? false : _b, _c = _a.typingSpeed, typingSpeed = _c === void 0 ? DEFAULT_TYPING_SPEED_MS : _c, _d = _a.maxWidth, maxWidth = _d === void 0 ? 700 : _d, _e = _a.className, className = _e === void 0 ? "" : _e, onTypingComplete = _a.onTypingComplete;
|
|
3913
|
+
var _f = React.useState(typing ? "" : typeof text === "string" ? text : ""), displayedText = _f[0], setDisplayedText = _f[1];
|
|
3914
|
+
var _g = React.useState(typing), isTyping = _g[0], setIsTyping = _g[1];
|
|
3915
|
+
var onTypingCompleteRef = React.useRef(onTypingComplete);
|
|
3916
|
+
var intervalIdRef = React.useRef(null);
|
|
3917
|
+
React.useEffect(function () {
|
|
3918
|
+
onTypingCompleteRef.current = onTypingComplete;
|
|
3919
|
+
}, [onTypingComplete]);
|
|
3920
|
+
React.useEffect(function () {
|
|
3921
|
+
var currentText = typeof text === "string" ? toGraphemes(text) : [''];
|
|
3922
|
+
if (!typing) {
|
|
3923
|
+
setDisplayedText(currentText.join(''));
|
|
3924
|
+
setIsTyping(false);
|
|
3925
|
+
return;
|
|
3926
|
+
}
|
|
3927
|
+
if (intervalIdRef.current) {
|
|
3928
|
+
return;
|
|
3929
|
+
}
|
|
3930
|
+
setIsTyping(true);
|
|
3931
|
+
setDisplayedText("");
|
|
3932
|
+
var cancelled = false;
|
|
3933
|
+
var charIndex = 0;
|
|
3934
|
+
intervalIdRef.current = setInterval(function () {
|
|
3935
|
+
var _a, _b;
|
|
3936
|
+
if (cancelled)
|
|
3937
|
+
return;
|
|
3938
|
+
if (charIndex >= currentText.length) {
|
|
3939
|
+
clearInterval((_a = intervalIdRef.current) !== null && _a !== void 0 ? _a : undefined);
|
|
3940
|
+
intervalIdRef.current = null;
|
|
3941
|
+
setIsTyping(false);
|
|
3942
|
+
(_b = onTypingCompleteRef.current) === null || _b === void 0 ? void 0 : _b.call(onTypingCompleteRef);
|
|
3943
|
+
return;
|
|
3944
|
+
}
|
|
3945
|
+
var char = currentText[charIndex];
|
|
3946
|
+
charIndex++;
|
|
3947
|
+
setDisplayedText(function (prev) { return prev + char; });
|
|
3948
|
+
}, typingSpeed);
|
|
3949
|
+
return function () {
|
|
3950
|
+
var _a;
|
|
3951
|
+
if (intervalIdRef.current) {
|
|
3952
|
+
clearInterval((_a = intervalIdRef.current) !== null && _a !== void 0 ? _a : undefined);
|
|
3953
|
+
intervalIdRef.current = null;
|
|
3954
|
+
}
|
|
3955
|
+
cancelled = true;
|
|
3956
|
+
};
|
|
3957
|
+
}, []);
|
|
3958
|
+
return (jsxRuntime.jsxs(framerMotion.motion.div, { initial: { opacity: 0, y: 12, scale: 0.97 }, animate: { opacity: 1, y: 0, scale: 1 }, transition: {
|
|
3959
|
+
duration: 0.6,
|
|
3960
|
+
ease: [0.4, 0.0, 0.2, 1],
|
|
3961
|
+
}, className: "relative ".concat(className), style: { maxWidth: "".concat(maxWidth, "px") }, children: [jsxRuntime.jsx("div", { className: "bg-white/85 dark:bg-gray-900/85 backdrop-blur-xl rounded-3xl px-8 py-6 shadow-[0_8px_30px_rgba(0,0,0,0.04)] dark:shadow-[0_8px_30px_rgba(0,0,0,0.3)] border border-white/50 dark:border-gray-800/50", children: jsxRuntime.jsxs("p", { className: "text-lg text-gray-800 dark:text-gray-200 leading-relaxed font-sans font-normal", children: [displayedText, isTyping && (jsxRuntime.jsx(framerMotion.motion.span, { animate: { opacity: [0.3, 1, 0.3] }, transition: {
|
|
3962
|
+
duration: 1.2,
|
|
3963
|
+
repeat: Infinity,
|
|
3964
|
+
ease: "easeInOut",
|
|
3965
|
+
}, className: "inline-block ml-1.5 w-0.5 h-5 bg-blue-500/50 align-middle rounded-full" }))] }) }), jsxRuntime.jsx("div", { className: "absolute -top-2 left-10 w-4 h-4 bg-white/85 dark:bg-gray-900/85 border-l border-t border-white/50 dark:border-gray-800/50 transform rotate-45 backdrop-blur-xl" })] }));
|
|
3966
|
+
});
|
|
3967
|
+
|
|
3968
|
+
/**
|
|
3969
|
+
* AssistantOrb
|
|
3970
|
+
*
|
|
3971
|
+
* A compound component that renders an animated aurora orb
|
|
3972
|
+
* with a speech bubble featuring a character-by-character typing effect.
|
|
3973
|
+
* Designed for AI assistant UIs with AuraUI system theming.
|
|
3974
|
+
*/
|
|
3975
|
+
var AssistantOrb = function (_a) {
|
|
3976
|
+
var _b;
|
|
3977
|
+
var text = _a.text, _c = _a.state, state = _c === void 0 ? "happy" : _c, _d = _a.size, size = _d === void 0 ? "xl" : _d, _e = _a.animated, animated = _e === void 0 ? true : _e, _f = _a.typing, typing = _f === void 0 ? false : _f, _g = _a.typingSpeed, typingSpeed = _g === void 0 ? DEFAULT_TYPING_SPEED_MS : _g, hint = _a.hint, _h = _a.maxWidth, maxWidth = _h === void 0 ? DEFAULT_MAX_WIDTH : _h, onTypingComplete = _a.onTypingComplete, translations = _a.translations, _j = _a.className, className = _j === void 0 ? "" : _j;
|
|
3978
|
+
var hintText = (_b = translations === null || translations === void 0 ? void 0 : translations.hint) !== null && _b !== void 0 ? _b : hint;
|
|
3979
|
+
var handleTypingComplete = React.useCallback(function () {
|
|
3980
|
+
onTypingComplete === null || onTypingComplete === void 0 ? void 0 : onTypingComplete();
|
|
3981
|
+
}, []);
|
|
3982
|
+
return (jsxRuntime.jsxs("div", { className: "relative flex flex-col items-center gap-6 max-w-md ".concat(className), children: [jsxRuntime.jsx(AuraGlow, { state: state, size: size, animated: animated }), jsxRuntime.jsx(SpeechBubble, { text: text, typing: typing, typingSpeed: typingSpeed, maxWidth: maxWidth, onTypingComplete: handleTypingComplete }), hintText && (jsxRuntime.jsx(framerMotion.motion.p, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: {
|
|
3983
|
+
delay: 0.6,
|
|
3984
|
+
duration: 0.6,
|
|
3985
|
+
ease: [0.4, 0.0, 0.2, 1],
|
|
3986
|
+
}, className: "text-sm text-gray-500 dark:text-gray-400 text-center mt-4 font-normal", children: hintText }))] }));
|
|
3987
|
+
};
|
|
3988
|
+
|
|
3989
|
+
var TYPING_SPEED_MS = 15;
|
|
3990
|
+
var DESKTOP_BREAKPOINT_PX = 1024;
|
|
3991
|
+
var WELCOME_GRADIENTS = [
|
|
3992
|
+
"linear-gradient(135deg, rgba(59, 130, 246, 0.03) 0%, rgba(147, 51, 234, 0.02) 50%, rgba(168, 85, 247, 0.02) 100%)",
|
|
3993
|
+
"linear-gradient(135deg, rgba(147, 51, 234, 0.03) 0%, rgba(168, 85, 247, 0.02) 50%, rgba(59, 130, 246, 0.02) 100%)",
|
|
3994
|
+
"linear-gradient(135deg, rgba(168, 85, 247, 0.03) 0%, rgba(59, 130, 246, 0.02) 50%, rgba(147, 51, 234, 0.02) 100%)",
|
|
3995
|
+
];
|
|
3996
|
+
var AURORAS = [
|
|
3997
|
+
{
|
|
3998
|
+
size: "w-[700px] h-[700px]",
|
|
3999
|
+
color: "from-blue-400/4 to-transparent",
|
|
4000
|
+
position: { top: "10%", left: "10%" },
|
|
4001
|
+
duration: 45,
|
|
4002
|
+
},
|
|
4003
|
+
{
|
|
4004
|
+
size: "w-[600px] h-[600px]",
|
|
4005
|
+
color: "from-purple-400/4 to-transparent",
|
|
4006
|
+
position: { bottom: "15%", right: "15%" },
|
|
4007
|
+
duration: 50,
|
|
4008
|
+
},
|
|
4009
|
+
{
|
|
4010
|
+
size: "w-[500px] h-[500px]",
|
|
4011
|
+
color: "from-violet-400/3 to-transparent",
|
|
4012
|
+
position: { top: "50%", left: "50%" },
|
|
4013
|
+
duration: 55,
|
|
4014
|
+
},
|
|
4015
|
+
];
|
|
4016
|
+
var DEFAULT_TRANSLATIONS$1 = {
|
|
4017
|
+
backButtonLabel: "Atras",
|
|
4018
|
+
};
|
|
4019
|
+
var BackButton = function (_a) {
|
|
4020
|
+
var onPress = _a.onPress, _b = _a.visible, visible = _b === void 0 ? true : _b, _c = _a.className, className = _c === void 0 ? "" : _c, label = _a.label;
|
|
4021
|
+
if (!visible) {
|
|
4022
|
+
return null;
|
|
4023
|
+
}
|
|
4024
|
+
return (jsxRuntime.jsx("div", { className: "fixed top-6 left-6 z-30 ".concat(className), children: jsxRuntime.jsx(react.Button, { variant: "light", size: "sm", onPress: onPress, className: "bg-transparent hover:bg-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 px-3", startContent: jsxRuntime.jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M15 19l-7-7 7-7" }) }), children: label }) }));
|
|
4025
|
+
};
|
|
4026
|
+
var Aurora = function (_a) {
|
|
4027
|
+
var size = _a.size, color = _a.color, position = _a.position, duration = _a.duration, _b = _a.delay, delay = _b === void 0 ? 0 : _b;
|
|
4028
|
+
return (jsxRuntime.jsx(framerMotion.motion.div, { className: "absolute ".concat(size, " rounded-full bg-gradient-radial ").concat(color, " blur-3xl"), style: position, animate: {
|
|
4029
|
+
x: [0, 40, -20, 0],
|
|
4030
|
+
y: [0, -30, 20, 0],
|
|
4031
|
+
scale: [1, 1.1, 0.95, 1],
|
|
4032
|
+
opacity: [0.3, 0.5, 0.35, 0.3],
|
|
4033
|
+
}, transition: {
|
|
4034
|
+
duration: duration,
|
|
4035
|
+
repeat: Number.POSITIVE_INFINITY,
|
|
4036
|
+
ease: [0.4, 0.0, 0.2, 1],
|
|
4037
|
+
delay: delay,
|
|
4038
|
+
} }));
|
|
4039
|
+
};
|
|
4040
|
+
var AnimatedBackground = function (_a) {
|
|
4041
|
+
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
4042
|
+
return (jsxRuntime.jsxs("div", { className: "absolute inset-0 z-0 overflow-hidden pointer-events-none ".concat(className), children: [jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-br from-gray-50 via-white to-gray-50 dark:from-gray-950 dark:via-gray-900 dark:to-gray-950" }), jsxRuntime.jsx(framerMotion.motion.div, { className: "absolute inset-0", animate: { background: WELCOME_GRADIENTS }, transition: {
|
|
4043
|
+
duration: 30,
|
|
4044
|
+
repeat: Number.POSITIVE_INFINITY,
|
|
4045
|
+
ease: "linear",
|
|
4046
|
+
} }), AURORAS.map(function (aurora, index) { return (jsxRuntime.jsx(Aurora, __assign({}, aurora, { delay: index * 5 }), aurora.duration)); })] }));
|
|
4047
|
+
};
|
|
4048
|
+
var TwoColumnLayoutAgent = function (_a) {
|
|
4049
|
+
var _b = _a.assistantState, assistantState = _b === void 0 ? "happy" : _b, assistantSpeech = _a.assistantSpeech, _c = _a.assistantSize, assistantSize = _c === void 0 ? "xl" : _c, assistantHint = _a.assistantHint, _d = _a.enableSequence, enableSequence = _d === void 0 ? true : _d, children = _a.children, _e = _a.showBackButton, showBackButton = _e === void 0 ? false : _e, onBack = _a.onBack, _f = _a.translations, translations = _f === void 0 ? {} : _f, _g = _a.className, className = _g === void 0 ? "" : _g;
|
|
4050
|
+
var _h = React.useState(!enableSequence), showRightContent = _h[0], setShowRightContent = _h[1];
|
|
4051
|
+
var isDesktop = useMediaQuery("(min-width: ".concat(DESKTOP_BREAKPOINT_PX, "px)"));
|
|
4052
|
+
var t = React.useMemo(function () { return (__assign(__assign({}, DEFAULT_TRANSLATIONS$1), translations)); }, [translations]);
|
|
4053
|
+
var handleBackPress = onBack !== null && onBack !== void 0 ? onBack : (function () { return undefined; });
|
|
4054
|
+
React.useEffect(function () {
|
|
4055
|
+
if (enableSequence && !showRightContent) {
|
|
4056
|
+
var safetyTimeout_1 = setTimeout(function () {
|
|
4057
|
+
setShowRightContent(true);
|
|
4058
|
+
}, 10000);
|
|
4059
|
+
return function () { return clearTimeout(safetyTimeout_1); };
|
|
4060
|
+
}
|
|
4061
|
+
}, [enableSequence, showRightContent]);
|
|
4062
|
+
var handleTypingComplete = function () {
|
|
4063
|
+
setTimeout(function () {
|
|
4064
|
+
setShowRightContent(true);
|
|
4065
|
+
}, 100);
|
|
4066
|
+
};
|
|
4067
|
+
return (jsxRuntime.jsxs("div", { className: "min-h-screen relative isolate overflow-hidden ".concat(className), children: [jsxRuntime.jsx(BackButton, { onPress: handleBackPress, visible: showBackButton, label: t.backButtonLabel }), jsxRuntime.jsx(AnimatedBackground, {}), jsxRuntime.jsx("div", { className: "relative z-10 flex flex-col h-screen", children: jsxRuntime.jsxs("div", { className: "flex-grow flex overflow-hidden", children: [jsxRuntime.jsx(framerMotion.motion.div, { initial: { opacity: 0, x: -30 }, animate: { opacity: 1, x: 0 }, transition: { duration: 0.8, ease: [0.4, 0.0, 0.2, 1] }, className: "".concat(isDesktop ? "flex w-2/5" : "hidden", " flex-col items-center justify-center p-8 xl:p-12"), children: jsxRuntime.jsx(AssistantOrb, { text: assistantSpeech, state: assistantState, size: assistantSize, animated: true, typing: enableSequence, typingSpeed: TYPING_SPEED_MS, hint: assistantHint, onTypingComplete: handleTypingComplete }) }), jsxRuntime.jsxs("div", { className: "".concat(isDesktop ? "w-3/5 p-12" : "w-full p-6 sm:p-8", " flex flex-col items-center justify-center overflow-y-auto"), children: [!isDesktop && (jsxRuntime.jsx("div", { className: "mb-8 flex flex-col items-center gap-4", children: jsxRuntime.jsx(AssistantOrb, { text: assistantSpeech, state: assistantState, size: "lg", animated: true, typing: false }) })), jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: showRightContent && (jsxRuntime.jsx(framerMotion.motion.div, { initial: { opacity: 0, x: 30 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -30 }, transition: { duration: 0.6, ease: [0.4, 0.0, 0.2, 1] }, className: "w-full max-w-2xl", children: children }, "right-content")) })] })] }) })] }));
|
|
4068
|
+
};
|
|
4069
|
+
|
|
3890
4070
|
// Traducciones por defecto en español
|
|
3891
4071
|
var defaultTranslations$1 = {
|
|
3892
4072
|
uploadText: "Da clic y selecciona tus archivos",
|
|
@@ -5503,6 +5683,7 @@ exports.ThemePicker = ThemePicker;
|
|
|
5503
5683
|
exports.ThemeProvider = ThemeProvider;
|
|
5504
5684
|
exports.TimeInputComponent = TimeInput;
|
|
5505
5685
|
exports.ToastContext = ToastContext;
|
|
5686
|
+
exports.TwoColumnLayoutAgent = TwoColumnLayoutAgent;
|
|
5506
5687
|
exports.UploadFile = UploadFile;
|
|
5507
5688
|
exports.VerticalSteps = VerticalSteps;
|
|
5508
5689
|
exports.Wizard = Wizard;
|
|
@@ -5512,6 +5693,7 @@ exports.defaultTranslations = defaultTranslations$4;
|
|
|
5512
5693
|
exports.sizeMap = sizeMap;
|
|
5513
5694
|
exports.themeColors = themeColors;
|
|
5514
5695
|
exports.useAuraToast = useAuraToast;
|
|
5696
|
+
exports.useMediaQuery = useMediaQuery;
|
|
5515
5697
|
exports.useNavigationLoading = useNavigationLoading;
|
|
5516
5698
|
exports.useThemeContext = useThemeContext;
|
|
5517
5699
|
Object.keys(react).forEach(function (k) {
|