@xqmsg/ui-core 0.18.0 → 0.18.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/components/navigation/index.d.ts +8 -2
- package/dist/components/toolbar/index.d.ts +2 -6
- package/dist/ui-core.cjs.development.js +6 -236
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +6 -236
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/navigation/index.tsx +10 -5
- package/src/components/toolbar/Toolbar.stories.tsx +9 -2
- package/src/components/toolbar/index.tsx +5 -49
- package/dist/components/toolbar/components/actions/index.d.ts +0 -14
- package/src/components/toolbar/components/actions/index.tsx +0 -39
package/dist/ui-core.esm.js
CHANGED
|
@@ -7,8 +7,6 @@ import { HiOutlineRefresh } from 'react-icons/hi';
|
|
|
7
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
|
-
import { FolderAddOutline as FolderAddOutline$1 } from 'src/components/icons';
|
|
11
|
-
import { useMediaQuery as useMediaQuery$1 } from '@chakra-ui/media-query';
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
12
|
* A functional React component utilized to render the `Button` component
|
|
@@ -4205,221 +4203,14 @@ var ToolbarBreadcrumbs = function ToolbarBreadcrumbs(_ref) {
|
|
|
4205
4203
|
}));
|
|
4206
4204
|
};
|
|
4207
4205
|
|
|
4208
|
-
/**
|
|
4209
|
-
* A functional React component utilized to render the `Add` component
|
|
4210
|
-
*/
|
|
4211
|
-
|
|
4212
|
-
var Add = function Add(_ref) {
|
|
4213
|
-
var onClick = _ref.onClick;
|
|
4214
|
-
return /*#__PURE__*/React__default.createElement(Box, {
|
|
4215
|
-
mx: "8px",
|
|
4216
|
-
cursor: "pointer",
|
|
4217
|
-
onClick: onClick
|
|
4218
|
-
}, /*#__PURE__*/React__default.createElement(FolderAddOutline$1, {
|
|
4219
|
-
boxSize: "16px"
|
|
4220
|
-
}));
|
|
4221
|
-
};
|
|
4222
|
-
|
|
4223
|
-
/**
|
|
4224
|
-
* A functional React component utilized to render the `Dropdown` component
|
|
4225
|
-
*/
|
|
4226
|
-
|
|
4227
|
-
var Dropdown$2 = function Dropdown(_ref) {
|
|
4228
|
-
var onSelectItem = _ref.onSelectItem,
|
|
4229
|
-
options = _ref.options,
|
|
4230
|
-
dropdownRef = _ref.dropdownRef,
|
|
4231
|
-
position = _ref.position,
|
|
4232
|
-
optionIndex = _ref.optionIndex,
|
|
4233
|
-
setOptionIndex = _ref.setOptionIndex;
|
|
4234
|
-
var DropdownContent = useMemo(function () {
|
|
4235
|
-
return options.map(function (option, idx) {
|
|
4236
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, option.value === 'section_header' && options[idx + 1] && options[idx + 1].value !== 'section_header' && /*#__PURE__*/React__default.createElement(Box, {
|
|
4237
|
-
color: colors.label.secondary.light,
|
|
4238
|
-
fontSize: "13px",
|
|
4239
|
-
width: "fit-content",
|
|
4240
|
-
fontWeight: "bold",
|
|
4241
|
-
px: "8px",
|
|
4242
|
-
pl: "26px",
|
|
4243
|
-
whiteSpace: "nowrap"
|
|
4244
|
-
}, idx > 0 && /*#__PURE__*/React__default.createElement(Box, {
|
|
4245
|
-
width: "100%",
|
|
4246
|
-
my: "3px",
|
|
4247
|
-
borderTop: "2px solid",
|
|
4248
|
-
borderColor: colors.border["default"]
|
|
4249
|
-
}), option.label), option.value !== 'section_header' && /*#__PURE__*/React__default.createElement(Flex, {
|
|
4250
|
-
alignItems: "center",
|
|
4251
|
-
cursor: "pointer",
|
|
4252
|
-
onClick: function onClick() {
|
|
4253
|
-
setOptionIndex(idx);
|
|
4254
|
-
onSelectItem(option);
|
|
4255
|
-
},
|
|
4256
|
-
key: option.value,
|
|
4257
|
-
fontSize: "13px",
|
|
4258
|
-
px: "8px",
|
|
4259
|
-
py: "4px",
|
|
4260
|
-
width: "100%",
|
|
4261
|
-
color: colors.label.primary.light,
|
|
4262
|
-
whiteSpace: "nowrap",
|
|
4263
|
-
id: option.value
|
|
4264
|
-
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
4265
|
-
mr: "8px",
|
|
4266
|
-
width: "12px"
|
|
4267
|
-
}, optionIndex === idx && /*#__PURE__*/React__default.createElement(Checkmark, {
|
|
4268
|
-
boxSize: "12px"
|
|
4269
|
-
})), option.label));
|
|
4270
|
-
});
|
|
4271
|
-
}, [onSelectItem, optionIndex, options, setOptionIndex]);
|
|
4272
|
-
return /*#__PURE__*/React__default.createElement(Flex, {
|
|
4273
|
-
flexDirection: "column",
|
|
4274
|
-
ref: dropdownRef,
|
|
4275
|
-
scrollMargin: "15px",
|
|
4276
|
-
backdropFilter: "auto",
|
|
4277
|
-
backdropBlur: "64px",
|
|
4278
|
-
borderRadius: "4px",
|
|
4279
|
-
bg: colors.fill.light.tertiary,
|
|
4280
|
-
mt: "3px",
|
|
4281
|
-
maxH: "240px",
|
|
4282
|
-
overflowY: "auto",
|
|
4283
|
-
px: "8px",
|
|
4284
|
-
py: "4px",
|
|
4285
|
-
position: "absolute",
|
|
4286
|
-
top: position === 'top' ? 26 : undefined,
|
|
4287
|
-
bottom: position === 'bottom' ? 30 : undefined,
|
|
4288
|
-
right: 0,
|
|
4289
|
-
width: "fit-content",
|
|
4290
|
-
minWidth: "100%",
|
|
4291
|
-
zIndex: 100,
|
|
4292
|
-
tabIndex: -2000
|
|
4293
|
-
}, DropdownContent);
|
|
4294
|
-
};
|
|
4295
|
-
|
|
4296
|
-
/**
|
|
4297
|
-
* A functional React component utilized to render the `Sort` component
|
|
4298
|
-
*/
|
|
4299
|
-
|
|
4300
|
-
var Sort = function Sort(_ref) {
|
|
4301
|
-
var onSelectItem = _ref.onSelectItem,
|
|
4302
|
-
sortOptions = _ref.sortOptions;
|
|
4303
|
-
var dropdownMenuRef = useRef(null);
|
|
4304
|
-
|
|
4305
|
-
var _useState = useState(false),
|
|
4306
|
-
showDropdown = _useState[0],
|
|
4307
|
-
setShowDropdown = _useState[1];
|
|
4308
|
-
|
|
4309
|
-
var _useState2 = useState(null),
|
|
4310
|
-
optionIndex = _useState2[0],
|
|
4311
|
-
setOptionIndex = _useState2[1];
|
|
4312
|
-
|
|
4313
|
-
useOutsideClick({
|
|
4314
|
-
ref: dropdownMenuRef,
|
|
4315
|
-
handler: function handler() {
|
|
4316
|
-
return setShowDropdown(false);
|
|
4317
|
-
}
|
|
4318
|
-
});
|
|
4319
|
-
return /*#__PURE__*/React__default.createElement(Box, {
|
|
4320
|
-
onClick: function onClick() {
|
|
4321
|
-
return setShowDropdown(!showDropdown);
|
|
4322
|
-
},
|
|
4323
|
-
position: "relative"
|
|
4324
|
-
}, /*#__PURE__*/React__default.createElement(Flex, {
|
|
4325
|
-
alignItems: "center",
|
|
4326
|
-
cursor: "pointer",
|
|
4327
|
-
onClick: function onClick() {
|
|
4328
|
-
return setShowDropdown(!showDropdown);
|
|
4329
|
-
}
|
|
4330
|
-
}, /*#__PURE__*/React__default.createElement(TableOutline, {
|
|
4331
|
-
boxSize: "16px"
|
|
4332
|
-
}), /*#__PURE__*/React__default.createElement(Box, {
|
|
4333
|
-
ml: "2px"
|
|
4334
|
-
}, /*#__PURE__*/React__default.createElement(ChevronDown, {
|
|
4335
|
-
boxSize: "12px"
|
|
4336
|
-
})), showDropdown && /*#__PURE__*/React__default.createElement(Dropdown$2, {
|
|
4337
|
-
onSelectItem: onSelectItem,
|
|
4338
|
-
options: sortOptions,
|
|
4339
|
-
position: "top",
|
|
4340
|
-
dropdownRef: dropdownMenuRef,
|
|
4341
|
-
optionIndex: optionIndex,
|
|
4342
|
-
setOptionIndex: setOptionIndex
|
|
4343
|
-
})));
|
|
4344
|
-
};
|
|
4345
|
-
|
|
4346
|
-
/**
|
|
4347
|
-
* A functional React component utilized to render the `Search` component
|
|
4348
|
-
*/
|
|
4349
|
-
|
|
4350
|
-
var Search$1 = function Search$1(_ref) {
|
|
4351
|
-
var searchValue = _ref.searchValue,
|
|
4352
|
-
onClick = _ref.onClick,
|
|
4353
|
-
_onChange = _ref.onChange;
|
|
4354
|
-
|
|
4355
|
-
var _useMediaQuery = useMediaQuery('(max-width: 600px)'),
|
|
4356
|
-
breakpoint600 = _useMediaQuery[0];
|
|
4357
|
-
|
|
4358
|
-
return /*#__PURE__*/React__default.createElement(Box, null, breakpoint600 ? /*#__PURE__*/React__default.createElement(Box, {
|
|
4359
|
-
cursor: "pointer",
|
|
4360
|
-
onClick: onClick
|
|
4361
|
-
}, /*#__PURE__*/React__default.createElement(Search, {
|
|
4362
|
-
boxSize: "16px"
|
|
4363
|
-
})) : /*#__PURE__*/React__default.createElement(StackedInput, {
|
|
4364
|
-
placeholder: "Search...",
|
|
4365
|
-
name: "search",
|
|
4366
|
-
value: searchValue,
|
|
4367
|
-
onChange: function onChange(e) {
|
|
4368
|
-
return _onChange(e.target.value);
|
|
4369
|
-
}
|
|
4370
|
-
}));
|
|
4371
|
-
};
|
|
4372
|
-
|
|
4373
|
-
/**
|
|
4374
|
-
* A functional React component utilized to render the `Actions` component
|
|
4375
|
-
*/
|
|
4376
|
-
|
|
4377
|
-
var Actions = function Actions(_ref) {
|
|
4378
|
-
var onSelectSortItem = _ref.onSelectSortItem,
|
|
4379
|
-
onClickAdd = _ref.onClickAdd,
|
|
4380
|
-
onChangeSearch = _ref.onChangeSearch,
|
|
4381
|
-
onClickSearch = _ref.onClickSearch,
|
|
4382
|
-
searchValue = _ref.searchValue,
|
|
4383
|
-
sortOptions = _ref.sortOptions;
|
|
4384
|
-
return /*#__PURE__*/React__default.createElement(Flex, {
|
|
4385
|
-
alignItems: "center"
|
|
4386
|
-
}, /*#__PURE__*/React__default.createElement(Sort, {
|
|
4387
|
-
onSelectItem: onSelectSortItem,
|
|
4388
|
-
sortOptions: sortOptions
|
|
4389
|
-
}), /*#__PURE__*/React__default.createElement(Add, {
|
|
4390
|
-
onClick: onClickAdd
|
|
4391
|
-
}), /*#__PURE__*/React__default.createElement(Search$1, {
|
|
4392
|
-
onChange: onChangeSearch,
|
|
4393
|
-
onClick: onClickSearch,
|
|
4394
|
-
searchValue: searchValue
|
|
4395
|
-
}));
|
|
4396
|
-
};
|
|
4397
|
-
|
|
4398
4206
|
/**
|
|
4399
4207
|
* A functional React component utilized to render the `Toolbar` component
|
|
4400
4208
|
*/
|
|
4401
4209
|
|
|
4402
4210
|
var Toolbar = function Toolbar(_ref) {
|
|
4403
|
-
var
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
sortOptions = _ref.sortOptions,
|
|
4407
|
-
onChangeSearch = _ref.onChangeSearch,
|
|
4408
|
-
onClickAdd = _ref.onClickAdd,
|
|
4409
|
-
onSelectSortItem = _ref.onSelectSortItem;
|
|
4410
|
-
|
|
4411
|
-
var _useMediaQuery = useMediaQuery$1('(min-width: 600px)'),
|
|
4412
|
-
breakpoint800 = _useMediaQuery[0];
|
|
4413
|
-
|
|
4414
|
-
var _useState = useState(false),
|
|
4415
|
-
showSearch = _useState[0],
|
|
4416
|
-
setShowSearch = _useState[1];
|
|
4417
|
-
|
|
4418
|
-
useEffect(function () {
|
|
4419
|
-
if (breakpoint800) {
|
|
4420
|
-
setShowSearch(false);
|
|
4421
|
-
}
|
|
4422
|
-
}, [breakpoint800, showSearch]);
|
|
4211
|
+
var children = _ref.children,
|
|
4212
|
+
pageList = _ref.pageList,
|
|
4213
|
+
currentPage = _ref.currentPage;
|
|
4423
4214
|
return /*#__PURE__*/React__default.createElement(Flex, {
|
|
4424
4215
|
flexDirection: "column"
|
|
4425
4216
|
}, /*#__PURE__*/React__default.createElement(Flex, {
|
|
@@ -4431,30 +4222,9 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
4431
4222
|
}, /*#__PURE__*/React__default.createElement(ToolbarBreadcrumbs, {
|
|
4432
4223
|
pageList: pageList,
|
|
4433
4224
|
currentPage: currentPage
|
|
4434
|
-
}), /*#__PURE__*/React__default.createElement(
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
onClickSearch: function onClickSearch() {
|
|
4438
|
-
return setShowSearch(!showSearch);
|
|
4439
|
-
},
|
|
4440
|
-
onSelectSortItem: onSelectSortItem,
|
|
4441
|
-
searchValue: searchValue,
|
|
4442
|
-
sortOptions: sortOptions
|
|
4443
|
-
})), showSearch && /*#__PURE__*/React__default.createElement(Flex, {
|
|
4444
|
-
px: "13px",
|
|
4445
|
-
height: "52px",
|
|
4446
|
-
alignItems: "center",
|
|
4447
|
-
background: "white",
|
|
4448
|
-
borderTop: "1px solid",
|
|
4449
|
-
borderColor: colors.fill.light.tertiary
|
|
4450
|
-
}, /*#__PURE__*/React__default.createElement(StackedInput, {
|
|
4451
|
-
placeholder: "Search...",
|
|
4452
|
-
name: "search",
|
|
4453
|
-
value: searchValue,
|
|
4454
|
-
onChange: function onChange(e) {
|
|
4455
|
-
return onChangeSearch(e.target.value);
|
|
4456
|
-
}
|
|
4457
|
-
})));
|
|
4225
|
+
}), /*#__PURE__*/React__default.createElement(Flex, {
|
|
4226
|
+
alignItems: "center"
|
|
4227
|
+
}, children, " ")));
|
|
4458
4228
|
};
|
|
4459
4229
|
|
|
4460
4230
|
function formatErrorResponse(error) {
|