Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

3.8 KB
Raw Blame
import type { SVGProps } from "react";
import { cn } from "@/lib/utils";

// Exact paths from usememos/.github@5e3121450f5160c7b6b7c301379c27fedf7985d1.
// The parity test keeps these inline, themeable marks aligned with the public SVGs.
const shapes = {
  standard: {
    transform: "translate(17.067 28.624) scale(1.427919 1.322148)",
    path: "M126 35 C142 26 162 27 178 35 C195 44 204 63 204 84 C205 102 197 116 197 130 C199 141 212 150 223 165 C239 187 247 221 245 247 Q245 260 239 264 C233 251 232 238 230 225 C227 196 217 173 202 154 C189 141 184 133 189 116 C194 103 196 89 193 78 C184 89 174 100 160 103 Q156 104 152 100 C145 122 133 145 130 167 C144 185 161 195 177 220 C195 248 204 278 198 300 Q196 307 192 309 C187 286 183 266 173 242 C163 219 145 202 129 188 L128 225 Q128 233 120 237 Q115 240 113 245 C114 261 120 279 125 294 Q126 303 119 297 C111 285 108 273 104 261 C96 278 97 299 104 318 Q106 326 99 323 C86 304 82 278 92 256 C97 243 107 231 119 225 C116 207 117 185 121 166 C125 142 136 119 145 95 Q147 87 139 82 L111 67 C104 78 94 85 88 89 Q84 91 87 85 C93 72 102 57 113 49 Q115 43 120 43 Q124 44 118 51 L115 56 L141 69 C145 58 146 46 151 40 Q156 37 156 45 C156 59 151 76 152 87 Q154 95 164 92 C178 87 188 76 188 69 C184 51 172 40 155 37 Q140 34 126 39 Q119 41 126 35 Z M162 130 C157 145 150 158 147 168 Q146 172 151 170 L156 166 L162 151 L166 168 L158 181 Q155 186 160 185 C169 181 174 173 174 168 L167 144 Q163 125 162 130 Z M197 165 C192 179 190 194 186 205 Q185 209 188 212 C200 232 207 255 209 278 Q210 287 214 281 C222 256 214 234 202 214 Q198 206 198 198 C200 183 201 173 200 166 Q199 160 197 165 Z",
  },
  small: {
    transform: "translate(3.189 13.356) scale(1.522148 1.409396)",
    path: "M126 35 C142 26 162 27 178 35 C195 44 204 63 204 84 C205 102 197 116 197 130 C199 141 212 150 223 165 C242 187 250 221 248 247 Q247 261 240 264 C233 251 232 238 230 225 C227 196 217 173 202 154 C189 141 184 133 189 116 C194 103 196 89 193 78 C184 89 174 100 160 103 Q156 104 152 100 C145 122 133 145 130 167 C144 185 161 195 177 220 C198 248 207 278 201 300 Q198 310 191 311 C187 286 183 266 173 242 C163 219 145 202 129 188 L128 225 Q128 233 120 237 Q115 240 113 245 C114 261 120 279 125 294 Q126 303 119 297 C111 285 108 273 104 261 C96 278 97 299 104 318 Q106 326 99 323 C82 304 79 278 89 255 C97 243 107 231 119 225 C113 207 114 185 118 166 C125 142 136 119 145 95 Q147 87 139 82 L111 67 C104 78 94 85 88 89 Q84 91 87 85 C93 72 102 57 113 49 Q115 43 120 43 Q124 44 118 51 L115 56 L141 69 C145 58 146 46 151 40 Q156 37 156 45 C156 59 151 76 152 87 Q154 95 164 92 C178 87 188 76 188 69 C184 51 172 40 155 37 Q140 34 126 39 Q119 41 126 35 Z M161 139 C158 149 151 159 149 166 Q147 172 153 169 C160 166 168 160 168 155 Q168 148 164 141 Q162 136 161 139 Z M196 164 C190 179 187 194 183 205 Q182 210 186 216 C198 236 204 257 207 280 Q208 287 213 284 C225 258 216 232 205 212 Q201 206 201 198 C203 184 204 173 202 165 Q200 159 196 164 Z",
  },
} as const;

type MemosMarkProps = SVGProps<SVGSVGElement> & {
  size?: number;
  variant?: keyof typeof shapes;
  label?: string;
};

/** Set color with CSS; size selects the official small mark at 32px or below. */
export function MemosMark({ size = 32, variant = size <= 32 ? "small" : "standard", label, className, ...props }: MemosMarkProps) {
  const shape = shapes[variant];

  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 512 512"
      width={size}
      height={size}
      fill="currentColor"
      role={label ? "img" : undefined}
      aria-label={label}
      aria-hidden={label ? undefined : true}
      focusable="false"
      className={cn("memos-mark shrink-0", className)}
      {...props}
    >
      {label ? <title>{label}</title> : null}
      <g transform={shape.transform}>
        <path fill="currentColor" fillRule="evenodd" d={shape.path} />
      </g>
    </svg>
  );
}