@elastic/eui 88.0.0 → 88.2.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/eui_charts_theme.js +9 -8
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +11 -41
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +11 -41
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accordion/accordion.js +34 -9
- package/es/components/accordion/accordion.styles.js +29 -9
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +10 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +10 -26
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- package/es/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/es/components/description_list/description_list.js +40 -3
- package/es/components/flyout/flyout.styles.js +1 -1
- package/es/components/header/header.js +120 -25
- package/es/components/header/header.styles.js +1 -1
- package/es/components/index.js +1 -0
- package/es/components/markdown_editor/markdown_format.styles.js +3 -6
- package/es/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/es/components/page/page_sidebar/page_sidebar.js +2 -4
- package/es/components/page_template/page_template.js +4 -31
- package/es/components/text/text.styles.js +3 -6
- package/es/components/text_truncate/index.js +10 -0
- package/es/components/text_truncate/text_truncate.js +232 -0
- package/es/components/text_truncate/text_truncate.styles.js +49 -0
- package/es/components/text_truncate/utils.js +348 -0
- package/es/global_styling/functions/typography.js +8 -8
- package/es/global_styling/variables/typography.js +1 -1
- package/es/services/theme/context.js +3 -1
- package/es/services/theme/hooks.js +19 -1
- package/es/services/theme/index.js +1 -1
- package/es/services/theme/provider.js +37 -8
- package/es/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/eui.d.ts +282 -24
- package/i18ntokens.json +112 -112
- package/lib/components/accordion/accordion.js +33 -8
- package/lib/components/accordion/accordion.styles.js +31 -10
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +10 -2
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +10 -26
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- package/lib/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/lib/components/description_list/description_list.js +39 -3
- package/lib/components/flyout/flyout.styles.js +1 -1
- package/lib/components/header/header.js +120 -23
- package/lib/components/header/header.styles.js +1 -1
- package/lib/components/index.js +11 -0
- package/lib/components/markdown_editor/markdown_format.styles.js +3 -6
- package/lib/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/lib/components/page/page_sidebar/page_sidebar.js +2 -4
- package/lib/components/page_template/page_template.js +2 -29
- package/lib/components/text/text.styles.js +3 -6
- package/lib/components/text_truncate/index.js +25 -0
- package/lib/components/text_truncate/text_truncate.js +242 -0
- package/lib/components/text_truncate/text_truncate.styles.js +54 -0
- package/lib/components/text_truncate/utils.js +352 -0
- package/lib/global_styling/functions/typography.js +8 -8
- package/lib/global_styling/variables/typography.js +3 -3
- package/lib/services/theme/context.js +3 -1
- package/lib/services/theme/hooks.js +21 -2
- package/lib/services/theme/index.js +6 -0
- package/lib/services/theme/provider.js +62 -35
- package/lib/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/optimize/es/components/accordion/accordion.js +19 -7
- package/optimize/es/components/accordion/accordion.styles.js +29 -9
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +5 -26
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- package/optimize/es/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/optimize/es/components/description_list/description_list.js +22 -2
- package/optimize/es/components/flyout/flyout.styles.js +1 -1
- package/optimize/es/components/header/header.js +75 -25
- package/optimize/es/components/header/header.styles.js +1 -1
- package/optimize/es/components/index.js +1 -0
- package/optimize/es/components/markdown_editor/markdown_format.styles.js +3 -6
- package/optimize/es/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/optimize/es/components/page/page_sidebar/page_sidebar.js +2 -4
- package/optimize/es/components/page_template/page_template.js +4 -26
- package/optimize/es/components/text/text.styles.js +3 -6
- package/optimize/es/components/text_truncate/index.js +10 -0
- package/optimize/es/components/text_truncate/text_truncate.js +148 -0
- package/optimize/es/components/text_truncate/text_truncate.styles.js +49 -0
- package/optimize/es/components/text_truncate/utils.js +337 -0
- package/optimize/es/global_styling/functions/typography.js +8 -8
- package/optimize/es/global_styling/variables/typography.js +1 -1
- package/optimize/es/services/theme/context.js +3 -1
- package/optimize/es/services/theme/hooks.js +19 -1
- package/optimize/es/services/theme/index.js +1 -1
- package/optimize/es/services/theme/provider.js +37 -8
- package/optimize/es/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/optimize/lib/components/accordion/accordion.js +18 -6
- package/optimize/lib/components/accordion/accordion.styles.js +31 -10
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +5 -26
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- package/optimize/lib/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/optimize/lib/components/description_list/description_list.js +22 -2
- package/optimize/lib/components/flyout/flyout.styles.js +1 -1
- package/optimize/lib/components/header/header.js +77 -24
- package/optimize/lib/components/header/header.styles.js +1 -1
- package/optimize/lib/components/index.js +11 -0
- package/optimize/lib/components/markdown_editor/markdown_format.styles.js +3 -6
- package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/optimize/lib/components/page/page_sidebar/page_sidebar.js +2 -4
- package/optimize/lib/components/page_template/page_template.js +2 -24
- package/optimize/lib/components/text/text.styles.js +3 -6
- package/optimize/lib/components/text_truncate/index.js +25 -0
- package/optimize/lib/components/text_truncate/text_truncate.js +158 -0
- package/optimize/lib/components/text_truncate/text_truncate.styles.js +54 -0
- package/optimize/lib/components/text_truncate/utils.js +342 -0
- package/optimize/lib/global_styling/functions/typography.js +8 -8
- package/optimize/lib/global_styling/variables/typography.js +3 -3
- package/optimize/lib/services/theme/context.js +3 -1
- package/optimize/lib/services/theme/hooks.js +21 -2
- package/optimize/lib/services/theme/index.js +6 -0
- package/optimize/lib/services/theme/provider.js +62 -35
- package/optimize/lib/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/package.json +1 -1
- package/src/components/datagrid/_data_grid.scss +13 -2
- package/src/components/datagrid/controls/_data_grid_keyboard_shortcuts.scss +1 -7
- package/src/components/index.scss +0 -1
- package/src/global_styling/mixins/_header.scss +2 -0
- package/test-env/components/accordion/accordion.js +28 -8
- package/test-env/components/accordion/accordion.styles.js +31 -10
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +10 -2
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +10 -26
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- package/test-env/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/test-env/components/description_list/description_list.js +37 -3
- package/test-env/components/flyout/flyout.styles.js +1 -1
- package/test-env/components/header/header.js +113 -23
- package/test-env/components/header/header.styles.js +1 -1
- package/test-env/components/index.js +11 -0
- package/test-env/components/markdown_editor/markdown_format.styles.js +3 -6
- package/test-env/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/test-env/components/page/page_sidebar/page_sidebar.js +2 -4
- package/test-env/components/page_template/page_template.js +2 -24
- package/test-env/components/text/text.styles.js +3 -6
- package/test-env/components/text_truncate/index.js +25 -0
- package/test-env/components/text_truncate/text_truncate.js +236 -0
- package/test-env/components/text_truncate/text_truncate.styles.js +54 -0
- package/test-env/components/text_truncate/utils.js +342 -0
- package/test-env/global_styling/functions/typography.js +8 -8
- package/test-env/global_styling/variables/typography.js +3 -3
- package/test-env/services/theme/context.js +3 -1
- package/test-env/services/theme/hooks.js +21 -2
- package/test-env/services/theme/index.js +6 -0
- package/test-env/services/theme/provider.js +62 -35
- package/test-env/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/src/components/accordion/_accordion_form.scss +0 -40
- package/src/components/accordion/_index.scss +0 -1
package/eui.d.ts
CHANGED
|
@@ -514,8 +514,8 @@ declare module '@elastic/eui/src/global_styling/variables/typography' {
|
|
|
514
514
|
/**
|
|
515
515
|
* Font units of measure
|
|
516
516
|
*/
|
|
517
|
-
export const
|
|
518
|
-
export type
|
|
517
|
+
export const EuiThemeFontUnits: readonly ["rem", "px", "em"];
|
|
518
|
+
export type _EuiThemeFontUnit = (typeof EuiThemeFontUnits)[number];
|
|
519
519
|
export const EuiThemeFontScales: readonly ["xxxs", "xxs", "xs", "s", "m", "l", "xl", "xxl"];
|
|
520
520
|
export type _EuiThemeFontScale = (typeof EuiThemeFontScales)[number];
|
|
521
521
|
export type _EuiThemeFontScales = Record<_EuiThemeFontScale, number>;
|
|
@@ -538,6 +538,16 @@ declare module '@elastic/eui/src/global_styling/variables/typography' {
|
|
|
538
538
|
* https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings
|
|
539
539
|
*/
|
|
540
540
|
featureSettings?: string;
|
|
541
|
+
/**
|
|
542
|
+
* Sets the default units used for font size & line height set by UI components
|
|
543
|
+
* like EuiText or EuiTitle. Defaults to `rem`.
|
|
544
|
+
*
|
|
545
|
+
* NOTE: This may overridden by some internal usages, e.g.
|
|
546
|
+
* EuiText's `relative` size which must use `em`.
|
|
547
|
+
*
|
|
548
|
+
* @default 'rem'
|
|
549
|
+
*/
|
|
550
|
+
defaultUnits: _EuiThemeFontUnit;
|
|
541
551
|
/**
|
|
542
552
|
* A computed number that is 1/4 of `base`
|
|
543
553
|
*/
|
|
@@ -663,6 +673,7 @@ declare module '@elastic/eui/src/global_styling/variables/levels' {
|
|
|
663
673
|
|
|
664
674
|
}
|
|
665
675
|
declare module '@elastic/eui/src/services/theme/types' {
|
|
676
|
+
import type { CSSObject } from '@emotion/react';
|
|
666
677
|
import { RecursivePartial, ValueOf } from '@elastic/eui/src/components/common';
|
|
667
678
|
import { _EuiThemeAnimation } from '@elastic/eui/src/global_styling/variables/animations';
|
|
668
679
|
import { _EuiThemeBreakpoints } from '@elastic/eui/src/global_styling/variables/breakpoint';
|
|
@@ -720,6 +731,10 @@ declare module '@elastic/eui/src/services/theme/types' {
|
|
|
720
731
|
hasDifferentColorFromGlobalTheme: boolean;
|
|
721
732
|
bodyColor: string;
|
|
722
733
|
colorClassName: string;
|
|
734
|
+
setGlobalCSSVariables: Function;
|
|
735
|
+
globalCSSVariables?: CSSObject;
|
|
736
|
+
setNearestThemeCSSVariables: Function;
|
|
737
|
+
themeCSSVariables?: CSSObject;
|
|
723
738
|
};
|
|
724
739
|
|
|
725
740
|
}
|
|
@@ -1356,16 +1371,26 @@ declare module '@elastic/eui/src/services/theme/hooks' {
|
|
|
1356
1371
|
export const RenderWithEuiTheme: <T extends {} = {}>({ children, }: {
|
|
1357
1372
|
children: (theme: UseEuiTheme) => React.ReactElement;
|
|
1358
1373
|
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
1374
|
+
/**
|
|
1375
|
+
* Minor syntactical sugar hook for theme CSS variables.
|
|
1376
|
+
* Primarily meant for internal EUI usage.
|
|
1377
|
+
*/
|
|
1378
|
+
export const useEuiThemeCSSVariables: () => {
|
|
1379
|
+
setGlobalCSSVariables: Function;
|
|
1380
|
+
globalCSSVariables: import("@emotion/serialize").CSSObject | undefined;
|
|
1381
|
+
setNearestThemeCSSVariables: Function;
|
|
1382
|
+
themeCSSVariables: import("@emotion/serialize").CSSObject | undefined;
|
|
1383
|
+
};
|
|
1359
1384
|
|
|
1360
1385
|
}
|
|
1361
1386
|
declare module '@elastic/eui/src/global_styling/functions/typography' {
|
|
1362
|
-
import { _EuiThemeFontScale,
|
|
1387
|
+
import { _EuiThemeFontScale, _EuiThemeFontUnit, _EuiThemeFontWeights } from '@elastic/eui/src/global_styling/variables/typography';
|
|
1363
1388
|
import { UseEuiTheme } from '@elastic/eui/src/services/theme/hooks';
|
|
1364
1389
|
export interface _FontScaleOptions {
|
|
1365
1390
|
/**
|
|
1366
|
-
* The
|
|
1391
|
+
* The font-size or line-height unit to return
|
|
1367
1392
|
*/
|
|
1368
|
-
|
|
1393
|
+
unit?: _EuiThemeFontUnit;
|
|
1369
1394
|
/**
|
|
1370
1395
|
* An additional custom scale multiplier to use against the current scale
|
|
1371
1396
|
* This parameter can be used (e.g. by EuiText sizes) to get sizes of text smaller than the default
|
|
@@ -1380,7 +1405,7 @@ declare module '@elastic/eui/src/global_styling/functions/typography' {
|
|
|
1380
1405
|
*
|
|
1381
1406
|
* @returns string - Calculated font-size value
|
|
1382
1407
|
*/
|
|
1383
|
-
export function euiFontSizeFromScale(scale: _EuiThemeFontScale, { base, font }: UseEuiTheme['euiTheme'], {
|
|
1408
|
+
export function euiFontSizeFromScale(scale: _EuiThemeFontScale, { base, font }: UseEuiTheme['euiTheme'], { unit, customScale }?: _FontScaleOptions): string;
|
|
1384
1409
|
/**
|
|
1385
1410
|
* Calculates the line-height to the closest multiple of the baseline
|
|
1386
1411
|
* EX: A proper line-height for text is 1.5 times the font-size.
|
|
@@ -1392,7 +1417,7 @@ declare module '@elastic/eui/src/global_styling/functions/typography' {
|
|
|
1392
1417
|
*
|
|
1393
1418
|
* @returns string - Calculated line-height value aligned to baseline
|
|
1394
1419
|
*/
|
|
1395
|
-
export function euiLineHeightFromBaseline(scale: _EuiThemeFontScale, { base, font }: UseEuiTheme['euiTheme'], {
|
|
1420
|
+
export function euiLineHeightFromBaseline(scale: _EuiThemeFontScale, { base, font }: UseEuiTheme['euiTheme'], { unit, customScale }?: _FontScaleOptions): string;
|
|
1396
1421
|
/**
|
|
1397
1422
|
* Text weight shifting
|
|
1398
1423
|
*
|
|
@@ -7788,6 +7813,20 @@ declare module '@elastic/eui/src/services/theme/context' {
|
|
|
7788
7813
|
export const EuiThemeContext: import("react").Context<EuiThemeComputed<{}>>;
|
|
7789
7814
|
export const EuiNestedThemeContext: import("react").Context<EuiThemeNested>;
|
|
7790
7815
|
|
|
7816
|
+
}
|
|
7817
|
+
declare module '@elastic/eui/src/services/emotion/clone_element' {
|
|
7818
|
+
import React from 'react';
|
|
7819
|
+
/**
|
|
7820
|
+
* React.cloneElement does not work if the cloned element does not already have the
|
|
7821
|
+
* `css` prop - as a result, we need to use `jsx()` to manually clone the element
|
|
7822
|
+
* See https://github.com/emotion-js/emotion/issues/1404
|
|
7823
|
+
*/
|
|
7824
|
+
export const cloneElementWithCss: (element: any, props: any) => React.ReactElement;
|
|
7825
|
+
|
|
7826
|
+
}
|
|
7827
|
+
declare module '@elastic/eui/src/services/emotion' {
|
|
7828
|
+
export * from '@elastic/eui/src/services/emotion/clone_element';
|
|
7829
|
+
|
|
7791
7830
|
}
|
|
7792
7831
|
declare module '@elastic/eui/src/services/theme/emotion' {
|
|
7793
7832
|
import { FunctionComponent, PropsWithChildren } from 'react';
|
|
@@ -7832,7 +7871,7 @@ declare module '@elastic/eui/src/services/theme/provider' {
|
|
|
7832
7871
|
declare module '@elastic/eui/src/services/theme' {
|
|
7833
7872
|
export { EuiSystemContext, EuiThemeContext, EuiNestedThemeContext, EuiModificationsContext, EuiColorModeContext, } from '@elastic/eui/src/services/theme/context';
|
|
7834
7873
|
export type { UseEuiTheme, WithEuiThemeProps } from '@elastic/eui/src/services/theme/hooks';
|
|
7835
|
-
export { useEuiTheme, withEuiTheme, RenderWithEuiTheme } from '@elastic/eui/src/services/theme/hooks';
|
|
7874
|
+
export { useEuiTheme, withEuiTheme, RenderWithEuiTheme, useEuiThemeCSSVariables, } from '@elastic/eui/src/services/theme/hooks';
|
|
7836
7875
|
export type { EuiThemeProviderProps } from '@elastic/eui/src/services/theme/provider';
|
|
7837
7876
|
export { EuiThemeProvider } from '@elastic/eui/src/services/theme/provider';
|
|
7838
7877
|
export { getEuiDevProviderWarning, setEuiDevProviderWarning } from '@elastic/eui/src/services/theme/warning';
|
|
@@ -7940,20 +7979,6 @@ declare module '@elastic/eui/src/services/console' {
|
|
|
7940
7979
|
declare module '@elastic/eui/src/services/copy_to_clipboard' {
|
|
7941
7980
|
export function copyToClipboard(text: string): boolean;
|
|
7942
7981
|
|
|
7943
|
-
}
|
|
7944
|
-
declare module '@elastic/eui/src/services/emotion/clone_element' {
|
|
7945
|
-
import React from 'react';
|
|
7946
|
-
/**
|
|
7947
|
-
* React.cloneElement does not work if the cloned element does not already have the
|
|
7948
|
-
* `css` prop - as a result, we need to use `jsx()` to manually clone the element
|
|
7949
|
-
* See https://github.com/emotion-js/emotion/issues/1404
|
|
7950
|
-
*/
|
|
7951
|
-
export const cloneElementWithCss: (element: any, props: any) => React.ReactElement;
|
|
7952
|
-
|
|
7953
|
-
}
|
|
7954
|
-
declare module '@elastic/eui/src/services/emotion' {
|
|
7955
|
-
export * from '@elastic/eui/src/services/emotion/clone_element';
|
|
7956
|
-
|
|
7957
7982
|
}
|
|
7958
7983
|
declare module '@elastic/eui/src/services/findElement' {
|
|
7959
7984
|
/**
|
|
@@ -8518,9 +8543,22 @@ declare module '@elastic/eui/src/components/accessibility' {
|
|
|
8518
8543
|
}
|
|
8519
8544
|
declare module '@elastic/eui/src/components/accordion/accordion.styles' {
|
|
8520
8545
|
import { UseEuiTheme } from '@elastic/eui/src/services';
|
|
8546
|
+
export const euiAccordionStyles: ({ euiTheme }: UseEuiTheme) => {
|
|
8547
|
+
euiAccordion: import("@emotion/utils").SerializedStyles;
|
|
8548
|
+
borders: {
|
|
8549
|
+
borders: import("@emotion/utils").SerializedStyles;
|
|
8550
|
+
horizontal: import("@emotion/utils").SerializedStyles;
|
|
8551
|
+
all: import("@emotion/utils").SerializedStyles;
|
|
8552
|
+
};
|
|
8553
|
+
};
|
|
8521
8554
|
export const euiAccordionButtonStyles: (euiThemeContext: UseEuiTheme) => {
|
|
8522
8555
|
euiAccordion__button: import("@emotion/utils").SerializedStyles;
|
|
8523
8556
|
disabled: import("@emotion/utils").SerializedStyles;
|
|
8557
|
+
s: import("@emotion/utils").SerializedStyles;
|
|
8558
|
+
m: import("@emotion/utils").SerializedStyles;
|
|
8559
|
+
l: import("@emotion/utils").SerializedStyles;
|
|
8560
|
+
arrowLeft: import("@emotion/utils").SerializedStyles;
|
|
8561
|
+
arrowRight: import("@emotion/utils").SerializedStyles;
|
|
8524
8562
|
};
|
|
8525
8563
|
export const euiAccordionChildrenStyles: ({ euiTheme }: UseEuiTheme) => {
|
|
8526
8564
|
euiAccordion__children: import("@emotion/utils").SerializedStyles;
|
|
@@ -8571,9 +8609,14 @@ declare module '@elastic/eui/src/components/accordion/accordion' {
|
|
|
8571
8609
|
*/
|
|
8572
8610
|
buttonClassName?: string;
|
|
8573
8611
|
/**
|
|
8574
|
-
* Apply more props to the triggering button
|
|
8612
|
+
* Apply more props to the triggering button.
|
|
8613
|
+
*
|
|
8614
|
+
* Includes optional `paddingSize` prop which allows sizes of `s`, `m`, or `l`.
|
|
8615
|
+
* Note: Padding will not be present on the side closest to the accordion arrow.
|
|
8575
8616
|
*/
|
|
8576
|
-
buttonProps?: CommonProps & HTMLAttributes<HTMLElement
|
|
8617
|
+
buttonProps?: CommonProps & HTMLAttributes<HTMLElement> & {
|
|
8618
|
+
paddingSize?: 's' | 'm' | 'l';
|
|
8619
|
+
};
|
|
8577
8620
|
/**
|
|
8578
8621
|
* Class that will apply to the trigger content for the accordion.
|
|
8579
8622
|
*/
|
|
@@ -8611,6 +8654,10 @@ declare module '@elastic/eui/src/components/accordion/accordion' {
|
|
|
8611
8654
|
* Placement of the arrow indicator, or 'none' to hide it.
|
|
8612
8655
|
*/
|
|
8613
8656
|
arrowDisplay?: 'left' | 'right' | 'none';
|
|
8657
|
+
/**
|
|
8658
|
+
* Optional border styling. Defaults to 'none'.
|
|
8659
|
+
*/
|
|
8660
|
+
borders?: 'horizontal' | 'all' | 'none';
|
|
8614
8661
|
/**
|
|
8615
8662
|
* Control the opening of accordion via prop
|
|
8616
8663
|
*/
|
|
@@ -8633,6 +8680,7 @@ declare module '@elastic/eui/src/components/accordion/accordion' {
|
|
|
8633
8680
|
export class EuiAccordionClass extends Component<WithEuiThemeProps & EuiAccordionProps, EuiAccordionState> {
|
|
8634
8681
|
static defaultProps: {
|
|
8635
8682
|
initialIsOpen: boolean;
|
|
8683
|
+
borders: "none";
|
|
8636
8684
|
paddingSize: "none";
|
|
8637
8685
|
arrowDisplay: "left";
|
|
8638
8686
|
isLoading: boolean;
|
|
@@ -10580,6 +10628,11 @@ declare module '@elastic/eui/src/components/collapsible_nav_beta/collapsible_nav
|
|
|
10580
10628
|
* Whether the navigation flyout should default to initially collapsed or expanded
|
|
10581
10629
|
*/
|
|
10582
10630
|
initialIsCollapsed?: boolean;
|
|
10631
|
+
/**
|
|
10632
|
+
* Optional callback that fires when the user toggles the nav between
|
|
10633
|
+
* collapsed and uncollapsed states
|
|
10634
|
+
*/
|
|
10635
|
+
onCollapseToggle?: (isCollapsed: boolean) => void;
|
|
10583
10636
|
/**
|
|
10584
10637
|
* Defaults to 248px wide. The navigation width determines behavior at
|
|
10585
10638
|
* various responsive breakpoints.
|
|
@@ -14206,6 +14259,20 @@ declare module '@elastic/eui/src/components/description_list/description_list_ty
|
|
|
14206
14259
|
* Only applies to `column` and `responsiveColumn` types.
|
|
14207
14260
|
*/
|
|
14208
14261
|
columnGutterSize?: EuiDescriptionListColumnGapSizes;
|
|
14262
|
+
/**
|
|
14263
|
+
* Allows customizing specific column widths (e.g. `['100px', '200px']`). The first
|
|
14264
|
+
* array value applies to the title column, and the second applies to the description column.
|
|
14265
|
+
*
|
|
14266
|
+
* Passing numbers instead of CSS width strings will use a ratio of widths.
|
|
14267
|
+
* For example, [1, 3] will render a description column 3x the width of the title column.
|
|
14268
|
+
* In other words, descriptions will have a width of `75%` and titles will have a width of `25%`.
|
|
14269
|
+
*
|
|
14270
|
+
* Only applies to `column` and `responsiveColumn` types.
|
|
14271
|
+
*
|
|
14272
|
+
* _Advanced usage note:_ column width strings also accept [CSS grid special units,
|
|
14273
|
+
* sizing, keywords, and sizing functions](https://css-tricks.com/snippets/css/complete-guide-grid/#aa-special-units-functions).
|
|
14274
|
+
*/
|
|
14275
|
+
columnWidths?: [number | string, number | string];
|
|
14209
14276
|
}
|
|
14210
14277
|
export const CHILD_TYPES: readonly ["row", "inline", "column"];
|
|
14211
14278
|
export type EuiDescriptionListChildTypes = (typeof CHILD_TYPES)[number];
|
|
@@ -16356,6 +16423,12 @@ declare module '@elastic/eui/src/components/header/header' {
|
|
|
16356
16423
|
theme?: 'default' | 'dark';
|
|
16357
16424
|
};
|
|
16358
16425
|
export const EuiHeader: FunctionComponent<EuiHeaderProps>;
|
|
16426
|
+
/**
|
|
16427
|
+
* Fixed headers - logic around dynamically calculating the total
|
|
16428
|
+
* page offset and setting the `top` position of subsequent headers
|
|
16429
|
+
*/
|
|
16430
|
+
export let euiFixedHeadersCount: number;
|
|
16431
|
+
export const EuiFixedHeader: FunctionComponent<EuiHeaderProps>;
|
|
16359
16432
|
export {};
|
|
16360
16433
|
|
|
16361
16434
|
}
|
|
@@ -22029,6 +22102,190 @@ declare module '@elastic/eui/src/components/text_diff' {
|
|
|
22029
22102
|
export type { EuiTextDiffProps } from '@elastic/eui/src/components/text_diff/text_diff';
|
|
22030
22103
|
export { useEuiTextDiff } from '@elastic/eui/src/components/text_diff/text_diff';
|
|
22031
22104
|
|
|
22105
|
+
}
|
|
22106
|
+
declare module '@elastic/eui/src/components/text_truncate/utils' {
|
|
22107
|
+
import type { ExclusiveUnion } from '@elastic/eui/src/components/common';
|
|
22108
|
+
interface SharedParams {
|
|
22109
|
+
fullText: string;
|
|
22110
|
+
ellipsis: string;
|
|
22111
|
+
availableWidth: number;
|
|
22112
|
+
}
|
|
22113
|
+
interface DOMParams extends SharedParams {
|
|
22114
|
+
container: HTMLElement;
|
|
22115
|
+
} type CanvasParams = SharedParams & ExclusiveUnion<{
|
|
22116
|
+
container: HTMLElement;
|
|
22117
|
+
}, {
|
|
22118
|
+
font: CanvasTextDrawingStyles['font'];
|
|
22119
|
+
}>; abstract class _TruncationUtils {
|
|
22120
|
+
protected fullText: SharedParams['fullText'];
|
|
22121
|
+
protected ellipsis: SharedParams['ellipsis'];
|
|
22122
|
+
protected availableWidth: SharedParams['availableWidth'];
|
|
22123
|
+
constructor({ fullText, ellipsis, availableWidth }: SharedParams);
|
|
22124
|
+
/**
|
|
22125
|
+
* Internal measurement utils which will be overridden depending on the
|
|
22126
|
+
* rendering approach used (e.g. DOM vs Canvas).
|
|
22127
|
+
*/
|
|
22128
|
+
abstract textWidth: number;
|
|
22129
|
+
abstract setTextToCheck: (text: string) => void;
|
|
22130
|
+
/**
|
|
22131
|
+
* Early return checks
|
|
22132
|
+
*/
|
|
22133
|
+
checkIfTruncationIsNeeded: () => false | undefined;
|
|
22134
|
+
checkSufficientEllipsisWidth: (truncation: string) => false | undefined;
|
|
22135
|
+
checkTruncationOffsetWidth: (text: string) => false | undefined;
|
|
22136
|
+
/**
|
|
22137
|
+
* Truncation types logic. This is where the magic happens
|
|
22138
|
+
*/
|
|
22139
|
+
truncateStart: (truncationOffset?: number | undefined) => string;
|
|
22140
|
+
truncateEnd: (truncationOffset?: number | undefined) => string;
|
|
22141
|
+
truncateStartEndAtPosition: (truncationPosition: number) => string;
|
|
22142
|
+
truncateStartEndAtMiddle: () => string;
|
|
22143
|
+
truncateMiddle: () => string;
|
|
22144
|
+
}
|
|
22145
|
+
/**
|
|
22146
|
+
* Creates a temporary vanilla JS DOM element for manipulating text and
|
|
22147
|
+
* determining text width.
|
|
22148
|
+
*
|
|
22149
|
+
* Requires passing in a container element to which the temporary element
|
|
22150
|
+
* will be appended. Any CSS/font styles that need to be accounted for should
|
|
22151
|
+
* be automatically inherited from the container.
|
|
22152
|
+
*
|
|
22153
|
+
* NOTE: The consumer is responsible for calling the `cleanup()` method manually
|
|
22154
|
+
* to remove the temporary DOM node once their usage of this utility is complete.
|
|
22155
|
+
*/
|
|
22156
|
+
export class TruncationUtilsWithDOM extends _TruncationUtils {
|
|
22157
|
+
container: DOMParams['container'];
|
|
22158
|
+
span: HTMLSpanElement;
|
|
22159
|
+
constructor({ container, ...rest }: DOMParams);
|
|
22160
|
+
get textWidth(): number;
|
|
22161
|
+
setTextToCheck: (text: string) => void;
|
|
22162
|
+
cleanup: () => void;
|
|
22163
|
+
}
|
|
22164
|
+
/**
|
|
22165
|
+
* Creates a temporary Canvas element for manipulating text & determining
|
|
22166
|
+
* text width. This method is compatible with charts or other canvas-rendered
|
|
22167
|
+
* frameworks, and requires no cleanup method.
|
|
22168
|
+
*
|
|
22169
|
+
* To accurately measure text, canvas rendering requires either a container to
|
|
22170
|
+
* compute/derive font styles from, or a static font string (useful for usage
|
|
22171
|
+
* outside the DOM). Particular care should be applied when fallback fonts are
|
|
22172
|
+
* used, as more fallback fonts can lead to less precision.
|
|
22173
|
+
*
|
|
22174
|
+
* Please note that while canvas is more performant than DOM measurement, there
|
|
22175
|
+
* are subpixel to single digit pixel differences between DOM and canvas
|
|
22176
|
+
* measurement due to the different rendering engines used.
|
|
22177
|
+
*/
|
|
22178
|
+
export class TruncationUtilsWithCanvas extends _TruncationUtils {
|
|
22179
|
+
context: CanvasRenderingContext2D;
|
|
22180
|
+
currentText: string;
|
|
22181
|
+
constructor({ font, container, ...rest }: CanvasParams);
|
|
22182
|
+
computeFontFromElement: (element: HTMLElement) => string;
|
|
22183
|
+
get textWidth(): number;
|
|
22184
|
+
setTextToCheck: (text: string) => void;
|
|
22185
|
+
}
|
|
22186
|
+
export {};
|
|
22187
|
+
|
|
22188
|
+
}
|
|
22189
|
+
declare module '@elastic/eui/src/components/text_truncate/text_truncate.styles' {
|
|
22190
|
+
export const euiTextTruncateStyles: {
|
|
22191
|
+
euiTextTruncate: import("@emotion/utils").SerializedStyles;
|
|
22192
|
+
/**
|
|
22193
|
+
* The below CSS is a hack to get double clicking and selecting the *full* text
|
|
22194
|
+
* instead of the truncated text (useful for copying/pasting, and mimics how
|
|
22195
|
+
* `text-overflow: ellipsis` works).
|
|
22196
|
+
*
|
|
22197
|
+
* Real talk: I'm lowkey amazed it works and it wouldn't surprise me if we ran into
|
|
22198
|
+
* cross-browser issues with this at some point. Hopefully CSS natively implements
|
|
22199
|
+
* custom text truncation some day (https://github.com/w3c/csswg-drafts/issues/3937)
|
|
22200
|
+
* and there'll be no need for the entire component at that point 🙏
|
|
22201
|
+
*/
|
|
22202
|
+
truncatedText: import("@emotion/utils").SerializedStyles;
|
|
22203
|
+
fullText: import("@emotion/utils").SerializedStyles;
|
|
22204
|
+
};
|
|
22205
|
+
|
|
22206
|
+
}
|
|
22207
|
+
declare module '@elastic/eui/src/components/text_truncate/text_truncate' {
|
|
22208
|
+
import { HTMLAttributes, FunctionComponent, ReactNode } from 'react';
|
|
22209
|
+
import type { CommonProps } from '@elastic/eui/src/components/common'; const TRUNCATION_TYPES: readonly ["end", "start", "startEnd", "middle"];
|
|
22210
|
+
export type EuiTextTruncationTypes = (typeof TRUNCATION_TYPES)[number];
|
|
22211
|
+
export type EuiTextTruncateProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onResize'> & CommonProps & {
|
|
22212
|
+
/**
|
|
22213
|
+
* The full text string to truncate
|
|
22214
|
+
*/
|
|
22215
|
+
text: string;
|
|
22216
|
+
/**
|
|
22217
|
+
* The truncation type desired. Determines where the ellipses are placed.
|
|
22218
|
+
*/
|
|
22219
|
+
truncation?: EuiTextTruncationTypes;
|
|
22220
|
+
/**
|
|
22221
|
+
* This prop **only** applies to the `start` and `end` truncation types.
|
|
22222
|
+
* It allows preserving a certain number of characters of either the
|
|
22223
|
+
* starting or ending text.
|
|
22224
|
+
*
|
|
22225
|
+
* If the passed offset is greater than the total text length,
|
|
22226
|
+
* the offset will be ignored.
|
|
22227
|
+
*/
|
|
22228
|
+
truncationOffset?: number;
|
|
22229
|
+
/**
|
|
22230
|
+
* This prop **only** applies to the `startEnd` truncation type.
|
|
22231
|
+
* It allows customizing the anchor position of the displayed text,
|
|
22232
|
+
* which otherwise defaults to the middle of the text string.
|
|
22233
|
+
*
|
|
22234
|
+
* The primary use case for this prop for is search highlighting - e.g., if
|
|
22235
|
+
* a user searches for a specific word in the text, pass the index of that
|
|
22236
|
+
* found word to ensure it is always visible.
|
|
22237
|
+
*
|
|
22238
|
+
* This behavior will intelligently detect when positions are close to the start
|
|
22239
|
+
* or end of the text, and omit leading or trailing ellipses when necessary.
|
|
22240
|
+
* If the passed position is greater than the total text length,
|
|
22241
|
+
* the truncation will simply default to `start` instead.
|
|
22242
|
+
*/
|
|
22243
|
+
truncationPosition?: number;
|
|
22244
|
+
/**
|
|
22245
|
+
* Defaults to the horizontal ellipsis character.
|
|
22246
|
+
* Can be optionally configured to use other punctuation,
|
|
22247
|
+
* e.g. spaces, brackets, hyphens, asterisks, etc.
|
|
22248
|
+
*/
|
|
22249
|
+
ellipsis?: string;
|
|
22250
|
+
/**
|
|
22251
|
+
* By default, EuiTextTruncate will render a resize observer to detect the
|
|
22252
|
+
* available width it has. For performance reasons (e.g. multiple truncated
|
|
22253
|
+
* text items within the same container), you may opt to pass in your own
|
|
22254
|
+
* container width, which will skip initializing a resize observer.
|
|
22255
|
+
*/
|
|
22256
|
+
width?: number;
|
|
22257
|
+
/**
|
|
22258
|
+
* Optional callback that fires when the default resizer observer both mounts and
|
|
22259
|
+
* registers a size change. This callback will **not** fire if `width` is passed.
|
|
22260
|
+
*/
|
|
22261
|
+
onResize?: (width: number) => void;
|
|
22262
|
+
/**
|
|
22263
|
+
* By default, EuiTextTruncate will calculate its truncation via DOM manipulation
|
|
22264
|
+
* and measurement, which has the benefit of automatically inheriting font styles.
|
|
22265
|
+
* However, if this approach proves to have a significant performance impact for your
|
|
22266
|
+
* usage, consider using the `canvas` API instead, which is more performant.
|
|
22267
|
+
*
|
|
22268
|
+
* Please note that there are minute pixel to subpixel differences between the
|
|
22269
|
+
* two options due to different rendering engines.
|
|
22270
|
+
*/
|
|
22271
|
+
measurementRenderAPI?: 'dom' | 'canvas';
|
|
22272
|
+
/**
|
|
22273
|
+
* By default, EuiTextTruncate will render the truncated string directly.
|
|
22274
|
+
* You can optionally pass a render prop function to the component, which
|
|
22275
|
+
* allows for more flexible text rendering, e.g. adding custom markup
|
|
22276
|
+
* or highlighting
|
|
22277
|
+
*/
|
|
22278
|
+
children?: (truncatedString: string) => ReactNode;
|
|
22279
|
+
};
|
|
22280
|
+
export const EuiTextTruncate: FunctionComponent<EuiTextTruncateProps>;
|
|
22281
|
+
export {};
|
|
22282
|
+
|
|
22283
|
+
}
|
|
22284
|
+
declare module '@elastic/eui/src/components/text_truncate' {
|
|
22285
|
+
export type { EuiTextTruncateProps, EuiTextTruncationTypes, } from '@elastic/eui/src/components/text_truncate/text_truncate';
|
|
22286
|
+
export { EuiTextTruncate } from '@elastic/eui/src/components/text_truncate/text_truncate';
|
|
22287
|
+
export { TruncationUtilsWithDOM, TruncationUtilsWithCanvas } from '@elastic/eui/src/components/text_truncate/utils';
|
|
22288
|
+
|
|
22032
22289
|
}
|
|
22033
22290
|
declare module '@elastic/eui/src/components/toast/toast.styles' {
|
|
22034
22291
|
import { UseEuiTheme } from '@elastic/eui/src/services';
|
|
@@ -22724,6 +22981,7 @@ declare module '@elastic/eui/src/components' {
|
|
|
22724
22981
|
export * from '@elastic/eui/src/components/tabs';
|
|
22725
22982
|
export * from '@elastic/eui/src/components/text';
|
|
22726
22983
|
export * from '@elastic/eui/src/components/text_diff';
|
|
22984
|
+
export * from '@elastic/eui/src/components/text_truncate';
|
|
22727
22985
|
export * from '@elastic/eui/src/components/timeline';
|
|
22728
22986
|
export * from '@elastic/eui/src/components/title';
|
|
22729
22987
|
export * from '@elastic/eui/src/components/toast';
|