@xqmsg/ui-core 0.18.7 → 0.19.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.
@@ -1,10 +1,10 @@
1
1
  import React__default, { memo, forwardRef, createElement, useMemo, useCallback, useRef, useEffect, useState } from 'react';
2
- import { Button as Button$2, Alert as Alert$1, AlertDescription, Flex, Box, Text as Text$2, Spinner, Checkbox, InputGroup, Input as Input$2, RadioGroup, Radio, InputRightElement, Textarea as Textarea$1, useOutsideClick, Switch as Switch$1, FormLabel as FormLabel$1, Tooltip, FormControl, FormErrorMessage, FormHelperText, SimpleGrid, useMediaQuery, Grid, GridItem, IconButton, Collapse, Link as Link$2, Table as Table$2, Tbody, Tr, Td, TableContainer, Thead, Th, Tabs as Tabs$1, TabList, Tab, extendTheme } from '@chakra-ui/react';
2
+ import { Button as Button$2, Alert as Alert$1, AlertDescription, Flex, Box, Text as Text$2, Spinner, Checkbox, InputGroup, Input as Input$2, RadioGroup, Radio, InputRightElement, Textarea as Textarea$1, useOutsideClick, Switch as Switch$1, FormLabel as FormLabel$1, Tooltip, FormControl, FormErrorMessage, FormHelperText, SimpleGrid, useMediaQuery, Grid, GridItem, IconButton, Collapse, Link as Link$2, Table as Table$2, Tbody, Tr, Td, TableContainer, Thead, Th, Tabs as Tabs$1, TabList, Tab, extendTheme, ChakraProvider, useToast as useToast$1 } from '@chakra-ui/react';
3
3
  import { FormProvider, useWatch, Controller } from 'react-hook-form';
4
4
  import { debounce, truncate } from 'lodash-es';
5
5
  import { QuestionOutlineIcon, CloseIcon, HamburgerIcon } from '@chakra-ui/icons';
6
+ import { Link as Link$3 } from 'react-router-dom';
6
7
  import { HiOutlineRefresh } from 'react-icons/hi';
7
- import { ChakraProvider } from '@chakra-ui/provider';
8
8
  import { createBreakpoints, transparentize, mode, getColor } from '@chakra-ui/theme-tools';
9
9
  import { defineStyle } from '@chakra-ui/system';
10
10
 
@@ -83,7 +83,7 @@ var SvgNeutral = function SvgNeutral(props, ref) {
83
83
  ref: ref
84
84
  }, props), _path$1 || (_path$1 = /*#__PURE__*/createElement("path", {
85
85
  d: "M7 4.5V4a.5.5 0 0 0-.5.5H7Zm.005 0h.5a.5.5 0 0 0-.5-.5v.5Zm0 .005v.5a.5.5 0 0 0 .5-.5h-.5Zm-.005 0h-.5a.5.5 0 0 0 .5.5v-.5Zm-.724 1.548a.5.5 0 1 0 .448.894l-.448-.894Zm.252.433-.224-.447.224.447Zm.708.569.485.12-.485-.12Zm-.472 1.89-.485-.12.485.12Zm.708.569.224.447-.224-.447Zm.252.433a.5.5 0 1 0-.448-.894l.448.894ZM12.5 7A5.5 5.5 0 0 1 7 12.5v1A6.5 6.5 0 0 0 13.5 7h-1ZM7 12.5A5.5 5.5 0 0 1 1.5 7h-1A6.5 6.5 0 0 0 7 13.5v-1ZM1.5 7A5.5 5.5 0 0 1 7 1.5v-1A6.5 6.5 0 0 0 .5 7h1ZM7 1.5A5.5 5.5 0 0 1 12.5 7h1A6.5 6.5 0 0 0 7 .5v1ZM7 5h.005V4H7v1Zm-.495-.5v.005h1V4.5h-1Zm.5-.495H7v1h.005v-1Zm.495.5V4.5h-1v.005h1Zm-.776 2.442.027-.014-.447-.894-.028.014.448.894Zm.027-.014L6.28 8.824l.97.243.472-1.891-.97-.243Zm.945 3.028.028-.014-.448-.894-.027.014.447.894ZM6.279 8.824a1 1 0 0 0 1.417 1.137l-.447-.894-.97-.243Zm.472-1.89.97.242a1 1 0 0 0-1.417-1.137l.447.894Z",
86
- fill: "#3C3C43",
86
+ fill: "current",
87
87
  fillOpacity: 0.6
88
88
  })));
89
89
  };
@@ -95,9 +95,11 @@ var Memo$1 = /*#__PURE__*/memo(ForwardRef$1);
95
95
  */
96
96
 
97
97
  var Neutral = function Neutral(_ref) {
98
- var boxSize = _ref.boxSize;
98
+ var color = _ref.color,
99
+ boxSize = _ref.boxSize;
99
100
  return /*#__PURE__*/React__default.createElement(Memo$1, {
100
- boxSize: boxSize
101
+ boxSize: boxSize,
102
+ fill: color || '#3C3C43'
101
103
  });
102
104
  };
103
105
 
@@ -2856,22 +2858,31 @@ var NavigationMenuItem = function NavigationMenuItem(_ref) {
2856
2858
  var label = _ref.label,
2857
2859
  leftIcon = _ref.leftIcon,
2858
2860
  href = _ref.href,
2861
+ to = _ref.to,
2859
2862
  rightIcon = _ref.rightIcon,
2860
2863
  isExternal = _ref.isExternal,
2861
2864
  isSelected = _ref.isSelected,
2862
2865
  onClick = _ref.onClick;
2863
2866
  var additionalProps = {};
2867
+ var reactRouterLinkProps = {};
2868
+
2869
+ if (to) {
2870
+ reactRouterLinkProps = {
2871
+ to: to,
2872
+ as: Link$3
2873
+ };
2874
+ }
2864
2875
 
2865
2876
  if (isExternal) {
2866
2877
  additionalProps = _extends$6({}, additionalProps, {
2867
2878
  referrerPolicy: 'no-referrer',
2868
- target: '_blank'
2879
+ target: '_blank',
2880
+ href: href,
2881
+ isExternal: true
2869
2882
  });
2870
2883
  }
2871
2884
 
2872
- return /*#__PURE__*/React__default.createElement(Link$2, Object.assign({
2873
- href: href
2874
- }, additionalProps, {
2885
+ return /*#__PURE__*/React__default.createElement(Link$2, Object.assign({}, reactRouterLinkProps, additionalProps, {
2875
2886
  onClick: onClick,
2876
2887
  display: "flex",
2877
2888
  alignItems: "center",
@@ -4300,6 +4311,87 @@ var Toolbar = function Toolbar(_ref) {
4300
4311
  }, children, " ")));
4301
4312
  };
4302
4313
 
4314
+ /**
4315
+ * A functional React component utilized to render the `Toast` component
4316
+ */
4317
+
4318
+ var Toast = function Toast(_ref) {
4319
+ var variant = _ref.variant,
4320
+ message = _ref.message,
4321
+ buttonText = _ref.buttonText,
4322
+ onClick = _ref.onClick;
4323
+ var Icon = useMemo(function () {
4324
+ switch (variant) {
4325
+ case 'error':
4326
+ return /*#__PURE__*/React__default.createElement(Error$1, {
4327
+ boxSize: "16px"
4328
+ });
4329
+
4330
+ case 'neutral':
4331
+ return /*#__PURE__*/React__default.createElement(Neutral, {
4332
+ boxSize: "16px",
4333
+ color: "white"
4334
+ });
4335
+
4336
+ case 'positive':
4337
+ return /*#__PURE__*/React__default.createElement(Positive, {
4338
+ boxSize: "16px"
4339
+ });
4340
+
4341
+ case 'warning':
4342
+ return /*#__PURE__*/React__default.createElement(Warning, {
4343
+ boxSize: "16px"
4344
+ });
4345
+
4346
+ default:
4347
+ return null;
4348
+ }
4349
+ }, [variant]);
4350
+ return /*#__PURE__*/React__default.createElement(Flex, {
4351
+ alignItems: "center",
4352
+ width: "fit-content",
4353
+ height: "32px",
4354
+ p: "8px",
4355
+ bg: "#151515D9",
4356
+ borderColor: "#9999991A",
4357
+ borderRadius: "8px"
4358
+ }, /*#__PURE__*/React__default.createElement(Box, {
4359
+ pr: "8px"
4360
+ }, Icon), /*#__PURE__*/React__default.createElement(Text$2, {
4361
+ pr: "16px",
4362
+ fontSize: "13px",
4363
+ color: colors.label.primary.dark
4364
+ }, message), onClick && buttonText && /*#__PURE__*/React__default.createElement(Flex, {
4365
+ ml: "auto",
4366
+ justifyContent: "flex-end"
4367
+ }, /*#__PURE__*/React__default.createElement(Button$2, {
4368
+ color: colors.fill.action,
4369
+ style: {
4370
+ background: 'transparent',
4371
+ border: 'transparent',
4372
+ boxShadow: 'none'
4373
+ },
4374
+ _hover: {
4375
+ bg: 'transparent',
4376
+ border: 'transparent',
4377
+ boxShadow: 'none'
4378
+ },
4379
+ onClick: onClick
4380
+ }, buttonText)));
4381
+ };
4382
+
4383
+ var useToast = function useToast(props) {
4384
+ var toast = useToast$1();
4385
+ return function () {
4386
+ return toast({
4387
+ position: props.position,
4388
+ render: function render() {
4389
+ return /*#__PURE__*/React__default.createElement(Toast, Object.assign({}, props));
4390
+ }
4391
+ });
4392
+ };
4393
+ };
4394
+
4303
4395
  function formatErrorResponse(error) {
4304
4396
  var _error$response, _error$response$data;
4305
4397
 
@@ -4326,5 +4418,5 @@ function formatErrorResponse(error) {
4326
4418
  };
4327
4419
  }
4328
4420
 
4329
- export { Banner, Breadcrumbs, Button, Checkmark, ChevronDown, ChevronRight, Clock, Close, Dropdown$1 as Dropdown, Error$1 as Error, FileFill, FileOutline, FolderAddFill, FolderAddOutline, FolderFill, FolderOutline, Form, FormSection, Google, GoogleButton, GoogleDrive, Group, Home, Image, Input, Layout, Link, LoadingIndicator, Menu, Microsoft, MicrosoftButton, MicrosoftOneDrive, NavigationMenu, Neutral, Positive, Search, Settings, SpinnerButton, Table, TableFill, TableOutline, TabsWrapper, Text, Toolbar, Trash, Warning, XQThemeProvider, colors, formatErrorResponse };
4421
+ export { Banner, Breadcrumbs, Button, Checkmark, ChevronDown, ChevronRight, Clock, Close, Dropdown$1 as Dropdown, Error$1 as Error, FileFill, FileOutline, FolderAddFill, FolderAddOutline, FolderFill, FolderOutline, Form, FormSection, Google, GoogleButton, GoogleDrive, Group, Home, Image, Input, Layout, Link, LoadingIndicator, Menu, Microsoft, MicrosoftButton, MicrosoftOneDrive, NavigationMenu, Neutral, Positive, Search, Settings, SpinnerButton, Table, TableFill, TableOutline, TabsWrapper, Text, Toolbar, Trash, Warning, XQThemeProvider, colors, formatErrorResponse, useToast };
4330
4422
  //# sourceMappingURL=ui-core.esm.js.map