@planningcenter/tapestry-react 1.4.0 → 2.0.0-rc.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/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/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 +8 -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/Pagination/Pagination.js +4 -2
- 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 +1 -1
- 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 +1 -1
- package/dist/cjs/Tabs/Tab.js +1 -0
- 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/system/default-theme.js +8 -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/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/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 +8 -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/Pagination/Pagination.js +4 -2
- 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 +1 -1
- 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 +1 -1
- package/dist/esm/Tabs/Tab.js +1 -0
- 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/system/default-theme.js +6 -2
- 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/GridView/GridView.d.ts +16 -4
- 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/package.json +3 -2
- 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/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/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 +6 -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/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/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 +63 -2
- package/src/Select/Select.mdx +1 -0
- package/src/Sidebar/Sidebar.js +7 -1
- 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 +1 -1
- 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/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/system/default-theme.ts +7 -2
- package/dist/cjs/icons.js +0 -126
- package/dist/esm/icons.js +0 -121
- package/src/icons.js +0 -121
|
@@ -46,6 +46,16 @@ export type DateFieldProps = {
|
|
|
46
46
|
*/
|
|
47
47
|
value: Date,
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Locks external scrollbars when open.
|
|
51
|
+
*/
|
|
52
|
+
lockScrollWhileOpen?: boolean,
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Attempts to keep popover in view clipping edges if too large.
|
|
56
|
+
*/
|
|
57
|
+
keepInView?: boolean,
|
|
58
|
+
|
|
49
59
|
/**
|
|
50
60
|
* Accepts any valid [Popover](/popover) props.
|
|
51
61
|
*/
|
|
@@ -140,7 +150,7 @@ class DateField extends Component<DateFieldProps> {
|
|
|
140
150
|
readOnly
|
|
141
151
|
value={value ? format(value, formatValue) : ''}
|
|
142
152
|
renderRight={
|
|
143
|
-
<Icon name="calendar" color="foregroundTertiary" />
|
|
153
|
+
<Icon name="general.calendar" color="foregroundTertiary" />
|
|
144
154
|
}
|
|
145
155
|
onClick={this.togglePopover}
|
|
146
156
|
onBlur={requestBlur}
|
package/src/Divider/Divider.mdx
CHANGED
|
@@ -6,12 +6,12 @@ summary: Custom components that wrap [react-beautiful-dnd](https://github.com/at
|
|
|
6
6
|
|
|
7
7
|
```jsx live
|
|
8
8
|
const navigationItems = [
|
|
9
|
-
{ icon: '
|
|
10
|
-
{ icon: 'person', name: 'Profile' },
|
|
11
|
-
{ icon: '
|
|
12
|
-
{ icon: '
|
|
13
|
-
{ icon: 'calendar', name: 'Events' },
|
|
14
|
-
{ icon: 'search', name: 'Search' },
|
|
9
|
+
{ icon: 'general.outlinedLocationPin', name: 'Home' },
|
|
10
|
+
{ icon: 'general.person', name: 'Profile' },
|
|
11
|
+
{ icon: 'general.checkCircle', name: 'Check-In' },
|
|
12
|
+
{ icon: 'general.twoPeople', name: 'Groups' },
|
|
13
|
+
{ icon: 'general.calendar', name: 'Events' },
|
|
14
|
+
{ icon: 'general.search', name: 'Search' },
|
|
15
15
|
]
|
|
16
16
|
function Item({
|
|
17
17
|
icon,
|
|
@@ -24,6 +24,20 @@ function Item({
|
|
|
24
24
|
...restProps
|
|
25
25
|
}) {
|
|
26
26
|
const { hover, hoverProps } = hooks.useHover()
|
|
27
|
+
|
|
28
|
+
const actions = {
|
|
29
|
+
add: {
|
|
30
|
+
icon: "general.plusCircle",
|
|
31
|
+
color: "success",
|
|
32
|
+
label: "Add",
|
|
33
|
+
},
|
|
34
|
+
remove: {
|
|
35
|
+
icon: "general.minusCircle",
|
|
36
|
+
color: "error",
|
|
37
|
+
label: "Remove",
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
27
41
|
return (
|
|
28
42
|
<Card
|
|
29
43
|
axis="horizontal"
|
|
@@ -40,10 +54,10 @@ function Item({
|
|
|
40
54
|
<Icon name={icon} color="grey-7" />
|
|
41
55
|
<Text grow={1}>{name}</Text>
|
|
42
56
|
<Button
|
|
43
|
-
title={type
|
|
57
|
+
title={actions.[type].label}
|
|
44
58
|
icon={{
|
|
45
|
-
name:
|
|
46
|
-
color: type
|
|
59
|
+
name: actions.[type].icon,
|
|
60
|
+
color: actions.[type].color,
|
|
47
61
|
}}
|
|
48
62
|
variant="naked"
|
|
49
63
|
opacity={hover && hoverEnabled ? 1 : 0}
|
package/src/Drawer/Drawer.js
CHANGED
|
@@ -8,8 +8,10 @@ import React, {
|
|
|
8
8
|
} from 'react'
|
|
9
9
|
|
|
10
10
|
import StackView from '../StackView'
|
|
11
|
+
import { useThemeValue } from '../system'
|
|
11
12
|
|
|
12
13
|
function DrawerContents({ shouldClose, onClose, ...restProps }) {
|
|
14
|
+
const themeProps = useThemeValue('drawer')
|
|
13
15
|
const ref = useRef(null)
|
|
14
16
|
const [show, setShow] = useState(false)
|
|
15
17
|
|
|
@@ -51,6 +53,7 @@ function DrawerContents({ shouldClose, onClose, ...restProps }) {
|
|
|
51
53
|
boxShadow="-6px 0px 6px -4px rgba(150,150,150,0.25)"
|
|
52
54
|
backgroundColor="surfaceTertiary"
|
|
53
55
|
transition="transform 240ms ease-out"
|
|
56
|
+
{...themeProps}
|
|
54
57
|
{...restProps}
|
|
55
58
|
/>
|
|
56
59
|
)
|
package/src/Drawer/Drawer.mdx
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
title: Drawer
|
|
3
3
|
category: General
|
|
4
4
|
summary: Use to add collapsible navigation items or content anchored to the right side of the screen.
|
|
5
|
+
propsSummary: Accepts [StackView](/stackview) props.
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
```jsx live
|
|
@@ -26,7 +27,7 @@ render(() => {
|
|
|
26
27
|
>
|
|
27
28
|
<Button
|
|
28
29
|
title="close drawer"
|
|
29
|
-
icon={{ name: '
|
|
30
|
+
icon={{ name: 'general.x', color: 'primary' }}
|
|
30
31
|
variant="naked"
|
|
31
32
|
onClick={() => setOpen(false)}
|
|
32
33
|
/>
|
package/src/Dropdown/Dropdown.js
CHANGED
|
@@ -12,21 +12,67 @@ import Item, { ITEM_DISPLAY_NAME } from './Item'
|
|
|
12
12
|
import Link, { LINK_DISPLAY_NAME, LINK_DATA } from './Link'
|
|
13
13
|
|
|
14
14
|
type Props = {
|
|
15
|
-
|
|
15
|
+
children?: React.ReactNode,
|
|
16
|
+
|
|
17
|
+
/** Allows specifying a type or custom element that will be cloned and provided `Dropdown` trigger props. (Defaults to a [Button](/button).) */
|
|
16
18
|
triggerElement?: React.ElementType | React.ReactNode,
|
|
19
|
+
|
|
20
|
+
/** Gain access to the internal ref. */
|
|
21
|
+
innerRef?: any,
|
|
22
|
+
|
|
17
23
|
/** Closes Popover upon selecting a `Dropdown.Item`. */
|
|
18
24
|
closeOnSelect?: boolean,
|
|
25
|
+
|
|
19
26
|
/** Forces Popover open for testing purposes. */
|
|
20
27
|
forceOpen?: boolean,
|
|
28
|
+
|
|
21
29
|
/** Externally control Popover open state on initial render. */
|
|
22
30
|
defaultOpen?: boolean,
|
|
31
|
+
|
|
23
32
|
/** Callback when Popover is opened. */
|
|
24
33
|
onOpen?: boolean,
|
|
34
|
+
|
|
25
35
|
/** Callback when Popover is closed. */
|
|
26
36
|
onClose?: boolean,
|
|
37
|
+
|
|
27
38
|
/** Overrides the default search function for selecting a dropdown item via keyboard. */
|
|
28
39
|
onSearch?: func,
|
|
29
|
-
|
|
40
|
+
|
|
41
|
+
/** Attempts to keep popover in view clipping edges if too large. */
|
|
42
|
+
keepInView?: boolean,
|
|
43
|
+
|
|
44
|
+
/** Locks external scrollbars when open. */
|
|
45
|
+
lockScrollWhileOpen?: boolean,
|
|
46
|
+
|
|
47
|
+
/** Matches anchor and popover widths. */
|
|
48
|
+
matchWidths?: boolean | 'minimum',
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* `'top-start'
|
|
52
|
+
| 'top'
|
|
53
|
+
| 'top-end'
|
|
54
|
+
| 'right-start'
|
|
55
|
+
| 'right'
|
|
56
|
+
| 'right-end'
|
|
57
|
+
| 'bottom-start'
|
|
58
|
+
| 'bottom'
|
|
59
|
+
| 'bottom-end'
|
|
60
|
+
| 'left-start'
|
|
61
|
+
| 'left'
|
|
62
|
+
| 'left-end'`
|
|
63
|
+
|
|
64
|
+
* Where to place the popover.
|
|
65
|
+
*/
|
|
66
|
+
placement?: string,
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Where to render the popover into. Accepts an HTML element or selector.
|
|
70
|
+
* Uses the closest fixed parent or `document.body` by default. This will only
|
|
71
|
+
* be computed once on initial render.
|
|
72
|
+
*/
|
|
73
|
+
renderTo?: HTMLElement | string,
|
|
74
|
+
|
|
75
|
+
/** Accepts any valid [Popover](/popover) props. */
|
|
30
76
|
popoverProps?: object,
|
|
31
77
|
}
|
|
32
78
|
|
|
@@ -169,7 +215,7 @@ class Dropdown extends Component<Props> {
|
|
|
169
215
|
'aria-haspopup': true,
|
|
170
216
|
'aria-expanded': isPopoverOpen,
|
|
171
217
|
[arrowIconOnly ? 'icon' : 'iconRight']: {
|
|
172
|
-
name: isPopoverOpen ? '
|
|
218
|
+
name: isPopoverOpen ? 'general.upCaret' : 'general.downCaret',
|
|
173
219
|
size: 'sm',
|
|
174
220
|
},
|
|
175
221
|
title: arrowIconOnly ? 'arrow down' : restProps.title,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Dropdown
|
|
3
3
|
category: General
|
|
4
|
-
summary: A compact way of displaying content or actionable items in a popover. Use [Select](/select) for selectable options if needed.
|
|
4
|
+
summary: A compact way of displaying content or actionable items in a popover. Use [Select](/select) for selectable options if needed.
|
|
5
|
+
propsSummary: Accepts [Button](/button) and [Popover](/popover) props.
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
### Items
|
|
8
9
|
|
|
9
10
|
```jsx live
|
|
10
11
|
render(
|
|
11
|
-
<Dropdown icon={{ name: 'cog' }} title="Folder settings" variant="outline">
|
|
12
|
+
<Dropdown icon={{ name: 'general.cog' }} title="Folder settings" variant="outline">
|
|
12
13
|
<Dropdown.Item onSelect={() => console.log('edit folder')}>
|
|
13
14
|
Edit Folder
|
|
14
15
|
</Dropdown.Item>
|
package/src/Dropdown/Link.js
CHANGED
|
@@ -7,7 +7,9 @@ export const LINK_DISPLAY_NAME = 'Dropdown.Link'
|
|
|
7
7
|
export const LINK_DATA = 'link'
|
|
8
8
|
|
|
9
9
|
class Link extends Component {
|
|
10
|
-
|
|
10
|
+
// Graphql wasn't picking up the correct displayName when this was
|
|
11
|
+
// assigned to LINK_DISPLAY_NAME, but using a string works
|
|
12
|
+
static displayName = 'Dropdown.Link'
|
|
11
13
|
|
|
12
14
|
render() {
|
|
13
15
|
const { disabled, external, index, text, to, ...restProps } = this.props
|
|
@@ -1,15 +1,29 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React, { Children, useEffect, useState } from 'react'
|
|
2
3
|
|
|
3
4
|
import Button from '../Button'
|
|
4
5
|
import StackView from '../StackView'
|
|
5
6
|
import { useDocumentEvent, useFocus, useHover } from '../hooks'
|
|
7
|
+
import { useThemeProps } from '../system'
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
type Props = {
|
|
10
|
+
/** Renders any custom component or HTML element when not in the edit state. */
|
|
11
|
+
display?: React.ReactNode,
|
|
12
|
+
|
|
13
|
+
/** Renders any custom component or HTML element, usually form elments to capture user values. */
|
|
14
|
+
edit?: React.ReactNode,
|
|
15
|
+
|
|
16
|
+
/** Shows a spinner if true and then optimistically shows a checkmark when false again. */
|
|
17
|
+
loading?: boolean,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function EditActions({ display, edit, loading, ...restProps }: Props) {
|
|
8
21
|
const { focus, focusProps } = useFocus()
|
|
9
22
|
const { hover, hoverProps } = useHover()
|
|
10
23
|
const [on, setOn] = useState(false)
|
|
11
24
|
const [showCheck, setShowCheck] = useState(false)
|
|
12
25
|
const toggle = () => setOn((bool) => !bool)
|
|
26
|
+
const { buttonProps, ...themeProps } = useThemeProps('editActions', restProps)
|
|
13
27
|
|
|
14
28
|
useEffect(() => {
|
|
15
29
|
if (loading === false) {
|
|
@@ -35,14 +49,14 @@ function EditActions({ display, edit, loading, ...restProps }) {
|
|
|
35
49
|
onClick={on ? undefined : () => setOn(true)}
|
|
36
50
|
{...focusProps}
|
|
37
51
|
{...hoverProps}
|
|
38
|
-
{...
|
|
52
|
+
{...themeProps}
|
|
39
53
|
>
|
|
40
54
|
{Children.toArray(on ? edit : display)}
|
|
41
55
|
<Button
|
|
42
56
|
grow={0}
|
|
43
57
|
title={on ? 'Close' : 'Edit'}
|
|
44
58
|
icon={{
|
|
45
|
-
name: showCheck ? '
|
|
59
|
+
name: showCheck ? 'general.check' : on ? 'general.x' : 'general.pencil',
|
|
46
60
|
color: showCheck ? 'green' : undefined,
|
|
47
61
|
}}
|
|
48
62
|
tooltip={{
|
|
@@ -53,6 +67,7 @@ function EditActions({ display, edit, loading, ...restProps }) {
|
|
|
53
67
|
onClick={focus || on ? toggle : () => setOn(true)}
|
|
54
68
|
opacity={focus || hover || on ? 1 : 0}
|
|
55
69
|
spinner={on && loading ? { color: 'primary' } : undefined}
|
|
70
|
+
{...buttonProps}
|
|
56
71
|
/>
|
|
57
72
|
</StackView>
|
|
58
73
|
)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
title: EditActions
|
|
3
3
|
category: General
|
|
4
4
|
summary: Helper component that manages switching between initial and editing states of inline forms. It uses an optimisitic save that will render a checkmark after the loading prop has been set to `false`.
|
|
5
|
+
propsSummary: Accepts [StackView](/stackview) props.
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
```jsx live
|
package/src/Field/Field.js
CHANGED
|
@@ -9,6 +9,12 @@ import StackView from '../StackView'
|
|
|
9
9
|
import { cloneChildren, generateId } from '../utils'
|
|
10
10
|
|
|
11
11
|
type Props = {
|
|
12
|
+
/** Usually accepts form fields, such as `input` or `select`. */
|
|
13
|
+
children?: any,
|
|
14
|
+
|
|
15
|
+
/** Gain access to the internal ref. */
|
|
16
|
+
innerRef?: any,
|
|
17
|
+
|
|
12
18
|
/** Label that describes field[s]. */
|
|
13
19
|
label?: string | React.ReactNode,
|
|
14
20
|
|
|
@@ -24,6 +30,9 @@ type Props = {
|
|
|
24
30
|
/** Renders label and field[s] inline. */
|
|
25
31
|
inline?: boolean,
|
|
26
32
|
|
|
33
|
+
/** Renders label and field[s] smaller. */
|
|
34
|
+
compact?: boolean,
|
|
35
|
+
|
|
27
36
|
/** Renders content into a [HelperDrawer](/helperdrawer) next to label. */
|
|
28
37
|
helpContent?: string | React.ReactNode,
|
|
29
38
|
|
|
@@ -33,8 +42,14 @@ type Props = {
|
|
|
33
42
|
/** Controls spacing between fields. */
|
|
34
43
|
spacing?: number,
|
|
35
44
|
|
|
45
|
+
/** Controls distribution between fields, by [passing this prop to StackView](/stackview#distribution). (Defaults to "fill".) */
|
|
46
|
+
distribution?: number,
|
|
47
|
+
|
|
36
48
|
/** State of field[s]. */
|
|
37
49
|
state?: 'success' | 'error',
|
|
50
|
+
|
|
51
|
+
/** Places an icon to the left of the label. */
|
|
52
|
+
icon?: any,
|
|
38
53
|
}
|
|
39
54
|
|
|
40
55
|
class Field extends Component<Props> {
|
package/src/Field/Field.mdx
CHANGED
package/src/FieldSet/FieldSet.js
CHANGED
|
@@ -5,8 +5,16 @@ import Heading from '../Heading'
|
|
|
5
5
|
import StackView from '../StackView'
|
|
6
6
|
import TileView from '../TileView'
|
|
7
7
|
import Toolbar from '../Toolbar'
|
|
8
|
+
import { useThemeProps } from '../system'
|
|
8
9
|
|
|
9
10
|
type Props = {
|
|
11
|
+
children?: any,
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Accepts any valid [Heading](/heading) props.
|
|
15
|
+
*/
|
|
16
|
+
headingProps?: object,
|
|
17
|
+
|
|
10
18
|
/**
|
|
11
19
|
* Maps to internal `Toolbar` prop.
|
|
12
20
|
*/
|
|
@@ -26,28 +34,44 @@ type Props = {
|
|
|
26
34
|
* Maps to internal `TileView` prop.
|
|
27
35
|
*/
|
|
28
36
|
spacing: number,
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Accepts any valid [TileView](/tileview) props.
|
|
40
|
+
*/
|
|
41
|
+
tileViewProps?: object,
|
|
29
42
|
}
|
|
30
43
|
|
|
31
|
-
function FieldSet({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
44
|
+
function FieldSet({ children, helpContent, legend, ...restProps }: Props) {
|
|
45
|
+
const {
|
|
46
|
+
headingProps,
|
|
47
|
+
tileViewProps,
|
|
48
|
+
spacing = 1,
|
|
49
|
+
minCellWidth = 16,
|
|
50
|
+
...themeProps
|
|
51
|
+
} = useThemeProps('fieldset', { ...restProps })
|
|
52
|
+
|
|
39
53
|
return (
|
|
40
|
-
<StackView
|
|
54
|
+
<StackView
|
|
55
|
+
as="fieldset"
|
|
56
|
+
padding={0}
|
|
57
|
+
margin={2}
|
|
58
|
+
{...themeProps}
|
|
59
|
+
{...restProps}
|
|
60
|
+
>
|
|
41
61
|
<Toolbar
|
|
42
62
|
title={
|
|
43
|
-
<Heading as="legend" level={4}>
|
|
63
|
+
<Heading as="legend" level={4} {...headingProps}>
|
|
44
64
|
{legend}
|
|
45
65
|
</Heading>
|
|
46
66
|
}
|
|
47
67
|
helpContent={helpContent}
|
|
48
68
|
marginBottom={1}
|
|
49
69
|
/>
|
|
50
|
-
<TileView
|
|
70
|
+
<TileView
|
|
71
|
+
minCellWidth={minCellWidth}
|
|
72
|
+
spacing={spacing}
|
|
73
|
+
{...tileViewProps}
|
|
74
|
+
>
|
|
51
75
|
{children}
|
|
52
76
|
</TileView>
|
|
53
77
|
</StackView>
|
|
@@ -59,7 +59,10 @@ export function FilterLayout(props: Props) {
|
|
|
59
59
|
radius={0}
|
|
60
60
|
title="Filter"
|
|
61
61
|
aria-label={sidebarOpen ? 'close filter' : 'open filter'}
|
|
62
|
-
iconRight={{
|
|
62
|
+
iconRight={{
|
|
63
|
+
name: sidebarOpen ? 'general.leftChevron' : 'general.threeReducingHorizontalBars',
|
|
64
|
+
size: sidebarOpen ? 'xs' : 'md'
|
|
65
|
+
}}
|
|
63
66
|
onClick={toggleSidebar}
|
|
64
67
|
/>
|
|
65
68
|
<Box visible={!(sidebarOpen && fill)} grow={1} shrink={1}>
|
package/src/Form/Form.js
CHANGED
|
@@ -130,7 +130,7 @@ class Form extends React.Component<Props> {
|
|
|
130
130
|
...this.state,
|
|
131
131
|
editButtonProps: {
|
|
132
132
|
disabled: isSubmitting,
|
|
133
|
-
icon: isEditing ? undefined : { name: 'pencil' },
|
|
133
|
+
icon: isEditing ? undefined : { name: 'general.pencil' },
|
|
134
134
|
onClick: () => {
|
|
135
135
|
// bail out if we've already triggered a submit in onBlur
|
|
136
136
|
if (this.submitTimeoutId === null) {
|
package/src/Form/Form.mdx
CHANGED
|
@@ -7,31 +7,33 @@ category: Forms
|
|
|
7
7
|
render(() => {
|
|
8
8
|
const [value, setValue] = React.useState({ name: "Dave's Band Tag Team" })
|
|
9
9
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
<ThemeProvider theme={{ icons }}>
|
|
11
|
+
<Form
|
|
12
|
+
initialPayload={value}
|
|
13
|
+
onSubmit={(payload, complete) => {
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
setValue(payload)
|
|
16
|
+
complete()
|
|
17
|
+
}, 1600)
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
{({ editButtonProps, getFieldProps }) => (
|
|
21
|
+
<StackView
|
|
22
|
+
minWidth={64}
|
|
23
|
+
padding={2}
|
|
24
|
+
spacing={1}
|
|
25
|
+
backgroundColor="primary-light"
|
|
26
|
+
>
|
|
27
|
+
<StackView axis="horizontal" alignment="center" spacing={1}>
|
|
28
|
+
<Input.Inline fontSize={0} light {...getFieldProps('name')} />
|
|
29
|
+
<Button size="xs" theme="light" {...editButtonProps} />
|
|
30
|
+
<Icon name="services.split" size="md" color="light-6" />
|
|
31
|
+
<Icon name="services.tag" size="md" color="light-6" />
|
|
32
|
+
</StackView>
|
|
31
33
|
</StackView>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</
|
|
34
|
+
)}
|
|
35
|
+
</Form>
|
|
36
|
+
</ThemeProvider>
|
|
35
37
|
)
|
|
36
38
|
})
|
|
37
39
|
```
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: GridView
|
|
3
3
|
category: Layout
|
|
4
|
-
summary: Lay out children in columns and rows. Wraps CSS grid styles in a simple API.
|
|
4
|
+
summary: Lay out children in columns and rows. Wraps CSS grid styles in a simple API. To learn more about how you can use CSS grid visit [learncssgrid.com](https://learncssgrid.com/).
|
|
5
|
+
propsSummary: Accepts all valid HTML attributes.
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
```jsx live
|
|
@@ -5,6 +5,7 @@ import * as React from 'react'
|
|
|
5
5
|
|
|
6
6
|
import { BoxProps } from '../Box'
|
|
7
7
|
import splitStyles from '../system/split-styles'
|
|
8
|
+
import { spacingValue } from '../system'
|
|
8
9
|
import { MediaQueries, Variants } from '../index'
|
|
9
10
|
import { useVariant } from '../VariantProvider'
|
|
10
11
|
|
|
@@ -64,19 +65,25 @@ const gridViewPlugin = {
|
|
|
64
65
|
styles.justifyItems = distribution
|
|
65
66
|
}
|
|
66
67
|
if (columnSpacing !== undefined && styles.gridColumnGap === undefined) {
|
|
67
|
-
styles.gridColumnGap = columnSpacing
|
|
68
|
+
styles.gridColumnGap = spacingValue(columnSpacing)
|
|
68
69
|
}
|
|
69
70
|
if (rowSpacing !== undefined && styles.gridRowGap === undefined) {
|
|
70
|
-
styles.gridRowGap = rowSpacing
|
|
71
|
+
styles.gridRowGap = spacingValue(rowSpacing)
|
|
71
72
|
}
|
|
72
|
-
if (spacing !== undefined && styles.
|
|
73
|
-
styles.
|
|
73
|
+
if (spacing !== undefined && styles.gap === undefined) {
|
|
74
|
+
styles.gap = spacingValue(spacing)
|
|
74
75
|
}
|
|
75
76
|
return styles
|
|
76
77
|
},
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
export type GridViewProps = {
|
|
81
|
+
/** Any direct children can use the `column|Start|End` or `row|Start|End` [shorthand properties](/style-props#grid) to place themselves on the grid. */
|
|
82
|
+
children?: any
|
|
83
|
+
|
|
84
|
+
/** Render custom component or HTML element tag. (Defaults to a `<div>` element). */
|
|
85
|
+
as?: any
|
|
86
|
+
|
|
80
87
|
/** The algorithm used to implicitly place grid items. Maps to CSS [gridAutoFlow](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow) property. */
|
|
81
88
|
autoFlow?: 'column' | 'row' | 'dense'
|
|
82
89
|
|
|
@@ -89,20 +96,32 @@ export type GridViewProps = {
|
|
|
89
96
|
/** The columns of the grid. Maps to CSS [gridTemplateColumns](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns) property. */
|
|
90
97
|
columns?: Array<any> | string
|
|
91
98
|
|
|
99
|
+
/** If true, sets `display: inline-grid`, otherwise it defaults to `display: grid` */
|
|
100
|
+
inline?: boolean
|
|
101
|
+
|
|
102
|
+
/** Gain access to the internal ref */
|
|
103
|
+
innerRef?: any
|
|
104
|
+
|
|
92
105
|
/** The rows of the grid. Maps to CSS [gridTemplateRows](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows) property. */
|
|
93
106
|
rows?: Array<any> | string
|
|
94
107
|
|
|
95
108
|
/** Aligns content in a grid item along the column axis. Maps to CSS [alignItems](https://developer.mozilla.org/en-US/docs/Web/CSS/align-items) property. */
|
|
96
109
|
alignment?: 'start' | 'end' | 'center' | 'stretch'
|
|
97
110
|
|
|
98
|
-
/** The amount of space between children. Maps to CSS [
|
|
99
|
-
spacing?: number
|
|
111
|
+
/** The amount of space between children. Maps to CSS [gap](https://developer.mozilla.org/en-US/docs/Web/CSS/gap) property. */
|
|
112
|
+
spacing?: number | string
|
|
100
113
|
|
|
101
114
|
/** The amount of space between columns. Maps to CSS [gridColumnGap](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-gap) property. */
|
|
102
|
-
columnSpacing?: number
|
|
115
|
+
columnSpacing?: number | string
|
|
103
116
|
|
|
104
117
|
/** The amount of space between rows. Maps to CSS [gridRowGap](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-gap) property. */
|
|
105
|
-
rowSpacing?: number
|
|
118
|
+
rowSpacing?: number | string
|
|
119
|
+
|
|
120
|
+
/** Describes styles at various points in time. [Read about variants](/variants).*/
|
|
121
|
+
variants?: object
|
|
122
|
+
|
|
123
|
+
/** Describes props at different breakpoints. [Read about mediaQueries](/responsive). */
|
|
124
|
+
mediaQueries?: object
|
|
106
125
|
} & BoxProps
|
|
107
126
|
|
|
108
127
|
type Props = React.RefAttributes<any> &
|