@sanity/sanity-id 1.0.1 → 1.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/components.css CHANGED
@@ -18,3 +18,4 @@
18
18
  @import "./dist/components/Table.css";
19
19
  @import "./dist/components/Testimonial.css";
20
20
  @import "./dist/components/Textarea.css";
21
+ @import "./dist/components/TextCard.css";
@@ -14,4 +14,9 @@
14
14
  @apply text-label-md;
15
15
  padding: var(--spacing-8);
16
16
  }
17
+ @supports not (text-box-trim: trim-both) {
18
+ && {
19
+ line-height: 1;
20
+ }
21
+ }
17
22
  }
@@ -19,5 +19,5 @@
19
19
  @apply text-label-md;
20
20
  color: var(--color-fg-base);
21
21
  text-decoration: none;
22
- @variant hover { text-decoration: underline; }
22
+ @variant hover { text-decoration-line: underline; }
23
23
  }
@@ -23,6 +23,9 @@
23
23
  min-height: calc((45 / 16) * 1rem);
24
24
  padding: var(--spacing-8) var(--spacing-32);
25
25
  }
26
+ @supports not (text-box-trim: trim-both) {
27
+ line-height: 1;
28
+ }
26
29
  }
27
30
  .Button_button[data-mode=primary] {
28
31
  &:hover {
@@ -84,7 +87,6 @@
84
87
  }
85
88
  &,
86
89
  &:active {
87
- background-color: var(--color-bg-base);
88
90
  border-color: var(--color-bg-inverse-base);
89
91
  color: var(--color-fg-base);
90
92
  }
@@ -32,6 +32,6 @@
32
32
  @apply text-component-heading-md;
33
33
  color: var(--color-fg-base);
34
34
  .Card_link[href]:hover & {
35
- text-decoration: underline;
35
+ text-decoration-line: underline;
36
36
  }
37
37
  }
@@ -29,6 +29,9 @@
29
29
  .Chip_text {
30
30
  text-box-edge: cap alphabetic;
31
31
  text-box-trim: trim-both;
32
+ @supports not (text-box-trim: trim-both) {
33
+ line-height: 1;
34
+ }
32
35
  }
33
36
  .Chip_icon {
34
37
  height: var(--spacing-icon-sm);
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Code
4
- } from "./chunk-GOQAK6JJ.js";
4
+ } from "./chunk-CHTYOZV5.js";
5
5
  import "./chunk-RC7UR3KP.js";
6
6
  import "./chunk-U67V476Y.js";
7
7
  export {
@@ -131,7 +131,6 @@
131
131
  }
132
132
  &,
133
133
  &:active {
134
- background-color: var(--color-bg-base);
135
134
  border-color: var(--color-bg-inverse-base);
136
135
  color: var(--color-fg-base);
137
136
  }
@@ -179,6 +178,11 @@
179
178
  @apply text-label-md;
180
179
  padding: var(--spacing-8);
181
180
  }
181
+ @supports not (text-box-trim: trim-both) {
182
+ && {
183
+ line-height: 1;
184
+ }
185
+ }
182
186
  }
183
187
 
184
188
  /* src/components/Code.module.css */
@@ -7,7 +7,7 @@ import "./chunk-K2RGV5MW.js";
7
7
  import {
8
8
  Code,
9
9
  normalizeCode
10
- } from "./chunk-GOQAK6JJ.js";
10
+ } from "./chunk-CHTYOZV5.js";
11
11
  import "./chunk-RC7UR3KP.js";
12
12
  import "./chunk-U67V476Y.js";
13
13
 
@@ -1,33 +1,10 @@
1
1
  import {
2
- LinkCTA
3
- } from "./chunk-SXBHZTND.js";
2
+ Eyebrow
3
+ } from "./chunk-TBD76CFH.js";
4
+ import "./chunk-SXBHZTND.js";
4
5
  import "./chunk-K2RGV5MW.js";
5
- import {
6
- require_classnames
7
- } from "./chunk-RC7UR3KP.js";
8
- import {
9
- __toESM
10
- } from "./chunk-U67V476Y.js";
11
-
12
- // src/components/Eyebrow.module.css
13
- var Eyebrow_default = {
14
- wrapper: "Eyebrow_wrapper",
15
- eyebrow: "Eyebrow_eyebrow"
16
- };
17
-
18
- // src/components/Eyebrow.tsx
19
- var import_classnames = __toESM(require_classnames());
20
- import { jsx, jsxs } from "react/jsx-runtime";
21
- function Eyebrow({
22
- children,
23
- className,
24
- cta
25
- }) {
26
- return /* @__PURE__ */ jsxs("div", { className: (0, import_classnames.default)(Eyebrow_default.wrapper, className), children: [
27
- /* @__PURE__ */ jsx("div", { className: Eyebrow_default.eyebrow, children }),
28
- !!cta?.text && /* @__PURE__ */ jsx(LinkCTA, { arrowPosition: "left", arrow: cta.arrow, href: cta.href, children: cta.text })
29
- ] });
30
- }
6
+ import "./chunk-RC7UR3KP.js";
7
+ import "./chunk-U67V476Y.js";
31
8
  export {
32
9
  Eyebrow
33
10
  };
@@ -80,7 +80,6 @@
80
80
  }
81
81
  &,
82
82
  &:active {
83
- background-color: var(--color-bg-base);
84
83
  border-color: var(--color-bg-inverse-base);
85
84
  color: var(--color-fg-base);
86
85
  }
@@ -128,4 +127,9 @@
128
127
  @apply text-label-md;
129
128
  padding: var(--spacing-8);
130
129
  }
130
+ @supports not (text-box-trim: trim-both) {
131
+ && {
132
+ line-height: 1;
133
+ }
134
+ }
131
135
  }
@@ -22,6 +22,9 @@
22
22
  display: flex;
23
23
  flex-direction: column;
24
24
  row-gap: var(--spacing-6);
25
+ @supports not (text-box-trim: trim-both) {
26
+ row-gap: 0;
27
+ }
25
28
  }
26
29
  .Person_name {
27
30
  @apply text-detail-md;
@@ -22,6 +22,9 @@
22
22
  display: flex;
23
23
  flex-direction: column;
24
24
  row-gap: var(--spacing-6);
25
+ @supports not (text-box-trim: trim-both) {
26
+ row-gap: 0;
27
+ }
25
28
  }
26
29
  .Person_name {
27
30
  @apply text-detail-md;
@@ -0,0 +1,76 @@
1
+ /* src/components/TextCard.module.css */
2
+ @reference "../../tailwind.css";
3
+ .TextCard_textCard {
4
+ border-top: 1px solid var(--color-border-base);
5
+ display: flex;
6
+ flex-direction: column;
7
+ row-gap: var(--spacing-24);
8
+ padding-block: var(--spacing-24);
9
+ @supports not (text-box-trim: trim-both) {
10
+ row-gap: var(--spacing-16);
11
+ }
12
+ }
13
+ .TextCard_title {
14
+ .TextCard_textCard[data-size=sm] & {
15
+ @apply text-component-heading-sm;
16
+ }
17
+ .TextCard_textCard[data-size=md] & {
18
+ @apply text-component-heading-md;
19
+ }
20
+ .TextCard_textCard[data-size=lg] & {
21
+ @apply text-component-heading-lg;
22
+ }
23
+ .TextCard_textCard[href]:hover & {
24
+ text-decoration-line: underline;
25
+ }
26
+ }
27
+ .TextCard_description {
28
+ @apply text-body-sm;
29
+ }
30
+ .TextCard_icon {
31
+ height: calc(1rem * 35 / 16);
32
+ width: calc(1rem * 35 / 16);
33
+ }
34
+
35
+ /* src/components/Eyebrow.module.css */
36
+ @reference "../../tailwind.css";
37
+ .Eyebrow_wrapper {
38
+ align-items: center;
39
+ display: flex;
40
+ column-gap: var(--spacing-12);
41
+ }
42
+ .Eyebrow_eyebrow {
43
+ @apply text-label-md;
44
+ }
45
+
46
+ /* src/components/LinkCTA.module.css */
47
+ @reference "../../tailwind.css";
48
+ .LinkCTA_link {
49
+ @apply text-label-lg;
50
+ align-items: center;
51
+ border-radius: var(--radius-full);
52
+ column-gap: var(--spacing-12);
53
+ cursor: pointer;
54
+ display: flex;
55
+ isolation: isolate;
56
+ position: relative;
57
+ &:hover {
58
+ color: var(--color-white);
59
+ background-color: var(--color-blue-700);
60
+ }
61
+ &:has(.LinkCTA_iconLeft) {
62
+ padding-right: var(--spacing-12);
63
+ }
64
+ &:has(.LinkCTA_iconRight) {
65
+ padding-left: var(--spacing-12);
66
+ }
67
+ }
68
+ .LinkCTA_iconLeft,
69
+ .LinkCTA_iconRight {
70
+ color: var(--color-white);
71
+ background-color: var(--color-blue-700);
72
+ border-radius: var(--radius-full);
73
+ height: var(--spacing-icon-lg);
74
+ padding: var(--spacing-2);
75
+ width: var(--spacing-icon-lg);
76
+ }
@@ -0,0 +1,13 @@
1
+ import type { ComponentProps, ElementType, ReactNode } from "react";
2
+ import type { IconSymbol } from "@sanity/icons";
3
+ export type TextCardProps<E extends ElementType> = Omit<ComponentProps<E>, "as"> & {
4
+ as?: E;
5
+ className?: string;
6
+ children?: ReactNode;
7
+ eyebrow?: string;
8
+ icon?: IconSymbol;
9
+ title: string;
10
+ size?: "sm" | "md" | "lg";
11
+ arrow?: "none" | "arrow-right" | "arrow-top-right";
12
+ };
13
+ export declare function TextCard<E extends ElementType = "div">({ arrow, as, className, children, eyebrow, icon, size, title, ...props }: TextCardProps<E>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,62 @@
1
+ import {
2
+ Eyebrow
3
+ } from "./chunk-TBD76CFH.js";
4
+ import "./chunk-SXBHZTND.js";
5
+ import {
6
+ SanityIcon
7
+ } from "./chunk-K2RGV5MW.js";
8
+ import {
9
+ require_classnames
10
+ } from "./chunk-RC7UR3KP.js";
11
+ import {
12
+ __toESM
13
+ } from "./chunk-U67V476Y.js";
14
+
15
+ // src/components/TextCard.module.css
16
+ var TextCard_default = {
17
+ textCard: "TextCard_textCard",
18
+ title: "TextCard_title",
19
+ description: "TextCard_description",
20
+ icon: "TextCard_icon"
21
+ };
22
+
23
+ // src/components/TextCard.tsx
24
+ var import_classnames = __toESM(require_classnames());
25
+ import { jsx, jsxs } from "react/jsx-runtime";
26
+ function TextCard({
27
+ arrow,
28
+ as,
29
+ className,
30
+ children,
31
+ eyebrow,
32
+ icon,
33
+ size,
34
+ title,
35
+ ...props
36
+ }) {
37
+ const Component = as ?? "div";
38
+ arrow ??= props.href ? "arrow-right" : "none";
39
+ size ??= "sm";
40
+ return /* @__PURE__ */ jsxs(
41
+ Component,
42
+ {
43
+ ...props,
44
+ className: (0, import_classnames.default)(TextCard_default.textCard, className),
45
+ "data-size": size,
46
+ children: [
47
+ typeof icon === "string" && /* @__PURE__ */ jsx(SanityIcon, { icon, className: TextCard_default.icon }),
48
+ !!eyebrow && /* @__PURE__ */ jsx(Eyebrow, { children: eyebrow }),
49
+ /* @__PURE__ */ jsxs("p", { className: TextCard_default.title, children: [
50
+ title,
51
+ "\xA0",
52
+ arrow === "arrow-right" && "\u2192",
53
+ arrow === "arrow-top-right" && "\u2197\uFE0E"
54
+ ] }),
55
+ /* @__PURE__ */ jsx("div", { className: TextCard_default.description, children })
56
+ ]
57
+ }
58
+ );
59
+ }
60
+ export {
61
+ TextCard
62
+ };
@@ -0,0 +1,33 @@
1
+ import {
2
+ LinkCTA
3
+ } from "./chunk-SXBHZTND.js";
4
+ import {
5
+ require_classnames
6
+ } from "./chunk-RC7UR3KP.js";
7
+ import {
8
+ __toESM
9
+ } from "./chunk-U67V476Y.js";
10
+
11
+ // src/components/Eyebrow.module.css
12
+ var Eyebrow_default = {
13
+ wrapper: "Eyebrow_wrapper",
14
+ eyebrow: "Eyebrow_eyebrow"
15
+ };
16
+
17
+ // src/components/Eyebrow.tsx
18
+ var import_classnames = __toESM(require_classnames());
19
+ import { jsx, jsxs } from "react/jsx-runtime";
20
+ function Eyebrow({
21
+ children,
22
+ className,
23
+ cta
24
+ }) {
25
+ return /* @__PURE__ */ jsxs("div", { className: (0, import_classnames.default)(Eyebrow_default.wrapper, className), children: [
26
+ /* @__PURE__ */ jsx("div", { className: Eyebrow_default.eyebrow, children }),
27
+ !!cta?.text && /* @__PURE__ */ jsx(LinkCTA, { arrowPosition: "left", arrow: cta.arrow, href: cta.href, children: cta.text })
28
+ ] });
29
+ }
30
+
31
+ export {
32
+ Eyebrow
33
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/sanity-id",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "repository": "https://github.com/sanity-io/sanity-id.git",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",
@@ -29,7 +29,8 @@
29
29
  "./components/switch": "./dist/components/Switch.js",
30
30
  "./components/table": "./dist/components/Table.js",
31
31
  "./components/testimonial": "./dist/components/Testimonial.js",
32
- "./components/textarea": "./dist/components/Textarea.js"
32
+ "./components/textarea": "./dist/components/Textarea.js",
33
+ "./components/text-card": "./dist/components/TextCard.js"
33
34
  },
34
35
  "files": [
35
36
  "./dist/*",
package/tailwind.css CHANGED
@@ -263,7 +263,9 @@
263
263
  font-weight: 400;
264
264
  letter-spacing: -0.035em;
265
265
  line-height: 1.08;
266
- @apply text-trim;
266
+ text-box: trim-both cap alphabetic;
267
+ text-decoration-thickness: 8%;
268
+ text-underline-offset: 10%;
267
269
 
268
270
  @variant screen-md {
269
271
  font-size: 3rem;
@@ -278,7 +280,9 @@
278
280
  font-weight: 400;
279
281
  letter-spacing: -0.03em;
280
282
  line-height: 1.1;
281
- @apply text-trim;
283
+ text-box: trim-both cap alphabetic;
284
+ text-decoration-thickness: 8%;
285
+ text-underline-offset: 10%;
282
286
  }
283
287
 
284
288
  @utility text-component-heading-lg {
@@ -289,7 +293,9 @@
289
293
  font-weight: 400;
290
294
  letter-spacing: -0.02em;
291
295
  line-height: 1.1;
292
- @apply text-trim;
296
+ text-box: trim-both cap alphabetic;
297
+ text-decoration-thickness: 8%;
298
+ text-underline-offset: 10%;
293
299
  }
294
300
 
295
301
  @utility text-component-heading-md {
@@ -300,7 +306,9 @@
300
306
  font-weight: 400;
301
307
  letter-spacing: -0.01em;
302
308
  line-height: 1.1;
303
- @apply text-trim;
309
+ text-box: trim-both cap alphabetic;
310
+ text-decoration-thickness: 8%;
311
+ text-underline-offset: 10%;
304
312
  }
305
313
 
306
314
  @utility text-component-heading-sm {
@@ -311,7 +319,9 @@
311
319
  font-weight: 400;
312
320
  letter-spacing: -0.01em;
313
321
  line-height: 1.1;
314
- @apply text-trim;
322
+ text-box: trim-both cap alphabetic;
323
+ text-decoration-thickness: 8%;
324
+ text-underline-offset: 10%;
315
325
  }
316
326
 
317
327
  @utility text-body-xl {
@@ -374,7 +384,9 @@
374
384
  letter-spacing: 0;
375
385
  line-height: 1.3;
376
386
  text-transform: uppercase;
377
- @apply text-trim;
387
+ text-box: trim-both cap alphabetic;
388
+ text-decoration-thickness: 8%;
389
+ text-underline-offset: 10%;
378
390
 
379
391
  em,
380
392
  i {
@@ -390,7 +402,9 @@
390
402
  letter-spacing: 0;
391
403
  line-height: 1.3;
392
404
  text-transform: uppercase;
393
- @apply text-trim;
405
+ text-box: trim-both cap alphabetic;
406
+ text-decoration-thickness: 8%;
407
+ text-underline-offset: 10%;
394
408
 
395
409
  em,
396
410
  i {
@@ -406,7 +420,9 @@
406
420
  letter-spacing: 0;
407
421
  line-height: 1.3;
408
422
  text-transform: uppercase;
409
- @apply text-trim;
423
+ text-box: trim-both cap alphabetic;
424
+ text-decoration-thickness: 8%;
425
+ text-underline-offset: 10%;
410
426
  }
411
427
 
412
428
  @utility text-detail-md {
@@ -416,7 +432,9 @@
416
432
  font-weight: 400;
417
433
  letter-spacing: 0;
418
434
  line-height: 1.5;
419
- @apply text-trim;
435
+ text-box: trim-both cap alphabetic;
436
+ text-decoration-thickness: 8%;
437
+ text-underline-offset: 10%;
420
438
  }
421
439
 
422
440
  @utility text-detail-sm {
@@ -426,7 +444,9 @@
426
444
  font-weight: 400;
427
445
  letter-spacing: 0;
428
446
  line-height: 1.5;
429
- @apply text-trim;
447
+ text-box: trim-both cap alphabetic;
448
+ text-decoration-thickness: 8%;
449
+ text-underline-offset: 10%;
430
450
  }
431
451
 
432
452
  @utility text-quote-lg {
@@ -496,8 +516,8 @@
496
516
  }
497
517
 
498
518
  @utility text-inline-link {
519
+ text-decoration-line: underline;
499
520
  cursor: pointer;
500
- text-decoration: underline;
501
521
 
502
522
  &:hover {
503
523
  color: var(--color-fg-accent-blue);
@@ -527,12 +547,11 @@
527
547
  }
528
548
 
529
549
  @utility text-trim {
530
- text-box-edge: cap alphabetic;
531
- text-box-trim: trim-both;
550
+ text-box: trim-both cap alphabetic;
551
+ }
532
552
 
533
- @supports not (text-box-trim: trim-both) {
534
- line-height: 1;
535
- }
553
+ @utility underline {
554
+ text-decoration-line: underline;
536
555
  }
537
556
 
538
557
  @utility focus-ring {