@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.es.js
CHANGED
|
@@ -7,7 +7,6 @@ import Draggable from 'react-draggable';
|
|
|
7
7
|
import { format } from 'date-fns';
|
|
8
8
|
import { enGB } from 'date-fns/locale';
|
|
9
9
|
import { DayPicker } from 'react-day-picker';
|
|
10
|
-
import 'react-day-picker/dist/style.css';
|
|
11
10
|
import { VariableSizeList } from 'react-window';
|
|
12
11
|
|
|
13
12
|
class CwSelectList {
|
|
@@ -161,7 +160,7 @@ function getContrastColor(color) {
|
|
|
161
160
|
return `hsl(${hsl.h}, ${contrastS}%, ${targetL}%)`;
|
|
162
161
|
}
|
|
163
162
|
|
|
164
|
-
var styles$
|
|
163
|
+
var styles$z = {"cw-tooltip-content":"cw-tooltip-module__cw-tooltip-content__RZczd","cw-tooltip":"cw-tooltip-module__cw-tooltip__1KYig"};
|
|
165
164
|
|
|
166
165
|
// Constants
|
|
167
166
|
const margin$1 = 16;
|
|
@@ -451,7 +450,7 @@ const CwTooltipManager = () => {
|
|
|
451
450
|
if (!state.isVisible || !state.content) {
|
|
452
451
|
return null;
|
|
453
452
|
}
|
|
454
|
-
return createPortal(jsx("div", { ref: tooltipRef, className: styles$
|
|
453
|
+
return createPortal(jsx("div", { ref: tooltipRef, className: styles$z["cw-tooltip-content"], "data-position": actualPosition, "data-visible": state.isVisible, "data-inline": state.displayInline, style: {
|
|
455
454
|
top: `${tooltipPosition.top}px`,
|
|
456
455
|
left: `${tooltipPosition.left}px`,
|
|
457
456
|
opacity: (isPositioned && !isMeasuring) ? 1 : 0,
|
|
@@ -532,7 +531,7 @@ const CwTooltipNew = ({ children, content = null, position = "right", dissapears
|
|
|
532
531
|
useEffect(() => {
|
|
533
532
|
ensureTooltipManager();
|
|
534
533
|
}, []);
|
|
535
|
-
return (jsx("div", { ref: containerRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, className: styles$
|
|
534
|
+
return (jsx("div", { ref: containerRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, className: styles$z["cw-tooltip"], children: children }));
|
|
536
535
|
};
|
|
537
536
|
|
|
538
537
|
const SVG_ICONS = {
|
|
@@ -652,7 +651,7 @@ function resolveBadgeAria(label, loading, hasText) {
|
|
|
652
651
|
return hasText ? {} : { 'aria-hidden': 'true' };
|
|
653
652
|
}
|
|
654
653
|
|
|
655
|
-
var styles$
|
|
654
|
+
var styles$y = {"badge":"cw-badge-module__badge__PKlak"};
|
|
656
655
|
|
|
657
656
|
/**
|
|
658
657
|
* CwBadge - the small coloured circle with a number, used for alert and notification counts.
|
|
@@ -681,7 +680,7 @@ const CwBadge = ({ count, content, color = 'info', variant = 'solid', size = 'sm
|
|
|
681
680
|
? formatBadgeCount(count, max)
|
|
682
681
|
: undefined;
|
|
683
682
|
const isDot = !loading && !hasContent && count === undefined;
|
|
684
|
-
const badgeClassNames = ['cw-badge', styles$
|
|
683
|
+
const badgeClassNames = ['cw-badge', styles$y.badge, className].filter(Boolean).join(' ');
|
|
685
684
|
return (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 ? jsx(CwIcon, { iconId: "spinner", size: "small" }) : hasContent ? content : countText }));
|
|
686
685
|
};
|
|
687
686
|
|
|
@@ -1069,7 +1068,7 @@ function CwLoading({ isLoading = false, text = '', size = 'regular', iconPositio
|
|
|
1069
1068
|
return (jsxs("div", { "aria-busy": isLoading, className: "cw-loading-container", "data-children": !!children, children: [overlay, jsx("div", { className: "cw-loading-disabled-content", children: children })] }));
|
|
1070
1069
|
}
|
|
1071
1070
|
|
|
1072
|
-
var styles$
|
|
1071
|
+
var styles$x = {"skeleton":"cw-skeleton-module__skeleton__Jvx2x","group":"cw-skeleton-module__group__Cm8AU"};
|
|
1073
1072
|
|
|
1074
1073
|
/*
|
|
1075
1074
|
* Internal helper for skeleton allocations (CwSkeleton, tables, cards).
|
|
@@ -1111,8 +1110,8 @@ function CwSkeleton({ variant = 'text', width, height, count = 1, radius, gap })
|
|
|
1111
1110
|
};
|
|
1112
1111
|
// The un-hashed cw-skeleton / cw-skeleton-group classes carry no styles in the
|
|
1113
1112
|
// library - they are stable public hooks for exceptional external overrides.
|
|
1114
|
-
const skeletonClassName = ['cw-skeleton', styles$
|
|
1115
|
-
const groupClassName = ['cw-skeleton-group', styles$
|
|
1113
|
+
const skeletonClassName = ['cw-skeleton', styles$x.skeleton].filter(Boolean).join(' ');
|
|
1114
|
+
const groupClassName = ['cw-skeleton-group', styles$x.group].filter(Boolean).join(' ');
|
|
1116
1115
|
const lineCount = normalizeSkeletonCount(count, 1);
|
|
1117
1116
|
if (lineCount <= 1) {
|
|
1118
1117
|
return (jsx("span", { className: skeletonClassName, "data-variant": variant, "aria-hidden": "true", style: style }));
|
|
@@ -1124,7 +1123,7 @@ function CwSkeleton({ variant = 'text', width, height, count = 1, radius, gap })
|
|
|
1124
1123
|
return (jsx("span", { className: groupClassName, "aria-hidden": "true", style: groupStyle, children: skeletonElements }));
|
|
1125
1124
|
}
|
|
1126
1125
|
|
|
1127
|
-
var styles$
|
|
1126
|
+
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"};
|
|
1128
1127
|
|
|
1129
1128
|
/**
|
|
1130
1129
|
* CwProgress - a determinate or indeterminate progress bar.
|
|
@@ -1148,17 +1147,17 @@ function CwProgress({ value, indeterminate = false, label, rightLabel, size = 'r
|
|
|
1148
1147
|
const valueText = rightLabel ?? (percent !== undefined ? `${percent}%` : '');
|
|
1149
1148
|
// The un-hashed cw-progress class carries no styles in the library - a stable
|
|
1150
1149
|
// public hook for exceptional external overrides only.
|
|
1151
|
-
const rootClassName = ['cw-progress', styles$
|
|
1152
|
-
const labelSpan = label ? jsx("span", { className: styles$
|
|
1153
|
-
const valueLabel = showValue ? (jsx("span", { className: styles$
|
|
1154
|
-
return (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) && (jsxs("header", { className: styles$
|
|
1150
|
+
const rootClassName = ['cw-progress', styles$w.progress, className].filter(Boolean).join(' ');
|
|
1151
|
+
const labelSpan = label ? jsx("span", { className: styles$w.label, id: labelId, children: label }) : null;
|
|
1152
|
+
const valueLabel = showValue ? (jsx("span", { className: styles$w.value, "data-mono": monoValue || undefined, children: valueText })) : null;
|
|
1153
|
+
return (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) && (jsxs("header", { className: styles$w.header, children: [labelSpan, valueLabel] })), layout === 'row' && labelSpan, jsx("div", { className: styles$w.track, role: "progressbar", ...(label && { 'aria-labelledby': labelId }), ...(!indeterminate && percent !== undefined && {
|
|
1155
1154
|
'aria-valuenow': percent,
|
|
1156
1155
|
'aria-valuemin': 0,
|
|
1157
1156
|
'aria-valuemax': 100
|
|
1158
|
-
}), children: jsx("div", { className: styles$
|
|
1157
|
+
}), children: jsx("div", { className: styles$w.fill, style: !indeterminate && clamped !== undefined ? { width: `${clamped}%` } : undefined }) }), layout === 'row' && valueLabel] }));
|
|
1159
1158
|
}
|
|
1160
1159
|
|
|
1161
|
-
var styles$
|
|
1160
|
+
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"};
|
|
1162
1161
|
|
|
1163
1162
|
// Constants moved outside to prevent recreation
|
|
1164
1163
|
const margin = 16;
|
|
@@ -1275,18 +1274,22 @@ const useTooltipPosition = (isVisible, containerRef, preferredPosition, tooltipC
|
|
|
1275
1274
|
*
|
|
1276
1275
|
* @see CwTooltipNew
|
|
1277
1276
|
*/
|
|
1277
|
+
/**
|
|
1278
|
+
* Portal-per-instance tooltip.
|
|
1279
|
+
* @deprecated Use {@link CwTooltipNew}: same API, one shared portal for every tooltip on the page.
|
|
1280
|
+
*/
|
|
1278
1281
|
const CwGenericTooltip = ({ children, content = null, position = defaultPosition, dissapearsWhenHover = false, hide = false, overlayStyle = {}, showDelay = 0, displayInline = false, }) => {
|
|
1279
1282
|
const [isVisible, setIsVisible] = useState(false);
|
|
1280
1283
|
const containerRef = useRef(null);
|
|
1281
1284
|
const { setTooltipTimeout, clearTooltipTimeout } = useTooltipDelay(() => {
|
|
1282
1285
|
setIsVisible(true);
|
|
1283
1286
|
}, showDelay);
|
|
1284
|
-
const { position: tooltipPosition, actualPosition } = useTooltipPosition(isVisible, containerRef, position, styles$
|
|
1287
|
+
const { position: tooltipPosition, actualPosition } = useTooltipPosition(isVisible, containerRef, position, styles$v["cw-generic-tooltip-content"]);
|
|
1285
1288
|
// Memoize tooltip content creation
|
|
1286
1289
|
const tooltipContent = useMemo(() => {
|
|
1287
1290
|
if (hide || !isVisible || !content)
|
|
1288
1291
|
return null;
|
|
1289
|
-
return createPortal(jsx("div", { className: styles$
|
|
1292
|
+
return createPortal(jsx("div", { className: styles$v["cw-generic-tooltip-content"], "data-position": actualPosition, "data-visible": isVisible, "data-inline": displayInline, style: {
|
|
1290
1293
|
position: 'fixed',
|
|
1291
1294
|
top: `${tooltipPosition.top}px`,
|
|
1292
1295
|
left: `${tooltipPosition.left}px`,
|
|
@@ -1301,7 +1304,7 @@ const CwGenericTooltip = ({ children, content = null, position = defaultPosition
|
|
|
1301
1304
|
clearTooltipTimeout();
|
|
1302
1305
|
setIsVisible(false);
|
|
1303
1306
|
}, [clearTooltipTimeout]);
|
|
1304
|
-
return (jsxs("div", { ref: containerRef, className: styles$
|
|
1307
|
+
return (jsxs("div", { ref: containerRef, className: styles$v["cw-generic-tooltip"], onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, children: [tooltipContent, children] }));
|
|
1305
1308
|
};
|
|
1306
1309
|
|
|
1307
1310
|
const CwButton = React__default.forwardRef(function CwButton({ text, variant = 'solid', color = 'primary', size = 'medium', iconPosition = 'left', pressed, className = '', icon = "", title, tooltipPosition = "bottom", badge, children, ...buttonProps }, ref) {
|
|
@@ -1369,8 +1372,13 @@ function CwModal(custModalProps) {
|
|
|
1369
1372
|
return (jsx("div", { children: custModalProps.modalState && (jsxs("div", { className: custModalProps.classNameModalOverlay + " cwelltModalOverlay", children: [jsx("div", { className: "cwelltModalOverlayBg", onClick: custModalProps.onCloseModal }), jsx(Draggable, { disabled: isModalDisabled, axis: "both", nodeRef: draggableRef, children: jsxs("div", { className: custModalProps.classNameModal + " cwelltContainerModal", ref: draggableRef, style: widthModalDef !== "40em" ? modalStyle.widthCustomStyle : modalStyle.widthDefStyle, children: [jsxs("div", { className: "cwelltModalHeader", onMouseOver: cwelltOnMouseOverModal, onMouseOut: cwelltOnMouseOutModal, children: [jsx("div", { className: "cwelltModalTitle", children: custModalProps.titleModal }), jsx("button", { className: "cwelltBtnCloseModal", onClick: custModalProps.onCloseModal, children: jsx("span", { className: "cwelltCloseIcon" }) })] }), jsx("div", { className: "cwelltModalBody", children: jsx("div", { className: "cwelltContainerModalBody", style: { position: "relative" }, children: custModalProps.children }) }), isHide === false ? (jsx("footer", { className: "legacy-modal-footer", onMouseOver: cwelltOnMouseOverModal, onMouseOut: cwelltOnMouseOutModal, children: jsx(CwButton, { variant: "icon", icon: "save", title: "Save", onClick: custModalProps.onSaveModal, form: custModalProps.formSaveModal, hidden: custModalProps.HideBtnModal, type: custModalProps.HtmlSubmitModal }) })) : (jsx("div", { style: { display: "none" } }))] }) })] })) }));
|
|
1370
1373
|
}
|
|
1371
1374
|
|
|
1372
|
-
var styles$
|
|
1375
|
+
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"};
|
|
1373
1376
|
|
|
1377
|
+
/**
|
|
1378
|
+
* Small anchored confirmation for a destructive action.
|
|
1379
|
+
*
|
|
1380
|
+
* Preferably avoid using it, it needs a refactor.
|
|
1381
|
+
*/
|
|
1374
1382
|
function CwConfirmationPopup(props) {
|
|
1375
1383
|
const { isOpen, onConfirm, onCancel, message = "Are you sure you want to proceed?", confirmText = "Confirm", cancelText = "Cancel", placement = 'bottom', children } = props;
|
|
1376
1384
|
const triggerRef = useRef(null);
|
|
@@ -1433,15 +1441,15 @@ function CwConfirmationPopup(props) {
|
|
|
1433
1441
|
onCancel();
|
|
1434
1442
|
}
|
|
1435
1443
|
};
|
|
1436
|
-
return (jsxs(Fragment, { children: [renderChildren(), isOpen && (jsx("div", { className: styles$
|
|
1444
|
+
return (jsxs(Fragment, { children: [renderChildren(), isOpen && (jsx("div", { className: styles$u.overlayPositioned, onClick: handleOverlayClick, children: jsxs("div", { ref: popupRef, className: styles$u.popup, style: {
|
|
1437
1445
|
position: 'absolute',
|
|
1438
1446
|
top: `${position.top}px`,
|
|
1439
1447
|
left: `${position.left}px`,
|
|
1440
1448
|
transform: 'none'
|
|
1441
|
-
}, children: [jsx("p", { className: styles$
|
|
1449
|
+
}, children: [jsx("p", { className: styles$u.message, children: message }), jsxs("div", { className: styles$u.buttons, children: [jsx("button", { className: `${styles$u.button} ${styles$u.confirmButton}`, onClick: onConfirm, children: confirmText }), jsx("button", { className: `${styles$u.button} ${styles$u.cancelButton}`, onClick: onCancel, children: cancelText })] })] }) }))] }));
|
|
1442
1450
|
}
|
|
1443
1451
|
|
|
1444
|
-
var styles$
|
|
1452
|
+
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"};
|
|
1445
1453
|
|
|
1446
1454
|
// Helper function to parse size values
|
|
1447
1455
|
const parseSize = (size) => {
|
|
@@ -1714,7 +1722,7 @@ const CwDialog = props => {
|
|
|
1714
1722
|
}
|
|
1715
1723
|
}
|
|
1716
1724
|
}, [open]);
|
|
1717
|
-
const header = useMemo(() => (jsxs("header", { onMouseDown: handleMouseDown, children: [jsx("span", { children: headline }), customHeader || (jsx("button", { className: styles$
|
|
1725
|
+
const header = useMemo(() => (jsxs("header", { onMouseDown: handleMouseDown, children: [jsx("span", { children: headline }), customHeader || (jsx("button", { className: styles$t["cw-dialog-button-close"], onClick: onClose }))] })), [handleMouseDown, headline, customHeader, onClose]);
|
|
1718
1726
|
const content = useMemo(() => (jsx("section", { children: children })), [children]);
|
|
1719
1727
|
const footer = useMemo(() => (jsx("footer", { children: customFooter || (jsx(CwButton, { variant: "icon", icon: "save", title: "Save", onClick: onSave, tooltipPosition: "top", disabled: disableSave, "data-testid": "cw-dialog-save" })) })), [customFooter, onSave, disableSave]);
|
|
1720
1728
|
const resizeHandles = useMemo(() => size.autoHeight
|
|
@@ -1741,7 +1749,7 @@ const CwDialog = props => {
|
|
|
1741
1749
|
: `${convertFromPx(size.height, size.heightUnit)}${size.heightUnit}`;
|
|
1742
1750
|
return { displayWidth, displayHeight };
|
|
1743
1751
|
}, [size.width, size.height, size.widthUnit, size.heightUnit, size.autoHeight]);
|
|
1744
|
-
const dialogContent = (jsx("div", { "data-has-scrim": hasScrim, className: styles$
|
|
1752
|
+
const dialogContent = (jsx("div", { "data-has-scrim": hasScrim, className: styles$t["cw-dialog-main"], onMouseDown: handleScrimMouseDown, onMouseUp: handleScrimMouseUpOrLeave, onMouseLeave: handleScrimMouseUpOrLeave, "data-pressing": isPressingScrim, children: jsxs("dialog", { ...domProps, ref: dialogRef, style: {
|
|
1745
1753
|
left: `${position.x}px`,
|
|
1746
1754
|
top: `${position.y}px`,
|
|
1747
1755
|
width: displayDimensions.displayWidth,
|
|
@@ -1794,7 +1802,8 @@ class CwReportModal extends React.Component {
|
|
|
1794
1802
|
}
|
|
1795
1803
|
|
|
1796
1804
|
/**
|
|
1797
|
-
* A modal that appears when an element is hovered
|
|
1805
|
+
* A modal that appears when an element is hovered.
|
|
1806
|
+
* Preferably avoid using it, it needs a refactor.
|
|
1798
1807
|
* @param children Contents of the modal
|
|
1799
1808
|
* @param hovereable Element to hover to display the modal
|
|
1800
1809
|
* @param onFirstOpened Function to run only once when the modal opens for the first time
|
|
@@ -1902,7 +1911,7 @@ function CwAlign(props) {
|
|
|
1902
1911
|
}, children: props.children }));
|
|
1903
1912
|
}
|
|
1904
1913
|
|
|
1905
|
-
var styles$
|
|
1914
|
+
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"};
|
|
1906
1915
|
|
|
1907
1916
|
/**
|
|
1908
1917
|
* CwCard - A simple card component for displaying content in a contained format
|
|
@@ -1928,10 +1937,10 @@ const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, o
|
|
|
1928
1937
|
// Construct class names using CSS modules
|
|
1929
1938
|
const cardClassNames = [
|
|
1930
1939
|
'cw-card',
|
|
1931
|
-
styles$
|
|
1940
|
+
styles$s.card,
|
|
1932
1941
|
className,
|
|
1933
|
-
clickable ? styles$
|
|
1934
|
-
disabled ? styles$
|
|
1942
|
+
clickable ? styles$s.clickable : '',
|
|
1943
|
+
disabled ? styles$s.disabled : '',
|
|
1935
1944
|
].filter(Boolean).join(' ');
|
|
1936
1945
|
// Handle click event when card is clickable
|
|
1937
1946
|
const handleClick = () => {
|
|
@@ -1949,15 +1958,15 @@ const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, o
|
|
|
1949
1958
|
const hasFooter = hasChips || footer || (hasActions && resolvedDirection === "row");
|
|
1950
1959
|
// Actions component to reuse. While loading, each provided action renders a circular
|
|
1951
1960
|
// ghost sized to the CwButton icon footprint (2rem) - no interactive buttons.
|
|
1952
|
-
const ActionsComponent = hasActions && !disabled ? (jsx("div", { className: styles$
|
|
1961
|
+
const ActionsComponent = hasActions && !disabled ? (jsx("div", { className: styles$s.actions, children: isLoading ? (jsxs(Fragment, { children: [extraActions && jsx(CwSkeleton, { variant: "circle", height: "2rem" }), onEdit && jsx(CwSkeleton, { variant: "circle", height: "2rem" }), onDelete && jsx(CwSkeleton, { variant: "circle", height: "2rem" })] })) : (jsxs(Fragment, { children: [extraActions ?? null, onEdit && jsx(CwButton, { variant: "icon", icon: "edit", onClick: onEdit }), onDelete && jsx(CwButton, { variant: "icon", icon: "delete", color: "danger", onClick: onDelete })] })) })) : null;
|
|
1953
1962
|
return (jsxs("div", { ...(id && { id }), className: cardClassNames, ...(style && { style }), ...(clickable && !isLoading && {
|
|
1954
1963
|
role: 'button',
|
|
1955
1964
|
tabIndex: 0,
|
|
1956
1965
|
onClick: handleClick,
|
|
1957
|
-
}), "data-variant": variant, "data-direction": resolvedDirection, "aria-busy": isLoading || undefined, children: [isLoading ? (jsxs("header", { children: [jsx("div", { className: styles$
|
|
1966
|
+
}), "data-variant": variant, "data-direction": resolvedDirection, "aria-busy": isLoading || undefined, children: [isLoading ? (jsxs("header", { children: [jsx("div", { className: styles$s.headerContent, "data-align": resolvedAlign, children: jsx(CwSkeleton, { width: "8rem", height: "1.5em" }) }), resolvedDirection === "column" && ActionsComponent] })) : (hasHeader && (jsxs("header", { children: [(title || subtitle) && (jsxs("div", { className: styles$s.headerContent, "data-align": resolvedAlign, children: [title && jsx("h5", { children: title }), subtitle && jsx("strong", { children: subtitle })] })), resolvedDirection === "column" && ActionsComponent] }))), jsx("div", { className: styles$s.content, children: isLoading ? jsx(CwSkeleton, { count: normalizeSkeletonCount(skeletonLines, 3) }) : children }), hasFooter && (isLoading ? (jsx("footer", { children: jsx("div", { className: styles$s.footerTags, children: jsx(CwSkeleton, { variant: "rect", width: "4rem", height: "1.5em", radius: "1rem" }) }) })) : (jsxs("footer", { children: [hasChips && (jsx("div", { className: styles$s.footerTags, children: chips.map((chip, index) => (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 && (jsx("div", { className: styles$s.footerContent, children: footer }))] }))), resolvedDirection === "row" && ActionsComponent] }));
|
|
1958
1967
|
};
|
|
1959
1968
|
|
|
1960
|
-
var styles$
|
|
1969
|
+
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"};
|
|
1961
1970
|
|
|
1962
1971
|
/**
|
|
1963
1972
|
* Option to display in the CwSelect
|
|
@@ -2052,16 +2061,14 @@ function CwCardList({ items, renderCard, pageSize = 10, layout = 'grid', default
|
|
|
2052
2061
|
icon: sortDirection === 'asc' ? 'arrow-up' : 'arrow-down',
|
|
2053
2062
|
onClick: () => setSortDirection(prev => prev === 'asc' ? 'desc' : 'asc'),
|
|
2054
2063
|
title: `Sort ${sortDirection === 'asc' ? 'descending' : 'ascending'}`,
|
|
2055
|
-
}, value: sortKey, onChange: (e) => handleSortChange(e.target.value), children: sortOptions.map(option => (jsx(CwOption, { value: option.key, children: option.label }, option.key))) }) })), isLoading ? (jsx("div", { className: `${styles$
|
|
2064
|
+
}, value: sortKey, onChange: (e) => handleSortChange(e.target.value), children: sortOptions.map(option => (jsx(CwOption, { value: option.key, children: option.label }, option.key))) }) })), isLoading ? (jsx("div", { className: `${styles$r.cardContainer}`, "data-layout": layout, style: gridStyle, "aria-busy": true, children: Array.from({ length: normalizeSkeletonCount(skeletonCards, 6) }, (_, index) => (jsx(CwCard, { isLoading: true, children: null }, `skeleton_${index}`))) })) : sortedItems.length === 0 ? (jsx("div", { className: styles$r.emptyState, children: emptyState || jsx("p", { children: "No items to display" }) })) : (jsxs(Fragment, { children: [jsx("div", { className: `${styles$r.cardContainer}`, "data-layout": layout, style: gridStyle, children: visibleItems.map((item, index) => (jsx(React__default.Fragment, { children: renderCard(item, index) }, keyExtractor ? keyExtractor(item, index) : index))) }), totalPages > 1 && (jsxs("div", { className: styles$r.pagination, children: [jsx(CwButton, { variant: "icon", icon: "chevron-left", disabled: currentPage === 1, onClick: () => setCurrentPage(p => Math.max(1, p - 1)) }), jsxs("span", { className: styles$r.pageInfo, children: [currentPage, " / ", totalPages] }), jsx(CwButton, { variant: "icon", icon: "chevron-right", disabled: currentPage === totalPages, onClick: () => setCurrentPage(p => Math.min(totalPages, p + 1)) })] }))] }))] }));
|
|
2056
2065
|
}
|
|
2057
2066
|
|
|
2058
|
-
var styles$
|
|
2067
|
+
var styles$q = {"cw-accordion":"cw-accordion-module__cw-accordion__ErvlW","cw-accordion-body":"cw-accordion-module__cw-accordion-body__xlI8b"};
|
|
2059
2068
|
|
|
2060
2069
|
/**
|
|
2061
|
-
*
|
|
2062
|
-
* @
|
|
2063
|
-
* @remarks Previously CwAccordionContainer
|
|
2064
|
-
* @returns
|
|
2070
|
+
* Legacy collapsible section with its own header markup.
|
|
2071
|
+
* @deprecated Use {@link CwExpandable} instead.
|
|
2065
2072
|
*/
|
|
2066
2073
|
function CwAccordionContainer(CwelltAccordionContainerProps) {
|
|
2067
2074
|
// #region Hooks
|
|
@@ -2072,7 +2079,7 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
|
|
|
2072
2079
|
setVisible_accordionBody(!isVisible_accordionBody);
|
|
2073
2080
|
};
|
|
2074
2081
|
// #endregion
|
|
2075
|
-
return (jsxs("div", { className: styles$
|
|
2082
|
+
return (jsxs("div", { className: styles$q["cw-accordion"], style: CwelltAccordionContainerProps.style, "data-open": isVisible_accordionBody, children: [jsxs("header", { onClick: () => showAccordionBody(), children: [jsx("div", { children: CwelltAccordionContainerProps.desc_text }), jsx("button", { className: "cw-button-icon" })] }), jsx("div", { className: styles$q["cw-accordion-body"], children: CwelltAccordionContainerProps.children })] }));
|
|
2076
2083
|
}
|
|
2077
2084
|
|
|
2078
2085
|
/*
|
|
@@ -2314,7 +2321,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
2314
2321
|
: classNameRow ?? "";
|
|
2315
2322
|
return (jsxs(React__default.Fragment, { children: [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: {
|
|
2316
2323
|
cursor: rowSelection ? "pointer" : "default",
|
|
2317
|
-
backgroundColor: isSelected ? "var(--cw-
|
|
2324
|
+
backgroundColor: isSelected ? "var(--cw-table-row-selected-background)" : undefined,
|
|
2318
2325
|
transition: "background-color 0.2s ease",
|
|
2319
2326
|
}, children: [expandedRowRender && (jsx("td", { className: "cw-table-col-action cw-table-col-expand", children: jsx("button", { onClick: () => handleRowExpand(item), className: `cw-button-icon ${expandedRowKey === itemKey
|
|
2320
2327
|
? "cwi-chevron-down"
|
|
@@ -2347,7 +2354,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
2347
2354
|
}, min: 1, max: totalPages }), jsx("span", { children: "/" }), jsx("span", { children: totalPages }), jsx(CwButton, { onClick: () => handlePageChange(currentPage + 1), disabled: currentPage === totalPages || totalPages <= 1, variant: "icon", icon: "chevron-right" }), jsx(CwButton, { onClick: () => handlePageChange(totalPages), disabled: currentPage === totalPages || totalPages <= 1, variant: "icon", icon: "chevron-right-double" })] })] }))] }));
|
|
2348
2355
|
}
|
|
2349
2356
|
|
|
2350
|
-
var styles$
|
|
2357
|
+
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"};
|
|
2351
2358
|
|
|
2352
2359
|
/**
|
|
2353
2360
|
* Hook that provides state management for CwSortableTable.
|
|
@@ -2410,7 +2417,7 @@ function useSortableTable(initialItems) {
|
|
|
2410
2417
|
}
|
|
2411
2418
|
|
|
2412
2419
|
// ─── Drop indicator row ───────────────────────────────────────────────────────
|
|
2413
|
-
const DropIndicatorRow = ({ colSpan }) => (jsx("tr", { className: styles$
|
|
2420
|
+
const DropIndicatorRow = ({ colSpan }) => (jsx("tr", { className: styles$p.dropIndicator, "aria-hidden": true, children: jsx("td", { colSpan: colSpan, children: jsx("div", {}) }) }));
|
|
2414
2421
|
// ─── Loading skeleton ─────────────────────────────────────────────────────────
|
|
2415
2422
|
// Plain td cells (no local class): the ghost cells get the same global cw-table
|
|
2416
2423
|
// padding as real body cells, so row heights match the loaded rows exactly.
|
|
@@ -2513,11 +2520,11 @@ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = f
|
|
|
2513
2520
|
return items.map((item, index) => {
|
|
2514
2521
|
const key = item[rowKey];
|
|
2515
2522
|
const isDragging = draggedItem?.[rowKey] === key;
|
|
2516
|
-
return (jsxs(React__default.Fragment, { children: [dropIndicatorIndex === index && (jsx(DropIndicatorRow, { colSpan: totalCols })), jsxs("tr", { draggable: true, onDragStart: (e) => handleDragStart(e, item), onDragOver: (e) => handleDragOver(e, index), onDragEnd: handleDragEnd, className: isDragging ? styles$
|
|
2523
|
+
return (jsxs(React__default.Fragment, { children: [dropIndicatorIndex === index && (jsx(DropIndicatorRow, { colSpan: totalCols })), jsxs("tr", { draggable: true, onDragStart: (e) => handleDragStart(e, item), onDragOver: (e) => handleDragOver(e, index), onDragEnd: handleDragEnd, className: isDragging ? styles$p.dragging : "", children: [showHandle && (jsx("td", { className: "cw-table-col-action", children: jsx(CwIcon, { iconId: "grip-dots", color: "neutral", style: { opacity: 0.75 } }) })), columns.map(col => (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 && (jsx(DropIndicatorRow, { colSpan: totalCols }))] }, String(key)));
|
|
2517
2524
|
});
|
|
2518
2525
|
};
|
|
2519
2526
|
// ── Render ──────────────────────────────────────────────────────────────
|
|
2520
|
-
return (jsxs("div", { className: `cw-table-container ${className ?? ""}`, style: containerStyle, "aria-busy": loading || undefined, children: [jsxs("table", { className: `cw-table cw-sortable-table ${tableClassName ?? ""}`, style: { width: "100%" }, children: [jsx("thead", { children: jsxs("tr", { children: [showHandle && jsx("th", { className: "cw-table-col-action" }), columns.map(col => (jsx("th", { className: col.className ?? "", style: col.width ? { width: col.width, minWidth: 50 } : undefined, children: col.title }, col.key)))] }) }), jsx("tbody", { children: renderBody() })] }), !loading && hasChanges && (jsxs("footer", { className: styles$
|
|
2527
|
+
return (jsxs("div", { className: `cw-table-container ${className ?? ""}`, style: containerStyle, "aria-busy": loading || undefined, children: [jsxs("table", { className: `cw-table cw-sortable-table ${tableClassName ?? ""}`, style: { width: "100%" }, children: [jsx("thead", { children: jsxs("tr", { children: [showHandle && jsx("th", { className: "cw-table-col-action" }), columns.map(col => (jsx("th", { className: col.className ?? "", style: col.width ? { width: col.width, minWidth: 50 } : undefined, children: col.title }, col.key)))] }) }), jsx("tbody", { children: renderBody() })] }), !loading && hasChanges && (jsxs("footer", { className: styles$p.saveBar, children: [jsx(CwButton, { variant: "outline", color: "neutral", icon: "undo", text: discardLabel, onClick: handleDiscard }), jsx(CwButton, { variant: "solid", color: "primary", icon: "save", text: saveLabel, onClick: () => handleSave(onReorder) })] }))] }));
|
|
2521
2528
|
}
|
|
2522
2529
|
|
|
2523
2530
|
/**
|
|
@@ -2689,7 +2696,7 @@ function CwTableServerSide({ columns, data, totalItems, pagination = false, page
|
|
|
2689
2696
|
const dynamicClassName = typeof classNameRow === "function" ? classNameRow(item) : (classNameRow ?? "");
|
|
2690
2697
|
return (jsxs(React__default.Fragment, { children: [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: {
|
|
2691
2698
|
cursor: rowSelection ? "pointer" : "default",
|
|
2692
|
-
backgroundColor: isSelected ? "var(--cw-
|
|
2699
|
+
backgroundColor: isSelected ? "var(--cw-table-row-selected-background)" : undefined,
|
|
2693
2700
|
transition: "background-color 0.2s ease",
|
|
2694
2701
|
}, children: [expandedRowRender && (jsx("td", { className: "cw-table-col-action cw-table-col-expand", children: jsx("button", { onClick: () => handleRowExpand(item), className: `cw-button-icon ${expandedRowKey === itemKey ? "cwi-chevron-down" : "cwi-chevron-right"}` }) })), columns.map((col) => (jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : col.dataIndex ? String(item[col.dataIndex] ?? "") : "" }, `${itemKey}_${col.key}`)))] }), expandedRowRender && expandedRowKey === itemKey && (jsx("tr", { className: "cw-table-row-expanded", children: jsx("td", { colSpan: getColSpan(), children: expandedRowRender(item) }) }))] }, String(itemKey)));
|
|
2695
2702
|
});
|
|
@@ -2718,7 +2725,7 @@ function CwTableServerSide({ columns, data, totalItems, pagination = false, page
|
|
|
2718
2725
|
}, min: 1, max: totalPages }), jsx("span", { children: "/" }), jsx("span", { children: totalPages }), jsx(CwButton, { onClick: () => handlePageChange(state.page + 1), disabled: state.page === totalPages || totalPages <= 1, variant: "icon", icon: "chevron-right" }), jsx(CwButton, { onClick: () => handlePageChange(totalPages), disabled: state.page === totalPages || totalPages <= 1, variant: "icon", icon: "chevron-right-double" })] })] }))] }));
|
|
2719
2726
|
}
|
|
2720
2727
|
|
|
2721
|
-
var styles$
|
|
2728
|
+
var styles$o = {"cw-tabs":"cw-tabs-module__cw-tabs__1pmji","cw-tabs-content":"cw-tabs-module__cw-tabs-content__HTp8d"};
|
|
2722
2729
|
|
|
2723
2730
|
const BADGE_COLOR_SCHEMES = ['primary', 'danger', 'warning', 'success', 'info', 'neutral'];
|
|
2724
2731
|
function isBadgeColorScheme(value) {
|
|
@@ -2772,15 +2779,16 @@ function CwTabs(CwTabsProps) {
|
|
|
2772
2779
|
const tabsListStyle = position === 'left' && CwTabsProps.tabsListWidth
|
|
2773
2780
|
? { minWidth: CwTabsProps.tabsListWidth }
|
|
2774
2781
|
: undefined;
|
|
2775
|
-
return (jsxs("div", { id: CwTabsProps.id, "data-testid": CwTabsProps.testId, className: styles$
|
|
2782
|
+
return (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: [jsx("ul", { style: tabsListStyle, children: CwTabsProps.tabs.map(tab => {
|
|
2776
2783
|
const badgeScheme = tab.badgeColor && isBadgeColorScheme(tab.badgeColor) ? tab.badgeColor : undefined;
|
|
2777
2784
|
const rawBadgeColor = tab.badgeColor && !badgeScheme ? tab.badgeColor : undefined;
|
|
2778
2785
|
return (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: [jsx(TabIcon, { icon: tab.icon }), tab.title, (tab.badge !== undefined || tab.badgeColor) && (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));
|
|
2779
|
-
}) }), jsx("div", { className: styles$
|
|
2786
|
+
}) }), 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 })] }));
|
|
2780
2787
|
}
|
|
2781
2788
|
|
|
2782
2789
|
/**
|
|
2783
|
-
* An expandable element with briefing and children displayed when clicked
|
|
2790
|
+
* An expandable element with briefing and children displayed when clicked.
|
|
2791
|
+
* Preferably avoid using it, it needs a refactor.
|
|
2784
2792
|
* @param briefing Title of the expandable
|
|
2785
2793
|
* @param onToggle Function to run when expandable is toggled open/closed
|
|
2786
2794
|
* @param onClose Function to run when expandable is closed
|
|
@@ -2803,7 +2811,7 @@ const CwExpandable = ({ briefing, onToggle, onOpen, onClose, children, ...detail
|
|
|
2803
2811
|
return (jsxs("details", { ref: myRef, ...detailsProps, className: "cw-expandable", children: [jsx("summary", { children: briefing }), children && jsx("section", { children: children })] }));
|
|
2804
2812
|
};
|
|
2805
2813
|
|
|
2806
|
-
var styles$
|
|
2814
|
+
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"};
|
|
2807
2815
|
|
|
2808
2816
|
/*
|
|
2809
2817
|
* Fixed rem widths for the ghosts: the master rows and detail panel size their
|
|
@@ -2847,12 +2855,12 @@ const CwMasterDetail = ({ id, className, style, items, selectedKey, onSelect, de
|
|
|
2847
2855
|
document.body.style.userSelect = '';
|
|
2848
2856
|
};
|
|
2849
2857
|
}, [isResizing, minMasterWidth, maxMasterWidth]);
|
|
2850
|
-
const rootClassName = [styles$
|
|
2858
|
+
const rootClassName = [styles$n['cw-master-detail'], className].filter(Boolean).join(' ');
|
|
2851
2859
|
return (jsxs("div", { id: id, ref: containerRef, className: rootClassName, style: style, "aria-busy": loading || undefined, children: [jsxs("aside", { style: { width: masterWidth, minWidth: masterWidth }, children: [showSearch && (jsx("search", { children: jsx("input", { type: "text", placeholder: searchPlaceholder, onChange: (e) => onSearch?.(e.target.value) }) })), masterHeader && (jsx("header", { children: masterHeader })), jsx("ul", { children: loading
|
|
2852
|
-
? Array.from({ length: skeletonRows }, (_unused, rowIndex) => (jsxs("li", { "aria-hidden": "true", children: [jsx(CwSkeleton, { variant: "circle", height: "2rem" }), jsxs("div", { className: styles$
|
|
2853
|
-
: items.map((item) => (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 && (jsx("footer", { children: masterFooter }))] }), resizable && (jsx("div", { className: styles$
|
|
2860
|
+
? Array.from({ length: skeletonRows }, (_unused, rowIndex) => (jsxs("li", { "aria-hidden": "true", children: [jsx(CwSkeleton, { variant: "circle", height: "2rem" }), jsxs("div", { className: styles$n.skeletonRow, children: [jsx(CwSkeleton, { variant: "text", width: MASTER_TITLE_WIDTHS[rowIndex % MASTER_TITLE_WIDTHS.length] }), jsx(CwSkeleton, { variant: "text", width: MASTER_SUBTITLE_WIDTH })] })] }, `skeleton_${rowIndex}`)))
|
|
2861
|
+
: items.map((item) => (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 && (jsx("footer", { children: masterFooter }))] }), resizable && (jsx("div", { className: styles$n.resizer, "data-resizing": isResizing, onMouseDown: handleMouseDown })), jsx("section", { className: styles$n.detail, children: loading ? (jsxs("div", { className: styles$n.detailSkeleton, "aria-hidden": "true", children: [jsx(CwSkeleton, { variant: "text", width: "14rem", height: "1.5em" }), jsx(CwSkeleton, { variant: "text", width: "22rem" }), jsx(CwSkeleton, { variant: "text", width: "18rem" }), jsx(CwSkeleton, { variant: "text", width: "20rem" })] })) : selectedKey && detailContent
|
|
2854
2862
|
? detailContent
|
|
2855
|
-
: (jsx("div", { className: styles$
|
|
2863
|
+
: (jsx("div", { className: styles$n['detail-empty'], children: emptyDetail ?? 'Select an item to view details' })) })] }));
|
|
2856
2864
|
};
|
|
2857
2865
|
|
|
2858
2866
|
/*
|
|
@@ -2892,7 +2900,7 @@ const CwKeyValueList = ({ items, className = "", emptyValue = "-", direction = "
|
|
|
2892
2900
|
return (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() }));
|
|
2893
2901
|
};
|
|
2894
2902
|
|
|
2895
|
-
var styles$
|
|
2903
|
+
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"};
|
|
2896
2904
|
|
|
2897
2905
|
function CwSortableList({ items, onReorder, renderItem, className = '', movedItems = new Set(), emptyMessage = "No elements to show", readOnly = false, maxHeight = "300px", }) {
|
|
2898
2906
|
const [draggedItem, setDraggedItem] = useState(null);
|
|
@@ -2955,15 +2963,15 @@ function CwSortableList({ items, onReorder, renderItem, className = '', movedIte
|
|
|
2955
2963
|
}
|
|
2956
2964
|
};
|
|
2957
2965
|
if (items.length === 0) {
|
|
2958
|
-
return (jsx("div", { className: `${styles$
|
|
2966
|
+
return (jsx("div", { className: `${styles$m.sortableList} ${styles$m.emptyState} ${className}`, children: jsx("div", { className: styles$m.emptyMessage, children: emptyMessage }) }));
|
|
2959
2967
|
}
|
|
2960
|
-
return (jsx("div", { className: `${styles$
|
|
2968
|
+
return (jsx("div", { className: `${styles$m.sortableList} ${className}`, style: { maxHeight }, children: items.map((item, index) => {
|
|
2961
2969
|
const { title, extraContent, actions, showHandle = true, expandedContent } = renderItem(item);
|
|
2962
2970
|
const isDragging = draggedItem?.id === item.id;
|
|
2963
2971
|
const isMoved = movedItems.has(item.id);
|
|
2964
2972
|
const canExpand = Boolean(expandedContent);
|
|
2965
2973
|
const isExpanded = expandedItems.has(item.id);
|
|
2966
|
-
return (jsxs(React__default.Fragment, { children: [dropIndicatorIndex === index && jsx("div", { className: styles$
|
|
2974
|
+
return (jsxs(React__default.Fragment, { children: [dropIndicatorIndex === index && jsx("div", { className: styles$m.dropIndicator }), 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: [jsxs("header", { children: [canExpand ? (jsx(CwButton, { variant: "icon", onClick: () => toggleExpanded(item.id), type: "button", title: isExpanded ? "Collapse" : "Expand", icon: isExpanded ? "chevron-up" : "chevron-down" })) : showHandle ? (jsx("div", { className: styles$m.sortableHandle, children: jsx(CwIcon, { iconId: "grip-dots" }) })) : null, jsxs("div", { className: styles$m.sortableContent, children: [jsx("div", { className: styles$m.sortableTitle, children: title }), extraContent && jsx("div", { className: styles$m.sortableExtraContent, children: extraContent })] }), jsx("div", { className: styles$m.sortableActions, children: actions })] }), isExpanded && expandedContent && (jsx("div", { className: styles$m.expandedContent, children: expandedContent }))] }), !readOnly && dropIndicatorIndex === items.length && index === items.length - 1 && (jsx("div", { className: styles$m.dropIndicator }))] }, item.id));
|
|
2967
2975
|
}) }));
|
|
2968
2976
|
}
|
|
2969
2977
|
|
|
@@ -3022,6 +3030,7 @@ function useSortableList(initialItems) {
|
|
|
3022
3030
|
|
|
3023
3031
|
/**
|
|
3024
3032
|
* A table with expandable row groups.
|
|
3033
|
+
* Preferably avoid using it, it needs a refactor.
|
|
3025
3034
|
* @param props The data to display
|
|
3026
3035
|
* @example
|
|
3027
3036
|
* const sampleTableData: CwTableGroupedData = {
|
|
@@ -3089,7 +3098,7 @@ const CwTableGrouped = props => {
|
|
|
3089
3098
|
group.rows.map((child, j) => (jsx("tr", { "data-row": true, "data-row-last-of-group": j == group.rows.length - 1, children: child.cells.map((cell, k) => (jsx("td", { children: cell.content }, k))) }, j)))] }, i))) }), jsx("tfoot", {})] }) }));
|
|
3090
3099
|
};
|
|
3091
3100
|
|
|
3092
|
-
var styles$
|
|
3101
|
+
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"};
|
|
3093
3102
|
|
|
3094
3103
|
const DEFAULT_LABELS$1 = {
|
|
3095
3104
|
uploadDisabled: 'Upload disabled',
|
|
@@ -3275,12 +3284,12 @@ function CwFileUploadMultiple(fileUploadProps) {
|
|
|
3275
3284
|
}
|
|
3276
3285
|
}
|
|
3277
3286
|
};
|
|
3278
|
-
return (jsxs("div", { className: `${styles$
|
|
3287
|
+
return (jsxs("div", { className: `${styles$l.fileUploadContainer} ${fileUploadProps.className}`, children: [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 ? (jsxs("div", { className: `${styles$l.uploadArea} ${fileUploadProps.disabled ? styles$l.uploadAreaDisabled : ''}`, onDragOver: handleDragOver, onDrop: handleDrop, onClick: !fileUploadProps.disabled ? handleButtonClick : undefined, children: [jsx(CwIcon, { iconId: "upload" }), jsx("p", { className: `${styles$l.uploadTitle}`, children: fileUploadProps.disabled ? labels.uploadDisabled : labels.clickToUpload }), jsxs("p", { className: `${styles$l.uploadSubtitle}`, children: [fileUploadProps.accept ? labels.acceptedFiles(fileUploadProps.accept) : labels.allTypesAccepted, !fileUploadProps.multiple && ` ${labels.singleFileOnly}`] })] })) : selectedFiles.length === 0 && existingFile ? (jsxs("div", { className: styles$l.filesContainer, children: [jsxs("div", { className: styles$l.fileItem, children: [jsxs("div", { className: styles$l.fileIcon, children: [jsx(CwIcon, { iconId: "page" }), jsx("span", { className: styles$l.fileExtension, children: getFileExtension(existingFile) })] }), jsx("div", { className: styles$l.fileInfo, children: jsx("p", { className: styles$l.fileName, children: existingFile }) }), jsx(CwButton, { variant: "icon", icon: "close", color: "neutral", onClick: () => {
|
|
3279
3288
|
setExistingFile(undefined);
|
|
3280
3289
|
if (fileUploadProps.onSelect) {
|
|
3281
3290
|
fileUploadProps.onSelect(null);
|
|
3282
3291
|
}
|
|
3283
|
-
}, disabled: fileUploadProps.disabled, className: styles$
|
|
3292
|
+
}, disabled: fileUploadProps.disabled, className: styles$l.smallButton })] }), jsx(CwButton, { text: labels.changeFile, icon: "refresh", onClick: handleButtonClick, disabled: fileUploadProps.disabled })] })) : (jsxs("div", { className: styles$l.filesContainer, children: [jsxs("header", { className: "cw-flex-row cw-align-between-center cw-flex-wrap", children: [jsx("small", { className: styles$l.filesCount, children: fileUploadProps.statusText ?? labels.filesSelected(selectedFiles.length) }), jsxs("div", { className: "cw-flex-row", children: [fileUploadProps.onConfirm && selectedFiles.length > 0 && (jsx(CwButton, { onClick: () => {
|
|
3284
3293
|
let files = fileInputRef.current?.files ?? null;
|
|
3285
3294
|
if (!files) {
|
|
3286
3295
|
const dataTransfer = new DataTransfer();
|
|
@@ -3288,9 +3297,13 @@ function CwFileUploadMultiple(fileUploadProps) {
|
|
|
3288
3297
|
files = dataTransfer.files;
|
|
3289
3298
|
}
|
|
3290
3299
|
fileUploadProps.onConfirm?.(files);
|
|
3291
|
-
}, disabled: fileUploadProps.disabled || fileUploadProps.confirmDisabled, icon: "upload", text: fileUploadProps.confirmLabel ?? labels.upload })), !fileUploadProps.hideClearAll && (jsx(CwButton, { onClick: removeAllFiles, disabled: fileUploadProps.disabled, color: "danger", variant: "outline", icon: "delete", text: labels.clearAll }))] })] }), selectedFiles.map((file, index) => (jsxs("div", { className: styles$
|
|
3300
|
+
}, disabled: fileUploadProps.disabled || fileUploadProps.confirmDisabled, icon: "upload", text: fileUploadProps.confirmLabel ?? labels.upload })), !fileUploadProps.hideClearAll && (jsx(CwButton, { onClick: removeAllFiles, disabled: fileUploadProps.disabled, color: "danger", variant: "outline", icon: "delete", text: labels.clearAll }))] })] }), selectedFiles.map((file, index) => (jsxs("div", { className: styles$l.fileItem, children: [jsxs("div", { className: styles$l.fileIcon, children: [jsx(CwIcon, { iconId: "page" }), jsx("span", { className: styles$l.fileExtension, children: getFileExtension(file.name) })] }), jsxs("div", { className: styles$l.fileInfo, children: [jsx("p", { className: styles$l.fileName, children: file.name }), jsxs("p", { className: styles$l.fileSize, children: [(file.size / 1024).toFixed(1), " KB"] })] }), jsx(CwButton, { variant: "icon", icon: "close", color: "neutral", onClick: () => removeFile(index), className: styles$l.smallButton })] }, `${file.name}-${file.size}`))), fileUploadProps.multiple && (jsx(CwButton, { text: labels.addMoreFiles, icon: "plus", variant: "outline", onClick: handleButtonClick, disabled: fileUploadProps.disabled })), !fileUploadProps.multiple && (jsx(CwButton, { text: labels.changeFile, icon: "refresh", onClick: handleButtonClick, disabled: fileUploadProps.disabled }))] }))] }));
|
|
3292
3301
|
}
|
|
3293
3302
|
|
|
3303
|
+
/**
|
|
3304
|
+
* Legacy text input with its own label markup, predating the design system.
|
|
3305
|
+
* @deprecated Use {@link CwInputText} instead.
|
|
3306
|
+
*/
|
|
3294
3307
|
function CwInput(CwInputProps) {
|
|
3295
3308
|
const handleChange = (e) => {
|
|
3296
3309
|
CwInputProps.onChange(e.target.value);
|
|
@@ -3337,7 +3350,7 @@ function CwDigit(props) {
|
|
|
3337
3350
|
return (jsxs("div", { className: "cw-input-text", "data-direction": labelProps ? flexDirection : "column", "data-feedback-position": feedbackPosition, children: [jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxs("div", { className: "cw-input-button", children: [jsx("input", { type: "number", ...inputProps, "aria-describedby": describedBy }), buttonProps && jsx(CwButton, { ...buttonProps })] })] }), feedbackMessages.map((feedbackItem, index) => (jsx("p", { id: feedbackIds[index], className: "cw-input-info", "data-color": feedbackItem.type, "aria-live": "polite", children: feedbackItem.message }, index)))] }));
|
|
3338
3351
|
}
|
|
3339
3352
|
|
|
3340
|
-
var styles$
|
|
3353
|
+
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"};
|
|
3341
3354
|
|
|
3342
3355
|
const CwColorPicker = ({ initialColor, onChange, previewText = "Color preview" }) => {
|
|
3343
3356
|
const [rgb, setRgb] = useState({ r: 255, g: 255, b: 255 });
|
|
@@ -3540,13 +3553,13 @@ const CwColorPicker = ({ initialColor, onChange, previewText = "Color preview" }
|
|
|
3540
3553
|
// Calculate background color for the main area based on current hue
|
|
3541
3554
|
const hueColor = hsvToRgb(hsv.h, 100, 100);
|
|
3542
3555
|
const hueHex = rgbToHex(hueColor.r, hueColor.g, hueColor.b);
|
|
3543
|
-
return (jsxs("div", { className: "cw-flex-column cw-gap-small", children: [jsxs("div", { className: "cw-flex-row cw-align-between-center cw-gap-small", children: [jsx("div", { className: styles$
|
|
3556
|
+
return (jsxs("div", { className: "cw-flex-column cw-gap-small", children: [jsxs("div", { className: "cw-flex-row cw-align-between-center cw-gap-small", children: [jsx("div", { className: styles$k.colorPreview, style: { backgroundColor: hexColor, color: getContrastColor(hexColor) }, children: previewText }), jsx("button", { type: "button", className: "cw-button", onClick: toggleInputMode, style: { minWidth: "3ch" }, children: inputMode === 'hex' ? 'RGB' : 'HEX' })] }), jsx("div", { className: "color-inputs-row", children: inputMode === 'hex' ? (jsx("input", { type: "text", value: hexColor, onChange: handleHexChange })) : (jsxs("div", { className: "cw-grid-base-3 cw-gap-small", children: [jsxs("div", { children: [jsx("label", { children: "R:" }), jsx("input", { type: "number", name: "r", min: "0", max: "255", value: rgb.r, onChange: handleRgbChange })] }), jsxs("div", { children: [jsx("label", { children: "G:" }), jsx("input", { type: "number", name: "g", min: "0", max: "255", value: rgb.g, onChange: handleRgbChange })] }), jsxs("div", { children: [jsx("label", { children: "B:" }), jsx("input", { type: "number", name: "b", min: "0", max: "255", value: rgb.b, onChange: handleRgbChange })] })] })) }), jsxs("div", { className: styles$k.colorPickerInteractiveArea, children: [jsx("div", { className: styles$k.hueBar, ref: hueBarRef, onClick: handleHueBarClick, children: jsx("div", { className: styles$k.hueBarSlider, style: { top: `${(360 - hsv.h) / 360 * 100}%` } }) }), jsxs("div", { className: styles$k.colorArea, ref: colorAreaRef, onClick: handleColorAreaClick, children: [jsxs("div", { className: styles$k.colorAreaOverlay, children: [jsx("div", { className: styles$k.hueBackground, style: { backgroundColor: hueHex } }), jsx("div", { className: styles$k.whiteGradient }), jsx("div", { className: styles$k.blackGradient })] }), jsx("div", { className: styles$k.colorAreaCursor, style: {
|
|
3544
3557
|
left: `${hsv.s}%`,
|
|
3545
3558
|
top: `${100 - hsv.v}%`
|
|
3546
3559
|
} })] })] })] }));
|
|
3547
3560
|
};
|
|
3548
3561
|
|
|
3549
|
-
var styles$
|
|
3562
|
+
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"};
|
|
3550
3563
|
|
|
3551
3564
|
const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled = false, readOnly = false, width = '4rem', height = '2rem', labelProps, layoutProps, className, style, }) => {
|
|
3552
3565
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -3679,11 +3692,11 @@ const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled
|
|
|
3679
3692
|
break;
|
|
3680
3693
|
}
|
|
3681
3694
|
};
|
|
3682
|
-
return (jsxs("div", { className: `cw-input-color ${styles$
|
|
3695
|
+
return (jsxs("div", { className: `cw-input-color ${styles$j.container}${className ? ` ${className}` : ''}`, style: style, "data-direction": layoutProps?.direction ?? "row", "data-align": layoutProps?.align, children: [labelProps && (jsx(CwLabel, { ...labelProps })), jsx("div", { ref: containerRef, onClick: handleToggle, className: `${styles$j.selectColor} ${disabled ? styles$j.disabled : ''} ${readOnly ? styles$j.readOnly : ''}`, style: {
|
|
3683
3696
|
width,
|
|
3684
3697
|
height,
|
|
3685
3698
|
backgroundColor: value,
|
|
3686
|
-
}, "aria-label": "Open color picker", "aria-expanded": isOpen, "aria-haspopup": "dialog", "aria-readonly": readOnly, role: "button", tabIndex: disabled ? -1 : 0, onKeyDown: handleKeyDown }), isOpen && createPortal(jsx("div", { ref: dropdownRef, className: styles$
|
|
3699
|
+
}, "aria-label": "Open color picker", "aria-expanded": isOpen, "aria-haspopup": "dialog", "aria-readonly": readOnly, role: "button", tabIndex: disabled ? -1 : 0, onKeyDown: handleKeyDown }), isOpen && createPortal(jsx("div", { ref: dropdownRef, className: styles$j.colorDropdown, style: dropdownStyle, role: "dialog", "aria-modal": "true", "aria-label": "Color picker", children: jsx(CwColorPicker, { initialColor: value, onChange: handleColorChange, previewText: previewText }) }), document.body)] }));
|
|
3687
3700
|
};
|
|
3688
3701
|
|
|
3689
3702
|
/**
|
|
@@ -3699,7 +3712,6 @@ const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled
|
|
|
3699
3712
|
* @example
|
|
3700
3713
|
* ```tsx
|
|
3701
3714
|
* <CwInputText
|
|
3702
|
-
* iconProps={{ id: "home" }}
|
|
3703
3715
|
* labelProps={{ children: "Name", width: "100px" }}
|
|
3704
3716
|
* buttonProps={{ children: "Ok", onclick:()=>{alert("hi")} }}
|
|
3705
3717
|
* feedback={{ type: "danger", message: "This field is required" }}
|
|
@@ -3750,13 +3762,15 @@ function CwInputNumber(CwInputNumberProps) {
|
|
|
3750
3762
|
}
|
|
3751
3763
|
|
|
3752
3764
|
function CwTextArea(props) {
|
|
3753
|
-
const { alignProps, buttonProps, iconProps, labelProps, resize, feedback, style, ...textareaProps } = props;
|
|
3765
|
+
const { alignProps, buttonProps, iconProps, labelProps, resize, feedback, style, className, ...textareaProps } = props;
|
|
3766
|
+
// Like CwInputText: className lands on the container, not on the textarea.
|
|
3767
|
+
const containerClassName = className ? `cw-text-area ${className}` : "cw-text-area";
|
|
3754
3768
|
const feedbackMessages = feedback
|
|
3755
3769
|
? Array.isArray(feedback) ? feedback : [feedback]
|
|
3756
3770
|
: [];
|
|
3757
3771
|
const flexDirection = alignProps?.flexDirection ?? "row";
|
|
3758
3772
|
const dataDirection = { 'data-direction': flexDirection };
|
|
3759
|
-
return (jsxs("div", { className:
|
|
3773
|
+
return (jsxs("div", { className: containerClassName, ...dataDirection, style: style, children: [jsxs(CwAlign, { ...alignProps, children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsx("textarea", { ...textareaProps, itemProp: textareaProps.required === true ? "required" : "", style: { resize: resize } }), buttonProps && jsx(CwButton, { ...buttonProps })] }), feedbackMessages.map((feedbackItem, index) => (jsx("p", { className: "cw-input-info", "data-color": feedbackItem.type, children: feedbackItem.message }, index)))] }));
|
|
3760
3774
|
}
|
|
3761
3775
|
|
|
3762
3776
|
/**
|
|
@@ -3872,6 +3886,10 @@ function formatPlainDate$1(pd, format) {
|
|
|
3872
3886
|
* />
|
|
3873
3887
|
* ```
|
|
3874
3888
|
*/
|
|
3889
|
+
/**
|
|
3890
|
+
* Text date input with a native picker fallback, predating the calendar pickers.
|
|
3891
|
+
* @deprecated Use {@link CwDatePickerTemporal} (or {@link CwDatePicker} at a JS Date boundary) instead.
|
|
3892
|
+
*/
|
|
3875
3893
|
function CwInputDateText(props) {
|
|
3876
3894
|
const displayFormat = "DD.MM.YYYY";
|
|
3877
3895
|
const internalFormat = "YYYY-MM-DD";
|
|
@@ -3933,7 +3951,7 @@ function CwInputDateText(props) {
|
|
|
3933
3951
|
return (jsx("div", { className: "cw-input-date-text", children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxs("div", { children: [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 }), jsxs("span", { children: [jsx(CwIcon, { iconId: "calendar" }), jsx("input", { type: "date", disabled: disabled, onChange: onChangeInputDate, readOnly: readOnly, ref: dateInputRef, tabIndex: -1, value: date, ...inputProps })] })] }), buttonProps && jsx(CwButton, { ...buttonProps })] }) }));
|
|
3934
3952
|
}
|
|
3935
3953
|
|
|
3936
|
-
var styles$
|
|
3954
|
+
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"};
|
|
3937
3955
|
|
|
3938
3956
|
const DEFAULT_LABELS = {
|
|
3939
3957
|
dropImageHere: "Drop image here",
|
|
@@ -4012,7 +4030,7 @@ function CwInputImage(props) {
|
|
|
4012
4030
|
const file = e.currentTarget.files?.[0];
|
|
4013
4031
|
void handleFile(file ?? null);
|
|
4014
4032
|
};
|
|
4015
|
-
return (jsxs("div", { className: `cw-input-image ${styles$
|
|
4033
|
+
return (jsxs("div", { className: `cw-input-image ${styles$i.container}`, "data-size": size, children: [jsxs("div", { onDragOver: (e) => e.preventDefault(), onDrop: handleDrop, className: styles$i.dropZone, children: [jsx(CwIcon, { iconId: "upload" }), jsxs("div", { className: "cw-flex-column cw-gap-tiny", children: [jsx("p", { className: styles$i.title, children: labels.dropImageHere }), jsx("p", { className: styles$i.subtitle, children: labels.acceptedFormats(allowedFormats.join(", ").replace(/image\//g, "")) })] })] }), jsxs("div", { className: "cw-flex-row cw-align-center-center cw-gap-small", children: [jsx(CwButton, { onClick: onPasteButtonClick, icon: "paste", text: labels.paste, size: size }), jsx(CwButton, { onClick: () => inputRef.current?.click(), icon: "folder-open", text: labels.browse, size: size })] }), jsx("input", { ref: inputRef, type: "file", accept: allowedFormats.join(","), onChange: handleFileChange, className: styles$i.hiddenInput, ...inputProps })] }));
|
|
4016
4034
|
}
|
|
4017
4035
|
|
|
4018
4036
|
/**
|
|
@@ -4144,7 +4162,7 @@ const CwImageArea = forwardRef((props, ref) => {
|
|
|
4144
4162
|
});
|
|
4145
4163
|
CwImageArea.displayName = "CwImageArea";
|
|
4146
4164
|
|
|
4147
|
-
var styles$
|
|
4165
|
+
var styles$h = {"container":"cw-weekday-selector-module__container__pwcvx","days":"cw-weekday-selector-module__days__Dd3RH"};
|
|
4148
4166
|
|
|
4149
4167
|
/* 2024-01-01 was a Monday. Formatted in UTC so a negative browser offset cannot shift a day. */
|
|
4150
4168
|
const MONDAY_UTC = Date.UTC(2024, 0, 1);
|
|
@@ -4342,16 +4360,16 @@ const CwWeekdaySelector = ({ value = "mtwrfsu", onChange, disabled = false, labe
|
|
|
4342
4360
|
// Points at the label element rather than copying its text, which also covers a labelProps that
|
|
4343
4361
|
// carries children instead of `text`.
|
|
4344
4362
|
const labelId = labelProps?.id ?? `${feedbackId}-label`;
|
|
4345
|
-
return (jsxs("div", { className: `cw-weekday-selector ${styles$
|
|
4363
|
+
return (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 && jsx(CwLabel, { id: labelId, ...labelProps }), jsx("div", { role: "group", className: styles$h.days, "aria-labelledby": labelProps ? labelId : undefined, "aria-describedby": describedBy, children: Weekdays.getFullWeek().map(day => (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) => (jsx("p", { id: feedbackIds[index], className: "cw-input-feedback", "data-color": feedbackItem.type, "aria-live": "polite", children: feedbackItem.message }, index)))] }));
|
|
4346
4364
|
};
|
|
4347
4365
|
|
|
4348
|
-
var styles$
|
|
4366
|
+
var styles$g = {"check-container":"cw-check-module__check-container__4nscZ","group":"cw-check-module__group__6JCQo","options":"cw-check-module__options__-g9LF"};
|
|
4349
4367
|
|
|
4350
4368
|
function CwCheck(props) {
|
|
4351
4369
|
const { labelProps, labelText, direction, alignment, className, ...inputProps } = props;
|
|
4352
4370
|
const resolvedDirection = direction ?? alignment ?? "row";
|
|
4353
4371
|
const displayText = labelProps?.text ?? labelText;
|
|
4354
|
-
return (jsx("div", { className: `cw-check ${styles$
|
|
4372
|
+
return (jsx("div", { className: `cw-check ${styles$g["check-container"]}${className ? ` ${className}` : ''}`, children: jsxs("label", { "data-direction": resolvedDirection, children: [jsx("input", { type: "checkbox", ...inputProps }), displayText && (jsx("span", { className: "cw-icon-text", children: displayText }))] }) }));
|
|
4355
4373
|
}
|
|
4356
4374
|
|
|
4357
4375
|
function CwCheckbox(CwCheckboxProps) {
|
|
@@ -4405,14 +4423,14 @@ function CwCheckboxGroup({ options, value = [], onChange, labelProps, groupLayou
|
|
|
4405
4423
|
?? (optionsAlignment === "column" ? "row" : "column");
|
|
4406
4424
|
// Each checkbox's box-to-text layout is the opposite of the options flow, mirroring CwRadioGroup.
|
|
4407
4425
|
const checkDirection = itemDirection === "row" ? "column" : "row";
|
|
4408
|
-
return (jsxs("div", { className: `cw-checkbox-group ${styles$
|
|
4426
|
+
return (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 && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), 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) => (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) => (jsx("p", { id: feedbackIds[index], className: "cw-input-feedback", "data-color": feedbackItem.type, "aria-live": "polite", children: feedbackItem.message }, index)))] }));
|
|
4409
4427
|
}
|
|
4410
4428
|
|
|
4411
|
-
var styles$
|
|
4429
|
+
var styles$f = {"radio":"cw-radio-module__radio__5sh7a","group":"cw-radio-module__group__br-HM","options":"cw-radio-module__options__LSw7M"};
|
|
4412
4430
|
|
|
4413
4431
|
/** Single native radio input. Building block for CwRadioGroup. */
|
|
4414
4432
|
function CwRadio({ label, direction = "row", className, ...inputProps }) {
|
|
4415
|
-
return (jsxs("label", { className: `cw-radio ${styles$
|
|
4433
|
+
return (jsxs("label", { className: `cw-radio ${styles$f.radio}${className ? ` ${className}` : ""}`, "data-direction": direction, children: [jsx("input", { type: "radio", ...inputProps }), label && jsx("span", { children: label })] }));
|
|
4416
4434
|
}
|
|
4417
4435
|
|
|
4418
4436
|
/**
|
|
@@ -4439,7 +4457,7 @@ function CwRadioGroup({ options, value, onChange, labelProps, groupLayout, itemL
|
|
|
4439
4457
|
// (itemLayout column) reads best with the circle beside the text; a side-by-side row reads
|
|
4440
4458
|
// best with the circle above the text.
|
|
4441
4459
|
const radioDirection = itemLayout?.direction === "row" ? "column" : "row";
|
|
4442
|
-
return (jsxs("div", { className: `cw-radio-group ${styles$
|
|
4460
|
+
return (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 && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), 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) => (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) => (jsx("p", { id: feedbackIds[index], className: "cw-input-feedback", "data-color": feedbackItem.type, "aria-live": "polite", children: feedbackItem.message }, index)))] }));
|
|
4443
4461
|
}
|
|
4444
4462
|
|
|
4445
4463
|
function CwToggle(props) {
|
|
@@ -4580,7 +4598,7 @@ function useDropdownPortal({ anchorRef, isOpen, onClose, positionStrategy = defa
|
|
|
4580
4598
|
return { panelRef, panelStyle: style, renderPanel };
|
|
4581
4599
|
}
|
|
4582
4600
|
|
|
4583
|
-
var
|
|
4601
|
+
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"};
|
|
4584
4602
|
|
|
4585
4603
|
/**
|
|
4586
4604
|
* Custom dropdown component with colour-coded options, optional search filter, and full
|
|
@@ -4694,14 +4712,18 @@ function CwDropdown({ options, value, onChange, labelProps, alignProps, placehol
|
|
|
4694
4712
|
}
|
|
4695
4713
|
}, [isOpen, highlightedIndex, filteredOptions, handleOptionSelect]);
|
|
4696
4714
|
const flexDirection = alignProps?.flexDirection ?? "row";
|
|
4697
|
-
return (jsx("div", { ref: containerRef, className: `cw-dropdown${className ? ` ${className}` : ""}`, "data-direction": flexDirection, style: style, ...otherProps, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && jsx(CwLabel, { id: labelId, ...labelProps }), jsxs("div", { className:
|
|
4698
|
-
|
|
4699
|
-
value === option.value ?
|
|
4700
|
-
highlightedIndex === index ?
|
|
4701
|
-
option.disabled ?
|
|
4702
|
-
].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 && (jsx("span", { className:
|
|
4715
|
+
return (jsx("div", { ref: containerRef, className: `cw-dropdown${className ? ` ${className}` : ""}`, "data-direction": flexDirection, style: style, ...otherProps, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && jsx(CwLabel, { id: labelId, ...labelProps }), jsxs("div", { className: styles$e.value, children: [jsxs("div", { className: "cw-dropdown-wrapper", ref: wrapperRef, children: [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: [jsx("div", { className: "cw-dropdown-trigger-content", id: valueId, children: selectedOption ? (jsxs(Fragment, { children: [selectedOption.color && (jsx("span", { className: styles$e.colorCircle, style: { backgroundColor: selectedOption.color } })), jsx("span", { children: selectedOption.label })] })) : (jsx("span", { className: "cw-dropdown-placeholder", children: placeholder })) }), jsx(CwIcon, { iconId: "chevron-down", size: "small" })] }), renderPanel(jsxs("div", { ref: panelRef, className: styles$e.dropdown, style: panelStyle, role: "listbox", onKeyDown: handleKeyDown, children: [allowSearch && (jsx("div", { className: styles$e.searchBox, children: jsx("input", { ref: inputRef, type: "text", placeholder: "Search...", value: searchText, onChange: handleSearchChange, onKeyDown: handleKeyDown, className: styles$e.searchInput, autoComplete: "off" }) })), jsx("ul", { children: filteredOptions.length > 0 ? (filteredOptions.map((option, index) => (jsxs("li", { ref: highlightedIndex === index ? highlightedItemRef : null, className: [
|
|
4716
|
+
styles$e.option,
|
|
4717
|
+
value === option.value ? styles$e.optionSelected : "",
|
|
4718
|
+
highlightedIndex === index ? styles$e.optionFocused : "",
|
|
4719
|
+
option.disabled ? styles$e.optionDisabled : "",
|
|
4720
|
+
].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 && (jsx("span", { className: styles$e.colorCircle, style: { backgroundColor: option.color } })), jsx("span", { children: option.label })] }, option.value)))) : (jsx("li", { className: styles$e.emptyState, children: "No options available" })) })] }))] }), feedbackMessages.map((item, index) => (jsx("p", { id: feedbackIds[index], className: "cw-input-feedback", "data-color": item.type, "aria-live": "polite", children: item.message }, index)))] })] }) }));
|
|
4703
4721
|
}
|
|
4704
4722
|
|
|
4723
|
+
/**
|
|
4724
|
+
* Legacy action menu with a fixed item shape and caller-owned open state.
|
|
4725
|
+
* @deprecated Use {@link CwPopoverButton} with your own content instead.
|
|
4726
|
+
*/
|
|
4705
4727
|
function CwDropdownFilter(props) {
|
|
4706
4728
|
// Determine visibility state
|
|
4707
4729
|
const isVisible = props.DropDownFilterState ?? false;
|
|
@@ -5030,8 +5052,8 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, placeh
|
|
|
5030
5052
|
}
|
|
5031
5053
|
else {
|
|
5032
5054
|
return {
|
|
5033
|
-
onPrimary: "var(--cw-
|
|
5034
|
-
primary: "var(--cw-
|
|
5055
|
+
onPrimary: "var(--cw-text-on-primary)",
|
|
5056
|
+
primary: "var(--cw-accent-primary)"
|
|
5035
5057
|
};
|
|
5036
5058
|
}
|
|
5037
5059
|
};
|
|
@@ -5068,7 +5090,7 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, placeh
|
|
|
5068
5090
|
};
|
|
5069
5091
|
return (jsxs("form", { ref: componentRef, id: id, "data-testid": testId, className: `${styles$b["cw-multi-filter"]}${className ? ` ${className}` : ""}`, style: style, onSubmit: (e) => {
|
|
5070
5092
|
e.preventDefault();
|
|
5071
|
-
}, children: [jsxs("div", { onClick: handleDivClick, ref: wrapperRef, className: styles$b["cw-multi-filter-search"], style: isPanelOpen ? { outline: "1px solid var(--cw-
|
|
5093
|
+
}, children: [jsxs("div", { onClick: handleDivClick, ref: wrapperRef, className: styles$b["cw-multi-filter-search"], style: isPanelOpen ? { outline: "1px solid var(--cw-outline-variant)" } : {}, children: [jsxs("ul", { id: id + "_selected_filters", children: [Array.from(selectedTags).map(tag => (createElement(CwMultiFilterTag, { ...tag, key: tag.ID, Selectable: false, Removable: true, OnRemove: () => removeTag(tag.ID) }))), 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 => {
|
|
5072
5094
|
switch (e.key) {
|
|
5073
5095
|
case "Enter":
|
|
5074
5096
|
case "Tab": {
|
|
@@ -5455,6 +5477,8 @@ function CwNavMenu({ items, loading = false, isActive, renderLink = defaultRende
|
|
|
5455
5477
|
: visibleItems.map(item => renderItem(item, 1)) }), showEmptyMessage && jsx("p", { className: styles$8.emptyMessage, children: emptyMessage })] }));
|
|
5456
5478
|
}
|
|
5457
5479
|
|
|
5480
|
+
var dropdownStyles = {"dropdown":"cw-choice-dropdown-module__dropdown__P0b4j","option":"cw-choice-dropdown-module__option__uR-ro","optionFocused":"cw-choice-dropdown-module__optionFocused__BYMxj"};
|
|
5481
|
+
|
|
5458
5482
|
/**
|
|
5459
5483
|
* Pure keyboard-navigation resolver shared by the `CwSearchInput` combobox.
|
|
5460
5484
|
* Kept side-effect-free so the arrow/home/end/enter/escape behaviour can be unit
|
|
@@ -9839,8 +9863,8 @@ const Scheduler = (props) => {
|
|
|
9839
9863
|
timeLinePercentage: timeLinePercentage,
|
|
9840
9864
|
isUtc: isUtc
|
|
9841
9865
|
};
|
|
9842
|
-
const evenColor = "var(--cw-
|
|
9843
|
-
const oddColor = "var(--cw-
|
|
9866
|
+
const evenColor = "var(--cw-surface-neutral-low)";
|
|
9867
|
+
const oddColor = "var(--cw-surface-neutral-medium)";
|
|
9844
9868
|
const weekendsLines = useMemo(() => getWeekendLinesByDatesVisible(selectedDate, visibleDays), [selectedDate, visibleDays]);
|
|
9845
9869
|
const divisionLines = useMemo(() => getLinesByDivisions(divisions), [divisions, visibleDays]);
|
|
9846
9870
|
// Timeline percentage calculation
|