@ni/nimble-components 24.1.10 → 24.1.11

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.
@@ -16333,7 +16333,7 @@
16333
16333
 
16334
16334
  /**
16335
16335
  * Do not edit directly
16336
- * Generated on Wed, 10 Apr 2024 00:13:11 GMT
16336
+ * Generated on Wed, 10 Apr 2024 17:29:50 GMT
16337
16337
  */
16338
16338
 
16339
16339
  const Information100DarkUi = "#a46eff";
@@ -16988,7 +16988,7 @@
16988
16988
  const [linkFont, linkFontColor, linkDisabledFontColor, linkFontFamily, linkFontWeight, linkFontSize, linkFontLineHeight, linkFallbackFontFamily] = createFontTokens(tokenNames.linkFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
16989
16989
  const [linkActiveFont, linkActiveFontColor, linkActiveDisabledFontColor, linkActiveFontFamily, linkActiveFontWeight, linkActiveFontSize, linkActiveFontLineHeight, linkActiveFallbackFontFamily] = createFontTokens(tokenNames.linkActiveFont, (element) => getColorForTheme(element, DigitalGreenLight, DigitalGreenLight, hexToRgbaCssColor(White, 0.6)), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
16990
16990
  const [linkProminentFont, linkProminentFontColor, linkProminentDisabledFontColor, linkProminentFontFamily, linkProminentFontWeight, linkProminentFontSize, linkProminentFontLineHeight, linkProminentFallbackFontFamily] = createFontTokens(tokenNames.linkProminentFont, (element) => getColorForTheme(element, DigitalGreenDark105, PowerGreen, PowerGreen), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
16991
- const [linkActiveProminentFont, linkActiveProminentFontColor, linkActiveProminentDisabledFontColor, linkActiveProminentFontFamily, linkActiveProminentFontWeight, linkActiveProminentFontSize, linkActiveProminentFontLineHeight, linkActiveProminentFallbackFontFamily] = createFontTokens(tokenNames.linkActiveProminentFont, (element) => getColorForTheme(element, DigitalGreenLight, DigitalGreenLight, PowerGreen), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
16991
+ const [linkActiveProminentFont, linkActiveProminentFontColor, linkActiveProminentDisabledFontColor, linkActiveProminentFontFamily, linkActiveProminentFontWeight, linkActiveProminentFontSize, linkActiveProminentFontLineHeight, linkActiveProminentFallbackFontFamily] = createFontTokens(tokenNames.linkActiveProminentFont, (element) => getColorForTheme(element, DigitalGreenLight, DigitalGreenLight, hexToRgbaCssColor(White, 0.6)), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
16992
16992
  const [placeholderFont, placeholderFontColor, placeholderDisabledFontColor, placeholderFontFamily, placeholderFontWeight, placeholderFontSize, placeholderFontLineHeight, placeholderFallbackFontFamily] = createFontTokens(tokenNames.placeholderFont, (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.6), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), PlaceholderFamily, PlaceholderWeight, PlaceholderSize, PlaceholderLineHeight, PlaceholderFallbackFontFamily);
16993
16993
  const [bodyFont, bodyFontColor, bodyDisabledFontColor, bodyFontFamily, bodyFontWeight, bodyFontSize, bodyFontLineHeight, bodyFallbackFontFamily] = createFontTokens(tokenNames.bodyFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), BodyFamily, BodyWeight, BodySize, BodyLineHeight, BodyFallbackFontFamily);
16994
16994
  const [bodyEmphasizedFont, bodyEmphasizedFontColor, bodyEmphasizedDisabledFontColor, bodyEmphasizedFontFamily, bodyEmphasizedFontWeight, bodyEmphasizedFontSize, bodyEmphasizedFontLineHeight, bodyEmphasizedFallbackFontFamily] = createFontTokens(tokenNames.bodyEmphasizedFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), BodyEmphasizedFamily, BodyEmphasizedWeight, BodyEmphasizedSize, BodyEmphasizedLineHeight, BodyEmphasizedFallbackFontFamily);
@@ -17098,92 +17098,80 @@
17098
17098
  }
17099
17099
 
17100
17100
  const styles$W = css `
17101
- ${display('inline')}
17101
+ @layer base, hover, focusVisible, active, disabled;
17102
17102
 
17103
- :host {
17104
- box-sizing: border-box;
17105
- font: ${linkFont};
17106
- }
17107
-
17108
- .top-container {
17109
- display: contents;
17110
- }
17111
-
17112
- [part='start'] {
17113
- display: none;
17114
- }
17115
-
17116
- .control {
17117
- color: ${linkFontColor};
17118
- text-decoration: underline;
17119
- }
17120
-
17121
- .control${focusVisible} {
17122
- display: inline;
17123
- outline: none;
17124
- box-shadow: inset 0px -1px ${linkFontColor};
17125
- }
17126
-
17127
- .control:active {
17128
- color: ${linkActiveFontColor};
17129
- text-decoration: underline;
17130
- }
17103
+ @layer base {
17104
+ ${display('inline')}
17131
17105
 
17132
- .control${focusVisible}:active {
17133
- box-shadow: inset 0px -1px ${linkActiveFontColor};
17134
- }
17106
+ :host {
17107
+ box-sizing: border-box;
17108
+ font: ${linkFont};
17109
+ }
17135
17110
 
17136
- .control:not(:any-link) {
17137
- color: ${linkDisabledFontColor};
17138
- text-decoration: none;
17139
- }
17111
+ .top-container {
17112
+ display: contents;
17113
+ }
17140
17114
 
17141
- .control:not(:any-link):active {
17142
- color: ${linkActiveDisabledFontColor};
17143
- }
17115
+ .control {
17116
+ color: ${linkFontColor};
17117
+ text-decoration: underline;
17118
+ }
17144
17119
 
17145
- :host([underline-hidden]) .control {
17146
- text-decoration: none;
17147
- }
17120
+ :host([underline-hidden]) .control {
17121
+ text-decoration: none;
17122
+ }
17148
17123
 
17149
- :host([underline-hidden]) .control:hover {
17150
- text-decoration: underline;
17151
- }
17124
+ :host([appearance='prominent']) .control {
17125
+ color: ${linkProminentFontColor};
17126
+ }
17152
17127
 
17153
- :host([underline-hidden]) .control${focusVisible} {
17154
- text-decoration: underline;
17155
- }
17128
+ [part='start'] {
17129
+ display: none;
17130
+ }
17156
17131
 
17157
- :host([underline-hidden]) .control:not(:any-link) {
17158
- text-decoration: none;
17159
- }
17132
+ .content {
17133
+ pointer-events: none;
17134
+ }
17160
17135
 
17161
- :host([appearance='prominent']) .control {
17162
- color: ${linkProminentFontColor};
17136
+ [part='end'] {
17137
+ display: none;
17138
+ }
17163
17139
  }
17164
17140
 
17165
- :host([appearance='prominent']) .control:active {
17166
- color: ${linkActiveProminentFontColor};
17141
+ @layer hover {
17142
+ .control:any-link:hover {
17143
+ text-decoration: underline;
17144
+ }
17167
17145
  }
17168
17146
 
17169
- :host([appearance='prominent']) .control${focusVisible} {
17170
- box-shadow: inset 0px -1px ${linkProminentFontColor};
17147
+ @layer focusVisible {
17148
+ .control${focusVisible} {
17149
+ outline: none;
17150
+ box-shadow: inset 0px -1px;
17151
+ text-decoration: underline;
17152
+ }
17171
17153
  }
17172
17154
 
17173
- :host([appearance='prominent']) .control${focusVisible}:active {
17174
- box-shadow: inset 0px -1px ${linkActiveProminentFontColor};
17175
- }
17155
+ @layer active {
17156
+ .control:active {
17157
+ color: ${linkActiveFontColor};
17158
+ text-decoration: underline;
17159
+ box-shadow: none;
17160
+ }
17176
17161
 
17177
- :host([appearance='prominent']) .control:not(:any-link) {
17178
- color: ${linkProminentDisabledFontColor};
17179
- }
17162
+ :host([appearance='prominent']) .control:active {
17163
+ color: ${linkActiveProminentFontColor};
17164
+ }
17180
17165
 
17181
- .content {
17182
- pointer-events: none;
17166
+ :host([underline-hidden]) .control:active {
17167
+ text-decoration: none;
17168
+ }
17183
17169
  }
17184
17170
 
17185
- [part='end'] {
17186
- display: none;
17171
+ @layer disabled {
17172
+ .control:not(:any-link) {
17173
+ color: ${linkDisabledFontColor};
17174
+ }
17187
17175
  }
17188
17176
  `;
17189
17177
 
@@ -20088,7 +20076,7 @@
20088
20076
 
20089
20077
  .control:active {
20090
20078
  color: var(--ni-private-breadcrumb-link-active-font-color);
20091
- text-decoration: underline;
20079
+ text-decoration: none;
20092
20080
  }
20093
20081
 
20094
20082
  [part='start'] {
@@ -53301,12 +53289,17 @@ img.ProseMirror-separator {
53301
53289
  * scheme and no matching mention pattern will be rendered as plain text (anchor with no href).
53302
53290
  * With this, the user can click the links only when the scheme is HTTP/HTTPS
53303
53291
  */
53304
- href: /^https?:\/\//i.test(href) ? href : null,
53292
+ href: RichTextMarkdownParser.startsWithHttpOrHttps(href)
53293
+ ? href
53294
+ : null,
53305
53295
  rel: node.attrs.rel,
53306
53296
  // Adding `class` here is a workaround to render two mentions without a whitespace as display names
53307
53297
  // This attribute can be removed when the below issue is resolved
53308
53298
  // https://github.com/ni/nimble/issues/1707
53309
- class: href
53299
+ class: href,
53300
+ 'underline-hidden': RichTextMarkdownParser.startsWithHttpOrHttps(href)
53301
+ ? null
53302
+ : true
53310
53303
  }
53311
53304
  ];
53312
53305
  }
@@ -53324,6 +53317,9 @@ img.ProseMirror-separator {
53324
53317
  RichTextMarkdownParser.mentionConfigs = undefined;
53325
53318
  RichTextMarkdownParser.mentionedHrefs.clear();
53326
53319
  }
53320
+ static startsWithHttpOrHttps(href) {
53321
+ return /^https?:\/\//i.test(href);
53322
+ }
53327
53323
  }
53328
53324
  _a$1 = RichTextMarkdownParser;
53329
53325
  RichTextMarkdownParser.mentionedHrefs = new Set();
@@ -58338,10 +58334,13 @@ img.ProseMirror-separator {
58338
58334
 
58339
58335
  ${
58340
58336
  /**
58341
- * When an absolute link is not HTTPS/HTTP, the anchor tag renders without an `href`, appearing as plain text.
58342
- * However, the `nimble-anchor` displays differently in color when the `href` attribute is absent.
58343
- * To ensure a consistent appearance, the font color is forced to the default link color regardless of the `href`
58344
- * attribute's presence.
58337
+ * In the rich-text editor, an absolute link renders as a native anchor, not a `nimble-anchor`. When such a link
58338
+ * is not HTTPS/HTTP, the anchor renders without an `href`, appearing as plain text.
58339
+ * However, in the rich-text viewer, absolute links are rendered as `nimble-anchor`s, and they do not look like
58340
+ * plain text when the `href` attribute is absent. They have a "disabled" color and may have an underline.
58341
+ * To ensure a consistent appearance between the editor and viewer, we force the font color to the default link/
58342
+ * plain text color regardless of the `href` attribute's presence. To remove the underline, the markdown parser
58343
+ * emits an `underline-hidden` attribute when the `href` attribute is absent.
58345
58344
  *
58346
58345
  * See models/markdown-parser.ts where link elements are emitted for more info.
58347
58346
  */ ''}