@nl-rvo/css-page-number-navigation 1.5.2 → 1.6.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.
@@ -1 +1 @@
1
- .rvo-pagination{align-items:center;display:flex;flex-wrap:wrap;gap:var(--rvo-pagination-gap);justify-content:center}@media (min-width:780px){.rvo-pagination{justify-content:flex-start}}.rvo-pagination__next .rvo-link,.rvo-pagination__prev .rvo-link{text-decoration:none}.rvo-pagination__next .rvo-link:hover,.rvo-pagination__prev .rvo-link:hover{text-decoration:underline}.rvo-pagination__list{display:flex;gap:var(--rvo-pagination-gap);margin-block-end:var(--rvo-pagination-list-margin-block-end);margin-block-start:var(--rvo-pagination-list-margin-block-start);padding-inline-end:var(--rvo-pagination-list-padding-inline-end);padding-inline-start:var(--rvo-pagination-list-padding-inline-start)}.rvo-pagination__item{font-weight:var(--rvo-font-weight-bold);list-style:none;min-inline-size:var(--rvo-size-xl);padding-block-end:var(--rvo-space-sm);padding-block-start:var(--rvo-space-sm);padding-inline-end:var(--rvo-space-sm);padding-inline-start:var(--rvo-space-sm);text-align:center}.rvo-pagination__item .rvo-link{font-weight:var(--rvo-font-weight-regular);text-decoration:none}.rvo-pagination__item .rvo-link:hover{text-decoration:underline}.rvo-pagination__item.rvo-pagination__item--active{background-color:var(--rvo-color-grijs-100);font-weight:var(--rvo-font-weight-normal)}
1
+ .rvo-pagination{align-items:center;display:flex;flex-wrap:wrap;gap:var(--rvo-pagination-gap);justify-content:center}@media(min-width: 780px){.rvo-pagination{justify-content:flex-start}}.rvo-pagination__prev .rvo-link,.rvo-pagination__next .rvo-link{text-decoration:none}.rvo-pagination__prev .rvo-link:hover,.rvo-pagination__next .rvo-link:hover{text-decoration:underline}.rvo-pagination__list{display:flex;gap:var(--rvo-pagination-gap);margin-block-end:var(--rvo-pagination-list-margin-block-end);margin-block-start:var(--rvo-pagination-list-margin-block-start);padding-inline-end:var(--rvo-pagination-list-padding-inline-end);padding-inline-start:var(--rvo-pagination-list-padding-inline-start)}.rvo-pagination__item{font-weight:var(--rvo-font-weight-bold);list-style:none;min-inline-size:var(--rvo-size-xl);padding-block-end:var(--rvo-space-sm);padding-block-start:var(--rvo-space-sm);padding-inline-end:var(--rvo-space-sm);padding-inline-start:var(--rvo-space-sm);text-align:center}.rvo-pagination__item .rvo-link{font-weight:var(--rvo-font-weight-regular);text-decoration:none}.rvo-pagination__item .rvo-link:hover{text-decoration:underline}.rvo-pagination__item.rvo-pagination__item--active{background-color:var(--rvo-color-grijs-100);font-weight:var(--rvo-font-weight-normal)}/*# sourceMappingURL=page-number-navigation.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["../src/page-number-navigation.scss"],"names":[],"mappings":"AAIA,gBACE,mBACA,aACA,eACA,8BACA,uBAEA,yBAPF,gBAQI,4BAKA,gEACE,qBAEA,4EACE,0BAMR,sBACE,aACA,8BACA,6DACA,iEACA,iEACA,qEAGF,sBACE,wCACA,gBACA,mCACA,sCACA,wCACA,uCACA,yCACA,kBAEA,gCACE,2CACA,qBAEA,sCACE,0BAIJ,mDACE,4CACA","file":"page-number-navigation.css"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.2",
2
+ "version": "1.6.0",
3
3
  "author": "Community for NL Design System",
4
4
  "license": "CC0-1.0",
5
5
  "name": "@nl-rvo/css-page-number-navigation",
@@ -9,26 +9,26 @@
9
9
  "css",
10
10
  "pagination"
11
11
  ],
12
- "files": [
13
- "src/index.scss",
14
- "dist/",
15
- "design-tokens.json",
16
- "*.md"
17
- ],
18
- "main": "dist/index.css",
19
- "publishConfig": {
20
- "access": "public"
21
- },
22
12
  "repository": {
23
13
  "type": "git+ssh",
24
14
  "url": "git@github.com:nl-design-system/rvo.git",
25
- "directory": "components/page-number-navigation"
15
+ "directory": "components/page-number-navigation/style"
26
16
  },
27
- "devDependencies": {
28
- "@nl-rvo/build-utils-css": "0.1.0"
17
+ "files": [
18
+ "src/",
19
+ "dist/"
20
+ ],
21
+ "exports": {
22
+ ".": "./dist/page-number-navigation.css",
23
+ "./dist/*": "./dist/*"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public",
27
+ "provenance": true
29
28
  },
30
29
  "scripts": {
31
- "build": "build-css-package",
32
- "clean": "rimraf dist"
30
+ "build": "sass --pkg-importer=node --style=compressed ./src/:./dist/",
31
+ "watch": "sass --pkg-importer=node --style=compressed --watch ./src/:./dist/",
32
+ "clean": "rimraf ./dist/"
33
33
  }
34
34
  }
package/CHANGELOG.md DELETED
@@ -1,73 +0,0 @@
1
- # `@nl-rvo/css-pagination`
2
-
3
- ## 1.5.2
4
-
5
- ### Patch Changes
6
-
7
- - 93fdefc: Use CSS Logical properties, to support both `dir=ltr` and `dir=rtl`.
8
-
9
- ## 1.5.1
10
-
11
- ### Patch Changes
12
-
13
- - f64662b: ROOS-330: prevents conditional render of react hooks
14
- - fae5a62: ROOS-330: added overridable labels for i18n purposes
15
-
16
- ## 1.5.0
17
-
18
- ### Minor Changes
19
-
20
- - fa36e07: Project structure updates
21
-
22
- - Moved all Storybook stories to the /stories directory.
23
- - Moved all documentation files to the /docs directory.
24
- - Removed React components from library-component-react and moved them into this package.
25
- - Update all .stories imports to the right react package "component-library-react"
26
- - Fix all Redundant / PascalCase lint warnings for .stories files.
27
-
28
- ## 1.4.0
29
-
30
- ### Minor Changes
31
-
32
- - 8b8710c: Update page number navigation: always show 5 items from page 1 and 5 items before the last page (with ellipses between ranges when needed).
33
-
34
- ## 1.3.1
35
-
36
- ### Patch Changes
37
-
38
- - 11eb258: Update imports to support storybook v10
39
-
40
- ## 1.3.0
41
-
42
- ### Minor Changes
43
-
44
- - a255197: Pagination renamed to Page Number Navigation and updated CSS
45
-
46
- ## 1.2.1
47
-
48
- ### Patch Changes
49
-
50
- - 9f3ff4d: pagination now has className prop and html atrributes props forwarded to the root element
51
-
52
- ## 1.2.0
53
-
54
- ### Minor Changes
55
-
56
- - 0cdf4eb: Remove utrecht-components-css reference and include utrecht css per component when needed
57
-
58
- ## 1.0.1
59
-
60
- ### Patch Changes
61
-
62
- - fc69881: Added aria-current attribute to active page link
63
-
64
- ## 1.0.0
65
-
66
- ### Major Changes
67
-
68
- - daa0537: Create npm package for each component.
69
-
70
- ## Pre-releases
71
-
72
- _@nl-rvo/component-library-css@1.0.0-alpha.381_:
73
- Added component
package/README.md DELETED
@@ -1,79 +0,0 @@
1
- ## Richtlijnen
2
-
3
- - Lijn de pagination altijd links uit met de bovenstaande content waarvoor de pagination actief is. Dit zorgt ervoor dat mensen met kokervisie de pagination makkelijk kunnen ontdekken.
4
- - Gebruik ellipsen (…) om eventuele overgeslagen pagina's te vervangen. Bijvoorbeeld:
5
-
6
- [1] 2 … 10
7
-
8
- 1 [2] 3 … 100
9
-
10
- 1 2 [3] 4 … 100
11
-
12
- 1 2 3 [4] 5 … 100
13
-
14
- 1 … 4 [5] 6 … 100
15
-
16
- 1 … 97 [98] 99 100
17
-
18
- 1 … 98 [99] 100
19
-
20
- 1 … 99 [100]
21
-
22
- ## Voor ontwikkelaars
23
-
24
- De logica voor het genereren van paginanummers met ellipsen kan als volgt worden geïmplementeerd.
25
-
26
- ```js
27
- const generatePageNumberMarkup = (page, activePage) => {
28
- return page === activePage ? `[${page}]` : `${page}`;
29
- };
30
-
31
- const generateEllipsisMarkup = () => "…";
32
-
33
- const generatePageNumbers = (totalPages, activePage) => {
34
- const pages = [];
35
- const windowSize = 5;
36
-
37
- const addRange = (from, to) => {
38
- for (let i = from; i <= to; i++) {
39
- pages.push(generatePageNumberMarkup(i, activePage));
40
- }
41
- };
42
-
43
- // Toon alle pagina's als het totaal klein is
44
- if (totalPages <= windowSize) {
45
- addRange(1, totalPages);
46
- return pages;
47
- }
48
-
49
- // Begin van de paginering
50
- // Voorbeeld: [1] 2 3 4 5 … 100
51
- if (activePage <= 4) {
52
- addRange(1, 5);
53
- pages.push(generateEllipsisMarkup());
54
- pages.push(generatePageNumberMarkup(totalPages, activePage));
55
- return pages;
56
- }
57
-
58
- // Einde van de paginering
59
- // Voorbeeld: 1 … 96 97 98 [99] 100
60
- if (activePage >= totalPages - 3) {
61
- pages.push(generatePageNumberMarkup(1, activePage));
62
- pages.push(generateEllipsisMarkup());
63
- addRange(totalPages - 4, totalPages);
64
- return pages;
65
- }
66
-
67
- // Midden van de paginering
68
- // Voorbeeld: 1 … 4 [5] 6 … 100
69
- pages.push(generatePageNumberMarkup(1, activePage));
70
- pages.push(generateEllipsisMarkup());
71
- addRange(activePage - 1, activePage + 1);
72
- pages.push(generateEllipsisMarkup());
73
- pages.push(generatePageNumberMarkup(totalPages, activePage));
74
-
75
- return pages;
76
- };
77
-
78
- generatePageNumbers(100, 1);
79
- ```
@@ -1,38 +0,0 @@
1
- {
2
- "rvo": {
3
- "pagination": {
4
- "gap": {
5
- "css": {
6
- "syntax": "<length>",
7
- "inherits": true
8
- }
9
- },
10
- "list": {
11
- "margin-block-end": {
12
- "css": {
13
- "syntax": "<length>",
14
- "inherits": true
15
- }
16
- },
17
- "margin-block-start": {
18
- "css": {
19
- "syntax": "<length>",
20
- "inherits": true
21
- }
22
- },
23
- "padding-inline-start": {
24
- "css": {
25
- "syntax": "<length>",
26
- "inherits": true
27
- }
28
- },
29
- "padding-inline-end": {
30
- "css": {
31
- "syntax": "<length>",
32
- "inherits": true
33
- }
34
- }
35
- }
36
- }
37
- }
38
- }
package/dist/index.css DELETED
@@ -1,53 +0,0 @@
1
- /**
2
- * @license CC0-1.0
3
- * Copyright (c) 2021 Community for NL Design System
4
- */
5
- .rvo-pagination {
6
- align-items: center;
7
- display: flex;
8
- flex-wrap: wrap;
9
- gap: var(--rvo-pagination-gap);
10
- justify-content: center;
11
- }
12
- @media (min-width: 780px) {
13
- .rvo-pagination {
14
- justify-content: flex-start;
15
- }
16
- }
17
- .rvo-pagination__prev .rvo-link, .rvo-pagination__next .rvo-link {
18
- text-decoration: none;
19
- }
20
- .rvo-pagination__prev .rvo-link:hover, .rvo-pagination__next .rvo-link:hover {
21
- text-decoration: underline;
22
- }
23
-
24
- .rvo-pagination__list {
25
- display: flex;
26
- gap: var(--rvo-pagination-gap);
27
- margin-block-end: var(--rvo-pagination-list-margin-block-end);
28
- margin-block-start: var(--rvo-pagination-list-margin-block-start);
29
- padding-inline-end: var(--rvo-pagination-list-padding-inline-end);
30
- padding-inline-start: var(--rvo-pagination-list-padding-inline-start);
31
- }
32
-
33
- .rvo-pagination__item {
34
- font-weight: var(--rvo-font-weight-bold);
35
- list-style: none;
36
- min-inline-size: var(--rvo-size-xl);
37
- padding-block-end: var(--rvo-space-sm);
38
- padding-block-start: var(--rvo-space-sm);
39
- padding-inline-end: var(--rvo-space-sm);
40
- padding-inline-start: var(--rvo-space-sm);
41
- text-align: center;
42
- }
43
- .rvo-pagination__item .rvo-link {
44
- font-weight: var(--rvo-font-weight-regular);
45
- text-decoration: none;
46
- }
47
- .rvo-pagination__item .rvo-link:hover {
48
- text-decoration: underline;
49
- }
50
- .rvo-pagination__item.rvo-pagination__item--active {
51
- background-color: var(--rvo-color-grijs-100);
52
- font-weight: var(--rvo-font-weight-normal);
53
- }
package/dist/index.mjs DELETED
@@ -1 +0,0 @@
1
- export default ".rvo-pagination{align-items:center;display:flex;flex-wrap:wrap;gap:var(--rvo-pagination-gap);justify-content:center}@media (min-width:780px){.rvo-pagination{justify-content:flex-start}}.rvo-pagination__next .rvo-link,.rvo-pagination__prev .rvo-link{text-decoration:none}.rvo-pagination__next .rvo-link:hover,.rvo-pagination__prev .rvo-link:hover{text-decoration:underline}.rvo-pagination__list{display:flex;gap:var(--rvo-pagination-gap);margin-block-end:var(--rvo-pagination-list-margin-block-end);margin-block-start:var(--rvo-pagination-list-margin-block-start);padding-inline-end:var(--rvo-pagination-list-padding-inline-end);padding-inline-start:var(--rvo-pagination-list-padding-inline-start)}.rvo-pagination__item{font-weight:var(--rvo-font-weight-bold);list-style:none;min-inline-size:var(--rvo-size-xl);padding-block-end:var(--rvo-space-sm);padding-block-start:var(--rvo-space-sm);padding-inline-end:var(--rvo-space-sm);padding-inline-start:var(--rvo-space-sm);text-align:center}.rvo-pagination__item .rvo-link{font-weight:var(--rvo-font-weight-regular);text-decoration:none}.rvo-pagination__item .rvo-link:hover{text-decoration:underline}.rvo-pagination__item.rvo-pagination__item--active{background-color:var(--rvo-color-grijs-100);font-weight:var(--rvo-font-weight-normal)}";
@@ -1,2 +0,0 @@
1
- declare const css: string;
2
- export default css;
File without changes