@nl-rvo/css-image 1.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @nl-rvo/css-image
2
+
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - ebe26f1: Introduce a new image component.
package/LICENSE.md ADDED
@@ -0,0 +1,124 @@
1
+ # Creative Commons Legal Code
2
+
3
+ ## CC0 1.0 Universal
4
+
5
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12
+ HEREUNDER.
13
+
14
+ ## Statement of Purpose
15
+
16
+ The laws of most jurisdictions throughout the world automatically confer
17
+ exclusive Copyright and Related Rights (defined below) upon the creator
18
+ and subsequent owner(s) (each and all, an "owner") of an original work of
19
+ authorship and/or a database (each, a "Work").
20
+
21
+ Certain owners wish to permanently relinquish those rights to a Work for
22
+ the purpose of contributing to a commons of creative, cultural and
23
+ scientific works ("Commons") that the public can reliably and without fear
24
+ of later claims of infringement build upon, modify, incorporate in other
25
+ works, reuse and redistribute as freely as possible in any form whatsoever
26
+ and for any purposes, including without limitation commercial purposes.
27
+ These owners may contribute to the Commons to promote the ideal of a free
28
+ culture and the further production of creative, cultural and scientific
29
+ works, or to gain reputation or greater distribution for their Work in
30
+ part through the use and efforts of others.
31
+
32
+ For these and/or other purposes and motivations, and without any
33
+ expectation of additional consideration or compensation, the person
34
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35
+ is an owner of Copyright and Related Rights in the Work, voluntarily
36
+ elects to apply CC0 to the Work and publicly distribute the Work under its
37
+ terms, with knowledge of his or her Copyright and Related Rights in the
38
+ Work and the meaning and intended legal effect of CC0 on those rights.
39
+
40
+ ## 1. Copyright and Related Rights
41
+
42
+ A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
43
+
44
+ i. the right to reproduce, adapt, distribute, perform, display,
45
+ communicate, and translate a Work;
46
+ ii. moral rights retained by the original author(s) and/or performer(s);
47
+ iii. publicity and privacy rights pertaining to a person's image or
48
+ likeness depicted in a Work;
49
+ iv. rights protecting against unfair competition in regards to a Work,
50
+ subject to the limitations in paragraph 4(a), below;
51
+ v. rights protecting the extraction, dissemination, use and reuse of data
52
+ in a Work;
53
+ vi. database rights (such as those arising under Directive 96/9/EC of the
54
+ European Parliament and of the Council of 11 March 1996 on the legal
55
+ protection of databases, and under any national implementation
56
+ thereof, including any amended or successor version of such
57
+ directive); and
58
+ vii. other similar, equivalent or corresponding rights throughout the
59
+ world based on applicable law or treaty, and any national
60
+ implementations thereof.
61
+
62
+ ## 2. Waiver
63
+
64
+ To the greatest extent permitted by, but not in contravention
65
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
66
+ irrevocably and unconditionally waives, abandons, and surrenders all of
67
+ Affirmer's Copyright and Related Rights and associated claims and causes
68
+ of action, whether now known or unknown (including existing as well as
69
+ future claims and causes of action), in the Work (i) in all territories
70
+ worldwide, (ii) for the maximum duration provided by applicable law or
71
+ treaty (including future time extensions), (iii) in any current or future
72
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
73
+ including without limitation commercial, advertising or promotional
74
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
75
+ member of the public at large and to the detriment of Affirmer's heirs and
76
+ successors, fully intending that such Waiver shall not be subject to
77
+ revocation, rescission, cancellation, termination, or any other legal or
78
+ equitable action to disrupt the quiet enjoyment of the Work by the public
79
+ as contemplated by Affirmer's express Statement of Purpose.
80
+
81
+ ## 3. Public License Fallback
82
+
83
+ Should any part of the Waiver for any reason
84
+ be judged legally invalid or ineffective under applicable law, then the
85
+ Waiver shall be preserved to the maximum extent permitted taking into
86
+ account Affirmer's express Statement of Purpose. In addition, to the
87
+ extent the Waiver is so judged Affirmer hereby grants to each affected
88
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
89
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
90
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
91
+ maximum duration provided by applicable law or treaty (including future
92
+ time extensions), (iii) in any current or future medium and for any number
93
+ of copies, and (iv) for any purpose whatsoever, including without
94
+ limitation commercial, advertising or promotional purposes (the
95
+ "License"). The License shall be deemed effective as of the date CC0 was
96
+ applied by Affirmer to the Work. Should any part of the License for any
97
+ reason be judged legally invalid or ineffective under applicable law, such
98
+ partial invalidity or ineffectiveness shall not invalidate the remainder
99
+ of the License, and in such case Affirmer hereby affirms that he or she
100
+ will not (i) exercise any of his or her remaining Copyright and Related
101
+ Rights in the Work or (ii) assert any associated claims and causes of
102
+ action with respect to the Work, in either case contrary to Affirmer's
103
+ express Statement of Purpose.
104
+
105
+ ## 4. Limitations and Disclaimers
106
+
107
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
108
+ surrendered, licensed or otherwise affected by this document.
109
+ b. Affirmer offers the Work as-is and makes no representations or
110
+ warranties of any kind concerning the Work, express, implied,
111
+ statutory or otherwise, including without limitation warranties of
112
+ title, merchantability, fitness for a particular purpose, non
113
+ infringement, or the absence of latent or other defects, accuracy, or
114
+ the present or absence of errors, whether or not discoverable, all to
115
+ the greatest extent permissible under applicable law.
116
+ c. Affirmer disclaims responsibility for clearing rights of other persons
117
+ that may apply to the Work or any use thereof, including without
118
+ limitation any person's Copyright and Related Rights in the Work.
119
+ Further, Affirmer disclaims responsibility for obtaining any necessary
120
+ consents, permissions or other rights required for any use of the
121
+ Work.
122
+ d. Affirmer understands and acknowledges that Creative Commons is not a
123
+ party to this document and has no duty or obligation with respect to
124
+ this CC0 or use of the Work.
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # Image component
2
+
3
+ Een toegankelijke, responsieve afbeeldingcomponent voor het NL Design System. En het tonen van een afbeelding op een duurzame en toegankelijke manier.
4
+
5
+ De **Image** component toont afbeeldingen op een consistente en toegankelijke manier, met optionele bijschriften, afgeronde hoeken op basis van design tokens en ondersteuning voor responsieve `<picture>`-bronnen.
6
+ Gebruik deze component voor contentafbeeldingen, hero-secties of illustraties die onderdeel zijn van de inhoudsstructuur.
7
+
8
+ ---
9
+
10
+ ## Kenmerken
11
+
12
+ - Responsief: ondersteunt `<picture>` met meerdere bronformaten.
13
+ - Toegankelijk: vereist `alt`-tekst en ondersteunt `caption` via `<figure>` en `<figcaption>`.
14
+ - Design tokens: radius-groottes en spacing volgen het tokensysteem.
15
+ - Prestatiegericht: optionele ondersteuning voor `loading`, `decoding` en `fetchPriority`.
16
+ - Herbruikbaar: geschikt voor gebruik binnen elk project als zelfstandige React-component.
17
+
18
+ ## Richtlijnen
19
+
20
+ - Gebruik bij voorkeur het WebP-bestandsformaat voor afbeeldingen die zijn opgebouwd uit pixels, zoals foto's, screenshots en complexe afbeeldingen. Als het niet mogelijk is om WebP te gebruiken, hanteer dan het JPG- of PNG-formaat.
21
+ - Gebruik het SVG-bestandsformaat voor afbeeldingen die zijn opgebouwd uit geometrische vormen (vectorafbeeldingen), zoals logo's, iconen, illustraties, grafieken en diagrammen.
22
+ - Laad een afbeelding in met de juiste grootte. Bijvoorbeeld: als de container een maximale breedte heeft van 1280 pixels, zorg er dan voor dat de afbeelding ook met een breedte van 1280 pixels, en niet groter, wordt ingeladen.
23
+ - Bied waar mogelijk meerdere variaties van een afbeelding aan om retinaschermen te ondersteunen.
24
+ - Stel de kwaliteit van rasterafbeeldingen (WebP, JPG en PNG) in op maximaal 85 procent. Dit maakt de bestandsgrootte kleiner, want alles boven 85 procent is voor het menselijk oog niet zichtbaar.
25
+ - Geef elke afbeelding die belangrijk is om de inhoud te begrijpen een alt-tekst mee die de inhoud van de afbeelding duidelijk omschrijft voor gebruikers die een schermlezer gebruiken.
26
+ - Als een afbeelding enkel decoratief is, geef de afbeelding wel een alt-attribuut mee, maar laat deze leeg.
27
+
28
+ ## Wanneer gebruik je image
29
+
30
+ Als er een afbeelding getoond moet worden.
@@ -0,0 +1,38 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/design-tokens/community-group/main/schemas/tokens.json",
3
+ "rvo-image": {
4
+ "description": "Design tokens for the RVO Image component.",
5
+ "tokens": {
6
+ "width": {
7
+ "value": "auto",
8
+ "type": "sizing",
9
+ "description": "Standaard afbeeldingsbreedte."
10
+ },
11
+ "height": {
12
+ "value": "auto",
13
+ "type": "sizing",
14
+ "description": "Standaard afbeeldingshoogte."
15
+ },
16
+ "max-width": {
17
+ "value": "100%",
18
+ "type": "sizing",
19
+ "description": "Maximale breedte van de afbeelding."
20
+ },
21
+ "object-fit": {
22
+ "value": "cover",
23
+ "type": "other",
24
+ "description": "Bepaalt hoe de afbeelding binnen zijn kader past."
25
+ },
26
+ "object-position": {
27
+ "value": "center",
28
+ "type": "other",
29
+ "description": "Bepaalt de positie van de afbeelding binnen zijn kader."
30
+ },
31
+ "border-radius": {
32
+ "value": "{rvo-border-radius.2xl}",
33
+ "type": "borderRadius",
34
+ "description": "Hoekafronding van de afbeelding. Wordt beïnvloed door radius-varianten."
35
+ }
36
+ }
37
+ }
38
+ }
package/dist/index.css ADDED
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @license CC0-1.0
3
+ * Copyright (c) 2025 Community for NL Design System
4
+ */
5
+ .rvo-image {
6
+ --rvo-image-width: auto;
7
+ --rvo-image-height: auto;
8
+ --rvo-image-max-width: 100%;
9
+ --rvo-image-object-fit: cover;
10
+ --rvo-image-object-position: center;
11
+ --rvo-image-border-radius: var(--rvo-border-radius-2xl, 4px);
12
+ display: block;
13
+ height: var(--rvo-image-height);
14
+ max-width: var(--rvo-image-max-width);
15
+ object-fit: var(--rvo-image-object-fit);
16
+ object-position: var(--rvo-image-object-position);
17
+ width: var(--rvo-image-width);
18
+ }
19
+ .rvo-image--radius-size-sm {
20
+ --rvo-image-border-radius: var(--rvo-border-radius-sm, 3px);
21
+ }
22
+ .rvo-image--radius-size-md {
23
+ --rvo-image-border-radius: var(--rvo-border-radius-md, 5px);
24
+ }
25
+ .rvo-image--radius-size-lg {
26
+ --rvo-image-border-radius: var(--rvo-border-radius-lg, 10px);
27
+ }
28
+ .rvo-image--radius-size-xl {
29
+ --rvo-image-border-radius: var(--rvo-border-radius-xl, 20px);
30
+ }
31
+ .rvo-image--radius-size-2xl {
32
+ --rvo-image-border-radius: var(--rvo-border-radius-2xl, 50px);
33
+ }
34
+ .rvo-image--radius-all {
35
+ border-radius: var(--rvo-image-border-radius);
36
+ }
37
+ .rvo-image--radius-top-left {
38
+ border-start-start-radius: var(--rvo-image-border-radius);
39
+ }
40
+ .rvo-image--radius-top-right {
41
+ border-start-end-radius: var(--rvo-image-border-radius);
42
+ }
43
+ .rvo-image--radius-bottom-right {
44
+ border-end-end-radius: var(--rvo-image-border-radius);
45
+ }
46
+ .rvo-image--radius-bottom-left {
47
+ border-end-start-radius: var(--rvo-image-border-radius);
48
+ }
49
+ .rvo-image__wrapper {
50
+ display: inline-block;
51
+ line-height: 0;
52
+ margin: 0;
53
+ }
@@ -0,0 +1 @@
1
+ .rvo-image{--rvo-image-width:auto;--rvo-image-height:auto;--rvo-image-max-width:100%;--rvo-image-object-fit:cover;--rvo-image-object-position:center;--rvo-image-border-radius:var(--rvo-border-radius-2xl,4px);display:block;height:var(--rvo-image-height);max-width:var(--rvo-image-max-width);object-fit:var(--rvo-image-object-fit);object-position:var(--rvo-image-object-position);width:var(--rvo-image-width)}.rvo-image--radius-size-sm{--rvo-image-border-radius:var(--rvo-border-radius-sm,3px)}.rvo-image--radius-size-md{--rvo-image-border-radius:var(--rvo-border-radius-md,5px)}.rvo-image--radius-size-lg{--rvo-image-border-radius:var(--rvo-border-radius-lg,10px)}.rvo-image--radius-size-xl{--rvo-image-border-radius:var(--rvo-border-radius-xl,20px)}.rvo-image--radius-size-2xl{--rvo-image-border-radius:var(--rvo-border-radius-2xl,50px)}.rvo-image--radius-all{border-radius:var(--rvo-image-border-radius)}.rvo-image--radius-top-left{border-start-start-radius:var(--rvo-image-border-radius)}.rvo-image--radius-top-right{border-start-end-radius:var(--rvo-image-border-radius)}.rvo-image--radius-bottom-right{border-end-end-radius:var(--rvo-image-border-radius)}.rvo-image--radius-bottom-left{border-end-start-radius:var(--rvo-image-border-radius)}.rvo-image__wrapper{display:inline-block;line-height:0;margin:0}
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export default ".rvo-image{--rvo-image-width:auto;--rvo-image-height:auto;--rvo-image-max-width:100%;--rvo-image-object-fit:cover;--rvo-image-object-position:center;--rvo-image-border-radius:var(--rvo-border-radius-2xl,4px);display:block;height:var(--rvo-image-height);max-width:var(--rvo-image-max-width);object-fit:var(--rvo-image-object-fit);object-position:var(--rvo-image-object-position);width:var(--rvo-image-width)}.rvo-image--radius-size-sm{--rvo-image-border-radius:var(--rvo-border-radius-sm,3px)}.rvo-image--radius-size-md{--rvo-image-border-radius:var(--rvo-border-radius-md,5px)}.rvo-image--radius-size-lg{--rvo-image-border-radius:var(--rvo-border-radius-lg,10px)}.rvo-image--radius-size-xl{--rvo-image-border-radius:var(--rvo-border-radius-xl,20px)}.rvo-image--radius-size-2xl{--rvo-image-border-radius:var(--rvo-border-radius-2xl,50px)}.rvo-image--radius-all{border-radius:var(--rvo-image-border-radius)}.rvo-image--radius-top-left{border-start-start-radius:var(--rvo-image-border-radius)}.rvo-image--radius-top-right{border-start-end-radius:var(--rvo-image-border-radius)}.rvo-image--radius-bottom-right{border-end-end-radius:var(--rvo-image-border-radius)}.rvo-image--radius-bottom-left{border-end-start-radius:var(--rvo-image-border-radius)}.rvo-image__wrapper{display:inline-block;line-height:0;margin:0}";
@@ -0,0 +1,2 @@
1
+ declare const css: string;
2
+ export default css;
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "author": "Community for NL Design System",
4
+ "license": "CC0-1.0",
5
+ "name": "@nl-rvo/css-image",
6
+ "description": "Image CSS component",
7
+ "keywords": [
8
+ "nl-design-system",
9
+ "css",
10
+ "image"
11
+ ],
12
+ "files": [
13
+ "src/index.scss",
14
+ "dist/",
15
+ "design-tokens.json",
16
+ "*.md"
17
+ ],
18
+ "main": "dist/index.css",
19
+ "style": "dist/index.css",
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "repository": {
24
+ "type": "git+ssh",
25
+ "url": "git@github.com:nl-design-system/rvo.git",
26
+ "directory": "components/image"
27
+ },
28
+ "devDependencies": {
29
+ "@nl-rvo/build-utils-css": "0.0.1"
30
+ },
31
+ "scripts": {
32
+ "build": "build-css-package",
33
+ "clean": "rimraf dist"
34
+ }
35
+ }
package/src/index.scss ADDED
@@ -0,0 +1,70 @@
1
+ /**
2
+ * @license CC0-1.0
3
+ * Copyright (c) 2025 Community for NL Design System
4
+ */
5
+
6
+ .rvo-image {
7
+ --rvo-image-width: auto;
8
+ --rvo-image-height: auto;
9
+ --rvo-image-max-width: 100%;
10
+ --rvo-image-object-fit: cover;
11
+ --rvo-image-object-position: center;
12
+ --rvo-image-border-radius: var(--rvo-border-radius-2xl, 4px);
13
+
14
+ display: block;
15
+ height: var(--rvo-image-height);
16
+ max-width: var(--rvo-image-max-width);
17
+ object-fit: var(--rvo-image-object-fit);
18
+ object-position: var(--rvo-image-object-position);
19
+ width: var(--rvo-image-width);
20
+
21
+ &--radius-size {
22
+ &-sm {
23
+ --rvo-image-border-radius: var(--rvo-border-radius-sm, 3px);
24
+ }
25
+
26
+ &-md {
27
+ --rvo-image-border-radius: var(--rvo-border-radius-md, 5px);
28
+ }
29
+
30
+ &-lg {
31
+ --rvo-image-border-radius: var(--rvo-border-radius-lg, 10px);
32
+ }
33
+
34
+ &-xl {
35
+ --rvo-image-border-radius: var(--rvo-border-radius-xl, 20px);
36
+ }
37
+
38
+ &-2xl {
39
+ --rvo-image-border-radius: var(--rvo-border-radius-2xl, 50px);
40
+ }
41
+ }
42
+
43
+ &--radius {
44
+ &-all {
45
+ border-radius: var(--rvo-image-border-radius);
46
+ }
47
+
48
+ &-top-left {
49
+ border-start-start-radius: var(--rvo-image-border-radius);
50
+ }
51
+
52
+ &-top-right {
53
+ border-start-end-radius: var(--rvo-image-border-radius);
54
+ }
55
+
56
+ &-bottom-right {
57
+ border-end-end-radius: var(--rvo-image-border-radius);
58
+ }
59
+
60
+ &-bottom-left {
61
+ border-end-start-radius: var(--rvo-image-border-radius);
62
+ }
63
+ }
64
+
65
+ &__wrapper {
66
+ display: inline-block;
67
+ line-height: 0; /* removes white gap under inline-block images */
68
+ margin: 0;
69
+ }
70
+ }