@pokela/components 2.0.0 → 2.2.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @pokela/components
2
2
 
3
- React-komponentit: **Pokela Design System**, versio 2.0.0.
3
+ React-komponentit: **Pokela Design System**, versio 2.2.0.
4
4
 
5
5
  > Generoitu hakemistosta `components/` — samoista tiedostoista joita sivusto
6
6
  > ajaa. Älä muokkaa käsin: muutokset tehdään lähteeseen ja paketti
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pokela/components",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "React-komponentit: Pokela Design System. Generoitu tiedostoista components/, ei käsin ylläpidetty.",
5
5
  "license": "MIT",
6
6
  "author": "Veli-Matti Pokela",
@@ -25,7 +25,7 @@
25
25
  "LICENSE"
26
26
  ],
27
27
  "dependencies": {
28
- "@pokela/tokens": "^2.0.0"
28
+ "@pokela/tokens": "^2.2.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "react": ">=18"
package/styles/base.css CHANGED
@@ -275,6 +275,59 @@ a:hover { text-decoration: underline; text-underline-offset: var(--space-4); }
275
275
 
276
276
  .media-fill { width: 100%; height: 100%; object-fit: cover; }
277
277
 
278
+ /* Levy: kuva kokonaisena hillityn taustalevyn keskellä.
279
+ Kuvakaappauksen oma tausta osui ennen suoraan sivun taustaa vasten,
280
+ ja raja näytti sattumanvaraiselta. Levy antaa jokaiselle kuvalle
281
+ saman rajan, oli kuva vaalea, tumma tai kapea puhelinkaappaus.
282
+ Kulmat terävinä ja hiusviiva kuten muuallakin sivulla. */
283
+ .media--levy {
284
+ display: flex;
285
+ align-items: center;
286
+ justify-content: center;
287
+ padding: var(--space-24);
288
+ background: var(--badge-surface);
289
+ box-shadow: inset 0 0 0 var(--hairline) var(--line);
290
+ }
291
+ @media (min-width: 900px) { .media--levy { padding: var(--space-40); } }
292
+ .media__levy {
293
+ display: flex;
294
+ align-items: center;
295
+ justify-content: center;
296
+ width: 100%;
297
+ height: 100%;
298
+ min-height: 0;
299
+ }
300
+ /* Varjo on aina tumma (--ink-l eikä teemaa seuraava --ink): vaalea
301
+ varjo tummalla levyllä olisi hehku, ei varjo. Tummassa teemassa se
302
+ jää lähes näkymättömäksi, ja hiusviiva kantaa rajan. */
303
+ .media__levy-kuva {
304
+ display: block;
305
+ width: auto;
306
+ height: auto;
307
+ max-width: 100%;
308
+ max-height: 100%;
309
+ outline: var(--hairline) solid var(--line);
310
+ box-shadow: 0 var(--space-12) var(--space-32) calc(var(--space-8) * -1)
311
+ color-mix(in srgb, var(--ink-l) 22%, transparent);
312
+ }
313
+
314
+ /* Hero: tausta jatkuu ruudun reunoihin, kuva pysyy sivun levyisenä.
315
+ border-image piirtää nauhan laatikon ulkopuolelle (outset) ilman
316
+ lisäelementtiä, joten jokainen hero saa sen samasta paikasta. Ulos
317
+ piirretty kuuluu näkyvään eikä vieritettävään ylivuotoon, joten
318
+ 100vw ei tuo vaakavierityspalkkia. margin-block varaa nauhalle
319
+ tilan, ettei se peitä viereisiä osioita. */
320
+ .media-hero {
321
+ border-image: linear-gradient(var(--badge-surface) 0 0) fill 0 / / var(--space-40) 100vw;
322
+ margin-block: var(--space-40);
323
+ }
324
+ @media (min-width: 900px) {
325
+ .media-hero {
326
+ border-image-outset: var(--space-72) 100vw;
327
+ margin-block: var(--space-72);
328
+ }
329
+ }
330
+
278
331
  /* Paikanvaraajan merkintä: järjestysnumero ja tunniste. Vain
279
332
  kehityksessä (Media.tsx päättää), ja tarkoitus on että pudotettavan
280
333
  tiedoston nimen voi lukea suoraan sivulta ilman terminaalia.
@@ -130,59 +130,54 @@
130
130
  pystykeskelle. Koko tulee .icon--l:stä. */
131
131
  }
132
132
 
133
- /* ---- käännös ------------------------------------------------------- */
133
+ /* ---- hover ja käännös ---------------------------------------------
134
+
135
+ Hover on hiljainen pinta (--badge-surface), ei käännös. Täysi
136
+ musta/valkoinen-käännös jokaisella hiirenliikkeellä oli liian raju
137
+ molemmissa teemoissa. Käännös jää tilalle joka on oikeasti päällä:
138
+ avattu rivi (`aria-expanded`) ja staattinen `.invert`. */
139
+ .list-row:hover,
140
+ .list-row:focus-visible {
141
+ background: var(--badge-surface);
142
+ text-decoration: none;
143
+ }
144
+ /* Meta tummuu pinnalla: --ink-faint jäisi vaaleassa teemassa
145
+ --badge-surfacen päällä alle AA:n (4,49:1). */
146
+ .list-row:hover .meta,
147
+ .list-row:focus-visible .meta { color: var(--ink-muted); }
134
148
 
135
149
  /* `.invert` on mukana, jotta tila voidaan näyttää myös staattisena
136
150
  (esim. dokumentaatiossa) ilman omaa sääntöä — muuten .list-row:n
137
151
  oma `color` voittaisi utilityn samalla spesifisyydellä ja teksti
138
152
  jäisi näkymättömiin. `aria-expanded` on avatun rivin sama tila. */
139
- .list-row:hover,
140
- .list-row:focus-visible,
141
153
  .list-row.invert,
142
154
  .list-row[aria-expanded='true'] {
143
155
  background: var(--invert-surface);
144
156
  color: var(--invert-ink);
145
157
  text-decoration: none;
146
158
  }
147
- .list-row:hover .list-row__description,
148
- .list-row:focus-visible .list-row__description,
149
159
  .list-row.invert .list-row__description,
150
160
  .list-row[aria-expanded='true'] .list-row__description,
151
- .list-row:hover .meta,
152
- .list-row:focus-visible .meta,
153
161
  .list-row.invert .meta,
154
162
  .list-row[aria-expanded='true'] .meta { color: var(--invert-faint); }
155
163
 
156
- /* Focus-renkaan pitää näkyä käännetyllä pinnalla. */
157
- .list-row:focus-visible {
158
- outline-color: var(--invert-ink);
159
- outline-offset: calc(var(--focus-offset) * -2);
160
- }
164
+ /* Focus-renkaan pitää näkyä myös käännetyllä pinnalla. */
165
+ .list-row:focus-visible { outline-offset: calc(var(--focus-offset) * -2); }
166
+ .list-row[aria-expanded='true']:focus-visible { outline-color: var(--invert-ink); }
161
167
 
162
168
  /* Sisarrivit vaimennetaan hoverin aikana. */
163
169
  .list-rows:hover .list-row:not(:hover) { color: var(--ink-faint); }
164
170
  .list-rows:hover .list-row:not(:hover) .list-row__description { color: var(--ink-faint); }
165
171
 
166
- /* Kosketus: ei hoveria, käännös :active-tilassa. Viimeisenä = voittaa. */
172
+ /* Kosketus: ei hoveria, hiljainen pinta :active-tilassa. Viimeisenä = voittaa. */
167
173
  @media (hover: none) {
168
- .list-row:hover {
169
- background: transparent;
170
- color: var(--ink);
171
- }
172
- .list-row:hover .list-row__description { color: var(--ink-muted); }
174
+ .list-row:hover { background: transparent; }
173
175
  .list-row:hover .meta { color: var(--ink-faint); }
174
176
  .list-rows:hover .list-row:not(:hover) { color: var(--ink); }
175
177
  .list-rows:hover .list-row:not(:hover) .list-row__description { color: var(--ink-muted); }
176
178
 
177
- .list-row:active,
178
- .list-row[aria-expanded='true'] {
179
- background: var(--invert-surface);
180
- color: var(--invert-ink);
181
- }
182
- .list-row:active .list-row__description,
183
- .list-row[aria-expanded='true'] .list-row__description,
184
- .list-row:active .meta,
185
- .list-row[aria-expanded='true'] .meta { color: var(--invert-faint); }
179
+ .list-row:active { background: var(--badge-surface); }
180
+ .list-row:active .meta { color: var(--ink-muted); }
186
181
  }
187
182
 
188
183
  @media (prefers-reduced-motion: reduce) {