@ni/nimble-components 20.10.3 → 20.12.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.
@@ -7516,6 +7516,16 @@
7516
7516
  applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties);
7517
7517
  applyMixins(Button$1, StartEnd, DelegatesARIAButton);
7518
7518
 
7519
+ /**
7520
+ * An Card Custom HTML Element.
7521
+ *
7522
+ * @slot - The default slot for the card content
7523
+ *
7524
+ * @public
7525
+ */
7526
+ let Card$1 = class Card extends FoundationElement {
7527
+ };
7528
+
7519
7529
  /**
7520
7530
  * The template for the {@link @microsoft/fast-foundation#(Checkbox:class)} component.
7521
7531
  * @public
@@ -16288,7 +16298,7 @@
16288
16298
 
16289
16299
  /**
16290
16300
  * Do not edit directly
16291
- * Generated on Wed, 01 Nov 2023 14:47:40 GMT
16301
+ * Generated on Wed, 01 Nov 2023 20:26:57 GMT
16292
16302
  */
16293
16303
 
16294
16304
  const Information100DarkUi = "#a46eff";
@@ -16673,9 +16683,9 @@
16673
16683
  return `${prefix}${uniqueIdCounter++}`;
16674
16684
  }
16675
16685
 
16676
- const template$A = html `<slot></slot>`;
16686
+ const template$B = html `<slot></slot>`;
16677
16687
 
16678
- const styles$T = css `
16688
+ const styles$U = css `
16679
16689
  :host {
16680
16690
  display: contents;
16681
16691
  }
@@ -16792,8 +16802,8 @@
16792
16802
  ], ThemeProvider.prototype, "theme", void 0);
16793
16803
  const nimbleDesignSystemProvider = ThemeProvider.compose({
16794
16804
  baseName: 'theme-provider',
16795
- styles: styles$T,
16796
- template: template$A
16805
+ styles: styles$U,
16806
+ template: template$B
16797
16807
  });
16798
16808
  DesignSystem.getOrCreate()
16799
16809
  .withPrefix('nimble')
@@ -16823,7 +16833,7 @@
16823
16833
  const actionRgbPartialColor = DesignToken.create(styleNameFromTokenName(tokenNames.actionRgbPartialColor)).withDefault((element) => hexToRgbPartial(getColorForTheme(element, Black91, Black15, White)));
16824
16834
  const applicationBackgroundColor = DesignToken.create(styleNameFromTokenName(tokenNames.applicationBackgroundColor)).withDefault((element) => getColorForTheme(element, White, Black85, ForestGreen));
16825
16835
  DesignToken.create(styleNameFromTokenName(tokenNames.headerBackgroundColor)).withDefault((element) => getColorForTheme(element, Black7, Black88, ForestGreen));
16826
- DesignToken.create(styleNameFromTokenName(tokenNames.sectionBackgroundColor)).withDefault((element) => getColorForTheme(element, Black15, Black80, ForestGreen));
16836
+ const sectionBackgroundColor = DesignToken.create(styleNameFromTokenName(tokenNames.sectionBackgroundColor)).withDefault((element) => getColorForTheme(element, Black15, Black80, ForestGreen));
16827
16837
  DesignToken.create(styleNameFromTokenName(tokenNames.dividerBackgroundColor)).withDefault((element) => getColorForTheme(element, Black15, Black80, ForestGreen));
16828
16838
  const fillSelectedColor = DesignToken.create(styleNameFromTokenName(tokenNames.fillSelectedColor)).withDefault((element) => hexToRgbaCssColor(getFillSelectedColorForTheme(element), 0.2));
16829
16839
  const fillSelectedRgbPartialColor = DesignToken.create(styleNameFromTokenName(tokenNames.fillSelectedRgbPartialColor)).withDefault((element) => hexToRgbPartial(getFillSelectedColorForTheme(element)));
@@ -16988,7 +16998,7 @@
16988
16998
  }
16989
16999
  }
16990
17000
 
16991
- const styles$S = css `
17001
+ const styles$T = css `
16992
17002
  ${display('inline')}
16993
17003
 
16994
17004
  :host {
@@ -17071,7 +17081,7 @@
17071
17081
  `;
17072
17082
 
17073
17083
  // prettier-ignore
17074
- const template$z = (_context, definition) => html `<a
17084
+ const template$A = (_context, definition) => html `<a
17075
17085
  class="control"
17076
17086
  part="control"
17077
17087
  download="${x => x.download}"
@@ -17161,8 +17171,8 @@
17161
17171
  const nimbleAnchor = Anchor.compose({
17162
17172
  baseName: 'anchor',
17163
17173
  baseClass: Anchor$1,
17164
- template: template$z,
17165
- styles: styles$S,
17174
+ template: template$A,
17175
+ styles: styles$T,
17166
17176
  shadowOptions: {
17167
17177
  delegatesFocus: true
17168
17178
  }
@@ -17265,7 +17275,7 @@
17265
17275
  padding: 0;
17266
17276
  `;
17267
17277
 
17268
- const styles$R = css `
17278
+ const styles$S = css `
17269
17279
  @layer base, hover, focusVisible, active, disabled, top;
17270
17280
 
17271
17281
  @layer base {
@@ -17542,8 +17552,8 @@
17542
17552
  }
17543
17553
  `));
17544
17554
 
17545
- const styles$Q = css `
17546
- ${styles$R}
17555
+ const styles$R = css `
17556
+ ${styles$S}
17547
17557
  ${buttonAppearanceVariantStyles}
17548
17558
 
17549
17559
  .control {
@@ -17551,7 +17561,7 @@
17551
17561
  }
17552
17562
  `;
17553
17563
 
17554
- const template$y = (context, definition) => html `
17564
+ const template$z = (context, definition) => html `
17555
17565
  <a
17556
17566
  class="control"
17557
17567
  part="control"
@@ -17633,8 +17643,8 @@
17633
17643
  ], AnchorButton.prototype, "disabled", void 0);
17634
17644
  const nimbleAnchorButton = AnchorButton.compose({
17635
17645
  baseName: 'anchor-button',
17636
- template: template$y,
17637
- styles: styles$Q,
17646
+ template: template$z,
17647
+ styles: styles$R,
17638
17648
  shadowOptions: {
17639
17649
  delegatesFocus: true
17640
17650
  }
@@ -17642,7 +17652,7 @@
17642
17652
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorButton());
17643
17653
  DesignSystem.tagFor(AnchorButton);
17644
17654
 
17645
- const styles$P = css `
17655
+ const styles$Q = css `
17646
17656
  ${display('grid')}
17647
17657
 
17648
17658
  :host {
@@ -17719,7 +17729,7 @@
17719
17729
  }
17720
17730
  `;
17721
17731
 
17722
- const template$x = (context, definition) => html `
17732
+ const template$y = (context, definition) => html `
17723
17733
  <template
17724
17734
  role="menuitem"
17725
17735
  class="${x => (typeof x.startColumnCount === 'number'
@@ -17825,8 +17835,8 @@
17825
17835
  // FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
17826
17836
  const nimbleAnchorMenuItem = AnchorMenuItem.compose({
17827
17837
  baseName: 'anchor-menu-item',
17828
- template: template$x,
17829
- styles: styles$P,
17838
+ template: template$y,
17839
+ styles: styles$Q,
17830
17840
  shadowOptions: {
17831
17841
  delegatesFocus: true
17832
17842
  }
@@ -17850,7 +17860,7 @@
17850
17860
  }
17851
17861
  });
17852
17862
 
17853
- const styles$O = css `
17863
+ const styles$P = css `
17854
17864
  ${display('inline-flex')}
17855
17865
 
17856
17866
  :host {
@@ -17966,7 +17976,7 @@
17966
17976
  }
17967
17977
  `;
17968
17978
 
17969
- const template$w = (context, definition) => html `
17979
+ const template$x = (context, definition) => html `
17970
17980
  <template slot="anchortab" role="tab" aria-disabled="${x => x.disabled}">
17971
17981
  <a
17972
17982
  download="${x => x.download}"
@@ -18018,8 +18028,8 @@
18018
18028
  // FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
18019
18029
  const nimbleAnchorTab = AnchorTab.compose({
18020
18030
  baseName: 'anchor-tab',
18021
- template: template$w,
18022
- styles: styles$O,
18031
+ template: template$x,
18032
+ styles: styles$P,
18023
18033
  shadowOptions: {
18024
18034
  delegatesFocus: true
18025
18035
  }
@@ -18027,7 +18037,7 @@
18027
18037
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorTab());
18028
18038
  DesignSystem.tagFor(AnchorTab);
18029
18039
 
18030
- const styles$N = css `
18040
+ const styles$O = css `
18031
18041
  ${display('grid')}
18032
18042
 
18033
18043
  :host {
@@ -18049,7 +18059,7 @@
18049
18059
  }
18050
18060
  `;
18051
18061
 
18052
- const template$v = (context, definition) => html `
18062
+ const template$w = (context, definition) => html `
18053
18063
  ${startSlotTemplate(context, definition)}
18054
18064
  <div ${ref('tablist')} class="tablist" part="tablist" role="tablist">
18055
18065
  <slot name="anchortab" ${slotted('tabs')}></slot>
@@ -18255,8 +18265,8 @@
18255
18265
  applyMixins(AnchorTabs, StartEnd);
18256
18266
  const nimbleAnchorTabs = AnchorTabs.compose({
18257
18267
  baseName: 'anchor-tabs',
18258
- template: template$v,
18259
- styles: styles$N,
18268
+ template: template$w,
18269
+ styles: styles$O,
18260
18270
  shadowOptions: {
18261
18271
  delegatesFocus: false
18262
18272
  }
@@ -18273,7 +18283,7 @@
18273
18283
  -webkit-user-select: none;
18274
18284
  `;
18275
18285
 
18276
- const styles$M = css `
18286
+ const styles$N = css `
18277
18287
  ${display('block')}
18278
18288
 
18279
18289
  :host {
@@ -18374,7 +18384,7 @@
18374
18384
  }
18375
18385
  `;
18376
18386
 
18377
- const template$u = (context, definition) => html `
18387
+ const template$v = (context, definition) => html `
18378
18388
  <template
18379
18389
  role="treeitem"
18380
18390
  slot="${x => (x.isNestedItem() ? 'item' : null)}"
@@ -18511,8 +18521,8 @@
18511
18521
  // FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
18512
18522
  const nimbleAnchorTreeItem = AnchorTreeItem.compose({
18513
18523
  baseName: 'anchor-tree-item',
18514
- template: template$u,
18515
- styles: styles$M,
18524
+ template: template$v,
18525
+ styles: styles$N,
18516
18526
  shadowOptions: {
18517
18527
  delegatesFocus: true
18518
18528
  }
@@ -18522,7 +18532,7 @@
18522
18532
  .register(nimbleAnchorTreeItem());
18523
18533
  DesignSystem.tagFor(AnchorTreeItem);
18524
18534
 
18525
- const styles$L = css `
18535
+ const styles$M = css `
18526
18536
  :host {
18527
18537
  contain: layout;
18528
18538
  display: block;
@@ -18546,7 +18556,7 @@
18546
18556
  baseName: 'anchored-region',
18547
18557
  baseClass: AnchoredRegion$1,
18548
18558
  template: anchoredRegionTemplate,
18549
- styles: styles$L
18559
+ styles: styles$M
18550
18560
  });
18551
18561
  DesignSystem.getOrCreate()
18552
18562
  .withPrefix('nimble')
@@ -18626,7 +18636,7 @@
18626
18636
  */
18627
18637
  const themeBehavior = (theme, styles) => new ThemeStyleSheetBehavior(theme, styles);
18628
18638
 
18629
- const styles$K = css `
18639
+ const styles$L = css `
18630
18640
  ${display('flex')}
18631
18641
 
18632
18642
  :host {
@@ -18769,8 +18779,8 @@
18769
18779
  }
18770
18780
  `));
18771
18781
 
18772
- const styles$J = css `
18773
- ${styles$R}
18782
+ const styles$K = css `
18783
+ ${styles$S}
18774
18784
  ${buttonAppearanceVariantStyles}
18775
18785
  `;
18776
18786
 
@@ -18816,7 +18826,7 @@
18816
18826
  baseName: 'button',
18817
18827
  baseClass: Button$1,
18818
18828
  template: buttonTemplate,
18819
- styles: styles$J,
18829
+ styles: styles$K,
18820
18830
  shadowOptions: {
18821
18831
  delegatesFocus: true
18822
18832
  }
@@ -18889,6 +18899,10 @@
18889
18899
  name: 'arrows_repeat_16_x_16',
18890
18900
  data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path class="cls-1" d="M8.75 11.75 10 14l-6-3 6-3-1.25 2.25ZM8 11h1a4 4 0 0 0 4-4M7.25 5.75 6 8l6-3-6-3 1.25 2.25ZM8 5H7a4 4 0 0 0-4 4"/></svg>`
18891
18901
  };
18902
+ const at16X16 = {
18903
+ name: 'at_16_x_16',
18904
+ data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" xml:space="preserve"><path d="M12.139 3.621a5.49 5.49 0 0 1 1.206 1.845c.29.716.436 1.519.436 2.407 0 .641-.091 1.292-.275 1.954-.183.662-.412 1.211-.687 1.646H9.343l-.11-.536a4.554 4.554 0 0 1-.756.415c-.242.104-.593.155-1.051.155-.747 0-1.351-.308-1.813-.924-.462-.616-.694-1.446-.694-2.49 0-.558.078-1.047.234-1.467.156-.418.369-.784.639-1.095.252-.293.556-.522.914-.687a2.518 2.518 0 0 1 1.064-.248c.302 0 .57.056.804.169.234.112.414.23.543.353v-.425h1.594v5.605h1.168c.165-.362.288-.755.368-1.178.079-.424.12-.83.12-1.22 0-.774-.108-1.453-.323-2.036-.215-.585-.512-1.069-.892-1.453a3.695 3.695 0 0 0-1.366-.879 4.861 4.861 0 0 0-1.697-.289c-.581 0-1.133.115-1.657.343a4.548 4.548 0 0 0-1.383.928c-.407.398-.738.898-.992 1.497s-.381 1.257-.381 1.972c0 .778.12 1.468.36 2.068.24.6.559 1.099.958 1.497.397.393.86.694 1.386.9a4.533 4.533 0 0 0 1.668.309c.389 0 .831-.035 1.328-.106a9.3 9.3 0 0 0 1.321-.279v1.333c-.426.096-.85.17-1.271.22-.422.049-.882.075-1.381.075a6.124 6.124 0 0 1-2.325-.433 5.415 5.415 0 0 1-1.852-1.23 5.58 5.58 0 0 1-1.212-1.91 6.666 6.666 0 0 1-.436-2.444c0-.852.151-1.641.453-2.366a5.94 5.94 0 0 1 1.25-1.9A5.66 5.66 0 0 1 5.781 2.46 5.808 5.808 0 0 1 8.079 2c.806 0 1.558.142 2.257.426a5.273 5.273 0 0 1 1.803 1.195zM9.082 9.652V6.19a2.79 2.79 0 0 0-.522-.21 2.1 2.1 0 0 0-.543-.065c-.44 0-.778.192-1.017.577s-.357.912-.357 1.58c0 .723.098 1.259.295 1.607.197.348.522.522.975.522.238 0 .446-.047.625-.141.18-.093.36-.229.544-.408z"/></svg>`
18905
+ };
18892
18906
  const bars16X16 = {
18893
18907
  name: 'bars_16_x_16',
18894
18908
  data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path class="cls-1" d="M2 13v-2h12v2Zm0-4V7h12v2Zm0-4V3h12v2Z"/></svg>`
@@ -19495,13 +19509,13 @@
19495
19509
  };
19496
19510
 
19497
19511
  // Avoiding any whitespace in the template because this is an inline element
19498
- const template$t = html `<div
19512
+ const template$u = html `<div
19499
19513
  class="icon"
19500
19514
  aria-hidden="true"
19501
19515
  :innerHTML=${x => x.icon.data}
19502
19516
  ></div>`;
19503
19517
 
19504
- const styles$I = css `
19518
+ const styles$J = css `
19505
19519
  ${display('inline-flex')}
19506
19520
 
19507
19521
  :host {
@@ -19554,8 +19568,8 @@
19554
19568
  const registerIcon = (baseName, iconClass) => {
19555
19569
  const composedIcon = iconClass.compose({
19556
19570
  baseName,
19557
- template: template$t,
19558
- styles: styles$I,
19571
+ template: template$u,
19572
+ styles: styles$J,
19559
19573
  baseClass: iconClass
19560
19574
  });
19561
19575
  DesignSystem.getOrCreate().withPrefix('nimble').register(composedIcon());
@@ -19659,7 +19673,7 @@
19659
19673
  }).withDefault(coreLabelDefaults.informationIconLabel);
19660
19674
 
19661
19675
  // prettier-ignore
19662
- const template$s = html `
19676
+ const template$t = html `
19663
19677
  <div class="container"
19664
19678
  role="status"
19665
19679
  aria-atomic="${x => x.ariaAtomic}"
@@ -19775,13 +19789,13 @@
19775
19789
  applyMixins(Banner, ARIAGlobalStatesAndProperties);
19776
19790
  const nimbleBanner = Banner.compose({
19777
19791
  baseName: 'banner',
19778
- template: template$s,
19779
- styles: styles$K
19792
+ template: template$t,
19793
+ styles: styles$L
19780
19794
  });
19781
19795
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());
19782
19796
  DesignSystem.tagFor(Banner);
19783
19797
 
19784
- const styles$H = css `
19798
+ const styles$I = css `
19785
19799
  ${display('inline-block')}
19786
19800
 
19787
19801
  :host {
@@ -19822,12 +19836,12 @@
19822
19836
  baseName: 'breadcrumb',
19823
19837
  baseClass: Breadcrumb$1,
19824
19838
  template: breadcrumbTemplate,
19825
- styles: styles$H
19839
+ styles: styles$I
19826
19840
  });
19827
19841
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBreadcrumb());
19828
19842
  DesignSystem.tagFor(Breadcrumb);
19829
19843
 
19830
- const styles$G = css `
19844
+ const styles$H = css `
19831
19845
  ${display('inline-flex')}
19832
19846
 
19833
19847
  :host {
@@ -19901,7 +19915,7 @@
19901
19915
  baseName: 'breadcrumb-item',
19902
19916
  baseClass: BreadcrumbItem$1,
19903
19917
  template: breadcrumbItemTemplate,
19904
- styles: styles$G,
19918
+ styles: styles$H,
19905
19919
  separator: forwardSlash16X16.data
19906
19920
  });
19907
19921
  DesignSystem.getOrCreate()
@@ -19909,6 +19923,36 @@
19909
19923
  .register(nimbleBreadcrumbItem());
19910
19924
  DesignSystem.tagFor(BreadcrumbItem);
19911
19925
 
19926
+ const styles$G = css `
19927
+ ${display('flex')}
19928
+
19929
+ :host {
19930
+ flex-direction: column;
19931
+ gap: ${standardPadding};
19932
+ padding: ${standardPadding};
19933
+ border: ${borderWidth} solid ${borderColor};
19934
+ font: ${bodyFont};
19935
+ color: ${bodyFontColor};
19936
+ background-color: ${sectionBackgroundColor};
19937
+ }
19938
+ `;
19939
+
19940
+ const template$s = html `<slot></slot>`;
19941
+
19942
+ /**
19943
+ * A nimble-styled card
19944
+ */
19945
+ class Card extends Card$1 {
19946
+ }
19947
+ const nimbleCard = Card.compose({
19948
+ baseName: 'card',
19949
+ baseClass: Card$1,
19950
+ template: template$s,
19951
+ styles: styles$G
19952
+ });
19953
+ DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCard());
19954
+ DesignSystem.tagFor(Card);
19955
+
19912
19956
  const styles$F = css `
19913
19957
  ${display('inline-flex')}
19914
19958
 
@@ -20202,7 +20246,7 @@
20202
20246
  const checkboxTag = DesignSystem.tagFor(Checkbox);
20203
20247
 
20204
20248
  const styles$D = css `
20205
- ${styles$R}
20249
+ ${styles$S}
20206
20250
 
20207
20251
  @layer base {
20208
20252
  .control[aria-pressed='true'] {
@@ -21756,6 +21800,19 @@
21756
21800
  registerIcon('icon-arrows-repeat', IconArrowsRepeat);
21757
21801
  DesignSystem.tagFor(IconArrowsRepeat);
21758
21802
 
21803
+ // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
21804
+ // See generation source in nimble-components/build/generate-icons
21805
+ /**
21806
+ * The icon component for the 'at' icon
21807
+ */
21808
+ class IconAt extends Icon {
21809
+ constructor() {
21810
+ super(at16X16);
21811
+ }
21812
+ }
21813
+ registerIcon('icon-at', IconAt);
21814
+ DesignSystem.tagFor(IconAt);
21815
+
21759
21816
  // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
21760
21817
  // See generation source in nimble-components/build/generate-icons
21761
21818
  /**
@@ -44574,6 +44631,39 @@ img.ProseMirror-separator {
44574
44631
  });
44575
44632
  }
44576
44633
 
44634
+ function pasteHandler(options) {
44635
+ return new Plugin({
44636
+ key: new PluginKey('handlePasteLink'),
44637
+ props: {
44638
+ handlePaste: (view, event, slice) => {
44639
+ var _a;
44640
+ const { state } = view;
44641
+ const { selection } = state;
44642
+ const { empty } = selection;
44643
+ if (empty) {
44644
+ return false;
44645
+ }
44646
+ let textContent = '';
44647
+ slice.content.forEach(node => {
44648
+ textContent += node.textContent;
44649
+ });
44650
+ const link = find$1(textContent).find(item => item.isLink && item.value === textContent);
44651
+ if (!textContent || !link) {
44652
+ return false;
44653
+ }
44654
+ const html = (_a = event.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/html');
44655
+ const hrefRegex = /href="([^"]*)"/;
44656
+ const existingLink = html === null || html === void 0 ? void 0 : html.match(hrefRegex);
44657
+ const url = existingLink ? existingLink[1] : link.href;
44658
+ options.editor.commands.setMark(options.type, {
44659
+ href: url,
44660
+ });
44661
+ return true;
44662
+ },
44663
+ },
44664
+ });
44665
+ }
44666
+
44577
44667
  const Link = Mark.create({
44578
44668
  name: 'link',
44579
44669
  priority: 1000,
@@ -44667,7 +44757,7 @@ img.ProseMirror-separator {
44667
44757
  type: this.type,
44668
44758
  getAttributes: (match, pasteEvent) => {
44669
44759
  var _a, _b;
44670
- const html = (_a = pasteEvent.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/html');
44760
+ const html = (_a = pasteEvent === null || pasteEvent === void 0 ? void 0 : pasteEvent.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/html');
44671
44761
  const hrefRegex = /href="([^"]*)"/;
44672
44762
  const existingLink = html === null || html === void 0 ? void 0 : html.match(hrefRegex);
44673
44763
  if (existingLink) {
@@ -44695,6 +44785,12 @@ img.ProseMirror-separator {
44695
44785
  type: this.type,
44696
44786
  }));
44697
44787
  }
44788
+ if (this.options.linkOnPaste) {
44789
+ plugins.push(pasteHandler({
44790
+ editor: this.editor,
44791
+ type: this.type,
44792
+ }));
44793
+ }
44698
44794
  return plugins;
44699
44795
  },
44700
44796
  });