@elastic/eui 62.0.2 → 62.1.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_theme_dark.css +1 -783
- package/dist/eui_theme_dark.json +0 -57
- package/dist/eui_theme_dark.json.d.ts +0 -57
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +1 -783
- package/dist/eui_theme_light.json +0 -57
- package/dist/eui_theme_light.json.d.ts +0 -57
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/breadcrumbs/breadcrumb.js +199 -0
- package/es/components/breadcrumbs/breadcrumb.styles.js +61 -0
- package/es/components/breadcrumbs/breadcrumbs.js +115 -187
- package/es/components/breadcrumbs/breadcrumbs.styles.js +30 -0
- package/es/components/code/code_block.js +119 -107
- package/es/components/collapsible_nav/collapsible_nav.js +2 -2
- package/es/components/control_bar/control_bar.js +13 -0
- package/es/components/datagrid/body/data_grid_body.js +1 -1
- package/es/components/datagrid/body/header/data_grid_header_row.js +1 -1
- package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/es/components/datagrid/data_grid.js +1 -1
- package/es/components/date_picker/super_date_picker/super_date_picker.js +2 -2
- package/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/es/components/description_list/description_list.js +22 -26
- package/es/components/description_list/description_list.styles.js +25 -0
- package/es/components/description_list/description_list_context.js +14 -0
- package/es/components/description_list/description_list_description.js +43 -2
- package/es/components/description_list/description_list_description.styles.js +47 -0
- package/es/components/description_list/description_list_title.js +43 -2
- package/es/components/description_list/description_list_title.styles.js +37 -0
- package/es/components/description_list/description_list_types.js +10 -0
- package/es/components/header/header.js +1 -27
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +22 -2
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +15 -0
- package/es/components/header/header_links/header_links.js +9 -9
- package/es/components/icon/assets/tokenStruct.js +1 -1
- package/es/components/page/page_header/page_header.js +1 -0
- package/es/components/page/page_header/page_header_content.js +2 -1
- package/es/components/page/page_template.js +1 -0
- package/es/components/pagination/pagination.js +1 -1
- package/es/components/panel/split_panel/split_panel.js +2 -2
- package/es/components/provider/provider.js +2 -2
- package/es/components/responsive/hide_for.js +6 -38
- package/es/components/responsive/show_for.js +6 -38
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +17 -36
- package/es/components/side_nav/side_nav.js +1 -1
- package/es/components/table/table_row_cell.js +1 -2
- package/es/components/toast/global_toast_list.js +208 -241
- package/es/components/toast/global_toast_list.styles.js +38 -0
- package/es/components/toast/global_toast_list_item.js +12 -7
- package/es/components/toast/toast.js +25 -25
- package/es/components/toast/toast.styles.js +55 -0
- package/es/components/token/index.js +2 -1
- package/es/components/token/token.js +48 -112
- package/es/components/token/token.styles.js +93 -0
- package/es/components/token/token_map.js +6 -9
- package/es/components/token/token_types.js +11 -0
- package/es/global_styling/reset/global_styles.js +1 -1
- package/es/services/{breakpoint.js → breakpoint/breakpoint.js} +4 -9
- package/es/services/{hooks/useIsWithinBreakpoints.js → breakpoint/currentEuiBreakpoint.js} +36 -28
- package/es/services/breakpoint/index.js +10 -0
- package/es/services/breakpoint/useIsWithinBreakpoints.js +24 -0
- package/es/services/hooks/index.js +0 -1
- package/es/services/index.js +1 -1
- package/eui.d.ts +1681 -1479
- package/i18ntokens.json +36 -36
- package/lib/components/breadcrumbs/breadcrumb.js +225 -0
- package/lib/components/breadcrumbs/breadcrumb.styles.js +68 -0
- package/lib/components/breadcrumbs/breadcrumbs.js +125 -188
- package/lib/components/breadcrumbs/breadcrumbs.styles.js +33 -0
- package/lib/components/code/code_block.js +118 -106
- package/lib/components/collapsible_nav/collapsible_nav.js +2 -2
- package/lib/components/control_bar/control_bar.js +13 -0
- package/lib/components/datagrid/body/data_grid_body.js +1 -1
- package/lib/components/datagrid/body/header/data_grid_header_row.js +1 -1
- package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/lib/components/datagrid/data_grid.js +1 -1
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +2 -2
- package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/lib/components/description_list/description_list.js +25 -31
- package/lib/components/description_list/description_list.styles.js +36 -0
- package/lib/components/description_list/description_list_context.js +24 -0
- package/lib/components/description_list/description_list_description.js +52 -2
- package/lib/components/description_list/description_list_description.styles.js +51 -0
- package/lib/components/description_list/description_list_title.js +52 -2
- package/lib/components/description_list/description_list_title.styles.js +50 -0
- package/lib/components/description_list/description_list_types.js +20 -0
- package/lib/components/header/header.js +1 -27
- package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +24 -2
- package/lib/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +26 -0
- package/lib/components/header/header_links/header_links.js +8 -8
- package/lib/components/icon/assets/tokenStruct.js +1 -1
- package/lib/components/icon/svgs/tokens/tokenStruct.svg +1 -1
- package/lib/components/page/page_header/page_header.js +1 -0
- package/lib/components/page/page_header/page_header_content.js +3 -2
- package/lib/components/page/page_template.js +1 -0
- package/lib/components/pagination/pagination.js +1 -1
- package/lib/components/panel/split_panel/split_panel.js +3 -3
- package/lib/components/provider/provider.js +1 -1
- package/lib/components/responsive/hide_for.js +12 -44
- package/lib/components/responsive/show_for.js +12 -44
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +15 -35
- package/lib/components/side_nav/side_nav.js +1 -1
- package/lib/components/table/table_row_cell.js +1 -3
- package/lib/components/toast/global_toast_list.js +209 -238
- package/lib/components/toast/global_toast_list.styles.js +45 -0
- package/lib/components/toast/global_toast_list_item.js +14 -7
- package/lib/components/toast/toast.js +27 -25
- package/lib/components/toast/toast.styles.js +66 -0
- package/lib/components/token/index.js +5 -3
- package/lib/components/token/token.js +50 -120
- package/lib/components/token/token.styles.js +101 -0
- package/lib/components/token/token_map.js +6 -9
- package/lib/components/token/token_types.js +22 -0
- package/lib/global_styling/reset/global_styles.js +1 -1
- package/{test-env/services → lib/services/breakpoint}/breakpoint.js +5 -9
- package/lib/services/breakpoint/currentEuiBreakpoint.js +80 -0
- package/lib/services/breakpoint/index.js +44 -0
- package/lib/services/breakpoint/useIsWithinBreakpoints.js +34 -0
- package/lib/services/hooks/index.js +0 -13
- package/lib/services/index.js +28 -0
- package/optimize/es/components/breadcrumbs/breadcrumb.js +136 -0
- package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +61 -0
- package/optimize/es/components/breadcrumbs/breadcrumbs.js +92 -165
- package/optimize/es/components/breadcrumbs/breadcrumbs.styles.js +30 -0
- package/optimize/es/components/code/code_block.js +106 -107
- package/optimize/es/components/description_list/description_list.js +20 -24
- package/optimize/es/components/description_list/description_list.styles.js +25 -0
- package/optimize/es/components/description_list/description_list_context.js +14 -0
- package/optimize/es/components/description_list/description_list_description.js +32 -2
- package/optimize/es/components/description_list/description_list_description.styles.js +47 -0
- package/optimize/es/components/description_list/description_list_title.js +32 -2
- package/optimize/es/components/description_list/description_list_title.styles.js +37 -0
- package/optimize/es/components/description_list/description_list_types.js +10 -0
- package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.js +8 -1
- package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +15 -0
- package/optimize/es/components/header/header_links/header_links.js +8 -8
- package/optimize/es/components/icon/assets/tokenStruct.js +1 -1
- package/optimize/es/components/page/page_header/page_header_content.js +1 -1
- package/optimize/es/components/panel/split_panel/split_panel.js +1 -1
- package/optimize/es/components/provider/provider.js +2 -2
- package/optimize/es/components/responsive/hide_for.js +5 -27
- package/optimize/es/components/responsive/show_for.js +5 -27
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.js +16 -35
- package/optimize/es/components/table/table_row_cell.js +1 -2
- package/optimize/es/components/toast/global_toast_list.js +199 -230
- package/optimize/es/components/toast/global_toast_list.styles.js +38 -0
- package/optimize/es/components/toast/global_toast_list_item.js +11 -6
- package/optimize/es/components/toast/toast.js +24 -24
- package/optimize/es/components/toast/toast.styles.js +55 -0
- package/optimize/es/components/token/index.js +2 -1
- package/optimize/es/components/token/token.js +46 -69
- package/optimize/es/components/token/token.styles.js +83 -0
- package/optimize/es/components/token/token_map.js +6 -9
- package/optimize/es/components/token/token_types.js +11 -0
- package/optimize/es/global_styling/reset/global_styles.js +1 -1
- package/optimize/es/services/{breakpoint.js → breakpoint/breakpoint.js} +4 -9
- package/optimize/es/services/breakpoint/currentEuiBreakpoint.js +53 -0
- package/optimize/es/services/breakpoint/index.js +10 -0
- package/optimize/es/services/breakpoint/useIsWithinBreakpoints.js +24 -0
- package/optimize/es/services/hooks/index.js +0 -1
- package/optimize/es/services/index.js +1 -1
- package/optimize/lib/components/breadcrumbs/breadcrumb.js +162 -0
- package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +68 -0
- package/optimize/lib/components/breadcrumbs/breadcrumbs.js +99 -164
- package/optimize/lib/components/breadcrumbs/breadcrumbs.styles.js +33 -0
- package/optimize/lib/components/code/code_block.js +105 -106
- package/optimize/lib/components/description_list/description_list.js +23 -28
- package/optimize/lib/components/description_list/description_list.styles.js +36 -0
- package/optimize/lib/components/description_list/description_list_context.js +24 -0
- package/optimize/lib/components/description_list/description_list_description.js +43 -2
- package/optimize/lib/components/description_list/description_list_description.styles.js +51 -0
- package/optimize/lib/components/description_list/description_list_title.js +43 -2
- package/optimize/lib/components/description_list/description_list_title.styles.js +50 -0
- package/optimize/lib/components/description_list/description_list_types.js +20 -0
- package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +10 -1
- package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +26 -0
- package/optimize/lib/components/header/header_links/header_links.js +7 -7
- package/optimize/lib/components/icon/assets/tokenStruct.js +1 -1
- package/optimize/lib/components/icon/svgs/tokens/tokenStruct.svg +1 -1
- package/optimize/lib/components/page/page_header/page_header_content.js +2 -2
- package/optimize/lib/components/panel/split_panel/split_panel.js +2 -2
- package/optimize/lib/components/provider/provider.js +1 -1
- package/optimize/lib/components/responsive/hide_for.js +4 -33
- package/optimize/lib/components/responsive/show_for.js +4 -33
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +14 -34
- package/optimize/lib/components/table/table_row_cell.js +1 -3
- package/optimize/lib/components/toast/global_toast_list.js +206 -220
- package/optimize/lib/components/toast/global_toast_list.styles.js +47 -0
- package/optimize/lib/components/toast/global_toast_list_item.js +14 -7
- package/optimize/lib/components/toast/toast.js +26 -24
- package/optimize/lib/components/toast/toast.styles.js +66 -0
- package/optimize/lib/components/token/index.js +5 -3
- package/optimize/lib/components/token/token.js +50 -76
- package/optimize/lib/components/token/token.styles.js +91 -0
- package/optimize/lib/components/token/token_map.js +6 -9
- package/optimize/lib/components/token/token_types.js +22 -0
- package/optimize/lib/global_styling/reset/global_styles.js +1 -1
- package/optimize/lib/services/{breakpoint.js → breakpoint/breakpoint.js} +5 -9
- package/optimize/lib/services/breakpoint/currentEuiBreakpoint.js +81 -0
- package/optimize/lib/services/breakpoint/index.js +44 -0
- package/optimize/lib/services/breakpoint/useIsWithinBreakpoints.js +34 -0
- package/optimize/lib/services/hooks/index.js +0 -13
- package/optimize/lib/services/index.js +28 -0
- package/package.json +2 -2
- package/src/components/control_bar/_control_bar.scss +1 -1
- package/src/components/header/_index.scss +0 -1
- package/src/components/index.scss +0 -5
- package/src/themes/amsterdam/overrides/_breadcrumbs.scss +0 -12
- package/src/themes/amsterdam/overrides/_index.scss +0 -4
- package/test-env/components/breadcrumbs/breadcrumb.js +211 -0
- package/test-env/components/breadcrumbs/breadcrumb.styles.js +68 -0
- package/test-env/components/breadcrumbs/breadcrumbs.js +122 -174
- package/test-env/components/breadcrumbs/breadcrumbs.styles.js +33 -0
- package/test-env/components/collapsible_nav/collapsible_nav.js +2 -2
- package/test-env/components/control_bar/control_bar.js +13 -0
- package/test-env/components/datagrid/body/data_grid_body.js +1 -1
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +1 -1
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/test-env/components/datagrid/data_grid.js +1 -1
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +2 -2
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/test-env/components/description_list/description_list.js +25 -30
- package/test-env/components/description_list/description_list.styles.js +36 -0
- package/test-env/components/description_list/description_list_context.js +24 -0
- package/test-env/components/description_list/description_list_description.js +43 -2
- package/test-env/components/description_list/description_list_description.styles.js +51 -0
- package/test-env/components/description_list/description_list_title.js +43 -2
- package/test-env/components/description_list/description_list_title.styles.js +50 -0
- package/test-env/components/description_list/description_list_types.js +20 -0
- package/test-env/components/header/header.js +1 -27
- package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +24 -2
- package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +26 -0
- package/test-env/components/header/header_links/header_links.js +8 -8
- package/test-env/components/icon/assets/tokenStruct.js +1 -1
- package/test-env/components/page/page_header/page_header.js +1 -0
- package/test-env/components/page/page_header/page_header_content.js +3 -2
- package/test-env/components/page/page_template.js +1 -0
- package/test-env/components/pagination/pagination.js +1 -1
- package/test-env/components/panel/split_panel/split_panel.js +3 -3
- package/test-env/components/provider/provider.js +1 -1
- package/test-env/components/responsive/hide_for.js +5 -34
- package/test-env/components/responsive/show_for.js +5 -34
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +15 -35
- package/test-env/components/side_nav/side_nav.js +1 -1
- package/test-env/components/table/table_row_cell.js +1 -3
- package/test-env/components/toast/global_toast_list.js +206 -220
- package/test-env/components/toast/global_toast_list.styles.js +47 -0
- package/test-env/components/toast/global_toast_list_item.js +14 -7
- package/test-env/components/toast/toast.js +27 -25
- package/test-env/components/toast/toast.styles.js +66 -0
- package/test-env/components/token/index.js +5 -3
- package/test-env/components/token/token.js +51 -120
- package/test-env/components/token/token.styles.js +91 -0
- package/test-env/components/token/token_map.js +6 -9
- package/test-env/components/token/token_types.js +22 -0
- package/test-env/global_styling/reset/global_styles.js +1 -1
- package/{lib/services → test-env/services/breakpoint}/breakpoint.js +5 -9
- package/test-env/services/breakpoint/currentEuiBreakpoint.js +37 -0
- package/test-env/services/breakpoint/index.js +44 -0
- package/test-env/services/breakpoint/useIsWithinBreakpoints.js +34 -0
- package/test-env/services/hooks/index.js +0 -13
- package/test-env/services/index.js +28 -0
- package/lib/services/hooks/useIsWithinBreakpoints.js +0 -57
- package/optimize/es/services/hooks/useIsWithinBreakpoints.js +0 -46
- package/optimize/lib/services/hooks/useIsWithinBreakpoints.js +0 -57
- package/src/components/breadcrumbs/_breadcrumbs.scss +0 -79
- package/src/components/breadcrumbs/_index.scss +0 -2
- package/src/components/breadcrumbs/_variables.scss +0 -2
- package/src/components/description_list/_description_list.scss +0 -211
- package/src/components/description_list/_index.scss +0 -1
- package/src/components/header/header_breadcrumbs/_header_breadcrumbs.scss +0 -8
- package/src/components/header/header_breadcrumbs/_index.scss +0 -1
- package/src/components/portal/_index.scss +0 -1
- package/src/components/portal/_portal.scss +0 -6
- package/src/components/toast/_global_toast_list.scss +0 -90
- package/src/components/toast/_index.scss +0 -4
- package/src/components/toast/_toast.scss +0 -103
- package/src/components/token/_index.scss +0 -2
- package/src/components/token/_token.scss +0 -85
- package/src/components/token/_variables.scss +0 -13
- package/src/themes/amsterdam/overrides/_header_breadcrumbs.scss +0 -71
- package/src/themes/amsterdam/overrides/_toast.scss +0 -21
- package/src/themes/amsterdam/overrides/_token.scss +0 -4
- package/test-env/services/hooks/useIsWithinBreakpoints.js +0 -57
|
@@ -43,7 +43,7 @@ import { EuiButtonIcon } from '../button';
|
|
|
43
43
|
import { keysOf } from '../common';
|
|
44
44
|
import { EuiCopy } from '../copy';
|
|
45
45
|
import { EuiFocusTrap } from '../focus_trap';
|
|
46
|
-
import {
|
|
46
|
+
import { useEuiI18n } from '../i18n';
|
|
47
47
|
import { useInnerText } from '../inner_text';
|
|
48
48
|
import { useMutationObserver } from '../observer/mutation_observer';
|
|
49
49
|
import { useResizeObserver } from '../observer/resize_observer';
|
|
@@ -127,7 +127,7 @@ export var EuiCodeBlock = function EuiCodeBlock(_ref) {
|
|
|
127
127
|
}),
|
|
128
128
|
innerTextRef = _useCopy.innerTextRef,
|
|
129
129
|
showCopyButton = _useCopy.showCopyButton,
|
|
130
|
-
|
|
130
|
+
textToCopy = _useCopy.textToCopy;
|
|
131
131
|
|
|
132
132
|
var _useOverflowDetection = useOverflowDetection(),
|
|
133
133
|
setWrapperRef = _useOverflowDetection.setWrapperRef,
|
|
@@ -140,8 +140,8 @@ export var EuiCodeBlock = function EuiCodeBlock(_ref) {
|
|
|
140
140
|
}),
|
|
141
141
|
showFullScreenButton = _useFullScreen.showFullScreenButton,
|
|
142
142
|
onKeyDown = _useFullScreen.onKeyDown,
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
isFullScreen = _useFullScreen.isFullScreen,
|
|
144
|
+
toggleFullScreen = _useFullScreen.toggleFullScreen; // Classes used in both fullscreen and non-fullscreen mode
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
var wrapperClasses = classNames(className, 'euiCodeBlock', {
|
|
@@ -171,25 +171,32 @@ export var EuiCodeBlock = function EuiCodeBlock(_ref) {
|
|
|
171
171
|
onKeyDown: onKeyDown
|
|
172
172
|
};
|
|
173
173
|
}, [preClasses, onKeyDown]);
|
|
174
|
-
var
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
var wrapperProps = {
|
|
182
|
-
className: classes,
|
|
183
|
-
style: optionalStyles
|
|
184
|
-
};
|
|
185
|
-
var codeBlockControls;
|
|
186
|
-
|
|
187
|
-
if (showCopyButton || showFullScreenButton) {
|
|
188
|
-
codeBlockControls = ___EmotionJSX("div", {
|
|
189
|
-
className: "euiCodeBlock__controls"
|
|
190
|
-
}, ___EmotionJSX(FullScreenButton, null), ___EmotionJSX(CopyButton, null));
|
|
191
|
-
}
|
|
174
|
+
var overflowHeightStyles = useMemo(function () {
|
|
175
|
+
if (overflowHeight) {
|
|
176
|
+
var property = typeof overflowHeight === 'string' ? 'height' : 'maxHeight';
|
|
177
|
+
return _defineProperty({}, property, overflowHeight);
|
|
178
|
+
}
|
|
192
179
|
|
|
180
|
+
return {};
|
|
181
|
+
}, [overflowHeight]);
|
|
182
|
+
var wrapperProps = useMemo(function () {
|
|
183
|
+
return {
|
|
184
|
+
className: classes,
|
|
185
|
+
style: overflowHeightStyles
|
|
186
|
+
};
|
|
187
|
+
}, [classes, overflowHeightStyles]);
|
|
188
|
+
var codeBlockControls = useMemo(function () {
|
|
189
|
+
if (showCopyButton || showFullScreenButton) {
|
|
190
|
+
return ___EmotionJSX("div", {
|
|
191
|
+
className: "euiCodeBlock__controls"
|
|
192
|
+
}, showFullScreenButton && ___EmotionJSX(FullScreenButton, {
|
|
193
|
+
isFullScreen: isFullScreen,
|
|
194
|
+
toggleFullScreen: toggleFullScreen
|
|
195
|
+
}), showCopyButton && ___EmotionJSX(CopyButton, {
|
|
196
|
+
textToCopy: textToCopy
|
|
197
|
+
}));
|
|
198
|
+
}
|
|
199
|
+
}, [isFullScreen, toggleFullScreen, showCopyButton, showFullScreenButton, textToCopy]);
|
|
193
200
|
return ___EmotionJSX("div", wrapperProps, isVirtualized ? ___EmotionJSX(VirtualizedCodeBlock, {
|
|
194
201
|
data: data,
|
|
195
202
|
rowHeight: fontSizeToRowHeightMap[fontSize],
|
|
@@ -199,10 +206,10 @@ export var EuiCodeBlock = function EuiCodeBlock(_ref) {
|
|
|
199
206
|
codeProps: codeProps
|
|
200
207
|
}) : ___EmotionJSX("pre", {
|
|
201
208
|
ref: combinedRef,
|
|
202
|
-
style:
|
|
209
|
+
style: overflowHeightStyles,
|
|
203
210
|
className: preClasses,
|
|
204
211
|
tabIndex: tabIndex
|
|
205
|
-
}, ___EmotionJSX("code", codeProps, content)), codeBlockControls, ___EmotionJSX(FullScreenDisplay, {
|
|
212
|
+
}, ___EmotionJSX("code", codeProps, content)), codeBlockControls, isFullScreen && ___EmotionJSX(FullScreenDisplay, {
|
|
206
213
|
className: wrapperClasses
|
|
207
214
|
}, isVirtualized ? ___EmotionJSX(VirtualizedCodeBlock, {
|
|
208
215
|
data: data,
|
|
@@ -312,10 +319,31 @@ var useOverflowDetection = function useOverflowDetection() {
|
|
|
312
319
|
*/
|
|
313
320
|
|
|
314
321
|
|
|
315
|
-
var
|
|
316
|
-
var
|
|
317
|
-
|
|
318
|
-
|
|
322
|
+
var CopyButton = function CopyButton(_ref3) {
|
|
323
|
+
var textToCopy = _ref3.textToCopy;
|
|
324
|
+
var copyButton = useEuiI18n('euiCodeBlock.copyButton', 'Copy');
|
|
325
|
+
return ___EmotionJSX("div", {
|
|
326
|
+
className: "euiCodeBlock__copyButton"
|
|
327
|
+
}, ___EmotionJSX(EuiCopy, {
|
|
328
|
+
textToCopy: textToCopy
|
|
329
|
+
}, function (copy) {
|
|
330
|
+
return ___EmotionJSX(EuiButtonIcon, {
|
|
331
|
+
onClick: copy,
|
|
332
|
+
iconType: "copyClipboard",
|
|
333
|
+
color: "text",
|
|
334
|
+
"aria-label": copyButton
|
|
335
|
+
});
|
|
336
|
+
}));
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
CopyButton.propTypes = {
|
|
340
|
+
textToCopy: PropTypes.string.isRequired
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
var useCopy = function useCopy(_ref4) {
|
|
344
|
+
var isCopyable = _ref4.isCopyable,
|
|
345
|
+
isVirtualized = _ref4.isVirtualized,
|
|
346
|
+
children = _ref4.children;
|
|
319
347
|
|
|
320
348
|
var _useInnerText = useInnerText(''),
|
|
321
349
|
_useInnerText2 = _slicedToArray(_useInnerText, 2),
|
|
@@ -328,32 +356,10 @@ var useCopy = function useCopy(_ref2) {
|
|
|
328
356
|
var textToCopy = isVirtualized ? "".concat(children) : innerText; // Virtualized code blocks do not have inner text
|
|
329
357
|
|
|
330
358
|
var showCopyButton = isCopyable && textToCopy;
|
|
331
|
-
|
|
332
|
-
var CopyButton = function CopyButton() {
|
|
333
|
-
if (!showCopyButton) return null;
|
|
334
|
-
return ___EmotionJSX("div", {
|
|
335
|
-
className: "euiCodeBlock__copyButton"
|
|
336
|
-
}, ___EmotionJSX(EuiI18n, {
|
|
337
|
-
token: "euiCodeBlock.copyButton",
|
|
338
|
-
default: "Copy"
|
|
339
|
-
}, function (copyButton) {
|
|
340
|
-
return ___EmotionJSX(EuiCopy, {
|
|
341
|
-
textToCopy: textToCopy
|
|
342
|
-
}, function (copy) {
|
|
343
|
-
return ___EmotionJSX(EuiButtonIcon, {
|
|
344
|
-
onClick: copy,
|
|
345
|
-
iconType: "copyClipboard",
|
|
346
|
-
color: "text",
|
|
347
|
-
"aria-label": copyButton
|
|
348
|
-
});
|
|
349
|
-
});
|
|
350
|
-
}));
|
|
351
|
-
};
|
|
352
|
-
|
|
353
359
|
return {
|
|
354
360
|
innerTextRef: innerTextRef,
|
|
355
361
|
showCopyButton: showCopyButton,
|
|
356
|
-
|
|
362
|
+
textToCopy: textToCopy
|
|
357
363
|
};
|
|
358
364
|
};
|
|
359
365
|
/**
|
|
@@ -361,18 +367,59 @@ var useCopy = function useCopy(_ref2) {
|
|
|
361
367
|
*/
|
|
362
368
|
|
|
363
369
|
|
|
364
|
-
var
|
|
365
|
-
var
|
|
370
|
+
var FullScreenButton = function FullScreenButton(_ref5) {
|
|
371
|
+
var isFullScreen = _ref5.isFullScreen,
|
|
372
|
+
toggleFullScreen = _ref5.toggleFullScreen;
|
|
373
|
+
|
|
374
|
+
var _useEuiI18n = useEuiI18n(['euiCodeBlock.fullscreenCollapse', 'euiCodeBlock.fullscreenExpand'], ['Collapse', 'Expand']),
|
|
375
|
+
_useEuiI18n2 = _slicedToArray(_useEuiI18n, 2),
|
|
376
|
+
fullscreenCollapse = _useEuiI18n2[0],
|
|
377
|
+
fullscreenExpand = _useEuiI18n2[1];
|
|
378
|
+
|
|
379
|
+
return ___EmotionJSX(EuiButtonIcon, {
|
|
380
|
+
className: "euiCodeBlock__fullScreenButton",
|
|
381
|
+
onClick: toggleFullScreen,
|
|
382
|
+
iconType: isFullScreen ? 'fullScreenExit' : 'fullScreen',
|
|
383
|
+
color: "text",
|
|
384
|
+
"aria-label": isFullScreen ? fullscreenCollapse : fullscreenExpand
|
|
385
|
+
});
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
FullScreenButton.propTypes = {
|
|
389
|
+
isFullScreen: PropTypes.bool.isRequired,
|
|
390
|
+
toggleFullScreen: PropTypes.func.isRequired
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
var FullScreenDisplay = function FullScreenDisplay(_ref6) {
|
|
394
|
+
var children = _ref6.children,
|
|
395
|
+
className = _ref6.className;
|
|
396
|
+
// Force fullscreen to use large font and padding.
|
|
397
|
+
var fullScreenClasses = classNames(className, 'euiCodeBlock--fontLarge', 'euiCodeBlock--paddingLarge', 'euiCodeBlock-isFullScreen'); // Attaches to the body because of EuiOverlayMask's React portal usage.
|
|
398
|
+
|
|
399
|
+
return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, {
|
|
400
|
+
clickOutsideDisables: true
|
|
401
|
+
}, ___EmotionJSX("div", {
|
|
402
|
+
className: fullScreenClasses
|
|
403
|
+
}, children)));
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
FullScreenDisplay.propTypes = {
|
|
407
|
+
className: PropTypes.string.isRequired
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
var useFullScreen = function useFullScreen(_ref7) {
|
|
411
|
+
var overflowHeight = _ref7.overflowHeight;
|
|
366
412
|
|
|
367
413
|
var _useState5 = useState(false),
|
|
368
414
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
369
415
|
isFullScreen = _useState6[0],
|
|
370
416
|
setIsFullScreen = _useState6[1];
|
|
371
417
|
|
|
372
|
-
var toggleFullScreen = function
|
|
373
|
-
setIsFullScreen(
|
|
374
|
-
|
|
375
|
-
|
|
418
|
+
var toggleFullScreen = useCallback(function () {
|
|
419
|
+
setIsFullScreen(function (isFullScreen) {
|
|
420
|
+
return !isFullScreen;
|
|
421
|
+
});
|
|
422
|
+
}, []);
|
|
376
423
|
var onKeyDown = useCallback(function (event) {
|
|
377
424
|
if (event.key === keys.ESCAPE) {
|
|
378
425
|
event.preventDefault();
|
|
@@ -381,45 +428,10 @@ var useFullScreen = function useFullScreen(_ref3) {
|
|
|
381
428
|
}
|
|
382
429
|
}, []);
|
|
383
430
|
var showFullScreenButton = !!overflowHeight;
|
|
384
|
-
|
|
385
|
-
var FullScreenButton = function FullScreenButton() {
|
|
386
|
-
if (!showFullScreenButton) return null;
|
|
387
|
-
return ___EmotionJSX(EuiI18n, {
|
|
388
|
-
tokens: ['euiCodeBlock.fullscreenCollapse', 'euiCodeBlock.fullscreenExpand'],
|
|
389
|
-
defaults: ['Collapse', 'Expand']
|
|
390
|
-
}, function (_ref4) {
|
|
391
|
-
var _ref5 = _slicedToArray(_ref4, 2),
|
|
392
|
-
fullscreenCollapse = _ref5[0],
|
|
393
|
-
fullscreenExpand = _ref5[1];
|
|
394
|
-
|
|
395
|
-
return ___EmotionJSX(EuiButtonIcon, {
|
|
396
|
-
className: "euiCodeBlock__fullScreenButton",
|
|
397
|
-
onClick: toggleFullScreen,
|
|
398
|
-
iconType: isFullScreen ? 'fullScreenExit' : 'fullScreen',
|
|
399
|
-
color: "text",
|
|
400
|
-
"aria-label": isFullScreen ? fullscreenCollapse : fullscreenExpand
|
|
401
|
-
});
|
|
402
|
-
});
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
var FullScreenDisplay = function FullScreenDisplay(_ref6) {
|
|
406
|
-
var children = _ref6.children,
|
|
407
|
-
className = _ref6.className;
|
|
408
|
-
if (!isFullScreen) return null; // Force fullscreen to use large font and padding.
|
|
409
|
-
|
|
410
|
-
var fullScreenClasses = classNames(className, 'euiCodeBlock--fontLarge', 'euiCodeBlock--paddingLarge', 'euiCodeBlock-isFullScreen'); // Attaches to the body because of EuiOverlayMask's React portal usage.
|
|
411
|
-
|
|
412
|
-
return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, {
|
|
413
|
-
clickOutsideDisables: true
|
|
414
|
-
}, ___EmotionJSX("div", {
|
|
415
|
-
className: fullScreenClasses
|
|
416
|
-
}, children)));
|
|
417
|
-
};
|
|
418
|
-
|
|
419
431
|
return {
|
|
420
432
|
showFullScreenButton: showFullScreenButton,
|
|
421
|
-
|
|
422
|
-
|
|
433
|
+
isFullScreen: isFullScreen,
|
|
434
|
+
toggleFullScreen: toggleFullScreen,
|
|
423
435
|
onKeyDown: onKeyDown
|
|
424
436
|
};
|
|
425
437
|
};
|
|
@@ -428,21 +440,21 @@ var useFullScreen = function useFullScreen(_ref3) {
|
|
|
428
440
|
*/
|
|
429
441
|
|
|
430
442
|
|
|
431
|
-
var ListRow = function ListRow(
|
|
432
|
-
var data =
|
|
433
|
-
index =
|
|
434
|
-
style =
|
|
443
|
+
var ListRow = function ListRow(_ref8) {
|
|
444
|
+
var data = _ref8.data,
|
|
445
|
+
index = _ref8.index,
|
|
446
|
+
style = _ref8.style;
|
|
435
447
|
var row = data[index];
|
|
436
448
|
row.properties.style = style;
|
|
437
449
|
return nodeToHtml(row, index, data, 0);
|
|
438
450
|
};
|
|
439
451
|
|
|
440
|
-
var VirtualizedCodeBlock = function VirtualizedCodeBlock(
|
|
441
|
-
var data =
|
|
442
|
-
rowHeight =
|
|
443
|
-
overflowHeight =
|
|
444
|
-
preProps =
|
|
445
|
-
codeProps =
|
|
452
|
+
var VirtualizedCodeBlock = function VirtualizedCodeBlock(_ref9) {
|
|
453
|
+
var data = _ref9.data,
|
|
454
|
+
rowHeight = _ref9.rowHeight,
|
|
455
|
+
overflowHeight = _ref9.overflowHeight,
|
|
456
|
+
preProps = _ref9.preProps,
|
|
457
|
+
codeProps = _ref9.codeProps;
|
|
446
458
|
var VirtualizedOuterElement = useMemo(function () {
|
|
447
459
|
return /*#__PURE__*/forwardRef(function (props, ref) {
|
|
448
460
|
return ___EmotionJSX("pre", _extends({}, props, {
|
|
@@ -459,9 +471,9 @@ var VirtualizedCodeBlock = function VirtualizedCodeBlock(_ref8) {
|
|
|
459
471
|
}, [codeProps]);
|
|
460
472
|
return ___EmotionJSX(EuiAutoSizer, {
|
|
461
473
|
disableHeight: typeof overflowHeight === 'number'
|
|
462
|
-
}, function (
|
|
463
|
-
var height =
|
|
464
|
-
width =
|
|
474
|
+
}, function (_ref10) {
|
|
475
|
+
var height = _ref10.height,
|
|
476
|
+
width = _ref10.width;
|
|
465
477
|
return ___EmotionJSX(FixedSizeList, {
|
|
466
478
|
height: height !== null && height !== void 0 ? height : overflowHeight,
|
|
467
479
|
width: width,
|
|
@@ -268,7 +268,7 @@ EuiCollapsibleNav.propTypes = {
|
|
|
268
268
|
/**
|
|
269
269
|
* Named breakpoint or pixel value for customizing the minimum window width to enable docking
|
|
270
270
|
*/
|
|
271
|
-
pushMinBreakpoint: PropTypes.oneOfType([PropTypes.
|
|
271
|
+
pushMinBreakpoint: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.number.isRequired]),
|
|
272
272
|
style: PropTypes.any,
|
|
273
273
|
|
|
274
274
|
/**
|
|
@@ -292,7 +292,7 @@ EuiCollapsibleNav.propTypes = {
|
|
|
292
292
|
* Keeps navigation flyout visible and push `<body>` content via padding
|
|
293
293
|
*/
|
|
294
294
|
isDocked: PropTypes.bool,
|
|
295
|
-
dockedBreakpoint: PropTypes.oneOfType([PropTypes.
|
|
295
|
+
dockedBreakpoint: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.number.isRequired]),
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
298
|
* Button for controlling visible state of the nav
|
|
@@ -370,6 +370,7 @@ EuiControlBar.propTypes = {
|
|
|
370
370
|
"aria-label": PropTypes.string,
|
|
371
371
|
"data-test-subj": PropTypes.string,
|
|
372
372
|
href: PropTypes.string,
|
|
373
|
+
rel: PropTypes.string,
|
|
373
374
|
onClick: PropTypes.func,
|
|
374
375
|
|
|
375
376
|
/**
|
|
@@ -392,6 +393,18 @@ EuiControlBar.propTypes = {
|
|
|
392
393
|
*/
|
|
393
394
|
"aria-current": PropTypes.any
|
|
394
395
|
}).isRequired),
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Determines breadcrumbs appearance, with `page` being the default styling.
|
|
399
|
+
* Application breadcrumbs should only be once per page, in (e.g.) EuiHeader
|
|
400
|
+
*/
|
|
401
|
+
type: PropTypes.oneOf(["page", "application"]),
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Whether the last breadcrumb should visually (and accessibly, to screen readers)
|
|
405
|
+
* be highlighted as the current page. Defaults to true.
|
|
406
|
+
*/
|
|
407
|
+
lastBreadcrumbIsCurrentPage: PropTypes.bool,
|
|
395
408
|
text: PropTypes.node,
|
|
396
409
|
iconType: PropTypes.string
|
|
397
410
|
}).isRequired).isRequired,
|
|
@@ -927,7 +927,7 @@ EuiDataGridBody.propTypes = {
|
|
|
927
927
|
/**
|
|
928
928
|
* The color associated with this data type; it's used to color the icon token
|
|
929
929
|
*/
|
|
930
|
-
color: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.
|
|
930
|
+
color: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.string.isRequired]).isRequired, PropTypes.string.isRequired]),
|
|
931
931
|
|
|
932
932
|
/**
|
|
933
933
|
* Text for how to represent an ascending sort of this data type, e.g. 'A -> Z'
|
|
@@ -559,7 +559,7 @@ EuiDataGridHeaderRow.propTypes = {
|
|
|
559
559
|
/**
|
|
560
560
|
* The color associated with this data type; it's used to color the icon token
|
|
561
561
|
*/
|
|
562
|
-
color: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.
|
|
562
|
+
color: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.string.isRequired]).isRequired, PropTypes.string.isRequired]),
|
|
563
563
|
|
|
564
564
|
/**
|
|
565
565
|
* Text for how to represent an ascending sort of this data type, e.g. 'A -> Z'
|
|
@@ -207,7 +207,7 @@ EuiDataGridColumnSortingDraggable.propTypes = {
|
|
|
207
207
|
/**
|
|
208
208
|
* The color associated with this data type; it's used to color the icon token
|
|
209
209
|
*/
|
|
210
|
-
color: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.
|
|
210
|
+
color: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.string.isRequired]).isRequired, PropTypes.string.isRequired]),
|
|
211
211
|
|
|
212
212
|
/**
|
|
213
213
|
* Text for how to represent an ascending sort of this data type, e.g. 'A -> Z'
|
|
@@ -922,7 +922,7 @@ EuiDataGrid.propTypes = {
|
|
|
922
922
|
/**
|
|
923
923
|
* The color associated with this data type; it's used to color the icon token
|
|
924
924
|
*/
|
|
925
|
-
color: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.
|
|
925
|
+
color: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.string.isRequired]).isRequired, PropTypes.string.isRequired]),
|
|
926
926
|
|
|
927
927
|
/**
|
|
928
928
|
* Text for how to represent an ascending sort of this data type, e.g. 'A -> Z'
|
|
@@ -674,7 +674,7 @@ EuiSuperDatePickerInternal.propTypes = {
|
|
|
674
674
|
* Forces state to be `iconOnly` when within provided breakpoints.
|
|
675
675
|
* Remove completely with `false` or provide your own list of breakpoints.
|
|
676
676
|
*/
|
|
677
|
-
responsive: PropTypes.oneOfType([PropTypes.oneOf([false]), PropTypes.arrayOf(PropTypes.
|
|
677
|
+
responsive: PropTypes.oneOfType([PropTypes.oneOf([false]), PropTypes.arrayOf(PropTypes.any.isRequired).isRequired])
|
|
678
678
|
}),
|
|
679
679
|
timeOptions: PropTypes.shape({
|
|
680
680
|
timeTenseOptions: PropTypes.arrayOf(PropTypes.any.isRequired).isRequired,
|
|
@@ -810,6 +810,6 @@ EuiSuperDatePicker.propTypes = {
|
|
|
810
810
|
onMouseOut: PropTypes.func
|
|
811
811
|
}),
|
|
812
812
|
iconOnly: PropTypes.bool,
|
|
813
|
-
responsive: PropTypes.oneOfType([PropTypes.oneOf([false]), PropTypes.arrayOf(PropTypes.
|
|
813
|
+
responsive: PropTypes.oneOfType([PropTypes.oneOf([false]), PropTypes.arrayOf(PropTypes.any.isRequired).isRequired])
|
|
814
814
|
})
|
|
815
815
|
};
|
|
@@ -287,5 +287,5 @@ EuiSuperUpdateButton.propTypes = {
|
|
|
287
287
|
* Forces state to be `iconOnly` when within provided breakpoints.
|
|
288
288
|
* Remove completely with `false` or provide your own list of breakpoints.
|
|
289
289
|
*/
|
|
290
|
-
responsive: PropTypes.oneOfType([PropTypes.oneOf([false]), PropTypes.arrayOf(PropTypes.
|
|
290
|
+
responsive: PropTypes.oneOfType([PropTypes.oneOf([false]), PropTypes.arrayOf(PropTypes.any.isRequired).isRequired])
|
|
291
291
|
};
|
|
@@ -18,25 +18,10 @@ import PropTypes from "prop-types";
|
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import { EuiDescriptionListTitle } from './description_list_title';
|
|
20
20
|
import { EuiDescriptionListDescription } from './description_list_description';
|
|
21
|
-
import {
|
|
21
|
+
import { useEuiTheme } from '../../services';
|
|
22
|
+
import { euiDescriptionListStyles } from './description_list.styles';
|
|
23
|
+
import { EuiDescriptionListContext } from './description_list_context';
|
|
22
24
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
23
|
-
var typesToClassNameMap = {
|
|
24
|
-
row: 'euiDescriptionList--row',
|
|
25
|
-
inline: 'euiDescriptionList--inline',
|
|
26
|
-
column: 'euiDescriptionList--column',
|
|
27
|
-
responsiveColumn: 'euiDescriptionList--responsiveColumn'
|
|
28
|
-
};
|
|
29
|
-
export var TYPES = keysOf(typesToClassNameMap);
|
|
30
|
-
var alignmentsToClassNameMap = {
|
|
31
|
-
center: 'euiDescriptionList--center',
|
|
32
|
-
left: ''
|
|
33
|
-
};
|
|
34
|
-
export var ALIGNMENTS = keysOf(alignmentsToClassNameMap);
|
|
35
|
-
var textStylesToClassNameMap = {
|
|
36
|
-
normal: '',
|
|
37
|
-
reverse: 'euiDescriptionList--reverse'
|
|
38
|
-
};
|
|
39
|
-
export var TEXT_STYLES = keysOf(textStylesToClassNameMap);
|
|
40
25
|
export var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
41
26
|
var _ref$align = _ref.align,
|
|
42
27
|
align = _ref$align === void 0 ? 'left' : _ref$align,
|
|
@@ -53,9 +38,10 @@ export var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
53
38
|
type = _ref$type === void 0 ? 'row' : _ref$type,
|
|
54
39
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
55
40
|
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
|
|
41
|
+
var euiTheme = useEuiTheme();
|
|
42
|
+
var styles = euiDescriptionListStyles(euiTheme);
|
|
43
|
+
var cssStyles = [styles.euiDescriptionList, styles[type], styles[align]];
|
|
44
|
+
var classes = classNames('euiDescriptionList', className);
|
|
59
45
|
var childrenOrListItems = null;
|
|
60
46
|
|
|
61
47
|
if (listItems) {
|
|
@@ -70,9 +56,19 @@ export var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
70
56
|
childrenOrListItems = children;
|
|
71
57
|
}
|
|
72
58
|
|
|
73
|
-
return ___EmotionJSX(
|
|
74
|
-
|
|
75
|
-
|
|
59
|
+
return ___EmotionJSX(EuiDescriptionListContext.Provider, {
|
|
60
|
+
value: {
|
|
61
|
+
type: type,
|
|
62
|
+
compressed: compressed,
|
|
63
|
+
textStyle: textStyle,
|
|
64
|
+
align: align
|
|
65
|
+
}
|
|
66
|
+
}, ___EmotionJSX("dl", _extends({
|
|
67
|
+
className: classes,
|
|
68
|
+
css: cssStyles
|
|
69
|
+
}, rest, {
|
|
70
|
+
"data-type": type
|
|
71
|
+
}), childrenOrListItems));
|
|
76
72
|
};
|
|
77
73
|
EuiDescriptionList.propTypes = {
|
|
78
74
|
className: PropTypes.string,
|
|
@@ -86,7 +82,7 @@ EuiDescriptionList.propTypes = {
|
|
|
86
82
|
/**
|
|
87
83
|
* Text alignment
|
|
88
84
|
*/
|
|
89
|
-
align: PropTypes.
|
|
85
|
+
align: PropTypes.any,
|
|
90
86
|
|
|
91
87
|
/**
|
|
92
88
|
* Smaller text and condensed spacing
|
|
@@ -102,7 +98,7 @@ EuiDescriptionList.propTypes = {
|
|
|
102
98
|
/**
|
|
103
99
|
* How each item should be laid out
|
|
104
100
|
*/
|
|
105
|
-
type: PropTypes.
|
|
101
|
+
type: PropTypes.any,
|
|
106
102
|
|
|
107
103
|
/**
|
|
108
104
|
* Props object to be passed to `EuiDescriptionListTitle`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
import { css } from '@emotion/react';
|
|
9
|
+
import { logicalTextAlignCSS, euiBreakpoint } from '../../global_styling';
|
|
10
|
+
export var euiDescriptionListStyles = function euiDescriptionListStyles(euiThemeContext) {
|
|
11
|
+
// Flex display for column and responsive column
|
|
12
|
+
var columnDisplay = "\n display: flex;\n align-items: baseline;\n flex-wrap: wrap; \n ";
|
|
13
|
+
return {
|
|
14
|
+
euiDescriptionList: /*#__PURE__*/css(";label:euiDescriptionList;"),
|
|
15
|
+
// Types
|
|
16
|
+
row: /*#__PURE__*/css(";label:row;"),
|
|
17
|
+
inline: /*#__PURE__*/css(";label:inline;"),
|
|
18
|
+
column: /*#__PURE__*/css(columnDisplay, ";;label:column;"),
|
|
19
|
+
// Responsive columns behave as a row on breakpoints xs-s
|
|
20
|
+
responsiveColumn: /*#__PURE__*/css(euiBreakpoint(euiThemeContext, ['m', 'xl']), "{", columnDisplay, ";};label:responsiveColumn;"),
|
|
21
|
+
// Alignment
|
|
22
|
+
center: /*#__PURE__*/css(logicalTextAlignCSS('center'), ";;label:center;"),
|
|
23
|
+
left: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";;label:left;")
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
import { createContext } from 'react';
|
|
9
|
+
export var contextDefaults = {
|
|
10
|
+
type: 'row',
|
|
11
|
+
textStyle: 'normal',
|
|
12
|
+
align: 'left'
|
|
13
|
+
};
|
|
14
|
+
export var EuiDescriptionListContext = /*#__PURE__*/createContext(contextDefaults);
|
|
@@ -2,6 +2,18 @@ var _excluded = ["children", "className"];
|
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || 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); }
|
|
4
4
|
|
|
5
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
+
|
|
7
|
+
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."); }
|
|
8
|
+
|
|
9
|
+
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); }
|
|
10
|
+
|
|
11
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
|
+
|
|
13
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
5
17
|
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; }
|
|
6
18
|
|
|
7
19
|
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; }
|
|
@@ -13,18 +25,47 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
13
25
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
26
|
* Side Public License, v 1.
|
|
15
27
|
*/
|
|
16
|
-
import React from 'react';
|
|
28
|
+
import React, { useContext } from 'react';
|
|
17
29
|
import PropTypes from "prop-types";
|
|
18
30
|
import classNames from 'classnames';
|
|
31
|
+
import { useEuiTheme } from '../../services';
|
|
32
|
+
import { euiDescriptionListDescriptionStyles } from './description_list_description.styles';
|
|
33
|
+
import { EuiDescriptionListContext } from './description_list_context';
|
|
19
34
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
35
|
export var EuiDescriptionListDescription = function EuiDescriptionListDescription(_ref) {
|
|
21
36
|
var children = _ref.children,
|
|
22
37
|
className = _ref.className,
|
|
23
38
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
24
39
|
|
|
40
|
+
var _useContext = useContext(EuiDescriptionListContext),
|
|
41
|
+
type = _useContext.type,
|
|
42
|
+
textStyle = _useContext.textStyle,
|
|
43
|
+
compressed = _useContext.compressed,
|
|
44
|
+
align = _useContext.align;
|
|
45
|
+
|
|
46
|
+
var theme = useEuiTheme();
|
|
47
|
+
var styles = euiDescriptionListDescriptionStyles(theme);
|
|
48
|
+
var conditionalStyles = compressed && textStyle === 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
|
|
49
|
+
|
|
50
|
+
switch (type) {
|
|
51
|
+
case 'inline':
|
|
52
|
+
conditionalStyles = compressed ? [styles.inlineStyles.compressed] : [styles.inlineStyles.normal];
|
|
53
|
+
break;
|
|
54
|
+
|
|
55
|
+
case 'responsiveColumn':
|
|
56
|
+
case 'column':
|
|
57
|
+
if (align === 'center') {
|
|
58
|
+
conditionalStyles.push(styles.left);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var cssStyles = [styles.euiDescriptionList__description, styles[type]].concat(_toConsumableArray(conditionalStyles));
|
|
25
65
|
var classes = classNames('euiDescriptionList__description', className);
|
|
26
66
|
return ___EmotionJSX("dd", _extends({
|
|
27
|
-
className: classes
|
|
67
|
+
className: classes,
|
|
68
|
+
css: cssStyles
|
|
28
69
|
}, rest), children);
|
|
29
70
|
};
|
|
30
71
|
EuiDescriptionListDescription.propTypes = {
|