@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
|
@@ -108,10 +108,10 @@ export function ChurchCenterStatus({
|
|
|
108
108
|
!!renderPopoverFooter()
|
|
109
109
|
|
|
110
110
|
const icon = {
|
|
111
|
-
check: '
|
|
112
|
-
exclamationTriangle: '
|
|
113
|
-
external: '
|
|
114
|
-
x: '
|
|
111
|
+
check: 'general.check',
|
|
112
|
+
exclamationTriangle: 'general.exclamationTriangle',
|
|
113
|
+
external: 'general.newWindow',
|
|
114
|
+
x: 'general.x',
|
|
115
115
|
...icons,
|
|
116
116
|
}
|
|
117
117
|
|
package/src/Collapse/Collapse.js
CHANGED
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
import React, { Children } from 'react'
|
|
3
3
|
|
|
4
4
|
import StackView from '../StackView'
|
|
5
|
+
import { spacingValue } from '../system'
|
|
5
6
|
|
|
6
7
|
function Column() {
|
|
7
8
|
return null
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export type Props = {
|
|
12
|
+
/** Often wraps the `ColumnView.Column` component. */
|
|
13
|
+
children?: any,
|
|
11
14
|
/** The amount of columns to be rendered. */
|
|
12
15
|
sizes?: Array<
|
|
13
16
|
| {
|
|
@@ -19,11 +22,12 @@ export type Props = {
|
|
|
19
22
|
| string
|
|
20
23
|
>,
|
|
21
24
|
/** The amount of space between columns. */
|
|
22
|
-
spacing?: number,
|
|
25
|
+
spacing?: number | string,
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
function ColumnView(props: Props) {
|
|
26
29
|
const { children, sizes = [], spacing, ...restProps } = props
|
|
30
|
+
const parsedSpacing = spacingValue(spacing)
|
|
27
31
|
const sortedColumns = Children.toArray(children)
|
|
28
32
|
.sort((a, b) => (a.props.order || 0) - (b.props.order || 0))
|
|
29
33
|
.reduce((columns, cell, index) => {
|
|
@@ -45,8 +49,8 @@ function ColumnView(props: Props) {
|
|
|
45
49
|
basis={size === 'auto' ? '100%' : size.basis || size}
|
|
46
50
|
shrink={size === 'auto' ? 1 : size.shrink || 0}
|
|
47
51
|
grow={size === 'auto' ? 1 : size.grow || 0}
|
|
48
|
-
marginLeft={index === 0 ? null :
|
|
49
|
-
spacing={
|
|
52
|
+
marginLeft={index === 0 ? null : parsedSpacing}
|
|
53
|
+
spacing={parsedSpacing}
|
|
50
54
|
>
|
|
51
55
|
{column.map((cell) => cell.props.children)}
|
|
52
56
|
</StackView>
|
package/src/Combobox/Combobox.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React, { Component } from 'react'
|
|
2
3
|
|
|
3
4
|
import Box from '../Box'
|
|
@@ -8,7 +9,16 @@ import ComboboxItem from './ComboboxItem'
|
|
|
8
9
|
import ComboboxItems from './ComboboxItems'
|
|
9
10
|
import ComboboxPopover from './ComboboxPopover'
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
type ComboboxProps = {
|
|
13
|
+
/**
|
|
14
|
+
* Usually takes `Combobox.Input`, `Combobox.Items` and `Combobox.Item` components.
|
|
15
|
+
*/
|
|
16
|
+
children: any,
|
|
17
|
+
onSelect: Function,
|
|
18
|
+
selectedValue: any,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
class Combobox extends Component<ComboboxProps> {
|
|
12
22
|
static Input = ComboboxInput
|
|
13
23
|
|
|
14
24
|
static Item = ComboboxItem
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
title: Combobox
|
|
3
3
|
category: Forms
|
|
4
4
|
summary: Used for easily selecting a list of items that are paired with a text input. Composes [Combobox.Input](https://github.com/ministrycentered/tapestry-react/blob/master/packages/tapestry-react/src/Combobox/ComboboxInput.js) and [Popover](/popover).
|
|
5
|
+
propsSummary: Accepts [Box](/box) props.
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
### Combobox
|
|
@@ -57,7 +58,7 @@ function App() {
|
|
|
57
58
|
>
|
|
58
59
|
<Combobox.Input
|
|
59
60
|
autoFocus
|
|
60
|
-
renderLeft={<Icon name="search" />}
|
|
61
|
+
renderLeft={<Icon name="general.search" />}
|
|
61
62
|
placeholder="Search by name, email, or phone number"
|
|
62
63
|
value={value}
|
|
63
64
|
onClear={value.length > 0 ? () => setValue('') : null}
|
|
@@ -188,7 +188,7 @@ class ComboboxPopover extends Component<Props> {
|
|
|
188
188
|
closeButton ? (
|
|
189
189
|
<Button
|
|
190
190
|
disabled={disabled}
|
|
191
|
-
icon={{ name: '
|
|
191
|
+
icon={{ name: 'general.x' }}
|
|
192
192
|
title="close options"
|
|
193
193
|
theme={false}
|
|
194
194
|
{...closeButton}
|
|
@@ -197,7 +197,7 @@ class ComboboxPopover extends Component<Props> {
|
|
|
197
197
|
<Button
|
|
198
198
|
disabled={disabled}
|
|
199
199
|
icon={{
|
|
200
|
-
name: isPopoverOpen ? '
|
|
200
|
+
name: isPopoverOpen ? 'general.x' : 'general.downCaret',
|
|
201
201
|
}}
|
|
202
202
|
title={
|
|
203
203
|
isPopoverOpen ? 'close options' : 'open options'
|
|
@@ -41,6 +41,11 @@ export type Props = {
|
|
|
41
41
|
*/
|
|
42
42
|
innerBodyRef?: Function,
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Ref that is passed to `useImperativeHandle` which in turn returns `useCollapsibleRows.
|
|
46
|
+
*/
|
|
47
|
+
dataTableRef?: any,
|
|
48
|
+
|
|
44
49
|
/**
|
|
45
50
|
* Controls whether or not sub-rows can be collapsed.
|
|
46
51
|
*/
|
|
@@ -193,6 +198,32 @@ export type Props = {
|
|
|
193
198
|
*/
|
|
194
199
|
keyboardShortcuts?: Object<Function>,
|
|
195
200
|
|
|
201
|
+
/**
|
|
202
|
+
* `onDragStart: (event) => void`
|
|
203
|
+
*
|
|
204
|
+
* Called at the start of a child `Draggable` drag.
|
|
205
|
+
*/
|
|
206
|
+
onDragStart?: Function,
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* `onDragEnd: (event) => void`
|
|
210
|
+
*
|
|
211
|
+
* Called at the end of a child `Draggable` drag.
|
|
212
|
+
*/
|
|
213
|
+
onDragEnd?: Function,
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* `onDrop: (event) => void`
|
|
217
|
+
*
|
|
218
|
+
* This function will be called when a `Draggable` has been dropped. Returns the `onDragEnd` event with any `Draggable` `data` attached.
|
|
219
|
+
*/
|
|
220
|
+
onDrop?: Function,
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* This prop controls whether or not the droppable can receive and reorder draggables. If true, draggables may move outside the droppable, but not added.
|
|
224
|
+
*/
|
|
225
|
+
sourceOnly?: boolean,
|
|
226
|
+
|
|
196
227
|
/**
|
|
197
228
|
* Puts the table in a loading state and shows a spinner in the middle of the table.
|
|
198
229
|
*/
|
|
@@ -261,6 +292,23 @@ export type Props = {
|
|
|
261
292
|
bodySubCell?: Object | Function,
|
|
262
293
|
}
|
|
263
294
|
| Array<Object | boolean>,
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Current visible page number for pagination
|
|
298
|
+
*/
|
|
299
|
+
currentPage: number,
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* `(nextPage: number) => undefined`
|
|
303
|
+
*
|
|
304
|
+
* Callback when new page is requested for pagination.
|
|
305
|
+
*/
|
|
306
|
+
onPageChange: Function,
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Total available pages for pagination.
|
|
310
|
+
*/
|
|
311
|
+
totalPages: number,
|
|
264
312
|
}
|
|
265
313
|
|
|
266
314
|
const defaultHiddenColumnIds = []
|
|
@@ -279,7 +279,7 @@ const columns = [
|
|
|
279
279
|
{
|
|
280
280
|
label: 'Age',
|
|
281
281
|
id: 'age',
|
|
282
|
-
header: <Icon name="person" />,
|
|
282
|
+
header: <Icon name="general.person" />,
|
|
283
283
|
cell: 'age',
|
|
284
284
|
css: {
|
|
285
285
|
justifyContent: 'center',
|
|
@@ -330,7 +330,7 @@ render(function () {
|
|
|
330
330
|
/>
|
|
331
331
|
<Button
|
|
332
332
|
title="Condensed"
|
|
333
|
-
iconRight={condensed ? { name: '
|
|
333
|
+
iconRight={condensed ? { name: 'general.check' } : undefined}
|
|
334
334
|
variant="outline"
|
|
335
335
|
onClick={() => setCondensed(!condensed)}
|
|
336
336
|
/>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useCallback } from 'react'
|
|
2
2
|
|
|
3
|
-
import Icon from '
|
|
3
|
+
import Icon from '../../Icon'
|
|
4
|
+
|
|
4
5
|
|
|
5
6
|
const iconPaths = {
|
|
6
|
-
fill: '
|
|
7
|
-
minus: '
|
|
8
|
-
checked: '
|
|
7
|
+
fill: 'tapestry.checkbox0',
|
|
8
|
+
minus: 'tapestry.checkbox1',
|
|
9
|
+
checked: 'tapestry.checkbox2',
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
const scaleStyles = {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
-
// import Checkbox from '../../Checkbox'
|
|
4
3
|
import Dropdown from '../../Dropdown'
|
|
5
4
|
import Text from '../../Text'
|
|
6
|
-
|
|
7
|
-
import Checkbox from './CheckboxCell'
|
|
5
|
+
import Checkbox from '../../Checkbox'
|
|
8
6
|
|
|
9
7
|
const noop = () => null
|
|
10
8
|
|
|
@@ -17,7 +15,7 @@ function ColumnPicker({
|
|
|
17
15
|
return (
|
|
18
16
|
<Dropdown
|
|
19
17
|
variant="outline"
|
|
20
|
-
icon={{ name: '
|
|
18
|
+
icon={{ name: 'general.threeVerticalBars' }}
|
|
21
19
|
tooltip={{ title: 'Filter Columns' }}
|
|
22
20
|
placement="bottom-end"
|
|
23
21
|
closeOnSelect={false}
|
|
@@ -40,6 +38,8 @@ function ColumnPicker({
|
|
|
40
38
|
<Checkbox
|
|
41
39
|
checked={hiddenColumnIds.indexOf(column.id) === -1}
|
|
42
40
|
onChange={noop}
|
|
41
|
+
label={null}
|
|
42
|
+
size="md"
|
|
43
43
|
/>
|
|
44
44
|
<Text marginLeft={1}>{column.label || column.header}</Text>
|
|
45
45
|
</Dropdown.Item>
|
|
@@ -4,7 +4,7 @@ export const SORT_ASC = 'ASC'
|
|
|
4
4
|
export const SORT_DESC = 'DESC'
|
|
5
5
|
|
|
6
6
|
export function getIconDirection(direction) {
|
|
7
|
-
return direction === SORT_ASC ? '
|
|
7
|
+
return direction === SORT_ASC ? 'general.upCaret' : 'general.downCaret'
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function getOppositeSortDirection(direction) {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
useAnySubRowsOpen,
|
|
9
9
|
} from '../hooks/useCollapsibleRows'
|
|
10
10
|
|
|
11
|
-
import Icon from '
|
|
11
|
+
import Icon from '../../Icon'
|
|
12
12
|
|
|
13
13
|
const buttonStyles = {
|
|
14
14
|
appearance: 'none',
|
|
@@ -50,7 +50,7 @@ function CollapseHeader({ accessibility }) {
|
|
|
50
50
|
}}
|
|
51
51
|
>
|
|
52
52
|
<Icon
|
|
53
|
-
name="
|
|
53
|
+
name="general.downCaret"
|
|
54
54
|
size="sm"
|
|
55
55
|
style={{
|
|
56
56
|
transform: anySubRowsOpen ? undefined : 'rotate(-90deg)',
|
|
@@ -75,7 +75,7 @@ function CollapseCell({ rowIndex }) {
|
|
|
75
75
|
}}
|
|
76
76
|
>
|
|
77
77
|
<Icon
|
|
78
|
-
name="
|
|
78
|
+
name="general.downCaret"
|
|
79
79
|
size="sm"
|
|
80
80
|
style={{
|
|
81
81
|
transform: isSubRowOpen ? undefined : 'rotate(-90deg)',
|
|
@@ -121,7 +121,7 @@ function getParsedColumns({
|
|
|
121
121
|
{..._dragHandleProps}
|
|
122
122
|
>
|
|
123
123
|
<Icon
|
|
124
|
-
name="
|
|
124
|
+
name="general.dragHandle"
|
|
125
125
|
size="sm"
|
|
126
126
|
color="foregroundTertiary"
|
|
127
127
|
style={{ cursor: 'grab' }}
|
|
@@ -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>
|