@raystack/apsara 0.20.4 → 0.21.1
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/calendar.d.ts +10 -3
- package/dist/calendar/calendar.d.ts.map +1 -1
- package/dist/dialog/dialog.d.ts +5 -1
- package/dist/dialog/dialog.d.ts.map +1 -1
- package/dist/index.cjs +128 -100
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -0
- package/dist/index.js +128 -100
- package/dist/index.js.map +1 -1
- package/dist/popover/popover.d.ts +1 -0
- package/dist/popover/popover.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { DayPickerProps } from
|
|
1
|
+
import { DayPickerProps } from 'react-day-picker';
|
|
2
2
|
interface OnDropdownOpen {
|
|
3
3
|
onDropdownOpen?: VoidFunction;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
interface CalendarPropsExtended {
|
|
6
|
+
showTooltip?: boolean;
|
|
7
|
+
tooltipMessages?: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
loadingData?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export type CalendarProps = DayPickerProps & OnDropdownOpen & CalendarPropsExtended;
|
|
13
|
+
export declare const Calendar: ({ className, classNames, showOutsideDays, onDropdownOpen, showTooltip, tooltipMessages, loadingData, ...props }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
14
|
export {};
|
|
8
15
|
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../calendar/calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../calendar/calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAEf,MAAM,kBAAkB,CAAC;AAe1B,UAAU,cAAc;IACtB,cAAc,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,UAAU,qBAAqB;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,aAAa,GAAG,cAAc,GACxC,cAAc,GACd,qBAAqB,CAAC;AAmExB,eAAO,MAAM,QAAQ,oHASlB,aAAa,4CAsEf,CAAC"}
|
package/dist/dialog/dialog.d.ts
CHANGED
|
@@ -8,8 +8,11 @@ export declare const DialogContent: import("react").ForwardRefExoticComponent<Di
|
|
|
8
8
|
close?: boolean | undefined;
|
|
9
9
|
overlayStyle?: import("react").CSSProperties | undefined;
|
|
10
10
|
overlayClassname?: string | undefined;
|
|
11
|
+
overlayBlur?: boolean | undefined;
|
|
11
12
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
-
declare const overlay: (props?:
|
|
13
|
+
declare const overlay: (props?: ({
|
|
14
|
+
blur?: boolean | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
13
16
|
export interface OverlayProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>, VariantProps<typeof overlay> {
|
|
14
17
|
}
|
|
15
18
|
type CloseButtonProps = ComponentProps<typeof DialogPrimitive.Close>;
|
|
@@ -20,6 +23,7 @@ export declare const Dialog: import("react").FC<DialogPrimitive.DialogProps> & {
|
|
|
20
23
|
close?: boolean | undefined;
|
|
21
24
|
overlayStyle?: import("react").CSSProperties | undefined;
|
|
22
25
|
overlayClassname?: string | undefined;
|
|
26
|
+
overlayBlur?: boolean | undefined;
|
|
23
27
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
28
|
Close: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
25
29
|
Title: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../dialog/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,wBAAwB,EAGzB,MAAM,OAAO,CAAC;AAIf,QAAA,MAAM,aAAa,yFAA4B,CAAC;AAEhD,MAAM,WAAW,kBACf,SAAQ,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EAC9D,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAEzC,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../dialog/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,wBAAwB,EAGzB,MAAM,OAAO,CAAC;AAIf,QAAA,MAAM,aAAa,yFAA4B,CAAC;AAEhD,MAAM,WAAW,kBACf,SAAQ,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EAC9D,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAEzC,eAAO,MAAM,aAAa;;;;;kDAgCzB,CAAC;AAEF,QAAA,MAAM,OAAO;;mFAMX,CAAC;AACH,MAAM,WAAW,YACf,SAAQ,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EAC9D,YAAY,CAAC,OAAO,OAAO,CAAC;CAAG;AAgBnC,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AACrE,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,gBAAgB,2CAMlB;AAED,eAAO,MAAM,MAAM;;;;;;;;;;;CAMjB,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -6676,14 +6676,20 @@ const $5d3850c4d0b4e6c7$export$f99233281efd08a0 = $5d3850c4d0b4e6c7$export$16f76
|
|
|
6676
6676
|
const $5d3850c4d0b4e6c7$export$393edc798c47379d = $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5;
|
|
6677
6677
|
const $5d3850c4d0b4e6c7$export$f39c2d165cd861fe = $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac;
|
|
6678
6678
|
|
|
6679
|
-
var styles$t = {"dialogContent":"dialog-module_dialogContent__bljTL","overlay":"dialog-module_overlay__t-jUE","close":"dialog-module_close__n9JNt"};
|
|
6679
|
+
var styles$t = {"dialogContent":"dialog-module_dialogContent__bljTL","overlayBlur":"dialog-module_overlayBlur__-RCHk","overlay":"dialog-module_overlay__t-jUE","close":"dialog-module_close__n9JNt"};
|
|
6680
6680
|
|
|
6681
6681
|
const dialogContent = cva(styles$t.dialogContent);
|
|
6682
|
-
const DialogContent = React.forwardRef(({ className, children, close, overlayStyle, overlayClassname, ...props }, forwardedRef) => {
|
|
6683
|
-
return (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$602eac185826482c, { children: jsxRuntimeExports.jsx(Overlay$1, { className: overlayClassname, style: overlayStyle, children: jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, { ...props, ref: forwardedRef, className: dialogContent({ className }), children: [children, close && (jsxRuntimeExports.jsx(CloseButton$1, { children: jsxRuntimeExports.jsx(Cross1Icon, {}) }))] }) }) }));
|
|
6682
|
+
const DialogContent = React.forwardRef(({ className, children, close, overlayStyle, overlayClassname, overlayBlur, ...props }, forwardedRef) => {
|
|
6683
|
+
return (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$602eac185826482c, { children: jsxRuntimeExports.jsx(Overlay$1, { className: overlayClassname, style: overlayStyle, blur: overlayBlur, children: jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, { ...props, ref: forwardedRef, className: dialogContent({ className }), children: [children, close && (jsxRuntimeExports.jsx(CloseButton$1, { children: jsxRuntimeExports.jsx(Cross1Icon, {}) }))] }) }) }));
|
|
6684
6684
|
});
|
|
6685
|
-
const overlay$1 = cva(styles$t.overlay
|
|
6686
|
-
|
|
6685
|
+
const overlay$1 = cva(styles$t.overlay, {
|
|
6686
|
+
variants: {
|
|
6687
|
+
blur: {
|
|
6688
|
+
true: styles$t.overlayBlur,
|
|
6689
|
+
},
|
|
6690
|
+
},
|
|
6691
|
+
});
|
|
6692
|
+
const Overlay$1 = React.forwardRef(({ className, blur, ...props }, ref) => (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, { ref: ref, className: overlay$1({ className, blur }), ...props })));
|
|
6687
6693
|
Overlay$1.displayName = $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff.displayName;
|
|
6688
6694
|
const close$1 = cva(styles$t.close);
|
|
6689
6695
|
function CloseButton$1({ children, className, ...props }) {
|
|
@@ -10422,6 +10428,20 @@ const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /*#__PURE__*/ React.forward
|
|
|
10422
10428
|
}
|
|
10423
10429
|
}))));
|
|
10424
10430
|
});
|
|
10431
|
+
/* -------------------------------------------------------------------------------------------------
|
|
10432
|
+
* PopoverClose
|
|
10433
|
+
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$CLOSE_NAME = 'PopoverClose';
|
|
10434
|
+
const $cb5cc270b50c6fcd$export$d6ac43ebaa40d53e = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
10435
|
+
const { __scopePopover: __scopePopover , ...closeProps } = props;
|
|
10436
|
+
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CLOSE_NAME, __scopePopover);
|
|
10437
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.button, _extends({
|
|
10438
|
+
type: "button"
|
|
10439
|
+
}, closeProps, {
|
|
10440
|
+
ref: forwardedRef,
|
|
10441
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onClick, ()=>context.onOpenChange(false)
|
|
10442
|
+
)
|
|
10443
|
+
}));
|
|
10444
|
+
});
|
|
10425
10445
|
/* -----------------------------------------------------------------------------------------------*/ function $cb5cc270b50c6fcd$var$getState(open) {
|
|
10426
10446
|
return open ? 'open' : 'closed';
|
|
10427
10447
|
}
|
|
@@ -10429,6 +10449,7 @@ const $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9 = $cb5cc270b50c6fcd$export$5b6b1
|
|
|
10429
10449
|
const $cb5cc270b50c6fcd$export$41fb9f06171c75f4 = $cb5cc270b50c6fcd$export$7dacb05d26466c3;
|
|
10430
10450
|
const $cb5cc270b50c6fcd$export$602eac185826482c = $cb5cc270b50c6fcd$export$dd679ffb4362d2d4;
|
|
10431
10451
|
const $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2 = $cb5cc270b50c6fcd$export$d7e1f420b25549ff;
|
|
10452
|
+
const $cb5cc270b50c6fcd$export$f39c2d165cd861fe = $cb5cc270b50c6fcd$export$d6ac43ebaa40d53e;
|
|
10432
10453
|
|
|
10433
10454
|
var styles$i = {"popover":"popover-module_popover__Jh8Hg"};
|
|
10434
10455
|
|
|
@@ -10437,6 +10458,7 @@ const PopoverContent = React.forwardRef(({ className, align = "center", sideOffs
|
|
|
10437
10458
|
PopoverContent.displayName = $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2.displayName;
|
|
10438
10459
|
const Popover = Object.assign($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, {
|
|
10439
10460
|
Trigger: $cb5cc270b50c6fcd$export$41fb9f06171c75f4,
|
|
10461
|
+
Close: $cb5cc270b50c6fcd$export$f39c2d165cd861fe,
|
|
10440
10462
|
Content: PopoverContent,
|
|
10441
10463
|
});
|
|
10442
10464
|
|
|
@@ -28054,6 +28076,97 @@ function DayPicker(props) {
|
|
|
28054
28076
|
|
|
28055
28077
|
var styles$6 = {"calendarRoot":"calendar-module_calendarRoot__KnBz-","caption_label":"calendar-module_caption_label__C5Ys7","dropdowns":"calendar-module_dropdowns__Wn53e","dropdown_trigger":"calendar-module_dropdown_trigger__dsyaq","dropdown_item_text":"calendar-module_dropdown_item_text__Tudqv","nav_button":"calendar-module_nav_button__8W5py","nav_button_previous":"calendar-module_nav_button_previous__lWJYm","nav_button_next":"calendar-module_nav_button_next__1MzRT","months":"calendar-module_months__IN75k","nav":"calendar-module_nav__aGeze","month_caption":"calendar-module_month_caption__Ws6Hx","day":"calendar-module_day__rQFGK","disabled":"calendar-module_disabled__jqgRB","outside":"calendar-module_outside__nq5XC","selected":"calendar-module_selected__kiiAZ","range_middle":"calendar-module_range_middle__PmzFi","range_start":"calendar-module_range_start__ZUooG","range_end":"calendar-module_range_end__PKrm7","week":"calendar-module_week__kCvKJ","day_button":"calendar-module_day_button__vCKP1","today":"calendar-module_today__iXQIQ","weekday":"calendar-module_weekday__xzf6F","hidden":"calendar-module_hidden__wqJVo","calendarPopover":"calendar-module_calendarPopover__PY4sa","dropdown_icon":"calendar-module_dropdown_icon__rDTbz","dropdown_content":"calendar-module_dropdown_content__ajJ5V"};
|
|
28056
28078
|
|
|
28079
|
+
/**
|
|
28080
|
+
* @internal
|
|
28081
|
+
*/
|
|
28082
|
+
const SkeletonThemeContext = React.createContext({});
|
|
28083
|
+
|
|
28084
|
+
/* eslint-disable react/no-array-index-key */
|
|
28085
|
+
const defaultEnableAnimation = true;
|
|
28086
|
+
// For performance & cleanliness, don't add any inline styles unless we have to
|
|
28087
|
+
function styleOptionsToCssProperties({ baseColor, highlightColor, width, height, borderRadius, circle, direction, duration, enableAnimation = defaultEnableAnimation, }) {
|
|
28088
|
+
const style = {};
|
|
28089
|
+
if (direction === 'rtl')
|
|
28090
|
+
style['--animation-direction'] = 'reverse';
|
|
28091
|
+
if (typeof duration === 'number')
|
|
28092
|
+
style['--animation-duration'] = `${duration}s`;
|
|
28093
|
+
if (!enableAnimation)
|
|
28094
|
+
style['--pseudo-element-display'] = 'none';
|
|
28095
|
+
if (typeof width === 'string' || typeof width === 'number')
|
|
28096
|
+
style.width = width;
|
|
28097
|
+
if (typeof height === 'string' || typeof height === 'number')
|
|
28098
|
+
style.height = height;
|
|
28099
|
+
if (typeof borderRadius === 'string' || typeof borderRadius === 'number')
|
|
28100
|
+
style.borderRadius = borderRadius;
|
|
28101
|
+
if (circle)
|
|
28102
|
+
style.borderRadius = '50%';
|
|
28103
|
+
if (typeof baseColor !== 'undefined')
|
|
28104
|
+
style['--base-color'] = baseColor;
|
|
28105
|
+
if (typeof highlightColor !== 'undefined')
|
|
28106
|
+
style['--highlight-color'] = highlightColor;
|
|
28107
|
+
return style;
|
|
28108
|
+
}
|
|
28109
|
+
function Skeleton({ count = 1, wrapper: Wrapper, className: customClassName, containerClassName, containerTestId, circle = false, style: styleProp, ...originalPropsStyleOptions }) {
|
|
28110
|
+
var _a, _b, _c;
|
|
28111
|
+
const contextStyleOptions = React.useContext(SkeletonThemeContext);
|
|
28112
|
+
const propsStyleOptions = { ...originalPropsStyleOptions };
|
|
28113
|
+
// DO NOT overwrite style options from the context if `propsStyleOptions`
|
|
28114
|
+
// has properties explicity set to undefined
|
|
28115
|
+
for (const [key, value] of Object.entries(originalPropsStyleOptions)) {
|
|
28116
|
+
if (typeof value === 'undefined') {
|
|
28117
|
+
delete propsStyleOptions[key];
|
|
28118
|
+
}
|
|
28119
|
+
}
|
|
28120
|
+
// Props take priority over context
|
|
28121
|
+
const styleOptions = {
|
|
28122
|
+
...contextStyleOptions,
|
|
28123
|
+
...propsStyleOptions,
|
|
28124
|
+
circle,
|
|
28125
|
+
};
|
|
28126
|
+
// `styleProp` has the least priority out of everything
|
|
28127
|
+
const style = {
|
|
28128
|
+
...styleProp,
|
|
28129
|
+
...styleOptionsToCssProperties(styleOptions),
|
|
28130
|
+
};
|
|
28131
|
+
let className = 'react-loading-skeleton';
|
|
28132
|
+
if (customClassName)
|
|
28133
|
+
className += ` ${customClassName}`;
|
|
28134
|
+
const inline = (_a = styleOptions.inline) !== null && _a !== void 0 ? _a : false;
|
|
28135
|
+
const elements = [];
|
|
28136
|
+
const countCeil = Math.ceil(count);
|
|
28137
|
+
for (let i = 0; i < countCeil; i++) {
|
|
28138
|
+
let thisStyle = style;
|
|
28139
|
+
if (countCeil > count && i === countCeil - 1) {
|
|
28140
|
+
// count is not an integer and we've reached the last iteration of
|
|
28141
|
+
// the loop, so add a "fractional" skeleton.
|
|
28142
|
+
//
|
|
28143
|
+
// For example, if count is 3.5, we've already added 3 full
|
|
28144
|
+
// skeletons, so now we add one more skeleton that is 0.5 times the
|
|
28145
|
+
// original width.
|
|
28146
|
+
const width = (_b = thisStyle.width) !== null && _b !== void 0 ? _b : '100%'; // 100% is the default since that's what's in the CSS
|
|
28147
|
+
const fractionalPart = count % 1;
|
|
28148
|
+
const fractionalWidth = typeof width === 'number'
|
|
28149
|
+
? width * fractionalPart
|
|
28150
|
+
: `calc(${width} * ${fractionalPart})`;
|
|
28151
|
+
thisStyle = { ...thisStyle, width: fractionalWidth };
|
|
28152
|
+
}
|
|
28153
|
+
const skeletonSpan = (React.createElement("span", { className: className, style: thisStyle, key: i }, "\u200C"));
|
|
28154
|
+
if (inline) {
|
|
28155
|
+
elements.push(skeletonSpan);
|
|
28156
|
+
}
|
|
28157
|
+
else {
|
|
28158
|
+
// Without the <br />, the skeleton lines will all run together if
|
|
28159
|
+
// `width` is specified
|
|
28160
|
+
elements.push(React.createElement(React.Fragment, { key: i },
|
|
28161
|
+
skeletonSpan,
|
|
28162
|
+
React.createElement("br", null)));
|
|
28163
|
+
}
|
|
28164
|
+
}
|
|
28165
|
+
return (React.createElement("span", { className: containerClassName, "data-testid": containerTestId, "aria-live": "polite", "aria-busy": (_c = styleOptions.enableAnimation) !== null && _c !== void 0 ? _c : defaultEnableAnimation }, Wrapper
|
|
28166
|
+
? elements.map((el, i) => React.createElement(Wrapper, { key: i }, el))
|
|
28167
|
+
: elements));
|
|
28168
|
+
}
|
|
28169
|
+
|
|
28057
28170
|
const root$1 = cva(styles$6.calendarRoot);
|
|
28058
28171
|
function DropDown({ options = [], value, onChange, onDropdownOpen, }) {
|
|
28059
28172
|
const [open, setOpen] = React.useState(false);
|
|
@@ -28068,19 +28181,25 @@ function DropDown({ options = [], value, onChange, onDropdownOpen, }) {
|
|
|
28068
28181
|
}
|
|
28069
28182
|
return (jsxRuntimeExports.jsxs(Select$1, { value: value?.toString(), onValueChange: handleChange, open: open, onOpenChange: setOpen, children: [jsxRuntimeExports.jsx(Select$1.Trigger, { className: styles$6.dropdown_trigger, iconProps: {
|
|
28070
28183
|
className: styles$6.dropdown_icon,
|
|
28071
|
-
}, children: jsxRuntimeExports.jsx(Select$1.Value, {}) }), jsxRuntimeExports.jsxs(Select$1.Content, { className: styles$6.dropdown_content, children: [jsxRuntimeExports.jsx(Select$1.ScrollUpButton, { asChild: true, children: jsxRuntimeExports.jsx(Flex, { justify:
|
|
28184
|
+
}, children: jsxRuntimeExports.jsx(Select$1.Value, {}) }), jsxRuntimeExports.jsxs(Select$1.Content, { className: styles$6.dropdown_content, children: [jsxRuntimeExports.jsx(Select$1.ScrollUpButton, { asChild: true, children: jsxRuntimeExports.jsx(Flex, { justify: 'center', children: jsxRuntimeExports.jsx(ChevronUpIcon, {}) }) }), jsxRuntimeExports.jsx(Select$1.Viewport, { children: options.map((opt) => (jsxRuntimeExports.jsx(Select$1.Item, { value: opt.value.toString(), disabled: opt.disabled, textProps: {
|
|
28072
28185
|
className: styles$6.dropdown_item_text,
|
|
28073
|
-
}, children: opt.label }, opt.value))) }), jsxRuntimeExports.jsx(Select$1.ScrollDownButton, { asChild: true, children: jsxRuntimeExports.jsx(Flex, { justify:
|
|
28186
|
+
}, children: opt.label }, opt.value))) }), jsxRuntimeExports.jsx(Select$1.ScrollDownButton, { asChild: true, children: jsxRuntimeExports.jsx(Flex, { justify: 'center', children: jsxRuntimeExports.jsx(ChevronDownIcon, {}) }) })] })] }));
|
|
28074
28187
|
}
|
|
28075
|
-
const Calendar = function ({ className, classNames, showOutsideDays = true, onDropdownOpen, ...props }) {
|
|
28188
|
+
const Calendar = function ({ className, classNames, showOutsideDays = true, onDropdownOpen, showTooltip = false, tooltipMessages = {}, loadingData = false, ...props }) {
|
|
28076
28189
|
return (jsxRuntimeExports.jsx(DayPicker, { showOutsideDays: showOutsideDays, components: {
|
|
28077
28190
|
Chevron: (props) => {
|
|
28078
|
-
if (props.orientation ===
|
|
28191
|
+
if (props.orientation === 'left') {
|
|
28079
28192
|
return jsxRuntimeExports.jsx(ChevronLeftIcon, { ...props });
|
|
28080
28193
|
}
|
|
28081
28194
|
return jsxRuntimeExports.jsx(ChevronRightIcon, { ...props });
|
|
28082
28195
|
},
|
|
28083
28196
|
Dropdown: (props) => (jsxRuntimeExports.jsx(DropDown, { ...props, onDropdownOpen: onDropdownOpen })),
|
|
28197
|
+
DayButton: (props) => {
|
|
28198
|
+
const { day, ...buttonProps } = props;
|
|
28199
|
+
const message = tooltipMessages[dateLib.format(day.date, 'dd-MM-yyyy')];
|
|
28200
|
+
return (jsxRuntimeExports.jsx(Tooltip, { side: "top", disabled: loadingData || !showTooltip || !message, message: message, children: jsxRuntimeExports.jsx("button", { ...buttonProps }) }));
|
|
28201
|
+
},
|
|
28202
|
+
MonthGrid: (props) => loadingData ? (jsxRuntimeExports.jsx(Skeleton, { count: 6, height: '12px', width: '252px', style: { marginBottom: 'var(--space-5)' }, highlightColor: "var(--background-base)", baseColor: "var(--background-base-hover)" })) : (jsxRuntimeExports.jsx("table", { ...props })),
|
|
28084
28203
|
}, classNames: {
|
|
28085
28204
|
caption_label: styles$6.caption_label,
|
|
28086
28205
|
button_previous: `${styles$6.nav_button} ${styles$6.nav_button_previous}`,
|
|
@@ -32138,97 +32257,6 @@ const Table = Object.assign(TableRoot, {
|
|
|
32138
32257
|
Caption: TableCaption,
|
|
32139
32258
|
});
|
|
32140
32259
|
|
|
32141
|
-
/**
|
|
32142
|
-
* @internal
|
|
32143
|
-
*/
|
|
32144
|
-
const SkeletonThemeContext = React.createContext({});
|
|
32145
|
-
|
|
32146
|
-
/* eslint-disable react/no-array-index-key */
|
|
32147
|
-
const defaultEnableAnimation = true;
|
|
32148
|
-
// For performance & cleanliness, don't add any inline styles unless we have to
|
|
32149
|
-
function styleOptionsToCssProperties({ baseColor, highlightColor, width, height, borderRadius, circle, direction, duration, enableAnimation = defaultEnableAnimation, }) {
|
|
32150
|
-
const style = {};
|
|
32151
|
-
if (direction === 'rtl')
|
|
32152
|
-
style['--animation-direction'] = 'reverse';
|
|
32153
|
-
if (typeof duration === 'number')
|
|
32154
|
-
style['--animation-duration'] = `${duration}s`;
|
|
32155
|
-
if (!enableAnimation)
|
|
32156
|
-
style['--pseudo-element-display'] = 'none';
|
|
32157
|
-
if (typeof width === 'string' || typeof width === 'number')
|
|
32158
|
-
style.width = width;
|
|
32159
|
-
if (typeof height === 'string' || typeof height === 'number')
|
|
32160
|
-
style.height = height;
|
|
32161
|
-
if (typeof borderRadius === 'string' || typeof borderRadius === 'number')
|
|
32162
|
-
style.borderRadius = borderRadius;
|
|
32163
|
-
if (circle)
|
|
32164
|
-
style.borderRadius = '50%';
|
|
32165
|
-
if (typeof baseColor !== 'undefined')
|
|
32166
|
-
style['--base-color'] = baseColor;
|
|
32167
|
-
if (typeof highlightColor !== 'undefined')
|
|
32168
|
-
style['--highlight-color'] = highlightColor;
|
|
32169
|
-
return style;
|
|
32170
|
-
}
|
|
32171
|
-
function Skeleton({ count = 1, wrapper: Wrapper, className: customClassName, containerClassName, containerTestId, circle = false, style: styleProp, ...originalPropsStyleOptions }) {
|
|
32172
|
-
var _a, _b, _c;
|
|
32173
|
-
const contextStyleOptions = React.useContext(SkeletonThemeContext);
|
|
32174
|
-
const propsStyleOptions = { ...originalPropsStyleOptions };
|
|
32175
|
-
// DO NOT overwrite style options from the context if `propsStyleOptions`
|
|
32176
|
-
// has properties explicity set to undefined
|
|
32177
|
-
for (const [key, value] of Object.entries(originalPropsStyleOptions)) {
|
|
32178
|
-
if (typeof value === 'undefined') {
|
|
32179
|
-
delete propsStyleOptions[key];
|
|
32180
|
-
}
|
|
32181
|
-
}
|
|
32182
|
-
// Props take priority over context
|
|
32183
|
-
const styleOptions = {
|
|
32184
|
-
...contextStyleOptions,
|
|
32185
|
-
...propsStyleOptions,
|
|
32186
|
-
circle,
|
|
32187
|
-
};
|
|
32188
|
-
// `styleProp` has the least priority out of everything
|
|
32189
|
-
const style = {
|
|
32190
|
-
...styleProp,
|
|
32191
|
-
...styleOptionsToCssProperties(styleOptions),
|
|
32192
|
-
};
|
|
32193
|
-
let className = 'react-loading-skeleton';
|
|
32194
|
-
if (customClassName)
|
|
32195
|
-
className += ` ${customClassName}`;
|
|
32196
|
-
const inline = (_a = styleOptions.inline) !== null && _a !== void 0 ? _a : false;
|
|
32197
|
-
const elements = [];
|
|
32198
|
-
const countCeil = Math.ceil(count);
|
|
32199
|
-
for (let i = 0; i < countCeil; i++) {
|
|
32200
|
-
let thisStyle = style;
|
|
32201
|
-
if (countCeil > count && i === countCeil - 1) {
|
|
32202
|
-
// count is not an integer and we've reached the last iteration of
|
|
32203
|
-
// the loop, so add a "fractional" skeleton.
|
|
32204
|
-
//
|
|
32205
|
-
// For example, if count is 3.5, we've already added 3 full
|
|
32206
|
-
// skeletons, so now we add one more skeleton that is 0.5 times the
|
|
32207
|
-
// original width.
|
|
32208
|
-
const width = (_b = thisStyle.width) !== null && _b !== void 0 ? _b : '100%'; // 100% is the default since that's what's in the CSS
|
|
32209
|
-
const fractionalPart = count % 1;
|
|
32210
|
-
const fractionalWidth = typeof width === 'number'
|
|
32211
|
-
? width * fractionalPart
|
|
32212
|
-
: `calc(${width} * ${fractionalPart})`;
|
|
32213
|
-
thisStyle = { ...thisStyle, width: fractionalWidth };
|
|
32214
|
-
}
|
|
32215
|
-
const skeletonSpan = (React.createElement("span", { className: className, style: thisStyle, key: i }, "\u200C"));
|
|
32216
|
-
if (inline) {
|
|
32217
|
-
elements.push(skeletonSpan);
|
|
32218
|
-
}
|
|
32219
|
-
else {
|
|
32220
|
-
// Without the <br />, the skeleton lines will all run together if
|
|
32221
|
-
// `width` is specified
|
|
32222
|
-
elements.push(React.createElement(React.Fragment, { key: i },
|
|
32223
|
-
skeletonSpan,
|
|
32224
|
-
React.createElement("br", null)));
|
|
32225
|
-
}
|
|
32226
|
-
}
|
|
32227
|
-
return (React.createElement("span", { className: containerClassName, "data-testid": containerTestId, "aria-live": "polite", "aria-busy": (_c = styleOptions.enableAnimation) !== null && _c !== void 0 ? _c : defaultEnableAnimation }, Wrapper
|
|
32228
|
-
? elements.map((el, i) => React.createElement(Wrapper, { key: i }, el))
|
|
32229
|
-
: elements));
|
|
32230
|
-
}
|
|
32231
|
-
|
|
32232
32260
|
function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoading = false, ShouldShowHeader = true, initialState, loaderRow = 2, onRowClick, onStateChange = () => { }, onLoadMore, ...props }) {
|
|
32233
32261
|
const [tableCustomFilter, setTableCustomFilter] = React.useState({});
|
|
32234
32262
|
const convertedChildren = React.Children.toArray(children);
|