ionbase-ui 0.47.0 → 0.51.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/components/Pagination.d.ts +50 -0
- package/dist/components/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination.js +88 -0
- package/dist/components/Pagination.js.map +1 -0
- package/dist/components/Textarea.d.ts +50 -0
- package/dist/components/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea.js +48 -0
- package/dist/components/Textarea.js.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/figma-descriptions.json +49 -39
- package/dist/figma-map.json +116 -3
- package/dist/meta/Input.json +0 -1
- package/dist/meta/Pagination.json +200 -0
- package/dist/meta/Textarea.json +520 -0
- package/dist/meta/components.json +721 -2
- package/dist/meta/contrast.json +770 -40
- package/dist/meta/index.json +39 -1
- package/dist/meta/pageItems.json +16 -0
- package/dist/meta/patterns/index.json +1 -1
- package/dist/styles/index.css +2 -0
- package/dist/styles/input.css +34 -15
- package/dist/styles/pagination.css +170 -0
- package/dist/styles/textarea.css +178 -0
- package/dist/styles/tokens/base.css +0 -1
- package/dist/styles/tokens/theme-dark.css +0 -1
- package/dist/tokens/index.d.ts +0 -6
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +0 -5
- package/dist/tokens/index.js.map +1 -1
- package/llms.txt +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Pagination",
|
|
3
|
+
"source": "src/components/Pagination.tsx",
|
|
4
|
+
"propsType": "PaginationProps",
|
|
5
|
+
"description": "Page navigation for a table or list.\n\nGeometry from the Figma `Pagination` (1291:503) and `Pagination Item`\n(1283:289) components. The Figma item set is not exported — a caller places a\nPagination, never a cell.",
|
|
6
|
+
"import": "import { Pagination } from 'ionbase-ui';",
|
|
7
|
+
"status": "stable",
|
|
8
|
+
"summary": "Page navigation for a table or list. Renders prev/next arrows, a truncated run of page numbers, and an optional rows-per-page Select.",
|
|
9
|
+
"useWhen": [
|
|
10
|
+
"a result set is split into pages and the user needs to move between them",
|
|
11
|
+
"the total number of pages is known — the numbered run needs a last page to anchor to"
|
|
12
|
+
],
|
|
13
|
+
"useInstead": [
|
|
14
|
+
{
|
|
15
|
+
"when": "the total is unknown or unbounded, as with a cursor-based or infinite feed",
|
|
16
|
+
"use": "Button",
|
|
17
|
+
"why": "a numbered pager has to draw a last page; with no total there is nothing to draw, and a bare Load more button is honest about that"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"when": "the user is moving between peer views rather than through one long list",
|
|
21
|
+
"use": "Tabs",
|
|
22
|
+
"why": "pagination implies a sequence with a position; tabs are peers in any order"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"when": "it is navigation between pages of the app rather than pages of data",
|
|
26
|
+
"use": "NavItem"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"variants": {
|
|
30
|
+
"type": {
|
|
31
|
+
"numbered": {
|
|
32
|
+
"use": "the default — prev, the page numbers, next. Use wherever the numbers fit"
|
|
33
|
+
},
|
|
34
|
+
"simple": {
|
|
35
|
+
"use": "prev, \"Page N of M\", next. For drawers, narrow columns and mobile, where a numbered run would wrap or truncate to uselessness"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"size": {
|
|
39
|
+
"sm": {
|
|
40
|
+
"use": "dense tables, and toolbars"
|
|
41
|
+
},
|
|
42
|
+
"md": {
|
|
43
|
+
"use": "the default"
|
|
44
|
+
},
|
|
45
|
+
"lg": {
|
|
46
|
+
"use": "roomy layouts, and touch targets on tablet"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"a11y": {
|
|
51
|
+
"role": "navigation / list",
|
|
52
|
+
"guarantees": [
|
|
53
|
+
"the whole control is a landmark — a `nav` with an accessible name, defaulting to \"Pagination\"",
|
|
54
|
+
"the current page carries `aria-current=\"page\"`, not `aria-pressed`: this is a position in a set, not a toggle",
|
|
55
|
+
"every cell has an explicit label — \"Go to page 4\", \"Go to previous page\" — so a screen reader never announces a bare digit",
|
|
56
|
+
"the ellipsis is `aria-hidden` and not focusable: it marks absent pages, and a tab stop that does nothing when activated is worse than no tab stop",
|
|
57
|
+
"in `simple`, the \"Page N of M\" text is an `aria-live=\"polite\"` region, because the page can change without anything else on screen announcing it",
|
|
58
|
+
"prev and next are genuinely `disabled` at the ends rather than styled to look it",
|
|
59
|
+
"the focus ring shows for keyboard focus only, and hover does not latch on touch"
|
|
60
|
+
],
|
|
61
|
+
"requires": [
|
|
62
|
+
"`aria-label` when more than one Pagination is on a page — two identically named landmarks are two indistinguishable landmarks",
|
|
63
|
+
"`pageSize` when `showPageSize` is set, or the rows-per-page Select renders with nothing selected"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"antiPatterns": [
|
|
67
|
+
{
|
|
68
|
+
"avoid": "passing `pageCount={0}` for an empty result set",
|
|
69
|
+
"instead": "render EmptyState and no pager — the component clamps to a single page, which draws a lone disabled `1` that says a page exists when none does"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"avoid": "raising `siblingCount` to avoid truncation",
|
|
73
|
+
"instead": "switch to `type=\"simple\"`. Widening the run past the container is the problem truncation exists to solve, and it reappears one breakpoint down"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"avoid": "treating `page` as 0-based",
|
|
77
|
+
"instead": "it is 1-based, matching what the numbers say. An off-by-one here is silent — the pager looks right and fetches the wrong rows"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"stylesheet": "src/styles/pagination.css",
|
|
81
|
+
"tokens": [
|
|
82
|
+
"--border-focus",
|
|
83
|
+
"--border-width-thick",
|
|
84
|
+
"--font-family-sans",
|
|
85
|
+
"--font-weight-medium",
|
|
86
|
+
"--font-weight-regular",
|
|
87
|
+
"--icon-size-lg",
|
|
88
|
+
"--icon-size-md",
|
|
89
|
+
"--icon-size-xs",
|
|
90
|
+
"--ion-duration-base",
|
|
91
|
+
"--ion-ease-out",
|
|
92
|
+
"--ion-pagination-box",
|
|
93
|
+
"--ion-pagination-font-size",
|
|
94
|
+
"--ion-pagination-icon",
|
|
95
|
+
"--ion-pagination-line-height",
|
|
96
|
+
"--radius-md",
|
|
97
|
+
"--spacing-16",
|
|
98
|
+
"--spacing-2",
|
|
99
|
+
"--spacing-32",
|
|
100
|
+
"--spacing-4",
|
|
101
|
+
"--spacing-40",
|
|
102
|
+
"--spacing-48",
|
|
103
|
+
"--spacing-6",
|
|
104
|
+
"--spacing-8",
|
|
105
|
+
"--surface-hover",
|
|
106
|
+
"--surface-selected",
|
|
107
|
+
"--surface-selected-hover",
|
|
108
|
+
"--text-default",
|
|
109
|
+
"--text-disabled",
|
|
110
|
+
"--text-secondary",
|
|
111
|
+
"--text-tertiary",
|
|
112
|
+
"--type-body",
|
|
113
|
+
"--type-body-lg",
|
|
114
|
+
"--type-body-lg-line-height",
|
|
115
|
+
"--type-body-line-height",
|
|
116
|
+
"--type-body-sm",
|
|
117
|
+
"--type-body-sm-line-height"
|
|
118
|
+
],
|
|
119
|
+
"props": {
|
|
120
|
+
"page": {
|
|
121
|
+
"type": "number",
|
|
122
|
+
"required": true,
|
|
123
|
+
"origin": "own",
|
|
124
|
+
"description": "The current page, 1-based."
|
|
125
|
+
},
|
|
126
|
+
"pageCount": {
|
|
127
|
+
"type": "number",
|
|
128
|
+
"required": true,
|
|
129
|
+
"origin": "own",
|
|
130
|
+
"description": "Total number of pages. One or more."
|
|
131
|
+
},
|
|
132
|
+
"onPageChange": {
|
|
133
|
+
"type": "((page: number) => void) | undefined",
|
|
134
|
+
"required": false,
|
|
135
|
+
"origin": "own",
|
|
136
|
+
"description": "Called with the requested page. Not called for the current page."
|
|
137
|
+
},
|
|
138
|
+
"type": {
|
|
139
|
+
"type": "PaginationType | undefined",
|
|
140
|
+
"required": false,
|
|
141
|
+
"origin": "own",
|
|
142
|
+
"description": "Matches the Figma `Type` variant.",
|
|
143
|
+
"values": [
|
|
144
|
+
"numbered",
|
|
145
|
+
"simple"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"size": {
|
|
149
|
+
"type": "PaginationSize | undefined",
|
|
150
|
+
"required": false,
|
|
151
|
+
"origin": "own",
|
|
152
|
+
"description": "Matches the Figma `Size` variant.",
|
|
153
|
+
"values": [
|
|
154
|
+
"sm",
|
|
155
|
+
"md",
|
|
156
|
+
"lg"
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
"siblingCount": {
|
|
160
|
+
"type": "number | undefined",
|
|
161
|
+
"required": false,
|
|
162
|
+
"origin": "own",
|
|
163
|
+
"description": "How many pages to show either side of the current one. The first and last\nare always shown, so the widest run is `siblingCount * 2 + 5`."
|
|
164
|
+
},
|
|
165
|
+
"showPageSize": {
|
|
166
|
+
"type": "boolean | undefined",
|
|
167
|
+
"required": false,
|
|
168
|
+
"origin": "own",
|
|
169
|
+
"description": "Renders the rows-per-page control. Matches the Figma `Show Page Size`."
|
|
170
|
+
},
|
|
171
|
+
"pageSize": {
|
|
172
|
+
"type": "number | undefined",
|
|
173
|
+
"required": false,
|
|
174
|
+
"origin": "own",
|
|
175
|
+
"description": "Current rows-per-page value. Required when `showPageSize`."
|
|
176
|
+
},
|
|
177
|
+
"pageSizeOptions": {
|
|
178
|
+
"type": "number[] | undefined",
|
|
179
|
+
"required": false,
|
|
180
|
+
"origin": "own",
|
|
181
|
+
"description": "Options offered by the rows-per-page control."
|
|
182
|
+
},
|
|
183
|
+
"onPageSizeChange": {
|
|
184
|
+
"type": "((pageSize: number) => void) | undefined",
|
|
185
|
+
"required": false,
|
|
186
|
+
"origin": "own"
|
|
187
|
+
},
|
|
188
|
+
"className": {
|
|
189
|
+
"type": "string | undefined",
|
|
190
|
+
"required": false,
|
|
191
|
+
"origin": "own"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"propCounts": {
|
|
195
|
+
"own": 11,
|
|
196
|
+
"aria": 0,
|
|
197
|
+
"dom": 276,
|
|
198
|
+
"other": 0
|
|
199
|
+
}
|
|
200
|
+
}
|