@backstage/ui 0.6.1 → 0.7.0-next.1
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/CHANGELOG.md +15 -2
- package/css/styles.css +99 -142
- package/dist/components/Checkbox/Checkbox.esm.js +5 -7
- package/dist/components/Checkbox/Checkbox.esm.js.map +1 -1
- package/dist/components/DataTable/Pagination/DataTablePagination.esm.js +1 -1
- package/dist/components/DataTable/Pagination/DataTablePagination.esm.js.map +1 -1
- package/dist/components/Header/Header.esm.js +21 -2
- package/dist/components/Header/Header.esm.js.map +1 -1
- package/dist/components/Header/HeaderToolbar.esm.js +40 -14
- package/dist/components/Header/HeaderToolbar.esm.js.map +1 -1
- package/dist/components/HeaderPage/HeaderPage.esm.js +12 -3
- package/dist/components/HeaderPage/HeaderPage.esm.js.map +1 -1
- package/dist/components/Link/Link.esm.js +9 -5
- package/dist/components/Link/Link.esm.js.map +1 -1
- package/dist/components/Menu/Combobox.esm.js +5 -7
- package/dist/components/Menu/Combobox.esm.js.map +1 -1
- package/dist/components/Select/Select.esm.js +1 -1
- package/dist/components/Select/Select.esm.js.map +1 -1
- package/dist/components/Select/Select.styles.css.esm.js +1 -1
- package/dist/components/Table/TableCellLink/TableCellLink.esm.js +1 -1
- package/dist/components/Table/TableCellLink/TableCellLink.esm.js.map +1 -1
- package/dist/components/Table/TableCellProfile/TableCellProfile.esm.js +1 -1
- package/dist/components/Table/TableCellProfile/TableCellProfile.esm.js.map +1 -1
- package/dist/components/Table/TableCellText/TableCellText.esm.js +2 -2
- package/dist/components/Table/TableCellText/TableCellText.esm.js.map +1 -1
- package/dist/components/Tabs/Tabs.esm.js +15 -3
- package/dist/components/Tabs/Tabs.esm.js.map +1 -1
- package/dist/components/Text/Text.esm.js +3 -2
- package/dist/components/Text/Text.esm.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.esm.js +5 -2
- package/dist/components/Tooltip/Tooltip.esm.js.map +1 -1
- package/dist/index.d.ts +107 -95
- package/dist/index.esm.js +1 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/utils/componentDefinitions.esm.js +1 -1
- package/dist/utils/componentDefinitions.esm.js.map +1 -1
- package/package.json +5 -3
- package/dist/components/Heading/Heading.esm.js +0 -37
- package/dist/components/Heading/Heading.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
# @backstage/ui
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.7.0-next.1
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- de89a3d: Fixes some styles on the Select component in BUI.
|
|
8
|
+
- 75fead9: Fixes a couple of small bugs in BUI including setting H1 and H2 correctly on the Header and HeaderPage.
|
|
9
|
+
- 2f9a084: We are motion away from `motion` to use `gsap` instead to make Backstage UI backward compatible with React 17.
|
|
10
|
+
|
|
11
|
+
## 0.7.0-next.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- b0e47f3: **Breaking** We are upgrading our `Text` component to support all font sizes making the `Heading` component redundant. The new `Text` component introduces 4 sizes for title and 4 sizes for body text. All of these work in multiple colors and font weights. We improved the `as` prop to include all possible values. The `Link` component has also been updated to match the new `Text` component.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- e7ff178: Update styling of Tooltip element
|
|
20
|
+
- e0e886f: Adds onTabSelectionChange to ui header component.
|
|
8
21
|
|
|
9
22
|
## 0.6.0
|
|
10
23
|
|
package/css/styles.css
CHANGED
|
@@ -9191,8 +9191,8 @@
|
|
|
9191
9191
|
--bui-gray-6: #7b7b7b;
|
|
9192
9192
|
--bui-gray-7: #9e9e9e;
|
|
9193
9193
|
--bui-gray-8: #b4b4b4;
|
|
9194
|
-
--bui-bg:
|
|
9195
|
-
--bui-bg-surface-1:
|
|
9194
|
+
--bui-bg: #333;
|
|
9195
|
+
--bui-bg-surface-1: #424242;
|
|
9196
9196
|
--bui-bg-surface-2: var(--bui-gray-2);
|
|
9197
9197
|
--bui-bg-solid: #9cc9ff;
|
|
9198
9198
|
--bui-bg-solid-hover: #83b9fd;
|
|
@@ -9217,7 +9217,7 @@
|
|
|
9217
9217
|
--bui-fg-danger: #e22b2b;
|
|
9218
9218
|
--bui-fg-warning: #e36d05;
|
|
9219
9219
|
--bui-fg-success: #1db954;
|
|
9220
|
-
--bui-border: #
|
|
9220
|
+
--bui-border: #ffffff1f;
|
|
9221
9221
|
--bui-border-hover: #fff6;
|
|
9222
9222
|
--bui-border-pressed: #ffffff80;
|
|
9223
9223
|
--bui-border-disabled: #fff3;
|
|
@@ -9732,58 +9732,6 @@
|
|
|
9732
9732
|
display: flex;
|
|
9733
9733
|
}
|
|
9734
9734
|
|
|
9735
|
-
.bui-Heading {
|
|
9736
|
-
font-family: var(--bui-font-regular);
|
|
9737
|
-
color: var(--bui-fg-primary);
|
|
9738
|
-
margin: 0;
|
|
9739
|
-
padding: 0;
|
|
9740
|
-
line-height: 100%;
|
|
9741
|
-
}
|
|
9742
|
-
|
|
9743
|
-
.bui-Heading[data-variant="display"] {
|
|
9744
|
-
font-size: var(--bui-font-size-10);
|
|
9745
|
-
font-weight: var(--bui-font-weight-bold);
|
|
9746
|
-
}
|
|
9747
|
-
|
|
9748
|
-
.bui-Heading[data-variant="title1"] {
|
|
9749
|
-
font-size: var(--bui-font-size-9);
|
|
9750
|
-
font-weight: var(--bui-font-weight-bold);
|
|
9751
|
-
}
|
|
9752
|
-
|
|
9753
|
-
.bui-Heading[data-variant="title2"] {
|
|
9754
|
-
font-size: var(--bui-font-size-8);
|
|
9755
|
-
font-weight: var(--bui-font-weight-bold);
|
|
9756
|
-
}
|
|
9757
|
-
|
|
9758
|
-
.bui-Heading[data-variant="title3"] {
|
|
9759
|
-
font-size: var(--bui-font-size-7);
|
|
9760
|
-
font-weight: var(--bui-font-weight-bold);
|
|
9761
|
-
}
|
|
9762
|
-
|
|
9763
|
-
.bui-Heading[data-variant="title4"] {
|
|
9764
|
-
font-size: var(--bui-font-size-6);
|
|
9765
|
-
font-weight: var(--bui-font-weight-bold);
|
|
9766
|
-
}
|
|
9767
|
-
|
|
9768
|
-
.bui-Heading[data-variant="title5"] {
|
|
9769
|
-
font-size: var(--bui-font-size-5);
|
|
9770
|
-
font-weight: var(--bui-font-weight-bold);
|
|
9771
|
-
}
|
|
9772
|
-
|
|
9773
|
-
.bui-Heading[data-color="primary"] {
|
|
9774
|
-
color: var(--bui-fg-primary);
|
|
9775
|
-
}
|
|
9776
|
-
|
|
9777
|
-
.bui-Heading[data-color="secondary"] {
|
|
9778
|
-
color: var(--bui-fg-secondary);
|
|
9779
|
-
}
|
|
9780
|
-
|
|
9781
|
-
.bui-Heading[data-truncate] {
|
|
9782
|
-
text-overflow: ellipsis;
|
|
9783
|
-
white-space: nowrap;
|
|
9784
|
-
overflow: hidden;
|
|
9785
|
-
}
|
|
9786
|
-
|
|
9787
9735
|
.bui-Icon {
|
|
9788
9736
|
width: 1rem;
|
|
9789
9737
|
height: 1rem;
|
|
@@ -9795,72 +9743,17 @@
|
|
|
9795
9743
|
margin: 0;
|
|
9796
9744
|
padding: 0;
|
|
9797
9745
|
text-decoration-line: none;
|
|
9746
|
+
display: inline-block;
|
|
9798
9747
|
|
|
9799
9748
|
&:hover {
|
|
9800
9749
|
text-underline-offset: calc(.025em + 2px);
|
|
9801
9750
|
text-decoration-line: underline;
|
|
9802
9751
|
text-decoration-style: solid;
|
|
9803
9752
|
text-decoration-thickness: min(2px, max(1px, .05em));
|
|
9804
|
-
text-decoration-color: color-mix(in srgb,
|
|
9753
|
+
text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
|
|
9805
9754
|
}
|
|
9806
9755
|
}
|
|
9807
9756
|
|
|
9808
|
-
.bui-Link[data-variant="title-large"] {
|
|
9809
|
-
font-size: var(--bui-font-size-8);
|
|
9810
|
-
line-height: 140%;
|
|
9811
|
-
}
|
|
9812
|
-
|
|
9813
|
-
.bui-Link[data-variant="title-medium"] {
|
|
9814
|
-
font-size: var(--bui-font-size-7);
|
|
9815
|
-
line-height: 140%;
|
|
9816
|
-
}
|
|
9817
|
-
|
|
9818
|
-
.bui-Link[data-variant="title-small"] {
|
|
9819
|
-
font-size: var(--bui-font-size-6);
|
|
9820
|
-
line-height: 140%;
|
|
9821
|
-
}
|
|
9822
|
-
|
|
9823
|
-
.bui-Link[data-variant="title-x-small"] {
|
|
9824
|
-
font-size: var(--bui-font-size-5);
|
|
9825
|
-
line-height: 140%;
|
|
9826
|
-
}
|
|
9827
|
-
|
|
9828
|
-
.bui-Link[data-variant="body-large"] {
|
|
9829
|
-
font-size: var(--bui-font-size-4);
|
|
9830
|
-
line-height: 140%;
|
|
9831
|
-
}
|
|
9832
|
-
|
|
9833
|
-
.bui-Link[data-variant="body-medium"] {
|
|
9834
|
-
font-size: var(--bui-font-size-3);
|
|
9835
|
-
line-height: 140%;
|
|
9836
|
-
}
|
|
9837
|
-
|
|
9838
|
-
.bui-Link[data-variant="body-small"] {
|
|
9839
|
-
font-size: var(--bui-font-size-2);
|
|
9840
|
-
line-height: 140%;
|
|
9841
|
-
}
|
|
9842
|
-
|
|
9843
|
-
.bui-Link[data-variant="body-x-small"] {
|
|
9844
|
-
font-size: var(--bui-font-size-1);
|
|
9845
|
-
line-height: 140%;
|
|
9846
|
-
}
|
|
9847
|
-
|
|
9848
|
-
.bui-Link[data-weight="regular"] {
|
|
9849
|
-
font-weight: var(--bui-font-weight-regular);
|
|
9850
|
-
}
|
|
9851
|
-
|
|
9852
|
-
.bui-Link[data-weight="bold"] {
|
|
9853
|
-
font-weight: var(--bui-font-weight-bold);
|
|
9854
|
-
}
|
|
9855
|
-
|
|
9856
|
-
.bui-Link[data-color="primary"] {
|
|
9857
|
-
color: var(--bui-fg-primary);
|
|
9858
|
-
}
|
|
9859
|
-
|
|
9860
|
-
.bui-Link[data-color="secondary"] {
|
|
9861
|
-
color: var(--bui-fg-secondary);
|
|
9862
|
-
}
|
|
9863
|
-
|
|
9864
9757
|
.bui-MenuPositioner {
|
|
9865
9758
|
z-index: 100;
|
|
9866
9759
|
outline: 0;
|
|
@@ -10303,22 +10196,42 @@
|
|
|
10303
10196
|
padding: 0;
|
|
10304
10197
|
}
|
|
10305
10198
|
|
|
10306
|
-
.bui-Text[data-variant="
|
|
10307
|
-
font-size: var(--bui-font-size-
|
|
10199
|
+
.bui-Text[data-variant="title-large"] {
|
|
10200
|
+
font-size: var(--bui-font-size-8);
|
|
10201
|
+
line-height: 140%;
|
|
10202
|
+
}
|
|
10203
|
+
|
|
10204
|
+
.bui-Text[data-variant="title-medium"] {
|
|
10205
|
+
font-size: var(--bui-font-size-7);
|
|
10206
|
+
line-height: 140%;
|
|
10207
|
+
}
|
|
10208
|
+
|
|
10209
|
+
.bui-Text[data-variant="title-small"] {
|
|
10210
|
+
font-size: var(--bui-font-size-6);
|
|
10211
|
+
line-height: 140%;
|
|
10212
|
+
}
|
|
10213
|
+
|
|
10214
|
+
.bui-Text[data-variant="title-x-small"] {
|
|
10215
|
+
font-size: var(--bui-font-size-5);
|
|
10308
10216
|
line-height: 140%;
|
|
10309
10217
|
}
|
|
10310
10218
|
|
|
10311
|
-
.bui-Text[data-variant="
|
|
10219
|
+
.bui-Text[data-variant="body-large"] {
|
|
10312
10220
|
font-size: var(--bui-font-size-4);
|
|
10313
10221
|
line-height: 140%;
|
|
10314
10222
|
}
|
|
10315
10223
|
|
|
10316
|
-
.bui-Text[data-variant="
|
|
10224
|
+
.bui-Text[data-variant="body-medium"] {
|
|
10225
|
+
font-size: var(--bui-font-size-3);
|
|
10226
|
+
line-height: 140%;
|
|
10227
|
+
}
|
|
10228
|
+
|
|
10229
|
+
.bui-Text[data-variant="body-small"] {
|
|
10317
10230
|
font-size: var(--bui-font-size-2);
|
|
10318
10231
|
line-height: 140%;
|
|
10319
10232
|
}
|
|
10320
10233
|
|
|
10321
|
-
.bui-Text[data-variant="
|
|
10234
|
+
.bui-Text[data-variant="body-x-small"] {
|
|
10322
10235
|
font-size: var(--bui-font-size-1);
|
|
10323
10236
|
line-height: 140%;
|
|
10324
10237
|
}
|
|
@@ -10357,6 +10270,10 @@
|
|
|
10357
10270
|
overflow: hidden;
|
|
10358
10271
|
}
|
|
10359
10272
|
|
|
10273
|
+
.bui-Text[data-as="span"], .bui-Text[data-as="label"], .bui-Text[data-as="strong"], .bui-Text[data-as="em"], .bui-Text[data-as="small"] {
|
|
10274
|
+
display: inline-block;
|
|
10275
|
+
}
|
|
10276
|
+
|
|
10360
10277
|
.bui-TextField {
|
|
10361
10278
|
font-family: var(--bui-font-regular);
|
|
10362
10279
|
flex-direction: column;
|
|
@@ -10504,18 +10421,20 @@
|
|
|
10504
10421
|
}
|
|
10505
10422
|
|
|
10506
10423
|
.bui-Tooltip {
|
|
10507
|
-
background: var(--bui-bg-surface-
|
|
10424
|
+
background: var(--bui-bg-surface-1);
|
|
10425
|
+
border: 1px solid var(--bui-gray-3);
|
|
10508
10426
|
forced-color-adjust: none;
|
|
10509
10427
|
padding: var(--bui-space-2) var(--bui-space-3);
|
|
10510
10428
|
max-width: 240px;
|
|
10511
10429
|
font-size: var(--bui-font-size-3);
|
|
10512
10430
|
font-family: var(--bui-font-regular);
|
|
10513
10431
|
color: var(--bui-fg-primary);
|
|
10432
|
+
--tooltip-offset: var(--bui-space-3);
|
|
10514
10433
|
border-radius: 4px;
|
|
10515
10434
|
outline: none;
|
|
10516
10435
|
transition: transform .2s, opacity .2s;
|
|
10517
10436
|
transform: translate3d(0, 0, 0);
|
|
10518
|
-
box-shadow: 0
|
|
10437
|
+
box-shadow: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;
|
|
10519
10438
|
|
|
10520
10439
|
&[data-entering], &[data-exiting] {
|
|
10521
10440
|
transform: var(--origin);
|
|
@@ -10523,41 +10442,76 @@
|
|
|
10523
10442
|
}
|
|
10524
10443
|
|
|
10525
10444
|
&[data-placement="top"] {
|
|
10526
|
-
margin-bottom: var(--
|
|
10445
|
+
margin-bottom: var(--tooltip-offset);
|
|
10527
10446
|
--origin: translateY(4px);
|
|
10528
10447
|
}
|
|
10529
10448
|
|
|
10449
|
+
&[data-placement="right"] {
|
|
10450
|
+
margin-left: var(--tooltip-offset);
|
|
10451
|
+
--origin: translateX(-4px);
|
|
10452
|
+
}
|
|
10453
|
+
|
|
10530
10454
|
&[data-placement="bottom"] {
|
|
10531
|
-
margin-top: var(--
|
|
10455
|
+
margin-top: var(--tooltip-offset);
|
|
10532
10456
|
--origin: translateY(-4px);
|
|
10457
|
+
}
|
|
10533
10458
|
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10459
|
+
&[data-placement="left"] {
|
|
10460
|
+
margin-right: var(--tooltip-offset);
|
|
10461
|
+
--origin: translateX(4px);
|
|
10537
10462
|
}
|
|
10463
|
+
}
|
|
10538
10464
|
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
--
|
|
10465
|
+
.bui-TooltipArrow {
|
|
10466
|
+
& svg {
|
|
10467
|
+
--tooltip-arrow-overlap: -2px;
|
|
10468
|
+
display: block;
|
|
10469
|
+
|
|
10470
|
+
& path:first-child {
|
|
10471
|
+
fill: var(--bui-bg-surface-1);
|
|
10472
|
+
}
|
|
10542
10473
|
|
|
10543
|
-
&
|
|
10544
|
-
|
|
10474
|
+
& path:nth-child(2) {
|
|
10475
|
+
fill: var(--bui-gray-3);
|
|
10545
10476
|
}
|
|
10546
10477
|
}
|
|
10547
10478
|
|
|
10548
|
-
&[data-placement="
|
|
10549
|
-
margin-
|
|
10550
|
-
|
|
10479
|
+
&[data-placement="top"] svg {
|
|
10480
|
+
margin-top: var(--tooltip-arrow-overlap);
|
|
10481
|
+
}
|
|
10551
10482
|
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10483
|
+
&[data-placement="bottom"] svg {
|
|
10484
|
+
margin-bottom: var(--tooltip-arrow-overlap);
|
|
10485
|
+
transform: rotate(180deg);
|
|
10486
|
+
}
|
|
10487
|
+
|
|
10488
|
+
&[data-placement="right"] svg {
|
|
10489
|
+
margin-right: var(--tooltip-arrow-overlap);
|
|
10490
|
+
transform: rotate(90deg);
|
|
10491
|
+
}
|
|
10492
|
+
|
|
10493
|
+
&[data-placement="left"] svg {
|
|
10494
|
+
margin-left: var(--tooltip-arrow-overlap);
|
|
10495
|
+
transform: rotate(-90deg);
|
|
10555
10496
|
}
|
|
10556
10497
|
}
|
|
10557
10498
|
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10499
|
+
[data-theme="dark"] {
|
|
10500
|
+
& .bui-Tooltip {
|
|
10501
|
+
background: var(--bui-bg-surface-2);
|
|
10502
|
+
box-shadow: none;
|
|
10503
|
+
border: 1px solid var(--bui-gray-4);
|
|
10504
|
+
}
|
|
10505
|
+
|
|
10506
|
+
& .bui-TooltipArrow {
|
|
10507
|
+
& svg path:first-child {
|
|
10508
|
+
fill: var(--bui-bg-surface-2);
|
|
10509
|
+
}
|
|
10510
|
+
|
|
10511
|
+
& svg path:nth-child(2) {
|
|
10512
|
+
fill: var(--bui-gray-4);
|
|
10513
|
+
}
|
|
10514
|
+
}
|
|
10561
10515
|
}
|
|
10562
10516
|
|
|
10563
10517
|
.bui-ScrollAreaRoot {
|
|
@@ -10624,11 +10578,11 @@
|
|
|
10624
10578
|
justify-content: space-between;
|
|
10625
10579
|
align-items: center;
|
|
10626
10580
|
gap: var(--bui-space-2);
|
|
10627
|
-
|
|
10628
|
-
transition: border-color .2s ease-in-out, outline-color .2s ease-in-out;
|
|
10581
|
+
width: 100%;
|
|
10629
10582
|
display: flex;
|
|
10630
10583
|
|
|
10631
10584
|
& svg {
|
|
10585
|
+
color: var(--bui-fg-secondary);
|
|
10632
10586
|
flex-shrink: 0;
|
|
10633
10587
|
}
|
|
10634
10588
|
|
|
@@ -10658,6 +10612,7 @@
|
|
|
10658
10612
|
|
|
10659
10613
|
&:hover {
|
|
10660
10614
|
border-color: var(--bui-border-hover);
|
|
10615
|
+
transition: border-color .2s ease-in-out, outline-color .2s ease-in-out;
|
|
10661
10616
|
}
|
|
10662
10617
|
|
|
10663
10618
|
&:focus-visible {
|
|
@@ -10696,6 +10651,7 @@
|
|
|
10696
10651
|
font-family: var(--bui-font-regular);
|
|
10697
10652
|
font-weight: var(--bui-font-weight-regular);
|
|
10698
10653
|
color: var(--bui-fg-primary);
|
|
10654
|
+
text-align: left;
|
|
10699
10655
|
overflow: hidden;
|
|
10700
10656
|
|
|
10701
10657
|
& .bui-SelectItemIndicator {
|
|
@@ -10710,14 +10666,15 @@
|
|
|
10710
10666
|
.bui-SelectItem {
|
|
10711
10667
|
width: var(--anchor-width);
|
|
10712
10668
|
padding-block: var(--bui-space-2);
|
|
10713
|
-
padding-
|
|
10669
|
+
padding-left: var(--bui-space-3);
|
|
10670
|
+
padding-right: var(--bui-space-4);
|
|
10714
10671
|
color: var(--bui-fg-primary);
|
|
10715
10672
|
border-radius: var(--bui-radius-3);
|
|
10716
10673
|
cursor: pointer;
|
|
10717
10674
|
user-select: none;
|
|
10718
10675
|
font-size: var(--bui-font-size-3);
|
|
10719
10676
|
align-items: center;
|
|
10720
|
-
gap: var(--bui-space-
|
|
10677
|
+
gap: var(--bui-space-1);
|
|
10721
10678
|
outline: none;
|
|
10722
10679
|
grid-template-columns: 1rem 1fr;
|
|
10723
10680
|
grid-template-areas: "icon text";
|
|
@@ -6,21 +6,19 @@ import '../Box/Box.esm.js';
|
|
|
6
6
|
import '../Grid/Grid.esm.js';
|
|
7
7
|
import '../Flex/Flex.esm.js';
|
|
8
8
|
import '../Container/Container.esm.js';
|
|
9
|
-
import '../Text/Text.esm.js';
|
|
10
|
-
import '../Heading/Heading.esm.js';
|
|
11
9
|
import '../Avatar/Avatar.esm.js';
|
|
12
10
|
import '../Button/Button.esm.js';
|
|
13
11
|
import '../Card/Card.esm.js';
|
|
14
12
|
import '../Collapsible/Collapsible.esm.js';
|
|
15
13
|
import '../DataTable/DataTable.esm.js';
|
|
16
14
|
import '../FieldLabel/FieldLabel.esm.js';
|
|
17
|
-
import '
|
|
15
|
+
import '../Header/HeaderToolbar.esm.js';
|
|
16
|
+
import '../Tabs/Tabs.esm.js';
|
|
18
17
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
19
|
-
import '@remixicon/react';
|
|
20
|
-
import '../ButtonIcon/ButtonIcon.esm.js';
|
|
21
18
|
import '../Menu/Menu.esm.js';
|
|
22
|
-
import '
|
|
23
|
-
import '../
|
|
19
|
+
import '../Text/Text.esm.js';
|
|
20
|
+
import '../ButtonIcon/ButtonIcon.esm.js';
|
|
21
|
+
import '@remixicon/react';
|
|
24
22
|
import { Icon } from '../Icon/Icon.esm.js';
|
|
25
23
|
import '../ButtonLink/ButtonLink.esm.js';
|
|
26
24
|
import '../RadioGroup/RadioGroup.esm.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.esm.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { Checkbox as CheckboxPrimitive } from '@base-ui-components/react/checkbox';\nimport { Icon } from '../..';\nimport type { CheckboxProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport clsx from 'clsx';\n\n/** @public */\nexport const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(\n (props, ref) => {\n const {\n label,\n checked,\n onChange,\n disabled,\n required,\n className,\n name,\n value,\n style,\n } = props;\n\n const { classNames } = useStyles('Checkbox');\n\n const checkboxElement = (\n <CheckboxPrimitive.Root\n ref={ref}\n className={clsx(classNames.root, className)}\n checked={checked}\n onCheckedChange={onChange}\n disabled={disabled}\n required={required}\n name={name}\n value={value}\n style={style}\n >\n <CheckboxPrimitive.Indicator className={classNames.indicator}>\n <Icon name=\"check\" size={12} />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n\n return label ? (\n <label className={classNames.label}>\n {checkboxElement}\n {label}\n </label>\n ) : (\n checkboxElement\n );\n },\n);\n"],"names":["CheckboxPrimitive"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Checkbox.esm.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { Checkbox as CheckboxPrimitive } from '@base-ui-components/react/checkbox';\nimport { Icon } from '../..';\nimport type { CheckboxProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport clsx from 'clsx';\n\n/** @public */\nexport const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(\n (props, ref) => {\n const {\n label,\n checked,\n onChange,\n disabled,\n required,\n className,\n name,\n value,\n style,\n } = props;\n\n const { classNames } = useStyles('Checkbox');\n\n const checkboxElement = (\n <CheckboxPrimitive.Root\n ref={ref}\n className={clsx(classNames.root, className)}\n checked={checked}\n onCheckedChange={onChange}\n disabled={disabled}\n required={required}\n name={name}\n value={value}\n style={style}\n >\n <CheckboxPrimitive.Indicator className={classNames.indicator}>\n <Icon name=\"check\" size={12} />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n\n return label ? (\n <label className={classNames.label}>\n {checkboxElement}\n {label}\n </label>\n ) : (\n checkboxElement\n );\n },\n);\n"],"names":["CheckboxPrimitive"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,MAAM,QAAW,GAAA,UAAA;AAAA,EACtB,CAAC,OAAO,GAAQ,KAAA;AACd,IAAM,MAAA;AAAA,MACJ,KAAA;AAAA,MACA,OAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA;AAAA,KACE,GAAA,KAAA;AAEJ,IAAA,MAAM,EAAE,UAAA,EAAe,GAAA,SAAA,CAAU,UAAU,CAAA;AAE3C,IAAA,MAAM,eACJ,mBAAA,GAAA;AAAA,MAACA,UAAkB,CAAA,IAAA;AAAA,MAAlB;AAAA,QACC,GAAA;AAAA,QACA,SAAW,EAAA,IAAA,CAAK,UAAW,CAAA,IAAA,EAAM,SAAS,CAAA;AAAA,QAC1C,OAAA;AAAA,QACA,eAAiB,EAAA,QAAA;AAAA,QACjB,QAAA;AAAA,QACA,QAAA;AAAA,QACA,IAAA;AAAA,QACA,KAAA;AAAA,QACA,KAAA;AAAA,QAEA,QAAC,kBAAA,GAAA,CAAAA,UAAA,CAAkB,SAAlB,EAAA,EAA4B,SAAW,EAAA,UAAA,CAAW,SACjD,EAAA,QAAA,kBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAK,OAAQ,EAAA,IAAA,EAAM,IAAI,CAC/B,EAAA;AAAA;AAAA,KACF;AAGF,IAAA,OAAO,KACL,mBAAA,IAAA,CAAC,OAAM,EAAA,EAAA,SAAA,EAAW,WAAW,KAC1B,EAAA,QAAA,EAAA;AAAA,MAAA,eAAA;AAAA,MACA;AAAA,KAAA,EACH,CAEA,GAAA,eAAA;AAAA;AAGN;;;;"}
|
|
@@ -51,7 +51,7 @@ const DataTablePagination = forwardRef(
|
|
|
51
51
|
}
|
|
52
52
|
) }),
|
|
53
53
|
/* @__PURE__ */ jsxs("div", { className: "bui-DataTablePagination--right", children: [
|
|
54
|
-
/* @__PURE__ */ jsx(Text, { variant: "body", children: `${fromCount} - ${toCount} of ${rowCount}` }),
|
|
54
|
+
/* @__PURE__ */ jsx(Text, { variant: "body-medium", children: `${fromCount} - ${toCount} of ${rowCount}` }),
|
|
55
55
|
/* @__PURE__ */ jsx(
|
|
56
56
|
ButtonIcon,
|
|
57
57
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTablePagination.esm.js","sources":["../../../../src/components/DataTable/Pagination/DataTablePagination.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { Text } from '../../Text';\nimport { DataTablePaginationProps } from './types';\nimport { ButtonIcon } from '../../ButtonIcon';\nimport clsx from 'clsx';\nimport { Select } from '../../Select';\nimport { useDataTable } from '../Root/DataTableRoot';\nimport { Icon } from '../../Icon';\n\n/** @public */\nconst DataTablePagination = forwardRef(\n (\n props: DataTablePaginationProps,\n ref: React.ForwardedRef<HTMLDivElement>,\n ) => {\n const { className, ...rest } = props;\n const { table } = useDataTable();\n const pageIndex = table?.getState().pagination.pageIndex;\n const pageSize = table?.getState().pagination.pageSize;\n const rowCount = table?.getRowCount();\n const fromCount = (pageIndex ?? 0) * (pageSize ?? 10) + 1;\n const toCount = Math.min(\n ((pageIndex ?? 0) + 1) * (pageSize ?? 10),\n rowCount,\n );\n\n return (\n <div\n ref={ref}\n style={{ minWidth: table?.getTotalSize() }}\n className={clsx('bui-DataTablePagination', className)}\n {...rest}\n >\n <div className=\"bui-DataTablePagination--left\">\n {!table.options.manualPagination && (\n <Select\n name=\"pageSize\"\n size=\"small\"\n placeholder=\"Show 10 results\"\n options={[\n { label: 'Show 5 results', value: '5' },\n { label: 'Show 10 results', value: '10' },\n { label: 'Show 20 results', value: '20' },\n { label: 'Show 30 results', value: '30' },\n { label: 'Show 40 results', value: '40' },\n { label: 'Show 50 results', value: '50' },\n ]}\n selectedKey={pageSize?.toString()}\n onSelectionChange={value => {\n table?.setPageSize(Number(value));\n }}\n className=\"bui-DataTablePagination--select\"\n />\n )}\n </div>\n <div className=\"bui-DataTablePagination--right\">\n <Text variant=\"body\">{`${fromCount} - ${toCount} of ${rowCount}`}</Text>\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={() => table?.previousPage()}\n isDisabled={!table?.getCanPreviousPage()}\n icon={<Icon name=\"chevron-left\" />}\n />\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={() => table?.nextPage()}\n isDisabled={!table?.getCanNextPage()}\n icon={<Icon name=\"chevron-right\" />}\n />\n </div>\n </div>\n );\n },\n);\n\nDataTablePagination.displayName = 'DataTablePagination';\n\nexport { DataTablePagination };\n"],"names":[],"mappings":";;;;;;;;;;;AA0BA,MAAM,mBAAsB,GAAA,UAAA;AAAA,EAC1B,CACE,OACA,GACG,KAAA;AACH,IAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAS,GAAA,KAAA;AAC/B,IAAM,MAAA,EAAE,KAAM,EAAA,GAAI,YAAa,EAAA;AAC/B,IAAA,MAAM,SAAY,GAAA,KAAA,EAAO,QAAS,EAAA,CAAE,UAAW,CAAA,SAAA;AAC/C,IAAA,MAAM,QAAW,GAAA,KAAA,EAAO,QAAS,EAAA,CAAE,UAAW,CAAA,QAAA;AAC9C,IAAM,MAAA,QAAA,GAAW,OAAO,WAAY,EAAA;AACp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AAS,KAAA,KAAA;AAC1B,gBAAO,KAAA,EAAA,WAAA,CAAY,MAAO,CAAA,KAAK,CAAC,CAAA;AAAA,eAClC;AAAA,cACA,SAAU,EAAA;AAAA;AAAA,WAGhB,EAAA,CAAA;AAAA,0BACA,IAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAU,gCACb,EAAA,QAAA,EAAA;AAAA,4BAAC,GAAA,CAAA,IAAA,EAAA,EAAK,SAAQ,
|
|
1
|
+
{"version":3,"file":"DataTablePagination.esm.js","sources":["../../../../src/components/DataTable/Pagination/DataTablePagination.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { Text } from '../../Text';\nimport { DataTablePaginationProps } from './types';\nimport { ButtonIcon } from '../../ButtonIcon';\nimport clsx from 'clsx';\nimport { Select } from '../../Select';\nimport { useDataTable } from '../Root/DataTableRoot';\nimport { Icon } from '../../Icon';\n\n/** @public */\nconst DataTablePagination = forwardRef(\n (\n props: DataTablePaginationProps,\n ref: React.ForwardedRef<HTMLDivElement>,\n ) => {\n const { className, ...rest } = props;\n const { table } = useDataTable();\n const pageIndex = table?.getState().pagination.pageIndex;\n const pageSize = table?.getState().pagination.pageSize;\n const rowCount = table?.getRowCount();\n const fromCount = (pageIndex ?? 0) * (pageSize ?? 10) + 1;\n const toCount = Math.min(\n ((pageIndex ?? 0) + 1) * (pageSize ?? 10),\n rowCount,\n );\n\n return (\n <div\n ref={ref}\n style={{ minWidth: table?.getTotalSize() }}\n className={clsx('bui-DataTablePagination', className)}\n {...rest}\n >\n <div className=\"bui-DataTablePagination--left\">\n {!table.options.manualPagination && (\n <Select\n name=\"pageSize\"\n size=\"small\"\n placeholder=\"Show 10 results\"\n options={[\n { label: 'Show 5 results', value: '5' },\n { label: 'Show 10 results', value: '10' },\n { label: 'Show 20 results', value: '20' },\n { label: 'Show 30 results', value: '30' },\n { label: 'Show 40 results', value: '40' },\n { label: 'Show 50 results', value: '50' },\n ]}\n selectedKey={pageSize?.toString()}\n onSelectionChange={value => {\n table?.setPageSize(Number(value));\n }}\n className=\"bui-DataTablePagination--select\"\n />\n )}\n </div>\n <div className=\"bui-DataTablePagination--right\">\n <Text variant=\"body-medium\">{`${fromCount} - ${toCount} of ${rowCount}`}</Text>\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={() => table?.previousPage()}\n isDisabled={!table?.getCanPreviousPage()}\n icon={<Icon name=\"chevron-left\" />}\n />\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={() => table?.nextPage()}\n isDisabled={!table?.getCanNextPage()}\n icon={<Icon name=\"chevron-right\" />}\n />\n </div>\n </div>\n );\n },\n);\n\nDataTablePagination.displayName = 'DataTablePagination';\n\nexport { DataTablePagination };\n"],"names":[],"mappings":";;;;;;;;;;;AA0BA,MAAM,mBAAsB,GAAA,UAAA;AAAA,EAC1B,CACE,OACA,GACG,KAAA;AACH,IAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAS,GAAA,KAAA;AAC/B,IAAM,MAAA,EAAE,KAAM,EAAA,GAAI,YAAa,EAAA;AAC/B,IAAA,MAAM,SAAY,GAAA,KAAA,EAAO,QAAS,EAAA,CAAE,UAAW,CAAA,SAAA;AAC/C,IAAA,MAAM,QAAW,GAAA,KAAA,EAAO,QAAS,EAAA,CAAE,UAAW,CAAA,QAAA;AAC9C,IAAM,MAAA,QAAA,GAAW,OAAO,WAAY,EAAA;AACpC,IAAA,MAAM,SAAa,GAAA,CAAA,SAAA,IAAa,CAAM,KAAA,QAAA,IAA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
|
+
const {
|
|
8
|
+
tabs,
|
|
9
|
+
icon,
|
|
10
|
+
title,
|
|
11
|
+
titleLink,
|
|
12
|
+
menuItems,
|
|
13
|
+
breadcrumbs,
|
|
14
|
+
customActions,
|
|
15
|
+
onTabSelectionChange
|
|
16
|
+
} = props;
|
|
8
17
|
const { classNames } = useStyles("Header");
|
|
9
18
|
const hasTabs = tabs && tabs.length > 0;
|
|
10
19
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -13,13 +22,23 @@ const Header = (props) => {
|
|
|
13
22
|
{
|
|
14
23
|
icon,
|
|
15
24
|
title,
|
|
25
|
+
titleLink,
|
|
16
26
|
menuItems,
|
|
17
27
|
breadcrumbs,
|
|
18
28
|
customActions,
|
|
19
29
|
hasTabs
|
|
20
30
|
}
|
|
21
31
|
),
|
|
22
|
-
tabs && /* @__PURE__ */ jsx("div", { className: classNames.tabsWrapper, children: /* @__PURE__ */ jsx(Tabs, { children: /* @__PURE__ */ jsx(TabList, { children: tabs?.map((tab) => /* @__PURE__ */ jsx(
|
|
32
|
+
tabs && /* @__PURE__ */ jsx("div", { className: classNames.tabsWrapper, children: /* @__PURE__ */ jsx(Tabs, { onSelectionChange: onTabSelectionChange, children: /* @__PURE__ */ jsx(TabList, { children: tabs?.map((tab) => /* @__PURE__ */ jsx(
|
|
33
|
+
Tab,
|
|
34
|
+
{
|
|
35
|
+
id: tab.id,
|
|
36
|
+
href: tab.href,
|
|
37
|
+
matchStrategy: tab.matchStrategy,
|
|
38
|
+
children: tab.label
|
|
39
|
+
},
|
|
40
|
+
tab.id
|
|
41
|
+
)) }) }) })
|
|
23
42
|
] });
|
|
24
43
|
};
|
|
25
44
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.esm.js","sources":["../../../src/components/Header/Header.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { HeaderProps } from './types';\nimport { HeaderToolbar } from './HeaderToolbar';\nimport { Tabs, TabList, Tab } from '../Tabs';\nimport { useStyles } from '../../hooks/useStyles';\nimport { type NavigateOptions } from 'react-router-dom';\n\ndeclare module 'react-aria-components' {\n interface RouterConfig {\n routerOptions: NavigateOptions;\n }\n}\n\n/**\n * A component that renders a toolbar.\n *\n * @public\n */\nexport const Header = (props: HeaderProps) => {\n const {
|
|
1
|
+
{"version":3,"file":"Header.esm.js","sources":["../../../src/components/Header/Header.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { HeaderProps } from './types';\nimport { HeaderToolbar } from './HeaderToolbar';\nimport { Tabs, TabList, Tab } from '../Tabs';\nimport { useStyles } from '../../hooks/useStyles';\nimport { type NavigateOptions } from 'react-router-dom';\n\ndeclare module 'react-aria-components' {\n interface RouterConfig {\n routerOptions: NavigateOptions;\n }\n}\n\n/**\n * A component that renders a toolbar.\n *\n * @public\n */\nexport const Header = (props: HeaderProps) => {\n const {\n tabs,\n icon,\n title,\n titleLink,\n menuItems,\n breadcrumbs,\n customActions,\n onTabSelectionChange,\n } = props;\n\n const { classNames } = useStyles('Header');\n\n const hasTabs = tabs && tabs.length > 0;\n\n return (\n <>\n <HeaderToolbar\n icon={icon}\n title={title}\n titleLink={titleLink}\n menuItems={menuItems}\n breadcrumbs={breadcrumbs}\n customActions={customActions}\n hasTabs={hasTabs}\n />\n {tabs && (\n <div className={classNames.tabsWrapper}>\n <Tabs onSelectionChange={onTabSelectionChange}>\n <TabList>\n {tabs?.map(tab => (\n <Tab\n key={tab.id}\n id={tab.id}\n href={tab.href}\n matchStrategy={tab.matchStrategy}\n >\n {tab.label}\n </Tab>\n ))}\n </TabList>\n </Tabs>\n </div>\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AAiCa,MAAA,MAAA,GAAS,CAAC,KAAuB,KAAA;AAC5C,EAAM,MAAA;AAAA,IACJ,IAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,SAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA,GACE,GAAA,KAAA;AAEJ,EAAA,MAAM,EAAE,UAAA,EAAe,GAAA,SAAA,CAAU,QAAQ,CAAA;AAEzC,EAAM,MAAA,OAAA,GAAU,IAAQ,IAAA,IAAA,CAAK,MAAS,GAAA,CAAA;AAEtC,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACC,IAAA;AAAA,QACA,KAAA;AAAA,QACA,SAAA;AAAA,QACA,SAAA;AAAA,QACA,WAAA;AAAA,QACA,aAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,IACC,IACC,oBAAA,GAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,WAAW,WACzB,EAAA,QAAA,kBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,iBAAA,EAAmB,oBACvB,EAAA,QAAA,kBAAA,GAAA,CAAC,OACE,EAAA,EAAA,QAAA,EAAA,IAAA,EAAM,IAAI,CACT,GAAA,qBAAA,GAAA;AAAA,MAAC,GAAA;AAAA,MAAA;AAAA,QAEC,IAAI,GAAI,CAAA,EAAA;AAAA,QACR,MAAM,GAAI,CAAA,IAAA;AAAA,QACV,eAAe,GAAI,CAAA,aAAA;AAAA,QAElB,QAAI,EAAA,GAAA,CAAA;AAAA,OAAA;AAAA,MALA,GAAI,CAAA;AAAA,KAOZ,CACH,EAAA,CAAA,EACF,CACF,EAAA;AAAA,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Link } from 'react-aria-components';
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { RouterProvider, Link } from 'react-aria-components';
|
|
3
3
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
4
4
|
import { useRef, useState, useEffect } from 'react';
|
|
5
5
|
import { RiShapesLine, RiArrowRightSLine, RiMore2Line } from '@remixicon/react';
|
|
6
6
|
import { ButtonIcon } from '../ButtonIcon/ButtonIcon.esm.js';
|
|
7
7
|
import { Menu } from '../Menu/Menu.esm.js';
|
|
8
8
|
import { Text } from '../Text/Text.esm.js';
|
|
9
|
-
import {
|
|
9
|
+
import { useNavigate, useHref } from 'react-router-dom';
|
|
10
|
+
import { gsap } from 'gsap';
|
|
11
|
+
import { ScrollTrigger } from 'gsap/ScrollTrigger';
|
|
12
|
+
import { useGSAP } from '@gsap/react';
|
|
10
13
|
|
|
14
|
+
gsap.registerPlugin(ScrollTrigger);
|
|
11
15
|
const HeaderToolbar = (props) => {
|
|
12
|
-
const {
|
|
16
|
+
const {
|
|
17
|
+
icon,
|
|
18
|
+
title,
|
|
19
|
+
titleLink,
|
|
20
|
+
menuItems,
|
|
21
|
+
breadcrumbs,
|
|
22
|
+
customActions,
|
|
23
|
+
hasTabs
|
|
24
|
+
} = props;
|
|
13
25
|
const { classNames } = useStyles("Header");
|
|
14
|
-
|
|
15
|
-
const breadcrumbOpacity = useTransform(scrollY, [80, 120], [0, 1]);
|
|
26
|
+
let navigate = useNavigate();
|
|
16
27
|
const toolbarWrapperRef = useRef(null);
|
|
17
28
|
const toolbarContentRef = useRef(null);
|
|
18
29
|
const toolbarControlsRef = useRef(null);
|
|
30
|
+
const breadcrumbsRef = useRef(null);
|
|
19
31
|
const [showBreadcrumbs, setShowBreadcrumbs] = useState(true);
|
|
20
32
|
useEffect(() => {
|
|
21
33
|
const wrapper = toolbarWrapperRef.current;
|
|
@@ -43,18 +55,32 @@ const HeaderToolbar = (props) => {
|
|
|
43
55
|
resizeObserver.disconnect();
|
|
44
56
|
};
|
|
45
57
|
}, []);
|
|
46
|
-
|
|
58
|
+
useGSAP(() => {
|
|
59
|
+
gsap.to(breadcrumbsRef.current, {
|
|
60
|
+
scrollTrigger: {
|
|
61
|
+
start: "10% 10%",
|
|
62
|
+
end: "20% 20%",
|
|
63
|
+
scrub: true
|
|
64
|
+
},
|
|
65
|
+
opacity: 1,
|
|
66
|
+
duration: 1,
|
|
67
|
+
ease: "power2.inOut"
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
const titleContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
|
+
/* @__PURE__ */ jsx("div", { className: classNames.toolbarIcon, children: icon || /* @__PURE__ */ jsx(RiShapesLine, {}) }),
|
|
72
|
+
/* @__PURE__ */ jsx(Text, { variant: "body-medium", children: title || "Your plugin" })
|
|
73
|
+
] });
|
|
74
|
+
return /* @__PURE__ */ jsx(RouterProvider, { navigate, useHref, children: /* @__PURE__ */ jsx("div", { className: classNames.toolbar, "data-has-tabs": hasTabs, children: /* @__PURE__ */ jsxs("div", { className: classNames.toolbarWrapper, ref: toolbarWrapperRef, children: [
|
|
47
75
|
/* @__PURE__ */ jsxs("div", { className: classNames.toolbarContent, ref: toolbarContentRef, children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */ jsx("div", { className: classNames.toolbarIcon, children: icon || /* @__PURE__ */ jsx(RiShapesLine, {}) }),
|
|
50
|
-
/* @__PURE__ */ jsx(Text, { variant: "body", children: title || "Your plugin" })
|
|
51
|
-
] }),
|
|
76
|
+
/* @__PURE__ */ jsx(Text, { as: "h1", variant: "body-medium", children: titleLink ? /* @__PURE__ */ jsx(Link, { className: classNames.toolbarName, href: titleLink, children: titleContent }) : /* @__PURE__ */ jsx("div", { className: classNames.toolbarName, children: titleContent }) }),
|
|
52
77
|
breadcrumbs && /* @__PURE__ */ jsxs(
|
|
53
|
-
|
|
78
|
+
"div",
|
|
54
79
|
{
|
|
80
|
+
ref: breadcrumbsRef,
|
|
55
81
|
className: classNames.breadcrumbs,
|
|
56
82
|
style: {
|
|
57
|
-
opacity:
|
|
83
|
+
opacity: 0,
|
|
58
84
|
visibility: showBreadcrumbs ? "visible" : "hidden"
|
|
59
85
|
},
|
|
60
86
|
children: [
|
|
@@ -114,7 +140,7 @@ const HeaderToolbar = (props) => {
|
|
|
114
140
|
)) }) }) })
|
|
115
141
|
] })
|
|
116
142
|
] })
|
|
117
|
-
] }) });
|
|
143
|
+
] }) }) });
|
|
118
144
|
};
|
|
119
145
|
|
|
120
146
|
export { HeaderToolbar };
|