@octanejs/sanity-logos 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sanity.io
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,20 @@
1
+ # @octanejs/sanity-logos
2
+
3
+ Octane port of `@sanity/logos@2.2.5`, including `SanityLogo`, `SanityMonogram`,
4
+ `GroqLogo`, and `GroqMonogram`.
5
+
6
+ ```sh
7
+ npm install @octanejs/sanity-logos
8
+ pnpm add @octanejs/sanity-logos
9
+ ```
10
+
11
+ ```tsrx
12
+ import {SanityLogo} from '@octanejs/sanity-logos'
13
+
14
+ export function Brand() @{
15
+ <SanityLogo dark aria-label="Sanity" />
16
+ }
17
+ ```
18
+
19
+ Logo props, Sanity color schemes, custom monogram colors, arbitrary SVG attributes, and
20
+ normal Octane refs are supported.
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@octanejs/sanity-logos",
3
+ "version": "0.1.0",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "engines": {
7
+ "node": ">=22.22.2"
8
+ },
9
+ "description": "Sanity and GROQ brand marks for Octane, matching @sanity/logos.",
10
+ "author": {
11
+ "name": "Dominic Gannaway",
12
+ "email": "dg@domgan.com"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/octanejs/octane.git",
20
+ "directory": "packages/sanity-logos"
21
+ },
22
+ "main": "src/index.ts",
23
+ "module": "src/index.ts",
24
+ "types": "src/index.ts",
25
+ "files": [
26
+ "src",
27
+ "README.md",
28
+ "LICENSE"
29
+ ],
30
+ "sideEffects": false,
31
+ "exports": {
32
+ ".": "./src/index.ts",
33
+ "./package.json": "./package.json"
34
+ },
35
+ "peerDependencies": {
36
+ "octane": "0.1.50"
37
+ },
38
+ "devDependencies": {
39
+ "@sanity/logos": "2.2.5",
40
+ "@tsrx/react": "^0.2.61",
41
+ "esbuild": "^0.28.1",
42
+ "prettier": "^3.9.6",
43
+ "react": "^19.2.7",
44
+ "react-dom": "^19.2.7",
45
+ "vitest": "^4.1.10",
46
+ "octane": "0.1.50"
47
+ },
48
+ "scripts": {
49
+ "generate": "node scripts/generate.mjs",
50
+ "generate:check": "node scripts/generate.mjs --check",
51
+ "test": "vitest run --root ../.. --project sanity-logos --project sanity-logos-ssr",
52
+ "typecheck": "tsgo --noEmit -p tsconfig.json"
53
+ }
54
+ }
package/src/data.ts ADDED
@@ -0,0 +1,89 @@
1
+ /* THIS FILE IS AUTO-GENERATED – DO NOT EDIT */
2
+ export const groqLogo = {
3
+ attributes: {
4
+ 'data-sanity-icon': 'groq-logo',
5
+ height: '1em',
6
+ viewBox: '0 0 304 64',
7
+ fill: 'none',
8
+ xmlns: 'http://www.w3.org/2000/svg',
9
+ },
10
+ body: '<path d="M32 0L0 32H32V0Z" fill="#f0709b"></path><path d="M32 32H0L32 64V32Z" fill="#59f3ba"></path><path d="M64 32H32V64L64 32Z" fill="#ccb1fc"></path><path d="M112 0L80 32H112V0Z" fill="#59f3ba"></path><path d="M112 0H80V32L112 0Z" fill="#ccb1fc"></path><path d="M112 32H80L112 64V32Z" fill="#f9e994"></path><path d="M144 64L112 32V64H144Z" fill="#a8bfff"></path><path d="M80 32V64H112L80 32Z" fill="#ff8e42"></path><path d="M112 0V32H144L112 0Z" fill="#f0709b"></path><path d="M192 0L160 32H192V0Z" fill="#f9e994"></path><path d="M192 32H160L192 64V32Z" fill="#ff8e42"></path><path d="M224 32H192V64L224 32Z" fill="#59f3ba"></path><path d="M192 0V32H224L192 0Z" fill="#a8bfff"></path><path d="M272 0L240 32H272V0Z" fill="#ccb1fc"></path><path d="M304 32L272 64H304V32Z" fill="#f0709b"></path><path d="M272 32H240L272 64V32Z" fill="#a8bfff"></path><path d="M304 32H272V64L304 32Z" fill="#f9e994"></path><path d="M272 0V32H304L272 0Z" fill="#59f3ba"></path>',
11
+ } as const;
12
+
13
+ export const groqMonogram = {
14
+ attributes: {
15
+ 'data-sanity-icon': 'groq-monogram',
16
+ width: '1em',
17
+ height: '1em',
18
+ viewBox: '0 0 128 128',
19
+ fill: 'none',
20
+ xmlns: 'http://www.w3.org/2000/svg',
21
+ },
22
+ body: '<rect width="128" height="128" rx="8" fill="#071715"></rect><rect y="32" width="64" height="64" fill="#023120"></rect><path d="M64 32L32 64H64V32Z" fill="#f0709b"></path><path d="M64 64H32L64 96V64Z" fill="#59f3ba"></path><path d="M96 64H64V96L96 64Z" fill="#ccb1fc"></path>',
23
+ } as const;
24
+
25
+ export const sanityLogoDefault = {
26
+ attributes: {
27
+ 'data-sanity-icon': 'sanity-logo',
28
+ height: '1em',
29
+ viewBox: '0 0 435 154',
30
+ fill: 'none',
31
+ xmlns: 'http://www.w3.org/2000/svg',
32
+ },
33
+ body: '<path d="M44.883 52.4463C33.4181 43.7972 21.8121 37.1021 21.8121 27.3381C21.8121 21.482 26.9827 15.4851 34.1181 15.4851C46.983 15.4851 54.5302 28.8754 61.942 45.6103H66.5538V7.11182H34.3946C7.82952 7.11182 0 23.1543 0 35.7055C0 52.1647 13.5649 61.9287 28.9416 73.365C39.7064 81.3158 48.7948 88.7092 48.7948 97.2175C48.7948 106.424 42.5006 111.723 34.5299 111.723C26.0004 111.723 13.4178 100.562 4.60595 77.4137H0V120.096H36.777C59.4302 120.096 70.7539 102.24 71.1716 87.876C71.7304 71.1411 57.3302 61.7937 44.883 52.4463Z" fill="#0D0E12"></path><path d="M145.002 106.841V61.7878C145.002 42.2598 132.837 37.1021 115.219 37.1021H83.8952L84.0364 68.9054H89.2071C94.6601 55.3743 102.49 45.4754 110.878 45.4754C118.149 45.4754 121.366 51.7539 121.366 58.3082V64.4459C109.619 71.4227 78.301 77.2788 78.301 98.4791C78.301 110.754 86.8306 120.935 99.2778 120.935C110.043 120.935 117.454 113.958 121.231 105.732C121.931 112.568 126.402 120.096 136.614 120.096H152.696V113.958C147.525 113.958 145.008 110.473 145.008 106.847L145.002 106.841ZM120.949 99.8639C118.713 103.074 115.213 106.7 111.019 106.7C105.148 106.7 101.372 102.234 101.372 93.3096C101.372 83.129 115.072 76.5746 120.949 71.6926V99.8697V99.8639Z" fill="#0D0E12"></path><path d="M270.145 28.4529C279.092 28.4529 284.686 22.1744 284.686 14.0885C284.686 6.00274 279.092 0 270.145 0C261.198 0 255.462 5.99688 255.462 14.0885C255.462 22.1802 261.474 28.4529 270.145 28.4529Z" fill="#0D0E12"></path><path d="M409.135 37.102V43.2397C417.947 43.2397 420.459 47.84 416.129 60.2563L405.641 88.5683L392.217 54.1186C389.141 47.4234 390.817 43.2397 397.252 43.2397V37.102H330.557V9.20654H324.263C322.446 18.6889 312.516 37.102 295.598 37.102V43.2397H306.504V100.568C306.504 110.191 309.722 121.07 328.457 121.07H357.54V89.5482H352.37C350.269 96.9417 345.94 111.723 336.569 111.723C331.399 111.723 330.557 106.002 330.557 101.401V45.8861H357.264C360.481 45.8861 363.834 46.3027 365.511 50.2106L393.894 120.231C388.441 132.647 379.07 134.595 362.293 129.437V153.988C366.629 153.988 377.811 154.129 379.77 153.572C390.817 150.362 398.364 128.745 401.441 120.378L425.488 55.521C428.147 48.4092 430.382 43.2456 434.994 43.2456V37.1079H409.129L409.135 37.102Z" fill="#0D0E12"></path><path d="M237.703 106.841V59.2764C237.703 44.3546 230.574 35.4238 216.45 35.4238C204.009 35.4238 196.803 44.0319 191.279 52.0414V37.0961H159.396V43.2338C164.849 43.2338 167.226 46.5785 167.226 50.4864V106.835C167.226 110.602 164.432 113.947 159.396 113.947V120.084H199.109V113.947C194.073 113.947 191.279 110.602 191.279 106.835V59.646C194.503 55.3743 198.214 50.7681 204.42 50.7681C210.291 50.7681 213.65 55.5093 213.65 61.2303V106.841C213.65 110.608 210.856 113.952 205.82 113.952V120.09H245.533V113.952C240.497 113.952 237.703 110.608 237.703 106.841Z" fill="#0D0E12"></path><path d="M284.127 106.841V37.1021H252.245V43.2398C257.698 43.2398 260.074 46.5844 260.074 50.4923V106.841C260.074 110.608 257.28 113.952 252.245 113.952V120.09H291.957V113.952C286.922 113.952 284.127 110.608 284.127 106.841Z" fill="#0D0E12"></path>',
34
+ } as const;
35
+
36
+ export const sanityLogoDark = {
37
+ attributes: {
38
+ 'data-sanity-icon': 'sanity-logo',
39
+ height: '1em',
40
+ viewBox: '0 0 435 154',
41
+ fill: 'none',
42
+ xmlns: 'http://www.w3.org/2000/svg',
43
+ },
44
+ body: '<path d="M44.883 52.4463C33.4181 43.7972 21.8121 37.1021 21.8121 27.3381C21.8121 21.482 26.9827 15.4851 34.1181 15.4851C46.983 15.4851 54.5302 28.8754 61.942 45.6103H66.5538V7.11182H34.3946C7.82952 7.11182 0 23.1543 0 35.7055C0 52.1647 13.5649 61.9287 28.9416 73.365C39.7064 81.3158 48.7948 88.7092 48.7948 97.2175C48.7948 106.424 42.5006 111.723 34.5299 111.723C26.0004 111.723 13.4178 100.562 4.60595 77.4137H0V120.096H36.777C59.4302 120.096 70.7539 102.24 71.1716 87.876C71.7304 71.1411 57.3302 61.7937 44.883 52.4463Z" fill="#ffffff"></path><path d="M145.002 106.841V61.7878C145.002 42.2598 132.837 37.1021 115.219 37.1021H83.8952L84.0364 68.9054H89.2071C94.6601 55.3743 102.49 45.4754 110.878 45.4754C118.149 45.4754 121.366 51.7539 121.366 58.3082V64.4459C109.619 71.4227 78.301 77.2788 78.301 98.4791C78.301 110.754 86.8306 120.935 99.2778 120.935C110.043 120.935 117.454 113.958 121.231 105.732C121.931 112.568 126.402 120.096 136.614 120.096H152.696V113.958C147.525 113.958 145.008 110.473 145.008 106.847L145.002 106.841ZM120.949 99.8639C118.713 103.074 115.213 106.7 111.019 106.7C105.148 106.7 101.372 102.234 101.372 93.3096C101.372 83.129 115.072 76.5746 120.949 71.6926V99.8697V99.8639Z" fill="#ffffff"></path><path d="M270.145 28.4529C279.092 28.4529 284.686 22.1744 284.686 14.0885C284.686 6.00274 279.092 0 270.145 0C261.198 0 255.462 5.99688 255.462 14.0885C255.462 22.1802 261.474 28.4529 270.145 28.4529Z" fill="#ffffff"></path><path d="M409.135 37.102V43.2397C417.947 43.2397 420.459 47.84 416.129 60.2563L405.641 88.5683L392.217 54.1186C389.141 47.4234 390.817 43.2397 397.252 43.2397V37.102H330.557V9.20654H324.263C322.446 18.6889 312.516 37.102 295.598 37.102V43.2397H306.504V100.568C306.504 110.191 309.722 121.07 328.457 121.07H357.54V89.5482H352.37C350.269 96.9417 345.94 111.723 336.569 111.723C331.399 111.723 330.557 106.002 330.557 101.401V45.8861H357.264C360.481 45.8861 363.834 46.3027 365.511 50.2106L393.894 120.231C388.441 132.647 379.07 134.595 362.293 129.437V153.988C366.629 153.988 377.811 154.129 379.77 153.572C390.817 150.362 398.364 128.745 401.441 120.378L425.488 55.521C428.147 48.4092 430.382 43.2456 434.994 43.2456V37.1079H409.129L409.135 37.102Z" fill="#ffffff"></path><path d="M237.703 106.841V59.2764C237.703 44.3546 230.574 35.4238 216.45 35.4238C204.009 35.4238 196.803 44.0319 191.279 52.0414V37.0961H159.396V43.2338C164.849 43.2338 167.226 46.5785 167.226 50.4864V106.835C167.226 110.602 164.432 113.947 159.396 113.947V120.084H199.109V113.947C194.073 113.947 191.279 110.602 191.279 106.835V59.646C194.503 55.3743 198.214 50.7681 204.42 50.7681C210.291 50.7681 213.65 55.5093 213.65 61.2303V106.841C213.65 110.608 210.856 113.952 205.82 113.952V120.09H245.533V113.952C240.497 113.952 237.703 110.608 237.703 106.841Z" fill="#ffffff"></path><path d="M284.127 106.841V37.1021H252.245V43.2398C257.698 43.2398 260.074 46.5844 260.074 50.4923V106.841C260.074 110.608 257.28 113.952 252.245 113.952V120.09H291.957V113.952C286.922 113.952 284.127 110.608 284.127 106.841Z" fill="#ffffff"></path>',
45
+ } as const;
46
+
47
+ export const sanityMonogramDefault = {
48
+ attributes: {
49
+ 'data-sanity-icon': 'sanity-monogram',
50
+ height: '1em',
51
+ viewBox: '0 0 192 192',
52
+ fill: 'none',
53
+ xmlns: 'http://www.w3.org/2000/svg',
54
+ },
55
+ body: '<rect width="192" height="192" fill="#FF5500"></rect><path d="M160.077 112.697L154.865 103.629L129.659 118.981L157.655 83.3368L161.888 80.8533L160.841 79.2802L162.764 76.8232L153.929 69.4699L149.886 74.6225L68.2657 122.375L98.4429 86.0855L154.651 55.2759L149.311 44.953L118.696 61.7277L133.771 43.6096L125.134 36L91.2055 76.7966L57.5083 95.2771L83.307 61.1709L99.4731 52.757L94.3391 42.3192L47.2403 66.8361L60.0839 49.8405L51.1123 42.6551L24 78.5378L24.4207 78.8736L29.486 89.1877L59.543 73.5354L32.1474 109.745L36.6375 113.342L39.3075 118.504L70.9528 101.154L36.1052 143.065L44.742 150.674L46.4762 148.588L130.543 99.2454L102.632 134.792L103.088 135.172L103.045 135.199L108.831 145.265L145.954 122.649L131.659 145.716L141.24 152L164 115.278L160.077 112.697Z" fill="#0D0E12"></path>',
56
+ } as const;
57
+
58
+ export const sanityMonogramLight = {
59
+ attributes: {
60
+ 'data-sanity-icon': 'sanity-monogram',
61
+ height: '1em',
62
+ viewBox: '0 0 192 192',
63
+ fill: 'none',
64
+ xmlns: 'http://www.w3.org/2000/svg',
65
+ },
66
+ body: '<rect width="192" height="192" fill="#ffffff"></rect><path d="M160.077 112.697L154.865 103.629L129.659 118.981L157.655 83.3368L161.888 80.8533L160.841 79.2802L162.764 76.8232L153.929 69.4699L149.886 74.6225L68.2657 122.375L98.4429 86.0855L154.651 55.2759L149.311 44.953L118.696 61.7277L133.771 43.6096L125.134 36L91.2055 76.7966L57.5083 95.2771L83.307 61.1709L99.4731 52.757L94.3391 42.3192L47.2403 66.8361L60.0839 49.8405L51.1123 42.6551L24 78.5378L24.4207 78.8736L29.486 89.1877L59.543 73.5354L32.1474 109.745L36.6375 113.342L39.3075 118.504L70.9528 101.154L36.1052 143.065L44.742 150.674L46.4762 148.588L130.543 99.2454L102.632 134.792L103.088 135.172L103.045 135.199L108.831 145.265L145.954 122.649L131.659 145.716L141.24 152L164 115.278L160.077 112.697Z" fill="#0D0E12"></path>',
67
+ } as const;
68
+
69
+ export const sanityMonogramDark = {
70
+ attributes: {
71
+ 'data-sanity-icon': 'sanity-monogram',
72
+ height: '1em',
73
+ viewBox: '0 0 192 192',
74
+ fill: 'none',
75
+ xmlns: 'http://www.w3.org/2000/svg',
76
+ },
77
+ body: '<rect width="192" height="192" fill="#0D0E12"></rect><path d="M160.077 112.697L154.865 103.629L129.659 118.981L157.655 83.3368L161.888 80.8533L160.841 79.2802L162.764 76.8232L153.929 69.4699L149.886 74.6225L68.2657 122.375L98.4429 86.0855L154.651 55.2759L149.311 44.953L118.696 61.7277L133.771 43.6096L125.134 36L91.2055 76.7966L57.5083 95.2771L83.307 61.1709L99.4731 52.757L94.3391 42.3192L47.2403 66.8361L60.0839 49.8405L51.1123 42.6551L24 78.5378L24.4207 78.8736L29.486 89.1877L59.543 73.5354L32.1474 109.745L36.6375 113.342L39.3075 118.504L70.9528 101.154L36.1052 143.065L44.742 150.674L46.4762 148.588L130.543 99.2454L102.632 134.792L103.088 135.172L103.045 135.199L108.831 145.265L145.954 122.649L131.659 145.716L141.24 152L164 115.278L160.077 112.697Z" fill="#ffffff"></path>',
78
+ } as const;
79
+
80
+ export const sanityMonogramCustom = {
81
+ attributes: {
82
+ 'data-sanity-icon': 'sanity-monogram',
83
+ height: '1em',
84
+ viewBox: '0 0 192 192',
85
+ fill: 'none',
86
+ xmlns: 'http://www.w3.org/2000/svg',
87
+ },
88
+ body: '<rect width="192" height="192" fill="__OCTANE_SANITY_BG__"></rect><path d="M160.077 112.697L154.865 103.629L129.659 118.981L157.655 83.3368L161.888 80.8533L160.841 79.2802L162.764 76.8232L153.929 69.4699L149.886 74.6225L68.2657 122.375L98.4429 86.0855L154.651 55.2759L149.311 44.953L118.696 61.7277L133.771 43.6096L125.134 36L91.2055 76.7966L57.5083 95.2771L83.307 61.1709L99.4731 52.757L94.3391 42.3192L47.2403 66.8361L60.0839 49.8405L51.1123 42.6551L24 78.5378L24.4207 78.8736L29.486 89.1877L59.543 73.5354L32.1474 109.745L36.6375 113.342L39.3075 118.504L70.9528 101.154L36.1052 143.065L44.742 150.674L46.4762 148.588L130.543 99.2454L102.632 134.792L103.088 135.172L103.045 135.199L108.831 145.265L145.954 122.649L131.659 145.716L141.24 152L164 115.278L160.077 112.697Z" fill="__OCTANE_SANITY_FG__"></path>',
89
+ } as const;
package/src/index.ts ADDED
@@ -0,0 +1,9 @@
1
+ export { GroqLogo, GroqMonogram, SanityLogo, SanityMonogram } from './logos';
2
+ export type {
3
+ SanityLogoProps,
4
+ SanityLogoRef,
5
+ SanityLogoSvgProps,
6
+ SanityMonogramColor,
7
+ SanityMonogramProps,
8
+ SanityMonogramScheme,
9
+ } from './types';
package/src/logos.ts ADDED
@@ -0,0 +1,42 @@
1
+ import {
2
+ groqLogo,
3
+ groqMonogram,
4
+ sanityLogoDark,
5
+ sanityLogoDefault,
6
+ sanityMonogramCustom,
7
+ sanityMonogramDark,
8
+ sanityMonogramDefault,
9
+ sanityMonogramLight,
10
+ } from './data';
11
+ import { escapeSvgAttribute, renderLogo } from './renderLogo';
12
+ import type { SanityLogoProps, SanityLogoSvgProps, SanityMonogramProps } from './types';
13
+
14
+ export function GroqLogo(props: SanityLogoSvgProps = {}) {
15
+ return renderLogo(groqLogo, props);
16
+ }
17
+
18
+ export function GroqMonogram(props: SanityLogoSvgProps = {}) {
19
+ return renderLogo(groqMonogram, props);
20
+ }
21
+
22
+ export function SanityLogo(props: SanityLogoProps = {}) {
23
+ const { dark, ...svgProps } = props;
24
+ return renderLogo(dark ? sanityLogoDark : sanityLogoDefault, svgProps);
25
+ }
26
+
27
+ export function SanityMonogram(props: SanityMonogramProps = {}) {
28
+ const { scheme = 'default', color, ...svgProps } = props;
29
+ if (color) {
30
+ const body = sanityMonogramCustom.body
31
+ .replaceAll('__OCTANE_SANITY_BG__', escapeSvgAttribute(color.bg1))
32
+ .replaceAll('__OCTANE_SANITY_FG__', escapeSvgAttribute(color.fg));
33
+ return renderLogo({ ...sanityMonogramCustom, body }, svgProps);
34
+ }
35
+ const data =
36
+ scheme === 'light'
37
+ ? sanityMonogramLight
38
+ : scheme === 'dark'
39
+ ? sanityMonogramDark
40
+ : sanityMonogramDefault;
41
+ return renderLogo(data, svgProps);
42
+ }
@@ -0,0 +1,31 @@
1
+ import { createElement } from 'octane';
2
+ import type { SanityLogoSvgProps } from './types';
3
+
4
+ export interface LogoData {
5
+ attributes: Record<string, string>;
6
+ body: string;
7
+ }
8
+
9
+ export function renderLogo(data: LogoData, props: SanityLogoSvgProps = {}) {
10
+ const {
11
+ children: _children,
12
+ dangerouslySetInnerHTML: _dangerouslySetInnerHTML,
13
+ ref,
14
+ ...rest
15
+ } = props;
16
+ return createElement('svg', {
17
+ ...data.attributes,
18
+ ...rest,
19
+ ref,
20
+ dangerouslySetInnerHTML: { __html: data.body },
21
+ });
22
+ }
23
+
24
+ export function escapeSvgAttribute(value: string): string {
25
+ return value
26
+ .replaceAll('&', '&amp;')
27
+ .replaceAll('"', '&quot;')
28
+ .replaceAll("'", '&#x27;')
29
+ .replaceAll('<', '&lt;')
30
+ .replaceAll('>', '&gt;');
31
+ }
package/src/types.ts ADDED
@@ -0,0 +1,43 @@
1
+ export interface SanityLogoRefObject {
2
+ current: SVGSVGElement | null;
3
+ }
4
+
5
+ export type SanityLogoRef =
6
+ | SanityLogoRefObject
7
+ | ((instance: SVGSVGElement | null) => void)
8
+ | readonly SanityLogoRef[]
9
+ | null;
10
+
11
+ export interface SanityLogoSvgProps {
12
+ [key: string]: any;
13
+ children?: unknown;
14
+ class?: unknown;
15
+ className?: string;
16
+ height?: string | number;
17
+ id?: string;
18
+ onClick?: (event: MouseEvent) => void;
19
+ ref?: SanityLogoRef;
20
+ role?: string;
21
+ style?: string | Record<string, string | number | null | undefined>;
22
+ width?: string | number;
23
+ }
24
+
25
+ export interface SanityLogoProps extends SanityLogoSvgProps {
26
+ dark?: boolean;
27
+ }
28
+
29
+ export type SanityMonogramScheme = 'light' | 'dark' | 'default';
30
+
31
+ /** @deprecated Prefer the scheme prop. */
32
+ export interface SanityMonogramColor {
33
+ bg1: string;
34
+ bg2: string;
35
+ fg: string;
36
+ }
37
+
38
+ export type SanityMonogramProps = SanityLogoSvgProps &
39
+ (
40
+ | { color: SanityMonogramColor; scheme?: undefined }
41
+ | { color?: undefined; scheme: SanityMonogramScheme }
42
+ | { color?: undefined; scheme?: undefined }
43
+ );