@dxc-technology/halstack-react 0.0.0-ca89a03 → 0.0.0-caad7df

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/index.d.ts CHANGED
@@ -59,7 +59,7 @@ type AccordionItemProps = {
59
59
  */
60
60
  tabIndex?: number;
61
61
  };
62
- type CommonProps$9 = {
62
+ type CommonProps$a = {
63
63
  /**
64
64
  * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
65
65
  * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
@@ -70,7 +70,7 @@ type CommonProps$9 = {
70
70
  */
71
71
  children: ReactElement<AccordionItemProps>[] | ReactElement<AccordionItemProps>;
72
72
  };
73
- type IndependentProps = CommonProps$9 & {
73
+ type IndependentProps = CommonProps$a & {
74
74
  /**
75
75
  * When true, limits the user to single-open section at a time. When false, multiple sections can be opened simultaneously.
76
76
  */
@@ -91,7 +91,7 @@ type IndependentProps = CommonProps$9 & {
91
91
  */
92
92
  onActiveChange?: (index: number) => void;
93
93
  };
94
- type NonIndependentProps = CommonProps$9 & {
94
+ type NonIndependentProps = CommonProps$a & {
95
95
  /**
96
96
  * When true, limits the user to single-open section at a time. When false, multiple sections can be opened simultaneously.
97
97
  */
@@ -145,7 +145,7 @@ type Message = {
145
145
  */
146
146
  text: ReactNode;
147
147
  };
148
- type CommonProps$8 = {
148
+ type CommonProps$9 = {
149
149
  /**
150
150
  * If true, the alert will have a close button that will remove the message from the alert,
151
151
  * only in banner and inline modes. The rest of the functionality will depend
@@ -198,14 +198,46 @@ type ModeSpecificProps = {
198
198
  */
199
199
  mode: "modal";
200
200
  };
201
- type Props$J = CommonProps$8 & ModeSpecificProps;
201
+ type Props$J = CommonProps$9 & ModeSpecificProps;
202
202
 
203
203
  declare const DxcAlert: ({ closable, message, mode, primaryAction, secondaryAction, semantic, title, }: Props$J) => react_jsx_runtime.JSX.Element;
204
204
 
205
+ type SearchBarProps = {
206
+ /**
207
+ * If true, the search bar input will be focused when rendered.
208
+ */
209
+ autoFocus?: boolean;
210
+ /**
211
+ * If true, the component will be disabled.
212
+ */
213
+ disabled?: boolean;
214
+ /**
215
+ * Function invoked when the search bar loses focus.
216
+ */
217
+ onBlur?: (value: string) => void;
218
+ /**
219
+ * Function invoked when the user cancels the search.
220
+ */
221
+ onCancel?: () => void;
222
+ /**
223
+ * Function invoked when the user changes the input value.
224
+ */
225
+ onChange?: (value: string) => void;
226
+ /**
227
+ * Function invoked when the Enter key is pressed.
228
+ */
229
+ onEnter?: (value: string) => void;
230
+ /**
231
+ * Placeholder text displayed in the search bar input field.
232
+ */
233
+ placeholder?: string;
234
+ };
235
+
205
236
  type Section$1 = {
206
237
  items: (Item$2 | GroupItem$2)[];
207
238
  title?: string;
208
239
  };
240
+ type SearchbarSidenavProps = Omit<SearchBarProps, "autoFocus" | "disabled" | "onCancel">;
209
241
  type Props$I = {
210
242
  /**
211
243
  * The content rendered in the bottom part of the sidenav, under the navigation menu.
@@ -237,6 +269,10 @@ type Props$I = {
237
269
  * Function called when the expansion state of the sidenav changes.
238
270
  */
239
271
  onExpandedChange?: (value: boolean) => void;
272
+ /**
273
+ * When provided, a search bar will be rendered at the top of the sidenav.
274
+ */
275
+ searchBar?: SearchbarSidenavProps;
240
276
  /**
241
277
  * The additional content rendered in the upper part of the sidenav, under the branding.
242
278
  */
@@ -252,6 +288,7 @@ type Item$2 = CommonItemProps$1 & {
252
288
  selected?: boolean;
253
289
  };
254
290
  type GroupItem$2 = CommonItemProps$1 & {
291
+ defaultOpen?: boolean;
255
292
  items: (Item$2 | GroupItem$2)[];
256
293
  };
257
294
 
@@ -270,6 +307,7 @@ type Item$1 = CommonItemProps & {
270
307
  };
271
308
  type GroupItem$1 = CommonItemProps & {
272
309
  items: (Item$1 | GroupItem$1)[];
310
+ defaultOpen?: boolean;
273
311
  };
274
312
  type Section = {
275
313
  items: (Item$1 | GroupItem$1)[];
@@ -307,10 +345,12 @@ type GroupItem = CommonItemProps & {
307
345
  items: Item$1[];
308
346
  };
309
347
  type MainNavPropsType = (GroupItem | Item$1)[];
348
+ type SearchBarHeaderProps = Omit<SearchBarProps, "autoFocus" | "disabled">;
310
349
  type Props$G = {
311
350
  appTitle?: string;
312
351
  navItems?: MainNavPropsType;
313
352
  responsiveBottomContent?: ReactNode;
353
+ searchBar?: SearchBarHeaderProps;
314
354
  sideContent?: ReactNode | ((isResponsive: boolean) => ReactNode);
315
355
  };
316
356
 
@@ -342,7 +382,7 @@ type Logo = {
342
382
  /**
343
383
  * Source of the logo image.
344
384
  */
345
- src: string;
385
+ src: string | SVG;
346
386
  /**
347
387
  * Alternative text for the logo image.
348
388
  */
@@ -438,9 +478,9 @@ type ApplicationLayoutPropsType = {
438
478
  declare const DxcApplicationLayout: {
439
479
  ({ logo, header, sidenav, footer, children }: ApplicationLayoutPropsType): JSX.Element;
440
480
  Footer: ({ bottomLinks, copyright, leftContent, logo, mode, rightContent, socialLinks, tabIndex, }: FooterPropsType) => JSX.Element;
441
- Header: ({ appTitle, navItems, sideContent, responsiveBottomContent }: Props$G) => JSX.Element;
481
+ Header: ({ appTitle, navItems, responsiveBottomContent, searchBar, sideContent, }: Props$G) => JSX.Element;
442
482
  Main: ({ children }: AppLayoutMainPropsType) => JSX.Element;
443
- Sidenav: ({ topContent, bottomContent, navItems, appTitle, displayGroupLines, expanded, defaultExpanded, onExpandedChange, }: Props$I) => JSX.Element;
483
+ Sidenav: ({ topContent, bottomContent, navItems, appTitle, displayGroupLines, expanded, defaultExpanded, onExpandedChange, searchBar, }: Props$I) => JSX.Element;
444
484
  };
445
485
 
446
486
  type Size$5 = "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
@@ -549,7 +589,7 @@ type NotificationProps = {
549
589
  */
550
590
  color?: never;
551
591
  };
552
- type CommonProps$7 = {
592
+ type CommonProps$8 = {
553
593
  /**
554
594
  * Text representing advisory information related to the badge. Under the hood, this prop also serves as an accessible label for the component.
555
595
  */
@@ -563,7 +603,7 @@ type CommonProps$7 = {
563
603
  */
564
604
  size?: "small" | "medium" | "large";
565
605
  };
566
- type Props$E = (ContextualProps | NotificationProps) & CommonProps$7;
606
+ type Props$E = (ContextualProps | NotificationProps) & CommonProps$8;
567
607
 
568
608
  declare const DxcBadge: ({ label, title, mode, color, icon, notificationLimit, size, }: Props$E) => JSX.Element;
569
609
 
@@ -875,43 +915,80 @@ type Props$y = {
875
915
 
876
916
  declare const DxcCheckbox: react.ForwardRefExoticComponent<Props$y & react.RefAttributes<HTMLDivElement>>;
877
917
 
878
- type Props$x = {
918
+ type ChipAvatarType = {
919
+ color: Props$F["color"];
920
+ profileName?: Props$F["label"];
921
+ imageSrc?: Props$F["imageSrc"];
922
+ icon?: Props$F["icon"];
923
+ };
924
+ type CommonProps$7 = {
879
925
  /**
880
- * Text to be placed on the chip.
926
+ * Function to be called when the chip is clicked or the dismiss action is triggered.
881
927
  */
882
- label?: string;
928
+ onClick?: () => void;
929
+ /**
930
+ * Value of the tabindex attribute.
931
+ */
932
+ tabIndex?: number;
933
+ };
934
+ type SelectableChipProps = CommonProps$7 & {
883
935
  /**
884
- * Element or path used as icon to be placed after the chip label.
936
+ * If true, the component will be disabled.
937
+ */
938
+ disabled?: boolean;
939
+ /**
940
+ * The whole chip is an interactive element that allows users to activate or clear options directly within the interface.
941
+ */
942
+ mode?: "selectable";
943
+ /**
944
+ * If true, the component will be selected. This property is only applicable when the mode is "selectable".
945
+ * If undefined, the component manages its own internal state (uncontrolled mode).
946
+ */
947
+ selected?: boolean;
948
+ } & ({
949
+ /**
950
+ * Element, path or avatar used as icon to be placed before the chip label.
951
+ */
952
+ prefix: ChipAvatarType;
953
+ /**
954
+ * Text to be placed on the chip. Required when using an avatar prefix.
885
955
  */
886
- suffixIcon?: string | SVG;
956
+ label: string;
957
+ } | {
887
958
  /**
888
959
  * Element or path used as icon to be placed before the chip label.
889
960
  */
890
- prefixIcon?: string | SVG;
961
+ prefix: string | SVG;
891
962
  /**
892
- * This function will be called when the suffix is clicked.
963
+ * Text to be placed on the chip. Optional when using an icon prefix.
893
964
  */
894
- onClickSuffix?: () => void;
965
+ label?: string;
966
+ } | {
967
+ prefix?: undefined;
895
968
  /**
896
- * This function will be called when the prefix is clicked.
969
+ * Text to be placed on the chip.
897
970
  */
898
- onClickPrefix?: () => void;
971
+ label: string;
972
+ });
973
+ type DismissibleChipProps = CommonProps$7 & {
899
974
  /**
900
- * If true, the component will be disabled.
975
+ * Dismissible chip is used to represent information generated by user input within an interface.
901
976
  */
902
- disabled?: boolean;
977
+ mode: "dismissible";
903
978
  /**
904
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
905
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
979
+ * Text to be placed on the chip.
906
980
  */
907
- margin?: Space$1 | Margin;
981
+ label: string;
908
982
  /**
909
- * Value of the tabindex attribute.
983
+ * Element, path or avatar used as icon to be placed before the chip label.
910
984
  */
911
- tabIndex?: number;
985
+ prefix?: string | SVG | ChipAvatarType;
986
+ selected?: never;
987
+ disabled?: never;
912
988
  };
989
+ type Props$x = SelectableChipProps | DismissibleChipProps;
913
990
 
914
- declare const DxcChip: ({ label, suffixIcon, prefixIcon, onClickSuffix, onClickPrefix, disabled, margin, tabIndex, }: Props$x) => react_jsx_runtime.JSX.Element;
991
+ declare const DxcChip: ({ disabled, label, mode, onClick, prefix, selected, tabIndex, }: Props$x) => react_jsx_runtime.JSX.Element | null;
915
992
 
916
993
  type Space = {
917
994
  top?: string;
@@ -1663,6 +1740,10 @@ type CommonProps$5 = {
1663
1740
  * If true, if the file is an image, a preview of it will be shown. If not, an icon refering to the file type will be shown.
1664
1741
  */
1665
1742
  showPreview?: boolean;
1743
+ /**
1744
+ * Size of the component.
1745
+ */
1746
+ size?: "medium" | "fillParent";
1666
1747
  /**
1667
1748
  * Value of the tabindex attribute.
1668
1749
  */
@@ -2430,6 +2511,32 @@ type Props$f = {
2430
2511
 
2431
2512
  declare const DxcPasswordInput: react.ForwardRefExoticComponent<Props$f & react.RefAttributes<HTMLDivElement>>;
2432
2513
 
2514
+ type PopoverPropsType = {
2515
+ /** Action that triggers the popover to open. */
2516
+ actionToOpen?: "click" | "hover";
2517
+ /** Alignment of the popover relative to the trigger element. */
2518
+ align?: "start" | "center" | "end";
2519
+ /** Set to true if child controls the events. It will render the child directly without wrapping it. */
2520
+ asChild?: boolean;
2521
+ /** Element that triggers the popover and works as the anchor. */
2522
+ children: React.ReactNode;
2523
+ /** Whether the popover should display a tip (arrow). */
2524
+ hasTip?: boolean;
2525
+ /** Controlled open state of the popover. If it is left undefined, it will be uncontrolled. */
2526
+ isOpen?: boolean;
2527
+ /** Callback function when the popover is opened.
2528
+ * Used only in controlled mode and if the trigger lacks the events to manage the controlled behavior. */
2529
+ onOpen?: () => void;
2530
+ /** Callback function when the popover is closed. */
2531
+ onClose?: () => void;
2532
+ /** Content to be displayed inside the popover. */
2533
+ popoverContent: React.ReactNode;
2534
+ /** Side of the trigger where the popover will appear. */
2535
+ side?: "top" | "bottom" | "left" | "right";
2536
+ };
2537
+
2538
+ declare const DxcPopover: ({ actionToOpen, align, asChild, children, hasTip, isOpen, onOpen, onClose, popoverContent, side, }: PopoverPropsType) => JSX.Element;
2539
+
2433
2540
  type Size$1 = {
2434
2541
  top?: Space$1;
2435
2542
  bottom?: Space$1;
@@ -3771,6 +3878,12 @@ declare const defaultTranslatedComponentLabels: {
3771
3878
  radioGroup: {
3772
3879
  optionalItemLabelDefault: string;
3773
3880
  };
3881
+ searchBar: {
3882
+ clearFieldActionTitle: string;
3883
+ inputAriaLabel: string;
3884
+ triggerTitle: string;
3885
+ cancelButtonLabel: string;
3886
+ };
3774
3887
  select: {
3775
3888
  actionClearSelectionTitle: string;
3776
3889
  actionClearSearchTitle: string;
@@ -3872,6 +3985,12 @@ declare const HalstackLanguageContext: react.Context<{
3872
3985
  radioGroup: {
3873
3986
  optionalItemLabelDefault: string;
3874
3987
  };
3988
+ searchBar: {
3989
+ clearFieldActionTitle: string;
3990
+ inputAriaLabel: string;
3991
+ triggerTitle: string;
3992
+ cancelButtonLabel: string;
3993
+ };
3875
3994
  select: {
3876
3995
  actionClearSelectionTitle: string;
3877
3996
  actionClearSearchTitle: string;
@@ -3891,7 +4010,10 @@ declare const HalstackLanguageContext: react.Context<{
3891
4010
  clearToastActionTitle: string;
3892
4011
  };
3893
4012
  }>;
3894
- type ThemeType = Record<string, string | number>;
4013
+ type ThemeType = {
4014
+ tokens?: Record<string, string | number>;
4015
+ logos?: Record<string, string | undefined>;
4016
+ };
3895
4017
  type HalstackProviderPropsType = {
3896
4018
  labels?: DeepPartial<TranslatedLabels>;
3897
4019
  children: ReactNode;
@@ -3907,4 +4029,4 @@ declare function useToast(): {
3907
4029
  loading: (toast: Omit<LoadingToast, "loading">) => (() => void) | undefined;
3908
4030
  };
3909
4031
 
3910
- export { DxcAccordion, DxcAlert, DxcApplicationLayout, DxcAvatar, DxcBadge, DxcBleed, DxcBreadcrumbs, DxcBulletedList, DxcButton, DxcCard, DxcCheckbox, DxcChip, DxcContainer, DxcContextualMenu, DxcDataGrid, DxcDateInput, DxcDialog, DxcDivider, DxcDropdown, DxcFileInput, DxcFlex, DxcGrid, DxcHeading, DxcImage, DxcInset, DxcLink, DxcNavTabs, DxcNumberInput, DxcPaginator, DxcParagraph, DxcPasswordInput, DxcProgressBar, DxcQuickNav, DxcRadioGroup, DxcResultsetTable, DxcSelect, DxcSlider, DxcSpinner, DxcStatusLight, DxcSwitch, DxcTable, DxcTabs, DxcTextInput, DxcTextarea, DxcToastsQueue, DxcToggleGroup, DxcTooltip, DxcTypography, DxcWizard, HalstackLanguageContext, HalstackProvider, useToast };
4032
+ export { DxcAccordion, DxcAlert, DxcApplicationLayout, DxcAvatar, DxcBadge, DxcBleed, DxcBreadcrumbs, DxcBulletedList, DxcButton, DxcCard, DxcCheckbox, DxcChip, DxcContainer, DxcContextualMenu, DxcDataGrid, DxcDateInput, DxcDialog, DxcDivider, DxcDropdown, DxcFileInput, DxcFlex, DxcGrid, DxcHeading, DxcImage, DxcInset, DxcLink, DxcNavTabs, DxcNumberInput, DxcPaginator, DxcParagraph, DxcPasswordInput, DxcPopover, DxcProgressBar, DxcQuickNav, DxcRadioGroup, DxcResultsetTable, DxcSelect, DxcSlider, DxcSpinner, DxcStatusLight, DxcSwitch, DxcTable, DxcTabs, DxcTextInput, DxcTextarea, DxcToastsQueue, DxcToggleGroup, DxcTooltip, DxcTypography, DxcWizard, HalstackLanguageContext, HalstackProvider, useToast };