@instructure/ui-pagination 11.6.0 → 11.6.1-snapshot-129
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/CHANGELOG.md +42 -296
- package/es/Pagination/{PaginationArrowButton → v1/PaginationArrowButton}/index.js +2 -2
- package/es/Pagination/{PaginationButton → v1/PaginationButton}/index.js +1 -1
- package/es/Pagination/{PaginationPageInput → v1/PaginationPageInput}/index.js +1 -1
- package/es/Pagination/{index.js → v1/index.js} +1 -1
- package/es/Pagination/v2/PaginationArrowButton/index.js +109 -0
- package/es/Pagination/v2/PaginationArrowButton/props.js +30 -0
- package/es/Pagination/v2/PaginationButton/index.js +77 -0
- package/es/Pagination/v2/PaginationButton/props.js +29 -0
- package/es/Pagination/v2/PaginationPageInput/index.js +189 -0
- package/es/Pagination/v2/PaginationPageInput/props.js +26 -0
- package/es/Pagination/v2/PaginationPageInput/styles.js +56 -0
- package/es/Pagination/v2/index.js +481 -0
- package/es/Pagination/v2/props.js +26 -0
- package/es/Pagination/v2/styles.js +58 -0
- package/es/{index.js → exports/a.js} +1 -1
- package/es/exports/b.js +24 -0
- package/lib/Pagination/{PaginationArrowButton → v1/PaginationArrowButton}/index.js +8 -8
- package/lib/Pagination/{PaginationButton → v1/PaginationButton}/index.js +2 -2
- package/lib/Pagination/{PaginationPageInput → v1/PaginationPageInput}/index.js +2 -2
- package/lib/Pagination/{index.js → v1/index.js} +6 -6
- package/lib/Pagination/v2/PaginationArrowButton/index.js +115 -0
- package/lib/Pagination/v2/PaginationArrowButton/props.js +35 -0
- package/lib/Pagination/v2/PaginationButton/index.js +83 -0
- package/lib/Pagination/v2/PaginationButton/props.js +34 -0
- package/lib/Pagination/v2/PaginationPageInput/index.js +194 -0
- package/lib/Pagination/v2/PaginationPageInput/props.js +31 -0
- package/lib/Pagination/v2/PaginationPageInput/styles.js +62 -0
- package/lib/Pagination/v2/index.js +496 -0
- package/lib/Pagination/v2/props.js +31 -0
- package/lib/Pagination/v2/styles.js +64 -0
- package/lib/{index.js → exports/a.js} +3 -3
- package/lib/exports/b.js +18 -0
- package/package.json +48 -25
- package/src/Pagination/{PaginationArrowButton → v1/PaginationArrowButton}/index.tsx +2 -2
- package/src/Pagination/{PaginationArrowButton → v1/PaginationArrowButton}/props.ts +1 -1
- package/src/Pagination/{PaginationButton → v1/PaginationButton}/index.tsx +1 -1
- package/src/Pagination/{PaginationButton → v1/PaginationButton}/props.ts +1 -1
- package/src/Pagination/{PaginationPageInput → v1/PaginationPageInput}/index.tsx +1 -1
- package/src/Pagination/{index.tsx → v1/index.tsx} +1 -1
- package/src/Pagination/v2/PaginationArrowButton/index.tsx +120 -0
- package/src/Pagination/v2/PaginationArrowButton/props.ts +74 -0
- package/src/Pagination/v2/PaginationButton/index.tsx +82 -0
- package/src/Pagination/v2/PaginationButton/props.ts +77 -0
- package/src/Pagination/v2/PaginationPageInput/index.tsx +242 -0
- package/src/Pagination/v2/PaginationPageInput/props.ts +95 -0
- package/src/Pagination/v2/PaginationPageInput/styles.ts +62 -0
- package/src/Pagination/v2/README.md +417 -0
- package/src/Pagination/v2/index.tsx +665 -0
- package/src/Pagination/v2/props.ts +245 -0
- package/src/Pagination/v2/styles.ts +64 -0
- package/src/exports/a.ts +29 -0
- package/src/exports/b.ts +29 -0
- package/tsconfig.build.json +1 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Pagination/v1/PaginationArrowButton/index.d.ts.map +1 -0
- package/types/Pagination/{PaginationArrowButton → v1/PaginationArrowButton}/props.d.ts +1 -1
- package/types/Pagination/v1/PaginationArrowButton/props.d.ts.map +1 -0
- package/types/Pagination/v1/PaginationButton/index.d.ts.map +1 -0
- package/types/Pagination/{PaginationButton → v1/PaginationButton}/props.d.ts +1 -1
- package/types/Pagination/v1/PaginationButton/props.d.ts.map +1 -0
- package/types/Pagination/v1/PaginationPageInput/index.d.ts.map +1 -0
- package/types/Pagination/v1/PaginationPageInput/props.d.ts.map +1 -0
- package/types/Pagination/v1/PaginationPageInput/styles.d.ts.map +1 -0
- package/types/Pagination/v1/PaginationPageInput/theme.d.ts.map +1 -0
- package/types/Pagination/v1/index.d.ts.map +1 -0
- package/types/Pagination/v1/props.d.ts.map +1 -0
- package/types/Pagination/v1/styles.d.ts.map +1 -0
- package/types/Pagination/v1/theme.d.ts.map +1 -0
- package/types/Pagination/v2/PaginationArrowButton/index.d.ts +27 -0
- package/types/Pagination/v2/PaginationArrowButton/index.d.ts.map +1 -0
- package/types/Pagination/v2/PaginationArrowButton/props.d.ts +17 -0
- package/types/Pagination/v2/PaginationArrowButton/props.d.ts.map +1 -0
- package/types/Pagination/v2/PaginationButton/index.d.ts +26 -0
- package/types/Pagination/v2/PaginationButton/index.d.ts.map +1 -0
- package/types/Pagination/v2/PaginationButton/props.d.ts +30 -0
- package/types/Pagination/v2/PaginationButton/props.d.ts.map +1 -0
- package/types/Pagination/v2/PaginationPageInput/index.d.ts +50 -0
- package/types/Pagination/v2/PaginationPageInput/index.d.ts.map +1 -0
- package/types/Pagination/v2/PaginationPageInput/props.d.ts +45 -0
- package/types/Pagination/v2/PaginationPageInput/props.d.ts.map +1 -0
- package/types/Pagination/v2/PaginationPageInput/styles.d.ts +16 -0
- package/types/Pagination/v2/PaginationPageInput/styles.d.ts.map +1 -0
- package/types/Pagination/v2/index.d.ts +106 -0
- package/types/Pagination/v2/index.d.ts.map +1 -0
- package/types/Pagination/v2/props.d.ts +138 -0
- package/types/Pagination/v2/props.d.ts.map +1 -0
- package/types/Pagination/v2/styles.d.ts +16 -0
- package/types/Pagination/v2/styles.d.ts.map +1 -0
- package/types/exports/a.d.ts +5 -0
- package/types/exports/a.d.ts.map +1 -0
- package/types/exports/b.d.ts +5 -0
- package/types/exports/b.d.ts.map +1 -0
- package/src/index.ts +0 -29
- package/types/Pagination/PaginationArrowButton/index.d.ts.map +0 -1
- package/types/Pagination/PaginationArrowButton/props.d.ts.map +0 -1
- package/types/Pagination/PaginationButton/index.d.ts.map +0 -1
- package/types/Pagination/PaginationButton/props.d.ts.map +0 -1
- package/types/Pagination/PaginationPageInput/index.d.ts.map +0 -1
- package/types/Pagination/PaginationPageInput/props.d.ts.map +0 -1
- package/types/Pagination/PaginationPageInput/styles.d.ts.map +0 -1
- package/types/Pagination/PaginationPageInput/theme.d.ts.map +0 -1
- package/types/Pagination/index.d.ts.map +0 -1
- package/types/Pagination/props.d.ts.map +0 -1
- package/types/Pagination/styles.d.ts.map +0 -1
- package/types/Pagination/theme.d.ts.map +0 -1
- package/types/index.d.ts +0 -5
- package/types/index.d.ts.map +0 -1
- /package/es/Pagination/{PaginationArrowButton → v1/PaginationArrowButton}/props.js +0 -0
- /package/es/Pagination/{PaginationButton → v1/PaginationButton}/props.js +0 -0
- /package/es/Pagination/{PaginationPageInput → v1/PaginationPageInput}/props.js +0 -0
- /package/es/Pagination/{PaginationPageInput → v1/PaginationPageInput}/styles.js +0 -0
- /package/es/Pagination/{PaginationPageInput → v1/PaginationPageInput}/theme.js +0 -0
- /package/es/Pagination/{props.js → v1/props.js} +0 -0
- /package/es/Pagination/{styles.js → v1/styles.js} +0 -0
- /package/es/Pagination/{theme.js → v1/theme.js} +0 -0
- /package/lib/Pagination/{PaginationArrowButton → v1/PaginationArrowButton}/props.js +0 -0
- /package/lib/Pagination/{PaginationButton → v1/PaginationButton}/props.js +0 -0
- /package/lib/Pagination/{PaginationPageInput → v1/PaginationPageInput}/props.js +0 -0
- /package/lib/Pagination/{PaginationPageInput → v1/PaginationPageInput}/styles.js +0 -0
- /package/lib/Pagination/{PaginationPageInput → v1/PaginationPageInput}/theme.js +0 -0
- /package/lib/Pagination/{props.js → v1/props.js} +0 -0
- /package/lib/Pagination/{styles.js → v1/styles.js} +0 -0
- /package/lib/Pagination/{theme.js → v1/theme.js} +0 -0
- /package/src/Pagination/{PaginationPageInput → v1/PaginationPageInput}/props.ts +0 -0
- /package/src/Pagination/{PaginationPageInput → v1/PaginationPageInput}/styles.ts +0 -0
- /package/src/Pagination/{PaginationPageInput → v1/PaginationPageInput}/theme.ts +0 -0
- /package/src/Pagination/{README.md → v1/README.md} +0 -0
- /package/src/Pagination/{props.ts → v1/props.ts} +0 -0
- /package/src/Pagination/{styles.ts → v1/styles.ts} +0 -0
- /package/src/Pagination/{theme.ts → v1/theme.ts} +0 -0
- /package/types/Pagination/{PaginationArrowButton → v1/PaginationArrowButton}/index.d.ts +0 -0
- /package/types/Pagination/{PaginationButton → v1/PaginationButton}/index.d.ts +0 -0
- /package/types/Pagination/{PaginationPageInput → v1/PaginationPageInput}/index.d.ts +0 -0
- /package/types/Pagination/{PaginationPageInput → v1/PaginationPageInput}/props.d.ts +0 -0
- /package/types/Pagination/{PaginationPageInput → v1/PaginationPageInput}/styles.d.ts +0 -0
- /package/types/Pagination/{PaginationPageInput → v1/PaginationPageInput}/theme.d.ts +0 -0
- /package/types/Pagination/{index.d.ts → v1/index.d.ts} +0 -0
- /package/types/Pagination/{props.d.ts → v1/props.d.ts} +0 -0
- /package/types/Pagination/{styles.d.ts → v1/styles.d.ts} +0 -0
- /package/types/Pagination/{theme.d.ts → v1/theme.d.ts} +0 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import React from 'react'
|
|
26
|
+
import type {
|
|
27
|
+
Spacing,
|
|
28
|
+
WithStyleProps,
|
|
29
|
+
ComponentStyle
|
|
30
|
+
} from '@instructure/emotion'
|
|
31
|
+
import type {
|
|
32
|
+
AsElementType,
|
|
33
|
+
OtherHTMLAttributes
|
|
34
|
+
} from '@instructure/shared-types'
|
|
35
|
+
import type { PaginationPageProps } from './PaginationButton/props'
|
|
36
|
+
import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
|
|
37
|
+
type ChildPage = React.ReactElement<PaginationPageProps>
|
|
38
|
+
|
|
39
|
+
type PaginationOwnProps = {
|
|
40
|
+
// this won't filter the children completely well,
|
|
41
|
+
// it will allow simple elements (e.g. `<div>`) and components with compatible props
|
|
42
|
+
// TODO: find a better way to type Children.oneOf([PaginationButton])
|
|
43
|
+
/**
|
|
44
|
+
* children of type Pagination.Page
|
|
45
|
+
*/
|
|
46
|
+
children?: ChildPage | ChildPage[]
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Disables interaction with all pages
|
|
50
|
+
*/
|
|
51
|
+
disabled?: boolean
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Displays "jump to first" and "jump to last" buttons. Always turned on with `input` variant.
|
|
55
|
+
*/
|
|
56
|
+
withFirstAndLastButton?: boolean
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Displays the unavailable navigation buttons as disabled instead of hiding them. Always turned on with `input` variant.
|
|
60
|
+
*/
|
|
61
|
+
showDisabledButtons?: boolean
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Visible label for component
|
|
65
|
+
*/
|
|
66
|
+
label?: React.ReactNode
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Accessible label for next button
|
|
70
|
+
*/
|
|
71
|
+
labelNext?: string
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Accessible label for previous button
|
|
75
|
+
*/
|
|
76
|
+
labelPrev?: string
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Accessible label for "jump to first" button
|
|
80
|
+
*/
|
|
81
|
+
labelFirst?: string
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Accessible label for "jump to last" button
|
|
85
|
+
*/
|
|
86
|
+
labelLast?: string
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Label for number input
|
|
90
|
+
*
|
|
91
|
+
* (__only__ for `input` variant)
|
|
92
|
+
*/
|
|
93
|
+
labelNumberInput?: (totalPageNumber: number) => React.ReactNode
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* ScreenReaderLabel for number input
|
|
97
|
+
*
|
|
98
|
+
* (__only__ for `input` variant)
|
|
99
|
+
*/
|
|
100
|
+
screenReaderLabelNumberInput?: (
|
|
101
|
+
currentPage: number,
|
|
102
|
+
totalPageNumber: number
|
|
103
|
+
) => string
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* ScreenReaderLabel for page number buttons
|
|
107
|
+
*
|
|
108
|
+
* (__only__ for `full` and `compact variants)
|
|
109
|
+
*/
|
|
110
|
+
screenReaderLabelPageButton?: (
|
|
111
|
+
currentPage: number,
|
|
112
|
+
totalPageNumber: number
|
|
113
|
+
) => string
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The compact variant truncates the page navigation to show only the first,
|
|
117
|
+
* last, and pages immediately surrounding the current page. Fewer than 5 pages,
|
|
118
|
+
* no next/previous arrow buttons will be shown, and all pages will be listed
|
|
119
|
+
*/
|
|
120
|
+
variant?: 'full' | 'compact' | 'input'
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Spacing token values can be found here: [Spacing Tokens](https://instructure.design/#layout-spacing/%23Tokens)
|
|
124
|
+
*
|
|
125
|
+
* Apply these values via familiar CSS-like shorthand. For example: `margin="space8 0 space12"`.
|
|
126
|
+
*/
|
|
127
|
+
margin?: Spacing
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* the element type to render as
|
|
131
|
+
*/
|
|
132
|
+
as?: AsElementType
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* provides a reference to the underlying html root element
|
|
136
|
+
*/
|
|
137
|
+
elementRef?: (element: Element | null) => void
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* provides a reference to the html input element
|
|
141
|
+
*
|
|
142
|
+
* (__only__ for `input` variant)
|
|
143
|
+
*/
|
|
144
|
+
inputRef?: (inputElement: HTMLInputElement | null) => void
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* For accessibility, Pagination sets focus on the first or last Pagination.Pages, respectively, when the Previous or Next arrow buttons are removed from the DOM.
|
|
148
|
+
* Set this property to `false` to prevent this behavior.
|
|
149
|
+
*/
|
|
150
|
+
shouldHandleFocus?: boolean
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The total number of pages
|
|
154
|
+
*/
|
|
155
|
+
totalPageNumber?: number
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The current page number
|
|
159
|
+
*/
|
|
160
|
+
currentPage?: number
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The number of pages to display before and after the current page
|
|
164
|
+
*/
|
|
165
|
+
siblingCount?: number
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* The number of always visible pages at the beginning and end
|
|
169
|
+
* of the pagination component
|
|
170
|
+
* */
|
|
171
|
+
boundaryCount?: number
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Called when page number is changed
|
|
175
|
+
*/
|
|
176
|
+
onPageChange?: (next: number, prev: number) => void
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Called when a page is hovered.
|
|
180
|
+
*/
|
|
181
|
+
onMouseEnter?: (page: number) => void
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Renders the visible pages
|
|
185
|
+
*/
|
|
186
|
+
renderPageIndicator?: (
|
|
187
|
+
pageIndex: number,
|
|
188
|
+
currentPage: number
|
|
189
|
+
) => React.ReactNode
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* The ellipsis
|
|
193
|
+
* (e.g. "...")
|
|
194
|
+
*/
|
|
195
|
+
ellipsis?: React.ReactNode
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
type PropKeys = keyof PaginationOwnProps
|
|
199
|
+
|
|
200
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
201
|
+
|
|
202
|
+
type PaginationProps = PaginationOwnProps &
|
|
203
|
+
WithStyleProps<null, PaginationStyle> &
|
|
204
|
+
OtherHTMLAttributes<PaginationOwnProps> &
|
|
205
|
+
WithDeterministicIdProps
|
|
206
|
+
|
|
207
|
+
type PaginationStyle = ComponentStyle<
|
|
208
|
+
'pagination' | 'pages' | 'pageIndicatorList'
|
|
209
|
+
>
|
|
210
|
+
|
|
211
|
+
const allowedProps: AllowedPropKeys = [
|
|
212
|
+
'children',
|
|
213
|
+
'disabled',
|
|
214
|
+
'withFirstAndLastButton',
|
|
215
|
+
'showDisabledButtons',
|
|
216
|
+
'label',
|
|
217
|
+
'labelNext',
|
|
218
|
+
'labelPrev',
|
|
219
|
+
'labelFirst',
|
|
220
|
+
'labelLast',
|
|
221
|
+
'labelNumberInput',
|
|
222
|
+
'screenReaderLabelNumberInput',
|
|
223
|
+
'screenReaderLabelPageButton',
|
|
224
|
+
'variant',
|
|
225
|
+
'margin',
|
|
226
|
+
'as',
|
|
227
|
+
'elementRef',
|
|
228
|
+
'inputRef',
|
|
229
|
+
'shouldHandleFocus',
|
|
230
|
+
'totalPageNumber',
|
|
231
|
+
'currentPage',
|
|
232
|
+
'onPageChange',
|
|
233
|
+
'siblingCount',
|
|
234
|
+
'boundaryCount',
|
|
235
|
+
'renderPageIndicator',
|
|
236
|
+
'ellipsis',
|
|
237
|
+
'onMouseEnter'
|
|
238
|
+
]
|
|
239
|
+
|
|
240
|
+
type PaginationSnapshot = {
|
|
241
|
+
lastFocusedButton?: HTMLButtonElement
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export type { PaginationProps, PaginationStyle, PaginationSnapshot, ChildPage }
|
|
245
|
+
export { allowedProps }
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import type { NewComponentTypes } from '@instructure/ui-themes'
|
|
26
|
+
import type { PaginationStyle } from './props'
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* ---
|
|
30
|
+
* private: true
|
|
31
|
+
* ---
|
|
32
|
+
* Generates the style object from the theme and provided additional information
|
|
33
|
+
* @param {Object} componentTheme The theme variable object.
|
|
34
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
35
|
+
* @param {Object} sharedTokens Shared token object that stores common values for the theme.
|
|
36
|
+
* @param {Object} state the state of the component, the style is applied to
|
|
37
|
+
* @return {Object} The final style object, which will be used in the component
|
|
38
|
+
*/
|
|
39
|
+
const generateStyle = (
|
|
40
|
+
componentTheme: NewComponentTypes['Pagination']
|
|
41
|
+
): PaginationStyle => {
|
|
42
|
+
return {
|
|
43
|
+
pageIndicatorList: {
|
|
44
|
+
all: 'unset',
|
|
45
|
+
display: 'flex',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
gap: componentTheme.pageIndicatorGap,
|
|
48
|
+
flexWrap: 'wrap',
|
|
49
|
+
justifyContent: 'center'
|
|
50
|
+
},
|
|
51
|
+
pagination: {
|
|
52
|
+
label: 'pagination',
|
|
53
|
+
textAlign: 'center'
|
|
54
|
+
},
|
|
55
|
+
pages: {
|
|
56
|
+
label: 'pagination__pages',
|
|
57
|
+
display: 'inline-flex',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
gap: componentTheme.pageIndicatorGap
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default generateStyle
|
package/src/exports/a.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export { Pagination, PaginationButton } from '../Pagination/v1'
|
|
26
|
+
|
|
27
|
+
export type { PaginationProps } from '../Pagination/v1/props'
|
|
28
|
+
export type { PaginationPageProps } from '../Pagination/v1/PaginationButton/props'
|
|
29
|
+
export type { PaginationNavigationProps } from '../Pagination/v1/PaginationArrowButton/props'
|
package/src/exports/b.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export { Pagination, PaginationButton } from '../Pagination/v2'
|
|
26
|
+
|
|
27
|
+
export type { PaginationProps } from '../Pagination/v2/props'
|
|
28
|
+
export type { PaginationPageProps } from '../Pagination/v2/PaginationButton/props'
|
|
29
|
+
export type { PaginationNavigationProps } from '../Pagination/v2/PaginationArrowButton/props'
|
package/tsconfig.build.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
{ "path": "../ui-icons/tsconfig.build.json" },
|
|
19
19
|
{ "path": "../ui-portal/tsconfig.build.json" },
|
|
20
20
|
{ "path": "../ui-react-utils/tsconfig.build.json" },
|
|
21
|
+
{ "path": "../ui-text/tsconfig.build.json" },
|
|
21
22
|
{ "path": "../ui-themes/tsconfig.build.json" },
|
|
22
23
|
{ "path": "../ui-tooltip/tsconfig.build.json" },
|
|
23
24
|
{ "path": "../ui-utils/tsconfig.build.json" },
|