@bioturing/components 0.13.3 → 0.14.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/CodeBlock.js +277 -132
- package/dist/DSRoot.js +309 -149
- package/dist/DropdownMenu.js +6 -1
- package/dist/Modal.js +9 -6
- package/dist/PopupPanel.css +116 -0
- package/dist/PopupPanel.js +333 -0
- package/dist/ScrollArea.js +4 -1
- package/dist/Select.js +126 -11
- package/dist/Table.js +3 -2
- package/dist/ThemeProvider.js +273 -131
- package/dist/Toast.js +286 -138
- package/dist/Upload.js +43 -1
- package/dist/components/{src/components/DSRoot → DSRoot}/component.d.ts +1 -1
- package/dist/components/DSRoot/context.d.ts +7 -0
- package/dist/components/{src/components/DropdownMenu → DropdownMenu}/component.d.ts +6 -1
- package/dist/components/{src/components/Modal → Modal}/Modal.d.ts +16 -1
- package/dist/components/{src/components/Modal → Modal}/index.d.ts +1 -1
- package/dist/components/PopupPanel/component.d.ts +61 -0
- package/dist/components/PopupPanel/constants.d.ts +7 -0
- package/dist/components/{src/components/Select → Select}/component.d.ts +13 -1
- package/dist/components/{src/components/Table → Table}/component.d.ts +1 -1
- package/dist/components/VerticalCollapsiblePanel/index.d.ts +1 -0
- package/dist/components/{src/components/hooks → hooks}/base-ui.d.ts +2 -2
- package/dist/components/{src/components/hooks → hooks}/index.d.ts +1 -0
- package/dist/components/hooks/useCharts.d.ts +22 -0
- package/dist/components/{src/components/index.d.ts → index.d.ts} +1 -0
- package/dist/components/{src/components/utils → utils}/antdUtils.d.ts +5 -0
- package/dist/hooks.js +961 -0
- package/dist/index.css +116 -0
- package/dist/index.js +1193 -242
- package/dist/style.css +157 -7
- package/dist/tokens/and-theme/index.d.ts +1 -0
- package/dist/{components/src/tokens/index.d.ts → tokens/and-theme/tokens.d.ts} +2 -0
- package/dist/tokens/charts/index.d.ts +6 -0
- package/dist/tokens/charts/tokens.d.ts +455 -0
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/utils.d.ts +16 -0
- package/dist/utils.js +43 -1
- package/package.json +17 -6
- package/dist/assets/src/icons/custom/ANOVAAnalysis.d.ts +0 -7
- package/dist/assets/src/icons/custom/AUCell.d.ts +0 -7
- package/dist/assets/src/icons/custom/Alphabet.d.ts +0 -7
- package/dist/assets/src/icons/custom/BarChart.d.ts +0 -7
- package/dist/assets/src/icons/custom/BoxPlot.d.ts +0 -7
- package/dist/assets/src/icons/custom/BubbleHeatmap.d.ts +0 -7
- package/dist/assets/src/icons/custom/CDR3Spectratyping.d.ts +0 -7
- package/dist/assets/src/icons/custom/CancerPrediction.d.ts +0 -7
- package/dist/assets/src/icons/custom/Cell.d.ts +0 -7
- package/dist/assets/src/icons/custom/CellCellCommunication.d.ts +0 -7
- package/dist/assets/src/icons/custom/CellSearch.d.ts +0 -7
- package/dist/assets/src/icons/custom/CellTypeDeconvolution.d.ts +0 -7
- package/dist/assets/src/icons/custom/CellTypePrediction.d.ts +0 -7
- package/dist/assets/src/icons/custom/Cells.d.ts +0 -7
- package/dist/assets/src/icons/custom/Circos.d.ts +0 -7
- package/dist/assets/src/icons/custom/Clonotype.d.ts +0 -7
- package/dist/assets/src/icons/custom/CoexpressionPlot.d.ts +0 -7
- package/dist/assets/src/icons/custom/Composition.d.ts +0 -7
- package/dist/assets/src/icons/custom/DEG.d.ts +0 -7
- package/dist/assets/src/icons/custom/Digits.d.ts +0 -7
- package/dist/assets/src/icons/custom/DiversityAnalysis.d.ts +0 -7
- package/dist/assets/src/icons/custom/Embedding.d.ts +0 -7
- package/dist/assets/src/icons/custom/EnrichmentTest.d.ts +0 -7
- package/dist/assets/src/icons/custom/Eppendorf.d.ts +0 -7
- package/dist/assets/src/icons/custom/FileArrowRight.d.ts +0 -7
- package/dist/assets/src/icons/custom/FolderArrowRight.d.ts +0 -7
- package/dist/assets/src/icons/custom/Heatmap.d.ts +0 -7
- package/dist/assets/src/icons/custom/ImageSegmentation.d.ts +0 -7
- package/dist/assets/src/icons/custom/IntersectionPlot.d.ts +0 -7
- package/dist/assets/src/icons/custom/LouvainClustering.d.ts +0 -7
- package/dist/assets/src/icons/custom/MarkerGenes.d.ts +0 -7
- package/dist/assets/src/icons/custom/MixedView.d.ts +0 -7
- package/dist/assets/src/icons/custom/NeighborhoodAnalysis.d.ts +0 -7
- package/dist/assets/src/icons/custom/PenSize.d.ts +0 -7
- package/dist/assets/src/icons/custom/Pertubation.d.ts +0 -7
- package/dist/assets/src/icons/custom/Pseudotime.d.ts +0 -7
- package/dist/assets/src/icons/custom/RegionSegmentation.d.ts +0 -7
- package/dist/assets/src/icons/custom/ScatterPlotTissueImageView.d.ts +0 -7
- package/dist/assets/src/icons/custom/ScatterPlotView.d.ts +0 -7
- package/dist/assets/src/icons/custom/SegmentSelection.d.ts +0 -7
- package/dist/assets/src/icons/custom/SpatialCellProportion.d.ts +0 -7
- package/dist/assets/src/icons/custom/Species.d.ts +0 -7
- package/dist/assets/src/icons/custom/SubClustering.d.ts +0 -7
- package/dist/assets/src/icons/custom/TSNEUMAP.d.ts +0 -7
- package/dist/assets/src/icons/custom/TissueImageScatterPlotView.d.ts +0 -7
- package/dist/assets/src/icons/custom/TissueImageView.d.ts +0 -7
- package/dist/assets/src/icons/custom/TwoD.d.ts +0 -7
- package/dist/assets/src/icons/custom/VennDiagramAnalysis.d.ts +0 -7
- package/dist/assets/src/icons/custom/ViolinPlot.d.ts +0 -7
- package/dist/assets/src/icons/custom/index.d.ts +0 -49
- package/dist/assets/src/icons/index.d.ts +0 -2
- package/dist/assets/src/icons/phosphor.d.ts +0 -1
- package/dist/assets/src/index.d.ts +0 -2
- package/dist/assets/src/logos/BBrowserX.d.ts +0 -9
- package/dist/assets/src/logos/BioStudio.d.ts +0 -9
- package/dist/assets/src/logos/BioTuring.d.ts +0 -9
- package/dist/assets/src/logos/BioTuringAlpha.d.ts +0 -9
- package/dist/assets/src/logos/BioVinci.d.ts +0 -9
- package/dist/assets/src/logos/Lens.d.ts +0 -9
- package/dist/assets/src/logos/Pixel.d.ts +0 -9
- package/dist/assets/src/logos/SmartBulk.d.ts +0 -9
- package/dist/assets/src/logos/SpatialX.d.ts +0 -9
- package/dist/assets/src/logos/Talk2Data.d.ts +0 -9
- package/dist/assets/src/logos/Vinci.d.ts +0 -9
- package/dist/assets/src/logos/index.d.ts +0 -11
- package/dist/components/src/components/DropdownMenu/utils.d.ts +0 -5
- package/dist/components/{src/components/Badge → Badge}/component.d.ts +0 -0
- package/dist/components/{src/components/Badge → Badge}/index.d.ts +0 -0
- package/dist/components/{src/components/Breadcrumb → Breadcrumb}/component.d.ts +0 -0
- package/dist/components/{src/components/Breadcrumb → Breadcrumb}/index.d.ts +0 -0
- package/dist/components/{src/components/Breadcrumb → Breadcrumb}/types.d.ts +0 -0
- package/dist/components/{src/components/Breadcrumb → Breadcrumb}/useItemRender.d.ts +0 -0
- package/dist/components/{src/components/Button → Button}/component.d.ts +0 -0
- package/dist/components/{src/components/Button → Button}/index.d.ts +0 -0
- package/dist/components/{src/components/Checkbox → Checkbox}/component.d.ts +0 -0
- package/dist/components/{src/components/Checkbox → Checkbox}/index.d.ts +0 -0
- package/dist/components/{src/components/CodeBlock → CodeBlock}/component.d.ts +0 -0
- package/dist/components/{src/components/CodeBlock → CodeBlock}/index.d.ts +0 -0
- package/dist/components/{src/components/CodeBlock → CodeBlock}/types.d.ts +0 -0
- package/dist/components/{src/components/Collapse → Collapse}/component.d.ts +0 -0
- package/dist/components/{src/components/Collapse → Collapse}/index.d.ts +0 -0
- package/dist/components/{src/components/DSRoot → DSRoot}/index.d.ts +0 -0
- package/dist/components/{src/components/DropdownMenu → DropdownMenu}/index.d.ts +0 -0
- package/dist/components/{src/components/Empty → Empty}/component.d.ts +0 -0
- package/dist/components/{src/components/Empty → Empty}/index.d.ts +0 -0
- package/dist/components/{src/components/Field → Field}/component.d.ts +0 -0
- package/dist/components/{src/components/Field → Field}/index.d.ts +0 -0
- package/dist/components/{src/components/Form → Form}/component.d.ts +0 -0
- package/dist/components/{src/components/Form → Form}/index.d.ts +0 -0
- package/dist/components/{src/components/Form → Form}/item.d.ts +0 -0
- package/dist/components/{src/components/IconButton → IconButton}/component.d.ts +0 -0
- package/dist/components/{src/components/IconButton → IconButton}/index.d.ts +0 -0
- package/dist/components/{src/components/Input → Input}/component.d.ts +0 -0
- package/dist/components/{src/components/Input → Input}/index.d.ts +0 -0
- package/dist/components/{src/components/Modal → Modal}/ModalProvider.d.ts +0 -0
- package/dist/components/{src/components/Modal → Modal}/ModalService.d.ts +0 -0
- package/dist/components/{src/components/Modal → Modal}/constants.d.ts +0 -0
- package/dist/components/{src/components/Modal → Modal}/functions.d.ts +0 -0
- package/dist/components/{src/components/Popover → Popover}/component.d.ts +0 -0
- package/dist/components/{src/components/Popover → Popover}/index.d.ts +0 -0
- package/dist/components/{src/components/ScrollArea → PopupPanel}/index.d.ts +0 -0
- package/dist/components/{src/components/Radio → Radio}/component.d.ts +0 -0
- package/dist/components/{src/components/Radio → Radio}/index.d.ts +0 -0
- package/dist/components/{src/components/Radio → Radio}/interface.d.ts +0 -0
- package/dist/components/{src/components/ScrollArea → ScrollArea}/component.d.ts +0 -0
- package/dist/components/{src/components/Segmented → ScrollArea}/index.d.ts +0 -0
- package/dist/components/{src/components/Segmented → Segmented}/component.d.ts +0 -0
- package/dist/components/{src/components/Select → Segmented}/index.d.ts +0 -0
- package/dist/components/{src/components/Slider → Select}/index.d.ts +0 -0
- package/dist/components/{src/components/Slider → Slider}/component.d.ts +0 -0
- package/dist/components/{src/components/Spin → Slider}/index.d.ts +0 -0
- package/dist/components/{src/components/Spin → Spin}/component.d.ts +0 -0
- package/dist/components/{src/components/Splitter → Spin}/index.d.ts +0 -0
- package/dist/components/{src/components/Splitter → Splitter}/component.d.ts +0 -0
- package/dist/components/{src/components/Switch → Splitter}/index.d.ts +0 -0
- package/dist/components/{src/components/Switch → Switch}/component.d.ts +0 -0
- package/dist/components/{src/components/Table → Switch}/index.d.ts +0 -0
- package/dist/components/{src/components/Tag → Table}/index.d.ts +0 -0
- package/dist/components/{src/components/Tag → Tag}/component.d.ts +0 -0
- package/dist/components/{src/components/ThemeProvider → Tag}/index.d.ts +0 -0
- package/dist/components/{src/components/ThemeProvider → ThemeProvider}/component.d.ts +0 -0
- package/dist/components/{src/components/Tooltip → ThemeProvider}/index.d.ts +0 -0
- package/dist/components/{src/components/Toast → Toast}/component.d.ts +0 -0
- package/dist/components/{src/components/Toast → Toast}/function.d.ts +0 -0
- package/dist/components/{src/components/Toast → Toast}/index.d.ts +0 -0
- package/dist/components/{src/components/Toast → Toast}/types.d.ts +0 -0
- package/dist/components/{src/components/Tooltip → Tooltip}/component.d.ts +0 -0
- package/dist/components/{src/components/Tour → Tooltip}/index.d.ts +0 -0
- package/dist/components/{src/components/Tour → Tour}/component.d.ts +0 -0
- package/dist/components/{src/components/Transition → Tour}/index.d.ts +0 -0
- package/dist/components/{src/components/Transition → Transition}/component.d.ts +0 -0
- package/dist/components/{src/components/Truncate → Transition}/index.d.ts +0 -0
- package/dist/components/{src/components/Tree → Tree}/components.d.ts +0 -0
- package/dist/components/{src/components/Tree → Tree}/helpers.d.ts +0 -0
- package/dist/components/{src/components/Tree → Tree}/index.d.ts +0 -0
- package/dist/components/{src/components/Tree → Tree}/types.d.ts +0 -0
- package/dist/components/{src/components/Tree → Tree}/useTreeCommon.d.ts +44 -44
- /package/dist/components/{src/components/Tree → Tree}/useUniqueKeysTree.d.ts +0 -0
- /package/dist/components/{src/components/Truncate → Truncate}/component.d.ts +0 -0
- /package/dist/components/{src/components/Truncate → Truncate}/helpers.d.ts +0 -0
- /package/dist/components/{src/components/VerticalCollapsiblePanel → Truncate}/index.d.ts +0 -0
- /package/dist/components/{src/components/Upload → Upload}/component.d.ts +0 -0
- /package/dist/components/{src/components/Upload → Upload}/dragger.d.ts +0 -0
- /package/dist/components/{src/components/Upload → Upload}/hooks.d.ts +0 -0
- /package/dist/components/{src/components/Upload → Upload}/index.d.ts +0 -0
- /package/dist/components/{src/components/Upload → Upload}/item.d.ts +0 -0
- /package/dist/components/{src/components/Upload → Upload}/utils.d.ts +0 -0
- /package/dist/components/{src/components/VerticalCollapsiblePanel → VerticalCollapsiblePanel}/component.d.ts +0 -0
- /package/dist/components/{src/components/hooks → hooks}/antd.d.ts +0 -0
- /package/dist/components/{src/components/hooks → hooks}/useControlledState.d.ts +0 -0
- /package/dist/components/{src/components/utils → utils}/WithAntdTokens.d.ts +0 -0
- /package/dist/components/{src/components/utils → utils}/client.d.ts +0 -0
- /package/dist/components/{src/components/utils → utils}/cn.d.ts +0 -0
- /package/dist/components/{src/components/utils → utils}/index.d.ts +0 -0
- /package/dist/components/{src/components/utils → utils}/isTracebackError.d.ts +0 -0
- /package/dist/components/{src/components/utils → utils}/main.d.ts +0 -0
- /package/dist/components/{src/components/utils → utils}/reactToString.d.ts +0 -0
- /package/dist/components/{src/components/utils → utils}/types.d.ts +0 -0
- /package/dist/{components/src/index.d.ts → index.d.ts} +0 -0
package/dist/Toast.js
CHANGED
|
@@ -148,14 +148,17 @@ var constants_ModalSize = /*#__PURE__*/ function(ModalSize) {
|
|
|
148
148
|
return ModalSize;
|
|
149
149
|
}({});
|
|
150
150
|
"use client";
|
|
151
|
-
const Modal = ({ open: externalOpen, closeIcon, children, size, footer, width, style, styles, classNames, okButtonProps, cancelButtonProps, loading, onOk, onCancel,
|
|
151
|
+
const Modal = ({ open: externalOpen, closeIcon, children, size: sizeProp, footer, width, style, styles, classNames, okButtonProps, cancelButtonProps, loading, onOk, onCancel, okText, okType = "primary", confirmLoading, cancelText = "Close", hideOkButton = false, hideCancelButton = false, contentPadding, title, afterTitle, beforeCloseButton, afterCloseButton, defaultFixedHeaderFooter = false, centered = true, type = "default", defaultOpen = true, background: backgroundProp, bodyScrollable = true, ...rest })=>{
|
|
152
152
|
const defaultCloseIcon = void 0 === closeIcon ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__bioturing_assets_dd0c210d__.X, {
|
|
153
153
|
size: 16,
|
|
154
154
|
weight: "bold"
|
|
155
155
|
}) : closeIcon;
|
|
156
156
|
const defaultModalSize = "default" === type ? "medium" : "xsmall";
|
|
157
|
-
const
|
|
157
|
+
const size = sizeProp || defaultModalSize;
|
|
158
|
+
const modalWidth = width || constants_ModalSize[size];
|
|
159
|
+
const background = backgroundProp || (size && size in constants_ModalSize && parseInt(constants_ModalSize[size]) <= parseInt(constants_ModalSize.medium) ? "elevated" : "container");
|
|
158
160
|
const modalStyle = {
|
|
161
|
+
"--ds-modal-bg": `var(--ds-color-bg-${background})`,
|
|
159
162
|
...style,
|
|
160
163
|
..."fullscreen" === size ? {
|
|
161
164
|
top: 0,
|
|
@@ -172,7 +175,7 @@ const Modal = ({ open: externalOpen, closeIcon, children, size, footer, width, s
|
|
|
172
175
|
...null == styles ? void 0 : styles.body
|
|
173
176
|
}
|
|
174
177
|
};
|
|
175
|
-
const [
|
|
178
|
+
const [isContentOverflow, setIsContentOverflow] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
|
|
176
179
|
const cls = useCls();
|
|
177
180
|
const resizeObserverRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
|
|
178
181
|
const modalInnerRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((node)=>{
|
|
@@ -181,12 +184,12 @@ const Modal = ({ open: externalOpen, closeIcon, children, size, footer, width, s
|
|
|
181
184
|
if (!(modalBody instanceof HTMLElement)) return;
|
|
182
185
|
const resizeObserver = new ResizeObserver(()=>{
|
|
183
186
|
const hasOverflow = modalBody.scrollHeight > modalBody.clientHeight;
|
|
184
|
-
|
|
187
|
+
setIsContentOverflow(hasOverflow);
|
|
185
188
|
});
|
|
186
189
|
resizeObserverRef.current = resizeObserver;
|
|
187
190
|
resizeObserver.observe(modalBody);
|
|
188
191
|
const hasOverflow = modalBody.scrollHeight > modalBody.clientHeight;
|
|
189
|
-
|
|
192
|
+
setIsContentOverflow(hasOverflow);
|
|
190
193
|
}, [
|
|
191
194
|
cls
|
|
192
195
|
]);
|
|
@@ -262,7 +265,7 @@ const Modal = ({ open: externalOpen, closeIcon, children, size, footer, width, s
|
|
|
262
265
|
title: renderTitle(),
|
|
263
266
|
classNames: {
|
|
264
267
|
...classNames,
|
|
265
|
-
wrapper: cls("modal-wrap", "fullscreen" == size && "modal-fullscreen",
|
|
268
|
+
wrapper: cls("modal-wrap", "fullscreen" == size && "modal-fullscreen", isContentOverflow && "modal-content-overflow", false === bodyScrollable && "modal-no-body-scroll", (defaultFixedHeaderFooter || isContentOverflow || "fullscreen" == size) && "modal-fixed")
|
|
266
269
|
},
|
|
267
270
|
styles: modalStyles,
|
|
268
271
|
modalRender: (modal)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
@@ -482,7 +485,10 @@ const ScrollArea = ({ children, className, viewportClassName, thumbClassName, sc
|
|
|
482
485
|
children: [
|
|
483
486
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__base_ui_components_react_5aaa6934__.ScrollArea.Viewport, {
|
|
484
487
|
className: clsx(cls("scroll-area-viewport"), viewportClassName),
|
|
485
|
-
children:
|
|
488
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__base_ui_components_react_5aaa6934__.ScrollArea.Content, {
|
|
489
|
+
className: clsx(cls("scroll-area-content")),
|
|
490
|
+
children: children
|
|
491
|
+
})
|
|
486
492
|
}),
|
|
487
493
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__base_ui_components_react_5aaa6934__.ScrollArea.Scrollbar, {
|
|
488
494
|
className: clsx(cls("scroll-area-scrollbar"), scrollbarClassName),
|
|
@@ -501,134 +507,276 @@ const MainSegmentedInner = ({ className, ...rest }, ref)=>/*#__PURE__*/ (0, __WE
|
|
|
501
507
|
});
|
|
502
508
|
const MainSegmented = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(MainSegmentedInner);
|
|
503
509
|
const Segmented = MainSegmented;
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
510
|
+
const getTokensByTheme = (originTokens, theme)=>{
|
|
511
|
+
const tokens = {};
|
|
512
|
+
Object.entries(originTokens).forEach(([key, value])=>{
|
|
513
|
+
if (value && "object" == typeof value && "light" in value && "dark" in value) {
|
|
514
|
+
const tokenValue = value;
|
|
515
|
+
tokens[key] = tokenValue[theme];
|
|
516
|
+
} else if ("string" == typeof value) tokens[key] = value;
|
|
517
|
+
});
|
|
518
|
+
return tokens;
|
|
519
|
+
};
|
|
520
|
+
const antdColorTokens = {
|
|
521
|
+
colorText: {
|
|
522
|
+
light: "rgba(0, 0, 0, 0.88)",
|
|
523
|
+
dark: "rgba(255, 255, 255, 0.85)"
|
|
524
|
+
},
|
|
525
|
+
colorTextSecondary: {
|
|
526
|
+
light: "rgba(0, 0, 0, 0.65)",
|
|
527
|
+
dark: "rgba(255, 255, 255, 0.65)"
|
|
528
|
+
},
|
|
529
|
+
colorTextTertiary: {
|
|
530
|
+
light: "rgba(0, 0, 0, 0.45)",
|
|
531
|
+
dark: "rgba(255, 255, 255, 0.45)"
|
|
532
|
+
},
|
|
533
|
+
colorTextQuaternary: {
|
|
534
|
+
light: "rgba(0, 0, 0, 0.25)",
|
|
535
|
+
dark: "rgba(255, 255, 255, 0.25)"
|
|
536
|
+
},
|
|
537
|
+
colorPrimary: {
|
|
538
|
+
light: "#175CD3",
|
|
539
|
+
dark: "#2E90FA"
|
|
540
|
+
},
|
|
541
|
+
colorPrimaryBg: {
|
|
542
|
+
light: "#E9F2FF",
|
|
543
|
+
dark: "#152137"
|
|
544
|
+
},
|
|
545
|
+
colorPrimaryBgHover: {
|
|
546
|
+
light: "#D1E9FF",
|
|
547
|
+
dark: "#112545"
|
|
548
|
+
},
|
|
549
|
+
colorPrimaryBorder: {
|
|
550
|
+
light: "#84CAFF",
|
|
551
|
+
dark: "#1C3959"
|
|
552
|
+
},
|
|
553
|
+
colorPrimaryBorderHover: {
|
|
554
|
+
light: "#53B1FD",
|
|
555
|
+
dark: "#204C7C"
|
|
556
|
+
},
|
|
557
|
+
colorPrimaryHover: {
|
|
558
|
+
light: "#1570EF",
|
|
559
|
+
dark: "#50A0E8"
|
|
560
|
+
},
|
|
561
|
+
colorPrimaryActive: {
|
|
562
|
+
light: "#175CD3",
|
|
563
|
+
dark: "#2565AB"
|
|
564
|
+
},
|
|
565
|
+
colorPrimaryTextHover: {
|
|
566
|
+
light: "#1570EF",
|
|
567
|
+
dark: "#50A0E8"
|
|
568
|
+
},
|
|
569
|
+
colorPrimaryTextActive: {
|
|
570
|
+
light: "#175CD3",
|
|
571
|
+
dark: "#2565AB"
|
|
572
|
+
},
|
|
573
|
+
colorInfo: {
|
|
574
|
+
light: "#175CD3",
|
|
575
|
+
dark: "#2E90FA"
|
|
576
|
+
},
|
|
577
|
+
colorInfoBg: {
|
|
578
|
+
light: "#E9F2FF",
|
|
579
|
+
dark: "#152137"
|
|
580
|
+
},
|
|
581
|
+
colorInfoBgHover: {
|
|
582
|
+
light: "#D1E9FF",
|
|
583
|
+
dark: "#112545"
|
|
584
|
+
},
|
|
585
|
+
colorInfoBorder: {
|
|
586
|
+
light: "#84CAFF",
|
|
587
|
+
dark: "#1C3959"
|
|
588
|
+
},
|
|
589
|
+
colorInfoBorderHover: {
|
|
590
|
+
light: "#53B1FD",
|
|
591
|
+
dark: "#204C7C"
|
|
592
|
+
},
|
|
593
|
+
colorInfoHover: {
|
|
594
|
+
light: "#1570EF",
|
|
595
|
+
dark: "#50A0E8"
|
|
596
|
+
},
|
|
597
|
+
colorInfoActive: {
|
|
598
|
+
light: "#175CD3",
|
|
599
|
+
dark: "#2565AB"
|
|
600
|
+
},
|
|
601
|
+
colorInfoTextHover: {
|
|
602
|
+
light: "#1570EF",
|
|
603
|
+
dark: "#50A0E8"
|
|
604
|
+
},
|
|
605
|
+
colorInfoTextActive: {
|
|
606
|
+
light: "#175CD3",
|
|
607
|
+
dark: "#2565AB"
|
|
608
|
+
},
|
|
609
|
+
colorSuccess: {
|
|
610
|
+
light: "#4CB200",
|
|
611
|
+
dark: "#389E0D"
|
|
612
|
+
},
|
|
613
|
+
colorSuccessBg: {
|
|
614
|
+
light: "#F6FFF0",
|
|
615
|
+
dark: "#162100"
|
|
616
|
+
},
|
|
617
|
+
colorSuccessBgHover: {
|
|
618
|
+
light: "#D9F7BE",
|
|
619
|
+
dark: "#1D2B00"
|
|
620
|
+
},
|
|
621
|
+
colorSuccessBorder: {
|
|
622
|
+
light: "#B7EB8F",
|
|
623
|
+
dark: "#274916"
|
|
624
|
+
},
|
|
625
|
+
colorSuccessBorderHover: {
|
|
626
|
+
light: "#95DE64",
|
|
627
|
+
dark: "#306317"
|
|
628
|
+
},
|
|
629
|
+
colorSuccessHover: {
|
|
630
|
+
light: "#73D13D",
|
|
631
|
+
dark: "#52C41A"
|
|
632
|
+
},
|
|
633
|
+
colorSuccessActive: {
|
|
634
|
+
light: "#389E0D",
|
|
635
|
+
dark: "#237804"
|
|
636
|
+
},
|
|
637
|
+
colorSuccessTextHover: {
|
|
638
|
+
light: "#237804",
|
|
639
|
+
dark: "#52C41A"
|
|
640
|
+
},
|
|
641
|
+
colorSuccessTextActive: {
|
|
642
|
+
light: "#092B00",
|
|
643
|
+
dark: "#237804"
|
|
644
|
+
},
|
|
645
|
+
colorWarning: {
|
|
646
|
+
light: "#FA8C16",
|
|
647
|
+
dark: "#D48806"
|
|
648
|
+
},
|
|
649
|
+
colorWarningBg: {
|
|
650
|
+
light: "#FFF7E6",
|
|
651
|
+
dark: "#281800"
|
|
652
|
+
},
|
|
653
|
+
colorWarningBgHover: {
|
|
654
|
+
light: "#FFE7BA",
|
|
655
|
+
dark: "#3D2200"
|
|
656
|
+
},
|
|
657
|
+
colorWarningBorder: {
|
|
658
|
+
light: "#FFD591",
|
|
659
|
+
dark: "#443B16"
|
|
660
|
+
},
|
|
661
|
+
colorWarningBorderHover: {
|
|
662
|
+
light: "#FFC069",
|
|
663
|
+
dark: "#594E1A"
|
|
664
|
+
},
|
|
665
|
+
colorWarningHover: {
|
|
666
|
+
light: "#FFA940",
|
|
667
|
+
dark: "#E8B339"
|
|
668
|
+
},
|
|
669
|
+
colorWarningActive: {
|
|
670
|
+
light: "#D46B08",
|
|
671
|
+
dark: "#AA7714"
|
|
672
|
+
},
|
|
673
|
+
colorWarningTextHover: {
|
|
674
|
+
light: "#AD4E00",
|
|
675
|
+
dark: "#E8B339"
|
|
676
|
+
},
|
|
677
|
+
colorWarningTextActive: {
|
|
678
|
+
light: "#873800",
|
|
679
|
+
dark: "#AA7714"
|
|
680
|
+
},
|
|
681
|
+
colorError: {
|
|
682
|
+
light: "#D92D20",
|
|
683
|
+
dark: "#CF3D33"
|
|
684
|
+
},
|
|
685
|
+
colorErrorBg: {
|
|
686
|
+
light: "#FEF3F2",
|
|
687
|
+
dark: "#291414"
|
|
688
|
+
},
|
|
689
|
+
colorErrorBgHover: {
|
|
690
|
+
light: "#FEE4E2",
|
|
691
|
+
dark: "#411A18"
|
|
692
|
+
},
|
|
693
|
+
colorErrorBorder: {
|
|
694
|
+
light: "#FDA29B",
|
|
695
|
+
dark: "#562222"
|
|
696
|
+
},
|
|
697
|
+
colorErrorBorderHover: {
|
|
698
|
+
light: "#F97066",
|
|
699
|
+
dark: "#772A24"
|
|
700
|
+
},
|
|
701
|
+
colorErrorHover: {
|
|
702
|
+
light: "#F04438",
|
|
703
|
+
dark: "#E5695A"
|
|
704
|
+
},
|
|
705
|
+
colorErrorActive: {
|
|
706
|
+
light: "#D92D20",
|
|
707
|
+
dark: "#A3332B"
|
|
708
|
+
},
|
|
709
|
+
colorErrorTextHover: {
|
|
710
|
+
light: "#F04438",
|
|
711
|
+
dark: "#E5695A"
|
|
712
|
+
},
|
|
713
|
+
colorErrorTextActive: {
|
|
714
|
+
light: "#D92D20",
|
|
715
|
+
dark: "#A3332B"
|
|
716
|
+
},
|
|
717
|
+
colorFill: {
|
|
718
|
+
light: "rgba(0, 0, 0, 0.15)",
|
|
719
|
+
dark: "rgba(255, 255, 255, 0.15)"
|
|
720
|
+
},
|
|
721
|
+
colorFillSecondary: {
|
|
722
|
+
light: "rgba(0, 0, 0, 0.06)",
|
|
723
|
+
dark: "rgba(255, 255, 255, 0.06)"
|
|
724
|
+
},
|
|
725
|
+
colorFillTertiary: {
|
|
726
|
+
light: "rgba(0, 0, 0, 0.04)",
|
|
727
|
+
dark: "rgba(255, 255, 255, 0.04)"
|
|
728
|
+
},
|
|
729
|
+
colorFillQuaternary: {
|
|
730
|
+
light: "rgba(0, 0, 0, 0.02)",
|
|
731
|
+
dark: "rgba(255, 255, 255, 0.02)"
|
|
732
|
+
},
|
|
733
|
+
colorFillAlter: {
|
|
734
|
+
light: "rgba(0, 0, 0, 0.02)",
|
|
735
|
+
dark: "rgba(255, 255, 255, 0.02)"
|
|
736
|
+
},
|
|
737
|
+
colorBorder: {
|
|
738
|
+
light: "rgba(0, 0, 0, 0.16)",
|
|
739
|
+
dark: "rgba(255, 255, 255, 0.16)"
|
|
740
|
+
},
|
|
741
|
+
colorBorderSecondary: {
|
|
742
|
+
light: "rgba(0, 0, 0, 0.06)",
|
|
743
|
+
dark: "rgba(255, 255, 255, 0.06)"
|
|
744
|
+
},
|
|
745
|
+
colorIcon: {
|
|
746
|
+
light: "rgba(0, 0, 0, 0.58)",
|
|
747
|
+
dark: "rgba(255, 255, 255, 0.58)"
|
|
748
|
+
},
|
|
749
|
+
colorIconHover: {
|
|
750
|
+
light: "rgba(0, 0, 0, 0.88)",
|
|
751
|
+
dark: "rgba(255, 255, 255, 0.88)"
|
|
752
|
+
},
|
|
753
|
+
colorBgContainer: {
|
|
754
|
+
light: "#FFFFFF",
|
|
755
|
+
dark: "#26262C"
|
|
756
|
+
},
|
|
757
|
+
colorBgElevated: {
|
|
758
|
+
light: "#FFFFFF",
|
|
759
|
+
dark: "#2F2F37"
|
|
760
|
+
},
|
|
761
|
+
colorBgLayout: {
|
|
762
|
+
light: "#F5F5F5",
|
|
763
|
+
dark: "#1A1A1E"
|
|
764
|
+
},
|
|
765
|
+
colorBgSpotlight: {
|
|
766
|
+
light: "rgba(0, 0, 0, 0.85)",
|
|
767
|
+
dark: "#505D5D"
|
|
768
|
+
},
|
|
769
|
+
colorBgMask: {
|
|
770
|
+
light: "rgba(0, 0, 0, 0.45)",
|
|
771
|
+
dark: "rgba(0, 0, 0, 0.45)"
|
|
772
|
+
},
|
|
773
|
+
colorBgBase: {
|
|
774
|
+
light: "#FFFFFF",
|
|
775
|
+
dark: "#13131A"
|
|
776
|
+
},
|
|
777
|
+
controlOutline: {
|
|
778
|
+
light: "rgba(0, 0, 0, 0.12)",
|
|
779
|
+
dark: "rgba(255, 255, 255, 0.12)"
|
|
632
780
|
}
|
|
633
781
|
};
|
|
634
782
|
const sharedTokens = {
|
|
@@ -649,7 +797,7 @@ const sharedTokens = {
|
|
|
649
797
|
lineHeightSM: 16 / 12,
|
|
650
798
|
fontWeightStrong: 600,
|
|
651
799
|
boxShadow: "0px 1px 2px rgba(0, 0, 0, 0.06), 0px 1px 6px rgba(0, 0, 0, 0.04), 0px 2px 10px rgba(0, 0, 0, 0.04)",
|
|
652
|
-
boxShadowSecondary: "0px 0px 1px
|
|
800
|
+
boxShadowSecondary: "0px 0px 1px 0px var(--ds-color-border-modal), 0px 3px 6px 1px rgba(0, 0, 0, 0.08), 0px 6px 26px 2px rgba(0, 0, 0, 0.08), 0px 4px 52px 0px rgba(0, 0, 0, 0.05)",
|
|
653
801
|
colorBgSpotlight: "rgba(0, 0, 0, 0.85)"
|
|
654
802
|
};
|
|
655
803
|
const sharedThemeConfig = {
|
|
@@ -690,14 +838,14 @@ const sharedThemeConfig = {
|
|
|
690
838
|
};
|
|
691
839
|
const lightTheme = {
|
|
692
840
|
token: {
|
|
693
|
-
...
|
|
841
|
+
...getTokensByTheme(antdColorTokens, "light"),
|
|
694
842
|
...sharedTokens
|
|
695
843
|
},
|
|
696
844
|
...sharedThemeConfig
|
|
697
845
|
};
|
|
698
846
|
const darkTheme = {
|
|
699
847
|
token: {
|
|
700
|
-
...
|
|
848
|
+
...getTokensByTheme(antdColorTokens, "dark"),
|
|
701
849
|
...sharedTokens
|
|
702
850
|
},
|
|
703
851
|
...sharedThemeConfig
|
package/dist/Upload.js
CHANGED
|
@@ -49,6 +49,48 @@ const useCls = ()=>{
|
|
|
49
49
|
const { getPrefixCls } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE_antd_es_config_provider_6a57beb3__["default"].ConfigContext);
|
|
50
50
|
return (...args)=>cx(...args).map((cls)=>getPrefixCls(cls)).join(" ");
|
|
51
51
|
};
|
|
52
|
+
function splitCamelCase(text) {
|
|
53
|
+
const result = [];
|
|
54
|
+
let currentWord = "";
|
|
55
|
+
for (const char of text)if (char >= "A" && char <= "Z") {
|
|
56
|
+
if (currentWord) result.push(currentWord);
|
|
57
|
+
currentWord = char.toLowerCase();
|
|
58
|
+
} else currentWord += char;
|
|
59
|
+
if (currentWord) result.push(currentWord);
|
|
60
|
+
return result.length > 0 ? result : [
|
|
61
|
+
text
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
const parseAntdPlacement = (placement = "bottomLeft")=>{
|
|
65
|
+
const [position1, position2] = splitCamelCase(placement);
|
|
66
|
+
let primaryPlacement;
|
|
67
|
+
let align = "center";
|
|
68
|
+
if ("top" === position1 || "bottom" === position1) {
|
|
69
|
+
primaryPlacement = position1;
|
|
70
|
+
if (position2) switch(position2){
|
|
71
|
+
case "left":
|
|
72
|
+
align = "start";
|
|
73
|
+
break;
|
|
74
|
+
case "right":
|
|
75
|
+
align = "end";
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
} else if ("left" === position1 || "right" === position1) {
|
|
79
|
+
primaryPlacement = position1;
|
|
80
|
+
if (position2) switch(position2){
|
|
81
|
+
case "top":
|
|
82
|
+
align = "start";
|
|
83
|
+
break;
|
|
84
|
+
case "bottom":
|
|
85
|
+
align = "end";
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
} else primaryPlacement = "bottom";
|
|
89
|
+
return {
|
|
90
|
+
placement: primaryPlacement,
|
|
91
|
+
align
|
|
92
|
+
};
|
|
93
|
+
};
|
|
52
94
|
"use client";
|
|
53
95
|
const IconButtonImpl = (props, ref)=>{
|
|
54
96
|
const { label, size = "medium", negativeMargin = true, children, className, tooltipProps = {}, as, href, target, rel, download, hrefLang, referrerPolicy, ...rest } = props;
|
|
@@ -415,4 +457,4 @@ const WithAntdTokens = ({ as: Tag = "div", ref, className, ...rest })=>{
|
|
|
415
457
|
});
|
|
416
458
|
return renderElement();
|
|
417
459
|
};
|
|
418
|
-
export { DefaultUpload, Upload, WithAntdTokens, clsx, cn, cx, isTracebackError, reactNodeToString, useAntdCssVarClassname, useCls, useGetPrefixCls, useUploadItemRender };
|
|
460
|
+
export { DefaultUpload, Upload, WithAntdTokens, clsx, cn, cx, isTracebackError, parseAntdPlacement, reactNodeToString, useAntdCssVarClassname, useCls, useGetPrefixCls, useUploadItemRender };
|
|
@@ -10,4 +10,4 @@ export interface DSRootProps extends ThemeProviderProps {
|
|
|
10
10
|
*/
|
|
11
11
|
appendClassesTo?: string | HTMLElement;
|
|
12
12
|
}
|
|
13
|
-
export declare const DSRoot: ({ className, appendClassesTo, children, ...props }: DSRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const DSRoot: ({ className, appendClassesTo, children, theme, ...props }: DSRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,8 +6,13 @@ export type DropdownMenuItemType = {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
icon?: React.ReactNode;
|
|
8
8
|
key: React.Key;
|
|
9
|
-
onClick?: React.
|
|
9
|
+
onClick?: React.HTMLAttributes<HTMLElement>["onClick"];
|
|
10
|
+
onMouseEnter?: React.HTMLAttributes<HTMLElement>["onMouseEnter"];
|
|
11
|
+
onMouseLeave?: React.HTMLAttributes<HTMLElement>["onMouseLeave"];
|
|
12
|
+
onMouseOver?: React.HTMLAttributes<HTMLElement>["onMouseOver"];
|
|
13
|
+
onMouseOut?: React.HTMLAttributes<HTMLElement>["onMouseOut"];
|
|
10
14
|
danger?: boolean;
|
|
15
|
+
ref?: React.Ref<HTMLElement>;
|
|
11
16
|
} | {
|
|
12
17
|
type: "divider";
|
|
13
18
|
} | {
|
|
@@ -65,5 +65,20 @@ export interface ModalProps extends Omit<AntModalProps, "centered"> {
|
|
|
65
65
|
* @default true
|
|
66
66
|
*/
|
|
67
67
|
defaultOpen?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Modal background
|
|
70
|
+
* @default "elevated" if size smaller than "medium", otherwise "container"
|
|
71
|
+
*/
|
|
72
|
+
background?: "elevated" | "container";
|
|
73
|
+
/**
|
|
74
|
+
* Modal old close callback
|
|
75
|
+
* @deprecated use onCancel instead
|
|
76
|
+
*/
|
|
77
|
+
onClose?: () => void;
|
|
78
|
+
/**
|
|
79
|
+
* Make modal body scrollable
|
|
80
|
+
* @default true
|
|
81
|
+
*/
|
|
82
|
+
bodyScrollable?: boolean;
|
|
68
83
|
}
|
|
69
|
-
export declare const Modal: ({ open: externalOpen, closeIcon, children, size, footer, width, style, styles, classNames, okButtonProps, cancelButtonProps, loading, onOk, onCancel,
|
|
84
|
+
export declare const Modal: ({ open: externalOpen, closeIcon, children, size: sizeProp, footer, width, style, styles, classNames, okButtonProps, cancelButtonProps, loading, onOk, onCancel, okText, okType, confirmLoading, cancelText, hideOkButton, hideCancelButton, contentPadding, title, afterTitle, beforeCloseButton, afterCloseButton, defaultFixedHeaderFooter, centered, type, defaultOpen, background: backgroundProp, bodyScrollable, ...rest }: ModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ModalFuncProps } from "./functions";
|
|
2
2
|
import { type ModalProviderProps } from "./ModalProvider";
|
|
3
|
-
export declare const Modal: (({ open: externalOpen, closeIcon, children, size, footer, width, style, styles, classNames, okButtonProps, cancelButtonProps, loading, onOk, onCancel,
|
|
3
|
+
export declare const Modal: (({ open: externalOpen, closeIcon, children, size: sizeProp, footer, width, style, styles, classNames, okButtonProps, cancelButtonProps, loading, onOk, onCancel, okText, okType, confirmLoading, cancelText, hideOkButton, hideCancelButton, contentPadding, title, afterTitle, beforeCloseButton, afterCloseButton, defaultFixedHeaderFooter, centered, type, defaultOpen, background: backgroundProp, bodyScrollable, ...rest }: import("./Modal").ModalProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
4
|
Provider: import("react").FC<ModalProviderProps>;
|
|
5
5
|
open: (config: ModalFuncProps) => import("./functions").ModalRef;
|
|
6
6
|
info: (config: ModalFuncProps) => import("./functions").ModalRef;
|