@papillonarts/components 0.39.0 → 0.41.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/build/Legacy/Alert/Alert.type.d.ts.map +1 -1
- package/build/Legacy/Alert/Alert.type.js +3 -1
- package/build/Legacy/Alert/__tests__/Alert.doc.md +74 -41
- package/build/Legacy/Blankslate/__tests__/Blankslate.doc.md +60 -22
- package/build/Legacy/Breadcrumb/__tests__/Breadcrumb.doc.md +39 -13
- package/build/Legacy/Button/__tests__/Button.doc.md +339 -0
- package/build/Legacy/Dropdown/__tests__/Dropdown.doc.md +54 -0
- package/build/Legacy/ErrorBoundary/ErrorBoundary.type.d.ts.map +1 -1
- package/build/Legacy/ErrorBoundary/__tests__/ErrorBoundary.doc.md +33 -0
- package/build/Legacy/Form/Checkbox/__tests__/Checkbox.doc.md +87 -0
- package/build/Legacy/Form/Input/__tests__/Input.doc.md +84 -0
- package/build/Legacy/Form/Radio/__tests__/Radio.doc.md +66 -0
- package/build/Legacy/Grid/DisplayTable/__tests__/DisplayTable.doc.md +34 -0
- package/build/Legacy/Grid/FlexGrid/FlexGrid.js +2 -2
- package/build/Legacy/Grid/FlexGrid/__tests__/FlexGrid.doc.md +158 -0
- package/build/Legacy/Icon/__tests__/Icon.doc.md +58 -0
- package/build/Legacy/Label/__tests__/Label.doc.md +33 -0
- package/build/Legacy/Loader/__tests__/Loader.doc.md +61 -0
- package/build/Legacy/Markdown/__tests__/Markdown.doc.md +28 -13
- package/build/Legacy/Navigation/Menu/__tests__/Menu.doc.md +53 -0
- package/build/Legacy/Navigation/TabNav/__tests__/TabNav.doc.md +99 -0
- package/build/Legacy/Navigation/UnderlineNav/__tests__/UnderlineNav.doc.md +106 -0
- package/build/Legacy/Pagination/PreviousNext/__tests__/PreviousNext.doc.md +57 -0
- package/build/Legacy/Popover/__tests__/Popover.doc.md +260 -0
- package/build/Legacy/Progress/__tests__/Progress.doc.md +51 -0
- package/build/Legacy/Select/__tests__/Select.doc.md +54 -0
- package/build/Legacy/SelectMenu/__tests__/SelectMenu.doc.md +35 -0
- package/build/Legacy/Subhead/__tests__/Subhead.doc.md +43 -0
- package/build/Legacy/SyntaxHighlighter/__tests__/SyntaxHighlighter.doc.md +45 -21
- package/build/Legacy/Toast/__tests__/Toast.doc.md +73 -0
- package/build/Modern/Flash/__tests__/Flash.doc.md +151 -6
- package/build/Modern/Link/__tests__/Link.doc.md +91 -5
- package/build/Modern/Pagination/__tests__/Pagination.doc.md +89 -7
- package/package.json +4 -4
|
@@ -1,11 +1,156 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Features
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
```
|
|
4
|
+
Flash all props and variants
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
export type FlashProps = ComponentPropsWithoutRef<'div'> & {
|
|
11
|
+
className?: string
|
|
12
|
+
variant?: 'default' | 'warning' | 'success' | 'danger'
|
|
13
|
+
full?: boolean
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Variants
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Default
|
|
21
|
+
|
|
22
|
+
Success
|
|
23
|
+
|
|
24
|
+
Danger
|
|
4
25
|
|
|
26
|
+
Warning
|
|
27
|
+
|
|
28
|
+
Full
|
|
29
|
+
|
|
30
|
+
WithIconAndAction
|
|
31
|
+
|
|
32
|
+
WithIconActionDismiss
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Default
|
|
36
|
+
|
|
37
|
+
> Flash default variant
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
<Flash>Default</Flash>
|
|
5
41
|
```
|
|
6
|
-
# Featues
|
|
7
42
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
>
|
|
43
|
+
### Success
|
|
44
|
+
|
|
45
|
+
> Flash success variant
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
<Flash
|
|
49
|
+
variant="success"
|
|
50
|
+
style={{
|
|
51
|
+
display: 'grid',
|
|
52
|
+
gridTemplateColumns: 'min-content 1fr minmax(0, auto)',
|
|
53
|
+
gridTemplateAreas: `'visual message actions'`,
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
<div className={classes.Visual}>
|
|
57
|
+
<CheckCircleIcon aria-label="Success" />
|
|
58
|
+
</div>
|
|
59
|
+
<div className={classes.Message}>Success</div>
|
|
60
|
+
</Flash>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Danger
|
|
64
|
+
|
|
65
|
+
> Flash danger variant
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
<Flash
|
|
69
|
+
variant="danger"
|
|
70
|
+
style={{
|
|
71
|
+
display: 'grid',
|
|
72
|
+
gridTemplateColumns: 'min-content 1fr minmax(0, auto)',
|
|
73
|
+
gridTemplateAreas: `'visual message actions'`,
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
<div className={classes.Visual}>
|
|
77
|
+
<InfoIcon aria-label="Danger" />
|
|
78
|
+
</div>
|
|
79
|
+
<div className={classes.Message}>Danger</div>
|
|
80
|
+
</Flash>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Warning
|
|
84
|
+
|
|
85
|
+
> Flash warning variant
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
<Flash
|
|
89
|
+
variant="warning"
|
|
90
|
+
style={{
|
|
91
|
+
display: 'grid',
|
|
92
|
+
gridTemplateColumns: 'min-content 1fr minmax(0, auto)',
|
|
93
|
+
gridTemplateAreas: `'visual message actions'`,
|
|
94
|
+
}}
|
|
95
|
+
>
|
|
96
|
+
<div className={classes.Visual}>
|
|
97
|
+
<AlertIcon aria-label="Warning" />
|
|
98
|
+
</div>
|
|
99
|
+
<div className={classes.Message}>Warning</div>
|
|
100
|
+
</Flash>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Full
|
|
104
|
+
|
|
105
|
+
> Flash full variant
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
<Flash
|
|
109
|
+
full
|
|
110
|
+
style={{
|
|
111
|
+
display: 'grid',
|
|
112
|
+
gridTemplateColumns: 'min-content 1fr minmax(0, auto)',
|
|
113
|
+
gridTemplateAreas: `'visual message actions'`,
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
<div className={classes.Visual}>
|
|
117
|
+
<InfoIcon aria-label="Info" />
|
|
118
|
+
</div>
|
|
119
|
+
<div className={classes.Message}>Full</div>
|
|
120
|
+
</Flash>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### With Icon And Action
|
|
124
|
+
|
|
125
|
+
> Flash with icon and action variant
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
<Flash className={classes.WithIconAndAction}>
|
|
129
|
+
<div className={classes.Visual}>
|
|
130
|
+
<InfoIcon aria-label="Info" />
|
|
131
|
+
</div>
|
|
132
|
+
<div className={classes.Message}>
|
|
133
|
+
This is a flash message with an icon and an action.
|
|
134
|
+
<Link href="/"> Learn more.</Link>
|
|
135
|
+
</div>
|
|
136
|
+
<div className={classes.ActionsResponsive}>{/*<Button>Join waitlist</Button>*/}</div>
|
|
137
|
+
</Flash>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### With Icon Action Dismiss
|
|
141
|
+
|
|
142
|
+
> Flash with icon action dismiss variant
|
|
143
|
+
|
|
144
|
+
```tsx
|
|
145
|
+
<Flash className={classes.WithIconActionDismiss}>
|
|
146
|
+
<div className={classes.Visual}>
|
|
147
|
+
<InfoIcon aria-label="Info" />
|
|
148
|
+
</div>
|
|
149
|
+
<div className={classes.Message}>
|
|
150
|
+
This is a flash message with an icon and an action.
|
|
151
|
+
<Link href="/"> Learn more.</Link>
|
|
152
|
+
</div>
|
|
153
|
+
<div className={classes.ActionsResponsive}>{/*<Button>Join waitlist</Button>*/}</div>
|
|
154
|
+
<div className={classes.Close}>{/*<IconButton variant="invisible" icon={XIcon} aria-label="Dismiss" />*/}</div>
|
|
155
|
+
</Flash>
|
|
11
156
|
```
|
|
@@ -1,10 +1,96 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Features
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
```
|
|
4
|
+
Link all props and variants
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
type StyledLinkProps<As extends ElementType = 'a'> = {
|
|
11
|
+
as?: As
|
|
12
|
+
/** @deprecated use CSS modules to style hover color */
|
|
13
|
+
hoverColor?: string
|
|
14
|
+
muted?: boolean
|
|
15
|
+
// Link inside a text block
|
|
16
|
+
inline?: boolean
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Variants
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
Default
|
|
24
|
+
|
|
25
|
+
Muted
|
|
26
|
+
|
|
27
|
+
Inline1
|
|
28
|
+
|
|
29
|
+
Inline2
|
|
30
|
+
```
|
|
4
31
|
|
|
32
|
+
### Default
|
|
33
|
+
|
|
34
|
+
> Link default variant
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
<Link href="#">Links are great</Link>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Muted
|
|
41
|
+
|
|
42
|
+
> Link muted variant
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
<Link href="#" muted>
|
|
46
|
+
Link
|
|
47
|
+
</Link>
|
|
5
48
|
```
|
|
6
|
-
# Featues
|
|
7
49
|
|
|
8
|
-
|
|
9
|
-
|
|
50
|
+
### Inline1
|
|
51
|
+
|
|
52
|
+
> Link inline 1 variant
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<Link inline={true} href="#">
|
|
56
|
+
Link
|
|
57
|
+
</Link>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Inline2
|
|
61
|
+
|
|
62
|
+
> Link inline 2 variant
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
<div>
|
|
66
|
+
<div style={{ display: 'flex', flexDirection: 'column' }} data-a11y-link-underlines="true">
|
|
67
|
+
[data-a11y-link-underlines=true] (inline links have underline)
|
|
68
|
+
<Link href="#">inline: undefined</Link>
|
|
69
|
+
<Link inline={true} href="#">
|
|
70
|
+
inline: true
|
|
71
|
+
</Link>
|
|
72
|
+
<Link inline={false} href="#">
|
|
73
|
+
inline: false
|
|
74
|
+
</Link>
|
|
75
|
+
<br />
|
|
76
|
+
<Link muted={true} inline={true} href="#">
|
|
77
|
+
inline: true, muted: true
|
|
78
|
+
</Link>
|
|
79
|
+
</div>
|
|
80
|
+
<br />
|
|
81
|
+
<div style={{ display: 'flex', flexDirection: 'column' }} data-a11y-link-underlines="false">
|
|
82
|
+
[data-a11y-link-underlines=false] (inline has no effect)
|
|
83
|
+
<Link href="#">inline: undefined</Link>
|
|
84
|
+
<Link inline={true} href="#">
|
|
85
|
+
inline: true
|
|
86
|
+
</Link>
|
|
87
|
+
<Link inline={false} href="#">
|
|
88
|
+
inline: false
|
|
89
|
+
</Link>
|
|
90
|
+
<br />
|
|
91
|
+
<Link muted={true} inline={true} href="#">
|
|
92
|
+
inline: true, muted: true
|
|
93
|
+
</Link>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
10
96
|
```
|
|
@@ -1,12 +1,94 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Features
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
```
|
|
4
|
+
Pagination all props and variants
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
export type PaginationProps = {
|
|
11
|
+
className?: string
|
|
12
|
+
pageCount: number
|
|
13
|
+
currentPage: number
|
|
14
|
+
onPageChange?: (e: React.MouseEvent, n: number) => void
|
|
15
|
+
hrefBuilder?: (n: number) => string
|
|
16
|
+
marginPageCount?: number
|
|
17
|
+
showPages?: boolean | ResponsiveValue<boolean>
|
|
18
|
+
surroundingPageCount?: number
|
|
19
|
+
renderPage?: (props: PageProps) => React.ReactNode
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Variants
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
Default
|
|
27
|
+
|
|
28
|
+
LargerPageCountMargin
|
|
29
|
+
|
|
30
|
+
HidePageNumbers
|
|
31
|
+
|
|
32
|
+
HidePageNumbersByViewport
|
|
33
|
+
|
|
34
|
+
HigherSurroundingPageCount
|
|
35
|
+
|
|
36
|
+
RenderLinks
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Default
|
|
40
|
+
|
|
41
|
+
> Pagination default variant
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
<Pagination pageCount={15} currentPage={2} onPageChange={(e) => e.preventDefault()} showPages={{ narrow: false }} />
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Larger PageCount Margin
|
|
48
|
+
|
|
49
|
+
> Pagination larger page count margin variant
|
|
4
50
|
|
|
51
|
+
```tsx
|
|
52
|
+
<Pagination pageCount={15} currentPage={5} marginPageCount={4} onPageChange={(e) => e.preventDefault()} />
|
|
5
53
|
```
|
|
6
|
-
# Featues
|
|
7
54
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
>
|
|
11
|
-
|
|
55
|
+
### Hide Page Numbers
|
|
56
|
+
|
|
57
|
+
> Pagination hide page numbers variant
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
<Pagination pageCount={15} currentPage={5} showPages={false} onPageChange={(e) => e.preventDefault()} />
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Hide Page Numbers By Viewport
|
|
64
|
+
|
|
65
|
+
> Pagination hide page numbers by viewport variant
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
<Pagination pageCount={15} currentPage={5} showPages={{ narrow: false }} onPageChange={(e) => e.preventDefault()} />
|
|
69
|
+
<p>Page numbers are hidden on narrow viewports.</p>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Higher Surrounding Page Count
|
|
73
|
+
|
|
74
|
+
> Pagination higher surrounding page count variant
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
<Pagination pageCount={15} currentPage={5} surroundingPageCount={4} onPageChange={(e) => e.preventDefault()} />
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Render Links
|
|
81
|
+
|
|
82
|
+
> Pagination render links variant
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
<Pagination
|
|
86
|
+
pageCount={15}
|
|
87
|
+
currentPage={page}
|
|
88
|
+
onPageChange={(e, n) => {
|
|
89
|
+
e.preventDefault()
|
|
90
|
+
setPage(n)
|
|
91
|
+
}}
|
|
92
|
+
renderPage={({ number, ...props }) => <ReactRouterLikeLink to={`#${number}`} {...props} />}
|
|
93
|
+
/>
|
|
12
94
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@papillonarts/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "Papillon Arts Components",
|
|
5
5
|
"homepage": "https://github.com/papillonarts/papillonarts/tree/master/packages/components",
|
|
6
6
|
"repository": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"build-release": "npm run build"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@papillonarts/css": "^0.
|
|
30
|
-
"@papillonarts/library": "^0.
|
|
29
|
+
"@papillonarts/css": "^0.41.0",
|
|
30
|
+
"@papillonarts/library": "^0.41.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "38632df415e9a45e174ea18880ce31b17f8ae2e5"
|
|
33
33
|
}
|