@planningcenter/tapestry-react 1.4.0 → 2.0.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/cjs/ActionsDropdown/ActionsDropdown.js +3 -3
- package/dist/cjs/Badge/Badge.js +41 -26
- package/dist/cjs/Badge/Status.js +2 -2
- package/dist/cjs/Calendar/Calendar.js +5 -3
- package/dist/cjs/Card/Card.js +2 -0
- package/dist/cjs/Checkbox/Checkbox.js +3 -3
- package/dist/cjs/ChurchCenterStatus/ChurchCenterStatus.js +4 -4
- package/dist/cjs/ColumnView/ColumnView.js +5 -2
- package/dist/cjs/Combobox/ComboboxPopover.js +2 -2
- package/dist/cjs/DataTable/components/CheckboxCell.js +4 -4
- package/dist/cjs/DataTable/components/ColumnPicker.js +6 -5
- package/dist/cjs/DataTable/hooks/useCollapsibleRows.js +1 -1
- package/dist/cjs/DataTable/hooks/useColumnSort.js +1 -1
- package/dist/cjs/DataTable/utils/getParsedColumns.js +4 -4
- package/dist/cjs/DateField/DateField.js +1 -1
- package/dist/cjs/Drawer/Drawer.js +4 -1
- package/dist/cjs/Dropdown/Dropdown.js +1 -1
- package/dist/cjs/Dropdown/Dropdown.test.js +194 -19
- package/dist/cjs/Dropdown/Link.js +3 -1
- package/dist/cjs/EditActions/EditActions.js +9 -3
- package/dist/cjs/FieldSet/FieldSet.js +24 -10
- package/dist/cjs/FilterLayout/FilterLayout.js +2 -1
- package/dist/cjs/Form/Form.js +1 -1
- package/dist/cjs/GridView/GridView.js +6 -4
- package/dist/cjs/Group/Group.js +10 -3
- package/dist/cjs/HeadingUppercase/HeadingUppercase.js +2 -2
- package/dist/cjs/HelperDrawer/HelperDrawer.js +1 -1
- package/dist/cjs/Highlight/Highlight.js +11 -5
- package/dist/cjs/Icon/Status.js +4 -4
- package/dist/cjs/Input/InputBox.js +1 -1
- package/dist/cjs/List/ListItem.js +1 -1
- package/dist/cjs/Menu/Heading.js +1 -0
- package/dist/cjs/Modal/Modal.test.js +156 -0
- package/dist/cjs/Pagination/Pagination.js +4 -2
- package/dist/cjs/Popover/Popover.js +4 -0
- package/dist/cjs/Popover/Popover.test.js +65 -0
- package/dist/cjs/Popover/rewireTabOrder.js +13 -30
- package/dist/cjs/Progress/Progress.js +12 -6
- package/dist/cjs/Radio/Radio.js +2 -2
- package/dist/cjs/RangeSlider/RangeSlider.js +10 -4
- package/dist/cjs/Scrim/Scrim.js +2 -2
- package/dist/cjs/Section/Section.js +14 -6
- package/dist/cjs/Select/Option.js +1 -1
- package/dist/cjs/Select/Select.js +10 -1
- package/dist/cjs/Sidebar/Sidebar.js +4 -3
- package/dist/cjs/Sortable/SortableItem.js +1 -1
- package/dist/cjs/StackView/StackView.js +5 -5
- package/dist/cjs/StepperField/StepperField.js +9 -6
- package/dist/cjs/StepperProgress/StepperProgress.js +9 -5
- package/dist/cjs/Table/ColumnPicker.js +1 -1
- package/dist/cjs/Table/DragHandle.js +1 -1
- package/dist/cjs/Table/NavigationArrow.js +1 -1
- package/dist/cjs/Table/SubRowToggleCell.js +1 -1
- package/dist/cjs/Table/Table.js +4 -6
- package/dist/cjs/Tabs/Tab.js +1 -0
- package/dist/cjs/ThemeProvider/ThemeProvider.js +5 -5
- package/dist/cjs/TileView/TileView.js +1 -1
- package/dist/cjs/TokenInput/DefaultToken.js +1 -1
- package/dist/cjs/Wizard/Wizard.js +2 -1
- package/dist/cjs/WrapView/WrapView.js +2 -27
- package/dist/cjs/hooks/use-accessibility-violation.js +1 -1
- package/dist/cjs/hooks/useConstant.js +23 -0
- package/dist/cjs/system/default-theme.js +8 -3
- package/dist/cjs/system/utils.js +2 -2
- package/dist/cjs/utils.js +3 -3
- package/dist/esm/ActionsDropdown/ActionsDropdown.js +3 -3
- package/dist/esm/Badge/Badge.js +42 -27
- package/dist/esm/Badge/Status.js +2 -2
- package/dist/esm/Calendar/Calendar.js +5 -3
- package/dist/esm/Card/Card.js +2 -3
- package/dist/esm/Checkbox/Checkbox.js +3 -3
- package/dist/esm/ChurchCenterStatus/ChurchCenterStatus.js +4 -4
- package/dist/esm/ColumnView/ColumnView.js +4 -2
- package/dist/esm/Combobox/ComboboxPopover.js +2 -2
- package/dist/esm/DataTable/components/CheckboxCell.js +4 -4
- package/dist/esm/DataTable/components/ColumnPicker.js +6 -5
- package/dist/esm/DataTable/hooks/useCollapsibleRows.js +1 -1
- package/dist/esm/DataTable/hooks/useColumnSort.js +1 -1
- package/dist/esm/DataTable/utils/getParsedColumns.js +4 -4
- package/dist/esm/DateField/DateField.js +1 -1
- package/dist/esm/Drawer/Drawer.js +3 -1
- package/dist/esm/Dropdown/Dropdown.js +1 -1
- package/dist/esm/Dropdown/Dropdown.test.js +158 -17
- package/dist/esm/Dropdown/Link.js +3 -1
- package/dist/esm/EditActions/EditActions.js +8 -3
- package/dist/esm/FieldSet/FieldSet.js +22 -10
- package/dist/esm/FilterLayout/FilterLayout.js +2 -1
- package/dist/esm/Form/Form.js +1 -1
- package/dist/esm/GridView/GridView.js +5 -4
- package/dist/esm/Group/Group.js +10 -3
- package/dist/esm/HeadingUppercase/HeadingUppercase.js +3 -3
- package/dist/esm/HelperDrawer/HelperDrawer.js +1 -1
- package/dist/esm/Highlight/Highlight.js +9 -5
- package/dist/esm/Icon/Status.js +4 -4
- package/dist/esm/Input/InputBox.js +1 -1
- package/dist/esm/List/ListItem.js +1 -1
- package/dist/esm/Menu/Heading.js +1 -0
- package/dist/esm/Modal/Modal.test.js +122 -0
- package/dist/esm/Pagination/Pagination.js +4 -2
- package/dist/esm/Popover/Popover.js +4 -0
- package/dist/esm/Popover/Popover.test.js +51 -0
- package/dist/esm/Popover/rewireTabOrder.js +13 -33
- package/dist/esm/Progress/Progress.js +10 -6
- package/dist/esm/Radio/Radio.js +2 -2
- package/dist/esm/RangeSlider/RangeSlider.js +8 -4
- package/dist/esm/Scrim/Scrim.js +2 -2
- package/dist/esm/Section/Section.js +12 -6
- package/dist/esm/Select/Option.js +1 -1
- package/dist/esm/Select/Select.js +10 -1
- package/dist/esm/Sidebar/Sidebar.js +4 -2
- package/dist/esm/Sortable/SortableItem.js +1 -1
- package/dist/esm/StackView/StackView.js +4 -5
- package/dist/esm/StepperField/StepperField.js +10 -7
- package/dist/esm/StepperProgress/StepperProgress.js +8 -5
- package/dist/esm/Table/ColumnPicker.js +1 -1
- package/dist/esm/Table/DragHandle.js +1 -1
- package/dist/esm/Table/NavigationArrow.js +1 -1
- package/dist/esm/Table/SubRowToggleCell.js +1 -1
- package/dist/esm/Table/Table.js +2 -3
- package/dist/esm/Tabs/Tab.js +1 -0
- package/dist/esm/ThemeProvider/ThemeProvider.js +1 -1
- package/dist/esm/TileView/TileView.js +1 -1
- package/dist/esm/TokenInput/DefaultToken.js +1 -1
- package/dist/esm/Wizard/Wizard.js +2 -1
- package/dist/esm/WrapView/WrapView.js +2 -28
- package/dist/esm/hooks/use-accessibility-violation.js +1 -1
- package/dist/esm/hooks/useConstant.js +15 -0
- package/dist/esm/system/default-theme.js +6 -2
- package/dist/esm/system/utils.js +1 -1
- package/dist/esm/utils.js +3 -3
- package/dist/types/Alert/Alert.d.ts +3 -0
- package/dist/types/Box/Box.d.ts +11 -2
- package/dist/types/Button/Button.d.ts +9 -1
- package/dist/types/Button/Input.d.ts +1 -1
- package/dist/types/Card/Card.d.ts +8 -1
- package/dist/types/Dropdown/Dropdown.test.d.ts +1 -1
- package/dist/types/GridView/GridView.d.ts +16 -4
- package/dist/types/Group/Group.d.ts +5 -1
- package/dist/types/Modal/Modal.test.d.ts +1 -0
- package/dist/types/Popover/Popover.test.d.ts +1 -0
- package/dist/types/Scrim/Scrim.d.ts +6 -1
- package/dist/types/StackView/StackView.d.ts +11 -0
- package/dist/types/Text/Text.d.ts +12 -0
- package/dist/types/TileView/TileView.d.ts +15 -7
- package/dist/types/WrapView/WrapView.d.ts +2 -1
- package/dist/types/hooks/useConstant.d.ts +1 -0
- package/package.json +16 -24
- package/src/ActionsDropdown/ActionsDropdown.tsx +3 -3
- package/src/Alert/Alert.mdx +1 -0
- package/src/Alert/Alert.tsx +5 -0
- package/src/Avatar/Avatar.mdx +1 -0
- package/src/Badge/Badge.js +66 -25
- package/src/Badge/Badge.mdx +2 -1
- package/src/Badge/Status.js +2 -2
- package/src/Badge/Status.mdx +1 -0
- package/src/Box/Box.mdx +2 -1
- package/src/Box/Box.tsx +13 -2
- package/src/Button/Button.mdx +4 -3
- package/src/Button/Button.tsx +11 -0
- package/src/Button/Input.mdx +2 -2
- package/src/Calendar/Calendar.js +8 -3
- package/src/Calendar/Calendar.mdx +1 -0
- package/src/Card/Card.mdx +1 -0
- package/src/Card/Card.tsx +7 -1
- package/src/Checkbox/Checkbox.js +8 -3
- package/src/Checkbox/Checkbox.mdx +1 -0
- package/src/CheckboxCard/CheckboxCard.js +26 -1
- package/src/CheckboxCard/CheckboxCard.mdx +1 -0
- package/src/CheckboxGroup/CheckboxGroup.js +6 -0
- package/src/CheckboxGroup/CheckboxGroup.mdx +1 -0
- package/src/ChurchCenterStatus/ChurchCenterStatus.mdx +1 -0
- package/src/ChurchCenterStatus/ChurchCenterStatus.tsx +4 -4
- package/src/Collapse/Collapse.js +2 -0
- package/src/ColumnView/ColumnView.js +7 -3
- package/src/ColumnView/ColumnView.mdx +1 -0
- package/src/Combobox/Combobox.js +11 -1
- package/src/Combobox/Combobox.mdx +2 -1
- package/src/Combobox/ComboboxPopover.js +2 -2
- package/src/DataTable/DataTable.js +48 -0
- package/src/DataTable/DataTable.mdx +2 -2
- package/src/DataTable/components/CheckboxCell.js +5 -4
- package/src/DataTable/components/ColumnPicker.js +4 -4
- package/src/DataTable/hooks/useCollapsibleRows.js +1 -1
- package/src/DataTable/hooks/useColumnSort.js +1 -1
- package/src/DataTable/utils/getParsedColumns.js +4 -4
- package/src/DateField/DateField.js +11 -1
- package/src/DateField/DateField.mdx +1 -0
- package/src/Divider/Divider.mdx +1 -0
- package/src/DragDrop/DragDrop.mdx +23 -9
- package/src/Drawer/Drawer.js +3 -0
- package/src/Drawer/Drawer.mdx +2 -1
- package/src/Dropdown/Dropdown.js +49 -3
- package/src/Dropdown/Dropdown.mdx +3 -2
- package/src/Dropdown/Dropdown.test.tsx +128 -17
- package/src/Dropdown/Link.js +3 -1
- package/src/EditActions/EditActions.js +18 -3
- package/src/EditActions/EditActions.mdx +1 -0
- package/src/Field/Field.js +15 -0
- package/src/Field/Field.mdx +1 -0
- package/src/FieldSet/FieldSet.js +35 -11
- package/src/FieldSet/FieldSet.mdx +1 -0
- package/src/FilterLayout/FilterLayout.mdx +1 -0
- package/src/FilterLayout/FilterLayout.tsx +4 -1
- package/src/Form/Form.js +1 -1
- package/src/Form/Form.mdx +26 -24
- package/src/GridView/GridView.mdx +2 -1
- package/src/GridView/GridView.tsx +27 -8
- package/src/Group/Group.mdx +8 -7
- package/src/Group/Group.tsx +12 -1
- package/src/Heading/Heading.js +6 -2
- package/src/Heading/Heading.mdx +1 -0
- package/src/HeadingUppercase/HeadingUppercase.js +9 -5
- package/src/HeadingUppercase/HeadingUppercase.mdx +1 -0
- package/src/HelperDrawer/HelperDrawer.js +10 -2
- package/src/HelperDrawer/HelperDrawer.mdx +1 -0
- package/src/Highlight/Highlight.js +6 -2
- package/src/Highlight/Highlight.mdx +1 -0
- package/src/Icon/Icon.js +6 -0
- package/src/Icon/Icon.mdx +42 -37
- package/src/Icon/Status.js +4 -4
- package/src/Input/Inline.js +11 -1
- package/src/Input/Inline.mdx +2 -1
- package/src/Input/Input.js +119 -1
- package/src/Input/Input.mdx +1 -6
- package/src/Input/InputBox.js +41 -1
- package/src/Input/InputBox.mdx +1 -0
- package/src/Input/InputField.js +32 -0
- package/src/Input/InputField.mdx +1 -0
- package/src/Input/InputLabel.mdx +1 -0
- package/src/Link/Link.js +10 -0
- package/src/Link/Link.mdx +2 -1
- package/src/LinkList/LinkList.js +7 -1
- package/src/LinkList/LinkList.mdx +1 -0
- package/src/List/List.js +25 -1
- package/src/List/List.mdx +1 -0
- package/src/List/ListItem.js +1 -1
- package/src/Logo/Logo.js +10 -1
- package/src/Logo/Logo.mdx +1 -0
- package/src/Menu/Heading.js +1 -0
- package/src/Menu/Menu.js +7 -1
- package/src/Menu/Menu.mdx +2 -1
- package/src/Modal/Modal.js +1 -0
- package/src/Modal/Modal.mdx +1 -0
- package/src/Modal/Modal.test.tsx +113 -0
- package/src/NumberField/NumberField.js +19 -0
- package/src/Page/Page.mdx +1 -1
- package/src/PagerView/PagerView.js +1 -0
- package/src/PagerView/PagerView.mdx +9 -8
- package/src/Pagination/Pagination.js +2 -2
- package/src/Pagination/Pagination.mdx +1 -0
- package/src/Popover/Popover.test.tsx +62 -0
- package/src/Popover/Popover.tsx +3 -0
- package/src/Popover/rewireTabOrder.ts +24 -42
- package/src/Progress/Progress.js +8 -3
- package/src/Progress/Progress.mdx +1 -0
- package/src/Radio/Radio.js +4 -2
- package/src/Radio/Radio.mdx +1 -0
- package/src/RangeSlider/RangeSlider.js +11 -2
- package/src/RangeSlider/RangeSlider.mdx +13 -10
- package/src/ScreenReader/ScreenReader.js +6 -1
- package/src/ScreenReader/ScreenReader.mdx +1 -0
- package/src/Scrim/Scrim.mdx +1 -0
- package/src/Scrim/Scrim.tsx +8 -2
- package/src/Section/Section.js +15 -3
- package/src/Section/Section.mdx +1 -0
- package/src/SegmentedControl/SegmentedControl.mdx +3 -2
- package/src/SegmentedTabs/SegmentedTabs.js +2 -0
- package/src/SegmentedTabs/SegmentedTabs.mdx +1 -0
- package/src/Select/Option.js +1 -1
- package/src/Select/Select.js +69 -2
- package/src/Select/Select.mdx +1 -0
- package/src/Sidebar/Sidebar.js +14 -6
- package/src/Sidebar/Sidebar.mdx +1 -0
- package/src/Sortable/SortableItem.js +1 -1
- package/src/Spinner/Spinner.mdx +1 -0
- package/src/StackView/StackView.mdx +17 -1
- package/src/StackView/StackView.tsx +23 -8
- package/src/StepperField/StepperField.js +35 -6
- package/src/StepperField/StepperField.mdx +2 -2
- package/src/StepperProgress/StepperProgress.js +9 -10
- package/src/StepperProgress/StepperProgress.mdx +1 -0
- package/src/Summary/Summary.mdx +1 -0
- package/src/Tab/Tab.mdx +1 -0
- package/src/Table/ColumnPicker.js +1 -1
- package/src/Table/DragHandle.js +1 -1
- package/src/Table/NavigationArrow.js +1 -1
- package/src/Table/SubRowToggleCell.js +1 -1
- package/src/Table/Table.js +2 -3
- package/src/Table/Table.mdx +2 -2
- package/src/Tabs/Tab.js +1 -0
- package/src/Tabs/Tabs.js +5 -0
- package/src/Tabs/Tabs.mdx +1 -0
- package/src/Text/Text.mdx +1 -0
- package/src/Text/Text.tsx +12 -0
- package/src/TextArea/TextArea.js +7 -1
- package/src/TextArea/TextArea.mdx +1 -0
- package/src/ThemeProvider/ThemeProvider.tsx +1 -1
- package/src/TileView/TileView.mdx +1 -0
- package/src/TileView/TileView.tsx +17 -3
- package/src/TimeField/TimeField.mdx +1 -0
- package/src/TokenInput/DefaultToken.js +1 -1
- package/src/TokenInput/TokenInput.js +12 -6
- package/src/TokenInput/TokenInput.mdx +1 -0
- package/src/Toolbar/Toolbar.mdx +1 -0
- package/src/Tooltip/Tooltip.js +39 -0
- package/src/Tooltip/Tooltip.mdx +4 -3
- package/src/Wizard/Wizard.js +1 -1
- package/src/Wizard/Wizard.mdx +7 -2
- package/src/WrapView/WrapView.mdx +1 -0
- package/src/WrapView/WrapView.tsx +6 -28
- package/src/hooks/use-accessibility-violation.tsx +1 -1
- package/src/hooks/useConstant.ts +17 -0
- package/src/system/default-theme.ts +7 -2
- package/src/system/utils.js +1 -1
- package/src/utils.js +3 -3
- package/src/utils.test.js +29 -0
- package/dist/cjs/icons.js +0 -126
- package/dist/esm/icons.js +0 -121
- package/src/icons.js +0 -121
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from 'react'
|
|
2
3
|
|
|
3
4
|
import Text from '../Text'
|
|
4
|
-
import {
|
|
5
|
+
import { useThemeProps } from '../system'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
type Props = {
|
|
8
|
+
children?: any,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function HeadingUppercase({ children, ...restProps }: Props) {
|
|
12
|
+
const themeProps = useThemeProps('HeadingUppercase', restProps)
|
|
8
13
|
return (
|
|
9
14
|
<Text
|
|
10
15
|
as="span"
|
|
@@ -15,8 +20,7 @@ function HeadingUppercase({ children, ...restProps }) {
|
|
|
15
20
|
color="foregroundSecondary"
|
|
16
21
|
shrink={0}
|
|
17
22
|
margin={0}
|
|
18
|
-
{...
|
|
19
|
-
{...restProps}
|
|
23
|
+
{...themeProps}
|
|
20
24
|
>
|
|
21
25
|
{children}
|
|
22
26
|
</Text>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
/** @jsxRuntime classic */
|
|
2
3
|
/** @jsx jsx */
|
|
3
4
|
import { jsx } from '@emotion/core'
|
|
@@ -22,7 +23,7 @@ function Toggle({ drawerId, ...restProps }) {
|
|
|
22
23
|
)
|
|
23
24
|
return (
|
|
24
25
|
<Button
|
|
25
|
-
icon={{ name: '
|
|
26
|
+
icon={{ name: 'general.outlinedInfoCircle' }}
|
|
26
27
|
tooltip={{ title: 'More info' }}
|
|
27
28
|
size="xs"
|
|
28
29
|
theme={false}
|
|
@@ -35,7 +36,14 @@ function Toggle({ drawerId, ...restProps }) {
|
|
|
35
36
|
)
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
type Props = {
|
|
40
|
+
children?: any,
|
|
41
|
+
|
|
42
|
+
/** Used by the `HelperDrawer.Toggle` to connect to. */
|
|
43
|
+
id?: string | number,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function HelperDrawer({ children, id, ...restProps }: Props) {
|
|
39
47
|
const [open, setOpen] = useState(false)
|
|
40
48
|
useEffect(() => {
|
|
41
49
|
drawerToggles[id] = () => setOpen((open) => !open)
|
|
@@ -3,6 +3,7 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
import Text from '../Text'
|
|
5
5
|
|
|
6
|
+
import { useThemeProps } from '../system'
|
|
6
7
|
import { markFuzzyMatchSubstring, markStartsWithMatchSubstring } from './utils'
|
|
7
8
|
|
|
8
9
|
type Props = {
|
|
@@ -31,14 +32,17 @@ type Props = {
|
|
|
31
32
|
* Highlight or mark letters in a string using a provided query.
|
|
32
33
|
*/
|
|
33
34
|
function Highlight({
|
|
34
|
-
color = 'primary',
|
|
35
35
|
marker = markStartsWithMatchSubstring,
|
|
36
36
|
query,
|
|
37
37
|
text,
|
|
38
38
|
...restProps
|
|
39
39
|
}: Props) {
|
|
40
|
+
const { color = 'primary', ...themeProps } = useThemeProps(
|
|
41
|
+
'highlight',
|
|
42
|
+
restProps
|
|
43
|
+
)
|
|
40
44
|
return (
|
|
41
|
-
<Text as="span" {...
|
|
45
|
+
<Text as="span" {...themeProps}>
|
|
42
46
|
{marker(text, query).map((part, index) => (
|
|
43
47
|
<Text
|
|
44
48
|
key={index}
|
package/src/Icon/Icon.js
CHANGED
|
@@ -15,6 +15,12 @@ const sizes = {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
type Props = {
|
|
18
|
+
/** Accepts the `Icon.Path` component if a `name` is not provided. */
|
|
19
|
+
children?: React.ReactNode,
|
|
20
|
+
|
|
21
|
+
/** Render custom component or HTML element tag. */
|
|
22
|
+
as?: any,
|
|
23
|
+
|
|
18
24
|
/** The name of the icon to render. */
|
|
19
25
|
name: string,
|
|
20
26
|
|
package/src/Icon/Icon.mdx
CHANGED
|
@@ -2,53 +2,58 @@
|
|
|
2
2
|
title: Icon
|
|
3
3
|
category: Primitives
|
|
4
4
|
summary: Icons are used to help visually communicate actions and information to the end user.
|
|
5
|
+
propsSummary: Accepts [Box](/box) props.
|
|
5
6
|
order: 3
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
## Single icon sets
|
|
9
10
|
|
|
11
|
+
By default, components have access to the `general` icon set. Additional icon groups can be imported through your app's ThemeProvider.
|
|
12
|
+
|
|
13
|
+
Example usage: `general.iconNameCamelCase`
|
|
14
|
+
|
|
10
15
|
```jsx live
|
|
11
16
|
render(() => {
|
|
12
17
|
const [value, setValue] = React.useState('')
|
|
13
|
-
const [appName, setAppName] = React.useState(
|
|
14
|
-
|
|
15
|
-
const iconsToRender = appName ? icons[appName] : defaultIcons
|
|
18
|
+
const [appName, setAppName] = React.useState('general')
|
|
19
|
+
|
|
16
20
|
return (
|
|
17
|
-
<
|
|
18
|
-
<StackView
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
</
|
|
48
|
-
|
|
21
|
+
<ThemeProvider theme={{ icons }}>
|
|
22
|
+
<StackView grow={1}>
|
|
23
|
+
<StackView axis="horizontal" spacing={2}>
|
|
24
|
+
<Select
|
|
25
|
+
basis={26}
|
|
26
|
+
emptyValue="Choose icon set"
|
|
27
|
+
onChange={(event) => setAppName(event.value)}
|
|
28
|
+
defaultValue={appName}
|
|
29
|
+
>
|
|
30
|
+
{appNames.map((appName) => (
|
|
31
|
+
<Select.Option key={appName} value={appName}>
|
|
32
|
+
{appName}
|
|
33
|
+
</Select.Option>
|
|
34
|
+
))}
|
|
35
|
+
</Select>
|
|
36
|
+
<Input
|
|
37
|
+
grow={1}
|
|
38
|
+
autoFocus
|
|
39
|
+
renderLeft={<Icon name="general.search" />}
|
|
40
|
+
placeholder="Search by icon name"
|
|
41
|
+
value={value}
|
|
42
|
+
onChange={(e) => setValue(e.target.value)}
|
|
43
|
+
/>
|
|
44
|
+
</StackView>
|
|
45
|
+
<TileView minCellWidth={16} spacing={4} margin={4}>
|
|
46
|
+
{matchSorter(Object.keys(icons[appName]), value).map((iconName) => (
|
|
47
|
+
<StackView key={iconName} alignment="center" spacing={1}>
|
|
48
|
+
<Icon key={iconName} name={`${appName}.${iconName}`} size="xl" />
|
|
49
|
+
<Text fontSize={5} color="foregroundSecondary">
|
|
50
|
+
{iconName}
|
|
51
|
+
</Text>
|
|
52
|
+
</StackView>
|
|
53
|
+
))}
|
|
49
54
|
</TileView>
|
|
50
|
-
</
|
|
51
|
-
</
|
|
55
|
+
</StackView>
|
|
56
|
+
</ThemeProvider>
|
|
52
57
|
)
|
|
53
58
|
})
|
|
54
59
|
```
|
package/src/Icon/Status.js
CHANGED
|
@@ -5,9 +5,9 @@ import Icon from './Icon'
|
|
|
5
5
|
import Path from './Path'
|
|
6
6
|
|
|
7
7
|
const STATUS_VARIANTS = {
|
|
8
|
-
confirmed: ['
|
|
9
|
-
unconfirmed: ['
|
|
10
|
-
declined: ['
|
|
8
|
+
confirmed: ['general.outlinedCircleCheck', 'success'],
|
|
9
|
+
unconfirmed: ['general.outlinedQuestionCircle', 'warning'],
|
|
10
|
+
declined: ['general.outlinedXCircle', 'error'],
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export type Props = {
|
|
@@ -33,7 +33,7 @@ function Status(props: Props) {
|
|
|
33
33
|
}
|
|
34
34
|
return (
|
|
35
35
|
<Icon name={variantName} color={color || variantColor} {...restProps}>
|
|
36
|
-
<Path name="
|
|
36
|
+
<Path name="tapestry.radio0" color={color} />
|
|
37
37
|
</Icon>
|
|
38
38
|
)
|
|
39
39
|
}
|
package/src/Input/Inline.js
CHANGED
|
@@ -4,8 +4,18 @@ import React from 'react'
|
|
|
4
4
|
import InputField from './InputField'
|
|
5
5
|
|
|
6
6
|
type Props = {
|
|
7
|
-
/** Controls the color when hovered and focused. */
|
|
7
|
+
/** Controls the color when hovered and focused. (Defaults `light ? 'light-0' : 'highlight'` */
|
|
8
8
|
highlightColor: string,
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Pass styles for when the input is focused.
|
|
12
|
+
*/
|
|
13
|
+
focus?: boolean,
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Sets `backgroundColor: highlightColor` if `readOnly` or `disabled` are not set.
|
|
17
|
+
*/
|
|
18
|
+
hover?: boolean,
|
|
9
19
|
}
|
|
10
20
|
|
|
11
21
|
function Inline({
|
package/src/Input/Inline.mdx
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
title: Input.Inline
|
|
3
3
|
category: Forms
|
|
4
4
|
summary: Composes [Input.InputField](/input.inputfield) with minimal styling.
|
|
5
|
+
propsSummary: Accepts props for [Input.InputField](/input.inputfield).
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
```jsx live
|
|
@@ -25,7 +26,7 @@ function App() {
|
|
|
25
26
|
backgroundColor="surfaceTertiary"
|
|
26
27
|
overflow="auto"
|
|
27
28
|
>
|
|
28
|
-
<Icon name="person" size="xl" />
|
|
29
|
+
<Icon name="general.person" size="xl" />
|
|
29
30
|
<Input.Inline
|
|
30
31
|
highlightColor="dark-1"
|
|
31
32
|
size="xl"
|
package/src/Input/Input.js
CHANGED
|
@@ -1,9 +1,127 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React, { Component } from 'react'
|
|
2
3
|
|
|
3
4
|
import InputBox from './InputBox'
|
|
4
5
|
import InputField from './InputField'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
type InputProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Names the input and required to submit the input's `value`.
|
|
10
|
+
*/
|
|
11
|
+
name: string,
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Used to identify an input.
|
|
15
|
+
*/
|
|
16
|
+
id?: string | number,
|
|
17
|
+
|
|
18
|
+
/** Specifies the type of form control to render. [Learn more on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types) */
|
|
19
|
+
type?: string,
|
|
20
|
+
|
|
21
|
+
/** Provides an initial value to the input. */
|
|
22
|
+
defaultValue?: string,
|
|
23
|
+
|
|
24
|
+
/** User provided value that is passed to input. */
|
|
25
|
+
value?: string,
|
|
26
|
+
|
|
27
|
+
placeholder?: string,
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Disables the input.
|
|
31
|
+
*/
|
|
32
|
+
disabled?: boolean,
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Prevents the user from editing the input, but still submits and receives focus.
|
|
36
|
+
*/
|
|
37
|
+
readOnly: boolean,
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Sets the input's width to the exact size of the text plus padding and cursor.
|
|
41
|
+
* Allows a string to be passed for measuring if input value is different from displayed value.
|
|
42
|
+
*/
|
|
43
|
+
autoWidth?: boolean | number | string,
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Accepts "on" or "off" values. [Learn more on MDN.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
|
|
47
|
+
*/
|
|
48
|
+
autoComplete?: string,
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Input will receive focus on page load. (Limit to one per page.)
|
|
52
|
+
*/
|
|
53
|
+
autoFocus?: boolean,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Pass styles for when the input is focused.
|
|
57
|
+
*/
|
|
58
|
+
focus?: object,
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Pass styles for when the input is hovered.
|
|
62
|
+
*/
|
|
63
|
+
hover?: object,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Defines the minimum value that is acceptable and valid for the input. [Learn more on MDN.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/min)
|
|
67
|
+
*/
|
|
68
|
+
min?: string,
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Defines the maximum value that is acceptable and valid for the input. [Learn more on MDN.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/max)
|
|
72
|
+
*/
|
|
73
|
+
max?: string,
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* defines the maximum number of characters the input will accept. [Learn more on MDN.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/minlength)
|
|
77
|
+
*/
|
|
78
|
+
minLength?: string,
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* defines the maximum number of characters the input will accept. [Learn more on MDN.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/maxlength)
|
|
82
|
+
*/
|
|
83
|
+
maxLength?: string,
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Maps to the internal input's `onChange` prop.
|
|
87
|
+
*/
|
|
88
|
+
onChange?: () => null,
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Maps to the internal input's `onFocus` prop.
|
|
92
|
+
*/
|
|
93
|
+
onFocus?: () => null,
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Maps to the internal input's `onBlur` prop.
|
|
97
|
+
*/
|
|
98
|
+
onBlur?: () => null,
|
|
99
|
+
|
|
100
|
+
onKeyDown?: Funtion,
|
|
101
|
+
onKeyUp?: Funtion,
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Forces the input text to stay fully selected while interacting with it.
|
|
105
|
+
*/
|
|
106
|
+
highlightOnInteraction?: boolean,
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Changes background color of the input. Both [theme colors](/colors) and html values are supported.
|
|
110
|
+
*/
|
|
111
|
+
backgroundColor?: string,
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Changes color of the input's value. Both [theme colors](/colors) and html values are supported.
|
|
115
|
+
*/
|
|
116
|
+
color?: string,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Changes color of the input's placeholder text. Both [theme colors](/colors) and html values are supported.
|
|
120
|
+
*/
|
|
121
|
+
placeholderColor?: string,
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
class Input extends Component<InputProps> {
|
|
7
125
|
setInputNode = (node) => {
|
|
8
126
|
this.inputNode = node
|
|
9
127
|
}
|
package/src/Input/Input.mdx
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
title: Input
|
|
3
3
|
category: Forms
|
|
4
4
|
summary: Composes [Input.InputBox](/input.inputbox) and [Input.InputField](/input.inputfield).
|
|
5
|
+
propsSummary: Accepts props for [Input.InputBox](/input.inputbox) _and_ [Input.InputField](/input.inputfield), remaining props are forwarded to `Input.InputBox`.
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
```jsx live
|
|
@@ -25,9 +26,3 @@ render(() => (
|
|
|
25
26
|
</GridView>
|
|
26
27
|
))
|
|
27
28
|
```
|
|
28
|
-
|
|
29
|
-
## Props
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
Accepts props for [Input.InputBox](/input.inputbox) _and_ [Input.InputField](/input.inputfield), remaining props are forwarded to `Input.InputBox`.
|
package/src/Input/InputBox.js
CHANGED
|
@@ -25,6 +25,21 @@ export type InputBoxProps = {
|
|
|
25
25
|
*/
|
|
26
26
|
evenPadding?: boolean,
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Gain access to the internal ref
|
|
30
|
+
*/
|
|
31
|
+
innerRef?: any,
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Used to identify an input.
|
|
35
|
+
*/
|
|
36
|
+
id?: string | number,
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Typically accepts a form control like `input` or [Input.InputField](/input.inputfield).
|
|
40
|
+
*/
|
|
41
|
+
children?: any,
|
|
42
|
+
|
|
28
43
|
/**
|
|
29
44
|
* Which child index should be focused when the focus method is called.
|
|
30
45
|
*/
|
|
@@ -59,6 +74,16 @@ export type InputBoxProps = {
|
|
|
59
74
|
*/
|
|
60
75
|
onClear?: () => void,
|
|
61
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Maps to the internal input's `onFocus` prop.
|
|
79
|
+
*/
|
|
80
|
+
onFocus?: () => null,
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Maps to the internal input's `onBlur` prop.
|
|
84
|
+
*/
|
|
85
|
+
onBlur?: () => null,
|
|
86
|
+
|
|
62
87
|
/**
|
|
63
88
|
* Allows rendering any content inside the beginning of the input box.
|
|
64
89
|
*/
|
|
@@ -80,10 +105,25 @@ export type InputBoxProps = {
|
|
|
80
105
|
*/
|
|
81
106
|
state?: 'error' | 'success',
|
|
82
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Determines where in the tab order the input should be placed for focused. (Defaults to `-1`).
|
|
110
|
+
*/
|
|
111
|
+
tabIndex?: number,
|
|
112
|
+
|
|
83
113
|
/**
|
|
84
114
|
* Applies subdued styling when using `InputBox` as a secondary element.
|
|
85
115
|
*/
|
|
86
116
|
subdued?: boolean,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Applies dropshadow while focusing on an input. (Defaults to `true`).
|
|
120
|
+
*/
|
|
121
|
+
secondaryStroke?: boolean,
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Changes background color of the input. Both [theme colors](/colors) and html values are supported.
|
|
125
|
+
*/
|
|
126
|
+
backgroundColor?: string,
|
|
87
127
|
}
|
|
88
128
|
|
|
89
129
|
// temporary until InputBox is converted to a functional component
|
|
@@ -379,7 +419,7 @@ class InputBox extends Component<InputBoxProps> {
|
|
|
379
419
|
<Spinner size={size} />
|
|
380
420
|
) : onClear ? (
|
|
381
421
|
<Button
|
|
382
|
-
icon={{ name: '
|
|
422
|
+
icon={{ name: 'general.x' }}
|
|
383
423
|
title="clear input value"
|
|
384
424
|
size={size}
|
|
385
425
|
theme={false}
|
package/src/Input/InputBox.mdx
CHANGED
package/src/Input/InputField.js
CHANGED
|
@@ -32,6 +32,11 @@ const resetStyles = {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export type InputFieldProps = {
|
|
35
|
+
/**
|
|
36
|
+
* Gain access to the internal ref
|
|
37
|
+
*/
|
|
38
|
+
innerRef?: any,
|
|
39
|
+
|
|
35
40
|
/**
|
|
36
41
|
* Sets the input's width to the exact size of the text plus padding and cursor.
|
|
37
42
|
* Allows a string to be passed for measuring if input value is different from displayed value.
|
|
@@ -57,6 +62,33 @@ export type InputFieldProps = {
|
|
|
57
62
|
* Size of the input font-size, and line-height. Based on [theming sizes](/theming#boxsizes).
|
|
58
63
|
*/
|
|
59
64
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl',
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Pass styles to base Box component.
|
|
68
|
+
*/
|
|
69
|
+
size?: object,
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Disables the input.
|
|
73
|
+
*/
|
|
74
|
+
disabled?: boolean,
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Maps to the input's `onChange` prop.
|
|
78
|
+
*/
|
|
79
|
+
onChange?: () => null,
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Maps to the input's `onFocus` prop.
|
|
83
|
+
*/
|
|
84
|
+
onFocus?: () => null,
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Maps to the input's `onBlur` prop.
|
|
88
|
+
*/
|
|
89
|
+
onBlur?: () => null,
|
|
90
|
+
|
|
91
|
+
onKeyDown?: Funtion,
|
|
60
92
|
}
|
|
61
93
|
|
|
62
94
|
class InputField extends Component<InputFieldProps> {
|
package/src/Input/InputField.mdx
CHANGED
package/src/Input/InputLabel.mdx
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
title: Input.InputLabel
|
|
3
3
|
category: Forms
|
|
4
4
|
summary: Provides accessibility as well as usability improvements for mouse users by allowing the user to click the <InputLabel/> component to focus the respective control. This mimics the browsers native label tag, but allows use with custom components like <Select/>.
|
|
5
|
+
propsSummary: Accepts [Text](/text) props.
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
```jsx live
|
package/src/Link/Link.js
CHANGED
|
@@ -23,6 +23,16 @@ type Props = {
|
|
|
23
23
|
* Show an underline when hovering link. Defaults to `true`.
|
|
24
24
|
*/
|
|
25
25
|
underline: boolean,
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Accepts hover styles.
|
|
29
|
+
*/
|
|
30
|
+
hover?: object,
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Accepts hover styles.
|
|
34
|
+
*/
|
|
35
|
+
focus?: object,
|
|
26
36
|
}
|
|
27
37
|
|
|
28
38
|
function Link({
|
package/src/Link/Link.mdx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Link
|
|
3
3
|
category: General
|
|
4
|
+
propsSummary: Accepts [Text](/text) props.
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
```jsx live
|
|
@@ -18,7 +19,7 @@ render(
|
|
|
18
19
|
alignment="center"
|
|
19
20
|
padding={1}
|
|
20
21
|
backgroundColor="primary"
|
|
21
|
-
spacing={<Icon name="
|
|
22
|
+
spacing={<Icon name="general.rightChevron" size="xs" color="white" marginHorizontal={0.5} />}
|
|
22
23
|
>
|
|
23
24
|
<Link to="#" color="white">
|
|
24
25
|
First Church Of Carlsbad
|
package/src/LinkList/LinkList.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from 'react'
|
|
2
3
|
|
|
3
4
|
import Divider from '../Divider'
|
|
4
5
|
import Link from '../Link'
|
|
5
6
|
import StackView from '../StackView'
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
type Props = {
|
|
9
|
+
/** Accepts an array of objects that specify the `name` and `url` for each link. */
|
|
10
|
+
links?: array,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function LinkList({ links, ...restProps }: Props) {
|
|
8
14
|
return (
|
|
9
15
|
<StackView
|
|
10
16
|
axis="horizontal"
|