@ssa-ui-kit/core 3.3.0 → 3.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.
@@ -21,7 +21,7 @@ export interface GaugeBarProps {
21
21
  max?: number;
22
22
  }
23
23
  export interface BarGaugeChartProps {
24
- title?: string;
24
+ title?: React.ReactNode;
25
25
  widgetCardProps?: WidgetCardProps;
26
26
  bars?: GaugeBarProps[];
27
27
  features?: BarGaugeChartFeature[];
@@ -1,16 +1 @@
1
1
  export declare const FONT_FAMILY = "Manrope, sans-serif";
2
- export declare const TITLE_PADDING_LEFT: {
3
- mobile: number;
4
- md: number;
5
- other: number;
6
- };
7
- export declare const TITLE_PADDING_TOP: {
8
- mobile: number;
9
- md: number;
10
- other: number;
11
- };
12
- export declare const TITLE_FONT_SIZE: {
13
- mobile: number;
14
- md: number;
15
- other: number;
16
- };
@@ -15,7 +15,7 @@ export interface BarLineComplexChartProps extends Omit<PlotParams, 'layout'> {
15
15
  lineShape?: Plotly.ScatterLine['shape'];
16
16
  width?: string;
17
17
  height?: string;
18
- title?: string;
18
+ title?: React.ReactNode;
19
19
  maxVisibleBars?: number;
20
20
  maxVisibleLines?: number;
21
21
  container?: Element | DocumentFragment;
@@ -6,7 +6,7 @@ type Datum = LineSeries['data'][number];
6
6
  export interface BigNumberChartProps {
7
7
  data: Datum[];
8
8
  interactive?: boolean;
9
- title?: string;
9
+ title?: React.ReactNode;
10
10
  widgetCardProps?: WidgetCardProps;
11
11
  trendLineProps?: Omit<TrendLineProps, 'data' | 'height' | 'width'>;
12
12
  features?: BigNumberChartFeatures[];
@@ -5,7 +5,7 @@ export type CandlestickChartFeatures = 'header' | 'fullscreenMode';
5
5
  export interface CandlestickChartProps extends Partial<Omit<PlotParams, 'data' | 'style'>> {
6
6
  data: CandlestickChartData;
7
7
  style?: CandlestickStyle;
8
- title?: string;
8
+ title?: React.ReactNode;
9
9
  features?: CandlestickChartFeatures[];
10
10
  widgetCardProps?: WidgetCardProps;
11
11
  }
@@ -5,7 +5,7 @@ export interface GaugeChartProps extends Pick<GaugeChartLabelsProps, 'maxLabel'
5
5
  minValue: number;
6
6
  maxValue: number;
7
7
  value: number;
8
- title?: string;
8
+ title?: React.ReactNode;
9
9
  segments?: {
10
10
  value: number;
11
11
  id?: string;
@@ -4,7 +4,7 @@ declare const ResponsiveRadar: <D extends Record<string, unknown>>(props: import
4
4
  export type RadarChartFeatures = 'header' | 'fullscreenMode';
5
5
  type ResponsiveRadarProps<D extends Record<string, unknown>> = ComponentProps<typeof ResponsiveRadar<D>>;
6
6
  export interface RadarChartProps<D extends Record<string, unknown>> extends Omit<ResponsiveRadarProps<D>, 'legends'> {
7
- title?: string;
7
+ title?: React.ReactNode;
8
8
  legends?: Partial<NonNullable<ResponsiveRadarProps<D>['legends']>[number]>[];
9
9
  features?: RadarChartFeatures[];
10
10
  widgetCardProps?: WidgetCardProps;
@@ -10,7 +10,7 @@ export type TreeMapChartFeature = 'header' | 'fullscreenMode';
10
10
  type NivoTreeMapChartProps = React.ComponentProps<typeof ResponsiveTreeMap<TreeNode>>;
11
11
  export interface TreeMapChartProps extends Omit<NivoTreeMapChartProps, 'data'> {
12
12
  data: TreeNode;
13
- title?: string;
13
+ title?: React.ReactNode;
14
14
  fullScreen?: boolean;
15
15
  features?: TreeMapChartFeature[];
16
16
  widgetCardProps?: WidgetCardProps;
@@ -5,8 +5,13 @@ import { DropdownProps } from './types';
5
5
  *
6
6
  * A flexible dropdown component that allows users to select one option from
7
7
  * a list of choices. Uses a compound component pattern with DropdownOption
8
- * children. Provides keyboard navigation, accessibility features, and click-outside
9
- * to close functionality.
8
+ * children. Provides keyboard navigation, accessibility features, click-outside
9
+ * to close functionality, and automatic viewport-aware placement of the options list.
10
+ *
11
+ * On every open the component measures available space below the toggle button
12
+ * and flips the list upward when there is not enough room, preventing the list
13
+ * from being clipped by the viewport edge. This behavior can be overridden via
14
+ * dropdownProps.dropdownPosition.
10
15
  *
11
16
  * Component structure:
12
17
  * - Dropdown (root container with context)
@@ -57,14 +62,15 @@ import { DropdownProps } from './types';
57
62
  *
58
63
  * @example
59
64
  * ```tsx
60
- * // With custom props for sub-components
65
+ * // With custom props for sub-components and forced upward placement
61
66
  * <Dropdown
62
67
  * selectedItem={selected}
63
68
  * onChange={handleChange}
64
69
  * dropdownProps={{
65
70
  * base: { id: 'my-dropdown' },
66
71
  * toggleButton: { 'data-testid': 'dropdown-toggle' },
67
- * toggleButtonArrow: { className: 'custom-arrow' }
72
+ * toggleButtonArrow: { className: 'custom-arrow' },
73
+ * dropdownPosition: DropdownPositions.top,
68
74
  * }}
69
75
  * >
70
76
  * {options.map(opt => (
@@ -3,6 +3,11 @@ import { Interpolation, Theme } from '@emotion/react';
3
3
  import { DropdownOptionProps } from '../DropdownOptions';
4
4
  import { CommonProps } from '../../types/emotion';
5
5
  import { IconProps } from '../Icon/types';
6
+ export declare enum DropdownPositions {
7
+ top = "top",
8
+ bottom = "bottom",
9
+ auto = "auto"
10
+ }
6
11
  /**
7
12
  * Props that are controlled by Dropdown component
8
13
  * These props cannot be passed via dropdownProps.toggleButton
@@ -13,7 +18,8 @@ export type ControlledButtonProps = 'onClick' | 'onFocus' | 'disabled' | 'type'
13
18
  *
14
19
  * A select-like dropdown component that allows users to choose one option from
15
20
  * a list. Uses compound component pattern with DropdownOption children.
16
- * Provides keyboard navigation, accessibility, and customizable styling.
21
+ * Provides keyboard navigation, accessibility, customizable styling, and
22
+ * automatic viewport-aware placement of the options list.
17
23
  *
18
24
  * @example
19
25
  * ```tsx
@@ -34,6 +40,18 @@ export type ControlledButtonProps = 'onClick' | 'onFocus' | 'disabled' | 'type'
34
40
  * ))}
35
41
  * </Dropdown>
36
42
  * ```
43
+ *
44
+ * @example
45
+ * ```tsx
46
+ * // Force the list to always open upward (e.g. component near the bottom of the page)
47
+ * <Dropdown
48
+ * selectedItem={selected}
49
+ * onChange={handleChange}
50
+ * dropdownProps={{ dropdownPosition: DropdownPositions.top }}
51
+ * >
52
+ * ...
53
+ * </Dropdown>
54
+ * ```
37
55
  */
38
56
  export interface DropdownProps<P extends DropdownOptionProps> extends CommonProps {
39
57
  /**
@@ -109,6 +127,15 @@ export interface DropdownProps<P extends DropdownOptionProps> extends CommonProp
109
127
  };
110
128
  /** Props for the arrow icon SVG element */
111
129
  toggleButtonArrow?: Omit<IconProps, 'name' | 'size'>;
130
+ /**
131
+ * Controls the opening direction of the options list.
132
+ * - DropdownPositions.auto: opens downward by default; flips upward automatically when
133
+ * there is insufficient space below the toggle in the viewport
134
+ * - DropdownPositions.top: always opens upward
135
+ * - DropdownPositions.bottom: always opens downward
136
+ * @default DropdownPositions.auto
137
+ */
138
+ dropdownPosition?: DropdownPositions;
112
139
  };
113
140
  }
114
141
  /**
@@ -130,4 +157,14 @@ export interface DropdownContextType {
130
157
  * Max height (px) of the options list
131
158
  */
132
159
  maxHeight?: number;
160
+ /**
161
+ * Ref attached to the options list element
162
+ * Used by Dropdown to measure actual list height for placement calculation
163
+ */
164
+ listRef?: React.RefObject<HTMLUListElement | null>;
165
+ /**
166
+ * Resolved placement of the options list
167
+ * Computed by Dropdown based on dropdownPosition prop and available viewport space
168
+ */
169
+ placement?: 'top' | 'bottom';
133
170
  }
@@ -5,6 +5,11 @@ import { DropdownItemsListProps } from './types';
5
5
  * Renders the scrollable list of options that appears when the dropdown is open.
6
6
  * Provides proper ARIA attributes for accessibility and keyboard navigation.
7
7
  *
8
+ * Placement (opening upward or downward) is driven entirely by the parent
9
+ * Dropdown via context — this component does not calculate position itself.
10
+ * A ref is attached to the list element so Dropdown can measure its actual
11
+ * rendered height when determining the correct placement on each open.
12
+ *
8
13
  * @category Form Controls
9
14
  * @subcategory Selection
10
15
  *
@@ -40,4 +40,4 @@ import { RowsPerPageDropdownProps } from './types';
40
40
  * - Keyboard navigation support
41
41
  * - Screen reader friendly
42
42
  */
43
- export declare const RowsPerPageDropdown: ({ selectedItem, rowsPerPageList, rowsPerPageText, ...rest }: RowsPerPageDropdownProps) => import("@emotion/react/jsx-runtime").JSX.Element;
43
+ export declare const RowsPerPageDropdown: ({ selectedItem, rowsPerPageList, rowsPerPageText, dropdownPosition, ...rest }: RowsPerPageDropdownProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { CommonProps } from '../../../../types/emotion';
2
+ import { DropdownPositions } from '../../../index';
2
3
  /**
3
4
  * Props for the RowsPerPageDropdown component
4
5
  *
@@ -45,4 +46,13 @@ export interface RowsPerPageDropdownProps extends CommonProps {
45
46
  id: number;
46
47
  value: number;
47
48
  }>;
49
+ /**
50
+ * Controls the opening direction of the options list.
51
+ * - DropdownPositions.auto: opens downward by default; flips upward automatically when
52
+ * there is insufficient space below the toggle in the viewport
53
+ * - DropdownPositions.top: always opens upward
54
+ * - DropdownPositions.bottom: always opens downward
55
+ * @default DropdownPositions.auto
56
+ */
57
+ dropdownPosition?: DropdownPositions;
48
58
  }
@@ -87,8 +87,11 @@ export interface PaginationProps extends CommonProps {
87
87
  */
88
88
  isPageFromCountVisible?: boolean;
89
89
  /**
90
- * Props for the rows per page dropdown
91
- * Only used when isRowPerPageVisible is true
90
+ * Props for the rows per page dropdown.
91
+ * Only used when isRowPerPageVisible is true.
92
+ * Use rowPerPageProps.dropdownPosition to control the opening direction
93
+ * ('auto' | 'top' | 'bottom'). Defaults to 'auto', which flips the list
94
+ * upward automatically when there is insufficient space below the toggle.
92
95
  */
93
96
  rowPerPageProps?: RowsPerPageDropdownProps;
94
97
  /**