@ember-eui/core 5.0.1 → 5.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.
Files changed (168) hide show
  1. package/addon/components/eui-accordion/index.hbs +1 -1
  2. package/addon/components/eui-breadcrumbs/index.hbs +9 -1
  3. package/addon/components/eui-header-links/index.hbs +1 -1
  4. package/addon/components/eui-input-popover/index.hbs +37 -31
  5. package/addon/components/eui-page-header-content/index.hbs +10 -12
  6. package/addon/components/eui-popover/index.hbs +61 -102
  7. package/addon/components/eui-step-horizontal/index.hbs +11 -6
  8. package/addon/helpers/merge.ts +5 -0
  9. package/addon/utils/css-mappings/eui-avatar.ts +1 -0
  10. package/addon/utils/css-mappings/eui-header-links.ts +1 -1
  11. package/app/helpers/merge.js +1 -0
  12. package/docs/layout/{accordion.md → accordion/demo/d01-simple-and-unstyle.md} +18 -22
  13. package/docs/layout/accordion/demo/d02-arrow-display.md +34 -0
  14. package/docs/layout/{accordion-demo/demo2.md → accordion/demo/d03-multiple-accordions.md} +6 -5
  15. package/docs/layout/{accordion-demo/demo3.md → accordion/demo/d04-extra-actions.md} +2 -2
  16. package/docs/layout/{accordion-demo/demo4.md → accordion/demo/d05-opened-on-initial-render.md} +2 -2
  17. package/docs/layout/{accordion-demo/demo5.md → accordion/demo/d06-controlling-toggled-state.md} +3 -2
  18. package/docs/layout/{accordion-demo/demo6.md → accordion/demo/d07-loading-state.md} +2 -1
  19. package/docs/layout/accordion/demo/d08-when-content-changes-dynamically.md +71 -0
  20. package/docs/layout/{accordion-demo/demo8.md → accordion/demo/d09-interactive-content-in-the-trigger.md} +4 -4
  21. package/docs/layout/{accordion-demo/demo9.md → accordion/demo/d10-styled-for-forms.md} +44 -44
  22. package/docs/layout/accordion/index.md +23 -0
  23. package/docs/layout/{bottom-bar-demo/demo1.md → bottom-bar/demo/d01-basic.md} +0 -2
  24. package/docs/layout/{bottom-bar-demo/demo2.md → bottom-bar/demo/d02-positions.md} +0 -0
  25. package/docs/layout/{bottom-bar-demo/demo3.md → bottom-bar/demo/d03-displacement.md} +1 -0
  26. package/docs/layout/bottom-bar/index.md +18 -0
  27. package/docs/layout/flex/demo/d01-flex-group-is-for-a-single-row-layout.md +19 -0
  28. package/docs/layout/flex/demo/d02-flex-items-are-also-flex.md +18 -0
  29. package/docs/layout/flex/demo/d03-spans-instead-of-divs.md +19 -0
  30. package/docs/layout/flex/demo/d04-panels-grow-to-fill-flex-items.md +32 -0
  31. package/docs/layout/flex/demo/d05-turn-off-item-streching.md +12 -0
  32. package/docs/layout/flex/demo/d06-proportional-widths-of-items.md +32 -0
  33. package/docs/layout/flex/demo/d07-justify-and-align.md +11 -0
  34. package/docs/layout/flex/demo/d08-allowing-flex-items-to-wrap.md +43 -0
  35. package/docs/layout/flex/demo/d09-change-direction.md +13 -0
  36. package/docs/layout/flex/demo/d10-flex-grids-are-for-repeatable-items.md +33 -0
  37. package/docs/layout/flex/demo/d11-flex-grids-can-change-direction.md +33 -0
  38. package/docs/layout/flex/demo/d12-flex-grids-and-flex-groups-can-nest.md +30 -0
  39. package/docs/layout/flex/demo/d13-gutter-sizing.md +61 -0
  40. package/docs/layout/flex/demo/d14-responsive-layouts.md +29 -0
  41. package/docs/layout/flex/index.md +18 -0
  42. package/docs/layout/{flyout-demo/demo1.md → flyout/demo/d01-basic.md} +12 -16
  43. package/docs/layout/flyout/demo/d02-more-complicated-flyout.md +195 -0
  44. package/docs/layout/{flyout-demo/demo3.md → flyout/demo/d03-sizing.md} +5 -17
  45. package/docs/layout/{flyout-demo/demo4.md → flyout/demo/d04-adjusting-padding.md} +29 -36
  46. package/docs/layout/{flyout-demo/demo5.md → flyout/demo/d05-adding-a-banner.md} +6 -6
  47. package/docs/layout/{flyout-demo/demo6.md → flyout/demo/d06-without-ownfocus.md} +11 -14
  48. package/docs/layout/{flyout-demo/demo7.md → flyout/demo/d07-push-versus-overlay.md} +17 -3
  49. package/docs/layout/flyout/demo/d08-understanding-max-width.md +9 -0
  50. package/docs/layout/flyout/index.md +7 -0
  51. package/docs/layout/{header-demo/demo1.md → header/demo/d01-header.md} +138 -120
  52. package/docs/layout/header/demo/d02-sections.md +9 -0
  53. package/docs/layout/{header-demo/demo2.md → header/demo/d03-header-links.md} +2 -2
  54. package/docs/layout/{header-demo/demo3.md → header/demo/d04-fixed-header.md} +1 -1
  55. package/docs/layout/{header-demo/demo4.md → header/demo/d05-dark-theme.md} +3 -3
  56. package/docs/layout/{header-demo/demo5.md → header/demo/d06-portal-content-in-the-header.md} +20 -9
  57. package/docs/layout/{header-demo/demo6.md → header/demo/d07-header-notifications.md} +1 -1
  58. package/docs/layout/{header-demo/demo7.md → header/demo/d08-stacked-headers.md} +47 -26
  59. package/docs/layout/header/demo/d09-the-elastic-navigation-pattern.md +9 -0
  60. package/docs/layout/header/index.md +7 -0
  61. package/docs/layout/horizontal-rule/demo/d01-size.md +14 -0
  62. package/docs/layout/horizontal-rule/demo/d02-margins.md +38 -0
  63. package/docs/layout/horizontal-rule/horizontal-rule.md +7 -0
  64. package/docs/layout/modal/demo/d01-modal.md +73 -0
  65. package/docs/layout/modal/demo/d02-forms-in-a-modal.md +107 -0
  66. package/docs/layout/modal/demo/d03-confirm-modal.md +86 -0
  67. package/docs/layout/modal/demo/d04-loading-and-disabling-confirm-button.md +80 -0
  68. package/docs/layout/{modal-demo/demo5.md → modal/demo/d05-widths.md} +20 -39
  69. package/docs/layout/modal/index.md +13 -0
  70. package/docs/layout/page-header/demo/{demo1.md → d01-basic.md} +0 -2
  71. package/docs/layout/page-header/demo/{demo2.md → d02-tabs-in-the-page-header.md} +1 -2
  72. package/docs/layout/page-header/demo/{demo3.md → d03-tabs-in-the-page-header.md} +2 -3
  73. package/docs/layout/page-header/demo/{demo4.md → d04-breadcrumbs-in-the-page-header.md} +3 -2
  74. package/docs/layout/page-header/demo/{demo5.md → d05-breadcrumbs-in-the-page-header.md} +1 -28
  75. package/docs/layout/page-header/demo/{demo6.md → d06-customizing-the-page-header.md} +0 -0
  76. package/docs/layout/page-header/index.md +1 -2
  77. package/docs/layout/{panel-demo/demo1.md → panel/demo/d01-padding.md} +0 -0
  78. package/docs/layout/{panel-demo/demo2.md → panel/demo/d02-shadow-and-border.md} +2 -2
  79. package/docs/layout/{panel-demo/demo3.md → panel/demo/d03-colors-and-corners.md} +0 -0
  80. package/docs/layout/{panel-demo/demo4.md → panel/demo/d04-growing-height.md} +0 -0
  81. package/docs/layout/{panel-demo/demo5.md → panel/demo/d05-split-panels.md} +1 -1
  82. package/docs/layout/{panel.md → panel/index.md} +4 -0
  83. package/docs/layout/{popover-demo/demo1.md → popover/demo/d01-basic.md} +6 -4
  84. package/docs/layout/{popover-demo/demo2.md → popover/demo/d02-anchor-position.md} +0 -0
  85. package/docs/layout/popover/demo/d03-popover-titles-and-footers.md +133 -0
  86. package/docs/layout/{popover-demo/demo5.md → popover/demo/d04-popover-padding-sizes.md} +56 -31
  87. package/docs/layout/{popover-demo/demo6.md → popover/demo/d05-panel-class-name.md} +3 -3
  88. package/docs/layout/{popover-demo/demo7.md → popover/demo/d06-popover-with-block-level-display.md} +2 -3
  89. package/docs/layout/{popover-demo/demo3.md → popover/demo/d07-popover-on-a-fixed-element.md} +3 -11
  90. package/docs/layout/{popover-demo/demo8.md → popover/demo/d08-constraining-a-popover-inside-a-container.md} +0 -0
  91. package/docs/layout/{popover-demo/demo9.md → popover/demo/d09-popover-attached-to-input-element.md} +14 -12
  92. package/docs/layout/popover/demo/d10-setting-an-initial-focus.md +61 -0
  93. package/docs/layout/{popover-demo/demo10.md → popover/demo/d11-removing-the-focus-trap.md} +1 -1
  94. package/docs/layout/popover/demo/d12-popover-using-and-html-element-as-the-anchor.md +9 -0
  95. package/docs/layout/popover/index.md +7 -0
  96. package/docs/layout/resizable-container/demo/d01-horizontal-resizing.md +10 -0
  97. package/docs/layout/resizable-container/demo/d02-resizable-panel-options.md +10 -0
  98. package/docs/layout/resizable-container/demo/d03-horizontal-resizing-with-controlled-widths.md +10 -0
  99. package/docs/layout/resizable-container/demo/d04-vertical-resizing.md +10 -0
  100. package/docs/layout/resizable-container/demo/d05-collapsible-resizable-panels.md +10 -0
  101. package/docs/layout/resizable-container/demo/d06-responsive-layout.md +10 -0
  102. package/docs/layout/resizable-container/demo/d07-collapsible-panels-options.md +10 -0
  103. package/docs/layout/resizable-container/demo/d08-collapsible-panels-with-external-control.md +10 -0
  104. package/docs/layout/resizable-container/index.md +15 -0
  105. package/docs/layout/spacer/demo/d01-basic.md +44 -0
  106. package/docs/layout/spacer/index.md +7 -0
  107. package/docs/navigation/{breadcrumbs-demo/demo1.md → breadcrumbs/demo/d01-basic.md} +9 -6
  108. package/docs/navigation/{breadcrumbs-demo/demo2.md → breadcrumbs/demo/d02-limit-the-number-of-breadcrumbs.md} +0 -0
  109. package/docs/navigation/{breadcrumbs-demo/demo3.md → breadcrumbs/demo/d03-truncate-each-breadcrumb.md} +0 -0
  110. package/docs/navigation/{breadcrumbs-demo/demo4.md → breadcrumbs/demo/d04-truncate-each-breadcrumb-on-each-object.md} +0 -0
  111. package/docs/navigation/{breadcrumbs-demo/demo5.md → breadcrumbs/demo/d05-responsive.md} +14 -0
  112. package/docs/navigation/{breadcrumbs-demo/demo6.md → breadcrumbs/demo/d06-color-for-emphasis.md} +12 -23
  113. package/docs/navigation/breadcrumbs/index.md +7 -0
  114. package/docs/navigation/button/demo/d01-basic.md +85 -0
  115. package/docs/navigation/button/demo/d02-empty-button.md +68 -0
  116. package/docs/navigation/button/demo/d03-flush-empty-button.md +32 -0
  117. package/docs/navigation/button/demo/d04-buttons-with-icons.md +213 -0
  118. package/docs/navigation/button/demo/d05-icon-buttons.md +139 -0
  119. package/docs/navigation/button/demo/d06-buttons-as-links.md +51 -0
  120. package/docs/navigation/button/demo/d07-loading-state.md +38 -0
  121. package/docs/navigation/button/demo/d08-split-buttons.md +43 -0
  122. package/docs/navigation/button/demo/d09-toggle-buttons.md +10 -0
  123. package/docs/navigation/button/demo/d10-button-groups.md +10 -0
  124. package/docs/navigation/button/demo/d11-ghost.md +10 -0
  125. package/docs/navigation/button/index.md +13 -0
  126. package/docs/navigation/steps-demo/demo3.md +0 -1
  127. package/docs/{layout/page-template/demo/demo1.md → templates/page-template/demo/d01-a-full-page-with-everything.md} +1 -24
  128. package/docs/{layout/page-template/demo/demo2.md → templates/page-template/demo/d02-restricting-page-width.md} +0 -0
  129. package/docs/{layout/page-template/demo/demo3.md → templates/page-template/demo/d03-showing-a-bottom-bar.md} +0 -0
  130. package/docs/{layout/page-template/demo/demo4.md → templates/page-template/demo/d04-centered-body.md} +1 -1
  131. package/docs/{layout/page-template/demo/demo5.md → templates/page-template/demo/d05-centered-content.md} +1 -1
  132. package/docs/{layout/page-template/demo/demo6.md → templates/page-template/demo/d06-a-simple-page-with-tabs.md} +0 -0
  133. package/docs/{layout/page-template/demo/demo7.md → templates/page-template/demo/d07-full-height-layout.md} +0 -0
  134. package/docs/{layout/page-template/demo/demo8.md → templates/page-template/demo/d08-simple-layout-with-centered-body.md} +0 -0
  135. package/docs/{layout/page-template/demo/demo9.md → templates/page-template/demo/d09-simple-layout-with-centered-content.md} +0 -0
  136. package/docs/{layout/page-template/demo/demo10.md → templates/page-template/demo/d10-a-simple-page-layout-with-custom-content.md} +0 -0
  137. package/docs/templates/page-template/index.md +37 -0
  138. package/docs/templates/sitewide-search/demo/d01-basic-setup.md +10 -0
  139. package/docs/templates/sitewide-search/demo/d02-options.md +10 -0
  140. package/docs/templates/sitewide-search/index.md +9 -0
  141. package/docs/templates/super-date-picker/demo/d01-update-button.md +10 -0
  142. package/docs/templates/super-date-picker/demo/d02-quick-select-panels.md +10 -0
  143. package/docs/templates/super-date-picker/demo/d03-sizing.md +10 -0
  144. package/docs/templates/super-date-picker/demo/d04-auto-refresh.md +11 -0
  145. package/docs/templates/super-date-picker/demo/d05-elastic-pattern-with-kql.md +10 -0
  146. package/docs/templates/super-date-picker/index.md +12 -0
  147. package/package.json +3 -3
  148. package/docs/layout/accordion-demo/demo1.md +0 -33
  149. package/docs/layout/accordion-demo/demo7.md +0 -66
  150. package/docs/layout/bottom-bar.md +0 -1
  151. package/docs/layout/flex-demo/demo1.md +0 -358
  152. package/docs/layout/flex.md +0 -1
  153. package/docs/layout/flyout-demo/demo2.md +0 -87
  154. package/docs/layout/flyout.md +0 -1
  155. package/docs/layout/header.md +0 -1
  156. package/docs/layout/horizontal-rule-demo/demo1.md +0 -70
  157. package/docs/layout/horizontal-rule.md +0 -1
  158. package/docs/layout/modal-demo/demo1.md +0 -97
  159. package/docs/layout/modal-demo/demo2.md +0 -126
  160. package/docs/layout/modal-demo/demo3.md +0 -55
  161. package/docs/layout/modal-demo/demo4.md +0 -65
  162. package/docs/layout/modal.md +0 -1
  163. package/docs/layout/page-template/index.md +0 -11
  164. package/docs/layout/popover-demo/demo4.md +0 -118
  165. package/docs/layout/popover.md +0 -1
  166. package/docs/navigation/breadcrumbs.md +0 -1
  167. package/docs/navigation/button-demo/demo1.md +0 -413
  168. package/docs/navigation/button.md +0 -1
@@ -0,0 +1,38 @@
1
+ ---
2
+ order: 2
3
+ ---
4
+
5
+ # Margins
6
+
7
+ ```hbs template
8
+ <div class="horizontal-rule-demo">
9
+ <EuiCode>none</EuiCode>
10
+ <div>
11
+ <EuiHorizontalRule @margin="none" />
12
+ </div>
13
+ <EuiCode>xs</EuiCode>
14
+ <div>
15
+ <EuiHorizontalRule @margin="xs" />
16
+ </div>
17
+ <EuiCode>s</EuiCode>
18
+ <div>
19
+ <EuiHorizontalRule @margin="s" />
20
+ </div>
21
+ <EuiCode>m</EuiCode>
22
+ <div>
23
+ <EuiHorizontalRule @margin="m" />
24
+ </div>
25
+ <EuiCode>l (default)</EuiCode>
26
+ <div>
27
+ <EuiHorizontalRule @margin="l" />
28
+ </div>
29
+ <EuiCode>xl</EuiCode>
30
+ <div>
31
+ <EuiHorizontalRule @margin="xl" />
32
+ </div>
33
+ <EuiCode>xxl</EuiCode>
34
+ <div>
35
+ <EuiHorizontalRule @margin="xxl" />
36
+ </div>
37
+ </div>
38
+ ```
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: Horizontal Rule
3
+ ---
4
+
5
+ <EuiPageHeader @pageTitle="Horizontal Rule"/>
6
+
7
+ <EuiHorizontalRule/>
@@ -0,0 +1,73 @@
1
+ ---
2
+ order: 1
3
+ ---
4
+
5
+ <!-- <EuiText>
6
+ Each <strong>EuiModal</strong> requires a specific set of nested child components. They can be omitted if necessary, but the order cannot be changed or interrupted.
7
+
8
+ Modals come a wrapping <strong>EuiOverlayMask</strong> to obscure the content beneath, but unlike flyouts, modals cannot be dismissed by clicking on the overlay mask. This is inline with our modal usage guidelines which requires there to be a primary action button, even if that button simply closes the modal.
9
+ </EuiText> -->
10
+
11
+ ```hbs template
12
+ <EuiButton
13
+ @color='primary'
14
+ {{on 'click' this.activateModal}}
15
+ >
16
+ Show modal
17
+ </EuiButton>
18
+
19
+ {{#if this.isActive}}
20
+
21
+ <EuiModal
22
+ @onClose={{this.deactivateModal}}
23
+ >
24
+ <EuiModalHeader>
25
+ <EuiTitle @size='m'>
26
+ Modal title
27
+ </EuiTitle>
28
+ </EuiModalHeader>
29
+ <EuiModalBody>
30
+ <EuiText>
31
+ <p>
32
+ This modal has the following setup:
33
+ </p>
34
+ <p>
35
+ <EuiCodeBlock @isCopyable={{true}}>
36
+ some code here...
37
+ </EuiCodeBlock>
38
+ </p>
39
+ </EuiText>
40
+ </EuiModalBody>
41
+ <EuiModalFooter>
42
+ <EuiButton
43
+ {{on 'click' this.deactivateModal}}
44
+ @color='primary'
45
+ @fill={{true}}
46
+ >
47
+ Close
48
+ </EuiButton>
49
+ </EuiModalFooter>
50
+ </EuiModal>
51
+ {{/if}}
52
+ ```
53
+
54
+ ```js component
55
+ import Component from '@glimmer/component';
56
+ import { tracked } from '@glimmer/tracking';
57
+ import { action } from '@ember/object';
58
+
59
+ export default class DemoModalComponent extends Component {
60
+ @tracked isActive = false;
61
+
62
+ @action
63
+ activateModal(modal) {
64
+ this.isActive = true;
65
+ }
66
+
67
+ @action
68
+ deactivateModal(modal) {
69
+ this.isActive = false;
70
+ }
71
+
72
+ }
73
+ ```
@@ -0,0 +1,107 @@
1
+ ---
2
+ order: 2
3
+ ---
4
+
5
+ # Forms in a modal
6
+
7
+ ```hbs template
8
+ <EuiButton
9
+ @color='primary'
10
+ {{on 'click' this.activateModal}}
11
+ >
12
+ Show form modal
13
+ </EuiButton>
14
+
15
+ {{#if this.isActive}}
16
+
17
+ <EuiModal
18
+ @onClose={{this.deactivateModal}}
19
+ >
20
+ <EuiModalHeader>
21
+ <EuiTitle @size='m'>
22
+ Modal title
23
+ </EuiTitle>
24
+ </EuiModalHeader>
25
+ <EuiModalBody>
26
+ <EuiForm>
27
+ {{#let
28
+ (unique-id)
29
+ (unique-id)
30
+ (unique-id)
31
+ (unique-id)
32
+ as |switchId textId rangeId selectId|}}
33
+ <EuiFormRow @id={{switchId}}>
34
+ <EuiSwitch
35
+ @id={{switchId}}
36
+ @label='Cool modal form'
37
+ @checked={{this.switchValue}}
38
+ @onChange={{pick 'target.checked' (set this 'switchValue')}}
39
+ />
40
+ </EuiFormRow>
41
+ <EuiFormRow @label='A text field' @id={{textId}}>
42
+ <EuiFieldText
43
+ @value={{this.textValue}}
44
+ @id={{textId}}
45
+ {{on 'input' (pick 'target.value' (set this 'textValue'))}}
46
+ />
47
+ </EuiFormRow>
48
+ <EuiFormRow @label='Range' @id={{textId}}>
49
+ <EuiRange
50
+ @min={{0}}
51
+ @max={{10}}
52
+ @step={{1}}
53
+ @value={{this.rangeValue}}
54
+ @onChange={{pick 'target.value' (set this 'rangeValue')}}
55
+ @showLabels={{false}}
56
+ aria-describedby={{rangeId}}
57
+ />
58
+ <EuiFormHelpText id={{rangeId}}>
59
+ Some help text for the range
60
+ </EuiFormHelpText>
61
+
62
+ </EuiFormRow>
63
+ <EuiFormRow @label='An EuiSuperSelect' @id={{textId}}>
64
+ <TodoText @text='missing eui-super-select'/>
65
+ </EuiFormRow>
66
+ {{/let}}
67
+ </EuiForm>
68
+ </EuiModalBody>
69
+ <EuiModalFooter>
70
+ <EuiButton
71
+ {{on 'click' this.deactivateModal}}
72
+ @color='primary'
73
+ >
74
+ Cancel
75
+ </EuiButton>
76
+ <EuiButton
77
+ {{on 'click' this.deactivateModal}}
78
+ @color='primary'
79
+ @fill={{true}}
80
+ >
81
+ Save
82
+ </EuiButton>
83
+ </EuiModalFooter>
84
+ </EuiModal>
85
+ {{/if}}
86
+ ```
87
+
88
+ ```js component
89
+ import Component from '@glimmer/component';
90
+ import { tracked } from '@glimmer/tracking';
91
+ import { action } from '@ember/object';
92
+
93
+ export default class DemoModalComponent extends Component {
94
+ @tracked isActive = false;
95
+
96
+ @action
97
+ activateModal(modal) {
98
+ this.isActive = true;
99
+ }
100
+
101
+ @action
102
+ deactivateModal(modal) {
103
+ this.isActive = false;
104
+ }
105
+
106
+ }
107
+ ```
@@ -0,0 +1,86 @@
1
+ ---
2
+ order: 3
3
+ ---
4
+
5
+ # Confirm Modal
6
+
7
+ ```hbs template
8
+
9
+ <!-- buttons -->
10
+
11
+ <EuiFlexGroup>
12
+ <EuiFlexItem>
13
+ <EuiButton
14
+ @color='primary'
15
+ {{on 'click' (fn this.activateModal 'confirmModalActive')}}
16
+ >
17
+ Show confirm modal
18
+ </EuiButton>
19
+ </EuiFlexItem>
20
+ <EuiFlexItem>
21
+ <EuiButton
22
+ @color='primary'
23
+ {{on 'click' (fn this.activateModal 'dangerousConfirmModalActive')}}
24
+ >
25
+ Show dangerous confirm modal
26
+ </EuiButton>
27
+ </EuiFlexItem>
28
+ </EuiFlexGroup>
29
+
30
+ <!-- modals -->
31
+
32
+ {{#if this.confirmModalActive}}
33
+ <EuiConfirmModal
34
+ @title='Do this thing'
35
+ @onConfirm={{fn this.deactivateModal 'confirmModalActive'}}
36
+ @buttonColor='primary'
37
+ @confirmButtonText='Yes, do it'
38
+ @cancelButtonText="No, don't do it"
39
+ @onCancel={{fn this.deactivateModal 'confirmModalActive'}}
40
+ >
41
+ <EuiText>
42
+ <p>You are about to do something</p>
43
+ <p>Are you sure you want to do this?</p>
44
+ </EuiText>
45
+ </EuiConfirmModal>
46
+ {{/if}}
47
+
48
+ {{#if this.dangerousConfirmModalActive}}
49
+ <EuiConfirmModal
50
+ @title='Do this destructive thing'
51
+ @onConfirm={{fn this.deactivateModal 'dangerousConfirmModalActive'}}
52
+ @buttonColor='danger'
53
+ @confirmButtonText='Yes, do it'
54
+ @cancelButtonText="No, don't do it"
55
+ @onCancel={{fn this.deactivateModal 'dangerousConfirmModalActive'}}
56
+ >
57
+ <EuiText>
58
+ <p>You’re about to destroy something.</p>
59
+ <p>Are you sure you want to do this?</p>
60
+ </EuiText>
61
+ </EuiConfirmModal>
62
+ {{/if}}
63
+
64
+ ```
65
+
66
+ ```js component
67
+ import Component from '@glimmer/component';
68
+ import { tracked } from '@glimmer/tracking';
69
+ import { action } from '@ember/object';
70
+
71
+ export default class DemoModalComponent extends Component {
72
+ @tracked confirmModalActive = false;
73
+ @tracked dangerousConfirmModalActive = false;
74
+
75
+ @action
76
+ activateModal(modal) {
77
+ this[modal] = true;
78
+ }
79
+
80
+ @action
81
+ deactivateModal(modal) {
82
+ this[modal] = false;
83
+ }
84
+
85
+ }
86
+ ```
@@ -0,0 +1,80 @@
1
+ ---
2
+ order: 4
3
+ ---
4
+
5
+ # Loading and disabling confirm button
6
+
7
+ <EuiText>
8
+ <strong>EuiConfirmModal</strong> supports being able to apply loading and disabled states to the confirm button with the <EuiCode>confirmButtonDisabled</EuiCode> and <EuiCode>isLoading</EuiCode> props respectively. This is helpful to indicate the fetching of data and/or to wait for a user's input before enabling the confirm action.
9
+ </EuiText>
10
+
11
+ ```hbs template
12
+ <EuiButton
13
+ @color='primary'
14
+ {{on 'click' (fn this.activateModal 'modalActive')}}
15
+ >
16
+ Show loading confirm modal
17
+ </EuiButton>
18
+ {{#if this.modalActive}}
19
+ <EuiConfirmModal
20
+ @title='Delete the EUI repo?'
21
+ @onConfirm={{this.alertMessage}}
22
+ @buttonColor='danger'
23
+ @confirmButtonText='Delete'
24
+ @cancelButtonText='Cancel'
25
+ @isLoading={{this.isLoading}}
26
+ @confirmButtonDisabled={{(if
27
+ (eq this.textValue 'delete')
28
+ false
29
+ true
30
+ )}}
31
+ @onCancel={{fn this.deactivateModal 'modalActive'}}
32
+ >
33
+ <EuiText>
34
+ {{#let
35
+ (unique-id)
36
+ as |textId|}}
37
+ <EuiFormRow @label="Type the word 'delete' to confirm" @id={{textId}}>
38
+ <EuiFieldText
39
+ @value={{this.textValue}}
40
+ @id={{textId}}
41
+ @isLoading={{this.isLoading}}
42
+ {{on 'input' (pick 'target.value' (set this 'textValue'))}}
43
+ />
44
+
45
+ </EuiFormRow>
46
+ {{/let}}
47
+ </EuiText>
48
+ </EuiConfirmModal>
49
+ {{/if}}
50
+ ```
51
+
52
+ ```js component
53
+ import Component from '@glimmer/component';
54
+ import { tracked } from '@glimmer/tracking';
55
+ import { action } from '@ember/object';
56
+
57
+ export default class DemoModalComponent extends Component {
58
+ @tracked modalActive = false;
59
+ @tracked isLoading = true;
60
+
61
+ @action
62
+ activateModal(modal) {
63
+ this[modal] = true
64
+ this.isLoading = true
65
+ setTimeout(() => {
66
+ this.isLoading = false
67
+ }, 1000);
68
+ }
69
+
70
+ @action
71
+ deactivateModal(modal) {
72
+ this[modal] = false;
73
+ }
74
+
75
+ @action
76
+ alertMessage() {
77
+ confirm('Shame on you!')
78
+ }
79
+ }
80
+ ```
@@ -15,54 +15,35 @@ order: 5
15
15
  ```hbs template
16
16
  <EuiButton
17
17
  @color='primary'
18
- {{on 'click' (fn this.activateModal 'widthModalActive')}}
18
+ {{on 'click' (fn this.activateModal 'modalActive')}}
19
19
  >
20
- Show Width Modal
20
+ Show modal with custom width
21
21
  </EuiButton>
22
- {{#if this.widthModalActive}}
22
+ {{#if this.modalActive}}
23
23
 
24
24
  <EuiModal
25
- @onClose={{fn this.deactivateModal 'widthModalActive'}}
26
- @initialFocus='#focusee'
27
- style='width: 800px'
25
+ @onClose={{fn this.deactivateModal 'modalActive'}}
26
+ style='width: {{this.width}}px'
28
27
  >
29
28
  <EuiModalHeader>
30
- <EuiTitle @size='m'>
31
- Basic Modal width 800 px width
29
+ <EuiTitle>
30
+ Modal title
32
31
  </EuiTitle>
33
32
  </EuiModalHeader>
34
33
  <EuiModalBody>
35
- <EuiText>
36
- <p>
37
- Hello there!
38
- </p>
39
- <p>
40
- This modal has many
41
- <a id='focusee' href='#'>
42
- different
43
- </a>
44
- <a href='#'>
45
- focusable
46
- </a>
47
- <a href='#'>
48
- items
49
- </a>
50
- .
51
- </p>
52
- </EuiText>
34
+ This modal has the following setup:
35
+ <EuiSpacer/>
36
+ <EuiCodeBlock @isCopyable={{true}}>
37
+ {{this.code}}
38
+ </EuiCodeBlock>
53
39
  </EuiModalBody>
54
40
  <EuiModalFooter>
55
- <EuiButtonEmpty
56
- {{on 'click' (fn this.deactivateModal 'widthModalActive')}}
57
- >
58
- Cancel
59
- </EuiButtonEmpty>
60
41
  <EuiButton
61
- {{on 'click' (fn this.deactivateModal 'widthModalActive')}}
42
+ {{on 'click' (fn this.deactivateModal 'modalActive')}}
62
43
  @color='primary'
63
44
  @fill={{true}}
64
45
  >
65
- Submit
46
+ close
66
47
  </EuiButton>
67
48
  </EuiModalFooter>
68
49
  </EuiModal>
@@ -76,7 +57,12 @@ import { tracked } from '@glimmer/tracking';
76
57
  import { action } from '@ember/object';
77
58
 
78
59
  export default class DemoModalComponent extends Component {
79
- @tracked widthModalActive = false;
60
+ @tracked modalActive = false;
61
+ width = 800
62
+
63
+ code = `
64
+ <EuiModal style='width: ${this.width}'>...</EuiModal>
65
+ `
80
66
 
81
67
  @action
82
68
  activateModal(modal) {
@@ -87,10 +73,5 @@ export default class DemoModalComponent extends Component {
87
73
  deactivateModal(modal) {
88
74
  this[modal] = false;
89
75
  }
90
-
91
- @action
92
- reloadPage() {
93
- location.reload();
94
- }
95
76
  }
96
77
  ```
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: Modal
3
+ ---
4
+
5
+ <EuiPageHeader @pageTitle="Modal"/>
6
+
7
+ <EuiSpacer @size="l" />
8
+
9
+ <EuiText>
10
+ A modal works best for focusing users' attention on a <strong>short</strong> amount of content and getting them to make a decision. Use it to temporarily interrupt a user’s current task and block interactions to the content below it. If your modal content is more complex, or requires considerable time to complete, consider using an EuiFlyout instead.
11
+ </EuiText>
12
+
13
+ <EuiHorizontalRule/>
@@ -2,8 +2,6 @@
2
2
  order: 1
3
3
  ---
4
4
 
5
- # Basic
6
-
7
5
  ```hbs template
8
6
  <EuiPageHeader
9
7
  @bottomBorder={{true}}
@@ -2,13 +2,12 @@
2
2
  order: 2
3
3
  ---
4
4
 
5
- # Tabs
5
+ # Tabs in the page header
6
6
 
7
7
  ```hbs template
8
8
  <EuiPageHeader
9
9
  @bottomBorder={{true}}
10
10
  @pageTitle="Page title"
11
- @description='This description should be describing the current page as depicted by the page title. It will never extend beneath the right side content.'
12
11
  @tabs={{array (hash label="Tab 1" isSelected=true) (hash label="Tab 2")}}
13
12
  >
14
13
  <:rightSideItems>
@@ -2,12 +2,11 @@
2
2
  order: 3
3
3
  ---
4
4
 
5
- # Tabs
6
-
7
5
  ```hbs template
6
+ <!-- example 2 -->
8
7
  <EuiPageHeader
9
8
  @bottomBorder={{true}}
10
- @description='This description should be describing the current page as depicted by the page title. It will never extend beneath the right side content.'
9
+ @description='This description should be describing the current page as depicted by the current tab. It has grow set to false to ensure a readable line-length.'
11
10
  @dumb={{true}}
12
11
  @tabs={{array (hash label="Tab 1" isSelected=true) (hash label="Tab 2")}}
13
12
  />
@@ -9,11 +9,12 @@ order: 4
9
9
  </EuiText>
10
10
 
11
11
  ```hbs template
12
+ <!-- example 1 -->
12
13
  <EuiPageHeader
13
14
  @bottomBorder={{true}}
14
15
  @pageTitle='Page title'
15
16
  @description='Example of a description.'
16
- @breadcrumbs={{this.breadcrumbs}}
17
+ @breadcrumbs={{this.breadcrumbsExample1}}
17
18
  >
18
19
  <:rightSideItems>
19
20
  <EuiFlexItem>
@@ -31,7 +32,7 @@ import Component from '@glimmer/component';
31
32
  import { tracked } from '@glimmer/tracking';
32
33
 
33
34
  export default class AccordionDemo1Component extends Component {
34
- breadcrumbs = [
35
+ breadcrumbsExample1 = [
35
36
  {
36
37
  text: 'Breadcrumb 1',
37
38
  href: '#',
@@ -2,8 +2,6 @@
2
2
  order: 5
3
3
  ---
4
4
 
5
- # Common pattern
6
-
7
5
  <EuiText>
8
6
  A common pattern is to use a single breadcrumb to return the user to a listing page from which the current page was navigated to
9
7
  </EuiText>
@@ -36,29 +34,4 @@ order: 5
36
34
  </EuiFlexItem>
37
35
  </:rightSideItems>
38
36
  </EuiPageHeader>
39
- ```
40
-
41
- ```js component
42
- import Component from '@glimmer/component';
43
- import { tracked } from '@glimmer/tracking';
44
-
45
- export default class AccordionDemo1Component extends Component {
46
- breadcrumbs = [
47
- {
48
- text: 'Breadcrumb 1',
49
- href: '#',
50
- onClick: (e) => e.preventDefault()
51
- },
52
- {
53
- text: 'Breadcrumb 2',
54
- href: '#',
55
- onClick: (e) => e.preventDefault()
56
- },
57
- {
58
- text: 'Current',
59
- href: '#',
60
- onClick: (e) => e.preventDefault()
61
- }
62
- ];
63
- }
64
- ```
37
+ ```
@@ -1,6 +1,5 @@
1
1
  ---
2
- order: 1
3
- title: Page Header
2
+ title: Page header
4
3
  ---
5
4
 
6
5
  <EuiPageHeader @pageTitle="Page Header" @bottomBorder={{true}}>
@@ -13,10 +13,10 @@ order: 2
13
13
  ```hbs template
14
14
  <EuiSpacer @size='l' />
15
15
  <EuiPanel @hasShadow={{false}}>
16
- @hasShadow={{false}}
16
+ <EuiCode>@hasShadow={{false}}</EuiCode>
17
17
  </EuiPanel>
18
18
  <EuiSpacer @size='l' />
19
19
  <EuiPanel @hasBorder={{true}}>
20
- @hasBorder={{true}}
20
+ <EuiCode>@hasBorder={{true}}</EuiCode>
21
21
  </EuiPanel>
22
22
  ```
@@ -2,7 +2,7 @@
2
2
  order: 4
3
3
  ---
4
4
 
5
- # Split panel
5
+ # Split panels
6
6
 
7
7
  <EuiText>
8
8
  <p><strong>EuiSplitPanel</strong> is a composition of an outer and multiple inner <strong>EuiPanels</strong>. It is a namespaced component that you consume using <EuiCode>EuiSplitPanel.Outer</EuiCode> and <EuiCode>EuiSplitPanel.Inner</EuiCode> respectively. You can supply the same panel props to both components with the exception of a few to ensure the visual layout is correct. It also has two directions, <EuiCode>column</EuiCode> (default) and <EuiCode>row</EuiCode>.</p><p>For custom responsiveness, you can adjust at which breakpoints a <EuiCode>row</EuiCode> layout will stack by passing a new array of breakpoint names <EuiCode>['xs', 's']</EuiCode> to the <EuiCode>responsive</EuiCode> prop, or completely turn it off with <EuiCode>false</EuiCode>.</p>
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Panel
3
+ ---
4
+
1
5
  <EuiPageHeader @pageTitle="Panel"/>
2
6
 
3
7
  <EuiText>
@@ -2,8 +2,6 @@
2
2
  order: 1
3
3
  ---
4
4
 
5
- # Basic
6
-
7
5
  <EuiText>
8
6
  <p>
9
7
  Use the
@@ -30,7 +28,7 @@ order: 1
30
28
  <EuiPopover
31
29
  @ownFocus={{true}}
32
30
  @isOpen={{this.popover}}
33
- @anchorPosition='downLeft'
31
+ @anchorPosition='downCenter'
34
32
  @closePopover={{set this 'popover' false}}
35
33
  >
36
34
  <:button>
@@ -43,7 +41,11 @@ order: 1
43
41
  </EuiButton>
44
42
  </:button>
45
43
  <:content>
46
- Popover content that’s wider than the default width
44
+ <EuiText @size="m" style="width: 300px;">
45
+ <p>
46
+ Popover content that’s wider than the default width
47
+ </p>
48
+ </EuiText>
47
49
  </:content>
48
50
  </EuiPopover>
49
51
  </div>