@paygreen/pgui 2.1.3 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +360 -23
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ActionsButton/index.d.ts +2 -2
- package/dist/cjs/types/components/Card/index.d.ts +3 -0
- package/dist/cjs/types/components/ConfirmMenuItem/index.d.ts +13 -0
- package/dist/cjs/types/components/DataList/index.d.ts +5 -5
- package/dist/cjs/types/components/Pagination/index.d.ts +5 -5
- package/dist/cjs/types/components/Textarea/index.d.ts +8 -0
- package/dist/cjs/types/components/index.d.ts +2 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/layout/BottomBar/index.d.ts +3 -0
- package/dist/cjs/types/layout/LayoutContainer/index.d.ts +3 -0
- package/dist/cjs/types/layout/SideNav/index.d.ts +19 -0
- package/dist/cjs/types/layout/TopBar/index.d.ts +3 -3
- package/dist/cjs/types/layout/index.d.ts +3 -0
- package/dist/cjs/types/theme/components/checkbox.d.ts +11 -0
- package/dist/cjs/types/theme/components/drawer.d.ts +6 -0
- package/dist/cjs/types/theme/components/index.d.ts +8 -0
- package/dist/cjs/types/theme/components/input.d.ts +0 -2
- package/dist/cjs/types/theme/components/number-input.d.ts +54 -0
- package/dist/cjs/types/theme/components/pin-input.d.ts +31 -0
- package/dist/cjs/types/theme/components/radio.d.ts +6 -0
- package/dist/cjs/types/theme/components/slider.d.ts +6 -0
- package/dist/cjs/types/theme/components/switch.d.ts +6 -0
- package/dist/cjs/types/theme/components/textarea.d.ts +42 -0
- package/dist/cjs/types/theme/foundations/index.d.ts +31 -0
- package/dist/cjs/types/theme/foundations/radius.d.ts +11 -0
- package/dist/cjs/types/theme/foundations/sizes.d.ts +21 -0
- package/dist/cjs/types/theme/rawStyle/chakraStyle.d.ts +2 -0
- package/dist/cjs/types/theme/{externals → rawStyle}/index.d.ts +1 -0
- package/dist/cjs/types/theme/{externals → rawStyle}/reactDayPicker.d.ts +0 -0
- package/dist/cjs/types/utils/index.d.ts +2 -0
- package/dist/cjs/types/utils/responsive.d.ts +1 -0
- package/dist/esm/index.js +351 -28
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ActionsButton/index.d.ts +2 -2
- package/dist/esm/types/components/Card/index.d.ts +3 -0
- package/dist/esm/types/components/ConfirmMenuItem/index.d.ts +13 -0
- package/dist/esm/types/components/DataList/index.d.ts +5 -5
- package/dist/esm/types/components/Pagination/index.d.ts +5 -5
- package/dist/esm/types/components/Textarea/index.d.ts +8 -0
- package/dist/esm/types/components/index.d.ts +2 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/layout/BottomBar/index.d.ts +3 -0
- package/dist/esm/types/layout/LayoutContainer/index.d.ts +3 -0
- package/dist/esm/types/layout/SideNav/index.d.ts +19 -0
- package/dist/esm/types/layout/TopBar/index.d.ts +3 -3
- package/dist/esm/types/layout/index.d.ts +3 -0
- package/dist/esm/types/theme/components/checkbox.d.ts +11 -0
- package/dist/esm/types/theme/components/drawer.d.ts +6 -0
- package/dist/esm/types/theme/components/index.d.ts +8 -0
- package/dist/esm/types/theme/components/input.d.ts +0 -2
- package/dist/esm/types/theme/components/number-input.d.ts +54 -0
- package/dist/esm/types/theme/components/pin-input.d.ts +31 -0
- package/dist/esm/types/theme/components/radio.d.ts +6 -0
- package/dist/esm/types/theme/components/slider.d.ts +6 -0
- package/dist/esm/types/theme/components/switch.d.ts +6 -0
- package/dist/esm/types/theme/components/textarea.d.ts +42 -0
- package/dist/esm/types/theme/foundations/index.d.ts +31 -0
- package/dist/esm/types/theme/foundations/radius.d.ts +11 -0
- package/dist/esm/types/theme/foundations/sizes.d.ts +21 -0
- package/dist/esm/types/theme/rawStyle/chakraStyle.d.ts +2 -0
- package/dist/esm/types/theme/{externals → rawStyle}/index.d.ts +1 -0
- package/dist/esm/types/theme/{externals → rawStyle}/reactDayPicker.d.ts +0 -0
- package/dist/esm/types/utils/index.d.ts +2 -0
- package/dist/esm/types/utils/responsive.d.ts +1 -0
- package/dist/index.d.ts +54 -15
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, {
|
|
3
|
-
import { forwardRef, IconButton,
|
|
2
|
+
import React__default, { useState, useRef, useEffect, useContext, createContext, forwardRef as forwardRef$1, useLayoutEffect, createElement, Fragment, Component, useCallback, useMemo } from 'react';
|
|
3
|
+
import { forwardRef, IconButton, Flex, createStylesContext, chakra, useMultiStyleConfig, useMenuItem, MenuIcon, MenuCommand, useMenuState, Icon, Text, useBreakpointValue, AccordionItem, AccordionButton, AccordionIcon, AccordionPanel, Box, Accordion, FormControl, FormLabel, FormHelperText, FormErrorMessage, SlideFade, useDisclosure, Popover, PopoverTrigger, InputGroup, Input as Input$2, InputRightElement, PopoverContent, PopoverArrow, HStack, useControllableState, useMergeRefs, useTheme, useColorModeValue, useStyleConfig, useToken, useBreakpoint, Drawer, DrawerOverlay, DrawerContent, DrawerCloseButton, VStack, Button as Button$1, Stack, extendTheme } from '@chakra-ui/react';
|
|
4
4
|
|
|
5
5
|
/******************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation.
|
|
@@ -183,6 +183,98 @@ var ActionsButton = forwardRef(function (_a, ref) {
|
|
|
183
183
|
});
|
|
184
184
|
ActionsButton.displayName = 'ActionsButton';
|
|
185
185
|
|
|
186
|
+
var Card = function (props) { return (React__default.createElement(Flex, __assign$2({ p: 6, background: "white", boxShadow: "base", borderRadius: "base", flexDir: "column", h: "fit-content", w: "full" }, props))); };
|
|
187
|
+
|
|
188
|
+
var _a = createStylesContext('Menu'), StylesProvider = _a[0], useStyles = _a[1];
|
|
189
|
+
var StyledMenuItem = forwardRef(function (props, ref) {
|
|
190
|
+
var type = props.type, rest = __rest$2(props, ["type"]);
|
|
191
|
+
var styles = useStyles();
|
|
192
|
+
/**
|
|
193
|
+
* Given another component, use its type if present
|
|
194
|
+
* Else, use no type to avoid invalid html, e.g. <a type="button" />
|
|
195
|
+
* Else, fall back to "button"
|
|
196
|
+
*/
|
|
197
|
+
var btnType = rest.as ? type !== null && type !== void 0 ? type : undefined : 'button';
|
|
198
|
+
var buttonStyles = __assign$2({ textDecoration: 'none', color: 'inherit', userSelect: 'none', display: 'flex', width: '100%', alignItems: 'center', textAlign: 'left', flex: '0 0 auto', outline: 0 }, styles.item);
|
|
199
|
+
return (React__default.createElement(chakra.button, __assign$2({ ref: ref, type: btnType }, rest, { __css: buttonStyles })));
|
|
200
|
+
});
|
|
201
|
+
var MenuItem = forwardRef(function (props, ref) {
|
|
202
|
+
var icon = props.icon, _a = props.iconSpacing, iconSpacing = _a === void 0 ? '0.75rem' : _a, command = props.command, _b = props.commandSpacing, commandSpacing = _b === void 0 ? '0.75rem' : _b, children = props.children, rest = __rest$2(props, ["icon", "iconSpacing", "command", "commandSpacing", "children"]);
|
|
203
|
+
var styles = useMultiStyleConfig('Menu', props);
|
|
204
|
+
var menuItemProps = useMenuItem(rest, ref);
|
|
205
|
+
var shouldWrap = icon || command;
|
|
206
|
+
var childrenFormated = shouldWrap ? (React__default.createElement(chakra.span, { pointerEvents: "none", flex: "1" }, children)) : (children);
|
|
207
|
+
return (React__default.createElement(StylesProvider, { value: styles },
|
|
208
|
+
React__default.createElement(StyledMenuItem, __assign$2({}, menuItemProps, { onClick: function (e) {
|
|
209
|
+
var _a;
|
|
210
|
+
(_a = rest === null || rest === void 0 ? void 0 : rest.onClick) === null || _a === void 0 ? void 0 : _a.call(rest, e);
|
|
211
|
+
} }),
|
|
212
|
+
icon && (React__default.createElement(MenuIcon, { fontSize: "0.8em", marginEnd: iconSpacing }, icon)),
|
|
213
|
+
childrenFormated,
|
|
214
|
+
command && (React__default.createElement(MenuCommand, { marginStart: commandSpacing }, command)))));
|
|
215
|
+
});
|
|
216
|
+
var ConfirmMenuItem = forwardRef(function (_a, ref) {
|
|
217
|
+
var children = _a.children, _b = _a.confirmColorScheme, confirmColorScheme = _b === void 0 ? 'red' : _b, _c = _a.confirmContent, confirmContent = _c === void 0 ? '' : _c, _d = _a.confirmIcon, confirmIcon = _d === void 0 ? FiAlertCircle : _d, confirmText = _a.confirmText, _e = _a.confirmDelay, confirmDelay = _e === void 0 ? 2000 : _e, icon = _a.icon, onClick = _a.onClick, rest = __rest$2(_a, ["children", "confirmColorScheme", "confirmContent", "confirmIcon", "confirmText", "confirmDelay", "icon", "onClick"]);
|
|
218
|
+
var _f = useState(false), isConfirmActive = _f[0], setIsConfirmActive = _f[1];
|
|
219
|
+
var timeoutRef = useRef();
|
|
220
|
+
var onCloseMenu = useMenuState().onClose;
|
|
221
|
+
var handleClickConfirm = function (event) {
|
|
222
|
+
if (isConfirmActive) {
|
|
223
|
+
if (timeoutRef.current) {
|
|
224
|
+
clearTimeout(timeoutRef.current);
|
|
225
|
+
}
|
|
226
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
227
|
+
onCloseMenu();
|
|
228
|
+
setIsConfirmActive(false);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
setIsConfirmActive(true);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
useEffect(function () {
|
|
235
|
+
if (isConfirmActive) {
|
|
236
|
+
timeoutRef.current = setTimeout(function () {
|
|
237
|
+
setIsConfirmActive(false);
|
|
238
|
+
}, confirmDelay);
|
|
239
|
+
}
|
|
240
|
+
return function () {
|
|
241
|
+
if (timeoutRef.current)
|
|
242
|
+
clearTimeout(timeoutRef.current);
|
|
243
|
+
};
|
|
244
|
+
}, [isConfirmActive, confirmDelay]);
|
|
245
|
+
var confirmActiveProps = isConfirmActive
|
|
246
|
+
? {
|
|
247
|
+
bg: "".concat(confirmColorScheme, ".100"),
|
|
248
|
+
color: 'transparent',
|
|
249
|
+
transition: '0.2s',
|
|
250
|
+
_dark: {
|
|
251
|
+
bg: "".concat(confirmColorScheme, ".800")
|
|
252
|
+
},
|
|
253
|
+
_hover: {
|
|
254
|
+
bg: "".concat(confirmColorScheme, ".50"),
|
|
255
|
+
_dark: {
|
|
256
|
+
bg: "".concat(confirmColorScheme, ".900")
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
_focusVisible: {
|
|
260
|
+
bg: "".concat(confirmColorScheme, ".50"),
|
|
261
|
+
_dark: {
|
|
262
|
+
bg: "".concat(confirmColorScheme, ".900")
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
icon: icon
|
|
266
|
+
? React__default.cloneElement(icon, { color: 'transparent' })
|
|
267
|
+
: icon
|
|
268
|
+
}
|
|
269
|
+
: {};
|
|
270
|
+
return (React__default.createElement(MenuItem, __assign$2({ position: "relative", onClick: handleClickConfirm, ref: ref, icon: icon }, rest, confirmActiveProps),
|
|
271
|
+
React__default.createElement(Flex, { as: "span", alignItems: "center", opacity: isConfirmActive ? 0 : undefined }, children),
|
|
272
|
+
isConfirmActive && (React__default.createElement(Flex, { position: "absolute", top: 0, insetStart: 0, insetEnd: 0, bottom: 0, px: 3, as: "span", fontSize: "sm", alignItems: "center", color: "".concat(confirmColorScheme, ".500"), _dark: { color: 'white' } }, confirmContent ? (confirmContent) : (React__default.createElement(React__default.Fragment, null,
|
|
273
|
+
React__default.createElement(Icon, { as: confirmIcon, me: 1 }),
|
|
274
|
+
' ',
|
|
275
|
+
React__default.createElement(Text, { noOfLines: 1, as: "span" }, confirmText !== null && confirmText !== void 0 ? confirmText : 'Êtes-vous sûr ?')))))));
|
|
276
|
+
});
|
|
277
|
+
|
|
186
278
|
var DataListContext = React__default.createContext({
|
|
187
279
|
setColumns: function () { },
|
|
188
280
|
columns: {},
|
|
@@ -256,7 +348,7 @@ var DataListRow = function (_a) {
|
|
|
256
348
|
var DataListHeader = function (_a) {
|
|
257
349
|
var rest = __rest$2(_a, []);
|
|
258
350
|
return (React__default.createElement(DataListHeaderContext.Provider, { value: true },
|
|
259
|
-
React__default.createElement(DataListRow, __assign$2({ fontSize: "sm", fontWeight: "bold", border: "none", _hover: {}, bg: "
|
|
351
|
+
React__default.createElement(DataListRow, __assign$2({ fontSize: "sm", fontWeight: "bold", border: "none", _hover: {}, bg: "background", color: "gray.700" }, rest))));
|
|
260
352
|
};
|
|
261
353
|
var DataListFooter = function (_a) {
|
|
262
354
|
var rest = __rest$2(_a, []);
|
|
@@ -275,7 +367,7 @@ var DataList = function (_a) {
|
|
|
275
367
|
columns: columns,
|
|
276
368
|
isHover: isHover
|
|
277
369
|
} },
|
|
278
|
-
React__default.createElement(Accordion, __assign$2({ display: "flex", flexDirection: "column", position: "relative", boxShadow: "md", borderRadius: "
|
|
370
|
+
React__default.createElement(Accordion, __assign$2({ display: "flex", flexDirection: "column", position: "relative", boxShadow: "md", borderRadius: "base", overflowX: "auto", overflowY: "hidden", minH: "10rem", allowMultiple: allowMultiple && !allowToggle, allowToggle: allowToggle, bg: "white", _dark: {
|
|
279
371
|
bg: 'blackAlpha.400'
|
|
280
372
|
} }, rest))));
|
|
281
373
|
};
|
|
@@ -8658,7 +8750,7 @@ var InputDayPicker = function (_a) {
|
|
|
8658
8750
|
React__default.createElement(Popover, __assign$2({ closeOnBlur: true, closeOnEsc: true, isOpen: isOpen, onClose: onClose, placement: "bottom-start", autoFocus: true }, popoverProps),
|
|
8659
8751
|
React__default.createElement(PopoverTrigger, null,
|
|
8660
8752
|
React__default.createElement(InputGroup, null,
|
|
8661
|
-
React__default.createElement(Input$
|
|
8753
|
+
React__default.createElement(Input$2, __assign$2({ value: value, onChange: handleInputChange, isDisabled: isDisabled, placeholder: "DD/MM/YYYY" }, inputProps)),
|
|
8662
8754
|
React__default.createElement(InputRightElement, { w: "fit-content", mr: "0.25rem", height: "".concat(renderInputRightElement()) },
|
|
8663
8755
|
React__default.createElement(IconButton, { "aria-label": "Calendrier", icon: React__default.createElement(Icon, { as: isOpen ? MdClose : MdCalendarToday, height: (inputProps === null || inputProps === void 0 ? void 0 : inputProps.size) === 'xs' ? '0.5rem' : 'fit-content' }), size: "".concat(renderIconSize()), onClick: onToggle, isDisabled: isDisabled, variant: isOpen ? '@danger' : 'solid', w: "".concat(renderBtnSize()), h: "".concat(renderBtnSize()) })))),
|
|
8664
8756
|
React__default.createElement(PopoverContent, null,
|
|
@@ -8769,7 +8861,7 @@ var SearchInput = forwardRef(function (_a, ref) {
|
|
|
8769
8861
|
}
|
|
8770
8862
|
};
|
|
8771
8863
|
return (React__default.createElement(InputGroup, __assign$2({}, rest),
|
|
8772
|
-
React__default.createElement(Input$
|
|
8864
|
+
React__default.createElement(Input$2, { ref: refs, onChange: handleChange, value: search || '', placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Recherche...', isDisabled: isDisabled, onKeyDown: handleEscape }),
|
|
8773
8865
|
React__default.createElement(InputRightElement, { color: isDisabled ? 'gray.300' : 'gray.400' }, !isDisabled && search ? (React__default.createElement(IconButton, { onClick: handleClear, variant: "@secondary", size: "xs", "aria-label": clearLabel !== null && clearLabel !== void 0 ? clearLabel : 'Effacer la recherche' },
|
|
8774
8866
|
React__default.createElement(FiX, null))) : (React__default.createElement(FiSearch, null)))));
|
|
8775
8867
|
});
|
|
@@ -43815,7 +43907,7 @@ var inputStyle = function inputStyle(isHidden) {
|
|
|
43815
43907
|
}, spacingStyle);
|
|
43816
43908
|
};
|
|
43817
43909
|
|
|
43818
|
-
var Input = function Input(props) {
|
|
43910
|
+
var Input$1 = function Input(props) {
|
|
43819
43911
|
var className = props.className,
|
|
43820
43912
|
cx = props.cx,
|
|
43821
43913
|
getStyles = props.getStyles,
|
|
@@ -44077,7 +44169,7 @@ var components$1 = {
|
|
|
44077
44169
|
GroupHeading: GroupHeading,
|
|
44078
44170
|
IndicatorsContainer: IndicatorsContainer,
|
|
44079
44171
|
IndicatorSeparator: IndicatorSeparator,
|
|
44080
|
-
Input: Input,
|
|
44172
|
+
Input: Input$1,
|
|
44081
44173
|
LoadingIndicator: LoadingIndicator,
|
|
44082
44174
|
Menu: Menu,
|
|
44083
44175
|
MenuList: MenuList,
|
|
@@ -45171,7 +45263,7 @@ var defaultTheme = {
|
|
|
45171
45263
|
spacing: spacing
|
|
45172
45264
|
};
|
|
45173
45265
|
|
|
45174
|
-
var defaultProps = {
|
|
45266
|
+
var defaultProps$5 = {
|
|
45175
45267
|
'aria-live': 'polite',
|
|
45176
45268
|
backspaceRemovesValue: true,
|
|
45177
45269
|
blurInputOnSelect: isTouchCapable(),
|
|
@@ -46955,7 +47047,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
46955
47047
|
return Select;
|
|
46956
47048
|
}(Component);
|
|
46957
47049
|
|
|
46958
|
-
Select$1.defaultProps = defaultProps;
|
|
47050
|
+
Select$1.defaultProps = defaultProps$5;
|
|
46959
47051
|
|
|
46960
47052
|
var StateManagedSelect = /*#__PURE__*/forwardRef$1(function (props, ref) {
|
|
46961
47053
|
var baseSelectProps = useStateManager(props);
|
|
@@ -47392,23 +47484,77 @@ var SelectInner = function (_a, ref) {
|
|
|
47392
47484
|
};
|
|
47393
47485
|
var Select = React__default.forwardRef(SelectInner);
|
|
47394
47486
|
|
|
47395
|
-
var
|
|
47396
|
-
|
|
47397
|
-
|
|
47487
|
+
var LayoutContainer = function (props) { return (React__default.createElement(Flex, __assign$2({ w: "full", px: { base: 4, sm: 12, md: 40, lg: 60, xl: 96 } }, props))); };
|
|
47488
|
+
|
|
47489
|
+
var BottomBar = function (props) { return (React__default.createElement(LayoutContainer, __assign$2({ minH: "4.125rem", bg: "white", boxShadow: "layout", justifyContent: "space-between", alignItems: "center" }, props))); };
|
|
47490
|
+
|
|
47491
|
+
var useIsMobile = function (currentBreakpoint) {
|
|
47492
|
+
return (currentBreakpoint === 'base' ||
|
|
47493
|
+
currentBreakpoint === 'sm' ||
|
|
47494
|
+
currentBreakpoint === 'md' ||
|
|
47495
|
+
currentBreakpoint === 'lg');
|
|
47398
47496
|
};
|
|
47399
|
-
|
|
47400
|
-
|
|
47401
|
-
|
|
47497
|
+
|
|
47498
|
+
var SideNav = function (_a) {
|
|
47499
|
+
var isMobileMenuOpen = _a.isMobileMenuOpen, onMobileMenuClose = _a.onMobileMenuClose, children = _a.children, props = __rest$2(_a, ["isMobileMenuOpen", "onMobileMenuClose", "children"]);
|
|
47500
|
+
var theme = useTheme();
|
|
47501
|
+
var currentBreakpoint = useBreakpoint();
|
|
47502
|
+
var isMobile = useIsMobile(currentBreakpoint);
|
|
47503
|
+
var customScrollBar = {
|
|
47504
|
+
'&::-webkit-scrollbar': {
|
|
47505
|
+
width: '0.7rem',
|
|
47506
|
+
borderRadius: '9999px',
|
|
47507
|
+
backgroundColor: "rgba(0, 0, 0, 0.05)"
|
|
47508
|
+
},
|
|
47509
|
+
'&::-webkit-scrollbar-thumb': {
|
|
47510
|
+
backgroundColor: "rgba(0, 0, 0, 0.05)",
|
|
47511
|
+
borderRadius: '9999px'
|
|
47512
|
+
}
|
|
47513
|
+
};
|
|
47514
|
+
if (isMobile) {
|
|
47515
|
+
return (React__default.createElement(Drawer, { isOpen: isMobileMenuOpen, placement: "left", onClose: onMobileMenuClose, size: "nav" },
|
|
47516
|
+
React__default.createElement(DrawerOverlay, null),
|
|
47517
|
+
React__default.createElement(DrawerContent, __assign$2({ bgGradient: theme.colors.gradients.primary, color: "white", pt: 6, px: 6, overflow: "auto", sx: customScrollBar }, props),
|
|
47518
|
+
React__default.createElement(DrawerCloseButton, null),
|
|
47519
|
+
children)));
|
|
47520
|
+
}
|
|
47521
|
+
return (React__default.createElement(Flex, __assign$2({ w: "22.5rem", h: "100vh", flexDir: "column", bgGradient: theme.colors.gradients.primary, color: "white", pt: 6, px: 6, overflow: "auto", position: "fixed", top: "0", left: "0", sx: customScrollBar }, props), children));
|
|
47522
|
+
};
|
|
47523
|
+
var SideNavContainer = function (props) { return (React__default.createElement(VStack, __assign$2({ spacing: 6, alignItems: "inherit", minH: "100%" }, props))); };
|
|
47524
|
+
var SideNavHeader = function (_a) {
|
|
47525
|
+
var children = _a.children, rest = __rest$2(_a, ["children"]);
|
|
47526
|
+
return (React__default.createElement(Flex, __assign$2({ h: "3.2rem", alignItems: "center" }, rest), children));
|
|
47527
|
+
};
|
|
47528
|
+
var SideNavBody = function (_a) {
|
|
47529
|
+
var children = _a.children, rest = __rest$2(_a, ["children"]);
|
|
47530
|
+
return (React__default.createElement(VStack, __assign$2({ pt: 4, spacing: 5, alignItems: "inherit" }, rest), children));
|
|
47531
|
+
};
|
|
47532
|
+
var SideNavFooter = function (_a) {
|
|
47533
|
+
var children = _a.children, rest = __rest$2(_a, ["children"]);
|
|
47534
|
+
return (React__default.createElement(Flex, __assign$2({ flex: "1", alignItems: "flex-end", pb: 4 }, rest), children));
|
|
47402
47535
|
};
|
|
47403
|
-
var
|
|
47404
|
-
var
|
|
47405
|
-
return (React__default.createElement(
|
|
47536
|
+
var SideNavMenu = function (_a) {
|
|
47537
|
+
var title = _a.title, children = _a.children, textProps = _a.textProps, rest = __rest$2(_a, ["title", "children", "textProps"]);
|
|
47538
|
+
return (React__default.createElement(VStack, __assign$2({ spacing: 1, alignItems: "inherit", h: "full", w: "full" }, rest),
|
|
47539
|
+
React__default.createElement(Text, __assign$2({ fontSize: "md", fontWeight: "bold", color: "white", textTransform: "uppercase" }, textProps), title),
|
|
47540
|
+
children));
|
|
47406
47541
|
};
|
|
47542
|
+
var SideNavMenuItem = function (_a) {
|
|
47543
|
+
var isActive = _a.isActive, children = _a.children, rest = __rest$2(_a, ["isActive", "children"]);
|
|
47544
|
+
if (isActive) {
|
|
47545
|
+
return (React__default.createElement(Button$1, __assign$2({ w: "full", justifyContent: "flex-start", background: "white", color: "brand.600" }, rest), children));
|
|
47546
|
+
}
|
|
47547
|
+
return (React__default.createElement(Button$1, __assign$2({ w: "full", justifyContent: "flex-start", background: "transparent", color: "brand.50", _hover: { background: 'whiteAlpha.200' }, _focus: { background: 'whiteAlpha.200' }, _active: { background: 'whiteAlpha.200' } }, rest), children));
|
|
47548
|
+
};
|
|
47549
|
+
|
|
47550
|
+
var TopBar = function (props) { return (React__default.createElement(Stack, __assign$2({ minH: "4.6875rem", bg: "white", boxShadow: "layout", w: "full", borderRadius: "0 0 1.25rem 1.25rem", justifyContent: "space-between", spacing: 2, alignItems: { base: 'inherit', xl: 'center' }, direction: { base: 'column', xl: 'row' }, py: { base: 4, xl: 0 } }, props))); };
|
|
47551
|
+
var TopBarFirstElement = function (props) { return (React__default.createElement(Flex, __assign$2({ px: 6, flexDir: "column" }, props))); };
|
|
47552
|
+
var TopBarLastElement = function (props) { return (React__default.createElement(HStack, __assign$2({ px: 6, spacing: 4, justifyContent: "flex-end" }, props))); };
|
|
47407
47553
|
var TopBarBackAction = function (_a) {
|
|
47408
47554
|
var _b = _a.backAction, backAction = _b === void 0 ? function () { } : _b, title = _a.title, rightInformation = _a.rightInformation, rest = __rest$2(_a, ["backAction", "title", "rightInformation"]);
|
|
47409
|
-
return (React__default.createElement(
|
|
47555
|
+
return (React__default.createElement(LayoutContainer, __assign$2({ w: "full", justifyContent: "space-between", alignItems: "center" }, rest),
|
|
47410
47556
|
React__default.createElement(IconButton, { "aria-label": "back", icon: React__default.createElement(Icon, { as: MdArrowBack }), onClick: backAction, variant: "@whiteNeutral" }),
|
|
47411
|
-
React__default.createElement(Text, { fontSize: { base: 'md', md: 'lg', lg: 'xl' }, color: "brand.700", fontWeight: "bold", overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis",
|
|
47557
|
+
React__default.createElement(Text, { fontSize: { base: 'md', md: 'lg', lg: 'xl' }, color: "brand.700", fontWeight: "bold", overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis", w: "full", px: 2 }, title),
|
|
47412
47558
|
rightInformation));
|
|
47413
47559
|
};
|
|
47414
47560
|
|
|
@@ -50913,10 +51059,94 @@ var button = {
|
|
|
50913
51059
|
}
|
|
50914
51060
|
};
|
|
50915
51061
|
|
|
50916
|
-
var
|
|
51062
|
+
var defaultProps$4 = {
|
|
51063
|
+
colorScheme: 'brand'
|
|
51064
|
+
};
|
|
51065
|
+
var baseStyle$1 = {
|
|
51066
|
+
control: {
|
|
51067
|
+
borderRadius: '4px'
|
|
51068
|
+
}
|
|
51069
|
+
};
|
|
51070
|
+
var checkbox = {
|
|
51071
|
+
defaultProps: defaultProps$4,
|
|
51072
|
+
baseStyle: baseStyle$1
|
|
51073
|
+
};
|
|
51074
|
+
|
|
51075
|
+
var getSize = function (value) {
|
|
51076
|
+
if (value === 'full') {
|
|
51077
|
+
return {
|
|
51078
|
+
dialog: { maxW: '100vw', h: '100vh' }
|
|
51079
|
+
};
|
|
51080
|
+
}
|
|
51081
|
+
return {
|
|
51082
|
+
dialog: { maxW: value }
|
|
51083
|
+
};
|
|
51084
|
+
};
|
|
51085
|
+
var sizes$1 = {
|
|
51086
|
+
nav: getSize('nav')
|
|
51087
|
+
};
|
|
51088
|
+
var drawer = {
|
|
51089
|
+
sizes: sizes$1
|
|
51090
|
+
};
|
|
51091
|
+
|
|
51092
|
+
var Input = {
|
|
51093
|
+
baseStyle: {
|
|
51094
|
+
field: {
|
|
51095
|
+
borderRadius: 'full'
|
|
51096
|
+
}
|
|
51097
|
+
},
|
|
51098
|
+
variants: {
|
|
51099
|
+
outline: function (props) {
|
|
51100
|
+
return {
|
|
51101
|
+
field: {
|
|
51102
|
+
bg: 'white',
|
|
51103
|
+
borderColor: 'gray.200',
|
|
51104
|
+
_focus: {
|
|
51105
|
+
borderColor: 'brand.500'
|
|
51106
|
+
},
|
|
51107
|
+
_focusVisible: {
|
|
51108
|
+
boxShadow: "0 0 0 1px ".concat(props.theme.colors.brand[500])
|
|
51109
|
+
}
|
|
51110
|
+
},
|
|
51111
|
+
addon: {
|
|
51112
|
+
borderRadius: 'full'
|
|
51113
|
+
}
|
|
51114
|
+
};
|
|
51115
|
+
},
|
|
51116
|
+
filled: function (props) { return ({
|
|
51117
|
+
field: {
|
|
51118
|
+
bg: 'gray.50',
|
|
51119
|
+
borderWidth: '1px',
|
|
51120
|
+
borderColor: 'gray.200',
|
|
51121
|
+
_hover: {
|
|
51122
|
+
bg: 'gray.50',
|
|
51123
|
+
borderColor: 'gray.200'
|
|
51124
|
+
},
|
|
51125
|
+
_focus: {
|
|
51126
|
+
bg: 'gray.50',
|
|
51127
|
+
borderColor: 'brand.500'
|
|
51128
|
+
},
|
|
51129
|
+
_focusVisible: {
|
|
51130
|
+
boxShadow: "0 0 0 1px ".concat(props.theme.colors.brand[500])
|
|
51131
|
+
}
|
|
51132
|
+
},
|
|
51133
|
+
addon: {
|
|
51134
|
+
borderRadius: 'full'
|
|
51135
|
+
}
|
|
51136
|
+
}); }
|
|
51137
|
+
}
|
|
51138
|
+
};
|
|
51139
|
+
|
|
51140
|
+
var numberInput = {
|
|
50917
51141
|
baseStyle: {
|
|
50918
51142
|
field: {
|
|
50919
51143
|
borderRadius: 'full'
|
|
51144
|
+
},
|
|
51145
|
+
stepperGroup: {
|
|
51146
|
+
width: '2rem'
|
|
51147
|
+
},
|
|
51148
|
+
stepper: {
|
|
51149
|
+
paddingRight: '0.2rem'
|
|
50920
51150
|
}
|
|
50921
51151
|
},
|
|
50922
51152
|
variants: {
|
|
@@ -50963,6 +51193,35 @@ var input = {
|
|
|
50963
51193
|
}
|
|
50964
51194
|
};
|
|
50965
51195
|
|
|
51196
|
+
var variants$1 = {
|
|
51197
|
+
outline: function (props) { var _a; return (_a = Input.variants.outline(props).field) !== null && _a !== void 0 ? _a : {}; },
|
|
51198
|
+
filled: function (props) { var _a; return (_a = Input.variants.filled(props).field) !== null && _a !== void 0 ? _a : {}; }
|
|
51199
|
+
};
|
|
51200
|
+
var pinInput = {
|
|
51201
|
+
variants: variants$1
|
|
51202
|
+
};
|
|
51203
|
+
|
|
51204
|
+
var defaultProps$3 = {
|
|
51205
|
+
colorScheme: 'brand'
|
|
51206
|
+
};
|
|
51207
|
+
var radio = {
|
|
51208
|
+
defaultProps: defaultProps$3
|
|
51209
|
+
};
|
|
51210
|
+
|
|
51211
|
+
var defaultProps$2 = {
|
|
51212
|
+
colorScheme: 'brand'
|
|
51213
|
+
};
|
|
51214
|
+
var slider = {
|
|
51215
|
+
defaultProps: defaultProps$2
|
|
51216
|
+
};
|
|
51217
|
+
|
|
51218
|
+
var defaultProps$1 = {
|
|
51219
|
+
colorScheme: 'brand'
|
|
51220
|
+
};
|
|
51221
|
+
var _switch = {
|
|
51222
|
+
defaultProps: defaultProps$1
|
|
51223
|
+
};
|
|
51224
|
+
|
|
50966
51225
|
var tag = {
|
|
50967
51226
|
baseStyle: {
|
|
50968
51227
|
container: {
|
|
@@ -50972,12 +51231,35 @@ var tag = {
|
|
|
50972
51231
|
}
|
|
50973
51232
|
};
|
|
50974
51233
|
|
|
51234
|
+
var baseStyle = __assign$2(__assign$2({}, Input.baseStyle.field), { paddingY: '8px', minHeight: '80px', lineHeight: 'short', verticalAlign: 'top' });
|
|
51235
|
+
var variants = {
|
|
51236
|
+
outline: function (props) { var _a; return (_a = Input.variants.outline(props).field) !== null && _a !== void 0 ? _a : {}; },
|
|
51237
|
+
filled: function (props) { var _a; return (_a = Input.variants.filled(props).field) !== null && _a !== void 0 ? _a : {}; }
|
|
51238
|
+
};
|
|
51239
|
+
var defaultProps = {
|
|
51240
|
+
size: 'md',
|
|
51241
|
+
variant: 'outline'
|
|
51242
|
+
};
|
|
51243
|
+
var textarea = {
|
|
51244
|
+
baseStyle: baseStyle,
|
|
51245
|
+
variants: variants,
|
|
51246
|
+
defaultProps: defaultProps
|
|
51247
|
+
};
|
|
51248
|
+
|
|
50975
51249
|
var components = /*#__PURE__*/Object.freeze({
|
|
50976
51250
|
__proto__: null,
|
|
50977
51251
|
Badge: badge,
|
|
50978
51252
|
Button: button,
|
|
50979
|
-
|
|
50980
|
-
|
|
51253
|
+
Checkbox: checkbox,
|
|
51254
|
+
Drawer: drawer,
|
|
51255
|
+
Input: Input,
|
|
51256
|
+
NumberInput: numberInput,
|
|
51257
|
+
PinInput: pinInput,
|
|
51258
|
+
Radio: radio,
|
|
51259
|
+
Slider: slider,
|
|
51260
|
+
Switch: _switch,
|
|
51261
|
+
Tag: tag,
|
|
51262
|
+
Textarea: textarea
|
|
50981
51263
|
});
|
|
50982
51264
|
|
|
50983
51265
|
var colors = {
|
|
@@ -51047,6 +51329,18 @@ var colors = {
|
|
|
51047
51329
|
background: '#F8FDFF'
|
|
51048
51330
|
};
|
|
51049
51331
|
|
|
51332
|
+
var radii = {
|
|
51333
|
+
none: '0',
|
|
51334
|
+
sm: '1.125rem',
|
|
51335
|
+
base: '1.25rem',
|
|
51336
|
+
md: '1.375rem',
|
|
51337
|
+
lg: '1.5rem',
|
|
51338
|
+
xl: '1.75rem',
|
|
51339
|
+
'2xl': '2rem',
|
|
51340
|
+
'3xl': '2.5rem',
|
|
51341
|
+
full: '9999px'
|
|
51342
|
+
};
|
|
51343
|
+
|
|
51050
51344
|
var shadows = {
|
|
51051
51345
|
xs: '0px 0px 0px 1px #0F54671A',
|
|
51052
51346
|
sm: '0px 1px 2px 0px #0F54671A',
|
|
@@ -51058,6 +51352,28 @@ var shadows = {
|
|
|
51058
51352
|
layout: '0px 12px 42px 0px #0F54670D'
|
|
51059
51353
|
};
|
|
51060
51354
|
|
|
51355
|
+
var largeSizes = {
|
|
51356
|
+
max: 'max-content',
|
|
51357
|
+
min: 'min-content',
|
|
51358
|
+
full: '100%',
|
|
51359
|
+
'3xs': '14rem',
|
|
51360
|
+
'2xs': '16rem',
|
|
51361
|
+
xs: '20rem',
|
|
51362
|
+
nav: '22.5rem',
|
|
51363
|
+
sm: '24rem',
|
|
51364
|
+
md: '28rem',
|
|
51365
|
+
lg: '32rem',
|
|
51366
|
+
xl: '36rem',
|
|
51367
|
+
'2xl': '42rem',
|
|
51368
|
+
'3xl': '48rem',
|
|
51369
|
+
'4xl': '56rem',
|
|
51370
|
+
'5xl': '64rem',
|
|
51371
|
+
'6xl': '72rem',
|
|
51372
|
+
'7xl': '80rem',
|
|
51373
|
+
'8xl': '90rem'
|
|
51374
|
+
};
|
|
51375
|
+
var sizes = __assign$2({}, largeSizes);
|
|
51376
|
+
|
|
51061
51377
|
var typography = {
|
|
51062
51378
|
fonts: {
|
|
51063
51379
|
heading: "'Work Sans', sans-serif",
|
|
@@ -51069,7 +51385,13 @@ var typography = {
|
|
|
51069
51385
|
}
|
|
51070
51386
|
};
|
|
51071
51387
|
|
|
51072
|
-
var foundations = __assign$2(__assign$2({ colors: colors }, typography), { shadows: shadows });
|
|
51388
|
+
var foundations = __assign$2(__assign$2({ colors: colors }, typography), { sizes: sizes, shadows: shadows, radii: radii });
|
|
51389
|
+
|
|
51390
|
+
var chakraStyle = function () { return ({
|
|
51391
|
+
'div[data-popper-placement]': {
|
|
51392
|
+
minWidth: 'auto !important'
|
|
51393
|
+
}
|
|
51394
|
+
}); };
|
|
51073
51395
|
|
|
51074
51396
|
var reactDayPicker = function (props) { return ({
|
|
51075
51397
|
':root': {
|
|
@@ -51115,13 +51437,14 @@ var reactDayPicker = function (props) { return ({
|
|
|
51115
51437
|
}
|
|
51116
51438
|
}); };
|
|
51117
51439
|
|
|
51118
|
-
var
|
|
51440
|
+
var rawStyle = /*#__PURE__*/Object.freeze({
|
|
51119
51441
|
__proto__: null,
|
|
51442
|
+
chakraStyle: chakraStyle,
|
|
51120
51443
|
reactDayPicker: reactDayPicker
|
|
51121
51444
|
});
|
|
51122
51445
|
|
|
51123
51446
|
var externalsStyles = function (props) {
|
|
51124
|
-
return Object.values(
|
|
51447
|
+
return Object.values(rawStyle).reduce(function (acc, cur) { return (__assign$2(__assign$2({}, acc), (typeof cur === 'function' ? cur(props) : cur))); }, {});
|
|
51125
51448
|
};
|
|
51126
51449
|
var styles = {
|
|
51127
51450
|
global: function (props) { return (__assign$2({ '#chakra-toast-portal > *': {
|
|
@@ -51134,5 +51457,5 @@ var styles = {
|
|
|
51134
51457
|
|
|
51135
51458
|
var theme = extendTheme(__assign$2(__assign$2({ styles: styles }, foundations), { components: __assign$2({}, components) }));
|
|
51136
51459
|
|
|
51137
|
-
export { ActionsButton, DataList, DataListAccordion, DataListAccordionButton, DataListAccordionIcon, DataListAccordionPanel, DataListCell, DataListContext, DataListFooter, DataListHeader, DataListHeaderContext, DataListRow, DayPicker, FormGroup, InputDayPicker, Pagination, PaginationButtonFirstPage, PaginationButtonLastPage, PaginationButtonNextPage, PaginationButtonPrevPage, PaginationContext, PaginationInfo, SearchInput, Select, TopBar, TopBarBackAction, TopBarFirstElement, TopBarLastElement, getPaginationInfo, theme };
|
|
51460
|
+
export { ActionsButton, BottomBar, Card, ConfirmMenuItem, DataList, DataListAccordion, DataListAccordionButton, DataListAccordionIcon, DataListAccordionPanel, DataListCell, DataListContext, DataListFooter, DataListHeader, DataListHeaderContext, DataListRow, DayPicker, FormGroup, InputDayPicker, LayoutContainer, MenuItem, Pagination, PaginationButtonFirstPage, PaginationButtonLastPage, PaginationButtonNextPage, PaginationButtonPrevPage, PaginationContext, PaginationInfo, SearchInput, Select, SideNav, SideNavBody, SideNavContainer, SideNavFooter, SideNavHeader, SideNavMenu, SideNavMenuItem, TopBar, TopBarBackAction, TopBarFirstElement, TopBarLastElement, dateFormat, getPaginationInfo, theme, useIsMobile };
|
|
51138
51461
|
//# sourceMappingURL=index.js.map
|