@cwellt_software/cwellt-reactjs-lib 1.5.4 → 1.6.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/content/icons/IconLibrary.stories.tsx +18 -0
- package/dist/index.cjs.js +117 -93
- package/dist/index.css +2 -2
- package/dist/index.d.ts +63 -42
- package/dist/index.es.js +117 -93
- package/dist/src/common/styles/tokens/ColorContrast.stories.d.ts +11 -0
- package/dist/src/common/styles/tokens/ColorContrast.stories.d.ts.map +1 -0
- package/dist/src/common/styles/tokens/ColorPalette.stories.d.ts +22 -0
- package/dist/src/common/styles/tokens/ColorPalette.stories.d.ts.map +1 -0
- package/dist/src/common/styles/tokens/DarkModePreview.stories.d.ts +12 -0
- package/dist/src/common/styles/tokens/DarkModePreview.stories.d.ts.map +1 -0
- package/dist/src/components/control/action/button/CwButtonSplit.stories.d.ts +24 -0
- package/dist/src/components/control/action/button/CwButtonSplit.stories.d.ts.map +1 -0
- package/dist/src/components/control/action/button/CwButtonSwitch.stories.d.ts +39 -0
- package/dist/src/components/control/action/button/CwButtonSwitch.stories.d.ts.map +1 -0
- package/dist/src/components/control/action/contextmenu/CwAnchoredMenu.d.ts +1 -1
- package/dist/src/components/control/action/contextmenu/CwAnchoredMenu.d.ts.map +1 -1
- package/dist/src/components/control/action/contextmenu/CwAnchoredMenu.stories.d.ts +29 -0
- package/dist/src/components/control/action/contextmenu/CwAnchoredMenu.stories.d.ts.map +1 -0
- package/dist/src/components/control/action/contextmenu/CwContextMenu.d.ts +2 -3
- package/dist/src/components/control/action/contextmenu/CwContextMenu.d.ts.map +1 -1
- package/dist/src/components/control/action/contextmenu/CwContextMenu.stories.d.ts +24 -0
- package/dist/src/components/control/action/contextmenu/CwContextMenu.stories.d.ts.map +1 -0
- package/dist/src/components/control/action/search/CwSearchAsync.stories.d.ts +103 -0
- package/dist/src/components/control/action/search/CwSearchAsync.stories.d.ts.map +1 -0
- package/dist/src/components/control/action/search/CwSearchInput.stories.d.ts +452 -0
- package/dist/src/components/control/action/search/CwSearchInput.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/checkbox/CwCheck.stories.d.ts +47 -0
- package/dist/src/components/control/choice/checkbox/CwCheck.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/checkbox/CwCheckboxGroup.stories.d.ts +102 -0
- package/dist/src/components/control/choice/checkbox/CwCheckboxGroup.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/checkbox/CwRadioGroup.stories.d.ts +96 -0
- package/dist/src/components/control/choice/checkbox/CwRadioGroup.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/dropdown/CwDropdownFilter.d.ts +4 -0
- package/dist/src/components/control/choice/dropdown/CwDropdownFilter.d.ts.map +1 -1
- package/dist/src/components/control/choice/dropdown/CwPopoverButton.stories.d.ts +29 -0
- package/dist/src/components/control/choice/dropdown/CwPopoverButton.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/multi-filter/CwMultiFilter.stories.d.ts +53 -0
- package/dist/src/components/control/choice/multi-filter/CwMultiFilter.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/nav-menu/CwNavMenu.stories.d.ts +325 -0
- package/dist/src/components/control/choice/nav-menu/CwNavMenu.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/select/CwDropdown.stories.d.ts +653 -0
- package/dist/src/components/control/choice/select/CwDropdown.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/select/CwSelect.stories.d.ts +657 -0
- package/dist/src/components/control/choice/select/CwSelect.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/tag-selector/CwTagSelector.stories.d.ts +132 -0
- package/dist/src/components/control/choice/tag-selector/CwTagSelector.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/toggle/CwToggle.stories.d.ts +47 -0
- package/dist/src/components/control/choice/toggle/CwToggle.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/tree-view/CwTreeView.stories.d.ts +41 -0
- package/dist/src/components/control/choice/tree-view/CwTreeView.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/any/CwInput.d.ts +4 -0
- package/dist/src/components/control/input/any/CwInput.d.ts.map +1 -1
- package/dist/src/components/control/input/color/CwColorPicker.d.ts +2 -3
- package/dist/src/components/control/input/color/CwColorPicker.d.ts.map +1 -1
- package/dist/src/components/control/input/color/CwColorPicker.stories.d.ts +31 -0
- package/dist/src/components/control/input/color/CwColorPicker.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/color/CwInputColor.d.ts +1 -2
- package/dist/src/components/control/input/color/CwInputColor.d.ts.map +1 -1
- package/dist/src/components/control/input/color/CwInputColor.stories.d.ts +91 -0
- package/dist/src/components/control/input/color/CwInputColor.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/date-text/CwInputDateText.d.ts +4 -0
- package/dist/src/components/control/input/date-text/CwInputDateText.d.ts.map +1 -1
- package/dist/src/components/control/input/digit/CwDigit.stories.d.ts +845 -0
- package/dist/src/components/control/input/digit/CwDigit.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/file/CwFileUploadMultiple.d.ts +1 -2
- package/dist/src/components/control/input/file/CwFileUploadMultiple.d.ts.map +1 -1
- package/dist/src/components/control/input/file/CwFileUploadMultiple.stories.d.ts +78 -0
- package/dist/src/components/control/input/file/CwFileUploadMultiple.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/image/CwInputImage.stories.d.ts +38 -0
- package/dist/src/components/control/input/image/CwInputImage.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/image-area/CwImageArea.stories.d.ts +50 -0
- package/dist/src/components/control/input/image-area/CwImageArea.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/new-dates/CwDatePicker.d.ts +0 -1
- package/dist/src/components/control/input/new-dates/CwDatePicker.d.ts.map +1 -1
- package/dist/src/components/control/input/new-dates/CwDatePicker.stories.d.ts +140 -0
- package/dist/src/components/control/input/new-dates/CwDatePicker.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/new-dates/CwDatePickerTemporal.d.ts +0 -1
- package/dist/src/components/control/input/new-dates/CwDatePickerTemporal.d.ts.map +1 -1
- package/dist/src/components/control/input/new-dates/CwDateRangePicker.stories.d.ts +160 -0
- package/dist/src/components/control/input/new-dates/CwDateRangePicker.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/new-dates/CwDateRangePickerTemporal.d.ts +0 -1
- package/dist/src/components/control/input/new-dates/CwDateRangePickerTemporal.d.ts.map +1 -1
- package/dist/src/components/control/input/new-dates/CwDateTimePicker.stories.d.ts +150 -0
- package/dist/src/components/control/input/new-dates/CwDateTimePicker.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/new-dates/CwDateTimePickerCompact.d.ts +0 -1
- package/dist/src/components/control/input/new-dates/CwDateTimePickerCompact.d.ts.map +1 -1
- package/dist/src/components/control/input/new-dates/CwTimePicker.stories.d.ts +111 -0
- package/dist/src/components/control/input/new-dates/CwTimePicker.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/phone/CwInputPhone.stories.d.ts +839 -0
- package/dist/src/components/control/input/phone/CwInputPhone.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/text/CwInputText.d.ts +3 -4
- package/dist/src/components/control/input/text/CwInputText.d.ts.map +1 -1
- package/dist/src/components/control/input/text-area/CwTextArea.d.ts +1 -1
- package/dist/src/components/control/input/text-area/CwTextArea.d.ts.map +1 -1
- package/dist/src/components/control/input/text-area/CwTextArea.stories.d.ts +668 -0
- package/dist/src/components/control/input/text-area/CwTextArea.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/weekday/CwWeekdaySelector.d.ts +1 -2
- package/dist/src/components/control/input/weekday/CwWeekdaySelector.d.ts.map +1 -1
- package/dist/src/components/control/input/weekday/CwWeekdaySelector.stories.d.ts +108 -0
- package/dist/src/components/control/input/weekday/CwWeekdaySelector.stories.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-new/presentation/Scheduler.stories.d.ts +41 -0
- package/dist/src/components/custom/scheduler-new/presentation/Scheduler.stories.d.ts.map +1 -0
- package/dist/src/components/display/data/accordion/CwAccordionContainer.d.ts +2 -4
- package/dist/src/components/display/data/accordion/CwAccordionContainer.d.ts.map +1 -1
- package/dist/src/components/display/data/accordion/CwAccordionContainer.stories.d.ts +27 -0
- package/dist/src/components/display/data/accordion/CwAccordionContainer.stories.d.ts.map +1 -0
- package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.d.ts +4 -0
- package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.d.ts.map +1 -1
- package/dist/src/components/display/data/table/CwTable.stories.d.ts +59 -0
- package/dist/src/components/display/data/table/CwTable.stories.d.ts.map +1 -0
- package/dist/src/components/display/data/table-serverside/CwTableServerSide.stories.d.ts +53 -0
- package/dist/src/components/display/data/table-serverside/CwTableServerSide.stories.d.ts.map +1 -0
- package/dist/src/components/display/data/table_sortable/CwSortableTable.stories.d.ts +45 -0
- package/dist/src/components/display/data/table_sortable/CwSortableTable.stories.d.ts.map +1 -0
- package/dist/src/components/display/data/tooltip_manager/CwTooltip.d.ts +1 -2
- package/dist/src/components/display/data/tooltip_manager/CwTooltip.d.ts.map +1 -1
- package/dist/src/components/display/data/tooltip_manager/CwTooltipNew.stories.d.ts +52 -0
- package/dist/src/components/display/data/tooltip_manager/CwTooltipNew.stories.d.ts.map +1 -0
- package/dist/src/components/display/graphics/icon/CwIcon.stories.d.ts +37 -0
- package/dist/src/components/display/graphics/icon/CwIcon.stories.d.ts.map +1 -0
- package/dist/src/components/display/graphics/image-gallery/CwImageGallery.stories.d.ts +24 -0
- package/dist/src/components/display/graphics/image-gallery/CwImageGallery.stories.d.ts.map +1 -0
- package/dist/src/components/display/graphics/image-zoom/CwImageZoom.stories.d.ts +23 -0
- package/dist/src/components/display/graphics/image-zoom/CwImageZoom.stories.d.ts.map +1 -0
- package/dist/src/components/display/graphics/loading/CwLoading.d.ts +1 -1
- package/dist/src/components/display/graphics/loading/CwLoading.d.ts.map +1 -1
- package/dist/src/components/display/graphics/loading/CwLoading.stories.d.ts +44 -0
- package/dist/src/components/display/graphics/loading/CwLoading.stories.d.ts.map +1 -0
- package/dist/src/components/display/graphics/progress/CwProgress.stories.d.ts +61 -0
- package/dist/src/components/display/graphics/progress/CwProgress.stories.d.ts.map +1 -0
- package/dist/src/components/display/graphics/skeleton/CwSkeleton.stories.d.ts +52 -0
- package/dist/src/components/display/graphics/skeleton/CwSkeleton.stories.d.ts.map +1 -0
- package/dist/src/components/display/text/badge/CwBadge.stories.d.ts +36 -0
- package/dist/src/components/display/text/badge/CwBadge.stories.d.ts.map +1 -0
- package/dist/src/components/display/text/heading/CwHeading.stories.d.ts +23 -0
- package/dist/src/components/display/text/heading/CwHeading.stories.d.ts.map +1 -0
- package/dist/src/components/display/text/label/CwLabel.stories.d.ts +31 -0
- package/dist/src/components/display/text/label/CwLabel.stories.d.ts.map +1 -0
- package/dist/src/components/display/text/message/CwMessage.stories.d.ts +38 -0
- package/dist/src/components/display/text/message/CwMessage.stories.d.ts.map +1 -0
- package/dist/src/components/display/text/tag/CwChip.d.ts +9 -9
- package/dist/src/components/display/text/tag/CwChip.d.ts.map +1 -1
- package/dist/src/components/layout/align/CwAlign.stories.d.ts +439 -0
- package/dist/src/components/layout/align/CwAlign.stories.d.ts.map +1 -0
- package/dist/src/components/layout/card/CwCard.d.ts +17 -17
- package/dist/src/components/layout/card/CwCard.d.ts.map +1 -1
- package/dist/src/components/layout/card/CwCard.stories.d.ts +75 -0
- package/dist/src/components/layout/card/CwCard.stories.d.ts.map +1 -0
- package/dist/src/components/layout/card/CwCardList.stories.d.ts +52 -0
- package/dist/src/components/layout/card/CwCardList.stories.d.ts.map +1 -0
- package/dist/src/components/layout/confirmation-popup/CwConfirmationPopup.d.ts +5 -0
- package/dist/src/components/layout/confirmation-popup/CwConfirmationPopup.d.ts.map +1 -1
- package/dist/src/components/layout/confirmation-popup/CwConfirmationPopup.stories.d.ts +55 -0
- package/dist/src/components/layout/confirmation-popup/CwConfirmationPopup.stories.d.ts.map +1 -0
- package/dist/src/components/layout/dialog/CwDialog.d.ts +1 -1
- package/dist/src/components/layout/dialog/CwDialog.d.ts.map +1 -1
- package/dist/src/components/layout/dialog/CwDialog.stories.d.ts +62 -0
- package/dist/src/components/layout/dialog/CwDialog.stories.d.ts.map +1 -0
- package/dist/src/components/layout/list/details/CwExpandable.d.ts +2 -1
- package/dist/src/components/layout/list/details/CwExpandable.d.ts.map +1 -1
- package/dist/src/components/layout/list/details/CwExpandable.stories.d.ts +35 -0
- package/dist/src/components/layout/list/details/CwExpandable.stories.d.ts.map +1 -0
- package/dist/src/components/layout/list/key-value/CwKeyValueList.stories.d.ts +84 -0
- package/dist/src/components/layout/list/key-value/CwKeyValueList.stories.d.ts.map +1 -0
- package/dist/src/components/layout/list/sortable/CwSortableList.stories.d.ts +49 -0
- package/dist/src/components/layout/list/sortable/CwSortableList.stories.d.ts.map +1 -0
- package/dist/src/components/layout/master-detail/CwMasterDetail.stories.d.ts +71 -0
- package/dist/src/components/layout/master-detail/CwMasterDetail.stories.d.ts.map +1 -0
- package/dist/src/components/layout/modal/hover/CwModalHover.d.ts +2 -1
- package/dist/src/components/layout/modal/hover/CwModalHover.d.ts.map +1 -1
- package/dist/src/components/layout/modal/hover/CwModalHover.stories.d.ts +404 -0
- package/dist/src/components/layout/modal/hover/CwModalHover.stories.d.ts.map +1 -0
- package/dist/src/components/layout/table/grouped/CwTableGrouped.d.ts +1 -0
- package/dist/src/components/layout/table/grouped/CwTableGrouped.d.ts.map +1 -1
- package/dist/src/components/layout/table/grouped/CwTableGrouped.stories.d.ts +31 -0
- package/dist/src/components/layout/table/grouped/CwTableGrouped.stories.d.ts.map +1 -0
- package/dist/src/components/layout/tabs/CwTabs.stories.d.ts +36 -0
- package/dist/src/components/layout/tabs/CwTabs.stories.d.ts.map +1 -0
- package/dist/src/content/icons/IconLibrary.stories.d.ts +20 -0
- package/dist/src/content/icons/IconLibrary.stories.d.ts.map +1 -0
- package/dist/src/playground/pages/ShadowRecipesPage.d.ts +3 -0
- package/dist/src/playground/pages/ShadowRecipesPage.d.ts.map +1 -0
- package/dist/src/storybook/PaletteAndComponentMappingDecorator.d.ts +28 -0
- package/dist/src/storybook/PaletteAndComponentMappingDecorator.d.ts.map +1 -0
- package/dist/src/storybook/PaletteDecorator.d.ts +12 -0
- package/dist/src/storybook/PaletteDecorator.d.ts.map +1 -0
- package/dist/src/storybook/StoryValue.d.ts +11 -0
- package/dist/src/storybook/StoryValue.d.ts.map +1 -0
- package/dist/src/storybook/componentMappings.d.ts +29 -0
- package/dist/src/storybook/componentMappings.d.ts.map +1 -0
- package/dist/src/storybook/cssVarOverrideStore.d.ts +23 -0
- package/dist/src/storybook/cssVarOverrideStore.d.ts.map +1 -0
- package/dist/src/storybook/groupLayoutStoryArgs.d.ts +77 -0
- package/dist/src/storybook/groupLayoutStoryArgs.d.ts.map +1 -0
- package/dist/src/storybook/needsRefactor.d.ts +15 -0
- package/dist/src/storybook/needsRefactor.d.ts.map +1 -0
- package/dist/src/storybook/palettes.d.ts +35 -0
- package/dist/src/storybook/palettes.d.ts.map +1 -0
- package/dist/src/storybook/pickerStoryArgs.d.ts +63 -0
- package/dist/src/storybook/pickerStoryArgs.d.ts.map +1 -0
- package/dist/src/storybook/sampleImages.d.ts +11 -0
- package/dist/src/storybook/sampleImages.d.ts.map +1 -0
- package/dist/src/storybook/sampleRows.d.ts +12 -0
- package/dist/src/storybook/sampleRows.d.ts.map +1 -0
- package/dist/src/storybook/storySource.d.ts +1 -1
- package/dist/src/storybook/storySource.d.ts.map +1 -1
- package/dist/src/storybook/useCssVarOverride.d.ts +17 -0
- package/dist/src/storybook/useCssVarOverride.d.ts.map +1 -0
- package/dist/test/storybook/cssVarOverrideStore.test.d.ts +2 -0
- package/dist/test/storybook/cssVarOverrideStore.test.d.ts.map +1 -0
- package/dist/test/storybook/groupLayoutStoryArgs.test.d.ts +2 -0
- package/dist/test/storybook/groupLayoutStoryArgs.test.d.ts.map +1 -0
- package/package.json +11 -3
package/dist/index.cjs.js
CHANGED
|
@@ -8,7 +8,6 @@ var Draggable = require('react-draggable');
|
|
|
8
8
|
var dateFns = require('date-fns');
|
|
9
9
|
var locale = require('date-fns/locale');
|
|
10
10
|
var reactDayPicker = require('react-day-picker');
|
|
11
|
-
require('react-day-picker/dist/style.css');
|
|
12
11
|
var reactWindow = require('react-window');
|
|
13
12
|
|
|
14
13
|
function _interopNamespaceDefault(e) {
|
|
@@ -181,7 +180,7 @@ function getContrastColor(color) {
|
|
|
181
180
|
return `hsl(${hsl.h}, ${contrastS}%, ${targetL}%)`;
|
|
182
181
|
}
|
|
183
182
|
|
|
184
|
-
var styles$
|
|
183
|
+
var styles$z = {"cw-tooltip-content":"cw-tooltip-module__cw-tooltip-content__RZczd","cw-tooltip":"cw-tooltip-module__cw-tooltip__1KYig"};
|
|
185
184
|
|
|
186
185
|
// Constants
|
|
187
186
|
const margin$1 = 16;
|
|
@@ -471,7 +470,7 @@ const CwTooltipManager = () => {
|
|
|
471
470
|
if (!state.isVisible || !state.content) {
|
|
472
471
|
return null;
|
|
473
472
|
}
|
|
474
|
-
return reactDom.createPortal(jsxRuntime.jsx("div", { ref: tooltipRef, className: styles$
|
|
473
|
+
return reactDom.createPortal(jsxRuntime.jsx("div", { ref: tooltipRef, className: styles$z["cw-tooltip-content"], "data-position": actualPosition, "data-visible": state.isVisible, "data-inline": state.displayInline, style: {
|
|
475
474
|
top: `${tooltipPosition.top}px`,
|
|
476
475
|
left: `${tooltipPosition.left}px`,
|
|
477
476
|
opacity: (isPositioned && !isMeasuring) ? 1 : 0,
|
|
@@ -552,7 +551,7 @@ const CwTooltipNew = ({ children, content = null, position = "right", dissapears
|
|
|
552
551
|
React.useEffect(() => {
|
|
553
552
|
ensureTooltipManager();
|
|
554
553
|
}, []);
|
|
555
|
-
return (jsxRuntime.jsx("div", { ref: containerRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, className: styles$
|
|
554
|
+
return (jsxRuntime.jsx("div", { ref: containerRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, className: styles$z["cw-tooltip"], children: children }));
|
|
556
555
|
};
|
|
557
556
|
|
|
558
557
|
const SVG_ICONS = {
|
|
@@ -672,7 +671,7 @@ function resolveBadgeAria(label, loading, hasText) {
|
|
|
672
671
|
return hasText ? {} : { 'aria-hidden': 'true' };
|
|
673
672
|
}
|
|
674
673
|
|
|
675
|
-
var styles$
|
|
674
|
+
var styles$y = {"badge":"cw-badge-module__badge__PKlak"};
|
|
676
675
|
|
|
677
676
|
/**
|
|
678
677
|
* CwBadge - the small coloured circle with a number, used for alert and notification counts.
|
|
@@ -701,7 +700,7 @@ const CwBadge = ({ count, content, color = 'info', variant = 'solid', size = 'sm
|
|
|
701
700
|
? formatBadgeCount(count, max)
|
|
702
701
|
: undefined;
|
|
703
702
|
const isDot = !loading && !hasContent && count === undefined;
|
|
704
|
-
const badgeClassNames = ['cw-badge', styles$
|
|
703
|
+
const badgeClassNames = ['cw-badge', styles$y.badge, className].filter(Boolean).join(' ');
|
|
705
704
|
return (jsxRuntime.jsx("span", { className: badgeClassNames, "data-color": color, "data-variant": variant, "data-size": size, "data-loading": loading ? 'true' : undefined, "data-dot": isDot ? 'true' : undefined, ...resolveBadgeAria(label, loading, !loading && (hasContent || countText !== undefined)), style: style, children: loading ? jsxRuntime.jsx(CwIcon, { iconId: "spinner", size: "small" }) : hasContent ? content : countText }));
|
|
706
705
|
};
|
|
707
706
|
|
|
@@ -1089,7 +1088,7 @@ function CwLoading({ isLoading = false, text = '', size = 'regular', iconPositio
|
|
|
1089
1088
|
return (jsxRuntime.jsxs("div", { "aria-busy": isLoading, className: "cw-loading-container", "data-children": !!children, children: [overlay, jsxRuntime.jsx("div", { className: "cw-loading-disabled-content", children: children })] }));
|
|
1090
1089
|
}
|
|
1091
1090
|
|
|
1092
|
-
var styles$
|
|
1091
|
+
var styles$x = {"skeleton":"cw-skeleton-module__skeleton__Jvx2x","group":"cw-skeleton-module__group__Cm8AU"};
|
|
1093
1092
|
|
|
1094
1093
|
/*
|
|
1095
1094
|
* Internal helper for skeleton allocations (CwSkeleton, tables, cards).
|
|
@@ -1131,8 +1130,8 @@ function CwSkeleton({ variant = 'text', width, height, count = 1, radius, gap })
|
|
|
1131
1130
|
};
|
|
1132
1131
|
// The un-hashed cw-skeleton / cw-skeleton-group classes carry no styles in the
|
|
1133
1132
|
// library - they are stable public hooks for exceptional external overrides.
|
|
1134
|
-
const skeletonClassName = ['cw-skeleton', styles$
|
|
1135
|
-
const groupClassName = ['cw-skeleton-group', styles$
|
|
1133
|
+
const skeletonClassName = ['cw-skeleton', styles$x.skeleton].filter(Boolean).join(' ');
|
|
1134
|
+
const groupClassName = ['cw-skeleton-group', styles$x.group].filter(Boolean).join(' ');
|
|
1136
1135
|
const lineCount = normalizeSkeletonCount(count, 1);
|
|
1137
1136
|
if (lineCount <= 1) {
|
|
1138
1137
|
return (jsxRuntime.jsx("span", { className: skeletonClassName, "data-variant": variant, "aria-hidden": "true", style: style }));
|
|
@@ -1144,7 +1143,7 @@ function CwSkeleton({ variant = 'text', width, height, count = 1, radius, gap })
|
|
|
1144
1143
|
return (jsxRuntime.jsx("span", { className: groupClassName, "aria-hidden": "true", style: groupStyle, children: skeletonElements }));
|
|
1145
1144
|
}
|
|
1146
1145
|
|
|
1147
|
-
var styles$
|
|
1146
|
+
var styles$w = {"progress":"cw-progress-module__progress__d-g2-","value":"cw-progress-module__value__Q-DrH","header":"cw-progress-module__header__mv5ct","label":"cw-progress-module__label__jwOWp","track":"cw-progress-module__track__572-3","fill":"cw-progress-module__fill__fX1UA"};
|
|
1148
1147
|
|
|
1149
1148
|
/**
|
|
1150
1149
|
* CwProgress - a determinate or indeterminate progress bar.
|
|
@@ -1168,17 +1167,17 @@ function CwProgress({ value, indeterminate = false, label, rightLabel, size = 'r
|
|
|
1168
1167
|
const valueText = rightLabel ?? (percent !== undefined ? `${percent}%` : '');
|
|
1169
1168
|
// The un-hashed cw-progress class carries no styles in the library - a stable
|
|
1170
1169
|
// public hook for exceptional external overrides only.
|
|
1171
|
-
const rootClassName = ['cw-progress', styles$
|
|
1172
|
-
const labelSpan = label ? jsxRuntime.jsx("span", { className: styles$
|
|
1173
|
-
const valueLabel = showValue ? (jsxRuntime.jsx("span", { className: styles$
|
|
1174
|
-
return (jsxRuntime.jsxs("div", { className: rootClassName, "data-layout": layout, "data-size": size, "data-color": color, "data-prominent": prominent || undefined, "data-indeterminate": indeterminate || undefined, children: [layout === 'column' && (labelSpan || valueLabel) && (jsxRuntime.jsxs("header", { className: styles$
|
|
1170
|
+
const rootClassName = ['cw-progress', styles$w.progress, className].filter(Boolean).join(' ');
|
|
1171
|
+
const labelSpan = label ? jsxRuntime.jsx("span", { className: styles$w.label, id: labelId, children: label }) : null;
|
|
1172
|
+
const valueLabel = showValue ? (jsxRuntime.jsx("span", { className: styles$w.value, "data-mono": monoValue || undefined, children: valueText })) : null;
|
|
1173
|
+
return (jsxRuntime.jsxs("div", { className: rootClassName, "data-layout": layout, "data-size": size, "data-color": color, "data-prominent": prominent || undefined, "data-indeterminate": indeterminate || undefined, children: [layout === 'column' && (labelSpan || valueLabel) && (jsxRuntime.jsxs("header", { className: styles$w.header, children: [labelSpan, valueLabel] })), layout === 'row' && labelSpan, jsxRuntime.jsx("div", { className: styles$w.track, role: "progressbar", ...(label && { 'aria-labelledby': labelId }), ...(!indeterminate && percent !== undefined && {
|
|
1175
1174
|
'aria-valuenow': percent,
|
|
1176
1175
|
'aria-valuemin': 0,
|
|
1177
1176
|
'aria-valuemax': 100
|
|
1178
|
-
}), children: jsxRuntime.jsx("div", { className: styles$
|
|
1177
|
+
}), children: jsxRuntime.jsx("div", { className: styles$w.fill, style: !indeterminate && clamped !== undefined ? { width: `${clamped}%` } : undefined }) }), layout === 'row' && valueLabel] }));
|
|
1179
1178
|
}
|
|
1180
1179
|
|
|
1181
|
-
var styles$
|
|
1180
|
+
var styles$v = {"cw-generic-tooltip-content":"cw-generic-tooltip-module__cw-generic-tooltip-content__la-Si","cw-generic-tooltip":"cw-generic-tooltip-module__cw-generic-tooltip__Ij76M"};
|
|
1182
1181
|
|
|
1183
1182
|
// Constants moved outside to prevent recreation
|
|
1184
1183
|
const margin = 16;
|
|
@@ -1295,18 +1294,22 @@ const useTooltipPosition = (isVisible, containerRef, preferredPosition, tooltipC
|
|
|
1295
1294
|
*
|
|
1296
1295
|
* @see CwTooltipNew
|
|
1297
1296
|
*/
|
|
1297
|
+
/**
|
|
1298
|
+
* Portal-per-instance tooltip.
|
|
1299
|
+
* @deprecated Use {@link CwTooltipNew}: same API, one shared portal for every tooltip on the page.
|
|
1300
|
+
*/
|
|
1298
1301
|
const CwGenericTooltip = ({ children, content = null, position = defaultPosition, dissapearsWhenHover = false, hide = false, overlayStyle = {}, showDelay = 0, displayInline = false, }) => {
|
|
1299
1302
|
const [isVisible, setIsVisible] = React.useState(false);
|
|
1300
1303
|
const containerRef = React.useRef(null);
|
|
1301
1304
|
const { setTooltipTimeout, clearTooltipTimeout } = useTooltipDelay(() => {
|
|
1302
1305
|
setIsVisible(true);
|
|
1303
1306
|
}, showDelay);
|
|
1304
|
-
const { position: tooltipPosition, actualPosition } = useTooltipPosition(isVisible, containerRef, position, styles$
|
|
1307
|
+
const { position: tooltipPosition, actualPosition } = useTooltipPosition(isVisible, containerRef, position, styles$v["cw-generic-tooltip-content"]);
|
|
1305
1308
|
// Memoize tooltip content creation
|
|
1306
1309
|
const tooltipContent = React.useMemo(() => {
|
|
1307
1310
|
if (hide || !isVisible || !content)
|
|
1308
1311
|
return null;
|
|
1309
|
-
return reactDom.createPortal(jsxRuntime.jsx("div", { className: styles$
|
|
1312
|
+
return reactDom.createPortal(jsxRuntime.jsx("div", { className: styles$v["cw-generic-tooltip-content"], "data-position": actualPosition, "data-visible": isVisible, "data-inline": displayInline, style: {
|
|
1310
1313
|
position: 'fixed',
|
|
1311
1314
|
top: `${tooltipPosition.top}px`,
|
|
1312
1315
|
left: `${tooltipPosition.left}px`,
|
|
@@ -1321,7 +1324,7 @@ const CwGenericTooltip = ({ children, content = null, position = defaultPosition
|
|
|
1321
1324
|
clearTooltipTimeout();
|
|
1322
1325
|
setIsVisible(false);
|
|
1323
1326
|
}, [clearTooltipTimeout]);
|
|
1324
|
-
return (jsxRuntime.jsxs("div", { ref: containerRef, className: styles$
|
|
1327
|
+
return (jsxRuntime.jsxs("div", { ref: containerRef, className: styles$v["cw-generic-tooltip"], onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, children: [tooltipContent, children] }));
|
|
1325
1328
|
};
|
|
1326
1329
|
|
|
1327
1330
|
const CwButton = React.forwardRef(function CwButton({ text, variant = 'solid', color = 'primary', size = 'medium', iconPosition = 'left', pressed, className = '', icon = "", title, tooltipPosition = "bottom", badge, children, ...buttonProps }, ref) {
|
|
@@ -1389,8 +1392,13 @@ function CwModal(custModalProps) {
|
|
|
1389
1392
|
return (jsxRuntime.jsx("div", { children: custModalProps.modalState && (jsxRuntime.jsxs("div", { className: custModalProps.classNameModalOverlay + " cwelltModalOverlay", children: [jsxRuntime.jsx("div", { className: "cwelltModalOverlayBg", onClick: custModalProps.onCloseModal }), jsxRuntime.jsx(Draggable, { disabled: isModalDisabled, axis: "both", nodeRef: draggableRef, children: jsxRuntime.jsxs("div", { className: custModalProps.classNameModal + " cwelltContainerModal", ref: draggableRef, style: widthModalDef !== "40em" ? modalStyle.widthCustomStyle : modalStyle.widthDefStyle, children: [jsxRuntime.jsxs("div", { className: "cwelltModalHeader", onMouseOver: cwelltOnMouseOverModal, onMouseOut: cwelltOnMouseOutModal, children: [jsxRuntime.jsx("div", { className: "cwelltModalTitle", children: custModalProps.titleModal }), jsxRuntime.jsx("button", { className: "cwelltBtnCloseModal", onClick: custModalProps.onCloseModal, children: jsxRuntime.jsx("span", { className: "cwelltCloseIcon" }) })] }), jsxRuntime.jsx("div", { className: "cwelltModalBody", children: jsxRuntime.jsx("div", { className: "cwelltContainerModalBody", style: { position: "relative" }, children: custModalProps.children }) }), isHide === false ? (jsxRuntime.jsx("footer", { className: "legacy-modal-footer", onMouseOver: cwelltOnMouseOverModal, onMouseOut: cwelltOnMouseOutModal, children: jsxRuntime.jsx(CwButton, { variant: "icon", icon: "save", title: "Save", onClick: custModalProps.onSaveModal, form: custModalProps.formSaveModal, hidden: custModalProps.HideBtnModal, type: custModalProps.HtmlSubmitModal }) })) : (jsxRuntime.jsx("div", { style: { display: "none" } }))] }) })] })) }));
|
|
1390
1393
|
}
|
|
1391
1394
|
|
|
1392
|
-
var styles$
|
|
1395
|
+
var styles$u = {"overlayPositioned":"CwConfirmationPopup-module__overlayPositioned__11qYB","popup":"CwConfirmationPopup-module__popup__ahPjM","message":"CwConfirmationPopup-module__message__MnNL4","buttons":"CwConfirmationPopup-module__buttons__fGYYE","button":"CwConfirmationPopup-module__button__ugYQE","confirmButton":"CwConfirmationPopup-module__confirmButton__rTP4S","cancelButton":"CwConfirmationPopup-module__cancelButton__Ry694"};
|
|
1393
1396
|
|
|
1397
|
+
/**
|
|
1398
|
+
* Small anchored confirmation for a destructive action.
|
|
1399
|
+
*
|
|
1400
|
+
* Preferably avoid using it, it needs a refactor.
|
|
1401
|
+
*/
|
|
1394
1402
|
function CwConfirmationPopup(props) {
|
|
1395
1403
|
const { isOpen, onConfirm, onCancel, message = "Are you sure you want to proceed?", confirmText = "Confirm", cancelText = "Cancel", placement = 'bottom', children } = props;
|
|
1396
1404
|
const triggerRef = React.useRef(null);
|
|
@@ -1453,15 +1461,15 @@ function CwConfirmationPopup(props) {
|
|
|
1453
1461
|
onCancel();
|
|
1454
1462
|
}
|
|
1455
1463
|
};
|
|
1456
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [renderChildren(), isOpen && (jsxRuntime.jsx("div", { className: styles$
|
|
1464
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [renderChildren(), isOpen && (jsxRuntime.jsx("div", { className: styles$u.overlayPositioned, onClick: handleOverlayClick, children: jsxRuntime.jsxs("div", { ref: popupRef, className: styles$u.popup, style: {
|
|
1457
1465
|
position: 'absolute',
|
|
1458
1466
|
top: `${position.top}px`,
|
|
1459
1467
|
left: `${position.left}px`,
|
|
1460
1468
|
transform: 'none'
|
|
1461
|
-
}, children: [jsxRuntime.jsx("p", { className: styles$
|
|
1469
|
+
}, children: [jsxRuntime.jsx("p", { className: styles$u.message, children: message }), jsxRuntime.jsxs("div", { className: styles$u.buttons, children: [jsxRuntime.jsx("button", { className: `${styles$u.button} ${styles$u.confirmButton}`, onClick: onConfirm, children: confirmText }), jsxRuntime.jsx("button", { className: `${styles$u.button} ${styles$u.cancelButton}`, onClick: onCancel, children: cancelText })] })] }) }))] }));
|
|
1462
1470
|
}
|
|
1463
1471
|
|
|
1464
|
-
var styles$
|
|
1472
|
+
var styles$t = {"cw-dialog-main":"cw-dialog-module__cw-dialog-main__cHxHt","cw-dialog-button-close":"cw-dialog-module__cw-dialog-button-close__9GRd8"};
|
|
1465
1473
|
|
|
1466
1474
|
// Helper function to parse size values
|
|
1467
1475
|
const parseSize = (size) => {
|
|
@@ -1734,7 +1742,7 @@ const CwDialog = props => {
|
|
|
1734
1742
|
}
|
|
1735
1743
|
}
|
|
1736
1744
|
}, [open]);
|
|
1737
|
-
const header = React.useMemo(() => (jsxRuntime.jsxs("header", { onMouseDown: handleMouseDown, children: [jsxRuntime.jsx("span", { children: headline }), customHeader || (jsxRuntime.jsx("button", { className: styles$
|
|
1745
|
+
const header = React.useMemo(() => (jsxRuntime.jsxs("header", { onMouseDown: handleMouseDown, children: [jsxRuntime.jsx("span", { children: headline }), customHeader || (jsxRuntime.jsx("button", { className: styles$t["cw-dialog-button-close"], onClick: onClose }))] })), [handleMouseDown, headline, customHeader, onClose]);
|
|
1738
1746
|
const content = React.useMemo(() => (jsxRuntime.jsx("section", { children: children })), [children]);
|
|
1739
1747
|
const footer = React.useMemo(() => (jsxRuntime.jsx("footer", { children: customFooter || (jsxRuntime.jsx(CwButton, { variant: "icon", icon: "save", title: "Save", onClick: onSave, tooltipPosition: "top", disabled: disableSave, "data-testid": "cw-dialog-save" })) })), [customFooter, onSave, disableSave]);
|
|
1740
1748
|
const resizeHandles = React.useMemo(() => size.autoHeight
|
|
@@ -1761,7 +1769,7 @@ const CwDialog = props => {
|
|
|
1761
1769
|
: `${convertFromPx(size.height, size.heightUnit)}${size.heightUnit}`;
|
|
1762
1770
|
return { displayWidth, displayHeight };
|
|
1763
1771
|
}, [size.width, size.height, size.widthUnit, size.heightUnit, size.autoHeight]);
|
|
1764
|
-
const dialogContent = (jsxRuntime.jsx("div", { "data-has-scrim": hasScrim, className: styles$
|
|
1772
|
+
const dialogContent = (jsxRuntime.jsx("div", { "data-has-scrim": hasScrim, className: styles$t["cw-dialog-main"], onMouseDown: handleScrimMouseDown, onMouseUp: handleScrimMouseUpOrLeave, onMouseLeave: handleScrimMouseUpOrLeave, "data-pressing": isPressingScrim, children: jsxRuntime.jsxs("dialog", { ...domProps, ref: dialogRef, style: {
|
|
1765
1773
|
left: `${position.x}px`,
|
|
1766
1774
|
top: `${position.y}px`,
|
|
1767
1775
|
width: displayDimensions.displayWidth,
|
|
@@ -1814,7 +1822,8 @@ class CwReportModal extends React__namespace.Component {
|
|
|
1814
1822
|
}
|
|
1815
1823
|
|
|
1816
1824
|
/**
|
|
1817
|
-
* A modal that appears when an element is hovered
|
|
1825
|
+
* A modal that appears when an element is hovered.
|
|
1826
|
+
* Preferably avoid using it, it needs a refactor.
|
|
1818
1827
|
* @param children Contents of the modal
|
|
1819
1828
|
* @param hovereable Element to hover to display the modal
|
|
1820
1829
|
* @param onFirstOpened Function to run only once when the modal opens for the first time
|
|
@@ -1922,7 +1931,7 @@ function CwAlign(props) {
|
|
|
1922
1931
|
}, children: props.children }));
|
|
1923
1932
|
}
|
|
1924
1933
|
|
|
1925
|
-
var styles$
|
|
1934
|
+
var styles$s = {"card":"cw-card-module__card__HJUT0","clickable":"cw-card-module__clickable__Y-V3X","disabled":"cw-card-module__disabled__0wHh1","content":"cw-card-module__content__ma9qy","headerContent":"cw-card-module__headerContent__x4Jfl","footerTags":"cw-card-module__footerTags__80sSW"};
|
|
1926
1935
|
|
|
1927
1936
|
/**
|
|
1928
1937
|
* CwCard - A simple card component for displaying content in a contained format
|
|
@@ -1948,10 +1957,10 @@ const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, o
|
|
|
1948
1957
|
// Construct class names using CSS modules
|
|
1949
1958
|
const cardClassNames = [
|
|
1950
1959
|
'cw-card',
|
|
1951
|
-
styles$
|
|
1960
|
+
styles$s.card,
|
|
1952
1961
|
className,
|
|
1953
|
-
clickable ? styles$
|
|
1954
|
-
disabled ? styles$
|
|
1962
|
+
clickable ? styles$s.clickable : '',
|
|
1963
|
+
disabled ? styles$s.disabled : '',
|
|
1955
1964
|
].filter(Boolean).join(' ');
|
|
1956
1965
|
// Handle click event when card is clickable
|
|
1957
1966
|
const handleClick = () => {
|
|
@@ -1969,15 +1978,15 @@ const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, o
|
|
|
1969
1978
|
const hasFooter = hasChips || footer || (hasActions && resolvedDirection === "row");
|
|
1970
1979
|
// Actions component to reuse. While loading, each provided action renders a circular
|
|
1971
1980
|
// ghost sized to the CwButton icon footprint (2rem) - no interactive buttons.
|
|
1972
|
-
const ActionsComponent = hasActions && !disabled ? (jsxRuntime.jsx("div", { className: styles$
|
|
1981
|
+
const ActionsComponent = hasActions && !disabled ? (jsxRuntime.jsx("div", { className: styles$s.actions, children: isLoading ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [extraActions && jsxRuntime.jsx(CwSkeleton, { variant: "circle", height: "2rem" }), onEdit && jsxRuntime.jsx(CwSkeleton, { variant: "circle", height: "2rem" }), onDelete && jsxRuntime.jsx(CwSkeleton, { variant: "circle", height: "2rem" })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [extraActions ?? null, onEdit && jsxRuntime.jsx(CwButton, { variant: "icon", icon: "edit", onClick: onEdit }), onDelete && jsxRuntime.jsx(CwButton, { variant: "icon", icon: "delete", color: "danger", onClick: onDelete })] })) })) : null;
|
|
1973
1982
|
return (jsxRuntime.jsxs("div", { ...(id && { id }), className: cardClassNames, ...(style && { style }), ...(clickable && !isLoading && {
|
|
1974
1983
|
role: 'button',
|
|
1975
1984
|
tabIndex: 0,
|
|
1976
1985
|
onClick: handleClick,
|
|
1977
|
-
}), "data-variant": variant, "data-direction": resolvedDirection, "aria-busy": isLoading || undefined, children: [isLoading ? (jsxRuntime.jsxs("header", { children: [jsxRuntime.jsx("div", { className: styles$
|
|
1986
|
+
}), "data-variant": variant, "data-direction": resolvedDirection, "aria-busy": isLoading || undefined, children: [isLoading ? (jsxRuntime.jsxs("header", { children: [jsxRuntime.jsx("div", { className: styles$s.headerContent, "data-align": resolvedAlign, children: jsxRuntime.jsx(CwSkeleton, { width: "8rem", height: "1.5em" }) }), resolvedDirection === "column" && ActionsComponent] })) : (hasHeader && (jsxRuntime.jsxs("header", { children: [(title || subtitle) && (jsxRuntime.jsxs("div", { className: styles$s.headerContent, "data-align": resolvedAlign, children: [title && jsxRuntime.jsx("h5", { children: title }), subtitle && jsxRuntime.jsx("strong", { children: subtitle })] })), resolvedDirection === "column" && ActionsComponent] }))), jsxRuntime.jsx("div", { className: styles$s.content, children: isLoading ? jsxRuntime.jsx(CwSkeleton, { count: normalizeSkeletonCount(skeletonLines, 3) }) : children }), hasFooter && (isLoading ? (jsxRuntime.jsx("footer", { children: jsxRuntime.jsx("div", { className: styles$s.footerTags, children: jsxRuntime.jsx(CwSkeleton, { variant: "rect", width: "4rem", height: "1.5em", radius: "1rem" }) }) })) : (jsxRuntime.jsxs("footer", { children: [hasChips && (jsxRuntime.jsx("div", { className: styles$s.footerTags, children: chips.map((chip, index) => (jsxRuntime.jsx(CwChip, { label: chip.label, colorScheme: chip.colorScheme, className: styles$s.chip, ...(chip.customColor && { customColor: chip.customColor }), ...(chip.variant && { variant: chip.variant }), ...(chip.icon && { icon: chip.icon }) }, index))) })), footer && (jsxRuntime.jsx("div", { className: styles$s.footerContent, children: footer }))] }))), resolvedDirection === "row" && ActionsComponent] }));
|
|
1978
1987
|
};
|
|
1979
1988
|
|
|
1980
|
-
var styles$
|
|
1989
|
+
var styles$r = {"cardContainer":"cw-card-list-module__cardContainer__l3YEh","pagination":"cw-card-list-module__pagination__5Ay78","pageInfo":"cw-card-list-module__pageInfo__uiMel","emptyState":"cw-card-list-module__emptyState__RlqiS"};
|
|
1981
1990
|
|
|
1982
1991
|
/**
|
|
1983
1992
|
* Option to display in the CwSelect
|
|
@@ -2072,16 +2081,14 @@ function CwCardList({ items, renderCard, pageSize = 10, layout = 'grid', default
|
|
|
2072
2081
|
icon: sortDirection === 'asc' ? 'arrow-up' : 'arrow-down',
|
|
2073
2082
|
onClick: () => setSortDirection(prev => prev === 'asc' ? 'desc' : 'asc'),
|
|
2074
2083
|
title: `Sort ${sortDirection === 'asc' ? 'descending' : 'ascending'}`,
|
|
2075
|
-
}, value: sortKey, onChange: (e) => handleSortChange(e.target.value), children: sortOptions.map(option => (jsxRuntime.jsx(CwOption, { value: option.key, children: option.label }, option.key))) }) })), isLoading ? (jsxRuntime.jsx("div", { className: `${styles$
|
|
2084
|
+
}, value: sortKey, onChange: (e) => handleSortChange(e.target.value), children: sortOptions.map(option => (jsxRuntime.jsx(CwOption, { value: option.key, children: option.label }, option.key))) }) })), isLoading ? (jsxRuntime.jsx("div", { className: `${styles$r.cardContainer}`, "data-layout": layout, style: gridStyle, "aria-busy": true, children: Array.from({ length: normalizeSkeletonCount(skeletonCards, 6) }, (_, index) => (jsxRuntime.jsx(CwCard, { isLoading: true, children: null }, `skeleton_${index}`))) })) : sortedItems.length === 0 ? (jsxRuntime.jsx("div", { className: styles$r.emptyState, children: emptyState || jsxRuntime.jsx("p", { children: "No items to display" }) })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: `${styles$r.cardContainer}`, "data-layout": layout, style: gridStyle, children: visibleItems.map((item, index) => (jsxRuntime.jsx(React.Fragment, { children: renderCard(item, index) }, keyExtractor ? keyExtractor(item, index) : index))) }), totalPages > 1 && (jsxRuntime.jsxs("div", { className: styles$r.pagination, children: [jsxRuntime.jsx(CwButton, { variant: "icon", icon: "chevron-left", disabled: currentPage === 1, onClick: () => setCurrentPage(p => Math.max(1, p - 1)) }), jsxRuntime.jsxs("span", { className: styles$r.pageInfo, children: [currentPage, " / ", totalPages] }), jsxRuntime.jsx(CwButton, { variant: "icon", icon: "chevron-right", disabled: currentPage === totalPages, onClick: () => setCurrentPage(p => Math.min(totalPages, p + 1)) })] }))] }))] }));
|
|
2076
2085
|
}
|
|
2077
2086
|
|
|
2078
|
-
var styles$
|
|
2087
|
+
var styles$q = {"cw-accordion":"cw-accordion-module__cw-accordion__ErvlW","cw-accordion-body":"cw-accordion-module__cw-accordion-body__xlI8b"};
|
|
2079
2088
|
|
|
2080
2089
|
/**
|
|
2081
|
-
*
|
|
2082
|
-
* @
|
|
2083
|
-
* @remarks Previously CwAccordionContainer
|
|
2084
|
-
* @returns
|
|
2090
|
+
* Legacy collapsible section with its own header markup.
|
|
2091
|
+
* @deprecated Use {@link CwExpandable} instead.
|
|
2085
2092
|
*/
|
|
2086
2093
|
function CwAccordionContainer(CwelltAccordionContainerProps) {
|
|
2087
2094
|
// #region Hooks
|
|
@@ -2092,7 +2099,7 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
|
|
|
2092
2099
|
setVisible_accordionBody(!isVisible_accordionBody);
|
|
2093
2100
|
};
|
|
2094
2101
|
// #endregion
|
|
2095
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
2102
|
+
return (jsxRuntime.jsxs("div", { className: styles$q["cw-accordion"], style: CwelltAccordionContainerProps.style, "data-open": isVisible_accordionBody, children: [jsxRuntime.jsxs("header", { onClick: () => showAccordionBody(), children: [jsxRuntime.jsx("div", { children: CwelltAccordionContainerProps.desc_text }), jsxRuntime.jsx("button", { className: "cw-button-icon" })] }), jsxRuntime.jsx("div", { className: styles$q["cw-accordion-body"], children: CwelltAccordionContainerProps.children })] }));
|
|
2096
2103
|
}
|
|
2097
2104
|
|
|
2098
2105
|
/*
|
|
@@ -2334,7 +2341,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
2334
2341
|
: classNameRow ?? "";
|
|
2335
2342
|
return (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("tr", { className: `${dynamicClassName} ${hasClassNameRow(item) ? item.classNameRow : ""} ${isSelected ? "cw-table-row-selected" : ""}`, onClick: (e) => rowSelection && handleRowClick(item, e), "data-row-key": itemKey != null ? String(itemKey) : undefined, style: {
|
|
2336
2343
|
cursor: rowSelection ? "pointer" : "default",
|
|
2337
|
-
backgroundColor: isSelected ? "var(--cw-
|
|
2344
|
+
backgroundColor: isSelected ? "var(--cw-table-row-selected-background)" : undefined,
|
|
2338
2345
|
transition: "background-color 0.2s ease",
|
|
2339
2346
|
}, children: [expandedRowRender && (jsxRuntime.jsx("td", { className: "cw-table-col-action cw-table-col-expand", children: jsxRuntime.jsx("button", { onClick: () => handleRowExpand(item), className: `cw-button-icon ${expandedRowKey === itemKey
|
|
2340
2347
|
? "cwi-chevron-down"
|
|
@@ -2367,7 +2374,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
2367
2374
|
}, min: 1, max: totalPages }), jsxRuntime.jsx("span", { children: "/" }), jsxRuntime.jsx("span", { children: totalPages }), jsxRuntime.jsx(CwButton, { onClick: () => handlePageChange(currentPage + 1), disabled: currentPage === totalPages || totalPages <= 1, variant: "icon", icon: "chevron-right" }), jsxRuntime.jsx(CwButton, { onClick: () => handlePageChange(totalPages), disabled: currentPage === totalPages || totalPages <= 1, variant: "icon", icon: "chevron-right-double" })] })] }))] }));
|
|
2368
2375
|
}
|
|
2369
2376
|
|
|
2370
|
-
var styles$
|
|
2377
|
+
var styles$p = {"dropIndicator":"cw-sortable-table-module__dropIndicator__ov-Jz","dragging":"cw-sortable-table-module__dragging__MrLrz","saveBar":"cw-sortable-table-module__saveBar__3OdoZ cw-flex-row cw-align-center-center cw-gap-small"};
|
|
2371
2378
|
|
|
2372
2379
|
/**
|
|
2373
2380
|
* Hook that provides state management for CwSortableTable.
|
|
@@ -2430,7 +2437,7 @@ function useSortableTable(initialItems) {
|
|
|
2430
2437
|
}
|
|
2431
2438
|
|
|
2432
2439
|
// ─── Drop indicator row ───────────────────────────────────────────────────────
|
|
2433
|
-
const DropIndicatorRow = ({ colSpan }) => (jsxRuntime.jsx("tr", { className: styles$
|
|
2440
|
+
const DropIndicatorRow = ({ colSpan }) => (jsxRuntime.jsx("tr", { className: styles$p.dropIndicator, "aria-hidden": true, children: jsxRuntime.jsx("td", { colSpan: colSpan, children: jsxRuntime.jsx("div", {}) }) }));
|
|
2434
2441
|
// ─── Loading skeleton ─────────────────────────────────────────────────────────
|
|
2435
2442
|
// Plain td cells (no local class): the ghost cells get the same global cw-table
|
|
2436
2443
|
// padding as real body cells, so row heights match the loaded rows exactly.
|
|
@@ -2533,11 +2540,11 @@ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = f
|
|
|
2533
2540
|
return items.map((item, index) => {
|
|
2534
2541
|
const key = item[rowKey];
|
|
2535
2542
|
const isDragging = draggedItem?.[rowKey] === key;
|
|
2536
|
-
return (jsxRuntime.jsxs(React.Fragment, { children: [dropIndicatorIndex === index && (jsxRuntime.jsx(DropIndicatorRow, { colSpan: totalCols })), jsxRuntime.jsxs("tr", { draggable: true, onDragStart: (e) => handleDragStart(e, item), onDragOver: (e) => handleDragOver(e, index), onDragEnd: handleDragEnd, className: isDragging ? styles$
|
|
2543
|
+
return (jsxRuntime.jsxs(React.Fragment, { children: [dropIndicatorIndex === index && (jsxRuntime.jsx(DropIndicatorRow, { colSpan: totalCols })), jsxRuntime.jsxs("tr", { draggable: true, onDragStart: (e) => handleDragStart(e, item), onDragOver: (e) => handleDragOver(e, index), onDragEnd: handleDragEnd, className: isDragging ? styles$p.dragging : "", children: [showHandle && (jsxRuntime.jsx("td", { className: "cw-table-col-action", children: jsxRuntime.jsx(CwIcon, { iconId: "grip-dots", color: "neutral", style: { opacity: 0.75 } }) })), columns.map(col => (jsxRuntime.jsx("td", { className: col.className ?? "", style: col.width ? { width: col.width } : undefined, children: renderCell(item, col) }, `${String(key)}_${col.key}`)))] }), index === items.length - 1 && dropIndicatorIndex === items.length && (jsxRuntime.jsx(DropIndicatorRow, { colSpan: totalCols }))] }, String(key)));
|
|
2537
2544
|
});
|
|
2538
2545
|
};
|
|
2539
2546
|
// ── Render ──────────────────────────────────────────────────────────────
|
|
2540
|
-
return (jsxRuntime.jsxs("div", { className: `cw-table-container ${className ?? ""}`, style: containerStyle, "aria-busy": loading || undefined, children: [jsxRuntime.jsxs("table", { className: `cw-table cw-sortable-table ${tableClassName ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [showHandle && jsxRuntime.jsx("th", { className: "cw-table-col-action" }), columns.map(col => (jsxRuntime.jsx("th", { className: col.className ?? "", style: col.width ? { width: col.width, minWidth: 50 } : undefined, children: col.title }, col.key)))] }) }), jsxRuntime.jsx("tbody", { children: renderBody() })] }), !loading && hasChanges && (jsxRuntime.jsxs("footer", { className: styles$
|
|
2547
|
+
return (jsxRuntime.jsxs("div", { className: `cw-table-container ${className ?? ""}`, style: containerStyle, "aria-busy": loading || undefined, children: [jsxRuntime.jsxs("table", { className: `cw-table cw-sortable-table ${tableClassName ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [showHandle && jsxRuntime.jsx("th", { className: "cw-table-col-action" }), columns.map(col => (jsxRuntime.jsx("th", { className: col.className ?? "", style: col.width ? { width: col.width, minWidth: 50 } : undefined, children: col.title }, col.key)))] }) }), jsxRuntime.jsx("tbody", { children: renderBody() })] }), !loading && hasChanges && (jsxRuntime.jsxs("footer", { className: styles$p.saveBar, children: [jsxRuntime.jsx(CwButton, { variant: "outline", color: "neutral", icon: "undo", text: discardLabel, onClick: handleDiscard }), jsxRuntime.jsx(CwButton, { variant: "solid", color: "primary", icon: "save", text: saveLabel, onClick: () => handleSave(onReorder) })] }))] }));
|
|
2541
2548
|
}
|
|
2542
2549
|
|
|
2543
2550
|
/**
|
|
@@ -2709,7 +2716,7 @@ function CwTableServerSide({ columns, data, totalItems, pagination = false, page
|
|
|
2709
2716
|
const dynamicClassName = typeof classNameRow === "function" ? classNameRow(item) : (classNameRow ?? "");
|
|
2710
2717
|
return (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("tr", { className: `${dynamicClassName} ${hasClassNameRow(item) ? item.classNameRow : ""} ${isSelected ? "cw-table-row-selected" : ""}`, onClick: (e) => rowSelection && handleRowClick(item, e), "data-row-key": itemKey != null ? String(itemKey) : undefined, style: {
|
|
2711
2718
|
cursor: rowSelection ? "pointer" : "default",
|
|
2712
|
-
backgroundColor: isSelected ? "var(--cw-
|
|
2719
|
+
backgroundColor: isSelected ? "var(--cw-table-row-selected-background)" : undefined,
|
|
2713
2720
|
transition: "background-color 0.2s ease",
|
|
2714
2721
|
}, children: [expandedRowRender && (jsxRuntime.jsx("td", { className: "cw-table-col-action cw-table-col-expand", children: jsxRuntime.jsx("button", { onClick: () => handleRowExpand(item), className: `cw-button-icon ${expandedRowKey === itemKey ? "cwi-chevron-down" : "cwi-chevron-right"}` }) })), columns.map((col) => (jsxRuntime.jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : col.dataIndex ? String(item[col.dataIndex] ?? "") : "" }, `${itemKey}_${col.key}`)))] }), expandedRowRender && expandedRowKey === itemKey && (jsxRuntime.jsx("tr", { className: "cw-table-row-expanded", children: jsxRuntime.jsx("td", { colSpan: getColSpan(), children: expandedRowRender(item) }) }))] }, String(itemKey)));
|
|
2715
2722
|
});
|
|
@@ -2738,7 +2745,7 @@ function CwTableServerSide({ columns, data, totalItems, pagination = false, page
|
|
|
2738
2745
|
}, min: 1, max: totalPages }), jsxRuntime.jsx("span", { children: "/" }), jsxRuntime.jsx("span", { children: totalPages }), jsxRuntime.jsx(CwButton, { onClick: () => handlePageChange(state.page + 1), disabled: state.page === totalPages || totalPages <= 1, variant: "icon", icon: "chevron-right" }), jsxRuntime.jsx(CwButton, { onClick: () => handlePageChange(totalPages), disabled: state.page === totalPages || totalPages <= 1, variant: "icon", icon: "chevron-right-double" })] })] }))] }));
|
|
2739
2746
|
}
|
|
2740
2747
|
|
|
2741
|
-
var styles$
|
|
2748
|
+
var styles$o = {"cw-tabs":"cw-tabs-module__cw-tabs__1pmji","cw-tabs-content":"cw-tabs-module__cw-tabs-content__HTp8d"};
|
|
2742
2749
|
|
|
2743
2750
|
const BADGE_COLOR_SCHEMES = ['primary', 'danger', 'warning', 'success', 'info', 'neutral'];
|
|
2744
2751
|
function isBadgeColorScheme(value) {
|
|
@@ -2792,15 +2799,16 @@ function CwTabs(CwTabsProps) {
|
|
|
2792
2799
|
const tabsListStyle = position === 'left' && CwTabsProps.tabsListWidth
|
|
2793
2800
|
? { minWidth: CwTabsProps.tabsListWidth }
|
|
2794
2801
|
: undefined;
|
|
2795
|
-
return (jsxRuntime.jsxs("div", { id: CwTabsProps.id, "data-testid": CwTabsProps.testId, className: styles$
|
|
2802
|
+
return (jsxRuntime.jsxs("div", { id: CwTabsProps.id, "data-testid": CwTabsProps.testId, className: styles$o['cw-tabs'] + (CwTabsProps.className ? ` ${CwTabsProps.className}` : "") + "", style: CwTabsProps.style, "data-tabs-position": position, children: [jsxRuntime.jsx("ul", { style: tabsListStyle, children: CwTabsProps.tabs.map(tab => {
|
|
2796
2803
|
const badgeScheme = tab.badgeColor && isBadgeColorScheme(tab.badgeColor) ? tab.badgeColor : undefined;
|
|
2797
2804
|
const rawBadgeColor = tab.badgeColor && !badgeScheme ? tab.badgeColor : undefined;
|
|
2798
2805
|
return (jsxRuntime.jsxs("li", { className: `${tab.key === activeTab ? "cw-tab-active" : ""}`, onClick: () => handleTabClick(tab), "data-active": tab.key === activeTab, "data-tab-key": tab.key, "data-badge-themed": tab.badgeColor ? "true" : undefined, children: [jsxRuntime.jsx(TabIcon, { icon: tab.icon }), tab.title, (tab.badge !== undefined || tab.badgeColor) && (jsxRuntime.jsx(CwBadge, { count: typeof tab.badge === 'number' ? tab.badge : undefined, content: typeof tab.badge === 'string' ? tab.badge : undefined, size: "medium", color: badgeScheme ?? 'primary', variant: badgeScheme ? 'solid' : 'soft', style: rawBadgeColor ? { backgroundColor: rawBadgeColor, color: getContrastColor(rawBadgeColor) } : undefined }))] }, tab.key));
|
|
2799
|
-
}) }), jsxRuntime.jsx("div", { className: styles$
|
|
2806
|
+
}) }), jsxRuntime.jsx("div", { className: styles$o['cw-tabs-content'], "data-active-tab-key": activeTab ?? undefined, style: CwTabsProps.contentHeight ? { '--tabs-height': CwTabsProps.contentHeight } : undefined, children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
|
|
2800
2807
|
}
|
|
2801
2808
|
|
|
2802
2809
|
/**
|
|
2803
|
-
* An expandable element with briefing and children displayed when clicked
|
|
2810
|
+
* An expandable element with briefing and children displayed when clicked.
|
|
2811
|
+
* Preferably avoid using it, it needs a refactor.
|
|
2804
2812
|
* @param briefing Title of the expandable
|
|
2805
2813
|
* @param onToggle Function to run when expandable is toggled open/closed
|
|
2806
2814
|
* @param onClose Function to run when expandable is closed
|
|
@@ -2823,7 +2831,7 @@ const CwExpandable = ({ briefing, onToggle, onOpen, onClose, children, ...detail
|
|
|
2823
2831
|
return (jsxRuntime.jsxs("details", { ref: myRef, ...detailsProps, className: "cw-expandable", children: [jsxRuntime.jsx("summary", { children: briefing }), children && jsxRuntime.jsx("section", { children: children })] }));
|
|
2824
2832
|
};
|
|
2825
2833
|
|
|
2826
|
-
var styles$
|
|
2834
|
+
var styles$n = {"cw-master-detail":"cw-master-detail-module__cw-master-detail__O8-FA","resizer":"cw-master-detail-module__resizer__hvGhL","detail":"cw-master-detail-module__detail__BG4Dm","skeletonRow":"cw-master-detail-module__skeletonRow__6BUgt","detailSkeleton":"cw-master-detail-module__detailSkeleton__GcDS4","detail-empty":"cw-master-detail-module__detail-empty__KFScK"};
|
|
2827
2835
|
|
|
2828
2836
|
/*
|
|
2829
2837
|
* Fixed rem widths for the ghosts: the master rows and detail panel size their
|
|
@@ -2867,12 +2875,12 @@ const CwMasterDetail = ({ id, className, style, items, selectedKey, onSelect, de
|
|
|
2867
2875
|
document.body.style.userSelect = '';
|
|
2868
2876
|
};
|
|
2869
2877
|
}, [isResizing, minMasterWidth, maxMasterWidth]);
|
|
2870
|
-
const rootClassName = [styles$
|
|
2878
|
+
const rootClassName = [styles$n['cw-master-detail'], className].filter(Boolean).join(' ');
|
|
2871
2879
|
return (jsxRuntime.jsxs("div", { id: id, ref: containerRef, className: rootClassName, style: style, "aria-busy": loading || undefined, children: [jsxRuntime.jsxs("aside", { style: { width: masterWidth, minWidth: masterWidth }, children: [showSearch && (jsxRuntime.jsx("search", { children: jsxRuntime.jsx("input", { type: "text", placeholder: searchPlaceholder, onChange: (e) => onSearch?.(e.target.value) }) })), masterHeader && (jsxRuntime.jsx("header", { children: masterHeader })), jsxRuntime.jsx("ul", { children: loading
|
|
2872
|
-
? Array.from({ length: skeletonRows }, (_unused, rowIndex) => (jsxRuntime.jsxs("li", { "aria-hidden": "true", children: [jsxRuntime.jsx(CwSkeleton, { variant: "circle", height: "2rem" }), jsxRuntime.jsxs("div", { className: styles$
|
|
2873
|
-
: items.map((item) => (jsxRuntime.jsx("li", { "data-master-key": item.key, "data-selected": item.key === selectedKey, "data-disabled": item.disabled, onClick: () => onSelect?.(item.key), children: item.content }, item.key))) }), masterFooter && (jsxRuntime.jsx("footer", { children: masterFooter }))] }), resizable && (jsxRuntime.jsx("div", { className: styles$
|
|
2880
|
+
? Array.from({ length: skeletonRows }, (_unused, rowIndex) => (jsxRuntime.jsxs("li", { "aria-hidden": "true", children: [jsxRuntime.jsx(CwSkeleton, { variant: "circle", height: "2rem" }), jsxRuntime.jsxs("div", { className: styles$n.skeletonRow, children: [jsxRuntime.jsx(CwSkeleton, { variant: "text", width: MASTER_TITLE_WIDTHS[rowIndex % MASTER_TITLE_WIDTHS.length] }), jsxRuntime.jsx(CwSkeleton, { variant: "text", width: MASTER_SUBTITLE_WIDTH })] })] }, `skeleton_${rowIndex}`)))
|
|
2881
|
+
: items.map((item) => (jsxRuntime.jsx("li", { "data-master-key": item.key, "data-selected": item.key === selectedKey, "data-disabled": item.disabled, onClick: () => onSelect?.(item.key), children: item.content }, item.key))) }), masterFooter && (jsxRuntime.jsx("footer", { children: masterFooter }))] }), resizable && (jsxRuntime.jsx("div", { className: styles$n.resizer, "data-resizing": isResizing, onMouseDown: handleMouseDown })), jsxRuntime.jsx("section", { className: styles$n.detail, children: loading ? (jsxRuntime.jsxs("div", { className: styles$n.detailSkeleton, "aria-hidden": "true", children: [jsxRuntime.jsx(CwSkeleton, { variant: "text", width: "14rem", height: "1.5em" }), jsxRuntime.jsx(CwSkeleton, { variant: "text", width: "22rem" }), jsxRuntime.jsx(CwSkeleton, { variant: "text", width: "18rem" }), jsxRuntime.jsx(CwSkeleton, { variant: "text", width: "20rem" })] })) : selectedKey && detailContent
|
|
2874
2882
|
? detailContent
|
|
2875
|
-
: (jsxRuntime.jsx("div", { className: styles$
|
|
2883
|
+
: (jsxRuntime.jsx("div", { className: styles$n['detail-empty'], children: emptyDetail ?? 'Select an item to view details' })) })] }));
|
|
2876
2884
|
};
|
|
2877
2885
|
|
|
2878
2886
|
/*
|
|
@@ -2912,7 +2920,7 @@ const CwKeyValueList = ({ items, className = "", emptyValue = "-", direction = "
|
|
|
2912
2920
|
return (jsxRuntime.jsx("dl", { className: `cw-keyvalue-list ${className}`, "data-direction": groupLayout?.direction, "data-align": groupLayout?.align, "data-justify": groupLayout?.justify, "data-gap": groupLayout?.gap, "aria-busy": loading || undefined, ...htmlProps, children: renderItems() }));
|
|
2913
2921
|
};
|
|
2914
2922
|
|
|
2915
|
-
var styles$
|
|
2923
|
+
var styles$m = {"sortableList":"cw-sortable-list-module__sortableList__PyLO-","sortableItem":"cw-sortable-list-module__sortableItem__FAnn2","readOnly":"cw-sortable-list-module__readOnly__r7GcH","dragging":"cw-sortable-list-module__dragging__MD715","moved":"cw-sortable-list-module__moved__sE6-N","expandedContent":"cw-sortable-list-module__expandedContent__Kocna","sortableHandle":"cw-sortable-list-module__sortableHandle__HvYBK","sortableContent":"cw-sortable-list-module__sortableContent__C6JhR","sortableTitle":"cw-sortable-list-module__sortableTitle__EgWXr","sortableExtraContent":"cw-sortable-list-module__sortableExtraContent__s4LSv","sortableActions":"cw-sortable-list-module__sortableActions__gwQOU","dropIndicator":"cw-sortable-list-module__dropIndicator__MNSF-","emptyMessage":"cw-sortable-list-module__emptyMessage__gMpaL"};
|
|
2916
2924
|
|
|
2917
2925
|
function CwSortableList({ items, onReorder, renderItem, className = '', movedItems = new Set(), emptyMessage = "No elements to show", readOnly = false, maxHeight = "300px", }) {
|
|
2918
2926
|
const [draggedItem, setDraggedItem] = React.useState(null);
|
|
@@ -2975,15 +2983,15 @@ function CwSortableList({ items, onReorder, renderItem, className = '', movedIte
|
|
|
2975
2983
|
}
|
|
2976
2984
|
};
|
|
2977
2985
|
if (items.length === 0) {
|
|
2978
|
-
return (jsxRuntime.jsx("div", { className: `${styles$
|
|
2986
|
+
return (jsxRuntime.jsx("div", { className: `${styles$m.sortableList} ${styles$m.emptyState} ${className}`, children: jsxRuntime.jsx("div", { className: styles$m.emptyMessage, children: emptyMessage }) }));
|
|
2979
2987
|
}
|
|
2980
|
-
return (jsxRuntime.jsx("div", { className: `${styles$
|
|
2988
|
+
return (jsxRuntime.jsx("div", { className: `${styles$m.sortableList} ${className}`, style: { maxHeight }, children: items.map((item, index) => {
|
|
2981
2989
|
const { title, extraContent, actions, showHandle = true, expandedContent } = renderItem(item);
|
|
2982
2990
|
const isDragging = draggedItem?.id === item.id;
|
|
2983
2991
|
const isMoved = movedItems.has(item.id);
|
|
2984
2992
|
const canExpand = Boolean(expandedContent);
|
|
2985
2993
|
const isExpanded = expandedItems.has(item.id);
|
|
2986
|
-
return (jsxRuntime.jsxs(React.Fragment, { children: [dropIndicatorIndex === index && jsxRuntime.jsx("div", { className: styles$
|
|
2994
|
+
return (jsxRuntime.jsxs(React.Fragment, { children: [dropIndicatorIndex === index && jsxRuntime.jsx("div", { className: styles$m.dropIndicator }), jsxRuntime.jsxs("div", { className: `${styles$m.sortableItem} ${isDragging ? styles$m.dragging : ''} ${isMoved ? styles$m.moved : ''} ${readOnly ? styles$m.readOnly : ''}`, draggable: !readOnly, onDragStart: (e) => handleDragStart(e, item), onDragOver: (e) => handleDragOver(e, index), onDragEnd: handleDragEnd, children: [jsxRuntime.jsxs("header", { children: [canExpand ? (jsxRuntime.jsx(CwButton, { variant: "icon", onClick: () => toggleExpanded(item.id), type: "button", title: isExpanded ? "Collapse" : "Expand", icon: isExpanded ? "chevron-up" : "chevron-down" })) : showHandle ? (jsxRuntime.jsx("div", { className: styles$m.sortableHandle, children: jsxRuntime.jsx(CwIcon, { iconId: "grip-dots" }) })) : null, jsxRuntime.jsxs("div", { className: styles$m.sortableContent, children: [jsxRuntime.jsx("div", { className: styles$m.sortableTitle, children: title }), extraContent && jsxRuntime.jsx("div", { className: styles$m.sortableExtraContent, children: extraContent })] }), jsxRuntime.jsx("div", { className: styles$m.sortableActions, children: actions })] }), isExpanded && expandedContent && (jsxRuntime.jsx("div", { className: styles$m.expandedContent, children: expandedContent }))] }), !readOnly && dropIndicatorIndex === items.length && index === items.length - 1 && (jsxRuntime.jsx("div", { className: styles$m.dropIndicator }))] }, item.id));
|
|
2987
2995
|
}) }));
|
|
2988
2996
|
}
|
|
2989
2997
|
|
|
@@ -3042,6 +3050,7 @@ function useSortableList(initialItems) {
|
|
|
3042
3050
|
|
|
3043
3051
|
/**
|
|
3044
3052
|
* A table with expandable row groups.
|
|
3053
|
+
* Preferably avoid using it, it needs a refactor.
|
|
3045
3054
|
* @param props The data to display
|
|
3046
3055
|
* @example
|
|
3047
3056
|
* const sampleTableData: CwTableGroupedData = {
|
|
@@ -3109,7 +3118,7 @@ const CwTableGrouped = props => {
|
|
|
3109
3118
|
group.rows.map((child, j) => (jsxRuntime.jsx("tr", { "data-row": true, "data-row-last-of-group": j == group.rows.length - 1, children: child.cells.map((cell, k) => (jsxRuntime.jsx("td", { children: cell.content }, k))) }, j)))] }, i))) }), jsxRuntime.jsx("tfoot", {})] }) }));
|
|
3110
3119
|
};
|
|
3111
3120
|
|
|
3112
|
-
var styles$
|
|
3121
|
+
var styles$l = {"fileUploadContainer":"cw-file-upload-multiple-module__fileUploadContainer__liEc1","hiddenInput":"cw-file-upload-multiple-module__hiddenInput__TZBBI","uploadArea":"cw-file-upload-multiple-module__uploadArea__DdOhs","uploadAreaDisabled":"cw-file-upload-multiple-module__uploadAreaDisabled__VWeFX","uploadTitle":"cw-file-upload-multiple-module__uploadTitle__gjRk8","uploadSubtitle":"cw-file-upload-multiple-module__uploadSubtitle__Z0S5t","filesContainer":"cw-file-upload-multiple-module__filesContainer__g44PY","fileItem":"cw-file-upload-multiple-module__fileItem__w27Dg","fileIcon":"cw-file-upload-multiple-module__fileIcon__iJJUX","fileExtension":"cw-file-upload-multiple-module__fileExtension__vOuHv","fileInfo":"cw-file-upload-multiple-module__fileInfo__R5ZTv","fileName":"cw-file-upload-multiple-module__fileName__DjepK","fileSize":"cw-file-upload-multiple-module__fileSize__b8GSm","smallButton":"cw-file-upload-multiple-module__smallButton__siUAh"};
|
|
3113
3122
|
|
|
3114
3123
|
const DEFAULT_LABELS$1 = {
|
|
3115
3124
|
uploadDisabled: 'Upload disabled',
|
|
@@ -3295,12 +3304,12 @@ function CwFileUploadMultiple(fileUploadProps) {
|
|
|
3295
3304
|
}
|
|
3296
3305
|
}
|
|
3297
3306
|
};
|
|
3298
|
-
return (jsxRuntime.jsxs("div", { className: `${styles$
|
|
3307
|
+
return (jsxRuntime.jsxs("div", { className: `${styles$l.fileUploadContainer} ${fileUploadProps.className}`, children: [jsxRuntime.jsx("input", { ref: fileInputRef, type: "file", name: fileUploadProps.name, accept: fileUploadProps.accept, multiple: fileUploadProps.multiple, onChange: handleFileSelectInternal, disabled: fileUploadProps.disabled, "aria-label": "files", className: styles$l.hiddenInput }), selectedFiles.length === 0 && !existingFile ? (jsxRuntime.jsxs("div", { className: `${styles$l.uploadArea} ${fileUploadProps.disabled ? styles$l.uploadAreaDisabled : ''}`, onDragOver: handleDragOver, onDrop: handleDrop, onClick: !fileUploadProps.disabled ? handleButtonClick : undefined, children: [jsxRuntime.jsx(CwIcon, { iconId: "upload" }), jsxRuntime.jsx("p", { className: `${styles$l.uploadTitle}`, children: fileUploadProps.disabled ? labels.uploadDisabled : labels.clickToUpload }), jsxRuntime.jsxs("p", { className: `${styles$l.uploadSubtitle}`, children: [fileUploadProps.accept ? labels.acceptedFiles(fileUploadProps.accept) : labels.allTypesAccepted, !fileUploadProps.multiple && ` ${labels.singleFileOnly}`] })] })) : selectedFiles.length === 0 && existingFile ? (jsxRuntime.jsxs("div", { className: styles$l.filesContainer, children: [jsxRuntime.jsxs("div", { className: styles$l.fileItem, children: [jsxRuntime.jsxs("div", { className: styles$l.fileIcon, children: [jsxRuntime.jsx(CwIcon, { iconId: "page" }), jsxRuntime.jsx("span", { className: styles$l.fileExtension, children: getFileExtension(existingFile) })] }), jsxRuntime.jsx("div", { className: styles$l.fileInfo, children: jsxRuntime.jsx("p", { className: styles$l.fileName, children: existingFile }) }), jsxRuntime.jsx(CwButton, { variant: "icon", icon: "close", color: "neutral", onClick: () => {
|
|
3299
3308
|
setExistingFile(undefined);
|
|
3300
3309
|
if (fileUploadProps.onSelect) {
|
|
3301
3310
|
fileUploadProps.onSelect(null);
|
|
3302
3311
|
}
|
|
3303
|
-
}, disabled: fileUploadProps.disabled, className: styles$
|
|
3312
|
+
}, disabled: fileUploadProps.disabled, className: styles$l.smallButton })] }), jsxRuntime.jsx(CwButton, { text: labels.changeFile, icon: "refresh", onClick: handleButtonClick, disabled: fileUploadProps.disabled })] })) : (jsxRuntime.jsxs("div", { className: styles$l.filesContainer, children: [jsxRuntime.jsxs("header", { className: "cw-flex-row cw-align-between-center cw-flex-wrap", children: [jsxRuntime.jsx("small", { className: styles$l.filesCount, children: fileUploadProps.statusText ?? labels.filesSelected(selectedFiles.length) }), jsxRuntime.jsxs("div", { className: "cw-flex-row", children: [fileUploadProps.onConfirm && selectedFiles.length > 0 && (jsxRuntime.jsx(CwButton, { onClick: () => {
|
|
3304
3313
|
let files = fileInputRef.current?.files ?? null;
|
|
3305
3314
|
if (!files) {
|
|
3306
3315
|
const dataTransfer = new DataTransfer();
|
|
@@ -3308,9 +3317,13 @@ function CwFileUploadMultiple(fileUploadProps) {
|
|
|
3308
3317
|
files = dataTransfer.files;
|
|
3309
3318
|
}
|
|
3310
3319
|
fileUploadProps.onConfirm?.(files);
|
|
3311
|
-
}, disabled: fileUploadProps.disabled || fileUploadProps.confirmDisabled, icon: "upload", text: fileUploadProps.confirmLabel ?? labels.upload })), !fileUploadProps.hideClearAll && (jsxRuntime.jsx(CwButton, { onClick: removeAllFiles, disabled: fileUploadProps.disabled, color: "danger", variant: "outline", icon: "delete", text: labels.clearAll }))] })] }), selectedFiles.map((file, index) => (jsxRuntime.jsxs("div", { className: styles$
|
|
3320
|
+
}, disabled: fileUploadProps.disabled || fileUploadProps.confirmDisabled, icon: "upload", text: fileUploadProps.confirmLabel ?? labels.upload })), !fileUploadProps.hideClearAll && (jsxRuntime.jsx(CwButton, { onClick: removeAllFiles, disabled: fileUploadProps.disabled, color: "danger", variant: "outline", icon: "delete", text: labels.clearAll }))] })] }), selectedFiles.map((file, index) => (jsxRuntime.jsxs("div", { className: styles$l.fileItem, children: [jsxRuntime.jsxs("div", { className: styles$l.fileIcon, children: [jsxRuntime.jsx(CwIcon, { iconId: "page" }), jsxRuntime.jsx("span", { className: styles$l.fileExtension, children: getFileExtension(file.name) })] }), jsxRuntime.jsxs("div", { className: styles$l.fileInfo, children: [jsxRuntime.jsx("p", { className: styles$l.fileName, children: file.name }), jsxRuntime.jsxs("p", { className: styles$l.fileSize, children: [(file.size / 1024).toFixed(1), " KB"] })] }), jsxRuntime.jsx(CwButton, { variant: "icon", icon: "close", color: "neutral", onClick: () => removeFile(index), className: styles$l.smallButton })] }, `${file.name}-${file.size}`))), fileUploadProps.multiple && (jsxRuntime.jsx(CwButton, { text: labels.addMoreFiles, icon: "plus", variant: "outline", onClick: handleButtonClick, disabled: fileUploadProps.disabled })), !fileUploadProps.multiple && (jsxRuntime.jsx(CwButton, { text: labels.changeFile, icon: "refresh", onClick: handleButtonClick, disabled: fileUploadProps.disabled }))] }))] }));
|
|
3312
3321
|
}
|
|
3313
3322
|
|
|
3323
|
+
/**
|
|
3324
|
+
* Legacy text input with its own label markup, predating the design system.
|
|
3325
|
+
* @deprecated Use {@link CwInputText} instead.
|
|
3326
|
+
*/
|
|
3314
3327
|
function CwInput(CwInputProps) {
|
|
3315
3328
|
const handleChange = (e) => {
|
|
3316
3329
|
CwInputProps.onChange(e.target.value);
|
|
@@ -3357,7 +3370,7 @@ function CwDigit(props) {
|
|
|
3357
3370
|
return (jsxRuntime.jsxs("div", { className: "cw-input-text", "data-direction": labelProps ? flexDirection : "column", "data-feedback-position": feedbackPosition, children: [jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsxs("div", { className: "cw-input-button", children: [jsxRuntime.jsx("input", { type: "number", ...inputProps, "aria-describedby": describedBy }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] })] }), feedbackMessages.map((feedbackItem, index) => (jsxRuntime.jsx("p", { id: feedbackIds[index], className: "cw-input-info", "data-color": feedbackItem.type, "aria-live": "polite", children: feedbackItem.message }, index)))] }));
|
|
3358
3371
|
}
|
|
3359
3372
|
|
|
3360
|
-
var styles$
|
|
3373
|
+
var styles$k = {"colorPreview":"cw-color-picker-module__colorPreview__ylJcD","hueBar":"cw-color-picker-module__hueBar__bFhyC","hueBarSlider":"cw-color-picker-module__hueBarSlider__D53IV","colorPickerInteractiveArea":"cw-color-picker-module__colorPickerInteractiveArea__KZFR1","colorArea":"cw-color-picker-module__colorArea__xgpSE","colorAreaOverlay":"cw-color-picker-module__colorAreaOverlay__pmgOc","hueBackground":"cw-color-picker-module__hueBackground__Mks78","whiteGradient":"cw-color-picker-module__whiteGradient__Bt-fU","blackGradient":"cw-color-picker-module__blackGradient__VnEKJ","colorAreaCursor":"cw-color-picker-module__colorAreaCursor__lotg3"};
|
|
3361
3374
|
|
|
3362
3375
|
const CwColorPicker = ({ initialColor, onChange, previewText = "Color preview" }) => {
|
|
3363
3376
|
const [rgb, setRgb] = React.useState({ r: 255, g: 255, b: 255 });
|
|
@@ -3560,13 +3573,13 @@ const CwColorPicker = ({ initialColor, onChange, previewText = "Color preview" }
|
|
|
3560
3573
|
// Calculate background color for the main area based on current hue
|
|
3561
3574
|
const hueColor = hsvToRgb(hsv.h, 100, 100);
|
|
3562
3575
|
const hueHex = rgbToHex(hueColor.r, hueColor.g, hueColor.b);
|
|
3563
|
-
return (jsxRuntime.jsxs("div", { className: "cw-flex-column cw-gap-small", children: [jsxRuntime.jsxs("div", { className: "cw-flex-row cw-align-between-center cw-gap-small", children: [jsxRuntime.jsx("div", { className: styles$
|
|
3576
|
+
return (jsxRuntime.jsxs("div", { className: "cw-flex-column cw-gap-small", children: [jsxRuntime.jsxs("div", { className: "cw-flex-row cw-align-between-center cw-gap-small", children: [jsxRuntime.jsx("div", { className: styles$k.colorPreview, style: { backgroundColor: hexColor, color: getContrastColor(hexColor) }, children: previewText }), jsxRuntime.jsx("button", { type: "button", className: "cw-button", onClick: toggleInputMode, style: { minWidth: "3ch" }, children: inputMode === 'hex' ? 'RGB' : 'HEX' })] }), jsxRuntime.jsx("div", { className: "color-inputs-row", children: inputMode === 'hex' ? (jsxRuntime.jsx("input", { type: "text", value: hexColor, onChange: handleHexChange })) : (jsxRuntime.jsxs("div", { className: "cw-grid-base-3 cw-gap-small", children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "R:" }), jsxRuntime.jsx("input", { type: "number", name: "r", min: "0", max: "255", value: rgb.r, onChange: handleRgbChange })] }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "G:" }), jsxRuntime.jsx("input", { type: "number", name: "g", min: "0", max: "255", value: rgb.g, onChange: handleRgbChange })] }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "B:" }), jsxRuntime.jsx("input", { type: "number", name: "b", min: "0", max: "255", value: rgb.b, onChange: handleRgbChange })] })] })) }), jsxRuntime.jsxs("div", { className: styles$k.colorPickerInteractiveArea, children: [jsxRuntime.jsx("div", { className: styles$k.hueBar, ref: hueBarRef, onClick: handleHueBarClick, children: jsxRuntime.jsx("div", { className: styles$k.hueBarSlider, style: { top: `${(360 - hsv.h) / 360 * 100}%` } }) }), jsxRuntime.jsxs("div", { className: styles$k.colorArea, ref: colorAreaRef, onClick: handleColorAreaClick, children: [jsxRuntime.jsxs("div", { className: styles$k.colorAreaOverlay, children: [jsxRuntime.jsx("div", { className: styles$k.hueBackground, style: { backgroundColor: hueHex } }), jsxRuntime.jsx("div", { className: styles$k.whiteGradient }), jsxRuntime.jsx("div", { className: styles$k.blackGradient })] }), jsxRuntime.jsx("div", { className: styles$k.colorAreaCursor, style: {
|
|
3564
3577
|
left: `${hsv.s}%`,
|
|
3565
3578
|
top: `${100 - hsv.v}%`
|
|
3566
3579
|
} })] })] })] }));
|
|
3567
3580
|
};
|
|
3568
3581
|
|
|
3569
|
-
var styles$
|
|
3582
|
+
var styles$j = {"container":"cw-input-color-module__container__x7gpk","selectColor":"cw-input-color-module__selectColor__DTo3V","disabled":"cw-input-color-module__disabled__O1fK5","readOnly":"cw-input-color-module__readOnly__HL-Bz","colorDropdown":"cw-input-color-module__colorDropdown__pX2bc"};
|
|
3570
3583
|
|
|
3571
3584
|
const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled = false, readOnly = false, width = '4rem', height = '2rem', labelProps, layoutProps, className, style, }) => {
|
|
3572
3585
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
@@ -3699,11 +3712,11 @@ const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled
|
|
|
3699
3712
|
break;
|
|
3700
3713
|
}
|
|
3701
3714
|
};
|
|
3702
|
-
return (jsxRuntime.jsxs("div", { className: `cw-input-color ${styles$
|
|
3715
|
+
return (jsxRuntime.jsxs("div", { className: `cw-input-color ${styles$j.container}${className ? ` ${className}` : ''}`, style: style, "data-direction": layoutProps?.direction ?? "row", "data-align": layoutProps?.align, children: [labelProps && (jsxRuntime.jsx(CwLabel, { ...labelProps })), jsxRuntime.jsx("div", { ref: containerRef, onClick: handleToggle, className: `${styles$j.selectColor} ${disabled ? styles$j.disabled : ''} ${readOnly ? styles$j.readOnly : ''}`, style: {
|
|
3703
3716
|
width,
|
|
3704
3717
|
height,
|
|
3705
3718
|
backgroundColor: value,
|
|
3706
|
-
}, "aria-label": "Open color picker", "aria-expanded": isOpen, "aria-haspopup": "dialog", "aria-readonly": readOnly, role: "button", tabIndex: disabled ? -1 : 0, onKeyDown: handleKeyDown }), isOpen && reactDom.createPortal(jsxRuntime.jsx("div", { ref: dropdownRef, className: styles$
|
|
3719
|
+
}, "aria-label": "Open color picker", "aria-expanded": isOpen, "aria-haspopup": "dialog", "aria-readonly": readOnly, role: "button", tabIndex: disabled ? -1 : 0, onKeyDown: handleKeyDown }), isOpen && reactDom.createPortal(jsxRuntime.jsx("div", { ref: dropdownRef, className: styles$j.colorDropdown, style: dropdownStyle, role: "dialog", "aria-modal": "true", "aria-label": "Color picker", children: jsxRuntime.jsx(CwColorPicker, { initialColor: value, onChange: handleColorChange, previewText: previewText }) }), document.body)] }));
|
|
3707
3720
|
};
|
|
3708
3721
|
|
|
3709
3722
|
/**
|
|
@@ -3719,7 +3732,6 @@ const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled
|
|
|
3719
3732
|
* @example
|
|
3720
3733
|
* ```tsx
|
|
3721
3734
|
* <CwInputText
|
|
3722
|
-
* iconProps={{ id: "home" }}
|
|
3723
3735
|
* labelProps={{ children: "Name", width: "100px" }}
|
|
3724
3736
|
* buttonProps={{ children: "Ok", onclick:()=>{alert("hi")} }}
|
|
3725
3737
|
* feedback={{ type: "danger", message: "This field is required" }}
|
|
@@ -3770,13 +3782,15 @@ function CwInputNumber(CwInputNumberProps) {
|
|
|
3770
3782
|
}
|
|
3771
3783
|
|
|
3772
3784
|
function CwTextArea(props) {
|
|
3773
|
-
const { alignProps, buttonProps, iconProps, labelProps, resize, feedback, style, ...textareaProps } = props;
|
|
3785
|
+
const { alignProps, buttonProps, iconProps, labelProps, resize, feedback, style, className, ...textareaProps } = props;
|
|
3786
|
+
// Like CwInputText: className lands on the container, not on the textarea.
|
|
3787
|
+
const containerClassName = className ? `cw-text-area ${className}` : "cw-text-area";
|
|
3774
3788
|
const feedbackMessages = feedback
|
|
3775
3789
|
? Array.isArray(feedback) ? feedback : [feedback]
|
|
3776
3790
|
: [];
|
|
3777
3791
|
const flexDirection = alignProps?.flexDirection ?? "row";
|
|
3778
3792
|
const dataDirection = { 'data-direction': flexDirection };
|
|
3779
|
-
return (jsxRuntime.jsxs("div", { className:
|
|
3793
|
+
return (jsxRuntime.jsxs("div", { className: containerClassName, ...dataDirection, style: style, children: [jsxRuntime.jsxs(CwAlign, { ...alignProps, children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsx("textarea", { ...textareaProps, itemProp: textareaProps.required === true ? "required" : "", style: { resize: resize } }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }), feedbackMessages.map((feedbackItem, index) => (jsxRuntime.jsx("p", { className: "cw-input-info", "data-color": feedbackItem.type, children: feedbackItem.message }, index)))] }));
|
|
3780
3794
|
}
|
|
3781
3795
|
|
|
3782
3796
|
/**
|
|
@@ -3892,6 +3906,10 @@ function formatPlainDate$1(pd, format) {
|
|
|
3892
3906
|
* />
|
|
3893
3907
|
* ```
|
|
3894
3908
|
*/
|
|
3909
|
+
/**
|
|
3910
|
+
* Text date input with a native picker fallback, predating the calendar pickers.
|
|
3911
|
+
* @deprecated Use {@link CwDatePickerTemporal} (or {@link CwDatePicker} at a JS Date boundary) instead.
|
|
3912
|
+
*/
|
|
3895
3913
|
function CwInputDateText(props) {
|
|
3896
3914
|
const displayFormat = "DD.MM.YYYY";
|
|
3897
3915
|
const internalFormat = "YYYY-MM-DD";
|
|
@@ -3953,7 +3971,7 @@ function CwInputDateText(props) {
|
|
|
3953
3971
|
return (jsxRuntime.jsx("div", { className: "cw-input-date-text", children: jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("input", { type: "text", disabled: disabled, maxLength: 10, onChange: onChangeInputText, pattern: "^$ --|[.0-9\\/\\-]{10}", placeholder: format.toLowerCase(), readOnly: readOnly, ref: textInputRef, required: required, size: width, tabIndex: tabIndex, value: displayedDate }), jsxRuntime.jsxs("span", { children: [jsxRuntime.jsx(CwIcon, { iconId: "calendar" }), jsxRuntime.jsx("input", { type: "date", disabled: disabled, onChange: onChangeInputDate, readOnly: readOnly, ref: dateInputRef, tabIndex: -1, value: date, ...inputProps })] })] }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }) }));
|
|
3954
3972
|
}
|
|
3955
3973
|
|
|
3956
|
-
var styles$
|
|
3974
|
+
var styles$i = {"hiddenInput":"cw-input-image-module__hiddenInput__pS7hb","dropZone":"cw-input-image-module__dropZone__ygrGu","title":"cw-input-image-module__title__Rji5M","subtitle":"cw-input-image-module__subtitle__djYYu","container":"cw-input-image-module__container__qh7Tm"};
|
|
3957
3975
|
|
|
3958
3976
|
const DEFAULT_LABELS = {
|
|
3959
3977
|
dropImageHere: "Drop image here",
|
|
@@ -4032,7 +4050,7 @@ function CwInputImage(props) {
|
|
|
4032
4050
|
const file = e.currentTarget.files?.[0];
|
|
4033
4051
|
void handleFile(file ?? null);
|
|
4034
4052
|
};
|
|
4035
|
-
return (jsxRuntime.jsxs("div", { className: `cw-input-image ${styles$
|
|
4053
|
+
return (jsxRuntime.jsxs("div", { className: `cw-input-image ${styles$i.container}`, "data-size": size, children: [jsxRuntime.jsxs("div", { onDragOver: (e) => e.preventDefault(), onDrop: handleDrop, className: styles$i.dropZone, children: [jsxRuntime.jsx(CwIcon, { iconId: "upload" }), jsxRuntime.jsxs("div", { className: "cw-flex-column cw-gap-tiny", children: [jsxRuntime.jsx("p", { className: styles$i.title, children: labels.dropImageHere }), jsxRuntime.jsx("p", { className: styles$i.subtitle, children: labels.acceptedFormats(allowedFormats.join(", ").replace(/image\//g, "")) })] })] }), jsxRuntime.jsxs("div", { className: "cw-flex-row cw-align-center-center cw-gap-small", children: [jsxRuntime.jsx(CwButton, { onClick: onPasteButtonClick, icon: "paste", text: labels.paste, size: size }), jsxRuntime.jsx(CwButton, { onClick: () => inputRef.current?.click(), icon: "folder-open", text: labels.browse, size: size })] }), jsxRuntime.jsx("input", { ref: inputRef, type: "file", accept: allowedFormats.join(","), onChange: handleFileChange, className: styles$i.hiddenInput, ...inputProps })] }));
|
|
4036
4054
|
}
|
|
4037
4055
|
|
|
4038
4056
|
/**
|
|
@@ -4164,7 +4182,7 @@ const CwImageArea = React.forwardRef((props, ref) => {
|
|
|
4164
4182
|
});
|
|
4165
4183
|
CwImageArea.displayName = "CwImageArea";
|
|
4166
4184
|
|
|
4167
|
-
var styles$
|
|
4185
|
+
var styles$h = {"container":"cw-weekday-selector-module__container__pwcvx","days":"cw-weekday-selector-module__days__Dd3RH"};
|
|
4168
4186
|
|
|
4169
4187
|
/* 2024-01-01 was a Monday. Formatted in UTC so a negative browser offset cannot shift a day. */
|
|
4170
4188
|
const MONDAY_UTC = Date.UTC(2024, 0, 1);
|
|
@@ -4362,16 +4380,16 @@ const CwWeekdaySelector = ({ value = "mtwrfsu", onChange, disabled = false, labe
|
|
|
4362
4380
|
// Points at the label element rather than copying its text, which also covers a labelProps that
|
|
4363
4381
|
// carries children instead of `text`.
|
|
4364
4382
|
const labelId = labelProps?.id ?? `${feedbackId}-label`;
|
|
4365
|
-
return (jsxRuntime.jsxs("div", { className: `cw-weekday-selector ${styles$
|
|
4383
|
+
return (jsxRuntime.jsxs("div", { className: `cw-weekday-selector ${styles$h.container}${className ? ` ${className}` : ""}`, "data-direction": labelProps ? layout?.direction ?? "row" : "column", "data-align": layout?.align, "data-gap": layout?.gap, children: [labelProps && jsxRuntime.jsx(CwLabel, { id: labelId, ...labelProps }), jsxRuntime.jsx("div", { role: "group", className: styles$h.days, "aria-labelledby": labelProps ? labelId : undefined, "aria-describedby": describedBy, children: Weekdays.getFullWeek().map(day => (jsxRuntime.jsx("input", { type: "checkbox", "data-day": day, "data-letter": dayNames[day].letter, "aria-label": dayNames[day].full, title: dayNames[day].full, checked: selectedDays.includes(day), onChange: (e) => handleChange(day, e.target.checked), disabled: disabled }, day))) }), feedbackMessages.map((feedbackItem, index) => (jsxRuntime.jsx("p", { id: feedbackIds[index], className: "cw-input-feedback", "data-color": feedbackItem.type, "aria-live": "polite", children: feedbackItem.message }, index)))] }));
|
|
4366
4384
|
};
|
|
4367
4385
|
|
|
4368
|
-
var styles$
|
|
4386
|
+
var styles$g = {"check-container":"cw-check-module__check-container__4nscZ","group":"cw-check-module__group__6JCQo","options":"cw-check-module__options__-g9LF"};
|
|
4369
4387
|
|
|
4370
4388
|
function CwCheck(props) {
|
|
4371
4389
|
const { labelProps, labelText, direction, alignment, className, ...inputProps } = props;
|
|
4372
4390
|
const resolvedDirection = direction ?? alignment ?? "row";
|
|
4373
4391
|
const displayText = labelProps?.text ?? labelText;
|
|
4374
|
-
return (jsxRuntime.jsx("div", { className: `cw-check ${styles$
|
|
4392
|
+
return (jsxRuntime.jsx("div", { className: `cw-check ${styles$g["check-container"]}${className ? ` ${className}` : ''}`, children: jsxRuntime.jsxs("label", { "data-direction": resolvedDirection, children: [jsxRuntime.jsx("input", { type: "checkbox", ...inputProps }), displayText && (jsxRuntime.jsx("span", { className: "cw-icon-text", children: displayText }))] }) }));
|
|
4375
4393
|
}
|
|
4376
4394
|
|
|
4377
4395
|
function CwCheckbox(CwCheckboxProps) {
|
|
@@ -4425,14 +4443,14 @@ function CwCheckboxGroup({ options, value = [], onChange, labelProps, groupLayou
|
|
|
4425
4443
|
?? (optionsAlignment === "column" ? "row" : "column");
|
|
4426
4444
|
// Each checkbox's box-to-text layout is the opposite of the options flow, mirroring CwRadioGroup.
|
|
4427
4445
|
const checkDirection = itemDirection === "row" ? "column" : "row";
|
|
4428
|
-
return (jsxRuntime.jsxs("div", { className: `cw-checkbox-group ${styles$
|
|
4446
|
+
return (jsxRuntime.jsxs("div", { className: `cw-checkbox-group ${styles$g.group}${className ? ` ${className}` : ""}`, "data-testid": dataTestId, "data-direction": labelProps ? groupDirection : "column", "data-align": groupLayout?.align, "data-gap": groupLayout?.gap, children: [labelProps && (jsxRuntime.jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxRuntime.jsx("div", { className: styles$g.options, role: "group", "aria-label": labelProps?.text, "aria-describedby": describedBy, "aria-required": required || undefined, "data-direction": itemDirection, "data-gap": itemLayout?.gap, children: options.map((option) => (jsxRuntime.jsx(CwCheck, { labelProps: { text: option.label }, checked: value.includes(option.value), disabled: disabled || option.disabled, direction: checkDirection, onChange: (e) => handleChange(option.value, e.currentTarget.checked) }, option.value))) }), feedbackMessages.map((feedbackItem, index) => (jsxRuntime.jsx("p", { id: feedbackIds[index], className: "cw-input-feedback", "data-color": feedbackItem.type, "aria-live": "polite", children: feedbackItem.message }, index)))] }));
|
|
4429
4447
|
}
|
|
4430
4448
|
|
|
4431
|
-
var styles$
|
|
4449
|
+
var styles$f = {"radio":"cw-radio-module__radio__5sh7a","group":"cw-radio-module__group__br-HM","options":"cw-radio-module__options__LSw7M"};
|
|
4432
4450
|
|
|
4433
4451
|
/** Single native radio input. Building block for CwRadioGroup. */
|
|
4434
4452
|
function CwRadio({ label, direction = "row", className, ...inputProps }) {
|
|
4435
|
-
return (jsxRuntime.jsxs("label", { className: `cw-radio ${styles$
|
|
4453
|
+
return (jsxRuntime.jsxs("label", { className: `cw-radio ${styles$f.radio}${className ? ` ${className}` : ""}`, "data-direction": direction, children: [jsxRuntime.jsx("input", { type: "radio", ...inputProps }), label && jsxRuntime.jsx("span", { children: label })] }));
|
|
4436
4454
|
}
|
|
4437
4455
|
|
|
4438
4456
|
/**
|
|
@@ -4459,7 +4477,7 @@ function CwRadioGroup({ options, value, onChange, labelProps, groupLayout, itemL
|
|
|
4459
4477
|
// (itemLayout column) reads best with the circle beside the text; a side-by-side row reads
|
|
4460
4478
|
// best with the circle above the text.
|
|
4461
4479
|
const radioDirection = itemLayout?.direction === "row" ? "column" : "row";
|
|
4462
|
-
return (jsxRuntime.jsxs("div", { className: `cw-radio-group ${styles$
|
|
4480
|
+
return (jsxRuntime.jsxs("div", { className: `cw-radio-group ${styles$f.group}${className ? ` ${className}` : ""}`, "data-testid": dataTestId, "data-direction": labelProps ? (groupLayout?.direction ?? "column") : "column", "data-align": groupLayout?.align, "data-gap": groupLayout?.gap, children: [labelProps && (jsxRuntime.jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxRuntime.jsx("div", { className: styles$f.options, role: "radiogroup", "aria-describedby": describedBy, "aria-labelledby": ariaLabelledby, "aria-label": ariaLabelledby ? undefined : (ariaLabel ?? labelProps?.text), "aria-required": required || undefined, "data-direction": itemLayout?.direction ?? "column", "data-gap": itemLayout?.gap, children: options.map((option) => (jsxRuntime.jsx(CwRadio, { name: groupName, label: option.label, direction: radioDirection, checked: value === option.value, required: required, disabled: disabled || option.disabled, onChange: () => onChange(option.value) }, option.value))) }), feedbackMessages.map((feedbackItem, index) => (jsxRuntime.jsx("p", { id: feedbackIds[index], className: "cw-input-feedback", "data-color": feedbackItem.type, "aria-live": "polite", children: feedbackItem.message }, index)))] }));
|
|
4463
4481
|
}
|
|
4464
4482
|
|
|
4465
4483
|
function CwToggle(props) {
|
|
@@ -4600,7 +4618,7 @@ function useDropdownPortal({ anchorRef, isOpen, onClose, positionStrategy = defa
|
|
|
4600
4618
|
return { panelRef, panelStyle: style, renderPanel };
|
|
4601
4619
|
}
|
|
4602
4620
|
|
|
4603
|
-
var
|
|
4621
|
+
var styles$e = {"dropdown":"cw-dropdown-module__dropdown__EFZ9M cw-choice-dropdown-module__dropdown__P0b4j","option":"cw-dropdown-module__option__TuMdI cw-choice-dropdown-module__option__uR-ro","optionFocused":"cw-dropdown-module__optionFocused__7LGaC cw-choice-dropdown-module__optionFocused__BYMxj","optionSelected":"cw-dropdown-module__optionSelected__OiXIc cw-choice-dropdown-module__optionSelected__Lt8Xg","optionDisabled":"cw-dropdown-module__optionDisabled__lYM6w cw-choice-dropdown-module__optionDisabled__n3scM","emptyState":"cw-dropdown-module__emptyState__gp8KT cw-choice-dropdown-module__emptyState__HO0Y7","searchBox":"cw-dropdown-module__searchBox__Bx0JE cw-choice-dropdown-module__searchBox__0gox7","searchInput":"cw-dropdown-module__searchInput__JrxCK cw-choice-dropdown-module__searchInput__G5oRs","value":"cw-dropdown-module__value__i-7IN","colorCircle":"cw-dropdown-module__colorCircle__5kgiT cw-choice-dropdown-module__colorCircle__x7mI9"};
|
|
4604
4622
|
|
|
4605
4623
|
/**
|
|
4606
4624
|
* Custom dropdown component with colour-coded options, optional search filter, and full
|
|
@@ -4714,14 +4732,18 @@ function CwDropdown({ options, value, onChange, labelProps, alignProps, placehol
|
|
|
4714
4732
|
}
|
|
4715
4733
|
}, [isOpen, highlightedIndex, filteredOptions, handleOptionSelect]);
|
|
4716
4734
|
const flexDirection = alignProps?.flexDirection ?? "row";
|
|
4717
|
-
return (jsxRuntime.jsx("div", { ref: containerRef, className: `cw-dropdown${className ? ` ${className}` : ""}`, "data-direction": flexDirection, style: style, ...otherProps, children: jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && jsxRuntime.jsx(CwLabel, { id: labelId, ...labelProps }), jsxRuntime.jsxs("div", { className:
|
|
4718
|
-
|
|
4719
|
-
value === option.value ?
|
|
4720
|
-
highlightedIndex === index ?
|
|
4721
|
-
option.disabled ?
|
|
4722
|
-
].filter(Boolean).join(" "), onClick: () => !option.disabled && handleOptionSelect(option.value), onMouseEnter: () => setHighlightedIndex(index), role: "option", "aria-selected": value === option.value, "aria-disabled": option.disabled, children: [option.color && (jsxRuntime.jsx("span", { className:
|
|
4735
|
+
return (jsxRuntime.jsx("div", { ref: containerRef, className: `cw-dropdown${className ? ` ${className}` : ""}`, "data-direction": flexDirection, style: style, ...otherProps, children: jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && jsxRuntime.jsx(CwLabel, { id: labelId, ...labelProps }), jsxRuntime.jsxs("div", { className: styles$e.value, children: [jsxRuntime.jsxs("div", { className: "cw-dropdown-wrapper", ref: wrapperRef, children: [jsxRuntime.jsxs("button", { type: "button", className: "cw-dropdown-trigger", onClick: handleTriggerClick, onKeyDown: handleKeyDown, disabled: disabled, "aria-haspopup": "listbox", "aria-expanded": isOpen, "aria-labelledby": labelProps ? `${labelId} ${valueId}` : undefined, "aria-label": labelProps ? undefined : (selectedOption?.label || placeholder), "aria-describedby": describedBy, children: [jsxRuntime.jsx("div", { className: "cw-dropdown-trigger-content", id: valueId, children: selectedOption ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [selectedOption.color && (jsxRuntime.jsx("span", { className: styles$e.colorCircle, style: { backgroundColor: selectedOption.color } })), jsxRuntime.jsx("span", { children: selectedOption.label })] })) : (jsxRuntime.jsx("span", { className: "cw-dropdown-placeholder", children: placeholder })) }), jsxRuntime.jsx(CwIcon, { iconId: "chevron-down", size: "small" })] }), renderPanel(jsxRuntime.jsxs("div", { ref: panelRef, className: styles$e.dropdown, style: panelStyle, role: "listbox", onKeyDown: handleKeyDown, children: [allowSearch && (jsxRuntime.jsx("div", { className: styles$e.searchBox, children: jsxRuntime.jsx("input", { ref: inputRef, type: "text", placeholder: "Search...", value: searchText, onChange: handleSearchChange, onKeyDown: handleKeyDown, className: styles$e.searchInput, autoComplete: "off" }) })), jsxRuntime.jsx("ul", { children: filteredOptions.length > 0 ? (filteredOptions.map((option, index) => (jsxRuntime.jsxs("li", { ref: highlightedIndex === index ? highlightedItemRef : null, className: [
|
|
4736
|
+
styles$e.option,
|
|
4737
|
+
value === option.value ? styles$e.optionSelected : "",
|
|
4738
|
+
highlightedIndex === index ? styles$e.optionFocused : "",
|
|
4739
|
+
option.disabled ? styles$e.optionDisabled : "",
|
|
4740
|
+
].filter(Boolean).join(" "), onClick: () => !option.disabled && handleOptionSelect(option.value), onMouseEnter: () => setHighlightedIndex(index), role: "option", "aria-selected": value === option.value, "aria-disabled": option.disabled, children: [option.color && (jsxRuntime.jsx("span", { className: styles$e.colorCircle, style: { backgroundColor: option.color } })), jsxRuntime.jsx("span", { children: option.label })] }, option.value)))) : (jsxRuntime.jsx("li", { className: styles$e.emptyState, children: "No options available" })) })] }))] }), feedbackMessages.map((item, index) => (jsxRuntime.jsx("p", { id: feedbackIds[index], className: "cw-input-feedback", "data-color": item.type, "aria-live": "polite", children: item.message }, index)))] })] }) }));
|
|
4723
4741
|
}
|
|
4724
4742
|
|
|
4743
|
+
/**
|
|
4744
|
+
* Legacy action menu with a fixed item shape and caller-owned open state.
|
|
4745
|
+
* @deprecated Use {@link CwPopoverButton} with your own content instead.
|
|
4746
|
+
*/
|
|
4725
4747
|
function CwDropdownFilter(props) {
|
|
4726
4748
|
// Determine visibility state
|
|
4727
4749
|
const isVisible = props.DropDownFilterState ?? false;
|
|
@@ -5050,8 +5072,8 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, placeh
|
|
|
5050
5072
|
}
|
|
5051
5073
|
else {
|
|
5052
5074
|
return {
|
|
5053
|
-
onPrimary: "var(--cw-
|
|
5054
|
-
primary: "var(--cw-
|
|
5075
|
+
onPrimary: "var(--cw-text-on-primary)",
|
|
5076
|
+
primary: "var(--cw-accent-primary)"
|
|
5055
5077
|
};
|
|
5056
5078
|
}
|
|
5057
5079
|
};
|
|
@@ -5088,7 +5110,7 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, placeh
|
|
|
5088
5110
|
};
|
|
5089
5111
|
return (jsxRuntime.jsxs("form", { ref: componentRef, id: id, "data-testid": testId, className: `${styles$b["cw-multi-filter"]}${className ? ` ${className}` : ""}`, style: style, onSubmit: (e) => {
|
|
5090
5112
|
e.preventDefault();
|
|
5091
|
-
}, children: [jsxRuntime.jsxs("div", { onClick: handleDivClick, ref: wrapperRef, className: styles$b["cw-multi-filter-search"], style: isPanelOpen ? { outline: "1px solid var(--cw-
|
|
5113
|
+
}, children: [jsxRuntime.jsxs("div", { onClick: handleDivClick, ref: wrapperRef, className: styles$b["cw-multi-filter-search"], style: isPanelOpen ? { outline: "1px solid var(--cw-outline-variant)" } : {}, children: [jsxRuntime.jsxs("ul", { id: id + "_selected_filters", children: [Array.from(selectedTags).map(tag => (React.createElement(CwMultiFilterTag, { ...tag, key: tag.ID, Selectable: false, Removable: true, OnRemove: () => removeTag(tag.ID) }))), jsxRuntime.jsx("input", { type: "text", id: id + "_input", ref: inputRef, value: inputTextValue, spellCheck: false, onFocus: () => setIsPanelOpen(true), onChange: e => handleInputText(e.currentTarget.value), autoComplete: "off", placeholder: selectedTags.size === 0 ? placeholder : "", onKeyDown: e => {
|
|
5092
5114
|
switch (e.key) {
|
|
5093
5115
|
case "Enter":
|
|
5094
5116
|
case "Tab": {
|
|
@@ -5475,6 +5497,8 @@ function CwNavMenu({ items, loading = false, isActive, renderLink = defaultRende
|
|
|
5475
5497
|
: visibleItems.map(item => renderItem(item, 1)) }), showEmptyMessage && jsxRuntime.jsx("p", { className: styles$8.emptyMessage, children: emptyMessage })] }));
|
|
5476
5498
|
}
|
|
5477
5499
|
|
|
5500
|
+
var dropdownStyles = {"dropdown":"cw-choice-dropdown-module__dropdown__P0b4j","option":"cw-choice-dropdown-module__option__uR-ro","optionFocused":"cw-choice-dropdown-module__optionFocused__BYMxj"};
|
|
5501
|
+
|
|
5478
5502
|
/**
|
|
5479
5503
|
* Pure keyboard-navigation resolver shared by the `CwSearchInput` combobox.
|
|
5480
5504
|
* Kept side-effect-free so the arrow/home/end/enter/escape behaviour can be unit
|
|
@@ -9859,8 +9883,8 @@ const Scheduler = (props) => {
|
|
|
9859
9883
|
timeLinePercentage: timeLinePercentage,
|
|
9860
9884
|
isUtc: isUtc
|
|
9861
9885
|
};
|
|
9862
|
-
const evenColor = "var(--cw-
|
|
9863
|
-
const oddColor = "var(--cw-
|
|
9886
|
+
const evenColor = "var(--cw-surface-neutral-low)";
|
|
9887
|
+
const oddColor = "var(--cw-surface-neutral-medium)";
|
|
9864
9888
|
const weekendsLines = React.useMemo(() => getWeekendLinesByDatesVisible(selectedDate, visibleDays), [selectedDate, visibleDays]);
|
|
9865
9889
|
const divisionLines = React.useMemo(() => getLinesByDivisions(divisions), [divisions, visibleDays]);
|
|
9866
9890
|
// Timeline percentage calculation
|