@zextras/carbonio-design-system 4.2.2-react18.0 → 5.0.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.
@@ -0,0 +1,17 @@
1
+ import type { StorybookConfig } from '@storybook/react-webpack5';
2
+
3
+ const config: StorybookConfig = {
4
+ stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5
+ addons: [
6
+ '@storybook/addon-webpack5-compiler-babel',
7
+ '@storybook/addon-essentials',
8
+ '@storybook/addon-themes',
9
+ '@storybook/addon-interactions',
10
+ '@storybook/test',
11
+ ],
12
+ framework: {
13
+ name: '@storybook/react-webpack5',
14
+ options: {}
15
+ }
16
+ };
17
+ export default config;
@@ -0,0 +1,8 @@
1
+ import { withThemeFromJSXProvider } from '@storybook/addon-themes';
2
+ import { ThemeProvider } from '../src';
3
+
4
+ export const decorators = [
5
+ withThemeFromJSXProvider({
6
+ Provider: ThemeProvider
7
+ })
8
+ ];
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [5.0.0](https://github.com/Zextras/carbonio-design-system/compare/v4.2.1...v5.0.0) (2024-04-09)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * remove deprecated ButtonOld component
11
+
12
+ ### Features
13
+
14
+ * add tooltip for the expand and collapse actions ([635dced](https://github.com/Zextras/carbonio-design-system/commit/635dced3c63afaf75865aabddd104bdb6fe507ed)), closes [#281](https://github.com/Zextras/carbonio-design-system/issues/281)
15
+ * **Banner:** align component to UI kit ([287c33f](https://github.com/Zextras/carbonio-design-system/commit/287c33f30bedb916602c2c7421246742dce81e62)), closes [#280](https://github.com/Zextras/carbonio-design-system/issues/280)
16
+ * remove deprecated ButtonOld component ([a3976b1](https://github.com/Zextras/carbonio-design-system/commit/a3976b1bd4fbf530c33eb76f3c65b186bef67c43)), closes [#282](https://github.com/Zextras/carbonio-design-system/issues/282)
17
+
5
18
  ### [4.2.1](https://github.com/Zextras/carbonio-design-system/compare/v4.2.0...v4.2.1) (2024-03-08)
6
19
 
7
20
 
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.40.1"
9
+ }
10
+ ]
11
+ }
@@ -62,16 +62,20 @@ export declare type AccordionItemType = {
62
62
  export declare interface AccordionProps extends ContainerProps {
63
63
  /** Items tree object, can be nested (each property is forwarded to the item component as a prop) */
64
64
  items: Array<AccordionItemType | AccordionDivider>;
65
- /** Depth level, internally used for recursion nesting */
66
- level?: number;
67
65
  /** Accordion background */
68
66
  background?: keyof DefaultTheme['palette'];
67
+ /** Depth level, internally used for recursion nesting */
68
+ level?: number;
69
69
  /** id of the currently active item (alternative to the active item flag) */
70
70
  activeId?: string;
71
71
  /** list of ids of the currently open items (alternative to the open item flag) */
72
72
  openIds?: string[];
73
73
  /** disable animation of the accordion when expanding folders */
74
74
  disableTransition?: boolean;
75
+ /** tooltip of the collapsed chevron */
76
+ expandLabel?: string;
77
+ /** tooltip of the expanded chevron */
78
+ collapseLabel?: string;
75
79
  }
76
80
 
77
81
  export declare type Action = {
@@ -224,40 +228,6 @@ declare type ButtonColorsByType = ({
224
228
 
225
229
  declare type ButtonIconPlacement = 'left' | 'right';
226
230
 
227
- export declare const ButtonOld: React_2.ForwardRefExoticComponent<ButtonOldProps & React_2.RefAttributes<HTMLDivElement>>;
228
-
229
- export declare interface ButtonOldProps {
230
- /** Type of button */
231
- type?: ButtonType;
232
- /** Color of button */
233
- color?: string | keyof DefaultTheme['palette'];
234
- /** Color of the Button label */
235
- labelColor?: string | keyof DefaultTheme['palette'];
236
- /** Color of the Button background */
237
- backgroundColor?: string | keyof DefaultTheme['palette'];
238
- /** Button text */
239
- label: string;
240
- /** `fit`: assume the size of the content
241
- *
242
- * `fill`: take the width of the container
243
- */
244
- size?: 'fit' | 'fill';
245
- /** optional icon to display beside the label */
246
- icon?: keyof DefaultTheme['icons'];
247
- /** Icon position */
248
- iconPlacement?: 'left' | 'right';
249
- /** whether to show the loading icon */
250
- loading?: boolean;
251
- /** small item size */
252
- isSmall?: boolean;
253
- /** whether to disable the button or not */
254
- disabled?: boolean;
255
- /** Callback to be invoked when the button is pressed */
256
- onClick: (event: React_2.SyntheticEvent | KeyboardEvent) => void;
257
- /** whether to force active status or not */
258
- forceActive?: boolean;
259
- }
260
-
261
231
  export declare type ButtonProps = ButtonPropsInternal & Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof ButtonPropsInternal>;
262
232
 
263
233
  declare type ButtonPropsInternal = {
@@ -319,8 +289,6 @@ declare type ButtonSkeletonProps = {
319
289
  height?: string;
320
290
  };
321
291
 
322
- declare type ButtonType = 'default' | 'outlined' | 'ghost';
323
-
324
292
  declare type ButtonWidth = 'fit' | 'fill';
325
293
 
326
294
  export declare function calcHighlight(fromColor: string): string;
@@ -334,7 +302,6 @@ export declare class Catcher extends React_2.Component<CatcherProps, CatcherStat
334
302
  export declare interface CatcherProps {
335
303
  /** error callback, use this to perform operations when an error is caught */
336
304
  onError?: (error: Error, errorInfo: ErrorInfo) => void;
337
- children?: React_2.ReactNode;
338
305
  }
339
306
 
340
307
  declare interface CatcherState {
@@ -773,9 +740,9 @@ export declare interface DateTimePickerProps extends Omit<ReactDatePickerProps,
773
740
  disabled?: boolean;
774
741
  }
775
742
 
776
- export declare const DefaultHeaderFactory: ({ headers, onChange, allSelected, selectionMode, multiSelect, showCheckbox }: THeaderProps) => React_2.JSX.Element;
743
+ export declare const DefaultHeaderFactory: React_2.VFC<THeaderProps>;
777
744
 
778
- export declare const DefaultRowFactory: ({ index, row, onChange, selected, selectionMode, multiSelect, showCheckbox }: TRowProps) => React_2.JSX.Element;
745
+ export declare const DefaultRowFactory: React_2.VFC<TRowProps>;
779
746
 
780
747
  export declare const DefaultTabBarItem: React_2.ForwardRefExoticComponent<DefaultTabBarItemProps & React_2.RefAttributes<HTMLDivElement>>;
781
748
 
@@ -1074,7 +1041,7 @@ export declare function generateHighlightSet(fromColorSet: Parameters<typeof gen
1074
1041
  onChange: () => void;
1075
1042
  }
1076
1043
 
1077
- declare type IconComponent = (props: SVGProps<SVGSVGElement>) => React_2.JSX.Element;
1044
+ declare type IconComponent = (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
1078
1045
 
1079
1046
  export declare interface IconComponentProps extends SVGAttributes<SVGSVGElement> {
1080
1047
  /** Icon to show. It can be a string key for the theme icons or a custom icon component */
@@ -1342,7 +1309,7 @@ export declare function generateHighlightSet(fromColorSet: Parameters<typeof gen
1342
1309
 
1343
1310
  export declare const ModalFooter: ({ customFooter, ...modalFooterContentProps }: ModalFooterProps) => React_2.JSX.Element;
1344
1311
 
1345
- export declare const ModalFooterContent: ({ type, centered, onConfirm, confirmLabel, confirmDisabled, confirmColor, onSecondaryAction, secondaryActionLabel, secondaryActionDisabled, onClose, dismissLabel, errorActionLabel, optionalFooter, onErrorAction }: ModalFooterContentProps) => React_2.JSX.Element;
1312
+ export declare const ModalFooterContent: React_2.VFC<ModalFooterContentProps>;
1346
1313
 
1347
1314
  export declare type ModalFooterContentProps = Omit<ModalFooterProps, 'customFooter'>;
1348
1315
 
@@ -1464,7 +1431,7 @@ export declare function generateHighlightSet(fromColorSet: Parameters<typeof gen
1464
1431
  maxVisible?: number;
1465
1432
  };
1466
1433
 
1467
- export declare const Padding: React_2.ForwardRefExoticComponent<(PaddingProps & Omit<React_2.HTMLAttributes<HTMLDivElement>, "id" | "height" | "width" | "color" | "content" | "translate" | "hidden" | "slot" | "style" | "title" | "dir" | "rel" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "role" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "suppressHydrationWarning" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "autoFocus" | "contextMenu" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is">) & React_2.RefAttributes<HTMLDivElement>>;
1434
+ export declare const Padding: React_2.ForwardRefExoticComponent<(PaddingProps & Omit<React_2.HTMLAttributes<HTMLDivElement>, "id" | "height" | "width" | "color" | "content" | "translate" | "hidden" | "slot" | "style" | "title" | "dir" | "rel" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "role" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "autoFocus" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture">) & React_2.RefAttributes<HTMLDivElement>>;
1468
1435
 
1469
1436
  export declare type PaddingObj = {
1470
1437
  value: string | keyof DefaultTheme['sizes']['padding'] | 0;
@@ -1701,8 +1668,8 @@ export declare function generateHighlightSet(fromColorSet: Parameters<typeof gen
1701
1668
 
1702
1669
  declare type ShapeType = 'round' | 'square';
1703
1670
 
1704
- export declare type Shimmer = React_2.FunctionComponent<SkeletonProps> & {
1705
- [K in keyof typeof ShimmerObject]: React_2.FunctionComponent<Parameters<(typeof ShimmerObject)[K]>[number]>;
1671
+ export declare type Shimmer = React_2.VFC<SkeletonProps> & {
1672
+ [K in keyof typeof ShimmerObject]: React_2.VFC<Parameters<(typeof ShimmerObject)[K]>[number]>;
1706
1673
  };
1707
1674
 
1708
1675
  export declare const Shimmer: Shimmer;
@@ -2049,7 +2016,7 @@ export declare function generateHighlightSet(fromColorSet: Parameters<typeof gen
2049
2016
 
2050
2017
  declare type ThemePaletteObj = DefaultTheme['palette'];
2051
2018
 
2052
- export declare const ThemeProvider: ({ children, extension, loadDefaultFont }: React_2.PropsWithChildren<ThemeProviderProps>) => React_2.JSX.Element;
2019
+ export declare const ThemeProvider: React_2.FC<ThemeProviderProps>;
2053
2020
 
2054
2021
  export declare interface ThemeProviderProps {
2055
2022
  extension?: (theme: DefaultTheme) => DefaultTheme;
@@ -2191,7 +2158,7 @@ export declare function generateHighlightSet(fromColorSet: Parameters<typeof gen
2191
2158
 
2192
2159
  export declare function useHiddenCount(containerRef: React_2.RefObject<HTMLElement>, listenForWindowResize: boolean): [number, () => void];
2193
2160
 
2194
- export declare const useIsVisible: <T extends HTMLElement>(listRef: React_2.RefObject<HTMLDivElement> | undefined, itemRef?: React_2.Ref<T>, intersectionObserverInitOptions?: IntersectionObserverInit) => [boolean, React_2.RefObject<T>];
2161
+ export declare const useIsVisible: <T extends HTMLElement>(listRef: React_2.RefObject<HTMLDivElement> | undefined, itemRef?: React_2.Ref<T> | undefined, intersectionObserverInitOptions?: IntersectionObserverInit) => [boolean, React_2.RefObject<T>];
2195
2162
 
2196
2163
  /**
2197
2164
  * Attach listeners for the given presets to the given ref.