- focusTriggerOnOutsideClick - indicates if the previously focused element outside
- {code('FocusTrapZone')} should be focused on outside click. Note: trigger will be focused
- when exiting FTZ using keyboard. If {code('isClickableOutsideFocusTrap')} ==={' '}
- {code('false')},{code('focusTriggerOnOutsideClick')} will not be taken into account.
-
Default: {code('false')}
-
Type: {code('boolean')}
-
-
- ignoreExternalFocusing - indicates if this Trap Zone will ignore keeping track of
- HTMLElement that activated the Zone.
-
Default: {code('false')}
-
Type: {code('boolean')}
-
-
- forceFocusInsideTrap - indicates whether focus trap zone should force focus inside
- the zone when outside 'focus' event occurs.
-
Default: {code('false')}
-
Type: {code('boolean')}
-
-
- disableFirstFocus - do not put focus onto first element when render focus trap zone.
-
Default: {code('false')}
-
Type: {code('boolean')}
-
-
- focusPreviouslyFocusedInnerElement - specifies the algorithm used to determine which
- descendant element to focus when focus() is called.
- If false, the first focusable descendant, filtered by the firstFocusableSelector
- property if present, is chosen.
- If true, the element that was focused when the Trap Zone last had a focused
- descendant is chosen.
- If it has never had a focused descendant before, behavior falls back to the first
- focused descendant.
-
Default: {code('false')}
-
Type: {code('boolean')}
-
-
- firstFocusableSelector - indicates the selector for first focusable item. By default,
- the first tabbable element will get focus. Only applies if
- {code('focusPreviouslyFocusedInnerElement')} === {code('false')}.
-
The default and other available behaviors for all the components can be found in the{' '}
- {link('documentation', 'https://stardust-ui.github.io/react/')}, together with notes on other
- accessibility considerations for using the component. The examples show the recommended way of
- using the components in different variations. It is possible to edit example's code, see the
- rendered HTML, change themes and validate the rendering in RTL scenario, or with different
- behaviors.
+ {link('documentation', '/')}, together with notes on other accessibility considerations for
+ using the component. The examples show the recommended way of using the components in
+ different variations. It is possible to edit example's code, see the rendered HTML, change
+ themes and validate the rendering in RTL scenario, or with different behaviors.
diff --git a/docs/src/views/AutoFocusZone.tsx b/docs/src/views/AutoFocusZone.tsx
index 0527ba2794..102f04e117 100644
--- a/docs/src/views/AutoFocusZone.tsx
+++ b/docs/src/views/AutoFocusZone.tsx
@@ -4,6 +4,7 @@ import { Link } from 'react-router-dom'
import DocPage from '../components/DocPage'
import { code, link } from '../utils/helpers'
import CodeSnippet from '../components/CodeSnippet'
+import ComponentPropsTable from 'docs/src/components/ComponentDoc/ComponentPropsTable'
export default () => (
@@ -43,17 +44,7 @@ export default () => (
)}
):
-
-
- as - element type the root element will use. Default is "div".
-
Type: {code('React.ReactType')}
-
-
- firstFocusableSelector - indicates the selector for first focusable item. By default,
- the first tabbable element will get focus.
-
Type: {code('string | (() => string)')}
-
-
+ Override {code('AutoFocusZone')} settings
To be able to add/override {code('AutoFocusZone')} props already set for a component, it is
diff --git a/docs/src/views/FocusZone.tsx b/docs/src/views/FocusZone.tsx
index d57be93898..1ab709b496 100644
--- a/docs/src/views/FocusZone.tsx
+++ b/docs/src/views/FocusZone.tsx
@@ -2,6 +2,7 @@ import * as React from 'react'
import { Link } from 'react-router-dom'
import { Header } from '@stardust-ui/react'
+import ComponentPropsTable from 'docs/src/components/ComponentDoc/ComponentPropsTable'
import CodeSnippet from '../components/CodeSnippet'
import DocPage from '../components/DocPage'
import { code, link } from '../utils/helpers'
@@ -40,7 +41,11 @@ export default () => (
Focus the next or previous element after pressing a navigation key
The last focused element within the zone is identified by using{' '}
- {link('Roving tabindex', 'https://www.w3.org/TR/wai-aria-practices/#kbd_roving_tabindex')}
+ {link(
+ 'Roving tabindex',
+ 'https://www.w3.org/TR/wai-aria-practices/#kbd_roving_tabindex',
+ true,
+ )}
- bidirectional - navigation between items can be made using all arrow keys.{' '}
- It is set by default.
-
See an example of {link('tab list', 'components/menu#usages-tab-list')}.
-
-
-
-
- defaultTabbableElement - function which uses root element as parameter to return the
- initial active element. For example, when there is a chat with a bottom-up approach, it is
- expected that the last chat message is tabbable (active), not the first default one.
-
- shouldFocusOnMount - if a default tabbable element should be force focused on
- FocusZone mount.
-
Default: {code('false')}
-
Type: {code('boolean')}
-
-
- shouldFocusInnerElementWhenReceivedFocus - if true and {code('FocusZone')}'s root
- element (container) receives focus, the focus will land either on the defaultTabbableElement
- (if set) or on the first tabbable element of this {code('FocusZone')}. Usually a case for
- nested focus zones, when nested focus zone's container is a focusable element.
-
Default: {code('false')}
-
Type: {code('boolean')}
-
-
- shouldResetActiveElementWhenTabFromZone - if true and {code('TAB')} key is not
- handled by
- {code('FocusZone')}, resets current active element to null value. For example, when roving
- index is not desirable and focus should always reset to the default tabbable element.
-
Default: {code('false')}
-
Type: {code('boolean')}
-
-
- disabled - if set, the {code('FocusZone')} will not be tabbable and keyboard
- navigation will be disabled. This does not affect disabled attribute of any child.
-
Default: {code('false')}
-
Type: {code('boolean')}
-
-
- isRtl - if true, {code('FocusZone')} behavior will change to match RTL environments
- (left/right arrows switched).
-
Default: {code('false')}
-
Type: {code('boolean')}
-
-
- isCircularNavigation - if true, will cycle to the beginning of the targets once the
- user attempts to navigate past the last target while at the end, and to the end when the
- user attempts to naviagate before the first target.
-
Default: {code('false')}
-
Type: {code('boolean')}
-
For example, {link('horizontal menu', 'components/menu#types-menu')}.
-
-
- shouldEnterInnerZone - callback function that will be executed, will be executed on
- keypresses to determine if the user intends to navigate into the inner (nested) zone.
- Returning true will ask the first inner zone to set focus. For example, when chat container
- is focus zone and chat messages are inner focus zones. Navigation between messages possible
- with up/down arrow keys, but when pressing Enter, focus should go to focusable elements
- inside message, for example, a link.
-
- onActiveElementChanged - callback for when one of immediate children elements gets
- activated by getting focused or by having one of its respective children elements focused.
-
- handleTabKey - allows {code('TAB')} key to be handled, thus alows tabbing through a
- focusable list of items in the focus zone. A side effect is that users will not be able to{' '}
- {code('TAB')} out of the focus zone and have to hit escape or some other key to exit focus
- zone.
-
Type: {code('FocusZoneTabbableElements')}, enum with next options:
-
-
- none - tabbing is not allowed
-
-
- all - all tabbing action is allowed
-
-
- inputOnly - tabbing is allowed only on input elements
-
-
-
-
- shouldInputLoseFocusOnArrowKey - a callback method to determine if the input element
- should lose focus on arrow keys. For example, when arrow keys are pressed to navigate when
- an input element is empty or when cursor is at the beginning/end of a string.
-
- stopFocusPropagation - if true, focus event propagation will be stopped.
-
Default: {code('false')}
-
Type: {code('boolean')}
-
-
- onFocus - callback called when "focus" event triggered in {code('FocusZone')}.
-
Type: {code('(event: React.FocusEvent) => void')}
-
-
- preventDefaultWhenHandled - if true, {code('FocusZone')} prevents default behavior
- when handled a key event.
-
Default: {code('false')}
-
Type: {code('boolean')}
-
-
+ Override {code('FocusZone')} settings
To be able to add/override Focus Zone settings already set for a component, it is needed to
From 861b0e17efb1bea267087fb1425ce3a81c4fea09 Mon Sep 17 00:00:00 2001
From: Oleksandr Fediashov
Date: Thu, 2 May 2019 10:30:09 +0200
Subject: [PATCH 5/9] fix ignore
---
build/gulp/plugins/gulp-component-menu.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build/gulp/plugins/gulp-component-menu.ts b/build/gulp/plugins/gulp-component-menu.ts
index d9becf8af7..86b5e5d07a 100644
--- a/build/gulp/plugins/gulp-component-menu.ts
+++ b/build/gulp/plugins/gulp-component-menu.ts
@@ -39,7 +39,7 @@ export default () => {
const jsonInfo = fs.readFileSync(infoFilePath)
componentInfo = JSON.parse(jsonInfo.toString())
} else {
- componentInfo = getComponentInfo(file.path)
+ componentInfo = getComponentInfo(file.path, [])
}
if (componentInfo.isParent) {
From b70a1d5f43dabd9e79183058f84a0af950f5e145 Mon Sep 17 00:00:00 2001
From: Oleksandr Fediashov
Date: Thu, 2 May 2019 15:45:10 +0200
Subject: [PATCH 6/9] revert link() changes
---
docs/src/utils/helpers.tsx | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/docs/src/utils/helpers.tsx b/docs/src/utils/helpers.tsx
index 7615aa79c8..be42bdf57d 100644
--- a/docs/src/utils/helpers.tsx
+++ b/docs/src/utils/helpers.tsx
@@ -1,14 +1,10 @@
import * as React from 'react'
-import { Link } from 'react-router-dom'
import { Icon } from '@stardust-ui/react'
export const code = value => {value}
-export const link = (content, href, isExternal = false) =>
- isExternal ? (
-
- {content} {isExternal ? : ''}
-
- ) : (
- {content}
- )
+export const link = (content, href, isExternal = false) => (
+
+ {content} {isExternal ? : ''}
+
+)
From 72ec8c8c0590f3de05fc847be400e9e9308ccc14 Mon Sep 17 00:00:00 2001
From: Oleksandr Fediashov
Date: Thu, 2 May 2019 15:46:42 +0200
Subject: [PATCH 7/9] invert condition
---
build/gulp/plugins/util/getComponentInfo.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/build/gulp/plugins/util/getComponentInfo.ts b/build/gulp/plugins/util/getComponentInfo.ts
index 07097c721c..65d0bd84a8 100644
--- a/build/gulp/plugins/util/getComponentInfo.ts
+++ b/build/gulp/plugins/util/getComponentInfo.ts
@@ -100,9 +100,9 @@ const getComponentInfo = (filepath: string, ignoredParentInterfaces: string[]) =
const { name, value } = parseType(propName, propDef)
const parentInterface = _.get(propDef, 'parent.name')
- const ignoredInDefinitions = _.includes(ignoredParentInterfaces, parentInterface)
+ const visibleInDefinition = !_.includes(ignoredParentInterfaces, parentInterface)
- if (!ignoredInDefinitions) {
+ if (visibleInDefinition) {
info.props[propName] = {
...propDef,
description,
From c43a6f7db7fae7c161c519d1c3b655f1a8f8d0d0 Mon Sep 17 00:00:00 2001
From: Oleksandr Fediashov
Date: Thu, 2 May 2019 15:47:46 +0200
Subject: [PATCH 8/9] update error contents
---
docs/src/components/ComponentDoc/useComponentProps.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/src/components/ComponentDoc/useComponentProps.ts b/docs/src/components/ComponentDoc/useComponentProps.ts
index 16fe443998..759b2ee980 100644
--- a/docs/src/components/ComponentDoc/useComponentProps.ts
+++ b/docs/src/components/ComponentDoc/useComponentProps.ts
@@ -5,7 +5,7 @@ const useComponentProps = (componentName: string) => {
if (!info) {
throw new Error(
- `We don't have definitions for "${componentName}", please ensure that are generated by "gulp-docgen" plugin`,
+ `We don't have definitions for "${componentName}". Please ensure those are generated by "gulp-docgen" plugin`,
)
}
From 1fc3f7b16566ff902af86b12527d636ab3f11005 Mon Sep 17 00:00:00 2001
From: Oleksandr Fediashov
Date: Thu, 2 May 2019 15:51:07 +0200
Subject: [PATCH 9/9] restore link stuff
---
docs/src/views/AccessibilityBehaviors.tsx | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/src/views/AccessibilityBehaviors.tsx b/docs/src/views/AccessibilityBehaviors.tsx
index be59f6494b..34e1f9ba9b 100644
--- a/docs/src/views/AccessibilityBehaviors.tsx
+++ b/docs/src/views/AccessibilityBehaviors.tsx
@@ -243,10 +243,11 @@ export default () => (
The default and other available behaviors for all the components can be found in the{' '}
- {link('documentation', '/')}, together with notes on other accessibility considerations for
- using the component. The examples show the recommended way of using the components in
- different variations. It is possible to edit example's code, see the rendered HTML, change
- themes and validate the rendering in RTL scenario, or with different behaviors.
+ {link('documentation', 'https://stardust-ui.github.io/react/')}, together with notes on other
+ accessibility considerations for using the component. The examples show the recommended way of
+ using the components in different variations. It is possible to edit example's code, see the
+ rendered HTML, change themes and validate the rendering in RTL scenario, or with different
+ behaviors.