diff --git a/src/App.vue b/src/App.vue index cd07ecc54..85ff76a9e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -61,6 +61,9 @@ +
  • + ActionPanel +
  • Badge
  • Button
  • Chart
  • diff --git a/src/components/ActionPanel/ActionPanel.vue b/src/components/ActionPanel/ActionPanel.vue new file mode 100644 index 000000000..0f37e3b0e --- /dev/null +++ b/src/components/ActionPanel/ActionPanel.vue @@ -0,0 +1,66 @@ + + + diff --git a/src/components/Button/Button.vue b/src/components/Button/Button.vue index 556b48f6a..019da34fa 100644 --- a/src/components/Button/Button.vue +++ b/src/components/Button/Button.vue @@ -67,6 +67,7 @@ export default { background: #fff; border: @bg-border-light; border-radius: @radius; + text-align: center; font-size: @font-sml; line-height: 2rem; font-weight: @bold; diff --git a/src/components/Composer/Composer.vue b/src/components/Composer/Composer.vue index 9e4cad532..4c281eb05 100644 --- a/src/components/Composer/Composer.vue +++ b/src/components/Composer/Composer.vue @@ -217,6 +217,7 @@ :closeLabel="__('common.close')" :name="fileAttacherModalId" :title="attachFilesLabel" + @closed="resetFocusAfterAttachment" > import Page from '@/components/Container/Page.vue'; import ThemeForm from '@/components/Form/context/ThemeForm.vue'; +import ActionPanel from '../ActionPanel/ActionPanel.vue'; export default { extends: Page, name: 'AdminPage', components: { + ActionPanel, ThemeForm } }; @@ -19,6 +21,19 @@ export default { margin-bottom: 2rem; } + .actionPanel { + margin-bottom: 1.5rem; + padding: 1rem; + border: @bg-border-light; + border-radius: @radius; + background: @lift; + } + + // Account for
    wrappers around some actions + .actionPanel__actions form + form { + margin-top: 0.25rem; + } + .app__contentPanel { font-size: @font-sml; line-height: 1.6em; @@ -33,24 +48,6 @@ export default { margin-top: 0; } - h3 { - margin-bottom: 0.5rem; - } - - ul { - margin: 0; - padding: 0; - list-style: none; - } - - li { - padding: 0.25em 0; - } - - ul + h2 { - margin-top: 1rem; - } - .app--admin__systemInfoGroup { font-weight: @bold; } diff --git a/src/components/FileAttacher/FileAttacher.vue b/src/components/FileAttacher/FileAttacher.vue index c243b2a55..3d331dd85 100644 --- a/src/components/FileAttacher/FileAttacher.vue +++ b/src/components/FileAttacher/FileAttacher.vue @@ -1,40 +1,55 @@ diff --git a/src/docs/components/ActionPanel/previews/PreviewActionPanel.vue b/src/docs/components/ActionPanel/previews/PreviewActionPanel.vue new file mode 100644 index 000000000..0abc7924c --- /dev/null +++ b/src/docs/components/ActionPanel/previews/PreviewActionPanel.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/src/docs/components/ActionPanel/readme.md b/src/docs/components/ActionPanel/readme.md new file mode 100644 index 000000000..29d6d92cf --- /dev/null +++ b/src/docs/components/ActionPanel/readme.md @@ -0,0 +1,11 @@ +## Props + +This component does not accept any props. + +## Events + +This component does not emit any events. + +## Usage + +Use this component to pair an action, like a button or link, with a title and description. \ No newline at end of file diff --git a/src/mixins/global.js b/src/mixins/global.js index d96d8c59a..bc3b091a8 100644 --- a/src/mixins/global.js +++ b/src/mixins/global.js @@ -158,9 +158,18 @@ export default { * @param {Boolean} toLast Move the focus to the last focusable element */ setFocusIn(el, toLast) { - let focusable = el.querySelectorAll( - 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])' - ); + const selectors = [ + 'button', + '[href]', + 'input', + 'select', + 'textarea', + 'details', + '[tabindex]:not([tabindex="-1"])' + ]; + let focusable = [...el.querySelectorAll(selectors.join(','))] + .filter(node => !node.hasAttribute('disabled')) + .filter(node => !node.hasAttribute('aria-hidden')); if (focusable.length) { if (toLast) { focusable[focusable.length - 1].focus(); diff --git a/src/router.js b/src/router.js index b91b9e049..7cd953cb3 100644 --- a/src/router.js +++ b/src/router.js @@ -1,6 +1,7 @@ import Vue from 'vue'; import Router from 'vue-router'; import Page from './docs/Page.vue'; +import ComponentActionPanel from './docs/components/ActionPanel/ComponentActionPanel.vue'; import ComponentAnnouncementsListPanel from './docs/components/ListPanel/ComponentAnnouncementsListPanel.vue'; import ComponentBadge from './docs/components/Badge/ComponentBadge.vue'; import ComponentButton from './docs/components/Button/ComponentButton.vue'; @@ -83,6 +84,11 @@ export default new Router({ name: 'page', component: Page }, + { + path: '/component/ActionPanel/:example?', + name: 'ActionPanel', + component: ComponentActionPanel + }, { path: '/component/Badge/:example?', name: 'Badge',