81 |
82 |
87 | {!isMobile && descriptionTexts['rowsPerPage']}
88 |
89 | onRowsPerPageChange(event)}
93 | aria-labelledby='number-of-rows-select'
94 | >
95 | {rowsPerPageOptions.map((optionValue: number) => (
96 |
100 | {optionValue}
101 |
102 | ))}
103 |
104 | {renderPaginationNumbers()}
105 |
106 |
107 | setCurrentPage(0)}
110 | disabled={currentPage === 0}
111 | aria-label={descriptionTexts['navigateFirstPage']}
112 | data-testid='first-page-icon'
113 | >
114 |
119 |
120 | decreaseCurrentPage()}
123 | disabled={currentPage === 0}
124 | aria-label={descriptionTexts['previousPage']}
125 | data-testid='pagination-previous-icon'
126 | >
127 |
132 |
133 | increaseCurrentPage()}
136 | disabled={currentPage === numberOfPages - 1}
137 | aria-label={descriptionTexts['nextPage']}
138 | data-testid='pagination-next-icon'
139 | >
140 |
146 |
147 | setCurrentPage(numberOfPages - 1)}
150 | disabled={currentPage === numberOfPages - 1}
151 | aria-label={descriptionTexts['navigateLastPage']}
152 | >
153 |
159 |
160 |
161 |
162 | );
163 | };
164 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | > [!WARNING]
3 | > This design system is DEPRECATED and not maintained!
4 | > Use [designsystemet.no](https://designsystemet.no/en) instead.
5 |
6 | ## How to install
7 |
8 | To add the design system to your project, navigate to the directory where your `package.json` file is located and run one of the following commands:
9 |
10 | ### NPM
11 |
12 | ```
13 | npm install @altinn/altinn-design-system
14 | ```
15 |
16 | ### Yarn
17 |
18 | ```
19 | yarn add @altinn/altinn-design-system
20 | ```
21 |
22 | ### Prerequisites
23 |
24 | As of version **0.27**, this design system is no longer compatible with [the old design system](https://github.com/Altinn/DesignSystem).
25 | This is because the old design system sets the `rem` unit to `10px`, while the default is `16px`, and this is also the unit expected by the Figma tokens.
26 | In older versions, these tokens are converted to match the `rem` unit of the old design system.
27 |
28 | ### Linking
29 |
30 | If you plan on making any contributions to the design system and develop features/test changes with a more rapid feedback loop, you'll most likely want to link your project to a local clone of `altinn-design-system` instead.
31 |
32 | If using `npm link` or `yarn link` works for your project, that'll be the easiest solution. Most likely however, you'll probably want to create local packages for `altinn-design-system` and refer to those in your project `package.json`:
33 |
34 | First, in your local `altinn-design-system`:
35 |
36 | 1. Run `yarn --immutable`, if you haven't already
37 | 2. Run `yarn build`
38 | 3. Run `yarn pack`
39 |
40 | Then, in your project:
41 |
42 | 1. Update the version number for `@altinn/altinn-design-system` to instead point to a path for the `package.tgz` file generated in the steps above. For example: `"@altinn/altinn-design-system": "../altinn-design-system/package.tgz",`
43 | 2. Run `yarn install` (or `npm install`, depending on your project)
44 | 3. Build and/or run your project
45 |
46 | Tip: Whenever you re-build and re-pack in `altinn-design-system`, the output filename stays the same (`package.tgz`). This might cause caching issues where your project uses an older `package.tgz`. To force using a newer package, rename it to something else after running `yarn pack` (for example `package2.tgz`). Be sure to run your package manager after every time you pack the design system library.
47 |
48 | ## Getting started
49 |
50 | ### Node and Corepack
51 |
52 | We are using the latest LTS release of node, but minimum version 16.9.0, since we are using [corepack](https://nodejs.org/api/corepack.html). To enable corepack, execute `corepack enable` from the terminal.
53 |
54 | ### Start Storybook
55 |
56 | Execute `yarn start` to start Storybook. It should open a browser automatically when it is ready. If you prefer to not automatically open a browser, you can execute `yarn start --no-open`.
57 |
58 | ### Tests
59 |
60 | - `yarn test` to run unit tests
61 | - `yarn lint` to run lint checks
62 |
63 | Lint checks and auto-fixes will be run automatically on commit.
64 |
65 | ### Adding new components
66 |
67 | New components can be added by executing `yarn add-component