@orangecheck/app-design 0.5.0 → 0.5.1

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.
@@ -1298,7 +1298,77 @@ function FloatChip({
1298
1298
  }
1299
1299
  );
1300
1300
  }
1301
+ var GROUNDS = [
1302
+ {
1303
+ className: "text-oca-ink",
1304
+ background: "linear-gradient(145deg, var(--oca-orange-light), var(--oca-orange-deep))",
1305
+ dot: "rgb(10 10 10 / 0.22)"
1306
+ },
1307
+ {
1308
+ className: "text-white ring-1 ring-inset ring-white/10",
1309
+ background: "linear-gradient(145deg, #2a2a2a, #0a0a0a)",
1310
+ dot: "rgb(255 255 255 / 0.16)"
1311
+ },
1312
+ {
1313
+ className: "text-oca-ink",
1314
+ background: "linear-gradient(145deg, #fff1df, var(--oca-peach))",
1315
+ dot: "rgb(234 88 11 / 0.22)"
1316
+ }
1317
+ ];
1318
+ var SIZES = {
1319
+ sm: "size-9 rounded-[0.7rem] text-[0.9375rem]",
1320
+ md: "size-11 rounded-[0.85rem] text-[1.125rem]",
1321
+ lg: "size-14 rounded-[1.05rem] text-[1.5rem]"
1322
+ };
1323
+ function monogramLetter(name) {
1324
+ const match = name.match(/[\p{L}\p{N}]/u);
1325
+ return match ? match[0].toLocaleUpperCase() : "\xB7";
1326
+ }
1327
+ function monogramGround(seed) {
1328
+ let h = 2166136261;
1329
+ for (let i = 0; i < seed.length; i++) {
1330
+ h ^= seed.charCodeAt(i);
1331
+ h = Math.imul(h, 16777619);
1332
+ }
1333
+ return (h >>> 0) % GROUNDS.length;
1334
+ }
1335
+ function Monogram({
1336
+ name,
1337
+ seed,
1338
+ size = "md",
1339
+ className,
1340
+ style
1341
+ }) {
1342
+ const ground = GROUNDS[monogramGround(seed ?? name)] ?? GROUNDS[0];
1343
+ return /* @__PURE__ */ jsxs(
1344
+ "span",
1345
+ {
1346
+ "aria-hidden": true,
1347
+ className: cn(
1348
+ "relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden font-semibold leading-none tracking-[-0.02em]",
1349
+ SIZES[size],
1350
+ ground.className,
1351
+ className
1352
+ ),
1353
+ style: { background: ground.background, ...style },
1354
+ children: [
1355
+ /* @__PURE__ */ jsx(
1356
+ "span",
1357
+ {
1358
+ className: "absolute inset-0",
1359
+ style: {
1360
+ backgroundImage: `radial-gradient(circle, ${ground.dot} 0.9px, transparent 1.2px)`,
1361
+ backgroundSize: "6px 6px",
1362
+ maskImage: "radial-gradient(90% 90% at 100% 100%, black, transparent 75%)"
1363
+ }
1364
+ }
1365
+ ),
1366
+ /* @__PURE__ */ jsx("span", { className: "relative", children: monogramLetter(name) })
1367
+ ]
1368
+ }
1369
+ );
1370
+ }
1301
1371
 
1302
- export { Accent, ActivityList, BrowserFrame, CodeBlock, Container, CopyButton, DataTable, Display, DocHeader, DocLayout, EmptyLine, EmptyState, Eyebrow, FloatChip, Footnote, HashChip, KeyValueList, Lead, LoadingBlock, Notice, PackageCard, PageHeader, PageHero, PhoneFrame, ProgressSteps, Prose, Reveal, Sats, SatsFigure, ScrollStory, Section, SectionIntro, SplitBar, StatCard, StatGrid, StepGrid, Ticker, TruthTable, UsdApprox, satsText, sectionVariants, useCopy, useInView };
1372
+ export { Accent, ActivityList, BrowserFrame, CodeBlock, Container, CopyButton, DataTable, Display, DocHeader, DocLayout, EmptyLine, EmptyState, Eyebrow, FloatChip, Footnote, HashChip, KeyValueList, Lead, LoadingBlock, Monogram, Notice, PackageCard, PageHeader, PageHero, PhoneFrame, ProgressSteps, Prose, Reveal, Sats, SatsFigure, ScrollStory, Section, SectionIntro, SplitBar, StatCard, StatGrid, StepGrid, Ticker, TruthTable, UsdApprox, monogramGround, monogramLetter, satsText, sectionVariants, useCopy, useInView };
1303
1373
  //# sourceMappingURL=components.mjs.map
1304
1374
  //# sourceMappingURL=components.mjs.map