@ni/ok-components 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.
@@ -17515,6 +17515,212 @@ class G1 extends He{constructor(){super(...arguments),this.header="",this.expand
17515
17515
  const Z1=G1.compose({baseName:"fv-accordion-item",template:W1,styles:j1})
17516
17516
  Mi.getOrCreate().withPrefix("ok").register(Z1())
17517
17517
  const K1=_t`
17518
+ @layer base, hover, focusVisible, active, disabled, top;
17519
+
17520
+ @layer base {
17521
+ ${z1("inline-block")}
17522
+
17523
+ :host {
17524
+ --ni-private-fv-search-input-inline-padding: ${Ac};
17525
+ --ni-private-fv-search-input-leading-inset: ${Ec};
17526
+ --ni-private-fv-search-input-leading-space: calc(var(--ni-private-fv-search-input-leading-inset) + ${Rc} + ${Ic});
17527
+ --ni-private-fv-search-input-trailing-space: calc(var(--ni-private-fv-search-input-inline-padding) + ${Rc});
17528
+ --ni-private-fv-search-input-border-color: rgba(${nc}, 0.3);
17529
+ --ni-private-fv-search-input-border-radius: 0px;
17530
+ min-width: 120px;
17531
+ height: ${_c};
17532
+ font: ${sd};
17533
+ color: ${ad};
17534
+ }
17535
+
17536
+ .search-input-container {
17537
+ position: relative;
17538
+ display: flex;
17539
+ align-items: center;
17540
+ width: 100%;
17541
+ height: 100%;
17542
+ border: ${Dc} solid transparent;
17543
+ border-radius: var(--ni-private-fv-search-input-border-radius);
17544
+ color: inherit;
17545
+ background-color: transparent;
17546
+ transition:
17547
+ border-color ${qd} ease-in-out,
17548
+ box-shadow ${qd} ease-in-out,
17549
+ background-color ${qd} ease-in-out;
17550
+ }
17551
+
17552
+ .search-input-container::after {
17553
+ content: '';
17554
+ position: absolute;
17555
+ inset-inline: 0;
17556
+ inset-block-end: calc(-1 * ${Dc});
17557
+ border-bottom: calc(${Dc} + 1px) solid ${lc};
17558
+ transform: scaleX(0);
17559
+ transform-origin: center;
17560
+ transition:
17561
+ transform ${qd} ease-in-out,
17562
+ border-bottom-color ${qd} ease-in-out;
17563
+ pointer-events: none;
17564
+ }
17565
+
17566
+ .search-input-icon {
17567
+ position: absolute;
17568
+ display: inline-flex;
17569
+ align-items: center;
17570
+ justify-content: center;
17571
+ top: 50%;
17572
+ inset-inline-start: var(--ni-private-fv-search-input-leading-inset);
17573
+ transform: translateY(-50%);
17574
+ color: ${rd};
17575
+ pointer-events: none;
17576
+ ${cc.cssCustomProperty}: ${rd};
17577
+ }
17578
+
17579
+ .search-input {
17580
+ -webkit-appearance: none;
17581
+ appearance: none;
17582
+ display: block;
17583
+ flex: 1 1 auto;
17584
+ min-width: 0;
17585
+ width: 100%;
17586
+ height: 100%;
17587
+ padding: 0 var(--ni-private-fv-search-input-trailing-space) 0 var(--ni-private-fv-search-input-leading-space);
17588
+ font: inherit;
17589
+ line-height: normal;
17590
+ color: inherit;
17591
+ border: none;
17592
+ outline: none;
17593
+ border-radius: 0;
17594
+ background: transparent;
17595
+ }
17596
+
17597
+ .search-input::placeholder {
17598
+ color: ${rd};
17599
+ }
17600
+
17601
+ .search-input-clear {
17602
+ -webkit-appearance: none;
17603
+ appearance: none;
17604
+ position: absolute;
17605
+ display: inline-flex;
17606
+ align-items: center;
17607
+ justify-content: center;
17608
+ top: 50%;
17609
+ inset-inline-end: 2px;
17610
+ height: calc(100% - 6px);
17611
+ aspect-ratio: 1;
17612
+ padding: 0;
17613
+ transform: translateY(-50%);
17614
+ color: ${rd};
17615
+ border: none;
17616
+ border-radius: 2px;
17617
+ background: transparent;
17618
+ cursor: pointer;
17619
+ ${cc.cssCustomProperty}: ${rd};
17620
+ }
17621
+
17622
+ :host([appearance='outline']) .search-input-container {
17623
+ border-color: var(--ni-private-fv-search-input-border-color);
17624
+ }
17625
+
17626
+ :host([appearance='block']) .search-input-container {
17627
+ background-color: rgba(${nc}, 0.1);
17628
+ }
17629
+
17630
+ :host([appearance='underline']) .search-input-container::after {
17631
+ transform: scaleX(1);
17632
+ border-bottom-color: var(--ni-private-fv-search-input-border-color);
17633
+ }
17634
+ }
17635
+
17636
+ @layer hover {
17637
+ .search-input-clear:hover {
17638
+ background: ${tc};
17639
+ }
17640
+
17641
+ :host([appearance='outline']) .search-input-container:hover {
17642
+ border-color: ${lc};
17643
+ box-shadow: 0 0 0 ${Dc} ${lc} inset;
17644
+ }
17645
+
17646
+ :host([appearance='block']) .search-input-container:hover::after {
17647
+ transform: scaleX(1);
17648
+ border-bottom-color: ${lc};
17649
+ }
17650
+
17651
+ :host([appearance='underline']) .search-input-container:hover::after {
17652
+ border-bottom-color: ${lc};
17653
+ }
17654
+
17655
+ :host([appearance='frameless']) .search-input-container:hover::after {
17656
+ transform: scaleX(1);
17657
+ border-bottom-color: ${lc};
17658
+ }
17659
+ }
17660
+
17661
+ @layer focusVisible {
17662
+ .search-input:focus-visible {
17663
+ outline: none;
17664
+ }
17665
+
17666
+ .search-input-clear:focus-visible {
17667
+ outline: ${Dc} solid ${lc};
17668
+ outline-offset: -1px;
17669
+ }
17670
+
17671
+ :host([appearance='outline']) .search-input-container:focus-within {
17672
+ border-color: ${lc};
17673
+ box-shadow: 0 0 0 ${Dc} ${lc} inset;
17674
+ }
17675
+
17676
+ :host([appearance='block']) .search-input-container:focus-within::after {
17677
+ transform: scaleX(1);
17678
+ border-bottom-color: ${lc};
17679
+ }
17680
+
17681
+ :host([appearance='underline']) .search-input-container:focus-within::after {
17682
+ border-bottom-color: ${lc};
17683
+ }
17684
+
17685
+ :host([appearance='frameless']) .search-input-container:focus-within::after {
17686
+ transform: scaleX(1);
17687
+ border-bottom-color: ${lc};
17688
+ }
17689
+ }
17690
+ `,Y1=J`
17691
+ <div class="search-input-container">
17692
+ <span class="search-input-icon" aria-hidden="true">
17693
+ <${vb}></${vb}>
17694
+ </span>
17695
+ <input
17696
+ class="search-input"
17697
+ part="control"
17698
+ id="control"
17699
+ type="text"
17700
+ aria-label="${t=>t.ariaLabel}"
17701
+ aria-labelledby="${t=>t.ariaLabelledby}"
17702
+ placeholder="${t=>t.placeholder}"
17703
+ :value="${t=>t.value}"
17704
+ @input="${t=>t.handleTextInput()}"
17705
+ @change="${t=>t.handleChange()}"
17706
+ ${Pt("control")}
17707
+ />
17708
+ ${Ut(t=>t.value.length>0,J`
17709
+ <button
17710
+ class="search-input-clear"
17711
+ type="button"
17712
+ aria-label="Clear search"
17713
+ @click="${t=>t.clear()}"
17714
+ >
17715
+ <${iv}></${iv}>
17716
+ </button>
17717
+ `)}
17718
+ </div>
17719
+ `,X1="outline"
17720
+ class J1 extends Gi{constructor(){super(...arguments),this.appearance=X1}handleChange(){this.value=this.control.value,super.handleChange()}clear(){return""===this.value||(this.value="",this.control.focus(),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))),!0}}t([pt],J1.prototype,"appearance",void 0)
17721
+ const Q1=J1.compose({baseName:"fv-search-input",baseClass:Gi,template:Y1,styles:K1,shadowOptions:{delegatesFocus:!0}})
17722
+ Mi.getOrCreate().withPrefix("ok").register(Q1())
17723
+ const t2=_t`
17518
17724
  ${z1("inline-block")}
17519
17725
 
17520
17726
  :host {
@@ -17537,10 +17743,10 @@ const K1=_t`
17537
17743
  :host([disabled]) slot {
17538
17744
  color: ${ld};
17539
17745
  }
17540
- `,Y1=J`<slot></slot>`
17541
- const X1=class extends He{}.compose({baseName:"ex-button",template:Y1,styles:K1})
17542
- Mi.getOrCreate().withPrefix("ok").register(X1())
17543
- const J1=_t`
17746
+ `,e2=J`<slot></slot>`
17747
+ const n2=class extends He{}.compose({baseName:"ex-button",template:e2,styles:t2})
17748
+ Mi.getOrCreate().withPrefix("ok").register(n2())
17749
+ const i2=_t`
17544
17750
  ${z1("inline-flex")}
17545
17751
 
17546
17752
  :host {
@@ -17554,12 +17760,12 @@ const J1=_t`
17554
17760
  width: 100%;
17555
17761
  height: 100%;
17556
17762
  }
17557
- `,Q1=J`<img aria-hidden="true" src=${t=>t.url}>`
17558
- class t2 extends Km{constructor(t){super(),this.url=t}static registerIconDynamic(t,e){const n="ok-ts-icon-dynamic-"
17763
+ `,o2=J`<img aria-hidden="true" src=${t=>t.url}>`
17764
+ class r2 extends Km{constructor(t){super(),this.url=t}static registerIconDynamic(t,e){const n="ok-ts-icon-dynamic-"
17559
17765
  if(!t.startsWith(n))throw new Error(`Icon tag name must start with '${n}', provided name: ${t}`)
17560
17766
  const i=t.substring(19)
17561
17767
  if(!/^[a-z][a-z]+$/.test(i))throw new Error(`Icon name must be lowercase [a-z] and at least two characters long, provided name: ${i}`)
17562
- const o=`TsIconDynamic${i.charAt(0).toUpperCase()+i.slice(1)}`,r=`ts-icon-dynamic-${i}`,s={[o]:class extends t2{constructor(){super(e)}}}[o].compose({baseName:r,template:Q1,styles:J1})
17563
- Mi.getOrCreate().withPrefix("ok").register(s())}}const e2=t2.compose({baseName:"ts-icon-dynamic",template:J`<template></template>`,styles:_t`${z1("none")}`})
17564
- Mi.getOrCreate().withPrefix("ok").register(e2())}()
17768
+ const o=`TsIconDynamic${i.charAt(0).toUpperCase()+i.slice(1)}`,r=`ts-icon-dynamic-${i}`,s={[o]:class extends r2{constructor(){super(e)}}}[o].compose({baseName:r,template:o2,styles:i2})
17769
+ Mi.getOrCreate().withPrefix("ok").register(s())}}const s2=r2.compose({baseName:"ts-icon-dynamic",template:J`<template></template>`,styles:_t`${z1("none")}`})
17770
+ Mi.getOrCreate().withPrefix("ok").register(s2())}()
17565
17771
  //# sourceMappingURL=all-components-bundle.min.js.map