@ssa-ui-kit/core 3.22.0 → 3.23.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.
Files changed (42) hide show
  1. package/dist/ai/source-map.md +97 -27
  2. package/dist/components/Carousel/Carousel.d.ts +62 -0
  3. package/dist/components/Carousel/index.d.ts +1 -0
  4. package/dist/components/Carousel/styles.d.ts +27 -0
  5. package/dist/components/Carousel/types.d.ts +141 -0
  6. package/dist/components/Charts/FunnelChart/FunnelChart.d.ts +24 -0
  7. package/dist/components/Charts/FunnelChart/index.d.ts +2 -0
  8. package/dist/components/Charts/FunnelChart/styles.d.ts +10 -0
  9. package/dist/components/Charts/FunnelChart/types.d.ts +62 -0
  10. package/dist/components/Charts/FunnelChart/utils.d.ts +25 -0
  11. package/dist/components/Charts/index.d.ts +1 -0
  12. package/dist/components/Drawer/DrawerActions.d.ts +44 -0
  13. package/dist/components/Drawer/DrawerFooter.d.ts +33 -0
  14. package/dist/components/Drawer/DrawerRoot.d.ts +10 -4
  15. package/dist/components/Drawer/constants.d.ts +17 -0
  16. package/dist/components/Drawer/index.parts.d.ts +2 -0
  17. package/dist/components/Drawer/useDrawer.d.ts +23 -0
  18. package/dist/components/NavBar/NavBarList.d.ts +5 -0
  19. package/dist/components/Table/ColumnResizeContext.d.ts +30 -0
  20. package/dist/components/Table/ColumnResizeHandle.d.ts +47 -0
  21. package/dist/components/Table/ColumnResizeHandle.types.d.ts +29 -0
  22. package/dist/components/Table/Table.d.ts +67 -5
  23. package/dist/components/Table/TableBase.d.ts +36 -0
  24. package/dist/components/Table/consts.d.ts +8 -0
  25. package/dist/components/Table/hooks/useColumnResize.d.ts +76 -0
  26. package/dist/components/Table/index.d.ts +5 -0
  27. package/dist/components/Table/types.d.ts +149 -0
  28. package/dist/components/TableCellHeader/TableCellHeader.d.ts +2 -1
  29. package/dist/components/TableCellHeader/types.d.ts +18 -1
  30. package/dist/components/Tooltip/types.d.ts +2 -2
  31. package/dist/components/Typeahead/Typeahead.context.d.ts +1 -0
  32. package/dist/components/Typeahead/Typeahead.d.ts +1 -1
  33. package/dist/components/Typeahead/singleLine.d.ts +52 -0
  34. package/dist/components/Typeahead/styles.d.ts +19 -0
  35. package/dist/components/Typeahead/types.d.ts +10 -1
  36. package/dist/components/Typeahead/useTypeahead.d.ts +2 -1
  37. package/dist/components/index.d.ts +4 -0
  38. package/dist/index.js +2396 -347
  39. package/dist/index.mjs +2392 -348
  40. package/dist/tsbuildcache +1 -1
  41. package/dist/types/emotion.d.ts +9 -0
  42. package/package.json +3 -3
@@ -25,4 +25,21 @@ import { TableCellProps } from '../TableCell/types';
25
25
  * </TableRow>
26
26
  * ```
27
27
  */
28
- export type TableCellHeaderProps = TableCellProps;
28
+ export interface TableCellHeaderProps extends TableCellProps {
29
+ /**
30
+ * Whether this column can be resized inside a `Table` with
31
+ * `resizableColumns`. Set it to `false` to pin a column — an actions or
32
+ * checkbox column, typically — at a width the user cannot change.
33
+ *
34
+ * In the default `fit` mode this also removes the handle from the column to
35
+ * its *left*, because that handle resizes by trading width with this one and
36
+ * would otherwise move a column the user was told they could not move. In
37
+ * `expand` mode nothing pays for a resize, so only this column's own handle
38
+ * goes.
39
+ *
40
+ * Ignored outside a resizable table.
41
+ *
42
+ * @default true
43
+ */
44
+ resizable?: boolean;
45
+ }
@@ -161,7 +161,7 @@ type UseInteractions = ReturnType<typeof useInteractions>;
161
161
  interface RefObject<T> {
162
162
  current: T;
163
163
  }
164
- export type UseTooltip = (props?: UseTooltipArgs) => Required<Pick<TooltipProps, 'color' | 'hasBorder' | 'hasShadow'>> & Pick<TooltipProps, 'size' | 'hasArrow' | 'arrowProps'> & {
164
+ export type UseTooltip = (props?: UseTooltipArgs) => Required<Pick<TooltipProps, 'color' | 'hasBorder' | 'hasShadow'>> & Pick<TooltipProps, 'size' | 'hasArrow' | 'arrowProps' | 'enableClick'> & {
165
165
  arrowRef: RefObject<null>;
166
166
  isOpen: boolean;
167
167
  setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
@@ -170,7 +170,7 @@ export type TooltipContextType = (UseFloatingReturn & ReturnType<typeof useInter
170
170
  arrowRef: React.Ref<SVGSVGElement>;
171
171
  isOpen: boolean;
172
172
  setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
173
- } & Required<Pick<TooltipProps, 'color' | 'hasBorder' | 'hasShadow'>> & Pick<TooltipProps, 'size' | 'hasArrow' | 'arrowProps'>) | null;
173
+ } & Required<Pick<TooltipProps, 'color' | 'hasBorder' | 'hasShadow'>> & Pick<TooltipProps, 'size' | 'hasArrow' | 'arrowProps' | 'enableClick'>) | null;
174
174
  export type TooltipArrowProps = Omit<React.ComponentProps<typeof FloatingArrow>, 'context'>;
175
175
  /**
176
176
  * Props for TooltipContent component
@@ -9,6 +9,7 @@ export declare const TypeaheadContext: React.Context<{
9
9
  inputRef: React.RefObject<HTMLInputElement | null>;
10
10
  firstSuggestion: string;
11
11
  isMultiple: boolean | undefined;
12
+ singleLine: boolean;
12
13
  typeaheadId: string;
13
14
  triggerRef: React.RefObject<HTMLDivElement | null>;
14
15
  className: string | undefined;
@@ -172,4 +172,4 @@ import { TypeaheadProps } from './types';
172
172
  *
173
173
  * @see https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
174
174
  */
175
- export declare const Typeahead: ({ name, label, value, defaultValue, selectedItems, defaultSelectedItems, isOpen, disabled, isDisabled, isMultiple, children, className, startIcon, endIcon, error, success, helperText, validationSchema, placeholder, startIconClassName, endIconClassName, popoverClassName, optionsClassName, wrapperClassName, filterOptions, autoSelect, allowCustomValues, width, onChange, onEmptyChange, onClearAll, onRemoveSelectedClick, renderOption, }: TypeaheadProps) => import("@emotion/react/jsx-runtime").JSX.Element;
175
+ export declare const Typeahead: ({ name, label, value, defaultValue, selectedItems, defaultSelectedItems, isOpen, disabled, isDisabled, isMultiple, singleLine, children, className, startIcon, endIcon, error, success, helperText, validationSchema, placeholder, startIconClassName, endIconClassName, popoverClassName, optionsClassName, wrapperClassName, filterOptions, autoSelect, allowCustomValues, width, onChange, onEmptyChange, onClearAll, onRemoveSelectedClick, renderOption, }: TypeaheadProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,52 @@
1
+ import { RefObject } from 'react';
2
+ /** Gap between the trigger's flex children, matches `S.TypeaheadTrigger`. */
3
+ export declare const SINGLE_LINE_GAP = 8;
4
+ /**
5
+ * Room always left for the search input, so typing never pushes chips around.
6
+ * Matches the input group's `min-width` while the popup is open.
7
+ */
8
+ export declare const SINGLE_LINE_INPUT_MIN_WIDTH = 50;
9
+ /**
10
+ * Width reserved for the hidden-items Counter before it has been rendered.
11
+ * Matches its small size, which is a 24px circle up to two digits.
12
+ */
13
+ export declare const SINGLE_LINE_COUNTER_WIDTH = 24;
14
+ /**
15
+ * Same timing and size as the Dropdown option tooltips (#669): long enough not
16
+ * to fire while the pointer is travelling across, capped so a long label does
17
+ * not produce an unreadably wide tooltip.
18
+ */
19
+ export declare const LABEL_TOOLTIP_DELAY = 1000;
20
+ export declare const LABEL_TOOLTIP_MAX_WIDTH = 320;
21
+ /**
22
+ * Only a primitive is safe to repeat inside a tooltip. Rendering the same
23
+ * element twice mounts two independent copies of it, so labels made of
24
+ * components get no tooltip.
25
+ */
26
+ export declare const asText: (value: unknown) => string | number | undefined;
27
+ /**
28
+ * How many chips, taken in order, fit into `available` pixels, reserving room
29
+ * for the hidden-items counter whenever at least one chip is left out.
30
+ *
31
+ * Never returns less than 1 while there are chips: a single chip that is too
32
+ * wide on its own is shown truncated rather than replaced by a bare counter.
33
+ */
34
+ export declare const getVisibleCount: (chipWidths: number[], available: number, gap?: number, counterWidth?: number) => number;
35
+ /**
36
+ * Measures how many selected chips fit on the trigger's single line.
37
+ *
38
+ * The line width is read as row + gap + input group: the input group grows to
39
+ * fill whatever the row leaves, so their sum is the line regardless of icons or
40
+ * paddings on the trigger. Chips beyond the current count are rendered out of
41
+ * flow (but laid out), so their natural widths are always measurable.
42
+ *
43
+ * Returns `Infinity` until the first real measurement, so an element that is
44
+ * not laid out (hidden, or jsdom) shows every chip instead of collapsing to one.
45
+ */
46
+ export declare const useVisibleCount: ({ enabled, rowRef, inputGroupRef, selectedCount, deps, }: {
47
+ enabled: boolean;
48
+ rowRef: RefObject<HTMLElement | null>;
49
+ inputGroupRef: RefObject<HTMLElement | null>;
50
+ selectedCount: number;
51
+ deps: unknown[];
52
+ }) => number;
@@ -18,6 +18,9 @@ export declare const TypeaheadItem: import("@emotion/styled").StyledComponent<{
18
18
  } & {
19
19
  isDisabled?: boolean;
20
20
  isCustomValue?: boolean;
21
+ singleLine?: boolean;
22
+ isOutOfFlow?: boolean;
23
+ canShrink?: boolean;
21
24
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
22
25
  export declare const TypeaheadItemAvatar: import("@emotion/styled").StyledComponent<{
23
26
  theme?: Theme;
@@ -29,7 +32,22 @@ export declare const TypeaheadItemLabel: import("@emotion/styled").StyledCompone
29
32
  } & {
30
33
  isDisabled?: boolean;
31
34
  isCustomValue?: boolean;
35
+ singleLine?: boolean;
32
36
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
37
+ export declare const TypeaheadSelectedRow: import("@emotion/styled").StyledComponent<{
38
+ theme?: Theme;
39
+ as?: React.ElementType;
40
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
41
+ export declare const TypeaheadSelectedCounter: import("@emotion/styled").StyledComponent<{
42
+ theme?: Theme;
43
+ as?: React.ElementType;
44
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
45
+ export declare const TypeaheadCounterCircle: {
46
+ readonly boxSizing: "border-box";
47
+ readonly width: "auto";
48
+ readonly minWidth: 24;
49
+ readonly padding: "0 4px";
50
+ };
33
51
  export declare const TypeaheadItemCross: import("@emotion/styled").StyledComponent<import("..").ButtonProps & import("react").RefAttributes<HTMLButtonElement> & {
34
52
  theme?: Theme;
35
53
  } & {
@@ -49,6 +67,7 @@ export declare const TypeaheadInputsGroupWrapper: import("@emotion/styled").Styl
49
67
  theme?: Theme;
50
68
  } & {
51
69
  isOpen: boolean;
70
+ singleLine?: boolean;
52
71
  }, {}, {}>;
53
72
  export declare const TypeaheadTrigger: import("@emotion/styled").StyledComponent<Omit<import("react").HTMLProps<HTMLElement> & import("..").ButtonProps & import("../Popover").PopoverTriggerProps, "ref"> & import("react").RefAttributes<HTMLElement> & {
54
73
  theme?: Theme;
@@ -60,6 +60,15 @@ export interface TypeaheadProps {
60
60
  * @default false
61
61
  */
62
62
  isMultiple?: boolean;
63
+ /**
64
+ * Keep the multiple-selection trigger on a single line.
65
+ * Shows as many selected items as fit, then a `+N` counter for the rest,
66
+ * instead of wrapping onto new lines. Selected items are truncated with an
67
+ * ellipsis and show their full label in a tooltip.
68
+ * Has no effect unless `isMultiple` is set.
69
+ * @default false
70
+ */
71
+ singleLine?: boolean;
63
72
  /**
64
73
  * Whether the component is disabled
65
74
  * Disabled typeahead cannot be interacted with
@@ -205,7 +214,7 @@ export interface TypeaheadProps {
205
214
  * Props used by the useTypeahead hook
206
215
  * Internal type that picks specific props from TypeaheadProps
207
216
  */
208
- export type UseTypeaheadProps = Pick<TypeaheadProps, 'selectedItems' | 'defaultSelectedItems' | 'isDisabled' | 'children' | 'isMultiple' | 'onChange' | 'onClearAll' | 'onRemoveSelectedClick' | 'onEmptyChange' | 'renderOption' | 'isOpen' | 'className' | 'startIcon' | 'endIcon' | 'startIconClassName' | 'endIconClassName' | 'name' | 'validationSchema' | 'error' | 'success' | 'placeholder' | 'filterOptions' | 'autoSelect' | 'allowCustomValues'>;
217
+ export type UseTypeaheadProps = Pick<TypeaheadProps, 'selectedItems' | 'defaultSelectedItems' | 'isDisabled' | 'children' | 'isMultiple' | 'singleLine' | 'onChange' | 'onClearAll' | 'onRemoveSelectedClick' | 'onEmptyChange' | 'renderOption' | 'isOpen' | 'className' | 'startIcon' | 'endIcon' | 'startIconClassName' | 'endIconClassName' | 'name' | 'validationSchema' | 'error' | 'success' | 'placeholder' | 'filterOptions' | 'autoSelect' | 'allowCustomValues'>;
209
218
  /**
210
219
  * Props for TypeaheadOptions container component
211
220
  */
@@ -6,7 +6,7 @@ type HandleChangeParams = {
6
6
  shouldClose?: boolean;
7
7
  resetInput?: boolean;
8
8
  };
9
- export declare const useTypeahead: ({ name, isOpen: isInitOpen, selectedItems: providedSelectedItems, defaultSelectedItems, isDisabled, isMultiple, children, className, startIcon, endIcon, startIconClassName, endIconClassName, validationSchema, error, success, placeholder, filterOptions, autoSelect, allowCustomValues, onChange, onClearAll, onRemoveSelectedClick, onEmptyChange, renderOption, }: UseTypeaheadProps) => {
9
+ export declare const useTypeahead: ({ name, isOpen: isInitOpen, selectedItems: providedSelectedItems, defaultSelectedItems, isDisabled, isMultiple, singleLine, children, className, startIcon, endIcon, startIconClassName, endIconClassName, validationSchema, error, success, placeholder, filterOptions, autoSelect, allowCustomValues, onChange, onClearAll, onRemoveSelectedClick, onEmptyChange, renderOption, }: UseTypeaheadProps) => {
10
10
  isOpen: boolean;
11
11
  isDisabled: boolean | undefined;
12
12
  optionsWithKey: Record<string | number, TypeaheadOptionProps>;
@@ -14,6 +14,7 @@ export declare const useTypeahead: ({ name, isOpen: isInitOpen, selectedItems: p
14
14
  inputRef: React.RefObject<HTMLInputElement | null>;
15
15
  firstSuggestion: string;
16
16
  isMultiple: boolean | undefined;
17
+ singleLine: boolean;
17
18
  typeaheadId: string;
18
19
  triggerRef: React.RefObject<HTMLDivElement | null>;
19
20
  className: string | undefined;
@@ -57,6 +57,8 @@ export * from './Filters';
57
57
  export * from './FiltersMultiSelect';
58
58
  export * as JsonSchema from './JsonSchemaForm';
59
59
  export { default as Table } from './Table';
60
+ export { ColumnResizeHandle, useColumnResize, useColumnResizeContext, } from './Table';
61
+ export type { ColumnResizeApi, ColumnResizeHandleProps, ColumnResizeMode, ColumnResizeOptions, ResizeHandleProps, TableProps, UseColumnResizeOptions, } from './Table';
60
62
  export { default as TableBody } from './TableBody';
61
63
  export { default as TableCell } from './TableCell';
62
64
  export { default as TableCellHeader } from './TableCellHeader';
@@ -101,6 +103,8 @@ export { default as ProgressLegendItem } from './ProgressLegendItem';
101
103
  export { default as ProgressVertical } from './ProgressVertical';
102
104
  export * from './Charts';
103
105
  export * from './ImageItem';
106
+ export * from './Carousel';
107
+ export type * from './Carousel/types';
104
108
  export { default as ResponsiveImage } from './ResponsiveImage';
105
109
  export * from './ResponsiveImage';
106
110
  export type * from './ResponsiveImage/types';