@planningcenter/tapestry-react 1.2.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/Button/Button.js +6 -1
- 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 +29 -16
- 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/Field/Field.js +1 -0
- 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 +4 -2
- package/dist/cjs/Menu/Item.js +5 -5
- 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/Button/Button.js +6 -1
- 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 +27 -15
- 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/Field/Field.js +1 -0
- 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 +4 -2
- package/dist/esm/Menu/Item.js +5 -5
- 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/ChurchCenterStatus/ChurchCenterStatus.d.ts +15 -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 +4 -3
- 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 +17 -1
- 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 +19 -0
- package/src/ChurchCenterStatus/ChurchCenterStatus.tsx +52 -20
- 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 +16 -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 +7 -1
- package/src/Menu/Item.js +5 -5
- 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
|
@@ -2,6 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import { BoxProps } from '../Box';
|
|
3
3
|
import { MediaQueries, Variants } from '../index';
|
|
4
4
|
export declare type TextProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Render custom component or HTML element tag. (Defaults to a `<div>` element).
|
|
7
|
+
*/
|
|
8
|
+
as?: any;
|
|
5
9
|
/**
|
|
6
10
|
* Gain access to the internal ref
|
|
7
11
|
*/
|
|
@@ -38,6 +42,14 @@ export declare type TextProps = {
|
|
|
38
42
|
* Sets `whiteSpace: nowrap` when `false`
|
|
39
43
|
*/
|
|
40
44
|
wrap?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Describes styles at various points in time. [Read about variants](/variants).
|
|
47
|
+
*/
|
|
48
|
+
variants?: object;
|
|
49
|
+
/**
|
|
50
|
+
* Describes props at different breakpoints. [Read about mediaQueries](/responsive).
|
|
51
|
+
*/
|
|
52
|
+
mediaQueries?: object;
|
|
41
53
|
} & BoxProps;
|
|
42
54
|
declare type Props = React.RefAttributes<any> & React.HTMLAttributes<any> & TextProps & MediaQueries<TextProps> & Variants<TextProps>;
|
|
43
55
|
export declare function Text({ as, innerRef, ...props }: Props): JSX.Element;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { BoxProps } from '../Box';
|
|
3
|
+
import { MediaQueries, Variants } from '../index';
|
|
3
4
|
export declare type TileViewProps = {
|
|
5
|
+
children?: any;
|
|
6
|
+
/** Render custom component or HTML element tag. (Defaults to a `<div>` element).*/
|
|
7
|
+
as?: any;
|
|
4
8
|
/** The minimum width a cell must be. */
|
|
5
9
|
minCellWidth?: number;
|
|
6
10
|
/** The amount of space between children. */
|
|
7
|
-
spacing?: number;
|
|
11
|
+
spacing?: number | string;
|
|
12
|
+
/** Gain access to the internal ref */
|
|
13
|
+
innerRef?: any;
|
|
14
|
+
/** Describes styles at various points in time. [Read about variants](/variants). */
|
|
15
|
+
variants?: object;
|
|
16
|
+
/** Describes props at different breakpoints. [Read about mediaQueries](/responsive). */
|
|
17
|
+
mediaQueries?: object;
|
|
8
18
|
} & BoxProps;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
innerRef: any;
|
|
13
|
-
}): JSX.Element;
|
|
19
|
+
declare type Props = React.RefAttributes<any> & React.HTMLAttributes<any> & TileViewProps & MediaQueries<TileViewProps> & Variants<TileViewProps>;
|
|
20
|
+
export declare function TileView({ as, innerRef, ...props }: Props): JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BoxProps } from '../Box';
|
|
3
3
|
export declare type WrapViewProps = {
|
|
4
|
+
children?: any;
|
|
4
5
|
/** The amount of space between children. */
|
|
5
|
-
spacing?: number;
|
|
6
|
+
spacing?: number | string;
|
|
6
7
|
} & BoxProps;
|
|
7
8
|
declare type Props = React.RefAttributes<any> & React.HTMLAttributes<any> & WrapViewProps;
|
|
8
9
|
export declare function WrapView({ children, spacing, ...restProps }: Props): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/tapestry-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-rc.0",
|
|
4
4
|
"description": "A collection of flexible React components to help you build resilient, accessible user interfaces quickly and effectively.",
|
|
5
5
|
"author": "Front End Systems Engineering <frontend@pco.bz>",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -89,8 +89,9 @@
|
|
|
89
89
|
"typescript": "^4.1.5"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
+
"@planningcenter/icons": "^14.0.0",
|
|
92
93
|
"@popmotion/popcorn": "^0.4.4",
|
|
93
|
-
"@popperjs/core": "
|
|
94
|
+
"@popperjs/core": "~2.9.0",
|
|
94
95
|
"@testing-library/jest-dom": "^5.11.9",
|
|
95
96
|
"@testing-library/user-event": "^13.1.9",
|
|
96
97
|
"camel-to-kebab": "^1.1.0",
|
|
@@ -111,7 +112,7 @@
|
|
|
111
112
|
"react-sticky-box": "^0.9.3",
|
|
112
113
|
"resize-observer-polyfill": "^1.5.1",
|
|
113
114
|
"stylefire": "^7.0.3",
|
|
114
|
-
"tabbable": "
|
|
115
|
+
"tabbable": "~5.2.1",
|
|
115
116
|
"tiny-invariant": "^1.1.0",
|
|
116
117
|
"tiny-spring": "^1.0.0",
|
|
117
118
|
"type-fest": "^0.21.1",
|
|
@@ -83,7 +83,7 @@ export function ActionsDropdown({
|
|
|
83
83
|
hasDuplicates || hasInactiveDate
|
|
84
84
|
? {
|
|
85
85
|
color: hasDuplicates ? '#E6A714' : 'white',
|
|
86
|
-
name: hasDuplicates ? '
|
|
86
|
+
name: hasDuplicates ? 'general.exclamationTriangle' : 'general.inactive',
|
|
87
87
|
size: 'md',
|
|
88
88
|
}
|
|
89
89
|
: undefined
|
|
@@ -107,7 +107,7 @@ export function ActionsDropdown({
|
|
|
107
107
|
<Icon
|
|
108
108
|
color="#E6A714"
|
|
109
109
|
marginTop="3px"
|
|
110
|
-
name="
|
|
110
|
+
name="general.exclamationTriangle"
|
|
111
111
|
/>
|
|
112
112
|
<Text size={4}>
|
|
113
113
|
There {duplicates.amount > 1 ? 'are' : 'is'} {duplicates.amount}{' '}
|
|
@@ -130,7 +130,7 @@ export function ActionsDropdown({
|
|
|
130
130
|
{hasInactiveDate ? (
|
|
131
131
|
<>
|
|
132
132
|
<StackView axis="horizontal" padding={2} spacing={1}>
|
|
133
|
-
<Icon name="inactive" color="grey-8" marginTop="3px" />
|
|
133
|
+
<Icon name="general.inactive" color="grey-8" marginTop="3px" />
|
|
134
134
|
<Text size={4}>
|
|
135
135
|
Set inactive on {format(inactive.date, 'MMM dd, yyyy')}
|
|
136
136
|
{inactive.reason && ` (${inactive.reason})`}.{' '}
|
package/src/Alert/Alert.mdx
CHANGED
package/src/Alert/Alert.tsx
CHANGED
|
@@ -4,8 +4,13 @@ import { MediaQueries } from '../index'
|
|
|
4
4
|
import { StackView, StackViewProps } from '../StackView'
|
|
5
5
|
|
|
6
6
|
export type AlertProps = {
|
|
7
|
+
children?: any
|
|
8
|
+
|
|
7
9
|
/** Sets status theme colors. */
|
|
8
10
|
type?: 'warning' | 'success' | 'error'
|
|
11
|
+
|
|
12
|
+
/** Describes props at different breakpoints. [Read about mediaQueries](/responsive). */
|
|
13
|
+
mediaQueries?: object
|
|
9
14
|
} & StackViewProps
|
|
10
15
|
|
|
11
16
|
type Props = React.RefAttributes<any> &
|
package/src/Avatar/Avatar.mdx
CHANGED
package/src/Badge/Badge.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React, { cloneElement } from 'react'
|
|
2
2
|
|
|
3
3
|
import Box from '../Box'
|
|
4
|
-
import { getForegroundColor, useBoxSize } from '../system'
|
|
4
|
+
import { getForegroundColor, useBoxSize, useThemeProps } from '../system'
|
|
5
5
|
import StackView from '../StackView'
|
|
6
6
|
import Text from '../Text'
|
|
7
7
|
import { stopPropagationClick } from '../utils'
|
|
8
8
|
|
|
9
9
|
export type BadgeProps = {
|
|
10
|
+
children?: any,
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* Background color of the badge, sets an accessible text color
|
|
12
14
|
*/
|
|
@@ -26,23 +28,62 @@ export type BadgeProps = {
|
|
|
26
28
|
* The text to be rendered
|
|
27
29
|
*/
|
|
28
30
|
title?: string,
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Allows rendering any content inside the beginning of the badge.
|
|
34
|
+
*/
|
|
35
|
+
renderLeft?: string | React.ReactNode,
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Allows rendering any content inside the end of the badge.
|
|
39
|
+
*/
|
|
40
|
+
renderRight?: string | React.ReactNode,
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* `onClick={stopPropagationClick(onClick)}`
|
|
44
|
+
*
|
|
45
|
+
* Callback passed to `stopPropagationClick` which
|
|
46
|
+
* adds event.stopPropagation() to a component's onClick event.
|
|
47
|
+
* Used to prevent element's onClick from bubbling up the tree.
|
|
48
|
+
*/
|
|
49
|
+
onClick?: Function,
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The size of the radius. (Default is 3px).
|
|
53
|
+
*/
|
|
54
|
+
radius?: number | string,
|
|
29
55
|
}
|
|
30
56
|
|
|
31
57
|
function Badge({
|
|
32
58
|
children,
|
|
33
|
-
color = {
|
|
34
|
-
foreground: 'foreground',
|
|
35
|
-
background: 'surfaceTertiary',
|
|
36
|
-
},
|
|
37
59
|
renderLeft,
|
|
38
60
|
renderRight,
|
|
39
61
|
onClick,
|
|
40
|
-
radius = 3,
|
|
41
|
-
size = 'md',
|
|
42
|
-
square,
|
|
43
62
|
title,
|
|
44
63
|
...restProps
|
|
45
64
|
}: BadgeProps) {
|
|
65
|
+
const {
|
|
66
|
+
color = {
|
|
67
|
+
foreground: 'foreground',
|
|
68
|
+
background: 'surfaceTertiary',
|
|
69
|
+
},
|
|
70
|
+
radius = 3,
|
|
71
|
+
size = 'md',
|
|
72
|
+
square = false,
|
|
73
|
+
...themeProps
|
|
74
|
+
} = useThemeProps('badge', restProps)
|
|
75
|
+
|
|
76
|
+
let badgeProps = {
|
|
77
|
+
color,
|
|
78
|
+
radius,
|
|
79
|
+
size,
|
|
80
|
+
square,
|
|
81
|
+
...themeProps,
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
badgeProps.backgroundColor = color.background || color
|
|
85
|
+
badgeProps.color = color.foreground || getForegroundColor(color)
|
|
86
|
+
|
|
46
87
|
const {
|
|
47
88
|
boxSize,
|
|
48
89
|
fontSize,
|
|
@@ -50,7 +91,8 @@ function Badge({
|
|
|
50
91
|
paddingHorizontal,
|
|
51
92
|
paddingHorizontalDense,
|
|
52
93
|
paddingVertical,
|
|
53
|
-
} = useBoxSize(size)
|
|
94
|
+
} = useBoxSize(badgeProps.size)
|
|
95
|
+
|
|
54
96
|
const textStyle = {
|
|
55
97
|
as: 'span',
|
|
56
98
|
fontWeight: 'inherit',
|
|
@@ -58,26 +100,26 @@ function Badge({
|
|
|
58
100
|
color: 'inherit',
|
|
59
101
|
}
|
|
60
102
|
|
|
61
|
-
if (square || radius === 'circle') {
|
|
62
|
-
|
|
63
|
-
|
|
103
|
+
if (badgeProps.square || badgeProps.radius === 'circle') {
|
|
104
|
+
badgeProps.width = boxSize
|
|
105
|
+
badgeProps.height = boxSize
|
|
64
106
|
}
|
|
65
107
|
|
|
66
|
-
if (radius === 'circle') {
|
|
108
|
+
if (badgeProps.radius === 'circle') {
|
|
67
109
|
textStyle.position = 'absolute'
|
|
68
110
|
textStyle.top = '50%'
|
|
69
111
|
textStyle.left = '50%'
|
|
70
112
|
textStyle.transform = 'translate(-50%, -50%)'
|
|
71
113
|
}
|
|
72
114
|
|
|
73
|
-
|
|
115
|
+
badgeProps.paddingLeft = renderLeft
|
|
74
116
|
? boxSize + 0.5
|
|
75
|
-
: radius === 'pill'
|
|
117
|
+
: badgeProps.radius === 'pill'
|
|
76
118
|
? paddingHorizontal
|
|
77
119
|
: paddingHorizontalDense
|
|
78
|
-
|
|
120
|
+
badgeProps.paddingRight = renderRight
|
|
79
121
|
? boxSize + 0.5
|
|
80
|
-
: radius === 'pill'
|
|
122
|
+
: badgeProps.radius === 'pill'
|
|
81
123
|
? paddingHorizontal
|
|
82
124
|
: paddingHorizontalDense
|
|
83
125
|
|
|
@@ -87,15 +129,10 @@ function Badge({
|
|
|
87
129
|
axis="horizontal"
|
|
88
130
|
alignment="center"
|
|
89
131
|
distribution="center"
|
|
90
|
-
radius={radius}
|
|
91
132
|
fontSize={fontSize}
|
|
92
133
|
lineHeight={lineHeight}
|
|
93
134
|
minHeight={boxSize}
|
|
94
|
-
paddingLeft={spacingLeft}
|
|
95
|
-
paddingRight={spacingRight}
|
|
96
135
|
paddingVertical={paddingVertical}
|
|
97
|
-
backgroundColor={color.background || color}
|
|
98
|
-
color={color.foreground || getForegroundColor(color)}
|
|
99
136
|
fill="currentColor"
|
|
100
137
|
textAlign="center"
|
|
101
138
|
position="relative"
|
|
@@ -103,7 +140,7 @@ function Badge({
|
|
|
103
140
|
outline={0}
|
|
104
141
|
focus={{ backgroundColor: 'highlightSecondary' }}
|
|
105
142
|
onClick={stopPropagationClick(onClick)}
|
|
106
|
-
{...
|
|
143
|
+
{...badgeProps}
|
|
107
144
|
>
|
|
108
145
|
{renderLeft && (
|
|
109
146
|
<Box
|
|
@@ -119,7 +156,9 @@ function Badge({
|
|
|
119
156
|
{typeof renderLeft === 'string'
|
|
120
157
|
? renderLeft
|
|
121
158
|
: cloneElement(renderLeft, {
|
|
122
|
-
size:
|
|
159
|
+
size:
|
|
160
|
+
(renderLeft.props && renderLeft.props.size) ||
|
|
161
|
+
badgeProps.size,
|
|
123
162
|
})}
|
|
124
163
|
</Box>
|
|
125
164
|
)}
|
|
@@ -144,7 +183,9 @@ function Badge({
|
|
|
144
183
|
{typeof renderRight === 'string'
|
|
145
184
|
? renderRight
|
|
146
185
|
: cloneElement(renderRight, {
|
|
147
|
-
size:
|
|
186
|
+
size:
|
|
187
|
+
(renderRight.props && renderRight.props.size) ||
|
|
188
|
+
badgeProps.size,
|
|
148
189
|
})}
|
|
149
190
|
</Box>
|
|
150
191
|
)}
|
package/src/Badge/Badge.mdx
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
title: Badge
|
|
3
3
|
category: General
|
|
4
4
|
summary: Badges are used to inform users of the status of a piece of information or of an action that has been taken.
|
|
5
|
+
propsSummary: Accepts [StackView](/stackview) props.
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
```jsx live
|
|
@@ -50,7 +51,7 @@ render(() => (
|
|
|
50
51
|
renderRight={
|
|
51
52
|
<Button
|
|
52
53
|
title="clear"
|
|
53
|
-
icon={{ name: '
|
|
54
|
+
icon={{ name: 'general.x' }}
|
|
54
55
|
radiusLeft={0}
|
|
55
56
|
onClick={() => alert('clear badge')}
|
|
56
57
|
/>
|
package/src/Badge/Status.js
CHANGED
package/src/Badge/Status.mdx
CHANGED
package/src/Box/Box.mdx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Box
|
|
3
3
|
category: Primitives
|
|
4
|
-
summary: Box is the primitive component that other components build from.
|
|
4
|
+
summary: Box is the primitive component that other components build from.
|
|
5
|
+
propsSummary: Accepts all [style props](/style-props) and valid HTML attributes.
|
|
5
6
|
order: 1
|
|
6
7
|
---
|
|
7
8
|
|
package/src/Box/Box.tsx
CHANGED
|
@@ -8,8 +8,9 @@ import splitStyles from '../system/split-styles'
|
|
|
8
8
|
import { useVariant } from '../VariantProvider'
|
|
9
9
|
|
|
10
10
|
export type BoxProps = {
|
|
11
|
+
children?: any
|
|
11
12
|
/**
|
|
12
|
-
* Render custom component or HTML element tag.
|
|
13
|
+
* Render custom component or HTML element tag. (Defaults to a `<div>` element).
|
|
13
14
|
*/
|
|
14
15
|
as?: any
|
|
15
16
|
|
|
@@ -19,7 +20,7 @@ export type BoxProps = {
|
|
|
19
20
|
innerRef?: any
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
|
-
* If true, sets
|
|
23
|
+
* If true, sets `display: inline-block`, otherwise it defaults to `display: block`
|
|
23
24
|
*/
|
|
24
25
|
inline?: boolean
|
|
25
26
|
|
|
@@ -27,6 +28,16 @@ export type BoxProps = {
|
|
|
27
28
|
* Controls display property. If `false` sets `display: none`, otherwise defaults to initial display value.
|
|
28
29
|
*/
|
|
29
30
|
visible?: boolean
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Describes styles at various points in time. [Read about variants](/variants).
|
|
34
|
+
*/
|
|
35
|
+
variants?: object
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Describes props at different breakpoints. [Read about mediaQueries](/responsive).
|
|
39
|
+
*/
|
|
40
|
+
mediaQueries?: object
|
|
30
41
|
} & StyleProps
|
|
31
42
|
|
|
32
43
|
type Props = React.RefAttributes<any> &
|
package/src/Button/Button.mdx
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
title: Button
|
|
3
3
|
category: General
|
|
4
4
|
summary: Used for any type of user action, including navigation.
|
|
5
|
+
propsSummary: Accepts all valid HTML attributes and [StackView](/stackview) props.
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
```jsx live
|
|
@@ -98,7 +99,7 @@ render(
|
|
|
98
99
|
key={size}
|
|
99
100
|
size={size}
|
|
100
101
|
title="Button"
|
|
101
|
-
iconLeft={{ name: '
|
|
102
|
+
iconLeft={{ name: 'general.twoPeople' }}
|
|
102
103
|
/>
|
|
103
104
|
))}
|
|
104
105
|
</StackView>
|
|
@@ -109,7 +110,7 @@ render(
|
|
|
109
110
|
key={size}
|
|
110
111
|
size={size}
|
|
111
112
|
title="Button"
|
|
112
|
-
iconRight={{ name: '
|
|
113
|
+
iconRight={{ name: 'general.downCaret' }}
|
|
113
114
|
/>
|
|
114
115
|
))}
|
|
115
116
|
</StackView>
|
|
@@ -119,7 +120,7 @@ render(
|
|
|
119
120
|
<Button
|
|
120
121
|
key={size}
|
|
121
122
|
size={size}
|
|
122
|
-
icon={{ name: 'person' }}
|
|
123
|
+
icon={{ name: 'general.person' }}
|
|
123
124
|
tooltip={{ title: 'person' }}
|
|
124
125
|
radius="circle"
|
|
125
126
|
/>
|
package/src/Button/Button.tsx
CHANGED
|
@@ -13,6 +13,8 @@ import { useAccessibilityViolation } from '../hooks/use-accessibility-violation'
|
|
|
13
13
|
import Input from './Input'
|
|
14
14
|
|
|
15
15
|
type ButtonProps = {
|
|
16
|
+
children?: any
|
|
17
|
+
|
|
16
18
|
/**
|
|
17
19
|
* Disables button by removing click handlers and making the button transparent.
|
|
18
20
|
*/
|
|
@@ -78,6 +80,15 @@ type ButtonProps = {
|
|
|
78
80
|
* Determines the modified style of the button.
|
|
79
81
|
*/
|
|
80
82
|
variant?: 'fill' | 'outline' | 'naked'
|
|
83
|
+
|
|
84
|
+
onClick?: Function
|
|
85
|
+
|
|
86
|
+
onKeyDown?: Function
|
|
87
|
+
|
|
88
|
+
/** Describes props at different breakpoints. [Read about mediaQueries](/responsive). */
|
|
89
|
+
mediaQueries?: object
|
|
90
|
+
|
|
91
|
+
|
|
81
92
|
} & StackViewProps
|
|
82
93
|
|
|
83
94
|
type Props = React.RefAttributes<any> &
|
|
@@ -116,6 +127,7 @@ export function Button({
|
|
|
116
127
|
|
|
117
128
|
let buttonProps: any = {
|
|
118
129
|
alignment: 'center',
|
|
130
|
+
as: (restProps as any).href || to ? 'a' : 'div',
|
|
119
131
|
axis: 'horizontal',
|
|
120
132
|
distribution: 'center',
|
|
121
133
|
fontSize,
|
|
@@ -127,7 +139,6 @@ export function Button({
|
|
|
127
139
|
role: 'button',
|
|
128
140
|
strokeAlign: 'inside',
|
|
129
141
|
strokeWeight: 1,
|
|
130
|
-
as: (restProps as any).href || to ? 'a' : 'div',
|
|
131
142
|
userSelect: 'none',
|
|
132
143
|
zIndex: 1,
|
|
133
144
|
}
|
|
@@ -271,6 +282,11 @@ export function Button({
|
|
|
271
282
|
}
|
|
272
283
|
}
|
|
273
284
|
|
|
285
|
+
// pass to if as is defined
|
|
286
|
+
if ((restProps as any).as) {
|
|
287
|
+
buttonProps.to = to
|
|
288
|
+
}
|
|
289
|
+
|
|
274
290
|
if (process.env.NODE_ENV !== 'production') {
|
|
275
291
|
if (icon && !(title || (tooltip && (tooltip as any).title))) {
|
|
276
292
|
const { tooltipProps, wrapperProps } = useAccessibilityViolation(
|
package/src/Button/Input.mdx
CHANGED
|
@@ -11,7 +11,7 @@ render(
|
|
|
11
11
|
title="Add Person"
|
|
12
12
|
theme="light"
|
|
13
13
|
iconLeft={{
|
|
14
|
-
name: 'person',
|
|
14
|
+
name: 'general.person',
|
|
15
15
|
color: 'light-6',
|
|
16
16
|
}}
|
|
17
17
|
>
|
|
@@ -109,7 +109,7 @@ render(() => {
|
|
|
109
109
|
buttonProps={{
|
|
110
110
|
innerRef: containerRef,
|
|
111
111
|
title: 'search',
|
|
112
|
-
icon: { name: '
|
|
112
|
+
icon: { name: 'general.search', color: 'light-9' },
|
|
113
113
|
theme: 'light',
|
|
114
114
|
onClose: () => setValue(''),
|
|
115
115
|
}}
|
package/src/Calendar/Calendar.js
CHANGED
|
@@ -68,6 +68,11 @@ const sizes = {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export type CalendarProps = {
|
|
71
|
+
/**
|
|
72
|
+
* Gain access to the outer wrapping `StackView` ref
|
|
73
|
+
*/
|
|
74
|
+
calendarRef?: any,
|
|
75
|
+
|
|
71
76
|
/**
|
|
72
77
|
* Used to calculate the month and year.
|
|
73
78
|
*/
|
|
@@ -256,7 +261,7 @@ const Calendar = forwardRef(
|
|
|
256
261
|
>
|
|
257
262
|
<Button
|
|
258
263
|
title="Previous month"
|
|
259
|
-
icon={{ name: '
|
|
264
|
+
icon={{ name: 'general.leftChevron', size: "xxs" }}
|
|
260
265
|
disabled={
|
|
261
266
|
isYearsView
|
|
262
267
|
? currentYear <= minYear
|
|
@@ -266,12 +271,12 @@ const Calendar = forwardRef(
|
|
|
266
271
|
/>
|
|
267
272
|
<Button
|
|
268
273
|
tooltip={{ title: 'Today' }}
|
|
269
|
-
icon={{ name: '
|
|
274
|
+
icon={{ name: 'tapestry.radio1' }}
|
|
270
275
|
onClick={() => setDate(TODAY, true)}
|
|
271
276
|
/>
|
|
272
277
|
<Button
|
|
273
278
|
title="Next month"
|
|
274
|
-
icon={{ name: '
|
|
279
|
+
icon={{ name: 'general.rightChevron', size: "xxs"}}
|
|
275
280
|
disabled={
|
|
276
281
|
isYearsView
|
|
277
282
|
? currentYear >= maxYear
|
package/src/Card/Card.mdx
CHANGED
package/src/Card/Card.tsx
CHANGED
|
@@ -5,13 +5,18 @@ import { StackView, StackViewProps } from '../StackView'
|
|
|
5
5
|
import { cloneChildren } from '../utils'
|
|
6
6
|
|
|
7
7
|
export type CardProps = {
|
|
8
|
+
children?: React.ReactNode
|
|
9
|
+
|
|
8
10
|
/** Adds a slightly higher contrast background. */
|
|
9
11
|
subdued?: boolean
|
|
12
|
+
|
|
13
|
+
/** The size of the radius. (Default is 3px). */
|
|
14
|
+
radius?: number | string,
|
|
10
15
|
} & StackViewProps
|
|
11
16
|
|
|
12
17
|
type Props = React.RefAttributes<any> & React.HTMLAttributes<any> & CardProps
|
|
13
18
|
|
|
14
|
-
function Section({ subdued, ...restProps }: Props) {
|
|
19
|
+
export function Section({ subdued, ...restProps }: Props) {
|
|
15
20
|
return (
|
|
16
21
|
<StackView
|
|
17
22
|
width="100%"
|
|
@@ -60,4 +65,5 @@ export function Card({ children, subdued, radius = 3, ...restProps }: Props) {
|
|
|
60
65
|
)
|
|
61
66
|
}
|
|
62
67
|
|
|
68
|
+
Section.displayName = 'Card.Section'
|
|
63
69
|
Card.Section = Section
|
package/src/Checkbox/Checkbox.js
CHANGED
|
@@ -14,9 +14,9 @@ import { useAccessibilityViolation } from '../hooks/use-accessibility-violation'
|
|
|
14
14
|
import { mergeProps } from '../utils'
|
|
15
15
|
|
|
16
16
|
const iconPaths = {
|
|
17
|
-
fill: '
|
|
18
|
-
minus: '
|
|
19
|
-
checked: '
|
|
17
|
+
fill: 'tapestry.checkbox0',
|
|
18
|
+
minus: 'tapestry.checkbox1',
|
|
19
|
+
checked: 'tapestry.checkbox2',
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export type Props = {
|
|
@@ -32,6 +32,11 @@ export type Props = {
|
|
|
32
32
|
*/
|
|
33
33
|
label?: string | null,
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Connects input to its corrospending label's `htmlFor`.
|
|
37
|
+
*/
|
|
38
|
+
id?: string | number,
|
|
39
|
+
|
|
35
40
|
/**
|
|
36
41
|
* If `true`, puts the checkbox in an indeterminate state.
|
|
37
42
|
*/
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
title: Checkbox
|
|
3
3
|
category: Forms
|
|
4
4
|
summary: Checkboxes are most commonly used to give users a way to make a range of selections (zero, one, or multiple). They may also be used as a way to have a user indicate that they agree to specific terms and conditions.
|
|
5
|
+
propsSummary: Accepts [StackView](/stackview) props.
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
```jsx live
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React, { useState } from 'react'
|
|
2
3
|
|
|
3
4
|
import Box from '../Box'
|
|
@@ -5,7 +6,31 @@ import Card from '../Card'
|
|
|
5
6
|
import Checkbox from '../Checkbox'
|
|
6
7
|
import Text from '../Text'
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
type Props = {
|
|
10
|
+
/**
|
|
11
|
+
* Checks the checkbox, will be overriden if indeterminate is `true`.
|
|
12
|
+
*/
|
|
13
|
+
checked?: boolean,
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Maps to the internal input's `onChange` prop.
|
|
17
|
+
*/
|
|
18
|
+
onChange?: () => null,
|
|
19
|
+
|
|
20
|
+
/** First line of text in the card, in a darker color. */
|
|
21
|
+
title?: string,
|
|
22
|
+
|
|
23
|
+
/** Second line of text in the card, in a lighter color. */
|
|
24
|
+
subtitle?: string,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function CheckboxCard({
|
|
28
|
+
checked,
|
|
29
|
+
onChange,
|
|
30
|
+
subtitle,
|
|
31
|
+
title,
|
|
32
|
+
...restProps
|
|
33
|
+
}: Props) {
|
|
9
34
|
const [localChecked, setLocalChecked] = useState(false)
|
|
10
35
|
const isActive = checked === undefined ? localChecked : checked
|
|
11
36
|
return (
|