@ama-pt/agora-design-system 1.2.2 → 1.3.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.
@@ -6,14 +6,26 @@ export interface AccordionElement extends HTMLDivElement {
6
6
  * Expand the accordion.
7
7
  */
8
8
  expand: () => void;
9
+ /**
10
+ * Expand the accordion without triggering any event (onExpanded and onChange will not be triggered).
11
+ */
12
+ silentExpand: () => void;
9
13
  /**
10
14
  * Collapse the accordion.
11
15
  */
12
16
  collapse: () => void;
17
+ /**
18
+ * Collapse the accordion without triggering any event (onCollapse and onChange will not be triggered).
19
+ */
20
+ silentCollapse: () => void;
13
21
  /**
14
22
  * Toggles the content of the accordion.
15
23
  */
16
24
  toggle: () => void;
25
+ /**
26
+ * Toggles the accordion without triggering any event (onCollapse, onExpanded and onChange will not be triggered).
27
+ */
28
+ silentToggle: () => void;
17
29
  /**
18
30
  * Current value of the expanded state of the accordion.
19
31
  */
@@ -48,9 +60,17 @@ export interface AccordionProps extends ComponentPropsWithRef<'div'> {
48
60
  * Event function called whenever the accordion collapses.
49
61
  */
50
62
  onCollapsed?: (evt: SyntheticEvent<AccordionElement | undefined>) => void | undefined;
63
+ /**
64
+ * Event function called whenever the accordion expands or collapses.
65
+ */
66
+ onChange?: (evt: SyntheticEvent<AccordionElement | undefined>) => void | undefined;
51
67
  /**
52
68
  * Initial value for the expanded value.
53
69
  */
70
+ defaultExpanded?: BooleanProp;
71
+ /**
72
+ * Value for the expanded value.
73
+ */
54
74
  expanded?: BooleanProp;
55
75
  /**
56
76
  * React ref object to the accordion.
@@ -1,15 +1,10 @@
1
1
  import React, { ComponentPropsWithRef, ForwardRefRenderFunction, ReactElement } from 'react';
2
2
  import { AccordionProps } from '../../components/accordion';
3
- export type AccordionGroupType = 'single' | 'multiple';
4
3
  export interface AccordionGroupProps extends ComponentPropsWithRef<'div'> {
5
4
  /**
6
- * List of accordion components to use as children of the group.
5
+ * List of accordion components to use as children of the group.
7
6
  */
8
7
  children?: ReactElement<AccordionProps> | Array<ReactElement<AccordionProps>>;
9
- /**
10
- * Option to open multiple accordions or just one at a time.
11
- */
12
- type?: AccordionGroupType;
13
8
  }
14
9
  export declare const InnerAccordionGroup: ForwardRefRenderFunction<HTMLDivElement, AccordionGroupProps>;
15
10
  export declare const AccordionGroup: React.ForwardRefExoticComponent<Omit<AccordionGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1,2 +1,2 @@
1
1
  export { AccordionGroup } from './accordion-group';
2
- export type { AccordionGroupProps, AccordionGroupType } from './accordion-group';
2
+ export type { AccordionGroupProps } from './accordion-group';
@@ -49,6 +49,7 @@ export * from './sidebar';
49
49
  export * from './skip-navigation';
50
50
  export * from './status-card';
51
51
  export * from './step-list';
52
+ export * from './stepper';
52
53
  export * from './switch';
53
54
  export * from './table';
54
55
  export * from './tabs';
@@ -3,7 +3,14 @@ import React, { ComponentPropsWithRef, ReactElement, ReactNode } from 'react';
3
3
  import { DropdownOptionProps, DropdownSectionProps, DropdownType } from '../../components/dropdown';
4
4
  import './input-select.scss';
5
5
  export interface InputSelectRef {
6
+ /**
7
+ * Array containing the selected options in the dropdown.
8
+ */
6
9
  selectedOptions: DropdownOptionProps[];
10
+ /**
11
+ * Reset the selection state within the component.
12
+ */
13
+ clearSelectedOptions: () => void;
7
14
  }
8
15
  export interface InputSelectProps extends Omit<ComponentPropsWithRef<'select'>, 'options' | 'onChange'> {
9
16
  /**
@@ -1 +1 @@
1
- export type SidebarVariantType = 'filter' | 'navigation' | 'navigation-tabs';
1
+ export type SidebarVariantType = 'filter' | 'navigation';
@@ -1,6 +1,6 @@
1
+ import { SidebarProps } from '../../../components/sidebar';
1
2
  import { FC, RefObject } from 'react';
2
3
  import './sidebar-item-navigation-mobile.scss';
3
- import { SidebarProps } from '../../../components/sidebar';
4
4
  export declare const SidebarItemNavigationMobile: FC<SidebarProps & {
5
5
  sidebarRef: RefObject<HTMLUListElement>;
6
6
  }>;
@@ -0,0 +1,4 @@
1
+ export { Stepper } from './stepper';
2
+ export type { StepperProps } from './stepper';
3
+ export { Step } from './step';
4
+ export type { StepProps } from './step';
@@ -0,0 +1,18 @@
1
+ import { ComponentPropsWithRef, FC } from 'react';
2
+ import { BooleanProp } from '../../models';
3
+ import './step.scss';
4
+ /**
5
+ * Available step status.
6
+ */
7
+ export type StepStatusType = 'done' | 'error' | 'current' | 'draft' | 'disabled' | 'default';
8
+ export interface StepProps extends ComponentPropsWithRef<'button'> {
9
+ /**
10
+ * Defines if the step is interactive. If the parent stepper have interactive prop defined, it will override this prop.
11
+ */
12
+ interactive?: BooleanProp;
13
+ /**
14
+ * The status of the step.
15
+ */
16
+ status?: StepStatusType;
17
+ }
18
+ export declare const Step: FC<StepProps>;
@@ -0,0 +1,16 @@
1
+ import { BooleanProp } from '../../models';
2
+ import React, { ComponentPropsWithRef, ForwardRefRenderFunction, ReactElement } from 'react';
3
+ import { StepProps } from './step';
4
+ import './stepper.scss';
5
+ export interface StepperProps extends ComponentPropsWithRef<'div'> {
6
+ /**
7
+ * Defines if the stepper is interactive or not.
8
+ */
9
+ interactive?: BooleanProp;
10
+ /**
11
+ * List of steps.
12
+ */
13
+ children?: ReactElement<StepProps> | ReactElement<StepProps>[];
14
+ }
15
+ export declare const InnerStepper: ForwardRefRenderFunction<HTMLDivElement, StepperProps>;
16
+ export declare const Stepper: React.ForwardRefExoticComponent<Omit<StepperProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1,4 +1,4 @@
1
- import React, { ComponentPropsWithRef, ReactElement, ReactNode } from 'react';
1
+ import React, { ComponentPropsWithRef, ReactElement } from 'react';
2
2
  import { TableLayout } from './models/table-layout.type';
3
3
  import { TableBodyProps } from './table-body';
4
4
  import { TableCaptionProps } from './table-caption';
@@ -7,10 +7,6 @@ import { TableHeaderProps } from './table-header';
7
7
  import { TablePaginationProps } from './table-pagination';
8
8
  import './table.scss';
9
9
  export interface TableProps extends ComponentPropsWithRef<'table'> {
10
- /**
11
- * Define the title of table
12
- */
13
- caption?: ReactNode;
14
10
  /**
15
11
  * Table children content
16
12
  */
@@ -0,0 +1,19 @@
1
+ import { BooleanProp } from '../../../models';
2
+ import React, { ComponentPropsWithoutRef, FC, ReactElement } from 'react';
3
+ import { TabBodyProps } from '../tab-body';
4
+ import { TabHeaderProps } from '../tab-header';
5
+ import { TabCurrentType } from '../tabs';
6
+ import './tabs-desktop.scss';
7
+ export interface TabsDesktopProps extends ComponentPropsWithoutRef<'div'> {
8
+ fullWidth: BooleanProp;
9
+ vertically?: BooleanProp;
10
+ tabListRef: React.RefObject<HTMLDivElement>;
11
+ tabPanelRef: React.RefObject<HTMLDivElement>;
12
+ activeTab: number;
13
+ activateTab: (index: number) => void;
14
+ currentType: TabCurrentType;
15
+ tabPanelClassName: string;
16
+ tabsHeaderData: Array<ReactElement<TabHeaderProps>>;
17
+ tabsBodyData: Array<ReactElement<TabBodyProps>>;
18
+ }
19
+ export declare const TabsDesktop: FC<TabsDesktopProps>;
@@ -0,0 +1,17 @@
1
+ import { BooleanProp } from '../../../models';
2
+ import React, { ComponentPropsWithoutRef, FC, ReactElement } from 'react';
3
+ import { TabBodyProps } from '../tab-body';
4
+ import { TabHeaderProps } from '../tab-header';
5
+ import { TabCurrentType } from '../tabs';
6
+ import './tabs-mobile.scss';
7
+ interface TabsMobileProps extends ComponentPropsWithoutRef<'div'> {
8
+ fullWidth: BooleanProp;
9
+ tabListRef: React.RefObject<HTMLDivElement>;
10
+ activeTab: number;
11
+ activateTab: (index: number) => void;
12
+ currentType: TabCurrentType;
13
+ tabsHeaderData: Array<ReactElement<TabHeaderProps>>;
14
+ tabsBodyData: Array<ReactElement<TabBodyProps>>;
15
+ }
16
+ export declare const TabsMobile: FC<TabsMobileProps>;
17
+ export {};
@@ -1,7 +1,6 @@
1
- import { ComponentPropsWithoutRef, FC, ReactElement } from 'react';
2
1
  import { BooleanProp } from '../../models';
2
+ import { ComponentPropsWithoutRef, FC, ReactElement } from 'react';
3
3
  import { TabProps } from './tab';
4
- import './tabs.scss';
5
4
  export type TabCurrentType = 'neutral' | 'primary' | 'secondary';
6
5
  export interface TabsProps extends ComponentPropsWithoutRef<'div'> {
7
6
  /**
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": "1.2.2",
4
+ "version": "1.3.0",
5
5
  "main": "artifacts/dist/index.mjs",
6
6
  "module": "artifacts/dist/index.umd.js",
7
7
  "files": [
@@ -32,21 +32,21 @@
32
32
  "@babel/preset-typescript": "^7.22.5",
33
33
  "@mdx-js/react": "^2.3.0",
34
34
  "@playwright/test": "^1.39.0",
35
- "@storybook/addon-a11y": "^8.3.6",
36
- "@storybook/addon-actions": "^8.3.6",
37
- "@storybook/addon-docs": "^8.3.6",
38
- "@storybook/addon-essentials": "^8.3.6",
39
- "@storybook/addon-interactions": "^8.3.6",
40
- "@storybook/addon-links": "^8.3.6",
41
- "@storybook/addon-storysource": "^8.3.6",
42
- "@storybook/blocks": "^8.3.6",
35
+ "@storybook/addon-a11y": "^8.4.5",
36
+ "@storybook/addon-actions": "^8.4.5",
37
+ "@storybook/addon-docs": "^8.4.5",
38
+ "@storybook/addon-essentials": "^8.4.5",
39
+ "@storybook/addon-interactions": "^8.4.5",
40
+ "@storybook/addon-links": "^8.4.5",
41
+ "@storybook/addon-storysource": "^8.4.5",
42
+ "@storybook/blocks": "^8.4.5",
43
43
  "@storybook/mdx2-csf": "^1.1.0",
44
44
  "@storybook/preset-scss": "^1.0.3",
45
- "@storybook/react": "^8.3.6",
46
- "@storybook/react-vite": "^8.3.6",
47
- "@storybook/test": "^8.3.6",
48
- "@storybook/theming": "^8.3.6",
49
- "@storybook/types": "^8.3.6",
45
+ "@storybook/react": "^8.4.5",
46
+ "@storybook/react-vite": "^8.4.5",
47
+ "@storybook/test": "^8.4.5",
48
+ "@storybook/theming": "^8.4.5",
49
+ "@storybook/types": "^8.4.5",
50
50
  "@testing-library/jest-dom": "^6.4.2",
51
51
  "@testing-library/react": "^15.0.1",
52
52
  "@testing-library/user-event": "^14.5.1",
@@ -73,7 +73,7 @@
73
73
  "eslint-plugin-prettier": "^5.0.0",
74
74
  "eslint-plugin-react": "^7.33.2",
75
75
  "eslint-plugin-react-hooks": "^4.6.0",
76
- "eslint-plugin-storybook": "^0.8.0",
76
+ "eslint-plugin-storybook": "^0.11.1",
77
77
  "glob": "^10.3.3",
78
78
  "gulp": "^4.0.2",
79
79
  "gulp-clean-css": "^4.3.0",
@@ -90,7 +90,7 @@
90
90
  "react": "^18.2.0",
91
91
  "react-dom": "^18.2.0",
92
92
  "react-syntax-highlighter": "^15.5.0",
93
- "storybook": "^8.3.6",
93
+ "storybook": "^8.4.5",
94
94
  "tailwindcss": "^3.4.1",
95
95
  "ts-dedent": "^2.2.0",
96
96
  "ts-jest": "^29.1.2",
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { SVGIconProps } from '../../../models';
3
- declare const _default: (props: SVGIconProps) => React.JSX.Element;
4
- export default _default;