@prokodo/ui 0.1.11 → 0.1.13

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.
Files changed (107) hide show
  1. package/README.md +6 -1
  2. package/dist/components/RTE/RTE.client.js +46 -5
  3. package/dist/components/RTE/RTE.css +226 -6
  4. package/dist/components/RTE/RTE.module.css +226 -6
  5. package/dist/components/RTE/RTE.module.scss.js +3 -0
  6. package/dist/components/RTE/RTE.utils.js +23 -1
  7. package/dist/components/accordion/Accordion.css +46 -0
  8. package/dist/components/accordion/Accordion.module.css +46 -0
  9. package/dist/components/accordion/Accordion.module.scss.js +4 -0
  10. package/dist/components/accordion/Accordion.view.js +25 -5
  11. package/dist/components/autocomplete/Autocomplete.client.js +132 -0
  12. package/dist/components/autocomplete/Autocomplete.css +317 -0
  13. package/dist/components/autocomplete/Autocomplete.js +12 -0
  14. package/dist/components/autocomplete/Autocomplete.lazy.js +12 -0
  15. package/dist/components/autocomplete/Autocomplete.module.css +317 -0
  16. package/dist/components/autocomplete/Autocomplete.module.scss.js +21 -0
  17. package/dist/components/autocomplete/Autocomplete.server.js +11 -0
  18. package/dist/components/autocomplete/Autocomplete.view.js +142 -0
  19. package/dist/components/autocomplete/index.js +4 -0
  20. package/dist/components/button/Button.css +1 -0
  21. package/dist/components/button/Button.module.css +1 -0
  22. package/dist/components/card/Card.css +9 -0
  23. package/dist/components/card/Card.module.css +9 -0
  24. package/dist/components/card/Card.module.scss.js +1 -0
  25. package/dist/components/dynamic-list/DynamicList.view.js +1 -1
  26. package/dist/components/input/Input.css +23 -4
  27. package/dist/components/input/Input.module.css +23 -4
  28. package/dist/components/pagination/Pagination.client.js +14 -0
  29. package/dist/components/pagination/Pagination.css +191 -0
  30. package/dist/components/pagination/Pagination.js +12 -0
  31. package/dist/components/pagination/Pagination.lazy.js +12 -0
  32. package/dist/components/pagination/Pagination.module.css +191 -0
  33. package/dist/components/pagination/Pagination.module.scss.js +12 -0
  34. package/dist/components/pagination/Pagination.server.js +11 -0
  35. package/dist/components/pagination/Pagination.utils.js +55 -0
  36. package/dist/components/pagination/Pagination.view.js +98 -0
  37. package/dist/components/pagination/index.js +4 -0
  38. package/dist/components/rich-text/RichText.css +0 -1
  39. package/dist/components/rich-text/RichText.module.css +0 -1
  40. package/dist/components/select/Select.client.js +230 -8
  41. package/dist/components/select/Select.css +47 -16
  42. package/dist/components/select/Select.module.css +47 -16
  43. package/dist/components/select/Select.module.scss.js +2 -0
  44. package/dist/components/select/Select.view.js +20 -57
  45. package/dist/components/switch/Switch.css +1 -1
  46. package/dist/components/switch/Switch.module.css +1 -1
  47. package/dist/components/switch/Switch.view.js +3 -1
  48. package/dist/components/tabs/Tabs.client.js +182 -0
  49. package/dist/components/tabs/Tabs.css +330 -0
  50. package/dist/components/tabs/Tabs.js +13 -0
  51. package/dist/components/tabs/Tabs.lazy.js +15 -0
  52. package/dist/components/tabs/Tabs.module.css +330 -0
  53. package/dist/components/tabs/Tabs.module.scss.js +19 -0
  54. package/dist/components/tabs/Tabs.server.js +11 -0
  55. package/dist/components/tabs/Tabs.view.js +157 -0
  56. package/dist/components/tabs/index.js +4 -0
  57. package/dist/components/tooltip/Tooltip.client.js +382 -0
  58. package/dist/components/tooltip/Tooltip.css +242 -0
  59. package/dist/components/tooltip/Tooltip.js +16 -0
  60. package/dist/components/tooltip/Tooltip.module.css +242 -0
  61. package/dist/components/tooltip/Tooltip.module.scss.js +15 -0
  62. package/dist/components/tooltip/Tooltip.server.js +12 -0
  63. package/dist/components/tooltip/Tooltip.view.js +127 -0
  64. package/dist/components/tooltip/index.js +4 -0
  65. package/dist/constants/project.js +1 -1
  66. package/dist/index.js +8 -0
  67. package/dist/theme.css +640 -22
  68. package/dist/tsconfig.build.tsbuildinfo +1 -1
  69. package/dist/types/components/RTE/RTE.utils.d.ts +1 -0
  70. package/dist/types/components/accordion/Accordion.d.ts +3 -0
  71. package/dist/types/components/accordion/Accordion.lazy.d.ts +3 -0
  72. package/dist/types/components/accordion/Accordion.model.d.ts +3 -0
  73. package/dist/types/components/accordion/Accordion.view.d.ts +1 -1
  74. package/dist/types/components/autocomplete/Autocomplete.client.d.ts +5 -0
  75. package/dist/types/components/autocomplete/Autocomplete.d.ts +4 -0
  76. package/dist/types/components/autocomplete/Autocomplete.lazy.d.ts +5 -0
  77. package/dist/types/components/autocomplete/Autocomplete.model.d.ts +58 -0
  78. package/dist/types/components/autocomplete/Autocomplete.server.d.ts +3 -0
  79. package/dist/types/components/autocomplete/Autocomplete.view.d.ts +3 -0
  80. package/dist/types/components/autocomplete/index.d.ts +2 -0
  81. package/dist/types/components/card/Card.model.d.ts +1 -1
  82. package/dist/types/components/grid/Grid.model.d.ts +37 -7
  83. package/dist/types/components/pagination/Pagination.client.d.ts +5 -0
  84. package/dist/types/components/pagination/Pagination.d.ts +4 -0
  85. package/dist/types/components/pagination/Pagination.lazy.d.ts +5 -0
  86. package/dist/types/components/pagination/Pagination.model.d.ts +22 -0
  87. package/dist/types/components/pagination/Pagination.server.d.ts +3 -0
  88. package/dist/types/components/pagination/Pagination.utils.d.ts +13 -0
  89. package/dist/types/components/pagination/Pagination.view.d.ts +3 -0
  90. package/dist/types/components/pagination/index.d.ts +2 -0
  91. package/dist/types/components/select/Select.model.d.ts +16 -1
  92. package/dist/types/components/tabs/Tabs.client.d.ts +5 -0
  93. package/dist/types/components/tabs/Tabs.d.ts +4 -0
  94. package/dist/types/components/tabs/Tabs.lazy.d.ts +5 -0
  95. package/dist/types/components/tabs/Tabs.model.d.ts +43 -0
  96. package/dist/types/components/tabs/Tabs.server.d.ts +3 -0
  97. package/dist/types/components/tabs/Tabs.view.d.ts +3 -0
  98. package/dist/types/components/tabs/index.d.ts +2 -0
  99. package/dist/types/components/tooltip/Tooltip.client.d.ts +5 -0
  100. package/dist/types/components/tooltip/Tooltip.d.ts +4 -0
  101. package/dist/types/components/tooltip/Tooltip.lazy.d.ts +5 -0
  102. package/dist/types/components/tooltip/Tooltip.model.d.ts +47 -0
  103. package/dist/types/components/tooltip/Tooltip.server.d.ts +3 -0
  104. package/dist/types/components/tooltip/Tooltip.view.d.ts +3 -0
  105. package/dist/types/components/tooltip/index.d.ts +2 -0
  106. package/dist/types/index.d.ts +4 -0
  107. package/package.json +23 -2
@@ -129,7 +129,6 @@
129
129
  position: relative;
130
130
  display: flex;
131
131
  flex-direction: column;
132
- justify-content: space-around;
133
132
  height: 100%;
134
133
  width: 100%;
135
134
  }
@@ -161,6 +160,9 @@
161
160
  background-color: var(--color-white);
162
161
  padding: 0 0.25rem;
163
162
  }
163
+ html[data-theme=dark] .prokodo-Input__label--is-focused {
164
+ background-color: rgb(16, 19, 27);
165
+ }
164
166
  }
165
167
  .prokodo-Input__inner {
166
168
  position: relative;
@@ -197,6 +199,13 @@
197
199
  background-color: var(--color-white);
198
200
  color: var(--color-grey-900);
199
201
  }
202
+ html[data-theme=dark] .prokodo-Input__input input:-webkit-autofill, html[data-theme=dark] .prokodo-Input__input textarea:-webkit-autofill {
203
+ background-color: rgb(16, 19, 27);
204
+ }
205
+ html[data-theme=dark] .prokodo-Input__input input:autofill,
206
+ html[data-theme=dark] .prokodo-Input__input textarea:autofill {
207
+ background-color: rgb(16, 19, 27);
208
+ }
200
209
  .prokodo-Input__input input:-webkit-autofill,
201
210
  .prokodo-Input__input input:-webkit-autofill:hover,
202
211
  .prokodo-Input__input input:-webkit-autofill:focus,
@@ -217,6 +226,10 @@
217
226
  background-color: var(--color-white);
218
227
  color: var(--color-grey-900);
219
228
  }
229
+ html[data-theme=dark] .prokodo-Input__input input:-moz-autofill,
230
+ html[data-theme=dark] .prokodo-Input__input textarea:-moz-autofill {
231
+ background-color: rgb(16, 19, 27);
232
+ }
220
233
  .prokodo-Input__input input:is(:-webkit-autofill, :-webkit-autofill), .prokodo-Input__input textarea:is(:-webkit-autofill, :-webkit-autofill) {
221
234
  border-color: none; /* adjust as needed */
222
235
  }
@@ -251,8 +264,8 @@
251
264
  background: var(--gradient-border-8);
252
265
  }
253
266
  .prokodo-Input__input__node {
254
- width: calc(100% - 1.5rem - 1.5rem - 0.25rem);
255
- padding: 0.875rem 1.5rem;
267
+ width: calc(100% - 1rem - 1rem - 0.25rem);
268
+ padding: 0.875rem 1rem;
256
269
  margin: 2px;
257
270
  border: none;
258
271
  outline: none;
@@ -279,6 +292,9 @@
279
292
  font-size: 1rem;
280
293
  }
281
294
  }
295
+ html[data-theme=dark] .prokodo-Input__input__node {
296
+ background-color: rgb(16, 19, 27);
297
+ }
282
298
  .prokodo-Input__input__node {
283
299
  font-size: 1rem;
284
300
  }
@@ -307,9 +323,12 @@
307
323
  pointer-events: none;
308
324
  }
309
325
  .prokodo-Input__input__node:disabled {
310
- color: var(--color-grey-300);
326
+ color: var(--color-grey-700);
311
327
  background: var(--color-white);
312
328
  }
329
+ html[data-theme=dark] .prokodo-Input__input__node:disabled {
330
+ background-color: rgb(16, 19, 27);
331
+ }
313
332
  .prokodo-Input__input:focus {
314
333
  border-color: var(--color-primary-500);
315
334
  box-shadow: 0 0 5px var(--color-primary-500);
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ var __defProp = Object.defineProperty;
3
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { memo } from "react";
6
+ import { PaginationView } from "./Pagination.view.js";
7
+ function PaginationClient(p) {
8
+ return /* @__PURE__ */ jsx(PaginationView, { ...p });
9
+ }
10
+ __name(PaginationClient, "PaginationClient");
11
+ const PaginationClient$1 = memo(PaginationClient);
12
+ export {
13
+ PaginationClient$1 as default
14
+ };
@@ -0,0 +1,191 @@
1
+ /* stylelint-disable */
2
+ /**
3
+ * Calculates a rem-based value by a given pixel size.
4
+ */
5
+ /* stylelint-disable */
6
+ /**
7
+ * Applies flex-column and gap.
8
+ */
9
+ /*
10
+ As example (light, primary)
11
+ See defined modes in designsystem/config/gradients
12
+ */
13
+ /**
14
+ * Mixin that renders a media query that target screens that are larger than the
15
+ * given size.
16
+ */
17
+ /**
18
+ * Mixin that renders a media query that target screens that are smaller than the
19
+ * given size.
20
+ */
21
+ /**
22
+ * Mixin that renders a media query that target screens in between the given range.
23
+ */
24
+ /**
25
+ * Mixin that renders a media query that target screens that have height larger than the
26
+ * given size.
27
+ */
28
+ /**
29
+ * Mixin that renders a media query that target screens that have height smaller than the
30
+ * given size.
31
+ */
32
+ /* stylelint-disable */
33
+ /* M3/Elevation Light/1 */
34
+ /* M3/Elevation Light/2 */
35
+ /* M3/Elevation/5 */
36
+ /* M3/Elevation/1 Text */
37
+ /* Inner elevations */
38
+ /* stylelint-disable */
39
+ /**
40
+ * Visually hides an element but not removes them for screen readers.
41
+ */
42
+ /**
43
+ * The inverse of the `hidden` helper to reset a previously hidden element to be
44
+ * visible for users.
45
+ */
46
+ /**
47
+ * Creates a selector for :hover effects depending on the current user input
48
+ * device. If the input device is a mouse, this hover effect will appear.
49
+ * Keyboard and touch inputs are ignored.
50
+ *
51
+ * Example usage:
52
+ * .link {
53
+ * color: blue;
54
+ *
55
+ * @include when-hovered() {
56
+ * color: green;
57
+ * }
58
+ * }
59
+ */
60
+ /**
61
+ * Creates a selector for :active effects depending on the current user input
62
+ * device. The state applies when the input device is a mouse or keyboard. Touch
63
+ * devices will not show a pressed state.
64
+ *
65
+ * Example usage:
66
+ * .link {
67
+ * box-shadow: none;
68
+ *
69
+ * @include when-pressed() {
70
+ * box-shadow: inset 0 2px 4px grey;
71
+ * }
72
+ * }
73
+ */
74
+ /**
75
+ * Creates a selector for :focus effects depending on the current user input
76
+ * device. When the user navigates using a keyboard, the focus effect defined in
77
+ * here is applied. For other input devices they don't show up.
78
+ *
79
+ * Example usage:
80
+ * .link {
81
+ * text-decoration: none;
82
+ *
83
+ * @include when-focused() {
84
+ * text-decoration: underline;
85
+ * }
86
+ * }
87
+ */
88
+ /**
89
+ * Creates a selector for :focus-within effects depending on the current user
90
+ * input device. When the user navigates using a keyboard, the focus effect
91
+ * defined in here is applied. For other input devices they don't show up.
92
+ *
93
+ * Example usage:
94
+ * .link {
95
+ * img {
96
+ * opacity: 0.75;
97
+ *
98
+ * @include when-focused-within() {
99
+ * opacity: 1;
100
+ * }
101
+ * }
102
+ * }
103
+ */
104
+ /**
105
+ * Wrapper for media query "prefers-reduced-motion".
106
+ */
107
+ /**
108
+ * This helper hides the outline but still makes it visible for
109
+ * Windows high-contrast users. Use this instead of `outline: 0;`.
110
+ */
111
+ /**
112
+ * This helper hides the outline but still makes it visible for
113
+ * Windows high-contrast users. Use this instead of `outline: 0;`.
114
+ */
115
+ /**
116
+ * Renders an alternative, but application consistent focus-ring.
117
+ */
118
+ /**
119
+ * Specifies the outer layout for all contents across breakpoints. Apply this
120
+ * mixin to the container element, to center the contents on the screen within
121
+ * the layout offsets.
122
+ */
123
+ /**
124
+ * This mixin specifies basic text-styles for components that render a richtext
125
+ * content.
126
+ */
127
+ .prokodo-Pagination {
128
+ display: inline-flex;
129
+ align-items: center;
130
+ gap: 0.5rem;
131
+ }
132
+ .prokodo-Pagination__list {
133
+ display: inline-flex;
134
+ align-items: center;
135
+ gap: 0.5rem;
136
+ margin: 0;
137
+ padding: 0;
138
+ list-style: none;
139
+ }
140
+ .prokodo-Pagination__item {
141
+ display: inline-flex;
142
+ align-items: center;
143
+ }
144
+ .prokodo-Pagination__ellipsis {
145
+ color: var(--color-grey-700);
146
+ padding: 0 0.25rem;
147
+ -webkit-user-select: none;
148
+ -moz-user-select: none;
149
+ user-select: none;
150
+ font-weight: 400;
151
+ font-size: 1rem;
152
+ font-family: var(--font-secondary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
153
+ font-style: normal;
154
+ line-height: 1.45;
155
+ letter-spacing: 0.03em;
156
+ text-transform: none;
157
+ text-align: left;
158
+ text-decoration: none;
159
+ }
160
+ @media screen and (min-width: 480px) {
161
+ .prokodo-Pagination__ellipsis {
162
+ font-size: 0.875rem;
163
+ line-height: 1.4;
164
+ }
165
+ }
166
+ @media screen and (min-width: 960px) {
167
+ .prokodo-Pagination__ellipsis {
168
+ font-size: 0.875rem;
169
+ line-height: 1.4;
170
+ }
171
+ }
172
+ .prokodo-Pagination__btn {
173
+ width: 40px;
174
+ height: 40px;
175
+ }
176
+ .prokodo-Pagination__page {
177
+ min-width: 36px;
178
+ height: 36px;
179
+ padding: 0 0.25rem;
180
+ border-radius: 10px;
181
+ color: var(--color-grey-700);
182
+ border: 1px solid var(--color-grey-100);
183
+ text-align: center !important;
184
+ }
185
+ html[data-theme=dark] .prokodo-Pagination__page {
186
+ border: 1px solid var(--color-grey-500);
187
+ }
188
+ .prokodo-Pagination__page--active {
189
+ border: none;
190
+ pointer-events: none;
191
+ }
@@ -0,0 +1,12 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import { createIsland } from "../../helpers/createIsland.js";
4
+ import PaginationServer from "./Pagination.server.js";
5
+ const Pagination = createIsland({
6
+ name: "Pagination",
7
+ Server: PaginationServer,
8
+ loadLazy: /* @__PURE__ */ __name(() => import("./Pagination.lazy.js"), "loadLazy")
9
+ });
10
+ export {
11
+ Pagination
12
+ };
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { createLazyWrapper } from "../../helpers/createLazyWrapper.js";
3
+ import PaginationClient from "./Pagination.client.js";
4
+ import PaginationServer from "./Pagination.server.js";
5
+ const Pagination_lazy = createLazyWrapper({
6
+ name: "Pagination",
7
+ Client: PaginationClient,
8
+ Server: PaginationServer
9
+ });
10
+ export {
11
+ Pagination_lazy as default
12
+ };
@@ -0,0 +1,191 @@
1
+ /* stylelint-disable */
2
+ /**
3
+ * Calculates a rem-based value by a given pixel size.
4
+ */
5
+ /* stylelint-disable */
6
+ /**
7
+ * Applies flex-column and gap.
8
+ */
9
+ /*
10
+ As example (light, primary)
11
+ See defined modes in designsystem/config/gradients
12
+ */
13
+ /**
14
+ * Mixin that renders a media query that target screens that are larger than the
15
+ * given size.
16
+ */
17
+ /**
18
+ * Mixin that renders a media query that target screens that are smaller than the
19
+ * given size.
20
+ */
21
+ /**
22
+ * Mixin that renders a media query that target screens in between the given range.
23
+ */
24
+ /**
25
+ * Mixin that renders a media query that target screens that have height larger than the
26
+ * given size.
27
+ */
28
+ /**
29
+ * Mixin that renders a media query that target screens that have height smaller than the
30
+ * given size.
31
+ */
32
+ /* stylelint-disable */
33
+ /* M3/Elevation Light/1 */
34
+ /* M3/Elevation Light/2 */
35
+ /* M3/Elevation/5 */
36
+ /* M3/Elevation/1 Text */
37
+ /* Inner elevations */
38
+ /* stylelint-disable */
39
+ /**
40
+ * Visually hides an element but not removes them for screen readers.
41
+ */
42
+ /**
43
+ * The inverse of the `hidden` helper to reset a previously hidden element to be
44
+ * visible for users.
45
+ */
46
+ /**
47
+ * Creates a selector for :hover effects depending on the current user input
48
+ * device. If the input device is a mouse, this hover effect will appear.
49
+ * Keyboard and touch inputs are ignored.
50
+ *
51
+ * Example usage:
52
+ * .link {
53
+ * color: blue;
54
+ *
55
+ * @include when-hovered() {
56
+ * color: green;
57
+ * }
58
+ * }
59
+ */
60
+ /**
61
+ * Creates a selector for :active effects depending on the current user input
62
+ * device. The state applies when the input device is a mouse or keyboard. Touch
63
+ * devices will not show a pressed state.
64
+ *
65
+ * Example usage:
66
+ * .link {
67
+ * box-shadow: none;
68
+ *
69
+ * @include when-pressed() {
70
+ * box-shadow: inset 0 2px 4px grey;
71
+ * }
72
+ * }
73
+ */
74
+ /**
75
+ * Creates a selector for :focus effects depending on the current user input
76
+ * device. When the user navigates using a keyboard, the focus effect defined in
77
+ * here is applied. For other input devices they don't show up.
78
+ *
79
+ * Example usage:
80
+ * .link {
81
+ * text-decoration: none;
82
+ *
83
+ * @include when-focused() {
84
+ * text-decoration: underline;
85
+ * }
86
+ * }
87
+ */
88
+ /**
89
+ * Creates a selector for :focus-within effects depending on the current user
90
+ * input device. When the user navigates using a keyboard, the focus effect
91
+ * defined in here is applied. For other input devices they don't show up.
92
+ *
93
+ * Example usage:
94
+ * .link {
95
+ * img {
96
+ * opacity: 0.75;
97
+ *
98
+ * @include when-focused-within() {
99
+ * opacity: 1;
100
+ * }
101
+ * }
102
+ * }
103
+ */
104
+ /**
105
+ * Wrapper for media query "prefers-reduced-motion".
106
+ */
107
+ /**
108
+ * This helper hides the outline but still makes it visible for
109
+ * Windows high-contrast users. Use this instead of `outline: 0;`.
110
+ */
111
+ /**
112
+ * This helper hides the outline but still makes it visible for
113
+ * Windows high-contrast users. Use this instead of `outline: 0;`.
114
+ */
115
+ /**
116
+ * Renders an alternative, but application consistent focus-ring.
117
+ */
118
+ /**
119
+ * Specifies the outer layout for all contents across breakpoints. Apply this
120
+ * mixin to the container element, to center the contents on the screen within
121
+ * the layout offsets.
122
+ */
123
+ /**
124
+ * This mixin specifies basic text-styles for components that render a richtext
125
+ * content.
126
+ */
127
+ .prokodo-Pagination {
128
+ display: inline-flex;
129
+ align-items: center;
130
+ gap: 0.5rem;
131
+ }
132
+ .prokodo-Pagination__list {
133
+ display: inline-flex;
134
+ align-items: center;
135
+ gap: 0.5rem;
136
+ margin: 0;
137
+ padding: 0;
138
+ list-style: none;
139
+ }
140
+ .prokodo-Pagination__item {
141
+ display: inline-flex;
142
+ align-items: center;
143
+ }
144
+ .prokodo-Pagination__ellipsis {
145
+ color: var(--color-grey-700);
146
+ padding: 0 0.25rem;
147
+ -webkit-user-select: none;
148
+ -moz-user-select: none;
149
+ user-select: none;
150
+ font-weight: 400;
151
+ font-size: 1rem;
152
+ font-family: var(--font-secondary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
153
+ font-style: normal;
154
+ line-height: 1.45;
155
+ letter-spacing: 0.03em;
156
+ text-transform: none;
157
+ text-align: left;
158
+ text-decoration: none;
159
+ }
160
+ @media screen and (min-width: 480px) {
161
+ .prokodo-Pagination__ellipsis {
162
+ font-size: 0.875rem;
163
+ line-height: 1.4;
164
+ }
165
+ }
166
+ @media screen and (min-width: 960px) {
167
+ .prokodo-Pagination__ellipsis {
168
+ font-size: 0.875rem;
169
+ line-height: 1.4;
170
+ }
171
+ }
172
+ .prokodo-Pagination__btn {
173
+ width: 40px;
174
+ height: 40px;
175
+ }
176
+ .prokodo-Pagination__page {
177
+ min-width: 36px;
178
+ height: 36px;
179
+ padding: 0 0.25rem;
180
+ border-radius: 10px;
181
+ color: var(--color-grey-700);
182
+ border: 1px solid var(--color-grey-100);
183
+ text-align: center !important;
184
+ }
185
+ html[data-theme=dark] .prokodo-Pagination__page {
186
+ border: 1px solid var(--color-grey-500);
187
+ }
188
+ .prokodo-Pagination__page--active {
189
+ border: none;
190
+ pointer-events: none;
191
+ }
@@ -0,0 +1,12 @@
1
+ const styles = {
2
+ "prokodo-Pagination": "prokodo-Pagination",
3
+ "prokodo-Pagination__list": "prokodo-Pagination__list",
4
+ "prokodo-Pagination__item": "prokodo-Pagination__item",
5
+ "prokodo-Pagination__ellipsis": "prokodo-Pagination__ellipsis",
6
+ "prokodo-Pagination__btn": "prokodo-Pagination__btn",
7
+ "prokodo-Pagination__page": "prokodo-Pagination__page",
8
+ "prokodo-Pagination__page--active": "prokodo-Pagination__page--active"
9
+ };
10
+ export {
11
+ styles as default
12
+ };
@@ -0,0 +1,11 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { PaginationView } from "./Pagination.view.js";
5
+ function PaginationServer(p) {
6
+ return /* @__PURE__ */ jsx(PaginationView, { ...p, readOnly: true });
7
+ }
8
+ __name(PaginationServer, "PaginationServer");
9
+ export {
10
+ PaginationServer as default
11
+ };
@@ -0,0 +1,55 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ function clampInt(v, min, max) {
4
+ if (!Number.isFinite(v)) return min;
5
+ const x = Math.trunc(v);
6
+ return Math.min(max, Math.max(min, x));
7
+ }
8
+ __name(clampInt, "clampInt");
9
+ function buildPaginationItems(args) {
10
+ const total = Math.max(1, Math.trunc(args.totalPages));
11
+ const page = clampInt(args.page, 1, total);
12
+ const siblings = Math.max(0, Math.trunc(args.siblingCount));
13
+ const boundaries = Math.max(0, Math.trunc(args.boundaryCount));
14
+ const maxVisible = boundaries * 2 + siblings * 2 + 3 + 2;
15
+ if (total <= maxVisible) {
16
+ return Array.from({ length: total }, (_, i) => ({
17
+ type: "page",
18
+ value: i + 1
19
+ }));
20
+ }
21
+ const items = [];
22
+ const startPages = Array.from({ length: boundaries }, (_, i) => i + 1);
23
+ const endPages = Array.from(
24
+ { length: boundaries },
25
+ (_, i) => total - boundaries + 1 + i
26
+ );
27
+ const siblingsStart = Math.max(boundaries + 2, page - siblings);
28
+ const siblingsEnd = Math.min(total - boundaries - 1, page + siblings);
29
+ for (const p of startPages) items.push({ type: "page", value: p });
30
+ if (siblingsStart > boundaries + 2) {
31
+ items.push({ type: "ellipsis", key: "start-ellipsis" });
32
+ } else {
33
+ items.push({ type: "page", value: boundaries + 1 });
34
+ }
35
+ for (let p = siblingsStart; p <= siblingsEnd; p++) {
36
+ items.push({ type: "page", value: p });
37
+ }
38
+ if (siblingsEnd < total - boundaries - 1) {
39
+ items.push({ type: "ellipsis", key: "end-ellipsis" });
40
+ } else {
41
+ items.push({ type: "page", value: total - boundaries });
42
+ }
43
+ for (const p of endPages) items.push({ type: "page", value: p });
44
+ const seen = /* @__PURE__ */ new Set();
45
+ return items.filter((it) => {
46
+ const key = it.type === "page" ? `p-${it.value}` : `e-${it.key}`;
47
+ if (seen.has(key)) return false;
48
+ seen.add(key);
49
+ return true;
50
+ });
51
+ }
52
+ __name(buildPaginationItems, "buildPaginationItems");
53
+ export {
54
+ buildPaginationItems
55
+ };
@@ -0,0 +1,98 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import { jsxs, jsx } from "react/jsx-runtime";
4
+ import { create } from "../../helpers/bem.js";
5
+ import styles from "./Pagination.module.scss.js";
6
+ import { buildPaginationItems } from "./Pagination.utils.js";
7
+ import { Button } from "../button/Button.js";
8
+ const bem = create(styles, "Pagination");
9
+ function PaginationView({
10
+ className,
11
+ page,
12
+ totalPages,
13
+ disabled,
14
+ isPending,
15
+ siblingCount = 1,
16
+ boundaryCount = 1,
17
+ onPrev,
18
+ onNext,
19
+ onPageChange,
20
+ readOnly,
21
+ translations: t
22
+ }) {
23
+ const safeTotal = Math.max(1, Math.trunc(totalPages));
24
+ const safePage = Math.min(safeTotal, Math.max(1, Math.trunc(page)));
25
+ if (safeTotal <= 1) return null;
26
+ const isDisabled = Boolean(disabled) || Boolean(isPending) || Boolean(readOnly);
27
+ const items = buildPaginationItems({
28
+ page: safePage,
29
+ totalPages: safeTotal,
30
+ siblingCount,
31
+ boundaryCount
32
+ });
33
+ return /* @__PURE__ */ jsxs(
34
+ "nav",
35
+ {
36
+ "aria-label": (t == null ? void 0 : t.pagination) ?? "Pagination",
37
+ className: bem(void 0, void 0, className),
38
+ children: [
39
+ /* @__PURE__ */ jsx(
40
+ Button,
41
+ {
42
+ "aria-label": (t == null ? void 0 : t.prev) ?? "Previous page",
43
+ className: bem("btn"),
44
+ disabled: isDisabled || safePage <= 1,
45
+ iconProps: { name: "ArrowLeft01Icon" },
46
+ variant: "outlined",
47
+ onClick: isDisabled ? void 0 : onPrev ?? (() => {
48
+ onPageChange == null ? void 0 : onPageChange(safePage - 1);
49
+ })
50
+ }
51
+ ),
52
+ /* @__PURE__ */ jsx("ul", { className: bem("list"), children: items.map((it) => {
53
+ var _a, _b, _c;
54
+ if (it.type === "ellipsis") {
55
+ return /* @__PURE__ */ jsx(
56
+ "li",
57
+ {
58
+ className: bem("item"),
59
+ children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: bem("ellipsis"), children: "…" })
60
+ },
61
+ `${safePage}-${safeTotal}-${it.key}`
62
+ );
63
+ }
64
+ const isActive = it.value === safePage;
65
+ return /* @__PURE__ */ jsx("li", { className: bem("item"), children: /* @__PURE__ */ jsx(
66
+ Button,
67
+ {
68
+ "aria-current": isActive ? "page" : void 0,
69
+ className: bem("page", { active: isActive }),
70
+ disabled: isDisabled || isActive,
71
+ title: (_a = it.value) == null ? void 0 : _a.toString(),
72
+ variant: isActive ? "outlined" : "text",
73
+ "aria-label": isActive ? ((_b = t == null ? void 0 : t.pageCurrent) == null ? void 0 : _b.replace("{page}", String(it.value))) ?? `Current page ${it.value}` : ((_c = t == null ? void 0 : t.pageGoTo) == null ? void 0 : _c.replace("{page}", String(it.value))) ?? `Go to page ${it.value}`,
74
+ onClick: isDisabled ? void 0 : () => onPageChange == null ? void 0 : onPageChange(it.value)
75
+ }
76
+ ) }, it.value);
77
+ }) }),
78
+ /* @__PURE__ */ jsx(
79
+ Button,
80
+ {
81
+ "aria-label": (t == null ? void 0 : t.next) ?? "Next page",
82
+ className: bem("btn"),
83
+ disabled: isDisabled || safePage >= safeTotal,
84
+ iconProps: { name: "ArrowRight01Icon" },
85
+ variant: "outlined",
86
+ onClick: isDisabled ? void 0 : onNext ?? (() => {
87
+ onPageChange == null ? void 0 : onPageChange(safePage + 1);
88
+ })
89
+ }
90
+ )
91
+ ]
92
+ }
93
+ );
94
+ }
95
+ __name(PaginationView, "PaginationView");
96
+ export {
97
+ PaginationView
98
+ };
@@ -0,0 +1,4 @@
1
+ import { Pagination } from "./Pagination.js";
2
+ export {
3
+ Pagination
4
+ };
@@ -213,7 +213,6 @@ html[data-theme=dark] .prokodo-RichText__pre {
213
213
  .prokodo-RichText__ul, .prokodo-RichText__ol {
214
214
  padding: 0;
215
215
  list-style-type: none;
216
- color: var(--color-grey-500);
217
216
  }
218
217
  .prokodo-RichText__li {
219
218
  display: flex;