@cwellt_software/cwellt-reactjs-lib 1.5.5 → 1.6.1
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/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/CwContextMenu.d.ts +2 -3
- package/dist/src/components/control/action/contextmenu/CwContextMenu.d.ts.map +1 -1
- 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/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/CwInputColor.d.ts +1 -2
- package/dist/src/components/control/input/color/CwInputColor.d.ts.map +1 -1
- 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/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/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/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/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/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/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/weekday/CwWeekdaySelector.d.ts +1 -2
- package/dist/src/components/control/input/weekday/CwWeekdaySelector.d.ts.map +1 -1
- 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/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/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/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/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/card/CwCard.d.ts +17 -17
- package/dist/src/components/layout/card/CwCard.d.ts.map +1 -1
- 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/dialog/CwDialog.d.ts +1 -1
- package/dist/src/components/layout/dialog/CwDialog.d.ts.map +1 -1
- 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/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/table/grouped/CwTableGrouped.d.ts +1 -0
- package/dist/src/components/layout/table/grouped/CwTableGrouped.d.ts.map +1 -1
- package/package.json +11 -3
package/dist/index.d.ts
CHANGED
|
@@ -77,28 +77,28 @@ declare function CwLabel(props: CwLabelProps): React$1.JSX.Element;
|
|
|
77
77
|
type ChipColorScheme = 'primary' | 'danger' | 'warning' | 'success' | 'info' | 'neutral' | 'custom';
|
|
78
78
|
type ChipVariant = 'soft' | 'solid' | 'outline' | 'ghost';
|
|
79
79
|
interface CwChipProps {
|
|
80
|
-
|
|
80
|
+
/**Text content of the chip */
|
|
81
81
|
label?: string;
|
|
82
|
-
|
|
82
|
+
/**Predefined color of the chip */
|
|
83
83
|
color?: ChipColorScheme;
|
|
84
84
|
/**
|
|
85
85
|
* Predefined color scheme of the chip
|
|
86
86
|
* @deprecated Use `color` instead. Still honoured, but `color` wins when both are passed.
|
|
87
87
|
*/
|
|
88
88
|
colorScheme?: ChipColorScheme;
|
|
89
|
-
|
|
89
|
+
/**Custom color (only used when the color is 'custom') */
|
|
90
90
|
customColor?: string;
|
|
91
|
-
|
|
91
|
+
/**Visual variant of the chip */
|
|
92
92
|
variant?: ChipVariant;
|
|
93
|
-
|
|
93
|
+
/**Additional CSS class name */
|
|
94
94
|
className?: string;
|
|
95
|
-
|
|
95
|
+
/**Whether to show a close icon */
|
|
96
96
|
closable?: boolean;
|
|
97
|
-
|
|
97
|
+
/**Handler for close icon click, required if closable is true */
|
|
98
98
|
onClose?: () => void;
|
|
99
|
-
|
|
99
|
+
/**Optional icon */
|
|
100
100
|
icon?: string;
|
|
101
|
-
|
|
101
|
+
/**Additional inline styles */
|
|
102
102
|
style?: React__default.CSSProperties;
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
@@ -482,6 +482,10 @@ interface CwGenericTooltipProps {
|
|
|
482
482
|
*
|
|
483
483
|
* @see CwTooltipNew
|
|
484
484
|
*/
|
|
485
|
+
/**
|
|
486
|
+
* Portal-per-instance tooltip.
|
|
487
|
+
* @deprecated Use {@link CwTooltipNew}: same API, one shared portal for every tooltip on the page.
|
|
488
|
+
*/
|
|
485
489
|
declare const CwGenericTooltip: FC<CwGenericTooltipProps>;
|
|
486
490
|
|
|
487
491
|
interface CwTooltipProps {
|
|
@@ -568,6 +572,11 @@ interface ConfirmationPopupProps {
|
|
|
568
572
|
placement?: 'top' | 'right' | 'bottom' | 'left';
|
|
569
573
|
children: ReactNode;
|
|
570
574
|
}
|
|
575
|
+
/**
|
|
576
|
+
* Small anchored confirmation for a destructive action.
|
|
577
|
+
*
|
|
578
|
+
* Preferably avoid using it, it needs a refactor.
|
|
579
|
+
*/
|
|
571
580
|
declare function CwConfirmationPopup(props: ConfirmationPopupProps): React__default.JSX.Element;
|
|
572
581
|
|
|
573
582
|
interface CwReportModalFunctionalProps {
|
|
@@ -619,7 +628,8 @@ interface CwModalHoverProps extends Omit<HTMLProps<HTMLDialogElement>, "classNam
|
|
|
619
628
|
hovereable: JSX.Element;
|
|
620
629
|
}
|
|
621
630
|
/**
|
|
622
|
-
* A modal that appears when an element is hovered
|
|
631
|
+
* A modal that appears when an element is hovered.
|
|
632
|
+
* Preferably avoid using it, it needs a refactor.
|
|
623
633
|
* @param children Contents of the modal
|
|
624
634
|
* @param hovereable Element to hover to display the modal
|
|
625
635
|
* @param onFirstOpened Function to run only once when the modal opens for the first time
|
|
@@ -654,7 +664,7 @@ interface CwDialogProps extends HTMLProps<PropsWithChildren<HTMLDialogElement>>
|
|
|
654
664
|
onClose?: () => void;
|
|
655
665
|
/** If true, the footer will not be displayed */
|
|
656
666
|
hideFooter?: boolean;
|
|
657
|
-
|
|
667
|
+
/** Reposition the dialog when content size changes after opening. For modals with slow loading content. Default: false */
|
|
658
668
|
autoReposition?: boolean;
|
|
659
669
|
/** If true, the save button will be disabled */
|
|
660
670
|
disableSave?: boolean;
|
|
@@ -715,17 +725,17 @@ declare function CwAlign(props: CwAlignProps): React$1.JSX.Element;
|
|
|
715
725
|
|
|
716
726
|
type CardChip = Omit<CwChipProps, 'closable' | 'onClose' | 'className' | 'style'>;
|
|
717
727
|
interface CwCardProps {
|
|
718
|
-
|
|
728
|
+
/** Unique identifier for the card */
|
|
719
729
|
id?: string;
|
|
720
|
-
|
|
730
|
+
/** Card title content */
|
|
721
731
|
title?: ReactNode;
|
|
722
|
-
|
|
732
|
+
/** Card subtitle content */
|
|
723
733
|
subtitle?: ReactNode;
|
|
724
|
-
/** @deprecated Use layout.align instead ("left" → "start", "center" → "center")
|
|
734
|
+
/** @deprecated Use layout.align instead ("left" → "start", "center" → "center") */
|
|
725
735
|
alignment?: "center" | "left";
|
|
726
|
-
|
|
736
|
+
/** Main content of the card */
|
|
727
737
|
children: ReactNode;
|
|
728
|
-
|
|
738
|
+
/** Footer content of the card */
|
|
729
739
|
footer?: ReactNode;
|
|
730
740
|
/** Optional callback for edit action - displays edit button when provided */
|
|
731
741
|
onEdit?: () => void;
|
|
@@ -733,27 +743,27 @@ interface CwCardProps {
|
|
|
733
743
|
onDelete?: () => void;
|
|
734
744
|
/** Additional actions beyond edit/delete (for edge cases) */
|
|
735
745
|
extraActions?: ReactNode;
|
|
736
|
-
|
|
746
|
+
/** Additional CSS class name to apply */
|
|
737
747
|
className?: string;
|
|
738
|
-
|
|
748
|
+
/** Whether the card is clickable */
|
|
739
749
|
clickable?: boolean;
|
|
740
|
-
|
|
750
|
+
/** Click handler when clickable is true */
|
|
741
751
|
onClick?: () => void;
|
|
742
|
-
|
|
752
|
+
/** Whether the card is in a loading state - the content zone renders skeleton lines instead of children */
|
|
743
753
|
isLoading?: boolean;
|
|
744
|
-
|
|
754
|
+
/** Number of skeleton text lines shown in the content while isLoading. Default 3 */
|
|
745
755
|
skeletonLines?: number;
|
|
746
|
-
|
|
756
|
+
/** Whether the card is disabled */
|
|
747
757
|
disabled?: boolean;
|
|
748
|
-
|
|
758
|
+
/** Custom style object for additional inline styles */
|
|
749
759
|
style?: React__default.CSSProperties;
|
|
750
|
-
|
|
760
|
+
/** Tags or chips to be displayed in the card */
|
|
751
761
|
chips?: CardChip[];
|
|
752
|
-
|
|
762
|
+
/** Variant design */
|
|
753
763
|
variant?: "border" | "shadow";
|
|
754
|
-
/** @deprecated Use layout.direction instead
|
|
764
|
+
/** @deprecated Use layout.direction instead */
|
|
755
765
|
direction?: "column" | "row";
|
|
756
|
-
/** Card layout: direction controls card flex direction; align controls header content alignment
|
|
766
|
+
/** Card layout: direction controls card flex direction; align controls header content alignment */
|
|
757
767
|
layout?: CwLayoutProps;
|
|
758
768
|
}
|
|
759
769
|
/**
|
|
@@ -815,10 +825,8 @@ interface CwAccordionContainerProps {
|
|
|
815
825
|
style?: React$1.CSSProperties;
|
|
816
826
|
}
|
|
817
827
|
/**
|
|
818
|
-
*
|
|
819
|
-
* @
|
|
820
|
-
* @remarks Previously CwAccordionContainer
|
|
821
|
-
* @returns
|
|
828
|
+
* Legacy collapsible section with its own header markup.
|
|
829
|
+
* @deprecated Use {@link CwExpandable} instead.
|
|
822
830
|
*/
|
|
823
831
|
declare function CwAccordionContainer(CwelltAccordionContainerProps: React$1.PropsWithChildren<CwAccordionContainerProps>): React$1.JSX.Element;
|
|
824
832
|
|
|
@@ -1224,7 +1232,8 @@ interface CwExpandableProps extends Omit<HTMLProps<PropsWithChildren<HTMLDetails
|
|
|
1224
1232
|
onClose?: (ev: MouseEvent) => void;
|
|
1225
1233
|
}
|
|
1226
1234
|
/**
|
|
1227
|
-
* An expandable element with briefing and children displayed when clicked
|
|
1235
|
+
* An expandable element with briefing and children displayed when clicked.
|
|
1236
|
+
* Preferably avoid using it, it needs a refactor.
|
|
1228
1237
|
* @param briefing Title of the expandable
|
|
1229
1238
|
* @param onToggle Function to run when expandable is toggled open/closed
|
|
1230
1239
|
* @param onClose Function to run when expandable is closed
|
|
@@ -1456,6 +1465,7 @@ interface CwTableGroupedProps {
|
|
|
1456
1465
|
}
|
|
1457
1466
|
/**
|
|
1458
1467
|
* A table with expandable row groups.
|
|
1468
|
+
* Preferably avoid using it, it needs a refactor.
|
|
1459
1469
|
* @param props The data to display
|
|
1460
1470
|
* @example
|
|
1461
1471
|
* const sampleTableData: CwTableGroupedData = {
|
|
@@ -1563,6 +1573,10 @@ interface CwInputProps {
|
|
|
1563
1573
|
required?: boolean;
|
|
1564
1574
|
error?: boolean;
|
|
1565
1575
|
}
|
|
1576
|
+
/**
|
|
1577
|
+
* Legacy text input with its own label markup, predating the design system.
|
|
1578
|
+
* @deprecated Use {@link CwInputText} instead.
|
|
1579
|
+
*/
|
|
1566
1580
|
declare function CwInput(CwInputProps: React__default.PropsWithChildren<CwInputProps>): React__default.JSX.Element;
|
|
1567
1581
|
|
|
1568
1582
|
interface CwInputFeedback {
|
|
@@ -1659,7 +1673,7 @@ interface CwDigitProps extends Omit<HTMLProps<HTMLInputElement>, "className" | "
|
|
|
1659
1673
|
*/
|
|
1660
1674
|
declare function CwDigit(props: CwDigitProps): React$1.JSX.Element;
|
|
1661
1675
|
|
|
1662
|
-
interface
|
|
1676
|
+
interface CwColorPickerProps {
|
|
1663
1677
|
initialColor: string;
|
|
1664
1678
|
onChange: (color: string, rgb?: {
|
|
1665
1679
|
r: number;
|
|
@@ -1672,7 +1686,7 @@ interface ColorPickerProps {
|
|
|
1672
1686
|
}) => void;
|
|
1673
1687
|
previewText?: string;
|
|
1674
1688
|
}
|
|
1675
|
-
declare const CwColorPicker: React__default.FC<
|
|
1689
|
+
declare const CwColorPicker: React__default.FC<CwColorPickerProps>;
|
|
1676
1690
|
|
|
1677
1691
|
interface CwInputLayoutProps {
|
|
1678
1692
|
direction?: "row" | "column";
|
|
@@ -1716,8 +1730,8 @@ interface CwInputColorProps {
|
|
|
1716
1730
|
declare const CwInputColor: React__default.FC<CwInputColorProps>;
|
|
1717
1731
|
|
|
1718
1732
|
interface CwInputTextProps extends Omit<HTMLProps<HTMLInputElement>, never> {
|
|
1719
|
-
/** Props to define alignment and size; undefined ==
|
|
1720
|
-
* @example alignProps={{
|
|
1733
|
+
/** Props to define alignment and size; undefined == row
|
|
1734
|
+
* @example alignProps={{flexDirection:"column"}} */
|
|
1721
1735
|
alignProps?: CwAlignProps;
|
|
1722
1736
|
/** Props of the button; undefined == no button
|
|
1723
1737
|
* @example buttonProps={{children:"Ok"}} */
|
|
@@ -1726,7 +1740,7 @@ interface CwInputTextProps extends Omit<HTMLProps<HTMLInputElement>, never> {
|
|
|
1726
1740
|
* @example labelProps={{children:"Your name please:"}} */
|
|
1727
1741
|
labelProps?: CwLabelProps;
|
|
1728
1742
|
/** Props of the icon; undefined == no icon
|
|
1729
|
-
* @
|
|
1743
|
+
* @deprecated The leading icon is being retired from the text input; do not use in new code. */
|
|
1730
1744
|
iconProps?: CwIconProps;
|
|
1731
1745
|
/** Feedback messages shown below the input; accepts a single message or an array for multiple
|
|
1732
1746
|
* @example feedback={{ type: "danger", message: "This field is required" }}
|
|
@@ -1747,7 +1761,6 @@ interface CwInputTextProps extends Omit<HTMLProps<HTMLInputElement>, never> {
|
|
|
1747
1761
|
* @example
|
|
1748
1762
|
* ```tsx
|
|
1749
1763
|
* <CwInputText
|
|
1750
|
-
* iconProps={{ id: "home" }}
|
|
1751
1764
|
* labelProps={{ children: "Name", width: "100px" }}
|
|
1752
1765
|
* buttonProps={{ children: "Ok", onclick:()=>{alert("hi")} }}
|
|
1753
1766
|
* feedback={{ type: "danger", message: "This field is required" }}
|
|
@@ -1806,7 +1819,7 @@ interface CwInputNumberProps {
|
|
|
1806
1819
|
}
|
|
1807
1820
|
declare function CwInputNumber(CwInputNumberProps: React__default.PropsWithChildren<CwInputNumberProps>): React__default.JSX.Element;
|
|
1808
1821
|
|
|
1809
|
-
interface CwTextAreaProps extends
|
|
1822
|
+
interface CwTextAreaProps extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
|
|
1810
1823
|
/** Can it be resized? */
|
|
1811
1824
|
resize?: CSS.Property.Resize;
|
|
1812
1825
|
/** Props to define alignment and size; undefined == column
|
|
@@ -1930,6 +1943,10 @@ interface CwInputDateTextProps extends Omit<React__default.HTMLProps<HTMLInputEl
|
|
|
1930
1943
|
* />
|
|
1931
1944
|
* ```
|
|
1932
1945
|
*/
|
|
1946
|
+
/**
|
|
1947
|
+
* Text date input with a native picker fallback, predating the calendar pickers.
|
|
1948
|
+
* @deprecated Use {@link CwDatePickerTemporal} (or {@link CwDatePicker} at a JS Date boundary) instead.
|
|
1949
|
+
*/
|
|
1933
1950
|
declare function CwInputDateText(props: CwInputDateTextProps): React__default.JSX.Element;
|
|
1934
1951
|
|
|
1935
1952
|
interface CwInputImageLabels {
|
|
@@ -2385,6 +2402,10 @@ interface CwDropdownFilterProps {
|
|
|
2385
2402
|
isNested?: boolean;
|
|
2386
2403
|
IdContent?: string;
|
|
2387
2404
|
}
|
|
2405
|
+
/**
|
|
2406
|
+
* Legacy action menu with a fixed item shape and caller-owned open state.
|
|
2407
|
+
* @deprecated Use {@link CwPopoverButton} with your own content instead.
|
|
2408
|
+
*/
|
|
2388
2409
|
declare function CwDropdownFilter(props: React$1.PropsWithChildren<CwDropdownFilterProps>): React$1.JSX.Element;
|
|
2389
2410
|
|
|
2390
2411
|
interface CwPopoverButtonProps extends Omit<CwButtonProps, "onClick" | "children"> {
|
|
@@ -3019,7 +3040,7 @@ interface CwAnchoredMenuProps extends React__default.PropsWithChildren {
|
|
|
3019
3040
|
}
|
|
3020
3041
|
declare const CwAnchoredMenu: React__default.FC<CwAnchoredMenuProps>;
|
|
3021
3042
|
|
|
3022
|
-
interface
|
|
3043
|
+
interface CwContextMenuProps extends React__default.PropsWithChildren {
|
|
3023
3044
|
options: string[];
|
|
3024
3045
|
offset?: {
|
|
3025
3046
|
x: number;
|
|
@@ -3027,7 +3048,7 @@ interface ContextMenuProps extends React__default.PropsWithChildren {
|
|
|
3027
3048
|
};
|
|
3028
3049
|
onSelect: (option: string) => void;
|
|
3029
3050
|
}
|
|
3030
|
-
declare const CwContextMenu: React__default.FC<
|
|
3051
|
+
declare const CwContextMenu: React__default.FC<CwContextMenuProps>;
|
|
3031
3052
|
|
|
3032
3053
|
interface CwButtonSplitAction {
|
|
3033
3054
|
key: string;
|