@ama-pt/agora-design-system 0.4.0 → 0.5.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { ComponentPropsWithRef, ReactNode, FC, SVGProps, HTMLProps, ComponentPropsWithoutRef, ReactElement, HtmlHTMLAttributes, ChangeEvent, RefObject, AnchorHTMLAttributes, ImgHTMLAttributes } from 'react';
2
+ import React__default, { ComponentPropsWithRef, ReactNode, FC, SVGProps, HTMLProps, ComponentPropsWithoutRef, ReactElement, ForwardRefRenderFunction, HtmlHTMLAttributes, ChangeEvent, RefObject, AnchorHTMLAttributes, ImgHTMLAttributes } from 'react';
3
3
 
4
4
  type BooleanProp = boolean | 'true' | 'false';
5
5
 
@@ -76,7 +76,7 @@ declare const Accordion: React__default.ForwardRefExoticComponent<Omit<Accordion
76
76
  /**
77
77
  * The available variants of the anchors. This variants will define the background and border color of the anchors.
78
78
  */
79
- type AnchorVariant = 'primary' | 'neutral' | 'white' | 'success' | 'warning' | 'danger';
79
+ type AnchorVariant = 'primary' | 'informative' | 'neutral' | 'white' | 'success' | 'warning' | 'danger';
80
80
  /**
81
81
  * The available anchor appearances. Defines the anchor shape.
82
82
  */
@@ -244,7 +244,7 @@ declare const Breadcrumb: FC<BreadcrumbProps>;
244
244
  /**
245
245
  * The available variants of the button. This variants will define the background and border color of the button.
246
246
  */
247
- type ButtonVariant = 'primary' | 'neutral' | 'white' | 'success' | 'warning' | 'danger';
247
+ type ButtonVariant = 'primary' | 'informative' | 'neutral' | 'white' | 'success' | 'warning' | 'danger';
248
248
  /**
249
249
  * The available button appearances. Defines the button shape.
250
250
  */
@@ -595,12 +595,25 @@ interface RangeProps extends Omit<ComponentPropsWithRef<'input'>, 'value' | 'onC
595
595
  }
596
596
  declare const InputRange: React__default.ForwardRefExoticComponent<Omit<RangeProps, "ref"> & React__default.RefAttributes<HTMLDivElement | HTMLInputElement | (HTMLInputElement | null)[]>>;
597
597
 
598
- type ListType = 'default' | 'unordered' | 'ordered';
598
+ type ListType = 'unordered' | 'ordered';
599
+ type ListStyle = 'none' | 'bullet' | 'number' | 'icon';
599
600
  interface ListProps extends ComponentPropsWithoutRef<'ul'> {
600
601
  /**
601
602
  * Type list.
602
603
  */
603
604
  type?: ListType;
605
+ /**
606
+ * Style of the list depending on the chosen type.
607
+ */
608
+ listStyle?: ListStyle;
609
+ /**
610
+ * Choose the starting number of an ordered number list.
611
+ */
612
+ startNumber?: number;
613
+ /**
614
+ * Choose the icon for an unordered list.
615
+ */
616
+ icon?: string;
604
617
  /**
605
618
  * Children content.
606
619
  */
@@ -646,47 +659,6 @@ interface MenuItemRef {
646
659
  type ExtendedInterfaceMenu = HTMLButtonElement | HTMLAnchorElement | MenuItemRef | AvatarProps;
647
660
  declare const MenuItem: React__default.ForwardRefExoticComponent<((BaseProps & AvatarProps) | Omit<BaseProps & React__default.HTMLProps<HTMLDivElement>, "ref"> | Omit<BaseProps & React__default.HTMLProps<HTMLAnchorElement>, "ref"> | Omit<BaseProps & React__default.HTMLProps<HTMLButtonElement>, "ref">) & React__default.RefAttributes<ExtendedInterfaceMenu>>;
648
661
 
649
- interface ModalProps extends ComponentPropsWithoutRef<'dialog'> {
650
- /**
651
- * Title text for the close button.
652
- */
653
- closeButtonText: string;
654
- /**
655
- * Children content.
656
- */
657
- children: ReactNode;
658
- /**
659
- * Show or hide close button title.
660
- */
661
- hideCloseButtonText?: BooleanProp;
662
- }
663
- declare const Modal: FC<ModalProps>;
664
-
665
- declare const useModal: () => {
666
- showModal: (params: ReactNode, props: ModalProps) => void;
667
- closeModal: () => void;
668
- isOpen: boolean;
669
- modalContent: ReactNode;
670
- modalProps: ModalProps;
671
- };
672
-
673
- interface ModalContextProps {
674
- isOpen?: boolean;
675
- showModal: (params: ReactNode, modalProps: ModalProps) => void;
676
- closeModal: () => void;
677
- modalContent?: ReactNode | null;
678
- }
679
- declare const ModalContext: React$1.Context<ModalContextProps>;
680
- declare const useModalContext: () => ModalContextProps;
681
-
682
- interface ModalProviderProps {
683
- /**
684
- * Children content.
685
- */
686
- children: ReactNode;
687
- }
688
- declare const ModalProvider: FC<ModalProviderProps>;
689
-
690
662
  /**
691
663
  * The available variants of the pill. This variants will define the background and border color of the pill.
692
664
  */
@@ -804,7 +776,7 @@ interface StatusCardProps extends ComponentPropsWithoutRef<'div'> {
804
776
  /**
805
777
  * Status card description content
806
778
  */
807
- description: string;
779
+ description: ReactNode;
808
780
  /**
809
781
  * The available Status card types. Defines the appearance of the cards.
810
782
  */
@@ -995,7 +967,7 @@ type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
995
967
  * The available alignments of the Tooltip. This alignments will define the alignment of the Tooltip.
996
968
  */
997
969
  type TooltipAlignment = 'start' | 'center' | 'end';
998
- interface TooltipProps extends ComponentPropsWithRef<'div'> {
970
+ interface TooltipProps extends Omit<ComponentPropsWithRef<'div'>, 'title'> {
999
971
  /**
1000
972
  * The variant of the Tooltip.
1001
973
  */
@@ -1011,7 +983,7 @@ interface TooltipProps extends ComponentPropsWithRef<'div'> {
1011
983
  /**
1012
984
  * The title of the Tooltip.
1013
985
  */
1014
- title?: string;
986
+ title?: ReactNode;
1015
987
  /**
1016
988
  * If the Tooltip has a title.
1017
989
  */
@@ -1019,7 +991,7 @@ interface TooltipProps extends ComponentPropsWithRef<'div'> {
1019
991
  /**
1020
992
  * The description of the Tooltip.
1021
993
  */
1022
- description: string;
994
+ description: ReactNode;
1023
995
  /**
1024
996
  * The children of the Tooltip.
1025
997
  */
@@ -1027,6 +999,88 @@ interface TooltipProps extends ComponentPropsWithRef<'div'> {
1027
999
  }
1028
1000
  declare const Tooltip: React__default.ForwardRefExoticComponent<Omit<TooltipProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
1029
1001
 
1002
+ interface DialogElementRef {
1003
+ /** Reference to the dialog container HTMLDivElement */
1004
+ current?: HTMLDivElement;
1005
+ /** Flag that tells if the dialog is visible or not */
1006
+ visible?: boolean;
1007
+ /** Show the dialog */
1008
+ show: () => void;
1009
+ /** Hide the dialog */
1010
+ hide: () => void;
1011
+ }
1012
+ interface DialogProps extends ComponentPropsWithRef<'div'> {
1013
+ /**
1014
+ * Initial visibility state of the dialog
1015
+ * */
1016
+ visible?: BooleanProp;
1017
+ /**
1018
+ * Renders the dialog content as full screen without a backdrop
1019
+ */
1020
+ fullScreen?: BooleanProp;
1021
+ /**
1022
+ * If not a fullscreen dialog, allows the user to dismiss the dialog by clicking in the backdrop
1023
+ */
1024
+ dismissOnBackdropClick?: BooleanProp;
1025
+ /**
1026
+ * Allows the dialog to be closed by pressing Escape key.
1027
+ */
1028
+ dismissOnEscape?: BooleanProp;
1029
+ }
1030
+ declare const Dialog: React__default.ForwardRefExoticComponent<Omit<DialogProps, "ref"> & React__default.RefAttributes<DialogElementRef>>;
1031
+
1032
+ interface InputFileProps extends ComponentPropsWithRef<'input'> {
1033
+ /**
1034
+ * The maxSize of the file in bytes
1035
+ */
1036
+ maxSize: number;
1037
+ /**
1038
+ * The extensionsBlackList of the uploader
1039
+ */
1040
+ extensionsBlackList: string[];
1041
+ /**
1042
+ * The addedLabel of the uploader
1043
+ */
1044
+ addedLabel: string;
1045
+ /**
1046
+ * The announceRemovedFileLabel of the uploader
1047
+ */
1048
+ announceRemovedFileLabel: string;
1049
+ /**
1050
+ * The removeFileLabel of the uploader
1051
+ */
1052
+ removeFileLabel: string;
1053
+ /**
1054
+ * The fileListLabel of the uploader
1055
+ */
1056
+ fileListLabel: string;
1057
+ /**
1058
+ * The fileDropZoneAriaLabel of the uploader
1059
+ */
1060
+ fileDropZoneAriaLabel: string;
1061
+ /**
1062
+ * The dropYourFilesHereLabel of the uploader
1063
+ */
1064
+ dropYourFilesHereLabel: string;
1065
+ /**
1066
+ * The allowedFilesAriaLabel of the uploader
1067
+ */
1068
+ allowedFilesAriaLabel: string;
1069
+ /**
1070
+ * The uploadFilesLabel of the uploader
1071
+ */
1072
+ uploadFilesLabel: string;
1073
+ /**
1074
+ * The id of the uploader
1075
+ */
1076
+ id?: string;
1077
+ /**
1078
+ * The fileLabel of the uploader
1079
+ */
1080
+ fileLabel: string;
1081
+ }
1082
+ declare const InputFile: ForwardRefRenderFunction<HTMLInputElement, InputFileProps>;
1083
+
1030
1084
  type AccordionGroupType = 'single' | 'multiple';
1031
1085
  interface AccordionGroupProps extends ComponentPropsWithRef<'div'> {
1032
1086
  /**
@@ -1090,10 +1144,30 @@ interface CheckboxGroupProps extends Omit<HtmlHTMLAttributes<HTMLDivElement>, 'o
1090
1144
  * Input label text.
1091
1145
  */
1092
1146
  label?: string;
1147
+ /**
1148
+ * Decides if display/hide label.
1149
+ */
1150
+ hideLabel?: BooleanProp;
1093
1151
  /**
1094
1152
  * List of checkboxes props to generate as checkboxes.
1095
1153
  */
1096
1154
  items?: CheckboxProps[];
1155
+ /**
1156
+ * Sets the checkbox in a error state. This also affects the feedback state.
1157
+ */
1158
+ hasError?: BooleanProp;
1159
+ /**
1160
+ * Show or hide the feedback status text.
1161
+ */
1162
+ hasFeedback?: BooleanProp;
1163
+ /**
1164
+ * Defines the state of the feedback text. This param will change the feedback icon and dye it.
1165
+ */
1166
+ feedbackState?: FeedbackState;
1167
+ /**
1168
+ * Feedback text displayed below checkbox-group.
1169
+ */
1170
+ feedbackText?: string;
1097
1171
  /**
1098
1172
  * List of checkbox components to use as children of the group.
1099
1173
  */
@@ -1223,10 +1297,30 @@ interface RadioButtonGroupProps extends Omit<HtmlHTMLAttributes<HTMLDivElement>,
1223
1297
  * Input label text.
1224
1298
  */
1225
1299
  label?: string;
1300
+ /**
1301
+ * Decides if display/hide label.
1302
+ */
1303
+ hideLabel?: BooleanProp;
1226
1304
  /**
1227
1305
  * Group name
1228
1306
  */
1229
1307
  name: string;
1308
+ /**
1309
+ * Sets the radio button in a error state. This also affects the feedback state.
1310
+ */
1311
+ hasError?: BooleanProp;
1312
+ /**
1313
+ * Show or hide the feedback status text.
1314
+ */
1315
+ hasFeedback?: BooleanProp;
1316
+ /**
1317
+ * Defines the state of the feedback text. This param will change the feedback icon and dye it.
1318
+ */
1319
+ feedbackState?: FeedbackState;
1320
+ /**
1321
+ * Feedback text displayed below radio-button.
1322
+ */
1323
+ feedbackText?: string;
1230
1324
  /**
1231
1325
  * List of radiobutton props to generate as radio buttons.
1232
1326
  */
@@ -1242,6 +1336,85 @@ interface RadioButtonGroupProps extends Omit<HtmlHTMLAttributes<HTMLDivElement>,
1242
1336
  }
1243
1337
  declare const RadioButtonGroup: FC<RadioButtonGroupProps>;
1244
1338
 
1339
+ type PopupDimensions = 's' | 'm' | 'l';
1340
+ interface PopupDialogProps extends Omit<ComponentPropsWithRef<'div'>, 'title'> {
1341
+ /**
1342
+ * Available popup sizes. Can be small (S), medium (M), and large (L) dimensions.
1343
+ */
1344
+ dimensions?: PopupDimensions;
1345
+ /**
1346
+ * Title of the popup dialog.
1347
+ */
1348
+ title: ReactNode;
1349
+ /**
1350
+ * Close button alternative text.
1351
+ */
1352
+ closeAriaLabel: string;
1353
+ /**
1354
+ * Children content.
1355
+ */
1356
+ children: ReactNode;
1357
+ }
1358
+ declare const PopupDialog: FC<PopupDialogProps>;
1359
+
1360
+ interface PopupContextProps {
1361
+ current: DialogElementRef | null;
1362
+ visibility?: boolean;
1363
+ show: (children: ReactNode, popupProps: PopupDialogProps) => void;
1364
+ hide: () => void;
1365
+ }
1366
+ declare const PopupContext: React$1.Context<PopupContextProps>;
1367
+ declare const usePopupContext: () => PopupContextProps;
1368
+
1369
+ interface PopupProviderProps {
1370
+ /**
1371
+ * If not a fullscreen dialog, allows the user to dismiss the dialog by clicking in the backdrop
1372
+ */
1373
+ dismissOnBackdropClick?: BooleanProp;
1374
+ /**
1375
+ * Allows the dialog to be closed by pressing Escape key.
1376
+ */
1377
+ dismissOnEscape?: BooleanProp;
1378
+ /**
1379
+ * Children content.
1380
+ */
1381
+ children: ReactNode;
1382
+ }
1383
+ declare const PopupProvider: FC<PopupProviderProps>;
1384
+
1385
+ interface ModalDialogProps extends Omit<ComponentPropsWithRef<'div'>, 'title'> {
1386
+ /**
1387
+ * Close button text.
1388
+ */
1389
+ closeButtonLabel: string;
1390
+ /**
1391
+ * Children content.
1392
+ */
1393
+ children: ReactNode;
1394
+ }
1395
+ declare const ModalDialog: FC<ModalDialogProps>;
1396
+
1397
+ interface ModalContextProps {
1398
+ current: DialogElementRef | null;
1399
+ visibility?: boolean;
1400
+ show: (children: ReactNode, popupProps: ModalDialogProps) => void;
1401
+ hide: () => void;
1402
+ }
1403
+ declare const ModalContext: React$1.Context<ModalContextProps>;
1404
+ declare const useModalContext: () => ModalContextProps;
1405
+
1406
+ interface ModalProviderProps {
1407
+ /**
1408
+ * Allows the dialog to be closed by pressing Escape key.
1409
+ */
1410
+ dismissOnEscape?: BooleanProp;
1411
+ /**
1412
+ * Children content.
1413
+ */
1414
+ children: ReactNode;
1415
+ }
1416
+ declare const ModalProvider: FC<ModalProviderProps>;
1417
+
1245
1418
  interface WeekDays {
1246
1419
  sun: string;
1247
1420
  mon: string;
@@ -1285,6 +1458,18 @@ interface InputDateProps extends ComponentPropsWithRef<'input'> {
1285
1458
  * Name of the icon leading icon to be displayed.
1286
1459
  */
1287
1460
  icon?: string;
1461
+ /**
1462
+ * The placeholder to apply in the input day part
1463
+ */
1464
+ dayInputPlaceholder?: string;
1465
+ /**
1466
+ * The placeholder to apply in the input month part
1467
+ */
1468
+ monthInputPlaceholder?: string;
1469
+ /**
1470
+ * The placeholder to apply in the input year part
1471
+ */
1472
+ yearInputPlaceholder?: string;
1288
1473
  /**
1289
1474
  * Accessible text to apply to the trailing calendar icon.
1290
1475
  */
@@ -1658,6 +1843,16 @@ declare const AgoraTailwindConfig: {
1658
1843
  16: string;
1659
1844
  32: string;
1660
1845
  };
1846
+ zIndex: {
1847
+ dropdown: string;
1848
+ backdrop: string;
1849
+ sticky: string;
1850
+ fixed: string;
1851
+ drawer: string;
1852
+ dialog: string;
1853
+ toast: string;
1854
+ tooltip: string;
1855
+ };
1661
1856
  };
1662
1857
  screens: {
1663
1858
  xs: string;
@@ -1981,4 +2176,4 @@ declare const AgoraTailwindConfig: {
1981
2176
  plugins: (({ addComponents }: any) => void)[];
1982
2177
  };
1983
2178
 
1984
- export { Accordion, AccordionGroup, type AccordionGroupProps, type AccordionGroupType, type AccordionProps, type AccordionRef, AgoraTailwindConfig, Anchor, type AnchorAppearance, type AnchorProps, type AnchorVariant, Avatar, type AvatarBadgePosition, type AvatarBadgeVariant, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarType, type BooleanProp, Breadcrumb, type BreadcrumbLink, type BreadcrumbProps, Button, type ButtonAppearance, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonVariant, type CardFooterProps, type CardLinksFooterProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type ContactsFooterProps, Drawer, type DrawerPosition, type DrawerProps, type DrawerRef, DropdownList, type DropdownListProps, DropdownSection, DropdownSectionOption, type DropdownSectionOptionProps, type DropdownSectionProps, type DropdownSectionType, FederatedFooter, type FederatedFooterProps, type FeedbackState, type GlossaryLetter, GlossaryLetters, type GlossaryLettersProps, Icon, type IconDimensions, type IconName, type IconPosition, type IconProps, InputDate, type InputDateProps, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, InputPhone, type InputPhoneProps, type InputPhoneRef, InputRange, InputSearch, type InputSearchProps, InputSelect, type InputSelectProps, InputText, InputTextArea, type InputTextAreaProps, type InputTextProps, type LetterStatus, type LinkableIconsProps, type LinkableImagesProps, List, type ListProps, type ListType, MenuItem, type MenuItemProps, type MenuItemRef, type MenuItemType, Modal, ModalContext, type ModalContextProps, type ModalProps, ModalProvider, type ModalProviderProps, type Months, type PhoneCountryCode, PhoneCountryCodes, type PhoneCountryISO, PhoneCountryISOs, Pill, type PillAppearance, type PillProps, type PillVariant, ProgressBar, ProgressBarGroup, type ProgressBarGroupProps, type ProgressBarProps, PublicFooter, type PublicFooterProps, RadioButton, RadioButtonGroup, type RadioButtonGroupProps, type RadioButtonProps, type RangeOrientation, type RangeProps, type RangeType, Scribbles, type ScribblesName, type ScribblesProps, StatusCard, type StatusCardProps, type StatusCardType, StepList, type StepListProps, Switch, type SwitchPosition, type SwitchProps, Tab, TabBody, type TabBodyProps, TabHeader, type TabHeaderProps, type TabProps, Tabs, type TabsProps, Tag, type TagProps, type TagVariant, Toast, ToastContext, type ToastContextProps, type ToastPositions, type ToastProps, ToastProvider, type ToastProviderProps, type ToastType, Tooltip, type TooltipAlignment, type TooltipPosition, type TooltipProps, type TooltipVariant, TypedEventEmitter, allIcons, allScribbles, debounce, normalizeText, stringToBoolean, useModal, useModalContext, useToast, useToastContext, useWindowSize };
2179
+ export { Accordion, AccordionGroup, type AccordionGroupProps, type AccordionGroupType, type AccordionProps, type AccordionRef, AgoraTailwindConfig, Anchor, type AnchorAppearance, type AnchorProps, type AnchorVariant, Avatar, type AvatarBadgePosition, type AvatarBadgeVariant, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarType, type BooleanProp, Breadcrumb, type BreadcrumbLink, type BreadcrumbProps, Button, type ButtonAppearance, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonVariant, type CardFooterProps, type CardLinksFooterProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type ContactsFooterProps, Dialog, type DialogElementRef, type DialogProps, Drawer, type DrawerPosition, type DrawerProps, type DrawerRef, DropdownList, type DropdownListProps, DropdownSection, DropdownSectionOption, type DropdownSectionOptionProps, type DropdownSectionProps, type DropdownSectionType, FederatedFooter, type FederatedFooterProps, type FeedbackState, type GlossaryLetter, GlossaryLetters, type GlossaryLettersProps, Icon, type IconDimensions, type IconName, type IconPosition, type IconProps, InputDate, type InputDateProps, InputFile, type InputFileProps, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, InputPhone, type InputPhoneProps, type InputPhoneRef, InputRange, InputSearch, type InputSearchProps, InputSelect, type InputSelectProps, InputText, InputTextArea, type InputTextAreaProps, type InputTextProps, type LetterStatus, type LinkableIconsProps, type LinkableImagesProps, List, type ListProps, type ListStyle, type ListType, MenuItem, type MenuItemProps, type MenuItemRef, type MenuItemType, ModalContext, type ModalContextProps, ModalDialog, type ModalDialogProps, ModalProvider, type ModalProviderProps, type Months, type PhoneCountryCode, PhoneCountryCodes, type PhoneCountryISO, PhoneCountryISOs, Pill, type PillAppearance, type PillProps, type PillVariant, PopupContext, type PopupContextProps, PopupDialog, type PopupDialogProps, type PopupDimensions, PopupProvider, type PopupProviderProps, ProgressBar, ProgressBarGroup, type ProgressBarGroupProps, type ProgressBarProps, PublicFooter, type PublicFooterProps, RadioButton, RadioButtonGroup, type RadioButtonGroupProps, type RadioButtonProps, type RangeOrientation, type RangeProps, type RangeType, Scribbles, type ScribblesName, type ScribblesProps, StatusCard, type StatusCardProps, type StatusCardType, StepList, type StepListProps, Switch, type SwitchPosition, type SwitchProps, Tab, TabBody, type TabBodyProps, TabHeader, type TabHeaderProps, type TabProps, Tabs, type TabsProps, Tag, type TagProps, type TagVariant, Toast, ToastContext, type ToastContextProps, type ToastPositions, type ToastProps, ToastProvider, type ToastProviderProps, type ToastType, Tooltip, type TooltipAlignment, type TooltipPosition, type TooltipProps, type TooltipVariant, TypedEventEmitter, allIcons, allScribbles, debounce, normalizeText, stringToBoolean, useModalContext, usePopupContext, useToast, useToastContext, useWindowSize };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ama-pt/agora-design-system",
3
3
  "description": "Ágora Design system",
4
- "version": "0.4.0",
4
+ "version": "0.5.0",
5
5
  "engines": {
6
6
  "node": "18.17.1"
7
7
  },