@ni/nimble-components 24.1.10 → 24.1.12
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/dist/all-components-bundle.js +86 -82
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +822 -832
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/anchor/styles.js +56 -68
- package/dist/esm/anchor/styles.js.map +1 -1
- package/dist/esm/breadcrumb-item/styles.js +1 -1
- package/dist/esm/breadcrumb-item/styles.js.map +1 -1
- package/dist/esm/rich-text/models/markdown-parser.d.ts +1 -0
- package/dist/esm/rich-text/models/markdown-parser.js +10 -2
- package/dist/esm/rich-text/models/markdown-parser.js.map +1 -1
- package/dist/esm/rich-text/viewer/styles.js +7 -4
- package/dist/esm/rich-text/viewer/styles.js.map +1 -1
- package/dist/esm/select/index.js +11 -6
- package/dist/esm/select/index.js.map +1 -1
- package/dist/esm/src/rich-text/models/markdown-parser.d.ts +1 -0
- package/dist/esm/theme-provider/design-tokens.js +1 -1
- package/dist/esm/theme-provider/design-tokens.js.map +1 -1
- package/package.json +1 -1
|
@@ -16333,7 +16333,7 @@
|
|
|
16333
16333
|
|
|
16334
16334
|
/**
|
|
16335
16335
|
* Do not edit directly
|
|
16336
|
-
* Generated on Wed, 10 Apr 2024
|
|
16336
|
+
* Generated on Wed, 10 Apr 2024 19:20:19 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,
|
|
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
|
-
|
|
17101
|
+
@layer base, hover, focusVisible, active, disabled;
|
|
17102
17102
|
|
|
17103
|
-
|
|
17104
|
-
|
|
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
|
-
|
|
17133
|
-
|
|
17134
|
-
|
|
17106
|
+
:host {
|
|
17107
|
+
box-sizing: border-box;
|
|
17108
|
+
font: ${linkFont};
|
|
17109
|
+
}
|
|
17135
17110
|
|
|
17136
|
-
|
|
17137
|
-
|
|
17138
|
-
|
|
17139
|
-
}
|
|
17111
|
+
.top-container {
|
|
17112
|
+
display: contents;
|
|
17113
|
+
}
|
|
17140
17114
|
|
|
17141
|
-
|
|
17142
|
-
|
|
17143
|
-
|
|
17115
|
+
.control {
|
|
17116
|
+
color: ${linkFontColor};
|
|
17117
|
+
text-decoration: underline;
|
|
17118
|
+
}
|
|
17144
17119
|
|
|
17145
|
-
|
|
17146
|
-
|
|
17147
|
-
|
|
17120
|
+
:host([underline-hidden]) .control {
|
|
17121
|
+
text-decoration: none;
|
|
17122
|
+
}
|
|
17148
17123
|
|
|
17149
|
-
|
|
17150
|
-
|
|
17151
|
-
|
|
17124
|
+
:host([appearance='prominent']) .control {
|
|
17125
|
+
color: ${linkProminentFontColor};
|
|
17126
|
+
}
|
|
17152
17127
|
|
|
17153
|
-
|
|
17154
|
-
|
|
17155
|
-
|
|
17128
|
+
[part='start'] {
|
|
17129
|
+
display: none;
|
|
17130
|
+
}
|
|
17156
17131
|
|
|
17157
|
-
|
|
17158
|
-
|
|
17159
|
-
|
|
17132
|
+
.content {
|
|
17133
|
+
pointer-events: none;
|
|
17134
|
+
}
|
|
17160
17135
|
|
|
17161
|
-
|
|
17162
|
-
|
|
17136
|
+
[part='end'] {
|
|
17137
|
+
display: none;
|
|
17138
|
+
}
|
|
17163
17139
|
}
|
|
17164
17140
|
|
|
17165
|
-
|
|
17166
|
-
|
|
17141
|
+
@layer hover {
|
|
17142
|
+
.control:any-link:hover {
|
|
17143
|
+
text-decoration: underline;
|
|
17144
|
+
}
|
|
17167
17145
|
}
|
|
17168
17146
|
|
|
17169
|
-
|
|
17170
|
-
|
|
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
|
-
|
|
17174
|
-
|
|
17175
|
-
|
|
17155
|
+
@layer active {
|
|
17156
|
+
.control:active {
|
|
17157
|
+
color: ${linkActiveFontColor};
|
|
17158
|
+
text-decoration: underline;
|
|
17159
|
+
box-shadow: none;
|
|
17160
|
+
}
|
|
17176
17161
|
|
|
17177
|
-
|
|
17178
|
-
|
|
17179
|
-
|
|
17162
|
+
:host([appearance='prominent']) .control:active {
|
|
17163
|
+
color: ${linkActiveProminentFontColor};
|
|
17164
|
+
}
|
|
17180
17165
|
|
|
17181
|
-
|
|
17182
|
-
|
|
17166
|
+
:host([underline-hidden]) .control:active {
|
|
17167
|
+
text-decoration: none;
|
|
17168
|
+
}
|
|
17183
17169
|
}
|
|
17184
17170
|
|
|
17185
|
-
|
|
17186
|
-
|
|
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:
|
|
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:
|
|
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
|
-
*
|
|
58342
|
-
*
|
|
58343
|
-
*
|
|
58344
|
-
* attribute
|
|
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
|
*/ ''}
|
|
@@ -58660,6 +58659,9 @@ img.ProseMirror-separator {
|
|
|
58660
58659
|
const isNimbleListOption = (el) => {
|
|
58661
58660
|
return el instanceof ListOption;
|
|
58662
58661
|
};
|
|
58662
|
+
const isOptionSelectable = (el) => {
|
|
58663
|
+
return !el.visuallyHidden && !el.disabled && !el.hidden;
|
|
58664
|
+
};
|
|
58663
58665
|
/**
|
|
58664
58666
|
* A nimble-styled HTML select.
|
|
58665
58667
|
*/
|
|
@@ -59089,7 +59091,9 @@ img.ProseMirror-separator {
|
|
|
59089
59091
|
// don't call super.selectNextOption as that relies on side-effecty
|
|
59090
59092
|
// behavior to not select disabled option (which no longer works)
|
|
59091
59093
|
for (let i = this.selectedIndex + 1; i < this.options.length; i++) {
|
|
59092
|
-
|
|
59094
|
+
const listOption = this.options[i];
|
|
59095
|
+
if (isNimbleListOption(listOption)
|
|
59096
|
+
&& isOptionSelectable(listOption)) {
|
|
59093
59097
|
this.selectedIndex = i;
|
|
59094
59098
|
break;
|
|
59095
59099
|
}
|
|
@@ -59099,7 +59103,9 @@ img.ProseMirror-separator {
|
|
|
59099
59103
|
// don't call super.selectPreviousOption as that relies on side-effecty
|
|
59100
59104
|
// behavior to not select disabled option (which no longer works)
|
|
59101
59105
|
for (let i = this.selectedIndex - 1; i >= 0; i--) {
|
|
59102
|
-
|
|
59106
|
+
const listOption = this.options[i];
|
|
59107
|
+
if (isNimbleListOption(listOption)
|
|
59108
|
+
&& isOptionSelectable(listOption)) {
|
|
59103
59109
|
this.selectedIndex = i;
|
|
59104
59110
|
break;
|
|
59105
59111
|
}
|
|
@@ -59208,9 +59214,6 @@ img.ProseMirror-separator {
|
|
|
59208
59214
|
const optionIsSelected = (option) => {
|
|
59209
59215
|
return option.hasAttribute('selected') || option.selected;
|
|
59210
59216
|
};
|
|
59211
|
-
const optionIsDisabled = (option) => {
|
|
59212
|
-
return option.hasAttribute('disabled') || option.disabled;
|
|
59213
|
-
};
|
|
59214
59217
|
let selectedIndex = -1;
|
|
59215
59218
|
let firstValidOptionIndex = -1;
|
|
59216
59219
|
for (let i = 0; i < options?.length; i++) {
|
|
@@ -59218,7 +59221,8 @@ img.ProseMirror-separator {
|
|
|
59218
59221
|
if (optionIsSelected(option) || option?.value === this.value) {
|
|
59219
59222
|
selectedIndex = i;
|
|
59220
59223
|
}
|
|
59221
|
-
if (firstValidOptionIndex === -1
|
|
59224
|
+
if (firstValidOptionIndex === -1
|
|
59225
|
+
&& isOptionSelectable(option)) {
|
|
59222
59226
|
firstValidOptionIndex = i;
|
|
59223
59227
|
}
|
|
59224
59228
|
}
|