@raystack/apsara 0.20.0 → 0.20.2
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/calendar/date-picker.d.ts.map +1 -1
- package/dist/index.cjs +20 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -8
- package/dist/index.js.map +1 -1
- package/dist/tooltip/tooltip.d.ts +6 -1
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/package.json +14 -13
package/dist/index.js
CHANGED
|
@@ -2819,10 +2819,10 @@ var SunIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
2819
2819
|
}));
|
|
2820
2820
|
});
|
|
2821
2821
|
|
|
2822
|
-
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
2822
|
+
function r$1(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r$1(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx$1(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r$1(e))&&(n&&(n+=" "),n+=t);return n}
|
|
2823
2823
|
|
|
2824
2824
|
const falsyToString = (value)=>typeof value === "boolean" ? "".concat(value) : value === 0 ? "0" : value;
|
|
2825
|
-
const cx = clsx;
|
|
2825
|
+
const cx = clsx$1;
|
|
2826
2826
|
const cva = (base, config)=>{
|
|
2827
2827
|
return (props)=>{
|
|
2828
2828
|
var ref;
|
|
@@ -4362,7 +4362,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
4362
4362
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
4363
4363
|
PERFORMANCE OF THIS SOFTWARE.
|
|
4364
4364
|
***************************************************************************** */
|
|
4365
|
-
/* global Reflect, Promise */
|
|
4365
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
4366
4366
|
|
|
4367
4367
|
|
|
4368
4368
|
var __assign = function() {
|
|
@@ -4396,7 +4396,12 @@ function __spreadArray(to, from, pack) {
|
|
|
4396
4396
|
}
|
|
4397
4397
|
}
|
|
4398
4398
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
4399
|
-
}
|
|
4399
|
+
}
|
|
4400
|
+
|
|
4401
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
4402
|
+
var e = new Error(message);
|
|
4403
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
4404
|
+
};
|
|
4400
4405
|
|
|
4401
4406
|
var zeroRightClassName = 'right-scroll-bar-position';
|
|
4402
4407
|
var fullWidthClassName = 'width-before-scroll-bar';
|
|
@@ -22443,8 +22448,10 @@ const $a093c7e1ec25a057$export$7c6e2c02157bb7d2 = $a093c7e1ec25a057$export$e9003
|
|
|
22443
22448
|
|
|
22444
22449
|
var styles$8 = {"trigger":"tooltip-module_trigger__-ySkn","content":"tooltip-module_content__SeE6X"};
|
|
22445
22450
|
|
|
22446
|
-
|
|
22447
|
-
|
|
22451
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
22452
|
+
|
|
22453
|
+
const Tooltip = ({ children, message, disabled, side = "right", classes, }) => {
|
|
22454
|
+
return disabled ? (children) : (jsxRuntimeExports.jsx($a093c7e1ec25a057$export$2881499e37b75b9a, { children: jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$be92b6f5f03c0fe9, { disableHoverableContent: false, children: [jsxRuntimeExports.jsx($a093c7e1ec25a057$export$41fb9f06171c75f4, { asChild: true, children: jsxRuntimeExports.jsx("div", { className: clsx(styles$8.trigger, classes?.trigger ?? ""), children: children }) }), jsxRuntimeExports.jsx($a093c7e1ec25a057$export$602eac185826482c, { children: jsxRuntimeExports.jsx($a093c7e1ec25a057$export$7c6e2c02157bb7d2, { side: side, sideOffset: 5, className: clsx(styles$8.content, classes?.content ?? ""), children: typeof message === "string" ? jsxRuntimeExports.jsx(Text, { children: message }) : message }) })] }) }));
|
|
22448
22455
|
};
|
|
22449
22456
|
|
|
22450
22457
|
const $b3bbe2732c13b576$export$bea8ebba691c5813 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
@@ -28143,6 +28150,10 @@ function DatePicker({ side = "top", dateFormat = "DD/MM/YYYY", placeholder = "DD
|
|
|
28143
28150
|
const textFieldRef = useRef(null);
|
|
28144
28151
|
const contentRef = useRef(null);
|
|
28145
28152
|
const isInputFieldFocused = useRef(false);
|
|
28153
|
+
const calendarValRef = useRef(value);
|
|
28154
|
+
useEffect(() => {
|
|
28155
|
+
calendarValRef.current = calendarVal;
|
|
28156
|
+
}, [calendarVal]);
|
|
28146
28157
|
function isElementOutside(el) {
|
|
28147
28158
|
return !isDropdownOpenRef.current && // Month and Year dropdown from Date picker
|
|
28148
28159
|
!textFieldRef.current?.contains(el) && // TextField
|
|
@@ -28155,12 +28166,12 @@ function DatePicker({ side = "top", dateFormat = "DD/MM/YYYY", placeholder = "DD
|
|
|
28155
28166
|
}, []);
|
|
28156
28167
|
function registerEventListeners() {
|
|
28157
28168
|
isInputFieldFocused.current = true;
|
|
28158
|
-
document.addEventListener('mouseup', handleMouseDown
|
|
28169
|
+
document.addEventListener('mouseup', handleMouseDown);
|
|
28159
28170
|
}
|
|
28160
28171
|
function removeEventListeners() {
|
|
28161
28172
|
isInputFieldFocused.current = false;
|
|
28162
28173
|
setShowCalendar(false);
|
|
28163
|
-
const updatedVal = dayjs(
|
|
28174
|
+
const updatedVal = dayjs(calendarValRef.current).format(dateFormat);
|
|
28164
28175
|
if (textFieldRef.current)
|
|
28165
28176
|
textFieldRef.current.value = updatedVal;
|
|
28166
28177
|
if (inputState === undefined)
|
|
@@ -28170,6 +28181,7 @@ function DatePicker({ side = "top", dateFormat = "DD/MM/YYYY", placeholder = "DD
|
|
|
28170
28181
|
const handleSelect = (day) => {
|
|
28171
28182
|
onSelect(day);
|
|
28172
28183
|
setCalendarVal(day);
|
|
28184
|
+
calendarValRef.current = day;
|
|
28173
28185
|
setInputState(undefined);
|
|
28174
28186
|
removeEventListeners();
|
|
28175
28187
|
};
|