@noirmd/previewer 2.1.5 → 2.1.7

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.
@@ -16,7 +16,7 @@
16
16
  transition: grid-template-rows 0.25s ease;
17
17
  border: 1px solid var(--nr-border);
18
18
  border-radius: var(--nr-radius-sm);
19
- background: color-mix(in oklab, var(--nr-bg-secondary) 30%, transparent);
19
+ background: transparent;
20
20
  }
21
21
 
22
22
  .nr-accordion__item:has(> .nr-accordion__input:checked) {
@@ -7,7 +7,6 @@
7
7
  margin-bottom: 1.5rem;
8
8
  border: 1px solid;
9
9
  padding: 1rem;
10
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
11
10
  }
12
11
 
13
12
  .nr-admonition--note {
@@ -37,7 +36,7 @@
37
36
  }
38
37
 
39
38
  .nr-admonition__title {
40
- font-weight: 700;
39
+ font-weight: 600;
41
40
  font-size: 1rem;
42
41
  margin: 0 0 0.5rem;
43
42
  display: flex;
@@ -52,4 +51,14 @@
52
51
  font-size: 0.875rem;
53
52
  line-height: 1.625;
54
53
  opacity: 0.9;
54
+ }
55
+
56
+ /* Remove top margin on headings inside admonition */
57
+ .nr-admonition__body .md-h1,
58
+ .nr-admonition__body .md-h2,
59
+ .nr-admonition__body .md-h3,
60
+ .nr-admonition__body .md-h4,
61
+ .nr-admonition__body .md-h5,
62
+ .nr-admonition__body .md-h6 {
63
+ margin-top: 0;
55
64
  }
package/dist/base.css CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  .md-h1 {
26
26
  font-size: 1.5rem;
27
- font-weight: 800;
27
+ font-weight: 700;
28
28
  letter-spacing: -0.025em;
29
29
  line-height: 1.2;
30
30
  margin: 1.5rem 0 0.75rem;
@@ -5,7 +5,7 @@
5
5
  .nr-blockquote {
6
6
  margin: 1rem 0;
7
7
  padding: 0.5rem 1rem;
8
- border-left: 4px solid rgba(14, 165, 233, 0.3);
8
+ border-left: 2px solid color-mix(in oklab, var(--nr-accent) 30%, transparent);
9
9
  color: var(--nr-text-secondary);
10
10
  font-style: italic;
11
11
  font-size: 0.875rem;
package/dist/button.css CHANGED
@@ -17,22 +17,46 @@
17
17
  align-items: center;
18
18
  width: fit-content;
19
19
  padding: 0.5rem 1rem;
20
- border-radius: 0.75rem;
21
- font-weight: 700;
20
+ border-radius: var(--nr-radius-sm);
21
+ font-weight: 500;
22
22
  font-size: 0.875rem;
23
23
  text-decoration: none;
24
24
  gap: 0.5rem;
25
- transition: all 0.15s;
25
+ transition: background-color 0.15s, color 0.15s, border-color 0.15s;
26
26
  border: 1px solid var(--nr-border);
27
- background: color-mix(in srgb, var(--nr-bg) 5%, transparent);
27
+ background: transparent;
28
28
  color: var(--nr-text);
29
29
  cursor: pointer;
30
30
  }
31
31
  .nr-button:hover {
32
- transform: scale(1.05);
33
32
  background: color-mix(in srgb, var(--nr-bg) 10%, transparent);
34
33
  color: var(--nr-text);
35
34
  }
36
- .nr-button:active {
37
- transform: scale(0.95);
38
- }
35
+ .nr-button:focus-visible {
36
+ outline: 2px solid var(--nr-ring);
37
+ outline-offset: 2px;
38
+ }
39
+
40
+ /* ── Theme color variants ───────────────────────────────── */
41
+
42
+ .nr-button--primary,
43
+ .nr-button--accent { background: var(--nr-accent); color: #fff; border-color: var(--nr-accent); }
44
+ .nr-button--primary:hover,
45
+ .nr-button--accent:hover { background: color-mix(in srgb, var(--nr-accent) 85%, #000); color: #fff; }
46
+
47
+ .nr-button--secondary { background: var(--nr-secondary); color: #fff; border-color: var(--nr-secondary); }
48
+ .nr-button--secondary:hover { background: color-mix(in srgb, var(--nr-secondary) 85%, #000); color: #fff; }
49
+
50
+ .nr-button--info { background: var(--nr-info); color: #fff; border-color: var(--nr-info); }
51
+ .nr-button--info:hover { background: color-mix(in srgb, var(--nr-info) 85%, #000); color: #fff; }
52
+
53
+ .nr-button--success { background: var(--nr-success); color: #fff; border-color: var(--nr-success); }
54
+ .nr-button--success:hover { background: color-mix(in srgb, var(--nr-success) 85%, #000); color: #fff; }
55
+
56
+ .nr-button--warning { background: var(--nr-warning); color: #1f2937; border-color: var(--nr-warning); }
57
+ .nr-button--warning:hover { background: color-mix(in srgb, var(--nr-warning) 85%, #000); color: #1f2937; }
58
+
59
+ .nr-button--danger,
60
+ .nr-button--error { background: var(--nr-danger); color: #fff; border-color: var(--nr-danger); }
61
+ .nr-button--danger:hover,
62
+ .nr-button--error:hover { background: color-mix(in srgb, var(--nr-danger) 85%, #000); color: #fff; }
package/dist/card.css CHANGED
@@ -20,7 +20,7 @@
20
20
  .nr-card {
21
21
  display: flex;
22
22
  flex-direction: column;
23
- border-radius: var(--nr-radius-lg);
23
+ border-radius: var(--nr-radius);
24
24
  border: 1px solid var(--nr-border);
25
25
  transition: all 0.2s;
26
26
  position: relative;
@@ -29,6 +29,7 @@
29
29
  flex: 1 1 18rem;
30
30
  max-width: 20rem;
31
31
  width: 100%;
32
+ background: var(--nr-bg);
32
33
  }
33
34
 
34
35
  .nr-card--interactive {
@@ -59,7 +60,7 @@
59
60
  .nr-card__gradient {
60
61
  position: absolute;
61
62
  inset: 0;
62
- background: linear-gradient(to top, color-mix(in srgb, var(--nr-bg) 40%, transparent), transparent);
63
+ background: linear-gradient(to top, var(--nr-bg) 0%, transparent 60%);
63
64
  }
64
65
 
65
66
  .nr-card__body {
@@ -68,8 +69,6 @@
68
69
  flex: 1;
69
70
  padding: 1.5rem;
70
71
  position: relative;
71
- border-top: 1px solid rgba(255, 255, 255, 0.05);
72
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
73
72
  }
74
73
  .nr-card__body--overlap {
75
74
  margin-top: -2.5rem;
@@ -88,7 +87,7 @@
88
87
  width: 2.5rem;
89
88
  height: 2.5rem;
90
89
  font-size: 1.6em;
91
- border-radius: 0.75rem;
90
+ border-radius: var(--nr-radius-sm);
92
91
  background: color-mix(in srgb, var(--nr-accent) 20%, transparent);
93
92
  display: flex;
94
93
  align-items: center;
@@ -99,7 +98,7 @@
99
98
 
100
99
  .nr-card__title {
101
100
  font-size: 1rem;
102
- font-weight: 900;
101
+ font-weight: 600;
103
102
  letter-spacing: -0.025em;
104
103
  line-height: 1.25;
105
104
  margin: 0;
@@ -107,7 +106,7 @@
107
106
 
108
107
  .nr-card__description {
109
108
  font-size: 0.875rem;
110
- opacity: 0.8;
109
+ color: var(--nr-text-secondary);
111
110
  line-height: 1.625;
112
111
  font-weight: 500;
113
112
  }
@@ -121,7 +120,11 @@
121
120
  }
122
121
 
123
122
  .nr-card__action {
124
- margin-top: 1.5rem;
123
+ /* Pin the action to the bottom of the card so every card in a grid
124
+ shows its button at the same spot (bottom-right), no matter how
125
+ long the description is. `padding-top` keeps a minimum gap. */
126
+ margin-top: auto;
127
+ padding-top: 0.75rem;
125
128
  display: flex;
126
129
  justify-content: flex-end;
127
130
  }
@@ -129,21 +132,19 @@
129
132
  .nr-card__action-link {
130
133
  background: color-mix(in srgb, var(--nr-accent) 20%, transparent);
131
134
  padding: 0.5rem 1rem;
132
- border-radius: 0.75rem;
135
+ border-radius: var(--nr-radius-sm);
133
136
  display: flex;
134
137
  align-items: center;
135
138
  gap: 0.375rem;
136
139
  font-size: 0.625rem;
137
- font-weight: 900;
140
+ font-weight: 500;
138
141
  text-transform: uppercase;
139
142
  letter-spacing: 0.1em;
140
- opacity: 0.5;
141
- color: var(--nr-text);
143
+ color: var(--nr-text-secondary);
142
144
  text-decoration: none;
143
145
  transition: all 0.15s;
144
146
  }
145
147
  .nr-card:hover .nr-card__action-link {
146
- opacity: 1;
147
148
  color: var(--nr-accent);
148
149
  }
149
150
  .nr-card__action-link:hover {
package/dist/chat.css CHANGED
@@ -55,7 +55,7 @@
55
55
  min-width: 2.5rem;
56
56
  padding: 0.5rem 1rem;
57
57
  border-radius: var(--nr-radius);
58
- background: var(--nr-bg-secondary);
58
+ background: var(--nr-muted);
59
59
  color: var(--nr-text);
60
60
  font-size: 0.9rem;
61
61
  }
@@ -8,7 +8,7 @@
8
8
  border-radius: var(--nr-radius);
9
9
  border: 1px solid var(--nr-border);
10
10
  overflow: hidden;
11
- background: rgba(30, 41, 59, 0.05);
11
+ background: color-mix(in oklab, var(--nr-bg-secondary) 30%, var(--nr-bg));
12
12
  }
13
13
 
14
14
  .nr-codeblock__header {
@@ -17,7 +17,7 @@
17
17
  gap: 0.5rem;
18
18
  padding: 0.5rem 1rem;
19
19
  border-bottom: 1px solid var(--nr-border);
20
- background: rgba(30, 41, 59, 0.1);
20
+ background: var(--nr-muted);
21
21
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
22
22
  font-size: 0.75rem;
23
23
  color: var(--nr-text-secondary);
@@ -48,12 +48,12 @@
48
48
  padding: 0.375rem;
49
49
  border-radius: var(--nr-radius-sm);
50
50
  border: none;
51
- background: rgba(30, 41, 59, 0.2);
51
+ background: var(--nr-muted);
52
52
  color: var(--nr-text-secondary);
53
53
  cursor: pointer;
54
54
  transition: background 0.15s, color 0.15s;
55
55
  }
56
56
  .nr-codeblock__copy:hover {
57
- background: rgba(30, 41, 59, 0.4);
57
+ background: color-mix(in oklab, var(--nr-bg-secondary) 70%, var(--nr-bg));
58
58
  color: var(--nr-text);
59
59
  }
package/dist/details.css CHANGED
@@ -12,18 +12,19 @@
12
12
  .nr-details__summary {
13
13
  cursor: pointer;
14
14
  padding: 1rem;
15
- font-weight: 700;
15
+ font-weight: 600;
16
16
  display: flex;
17
17
  align-items: center;
18
18
  gap: 0.5rem;
19
19
  list-style: none;
20
+ transition: background-color 0.15s;
20
21
  }
21
22
  .nr-details__summary::-webkit-details-marker {
22
23
  display: none;
23
24
  }
24
25
  .nr-details__summary:hover {
25
26
  color: var(--nr-accent);
26
- transition: color 0.15s;
27
+ background: var(--nr-muted);
27
28
  }
28
29
 
29
30
  .nr-details__icon {
package/dist/index.cjs CHANGED
@@ -11089,6 +11089,7 @@ function createModal(title) {
11089
11089
  header.appendChild(titleEl);
11090
11090
  const closeBtn = document.createElement("button");
11091
11091
  closeBtn.className = "nr-modal__close";
11092
+ closeBtn.setAttribute("aria-label", "Close");
11092
11093
  closeBtn.appendChild(createIcon("close"));
11093
11094
  closeBtn.addEventListener("click", () => dialog.close());
11094
11095
  header.appendChild(closeBtn);
@@ -11370,6 +11371,18 @@ function openModal(dialog) {
11370
11371
  }
11371
11372
  }
11372
11373
  var IMG_RE = /!\[([^\]]*)\]\(([^)]+)\)/g;
11374
+ function applyAlignClass(el, baseClass, align) {
11375
+ if (align === "center") {
11376
+ el.classList.add(`${baseClass}--center`);
11377
+ } else if (align === "right") {
11378
+ el.classList.add(`${baseClass}--right`);
11379
+ }
11380
+ }
11381
+ function resolveIcon(value, fallback) {
11382
+ if (!value) return fallback;
11383
+ if (value === "none" || value === "off") return null;
11384
+ return value;
11385
+ }
11373
11386
  function parseIntProp(value, defaultValue) {
11374
11387
  if (!value) return defaultValue;
11375
11388
  const n = parseInt(value, 10);
@@ -11409,13 +11422,16 @@ var modalDirective = ({ props, renderSlot }) => {
11409
11422
  const label = props.label || props.title || "Open";
11410
11423
  const modalTitle = props.title || "Modal";
11411
11424
  const align = props.align || "left";
11425
+ const iconName = resolveIcon(props.icon, "open_in_full");
11412
11426
  const wrapper = document.createElement("div");
11413
- wrapper.className = `nr-modal-trigger${align === "center" ? " nr-modal-trigger--center" : align === "right" ? " nr-modal-trigger--right" : ""}`;
11427
+ wrapper.className = "nr-modal-trigger";
11428
+ applyAlignClass(wrapper, "nr-modal-trigger", align);
11414
11429
  const btn = document.createElement("button");
11415
- btn.className = `nr-button nr-button--default`;
11430
+ btn.className = "nr-button nr-button--default";
11431
+ btn.setAttribute("aria-haspopup", "dialog");
11432
+ applyColor(btn, props.color, "nr-button");
11416
11433
  applyBaseProps(btn, props);
11417
- const icon = props.icon || "open_in_new";
11418
- if (icon) btn.appendChild(createIcon(icon));
11434
+ if (iconName) btn.appendChild(createIcon(iconName));
11419
11435
  btn.appendChild(document.createTextNode(label));
11420
11436
  const dialog = createModal(modalTitle);
11421
11437
  const body = dialog.querySelector(".nr-modal__body");
@@ -11436,20 +11452,21 @@ var modal_default = modalDirective;
11436
11452
  var buttonDirective = ({ props, renderSlot }) => {
11437
11453
  const url = props.url || props.href || "#";
11438
11454
  const label = props.label || props.title;
11439
- const icon = props.icon || "near_me";
11455
+ const iconName = resolveIcon(props.icon, "touch_app");
11440
11456
  const target = props.target || "_blank";
11441
- const customClass = props.class || "";
11442
11457
  const align = props.align || "left";
11443
11458
  const wrapper = document.createElement("div");
11444
- wrapper.className = `nr-button-wrap${align === "center" ? " nr-button-wrap--center" : align === "right" ? " nr-button-wrap--right" : ""}`;
11459
+ wrapper.className = "nr-button-wrap";
11460
+ applyAlignClass(wrapper, "nr-button-wrap", align);
11445
11461
  if (label) {
11446
11462
  const a = document.createElement("a");
11447
11463
  a.href = url;
11448
11464
  a.target = target;
11449
- a.rel = "noopener noreferrer";
11465
+ if (target === "_blank") a.rel = "noopener noreferrer";
11450
11466
  a.className = "nr-button nr-button--default";
11467
+ applyColor(a, props.color, "nr-button");
11451
11468
  applyBaseProps(a, props);
11452
- a.appendChild(createIcon(icon));
11469
+ if (iconName) a.appendChild(createIcon(iconName));
11453
11470
  a.appendChild(document.createTextNode(label));
11454
11471
  wrapper.appendChild(a);
11455
11472
  return wrapper;
@@ -11459,6 +11476,8 @@ var buttonDirective = ({ props, renderSlot }) => {
11459
11476
  if (links.length > 0) {
11460
11477
  links.forEach((link) => {
11461
11478
  link.classList.add("nr-button", "nr-button--default");
11479
+ applyColor(link, props.color, "nr-button");
11480
+ if (iconName) link.prepend(createIcon(iconName));
11462
11481
  applyBaseProps(link, props);
11463
11482
  });
11464
11483
  wrapper.appendChild(slotContent);
@@ -11466,10 +11485,11 @@ var buttonDirective = ({ props, renderSlot }) => {
11466
11485
  const a = document.createElement("a");
11467
11486
  a.href = url;
11468
11487
  a.target = target;
11469
- a.rel = "noopener noreferrer";
11488
+ if (target === "_blank") a.rel = "noopener noreferrer";
11470
11489
  a.className = "nr-button nr-button--default";
11490
+ applyColor(a, props.color, "nr-button");
11471
11491
  applyBaseProps(a, props);
11472
- a.appendChild(createIcon(icon));
11492
+ if (iconName) a.appendChild(createIcon(iconName));
11473
11493
  a.appendChild(slotContent);
11474
11494
  wrapper.appendChild(a);
11475
11495
  }
@@ -12258,6 +12278,10 @@ var directiveRegistry = {
12258
12278
  modal: modal_default,
12259
12279
  button: button_default,
12260
12280
  // Layout / generic wrappers
12281
+ // ⚠️ DEPRECATED — legacy only, kept for backward compatibility.
12282
+ // Do NOT document these (`:::div`, `:::style`, `:::custom`, `:::raw`)
12283
+ // in guides or llms.txt; use native HTML blocks instead.
12284
+ // See ./wrapper.ts for details.
12261
12285
  div: wrapper_default,
12262
12286
  style: wrapper_default,
12263
12287
  custom: wrapper_default,