@elastic/eui 88.1.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.map +1 -1
- package/dist/eui_theme_dark.css +9 -36
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +9 -36
- 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 +2 -25
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- 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/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_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/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/eui.d.ts +246 -17
- package/i18ntokens.json +8 -8
- 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 +2 -25
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- 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/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_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/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/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 +2 -25
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- 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/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_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/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/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 +2 -25
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- 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/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_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/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/package.json +1 -1
- package/src/components/datagrid/_data_grid.scss +13 -2
- 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 +2 -25
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
- 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/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_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/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/src/components/accordion/_accordion_form.scss +0 -40
- package/src/components/accordion/_index.scss +0 -1
package/eui.d.ts
CHANGED
|
@@ -673,6 +673,7 @@ declare module '@elastic/eui/src/global_styling/variables/levels' {
|
|
|
673
673
|
|
|
674
674
|
}
|
|
675
675
|
declare module '@elastic/eui/src/services/theme/types' {
|
|
676
|
+
import type { CSSObject } from '@emotion/react';
|
|
676
677
|
import { RecursivePartial, ValueOf } from '@elastic/eui/src/components/common';
|
|
677
678
|
import { _EuiThemeAnimation } from '@elastic/eui/src/global_styling/variables/animations';
|
|
678
679
|
import { _EuiThemeBreakpoints } from '@elastic/eui/src/global_styling/variables/breakpoint';
|
|
@@ -730,6 +731,10 @@ declare module '@elastic/eui/src/services/theme/types' {
|
|
|
730
731
|
hasDifferentColorFromGlobalTheme: boolean;
|
|
731
732
|
bodyColor: string;
|
|
732
733
|
colorClassName: string;
|
|
734
|
+
setGlobalCSSVariables: Function;
|
|
735
|
+
globalCSSVariables?: CSSObject;
|
|
736
|
+
setNearestThemeCSSVariables: Function;
|
|
737
|
+
themeCSSVariables?: CSSObject;
|
|
733
738
|
};
|
|
734
739
|
|
|
735
740
|
}
|
|
@@ -1366,6 +1371,16 @@ declare module '@elastic/eui/src/services/theme/hooks' {
|
|
|
1366
1371
|
export const RenderWithEuiTheme: <T extends {} = {}>({ children, }: {
|
|
1367
1372
|
children: (theme: UseEuiTheme) => React.ReactElement;
|
|
1368
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
|
+
};
|
|
1369
1384
|
|
|
1370
1385
|
}
|
|
1371
1386
|
declare module '@elastic/eui/src/global_styling/functions/typography' {
|
|
@@ -7798,6 +7813,20 @@ declare module '@elastic/eui/src/services/theme/context' {
|
|
|
7798
7813
|
export const EuiThemeContext: import("react").Context<EuiThemeComputed<{}>>;
|
|
7799
7814
|
export const EuiNestedThemeContext: import("react").Context<EuiThemeNested>;
|
|
7800
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
|
+
|
|
7801
7830
|
}
|
|
7802
7831
|
declare module '@elastic/eui/src/services/theme/emotion' {
|
|
7803
7832
|
import { FunctionComponent, PropsWithChildren } from 'react';
|
|
@@ -7842,7 +7871,7 @@ declare module '@elastic/eui/src/services/theme/provider' {
|
|
|
7842
7871
|
declare module '@elastic/eui/src/services/theme' {
|
|
7843
7872
|
export { EuiSystemContext, EuiThemeContext, EuiNestedThemeContext, EuiModificationsContext, EuiColorModeContext, } from '@elastic/eui/src/services/theme/context';
|
|
7844
7873
|
export type { UseEuiTheme, WithEuiThemeProps } from '@elastic/eui/src/services/theme/hooks';
|
|
7845
|
-
export { useEuiTheme, withEuiTheme, RenderWithEuiTheme } from '@elastic/eui/src/services/theme/hooks';
|
|
7874
|
+
export { useEuiTheme, withEuiTheme, RenderWithEuiTheme, useEuiThemeCSSVariables, } from '@elastic/eui/src/services/theme/hooks';
|
|
7846
7875
|
export type { EuiThemeProviderProps } from '@elastic/eui/src/services/theme/provider';
|
|
7847
7876
|
export { EuiThemeProvider } from '@elastic/eui/src/services/theme/provider';
|
|
7848
7877
|
export { getEuiDevProviderWarning, setEuiDevProviderWarning } from '@elastic/eui/src/services/theme/warning';
|
|
@@ -7950,20 +7979,6 @@ declare module '@elastic/eui/src/services/console' {
|
|
|
7950
7979
|
declare module '@elastic/eui/src/services/copy_to_clipboard' {
|
|
7951
7980
|
export function copyToClipboard(text: string): boolean;
|
|
7952
7981
|
|
|
7953
|
-
}
|
|
7954
|
-
declare module '@elastic/eui/src/services/emotion/clone_element' {
|
|
7955
|
-
import React from 'react';
|
|
7956
|
-
/**
|
|
7957
|
-
* React.cloneElement does not work if the cloned element does not already have the
|
|
7958
|
-
* `css` prop - as a result, we need to use `jsx()` to manually clone the element
|
|
7959
|
-
* See https://github.com/emotion-js/emotion/issues/1404
|
|
7960
|
-
*/
|
|
7961
|
-
export const cloneElementWithCss: (element: any, props: any) => React.ReactElement;
|
|
7962
|
-
|
|
7963
|
-
}
|
|
7964
|
-
declare module '@elastic/eui/src/services/emotion' {
|
|
7965
|
-
export * from '@elastic/eui/src/services/emotion/clone_element';
|
|
7966
|
-
|
|
7967
7982
|
}
|
|
7968
7983
|
declare module '@elastic/eui/src/services/findElement' {
|
|
7969
7984
|
/**
|
|
@@ -8528,9 +8543,22 @@ declare module '@elastic/eui/src/components/accessibility' {
|
|
|
8528
8543
|
}
|
|
8529
8544
|
declare module '@elastic/eui/src/components/accordion/accordion.styles' {
|
|
8530
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
|
+
};
|
|
8531
8554
|
export const euiAccordionButtonStyles: (euiThemeContext: UseEuiTheme) => {
|
|
8532
8555
|
euiAccordion__button: import("@emotion/utils").SerializedStyles;
|
|
8533
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;
|
|
8534
8562
|
};
|
|
8535
8563
|
export const euiAccordionChildrenStyles: ({ euiTheme }: UseEuiTheme) => {
|
|
8536
8564
|
euiAccordion__children: import("@emotion/utils").SerializedStyles;
|
|
@@ -8581,9 +8609,14 @@ declare module '@elastic/eui/src/components/accordion/accordion' {
|
|
|
8581
8609
|
*/
|
|
8582
8610
|
buttonClassName?: string;
|
|
8583
8611
|
/**
|
|
8584
|
-
* 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.
|
|
8585
8616
|
*/
|
|
8586
|
-
buttonProps?: CommonProps & HTMLAttributes<HTMLElement
|
|
8617
|
+
buttonProps?: CommonProps & HTMLAttributes<HTMLElement> & {
|
|
8618
|
+
paddingSize?: 's' | 'm' | 'l';
|
|
8619
|
+
};
|
|
8587
8620
|
/**
|
|
8588
8621
|
* Class that will apply to the trigger content for the accordion.
|
|
8589
8622
|
*/
|
|
@@ -8621,6 +8654,10 @@ declare module '@elastic/eui/src/components/accordion/accordion' {
|
|
|
8621
8654
|
* Placement of the arrow indicator, or 'none' to hide it.
|
|
8622
8655
|
*/
|
|
8623
8656
|
arrowDisplay?: 'left' | 'right' | 'none';
|
|
8657
|
+
/**
|
|
8658
|
+
* Optional border styling. Defaults to 'none'.
|
|
8659
|
+
*/
|
|
8660
|
+
borders?: 'horizontal' | 'all' | 'none';
|
|
8624
8661
|
/**
|
|
8625
8662
|
* Control the opening of accordion via prop
|
|
8626
8663
|
*/
|
|
@@ -8643,6 +8680,7 @@ declare module '@elastic/eui/src/components/accordion/accordion' {
|
|
|
8643
8680
|
export class EuiAccordionClass extends Component<WithEuiThemeProps & EuiAccordionProps, EuiAccordionState> {
|
|
8644
8681
|
static defaultProps: {
|
|
8645
8682
|
initialIsOpen: boolean;
|
|
8683
|
+
borders: "none";
|
|
8646
8684
|
paddingSize: "none";
|
|
8647
8685
|
arrowDisplay: "left";
|
|
8648
8686
|
isLoading: boolean;
|
|
@@ -16385,6 +16423,12 @@ declare module '@elastic/eui/src/components/header/header' {
|
|
|
16385
16423
|
theme?: 'default' | 'dark';
|
|
16386
16424
|
};
|
|
16387
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>;
|
|
16388
16432
|
export {};
|
|
16389
16433
|
|
|
16390
16434
|
}
|
|
@@ -22058,6 +22102,190 @@ declare module '@elastic/eui/src/components/text_diff' {
|
|
|
22058
22102
|
export type { EuiTextDiffProps } from '@elastic/eui/src/components/text_diff/text_diff';
|
|
22059
22103
|
export { useEuiTextDiff } from '@elastic/eui/src/components/text_diff/text_diff';
|
|
22060
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
|
+
|
|
22061
22289
|
}
|
|
22062
22290
|
declare module '@elastic/eui/src/components/toast/toast.styles' {
|
|
22063
22291
|
import { UseEuiTheme } from '@elastic/eui/src/services';
|
|
@@ -22753,6 +22981,7 @@ declare module '@elastic/eui/src/components' {
|
|
|
22753
22981
|
export * from '@elastic/eui/src/components/tabs';
|
|
22754
22982
|
export * from '@elastic/eui/src/components/text';
|
|
22755
22983
|
export * from '@elastic/eui/src/components/text_diff';
|
|
22984
|
+
export * from '@elastic/eui/src/components/text_truncate';
|
|
22756
22985
|
export * from '@elastic/eui/src/components/timeline';
|
|
22757
22986
|
export * from '@elastic/eui/src/components/title';
|
|
22758
22987
|
export * from '@elastic/eui/src/components/toast';
|
package/i18ntokens.json
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
"highlighting": "string",
|
|
6
6
|
"loc": {
|
|
7
7
|
"start": {
|
|
8
|
-
"line":
|
|
8
|
+
"line": 439,
|
|
9
9
|
"column": 16,
|
|
10
|
-
"index":
|
|
10
|
+
"index": 13187
|
|
11
11
|
},
|
|
12
12
|
"end": {
|
|
13
|
-
"line":
|
|
13
|
+
"line": 439,
|
|
14
14
|
"column": 76,
|
|
15
|
-
"index":
|
|
15
|
+
"index": 13247
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"filepath": "src/components/accordion/accordion.tsx"
|
|
@@ -437,14 +437,14 @@
|
|
|
437
437
|
"highlighting": "string",
|
|
438
438
|
"loc": {
|
|
439
439
|
"start": {
|
|
440
|
-
"line":
|
|
440
|
+
"line": 152,
|
|
441
441
|
"column": 27,
|
|
442
|
-
"index":
|
|
442
|
+
"index": 5056
|
|
443
443
|
},
|
|
444
444
|
"end": {
|
|
445
|
-
"line":
|
|
445
|
+
"line": 155,
|
|
446
446
|
"column": 3,
|
|
447
|
-
"index":
|
|
447
|
+
"index": 5126
|
|
448
448
|
}
|
|
449
449
|
},
|
|
450
450
|
"filepath": "src/components/collapsible_nav_beta/collapsible_nav_beta.tsx"
|
|
@@ -17,12 +17,19 @@ var _button = require("../button");
|
|
|
17
17
|
var _accordion = require("./accordion.styles");
|
|
18
18
|
var _global_styling = require("../../global_styling");
|
|
19
19
|
var _react2 = require("@emotion/react");
|
|
20
|
-
var _excluded = ["children", "buttonContent", "className", "id", "element", "buttonClassName", "buttonContentClassName", "extraAction", "paddingSize", "initialIsOpen", "arrowDisplay", "forceState", "isLoading", "isLoadingMessage", "isDisabled", "buttonProps", "buttonElement", "arrowProps", "theme"]
|
|
20
|
+
var _excluded = ["children", "buttonContent", "className", "id", "element", "buttonClassName", "buttonContentClassName", "extraAction", "paddingSize", "borders", "initialIsOpen", "arrowDisplay", "forceState", "isLoading", "isLoadingMessage", "isDisabled", "buttonProps", "buttonElement", "arrowProps", "theme"],
|
|
21
|
+
_excluded2 = ["paddingSize", "className", "css"];
|
|
21
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
25
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
25
26
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
28
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
30
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
31
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
32
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
26
33
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
27
34
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
28
35
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -171,18 +178,24 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
171
178
|
buttonContentClassName = _this$props3.buttonContentClassName,
|
|
172
179
|
extraAction = _this$props3.extraAction,
|
|
173
180
|
paddingSize = _this$props3.paddingSize,
|
|
181
|
+
borders = _this$props3.borders,
|
|
174
182
|
initialIsOpen = _this$props3.initialIsOpen,
|
|
175
183
|
arrowDisplay = _this$props3.arrowDisplay,
|
|
176
184
|
forceState = _this$props3.forceState,
|
|
177
185
|
isLoading = _this$props3.isLoading,
|
|
178
186
|
isLoadingMessage = _this$props3.isLoadingMessage,
|
|
179
187
|
isDisabled = _this$props3.isDisabled,
|
|
180
|
-
|
|
188
|
+
_buttonProps = _this$props3.buttonProps,
|
|
181
189
|
_this$props3$buttonEl = _this$props3.buttonElement,
|
|
182
190
|
_ButtonElement = _this$props3$buttonEl === void 0 ? 'button' : _this$props3$buttonEl,
|
|
183
191
|
arrowProps = _this$props3.arrowProps,
|
|
184
192
|
theme = _this$props3.theme,
|
|
185
193
|
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
194
|
+
var _ref = _buttonProps || {},
|
|
195
|
+
buttonPaddingSize = _ref.paddingSize,
|
|
196
|
+
buttonPropsClassName = _ref.className,
|
|
197
|
+
buttonPropsCss = _ref.css,
|
|
198
|
+
buttonProps = _objectWithoutProperties(_ref, _excluded2);
|
|
186
199
|
|
|
187
200
|
// Force button element to be a legend if the element is a fieldset
|
|
188
201
|
var ButtonElement = Element === 'fieldset' ? 'legend' : _ButtonElement;
|
|
@@ -193,10 +206,12 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
193
206
|
var classes = (0, _classnames.default)('euiAccordion', {
|
|
194
207
|
'euiAccordion-isOpen': this.isOpen
|
|
195
208
|
}, className);
|
|
209
|
+
var styles = (0, _accordion.euiAccordionStyles)(theme);
|
|
210
|
+
var cssStyles = [styles.euiAccordion, borders !== 'none' && styles.borders.borders, borders !== 'none' && styles.borders[borders]];
|
|
196
211
|
var childrenClasses = (0, _classnames.default)('euiAccordion__children', {
|
|
197
212
|
'euiAccordion__children-isLoading': isLoading
|
|
198
213
|
});
|
|
199
|
-
var buttonClasses = (0, _classnames.default)('euiAccordion__button', buttonClassName,
|
|
214
|
+
var buttonClasses = (0, _classnames.default)('euiAccordion__button', buttonClassName, buttonPropsClassName);
|
|
200
215
|
var buttonContentClasses = (0, _classnames.default)('euiAccordion__buttonContent', buttonContentClassName);
|
|
201
216
|
var iconButtonClasses = (0, _classnames.default)('euiAccordion__iconButton', {
|
|
202
217
|
'euiAccordion__iconButton-isOpen': this.isOpen,
|
|
@@ -205,7 +220,7 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
205
220
|
|
|
206
221
|
// Emotion styles
|
|
207
222
|
var buttonStyles = (0, _accordion.euiAccordionButtonStyles)(theme);
|
|
208
|
-
var cssButtonStyles = [buttonStyles.euiAccordion__button, isDisabled && buttonStyles.disabled,
|
|
223
|
+
var cssButtonStyles = [buttonStyles.euiAccordion__button, isDisabled && buttonStyles.disabled].concat(_toConsumableArray(buttonPaddingSize ? [buttonStyles[buttonPaddingSize], arrowDisplay === 'left' && buttonStyles.arrowLeft, arrowDisplay === 'right' && buttonStyles.arrowRight] : []), [buttonPropsCss]);
|
|
209
224
|
var childrenStyles = (0, _accordion.euiAccordionChildrenStyles)(theme);
|
|
210
225
|
var cssChildrenStyles = [childrenStyles.euiAccordion__children, isLoading && childrenStyles.isLoading, paddingSize && paddingSize !== 'none' && childrenStyles[paddingSize]];
|
|
211
226
|
var childWrapperStyles = (0, _accordion.euiAccordionChildWrapperStyles)(theme);
|
|
@@ -219,7 +234,7 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
219
234
|
var triggerWrapperStyles = (0, _accordion.euiAccordionTriggerWrapperStyles)();
|
|
220
235
|
var cssTriggerWrapperStyles = [triggerWrapperStyles.euiAccordion__triggerWrapper];
|
|
221
236
|
var iconButton;
|
|
222
|
-
var buttonId = (_buttonProps$id = buttonProps
|
|
237
|
+
var buttonId = (_buttonProps$id = buttonProps.id) !== null && _buttonProps$id !== void 0 ? _buttonProps$id : this.generatedId;
|
|
223
238
|
if (_arrowDisplay !== 'none') {
|
|
224
239
|
iconButton = (0, _react2.jsx)(_button.EuiButtonIcon, _extends({
|
|
225
240
|
color: "text"
|
|
@@ -271,7 +286,8 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
271
286
|
className: buttonContentClasses
|
|
272
287
|
}, buttonContent));
|
|
273
288
|
return (0, _react2.jsx)(Element, _extends({
|
|
274
|
-
className: classes
|
|
289
|
+
className: classes,
|
|
290
|
+
css: cssStyles
|
|
275
291
|
}, rest), (0, _react2.jsx)("div", {
|
|
276
292
|
className: "euiAccordion__triggerWrapper",
|
|
277
293
|
css: cssTriggerWrapperStyles
|
|
@@ -303,6 +319,7 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
303
319
|
exports.EuiAccordionClass = EuiAccordionClass;
|
|
304
320
|
_defineProperty(EuiAccordionClass, "defaultProps", {
|
|
305
321
|
initialIsOpen: false,
|
|
322
|
+
borders: 'none',
|
|
306
323
|
paddingSize: 'none',
|
|
307
324
|
arrowDisplay: 'left',
|
|
308
325
|
isLoading: false,
|
|
@@ -327,13 +344,17 @@ EuiAccordionClass.propTypes = {
|
|
|
327
344
|
*/
|
|
328
345
|
buttonClassName: _propTypes.default.string,
|
|
329
346
|
/**
|
|
330
|
-
* Apply more props to the triggering button
|
|
347
|
+
* Apply more props to the triggering button.
|
|
348
|
+
*
|
|
349
|
+
* Includes optional `paddingSize` prop which allows sizes of `s`, `m`, or `l`.
|
|
350
|
+
* Note: Padding will not be present on the side closest to the accordion arrow.
|
|
331
351
|
*/
|
|
332
352
|
buttonProps: _propTypes.default.shape({
|
|
333
353
|
className: _propTypes.default.string,
|
|
334
354
|
"aria-label": _propTypes.default.string,
|
|
335
355
|
"data-test-subj": _propTypes.default.string,
|
|
336
|
-
css: _propTypes.default.any
|
|
356
|
+
css: _propTypes.default.any,
|
|
357
|
+
paddingSize: _propTypes.default.oneOf(["s", "m", "l"])
|
|
337
358
|
}),
|
|
338
359
|
/**
|
|
339
360
|
* Class that will apply to the trigger content for the accordion.
|
|
@@ -372,6 +393,10 @@ EuiAccordionClass.propTypes = {
|
|
|
372
393
|
* Placement of the arrow indicator, or 'none' to hide it.
|
|
373
394
|
*/
|
|
374
395
|
arrowDisplay: _propTypes.default.oneOf(["left", "right", "none"]),
|
|
396
|
+
/**
|
|
397
|
+
* Optional border styling. Defaults to 'none'.
|
|
398
|
+
*/
|
|
399
|
+
borders: _propTypes.default.oneOf(["horizontal", "all", "none"]),
|
|
375
400
|
/**
|
|
376
401
|
* Control the opening of accordion via prop
|
|
377
402
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.euiAccordionTriggerWrapperStyles = exports.euiAccordionSpinnerStyles = exports.euiAccordionOptionalActionStyles = exports.euiAccordionIconButtonStyles = exports.euiAccordionChildrenStyles = exports.euiAccordionChildWrapperStyles = exports.euiAccordionButtonStyles = void 0;
|
|
6
|
+
exports.euiAccordionTriggerWrapperStyles = exports.euiAccordionStyles = exports.euiAccordionSpinnerStyles = exports.euiAccordionOptionalActionStyles = exports.euiAccordionIconButtonStyles = exports.euiAccordionChildrenStyles = exports.euiAccordionChildWrapperStyles = exports.euiAccordionButtonStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _global_styling = require("../../global_styling");
|
|
9
9
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
|
|
@@ -13,13 +13,34 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
13
13
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
14
|
* Side Public License, v 1.
|
|
15
15
|
*/
|
|
16
|
+
var euiAccordionStyles = function euiAccordionStyles(_ref5) {
|
|
17
|
+
var euiTheme = _ref5.euiTheme;
|
|
18
|
+
return {
|
|
19
|
+
euiAccordion: /*#__PURE__*/(0, _react.css)(";label:euiAccordion;"),
|
|
20
|
+
// Borders
|
|
21
|
+
borders: {
|
|
22
|
+
// Prevent border repeats
|
|
23
|
+
borders: /*#__PURE__*/(0, _react.css)("&+[class*='euiAccordion-borders']{", (0, _global_styling.logicalCSS)('border-top', 'none'), ";};label:borders;"),
|
|
24
|
+
horizontal: /*#__PURE__*/(0, _react.css)("border-block:", euiTheme.border.thin, ";;label:horizontal;"),
|
|
25
|
+
all: /*#__PURE__*/(0, _react.css)("border:", euiTheme.border.thin, ";;label:all;")
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
exports.euiAccordionStyles = euiAccordionStyles;
|
|
16
30
|
var euiAccordionButtonStyles = function euiAccordionButtonStyles(euiThemeContext) {
|
|
17
31
|
var euiTheme = euiThemeContext.euiTheme;
|
|
18
32
|
return {
|
|
19
33
|
euiAccordion__button: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 's'), " align-items:center;display:flex;flex-grow:1;line-height:", euiTheme.size.l, ";", (0, _global_styling.logicalTextAlignCSS)('left'), " ", (0, _global_styling.logicalCSS)('width', '100%'), " &:hover,&:focus{cursor:pointer;text-decoration:underline;};label:euiAccordion__button;"),
|
|
20
34
|
// Triggering button needs separate `disabled` key because the element that renders may not support `:disabled`;
|
|
21
35
|
// Hover pseudo selector for specificity
|
|
22
|
-
disabled: /*#__PURE__*/(0, _react.css)("&,&:hover{cursor:not-allowed;color:", euiTheme.colors.disabledText, ";text-decoration:none;};label:disabled;")
|
|
36
|
+
disabled: /*#__PURE__*/(0, _react.css)("&,&:hover{cursor:not-allowed;color:", euiTheme.colors.disabledText, ";text-decoration:none;};label:disabled;"),
|
|
37
|
+
// Optional padding sizes
|
|
38
|
+
s: /*#__PURE__*/(0, _react.css)("padding:", euiTheme.size.s, ";;label:s;"),
|
|
39
|
+
m: /*#__PURE__*/(0, _react.css)("padding:", euiTheme.size.base, ";;label:m;"),
|
|
40
|
+
l: /*#__PURE__*/(0, _react.css)("padding:", euiTheme.size.l, ";;label:l;"),
|
|
41
|
+
// Remove padding from the accordion button on the side that the arrow is on
|
|
42
|
+
arrowLeft: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', 0), ";;label:arrowLeft;"),
|
|
43
|
+
arrowRight: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', 0), ";;label:arrowRight;")
|
|
23
44
|
};
|
|
24
45
|
};
|
|
25
46
|
exports.euiAccordionButtonStyles = euiAccordionButtonStyles;
|
|
@@ -31,8 +52,8 @@ var _ref4 = process.env.NODE_ENV === "production" ? {
|
|
|
31
52
|
styles: "align-items:center;display:flex;label:isLoading;",
|
|
32
53
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
33
54
|
};
|
|
34
|
-
var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(
|
|
35
|
-
var euiTheme =
|
|
55
|
+
var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref6) {
|
|
56
|
+
var euiTheme = _ref6.euiTheme;
|
|
36
57
|
return {
|
|
37
58
|
euiAccordion__children: /*#__PURE__*/(0, _react.css)(";label:euiAccordion__children;"),
|
|
38
59
|
isLoading: _ref4,
|
|
@@ -44,8 +65,8 @@ var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref5) {
|
|
|
44
65
|
};
|
|
45
66
|
};
|
|
46
67
|
exports.euiAccordionChildrenStyles = euiAccordionChildrenStyles;
|
|
47
|
-
var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(
|
|
48
|
-
var euiTheme =
|
|
68
|
+
var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(_ref7) {
|
|
69
|
+
var euiTheme = _ref7.euiTheme;
|
|
49
70
|
return {
|
|
50
71
|
euiAccordion__childWrapper: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 0), " opacity:0;overflow:hidden;transition:", _global_styling.logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;&:focus{outline:none;};label:euiAccordion__childWrapper;"),
|
|
51
72
|
isOpen: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 'auto'), " opacity:1;visibility:visible;;label:isOpen;")
|
|
@@ -60,8 +81,8 @@ var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
|
60
81
|
styles: "transform:rotate(\n 90deg\n )!important;label:isOpen;",
|
|
61
82
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
62
83
|
};
|
|
63
|
-
var euiAccordionIconButtonStyles = function euiAccordionIconButtonStyles(
|
|
64
|
-
var euiTheme =
|
|
84
|
+
var euiAccordionIconButtonStyles = function euiAccordionIconButtonStyles(_ref8) {
|
|
85
|
+
var euiTheme = _ref8.euiTheme;
|
|
65
86
|
return {
|
|
66
87
|
euiAccordion__iconButton: /*#__PURE__*/(0, _react.css)("flex-shrink:0;", (0, _global_styling.logicalCSS)('margin-right', euiTheme.size.xs), " transform:rotate(\n 0deg\n )!important;;label:euiAccordion__iconButton;"),
|
|
67
88
|
isOpen: _ref3,
|
|
@@ -83,8 +104,8 @@ var euiAccordionOptionalActionStyles = function euiAccordionOptionalActionStyles
|
|
|
83
104
|
};
|
|
84
105
|
};
|
|
85
106
|
exports.euiAccordionOptionalActionStyles = euiAccordionOptionalActionStyles;
|
|
86
|
-
var euiAccordionSpinnerStyles = function euiAccordionSpinnerStyles(
|
|
87
|
-
var euiTheme =
|
|
107
|
+
var euiAccordionSpinnerStyles = function euiAccordionSpinnerStyles(_ref9) {
|
|
108
|
+
var euiTheme = _ref9.euiTheme;
|
|
88
109
|
return {
|
|
89
110
|
euiAccordion__spinner: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-right', euiTheme.size.xs), ";;label:euiAccordion__spinner;")
|
|
90
111
|
};
|
|
@@ -199,13 +199,17 @@ EuiCollapsibleNavGroup.propTypes = {
|
|
|
199
199
|
*/
|
|
200
200
|
buttonClassName: _propTypes.default.string,
|
|
201
201
|
/**
|
|
202
|
-
* Apply more props to the triggering button
|
|
202
|
+
* Apply more props to the triggering button.
|
|
203
|
+
*
|
|
204
|
+
* Includes optional `paddingSize` prop which allows sizes of `s`, `m`, or `l`.
|
|
205
|
+
* Note: Padding will not be present on the side closest to the accordion arrow.
|
|
203
206
|
*/
|
|
204
207
|
buttonProps: _propTypes.default.shape({
|
|
205
208
|
className: _propTypes.default.string,
|
|
206
209
|
"aria-label": _propTypes.default.string,
|
|
207
210
|
"data-test-subj": _propTypes.default.string,
|
|
208
|
-
css: _propTypes.default.any
|
|
211
|
+
css: _propTypes.default.any,
|
|
212
|
+
paddingSize: _propTypes.default.oneOf(["s", "m", "l"])
|
|
209
213
|
}),
|
|
210
214
|
/**
|
|
211
215
|
* Class that will apply to the trigger content for the accordion.
|
|
@@ -244,6 +248,10 @@ EuiCollapsibleNavGroup.propTypes = {
|
|
|
244
248
|
* Placement of the arrow indicator, or 'none' to hide it.
|
|
245
249
|
*/
|
|
246
250
|
arrowDisplay: _propTypes.default.oneOf(["left", "right", "none"]),
|
|
251
|
+
/**
|
|
252
|
+
* Optional border styling. Defaults to 'none'.
|
|
253
|
+
*/
|
|
254
|
+
borders: _propTypes.default.oneOf(["horizontal", "all", "none"]),
|
|
247
255
|
/**
|
|
248
256
|
* Control the opening of accordion via prop
|
|
249
257
|
*/
|