@loomhq/lens 12.8.0 → 12.9.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.
- package/README.md +35 -7
- package/dist/cjs/icons/editions-icon.js +40 -0
- package/dist/cjs/icons/editions-icon.js.map +7 -0
- package/dist/cjs/icons/editions.js +9 -2
- package/dist/cjs/icons/editions.js.map +2 -2
- package/dist/cjs/icons/index.js +9 -2
- package/dist/cjs/icons/index.js.map +2 -2
- package/dist/cjs/index.js +241 -33
- package/dist/cjs/index.js.map +4 -4
- package/dist/esm/icons/chunk-SPTM4NUO.js +18 -0
- package/dist/esm/icons/chunk-SPTM4NUO.js.map +7 -0
- package/dist/esm/icons/editions-icon.js +12 -0
- package/dist/esm/icons/editions-icon.js.map +7 -0
- package/dist/esm/icons/editions.js +1 -1
- package/dist/esm/icons/index.js +57 -57
- package/dist/esm/index.js +242 -34
- package/dist/esm/index.js.map +4 -4
- package/dist/types/components/dropdown/dropdown.d.ts +3 -1
- package/dist/types/components/dropdown/dropdown.d.ts.map +1 -1
- package/dist/types/components/icon/available-icons/editions-icon.d.ts +3 -0
- package/dist/types/components/icon/available-icons/editions-icon.d.ts.map +1 -0
- package/dist/types/components/icon/available-icons/editions.d.ts +1 -1
- package/dist/types/components/icon/available-icons/editions.d.ts.map +1 -1
- package/dist/types/components/menu/menu.d.ts +4 -2
- package/dist/types/components/menu/menu.d.ts.map +1 -1
- package/dist/types/components/select/select.d.ts.map +1 -1
- package/dist/types/components/tabs/tabs.d.ts +24 -1
- package/dist/types/components/tabs/tabs.d.ts.map +1 -1
- package/dist/types/components/tooltip/tooltip.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/types/components/typeahead/typeahead.d.ts.map +1 -1
- package/dist/types/icons/editions-icon.d.ts +3 -0
- package/dist/types/icons/editions-icon.d.ts.map +1 -0
- package/dist/types/icons/editions.d.ts +1 -1
- package/dist/types/icons/editions.d.ts.map +1 -1
- package/dist/types/utilities/text.d.ts +3 -0
- package/dist/types/utilities/text.d.ts.map +1 -0
- package/package.json +6 -5
- package/dist/esm/icons/chunk-T4L22EHS.js +0 -11
- package/dist/esm/icons/chunk-T4L22EHS.js.map +0 -7
package/dist/cjs/index.js
CHANGED
|
@@ -3721,6 +3721,29 @@ var getDownshiftEnvironment = (container) => {
|
|
|
3721
3721
|
return window;
|
|
3722
3722
|
};
|
|
3723
3723
|
|
|
3724
|
+
// src/utilities/text.ts
|
|
3725
|
+
var getTextFromNode = (node) => {
|
|
3726
|
+
if (typeof node === "string") {
|
|
3727
|
+
return node;
|
|
3728
|
+
}
|
|
3729
|
+
if (typeof node === "number" || typeof node === "boolean" || typeof node === "bigint") {
|
|
3730
|
+
return node.toString();
|
|
3731
|
+
}
|
|
3732
|
+
if (node === null || node === void 0) {
|
|
3733
|
+
return "";
|
|
3734
|
+
}
|
|
3735
|
+
if (isIterable(node)) {
|
|
3736
|
+
return Array.from(node).map(getTextFromNode).join("");
|
|
3737
|
+
}
|
|
3738
|
+
if (typeof node === "object" && "props" in node && node.props && node.props.children !== void 0) {
|
|
3739
|
+
return getTextFromNode(node.props.children);
|
|
3740
|
+
}
|
|
3741
|
+
return "";
|
|
3742
|
+
};
|
|
3743
|
+
var isIterable = (node) => {
|
|
3744
|
+
return typeof node[Symbol.iterator] === "function";
|
|
3745
|
+
};
|
|
3746
|
+
|
|
3724
3747
|
// src/components/icon/available-icons/chevron-down.tsx
|
|
3725
3748
|
var React20 = __toESM(require("react"));
|
|
3726
3749
|
function SvgChevronDown() {
|
|
@@ -3821,19 +3844,24 @@ var MenuItem = (_a) => {
|
|
|
3821
3844
|
isSelected,
|
|
3822
3845
|
icon,
|
|
3823
3846
|
hasDivider,
|
|
3824
|
-
children
|
|
3847
|
+
children,
|
|
3848
|
+
menuItemRole
|
|
3825
3849
|
} = _b, props = __objRest(_b, [
|
|
3826
3850
|
"isDisabled",
|
|
3827
3851
|
"isHighlighted",
|
|
3828
3852
|
"isSelected",
|
|
3829
3853
|
"icon",
|
|
3830
3854
|
"hasDivider",
|
|
3831
|
-
"children"
|
|
3855
|
+
"children",
|
|
3856
|
+
"menuItemRole"
|
|
3832
3857
|
]);
|
|
3833
3858
|
const checkColumn = isSelected ? "auto" : "";
|
|
3834
3859
|
const iconColumn = icon ? "auto" : "";
|
|
3835
3860
|
const columns = `${iconColumn} 1fr ${checkColumn}`;
|
|
3836
3861
|
const color = isDisabled ? "disabledContent" : void 0;
|
|
3862
|
+
const updatedProps = menuItemRole ? __spreadProps(__spreadValues({}, props), {
|
|
3863
|
+
role: menuItemRole
|
|
3864
|
+
}) : props;
|
|
3837
3865
|
return /* @__PURE__ */ import_react22.default.createElement(
|
|
3838
3866
|
MenuItemWrapper,
|
|
3839
3867
|
__spreadValues({
|
|
@@ -3857,6 +3885,7 @@ var Menu = (_a) => {
|
|
|
3857
3885
|
maxWidth,
|
|
3858
3886
|
maxHeight,
|
|
3859
3887
|
children,
|
|
3888
|
+
role,
|
|
3860
3889
|
downshiftMenuProps = () => null,
|
|
3861
3890
|
search
|
|
3862
3891
|
} = _b, props = __objRest(_b, [
|
|
@@ -3866,9 +3895,13 @@ var Menu = (_a) => {
|
|
|
3866
3895
|
"maxWidth",
|
|
3867
3896
|
"maxHeight",
|
|
3868
3897
|
"children",
|
|
3898
|
+
"role",
|
|
3869
3899
|
"downshiftMenuProps",
|
|
3870
3900
|
"search"
|
|
3871
3901
|
]);
|
|
3902
|
+
const updatedDownshiftMenuProps = role ? __spreadProps(__spreadValues({}, downshiftMenuProps()), {
|
|
3903
|
+
role
|
|
3904
|
+
}) : __spreadValues({}, downshiftMenuProps());
|
|
3872
3905
|
return /* @__PURE__ */ import_react22.default.createElement(
|
|
3873
3906
|
MenuContainer,
|
|
3874
3907
|
__spreadValues(__spreadValues({
|
|
@@ -4037,11 +4070,13 @@ var getHeaderAccessibilityProps = ({
|
|
|
4037
4070
|
selectedItem,
|
|
4038
4071
|
getInputProps,
|
|
4039
4072
|
getToggleButtonProps,
|
|
4040
|
-
ariaMenuName
|
|
4073
|
+
ariaMenuName,
|
|
4074
|
+
isOpen
|
|
4041
4075
|
}) => {
|
|
4042
4076
|
const valueLabel = selectedItem ? `selected value is ${selectedItem.title}` : "no value selected";
|
|
4043
4077
|
const toggleLabel = getToggleButtonProps == null ? void 0 : getToggleButtonProps()["aria-label"];
|
|
4044
4078
|
return {
|
|
4079
|
+
"aria-expanded": isOpen,
|
|
4045
4080
|
// Ensures all options within the list of selections can be narrated by a screen reader
|
|
4046
4081
|
"aria-activedescendant": getInputProps()["aria-activedescendant"],
|
|
4047
4082
|
// The existing aria-label includes whether or not the menu is open or closed, and we add the valueLabel to make a screen reader narrate what is selected
|
|
@@ -4058,7 +4093,8 @@ var SelectHeader = ({
|
|
|
4058
4093
|
options,
|
|
4059
4094
|
getInputProps,
|
|
4060
4095
|
ariaMenuName,
|
|
4061
|
-
hasError
|
|
4096
|
+
hasError,
|
|
4097
|
+
isOpen
|
|
4062
4098
|
}) => {
|
|
4063
4099
|
const icon = getIcon({ options, selectedItem, selectedOptionValue });
|
|
4064
4100
|
const hasIcon = Boolean(icon);
|
|
@@ -4072,7 +4108,8 @@ var SelectHeader = ({
|
|
|
4072
4108
|
selectedItem,
|
|
4073
4109
|
getInputProps,
|
|
4074
4110
|
getToggleButtonProps,
|
|
4075
|
-
ariaMenuName
|
|
4111
|
+
ariaMenuName,
|
|
4112
|
+
isOpen
|
|
4076
4113
|
})), {
|
|
4077
4114
|
hasValue: inputValue || selectedOptionValue,
|
|
4078
4115
|
disabled: isDisabled,
|
|
@@ -4106,14 +4143,16 @@ var CustomHeader = ({
|
|
|
4106
4143
|
getInputProps,
|
|
4107
4144
|
ariaMenuName,
|
|
4108
4145
|
hasError,
|
|
4109
|
-
errorMessage
|
|
4146
|
+
errorMessage,
|
|
4147
|
+
isOpen
|
|
4110
4148
|
}) => {
|
|
4111
4149
|
const buttonProps = () => {
|
|
4112
4150
|
return __spreadValues(__spreadValues({}, getToggleButtonProps()), getHeaderAccessibilityProps({
|
|
4113
4151
|
selectedItem,
|
|
4114
4152
|
getInputProps,
|
|
4115
4153
|
getToggleButtonProps,
|
|
4116
|
-
ariaMenuName
|
|
4154
|
+
ariaMenuName,
|
|
4155
|
+
isOpen
|
|
4117
4156
|
}));
|
|
4118
4157
|
};
|
|
4119
4158
|
const getSelectedItem = () => {
|
|
@@ -4320,13 +4359,13 @@ var Select = (_a) => {
|
|
|
4320
4359
|
if (search.searchType === "startsWith") {
|
|
4321
4360
|
filteredGroups = options.map((group) => __spreadProps(__spreadValues({}, group), {
|
|
4322
4361
|
items: group.items.filter(
|
|
4323
|
-
(item) => item.title
|
|
4362
|
+
(item) => getTextFromNode(item.title).toLowerCase().startsWith(searchValue.toLowerCase())
|
|
4324
4363
|
)
|
|
4325
4364
|
}));
|
|
4326
4365
|
} else {
|
|
4327
4366
|
filteredGroups = options.map((group) => __spreadProps(__spreadValues({}, group), {
|
|
4328
4367
|
items: group.items.filter(
|
|
4329
|
-
(item) => item.title
|
|
4368
|
+
(item) => getTextFromNode(item.title).toLowerCase().includes(searchValue.toLowerCase())
|
|
4330
4369
|
)
|
|
4331
4370
|
}));
|
|
4332
4371
|
}
|
|
@@ -4339,11 +4378,11 @@ var Select = (_a) => {
|
|
|
4339
4378
|
}
|
|
4340
4379
|
if (search.searchType === "startsWith") {
|
|
4341
4380
|
return options.filter(
|
|
4342
|
-
(option) => option.title
|
|
4381
|
+
(option) => getTextFromNode(option.title).toLowerCase().startsWith(searchValue.toLowerCase())
|
|
4343
4382
|
);
|
|
4344
4383
|
}
|
|
4345
4384
|
return options.filter(
|
|
4346
|
-
(option) => option.title
|
|
4385
|
+
(option) => getTextFromNode(option.title).toLowerCase().includes(searchValue.toLowerCase())
|
|
4347
4386
|
);
|
|
4348
4387
|
}
|
|
4349
4388
|
return options;
|
|
@@ -4373,7 +4412,8 @@ var Select = (_a) => {
|
|
|
4373
4412
|
getInputProps,
|
|
4374
4413
|
ariaMenuName,
|
|
4375
4414
|
hasError,
|
|
4376
|
-
errorMessage
|
|
4415
|
+
errorMessage,
|
|
4416
|
+
isOpen
|
|
4377
4417
|
}
|
|
4378
4418
|
) : /* @__PURE__ */ import_react24.default.createElement(
|
|
4379
4419
|
SelectHeader,
|
|
@@ -4387,7 +4427,8 @@ var Select = (_a) => {
|
|
|
4387
4427
|
isDisabled,
|
|
4388
4428
|
getInputProps,
|
|
4389
4429
|
ariaMenuName,
|
|
4390
|
-
hasError
|
|
4430
|
+
hasError,
|
|
4431
|
+
isOpen
|
|
4391
4432
|
}
|
|
4392
4433
|
)), downshiftIsOpen && isOpen && renderLayer(
|
|
4393
4434
|
/* @__PURE__ */ import_react24.default.createElement(
|
|
@@ -5121,6 +5162,7 @@ var TypeaheadInputField = import_styled24.default.input`
|
|
|
5121
5162
|
transition: 0.3s box-shadow;
|
|
5122
5163
|
padding-top: 0;
|
|
5123
5164
|
padding-bottom: 0;
|
|
5165
|
+
id: ${(props) => props.id};
|
|
5124
5166
|
padding-left: ${(props) => props.hasIcon ? u(5.5) : "var(--lns-formFieldHorizontalPadding)"};
|
|
5125
5167
|
padding-right: ${(props) => props.hasAddOn ? u(5.5) : "var(--lns-formFieldHorizontalPadding)"};
|
|
5126
5168
|
border-radius: var(--lns-formFieldRadius);
|
|
@@ -5207,7 +5249,8 @@ var TypeaheadHeader = ({
|
|
|
5207
5249
|
hasLoader,
|
|
5208
5250
|
inputValue,
|
|
5209
5251
|
handleInputValueChange,
|
|
5210
|
-
inputRef
|
|
5252
|
+
inputRef,
|
|
5253
|
+
id
|
|
5211
5254
|
}) => {
|
|
5212
5255
|
const icon = getIcon2({ options, selectedItem, selectedOptionValue });
|
|
5213
5256
|
const hasIcon = Boolean(icon);
|
|
@@ -5227,6 +5270,8 @@ var TypeaheadHeader = ({
|
|
|
5227
5270
|
getInputProps,
|
|
5228
5271
|
ariaMenuName
|
|
5229
5272
|
})), getInputProps({
|
|
5273
|
+
id,
|
|
5274
|
+
"aria-labelledby": void 0,
|
|
5230
5275
|
disabled: isDisabled,
|
|
5231
5276
|
onFocus: handleClickAndFocus,
|
|
5232
5277
|
onClick: handleClickAndFocus,
|
|
@@ -5374,7 +5419,8 @@ var Typeahead = (0, import_react31.forwardRef)(
|
|
|
5374
5419
|
isLoading,
|
|
5375
5420
|
loadingMessage,
|
|
5376
5421
|
emptyResultsMessage,
|
|
5377
|
-
errorMessage
|
|
5422
|
+
errorMessage,
|
|
5423
|
+
id
|
|
5378
5424
|
} = _b, props = __objRest(_b, [
|
|
5379
5425
|
"container",
|
|
5380
5426
|
"onOptionChange",
|
|
@@ -5394,7 +5440,8 @@ var Typeahead = (0, import_react31.forwardRef)(
|
|
|
5394
5440
|
"isLoading",
|
|
5395
5441
|
"loadingMessage",
|
|
5396
5442
|
"emptyResultsMessage",
|
|
5397
|
-
"errorMessage"
|
|
5443
|
+
"errorMessage",
|
|
5444
|
+
"id"
|
|
5398
5445
|
]);
|
|
5399
5446
|
const environment = getDownshiftEnvironment(container);
|
|
5400
5447
|
const internalInputRef = (0, import_react31.useRef)(null);
|
|
@@ -5502,7 +5549,8 @@ var Typeahead = (0, import_react31.forwardRef)(
|
|
|
5502
5549
|
setDownshiftIsOpen(true);
|
|
5503
5550
|
},
|
|
5504
5551
|
hasLoader: isLoading,
|
|
5505
|
-
hasError: Boolean(errorMessage)
|
|
5552
|
+
hasError: Boolean(errorMessage),
|
|
5553
|
+
id
|
|
5506
5554
|
}
|
|
5507
5555
|
)), downshiftIsOpen && isOpen && renderLayer(
|
|
5508
5556
|
/* @__PURE__ */ import_react31.default.createElement(
|
|
@@ -5580,7 +5628,9 @@ var Dropdown = (_a) => {
|
|
|
5580
5628
|
onOuterClick,
|
|
5581
5629
|
triggerOffset = 0,
|
|
5582
5630
|
onOpenChange,
|
|
5583
|
-
search
|
|
5631
|
+
search,
|
|
5632
|
+
role,
|
|
5633
|
+
menuItemRole
|
|
5584
5634
|
} = _b, props = __objRest(_b, [
|
|
5585
5635
|
"ariaMenuName",
|
|
5586
5636
|
"menuPosition",
|
|
@@ -5596,7 +5646,9 @@ var Dropdown = (_a) => {
|
|
|
5596
5646
|
"onOuterClick",
|
|
5597
5647
|
"triggerOffset",
|
|
5598
5648
|
"onOpenChange",
|
|
5599
|
-
"search"
|
|
5649
|
+
"search",
|
|
5650
|
+
"role",
|
|
5651
|
+
"menuItemRole"
|
|
5600
5652
|
]);
|
|
5601
5653
|
const environment = getDownshiftEnvironment(container);
|
|
5602
5654
|
const [downshiftIsOpen, setDownshiftIsOpen] = (0, import_react32.useState)(false);
|
|
@@ -5628,17 +5680,11 @@ var Dropdown = (_a) => {
|
|
|
5628
5680
|
if (search) {
|
|
5629
5681
|
if (search.searchType === "startsWith") {
|
|
5630
5682
|
return options.filter(
|
|
5631
|
-
(option) =>
|
|
5632
|
-
var _a2;
|
|
5633
|
-
return (_a2 = option.title) == null ? void 0 : _a2.toString().toLowerCase().startsWith(searchValue.toLowerCase());
|
|
5634
|
-
}
|
|
5683
|
+
(option) => getTextFromNode(option.title).toLowerCase().startsWith(searchValue.toLowerCase())
|
|
5635
5684
|
);
|
|
5636
5685
|
}
|
|
5637
5686
|
return options.filter(
|
|
5638
|
-
(option) =>
|
|
5639
|
-
var _a2;
|
|
5640
|
-
return (_a2 = option.title) == null ? void 0 : _a2.toString().toLowerCase().includes(searchValue.toLowerCase());
|
|
5641
|
-
}
|
|
5687
|
+
(option) => getTextFromNode(option.title).toLowerCase().includes(searchValue.toLowerCase())
|
|
5642
5688
|
);
|
|
5643
5689
|
}
|
|
5644
5690
|
return options;
|
|
@@ -5673,7 +5719,7 @@ var Dropdown = (_a) => {
|
|
|
5673
5719
|
ariaMenuName,
|
|
5674
5720
|
getInputProps,
|
|
5675
5721
|
isOpen: isOpen2
|
|
5676
|
-
}))) : /* @__PURE__ */ import_react32.default.createElement(TriggerSection, __spreadValues({}, getToggleButtonProps({})), trigger)),
|
|
5722
|
+
}))) : /* @__PURE__ */ import_react32.default.createElement(TriggerSection, __spreadValues({}, getToggleButtonProps({ tabIndex: 0 })), trigger)),
|
|
5677
5723
|
isOpen2 && renderLayer(
|
|
5678
5724
|
/* @__PURE__ */ import_react32.default.createElement(
|
|
5679
5725
|
"div",
|
|
@@ -5688,6 +5734,7 @@ var Dropdown = (_a) => {
|
|
|
5688
5734
|
maxWidth: menuMaxWidth,
|
|
5689
5735
|
maxHeight: menuMaxHeight,
|
|
5690
5736
|
downshiftMenuProps: getMenuProps,
|
|
5737
|
+
role,
|
|
5691
5738
|
search: search && /* @__PURE__ */ import_react32.default.createElement(
|
|
5692
5739
|
search_bar_default,
|
|
5693
5740
|
{
|
|
@@ -5710,6 +5757,7 @@ var Dropdown = (_a) => {
|
|
|
5710
5757
|
icon: item.icon,
|
|
5711
5758
|
hasDivider: item.hasDivider,
|
|
5712
5759
|
getItemProps,
|
|
5760
|
+
menuItemRole,
|
|
5713
5761
|
index
|
|
5714
5762
|
}, getItemProps({
|
|
5715
5763
|
key: index,
|
|
@@ -6928,16 +6976,16 @@ var CombinedLogoSvg = (_a) => {
|
|
|
6928
6976
|
), /* @__PURE__ */ import_react46.default.createElement(
|
|
6929
6977
|
"path",
|
|
6930
6978
|
{
|
|
6931
|
-
|
|
6932
|
-
|
|
6979
|
+
fillRule: "evenodd",
|
|
6980
|
+
clipRule: "evenodd",
|
|
6933
6981
|
d: "M70.3743 15.1855C71.6352 15.1855 72.7252 15.459 73.6442 16.0059C74.5709 16.5527 75.2848 17.3237 75.7861 18.3187C76.2874 19.3061 76.5381 20.4568 76.5381 21.7708C76.5381 23.0773 76.2874 24.2242 75.7861 25.2116C75.2848 26.199 74.5709 26.9661 73.6442 27.513C72.7252 28.0599 71.6352 28.3333 70.3743 28.3333C69.1135 28.3333 68.0197 28.0599 67.0931 27.513C66.174 26.9661 65.4639 26.199 64.9626 25.2116C64.4613 24.2242 64.2106 23.0773 64.2106 21.7708C64.2106 20.4568 64.4613 19.3061 64.9626 18.3187C65.4639 17.3237 66.174 16.5527 67.0931 16.0059C68.0197 15.459 69.1135 15.1855 70.3743 15.1855ZM70.3743 17.7376C69.7287 17.7376 69.1895 17.9161 68.7565 18.2731C68.3312 18.6225 68.0084 19.101 67.7881 19.7087C67.5754 20.3087 67.4691 20.9923 67.4691 21.7594C67.4691 22.519 67.5754 23.2026 67.7881 23.8102C68.0084 24.4179 68.3312 24.9002 68.7565 25.2572C69.1895 25.6066 69.7287 25.7812 70.3743 25.7812C71.02 25.7812 71.5592 25.6066 71.9922 25.2572C72.4251 24.9002 72.7479 24.4179 72.9606 23.8102C73.1733 23.2026 73.2796 22.519 73.2796 21.7594C73.2796 20.9999 73.1733 20.3163 72.9606 19.7087C72.7479 19.101 72.4251 18.6225 71.9922 18.2731C71.5592 17.9161 71.02 17.7376 70.3743 17.7376Z",
|
|
6934
6982
|
fill: wordmarkColor
|
|
6935
6983
|
}
|
|
6936
6984
|
), /* @__PURE__ */ import_react46.default.createElement(
|
|
6937
6985
|
"path",
|
|
6938
6986
|
{
|
|
6939
|
-
|
|
6940
|
-
|
|
6987
|
+
fillRule: "evenodd",
|
|
6988
|
+
clipRule: "evenodd",
|
|
6941
6989
|
d: "M84.6387 15.1855C85.8995 15.1855 86.9895 15.459 87.9085 16.0059C88.8352 16.5527 89.5491 17.3237 90.0505 18.3187C90.5518 19.3061 90.8024 20.4568 90.8024 21.7708C90.8024 23.0773 90.5518 24.2242 90.0505 25.2116C89.5491 26.199 88.8352 26.9661 87.9085 27.513C86.9895 28.0599 85.8995 28.3333 84.6387 28.3333C83.3778 28.3333 82.2841 28.0599 81.3574 27.513C80.4384 26.9661 79.7282 26.199 79.2269 25.2116C78.7256 24.2242 78.4749 23.0773 78.4749 21.7708C78.4749 20.4568 78.7256 19.3061 79.2269 18.3187C79.7282 17.3237 80.4384 16.5527 81.3574 16.0059C82.2841 15.459 83.3778 15.1855 84.6387 15.1855ZM84.6387 17.7376C83.9931 17.7376 83.4538 17.9161 83.0208 18.2731C82.5955 18.6225 82.2727 19.101 82.0524 19.7087C81.8397 20.3087 81.7334 20.9923 81.7334 21.7594C81.7334 22.519 81.8397 23.2026 82.0524 23.8102C82.2727 24.4179 82.5955 24.9002 83.0208 25.2572C83.4538 25.6066 83.9931 25.7812 84.6387 25.7812C85.2843 25.7812 85.8236 25.6066 86.2565 25.2572C86.6895 24.9002 87.0123 24.4179 87.2249 23.8102C87.4376 23.2026 87.5439 22.519 87.5439 21.7594C87.5439 20.9999 87.4376 20.3163 87.2249 19.7087C87.0123 19.101 86.6895 18.6225 86.2565 18.2731C85.8236 17.9161 85.2843 17.7376 84.6387 17.7376Z",
|
|
6942
6990
|
fill: wordmarkColor
|
|
6943
6991
|
}
|
|
@@ -7590,7 +7638,7 @@ var Tab = (_a) => {
|
|
|
7590
7638
|
children
|
|
7591
7639
|
);
|
|
7592
7640
|
};
|
|
7593
|
-
var
|
|
7641
|
+
var TabsDeprecated = (_a) => {
|
|
7594
7642
|
var _b = _a, {
|
|
7595
7643
|
children,
|
|
7596
7644
|
scrollOffset,
|
|
@@ -7627,6 +7675,166 @@ var Tabs = (_a) => {
|
|
|
7627
7675
|
}
|
|
7628
7676
|
return /* @__PURE__ */ import_react50.default.createElement(TabsContext.Provider, { value: { isPilledDesign } }, tabsContent);
|
|
7629
7677
|
};
|
|
7678
|
+
var ConditionalTooltip = ({
|
|
7679
|
+
tooltipProps,
|
|
7680
|
+
children,
|
|
7681
|
+
tooltipId
|
|
7682
|
+
}) => {
|
|
7683
|
+
if (tooltipProps) {
|
|
7684
|
+
return /* @__PURE__ */ import_react50.default.createElement(tooltip_default, __spreadProps(__spreadValues({}, tooltipProps), { tooltipId, tabIndex: -1 }), children);
|
|
7685
|
+
}
|
|
7686
|
+
return children;
|
|
7687
|
+
};
|
|
7688
|
+
var TabNew = import_react50.default.forwardRef(
|
|
7689
|
+
(_a, ref) => {
|
|
7690
|
+
var _b = _a, {
|
|
7691
|
+
tabContent,
|
|
7692
|
+
tooltipProps,
|
|
7693
|
+
isActive,
|
|
7694
|
+
htmlTag = "button",
|
|
7695
|
+
icon,
|
|
7696
|
+
isDisabled = false,
|
|
7697
|
+
onKeyDown,
|
|
7698
|
+
onClick
|
|
7699
|
+
} = _b, props = __objRest(_b, [
|
|
7700
|
+
"tabContent",
|
|
7701
|
+
"tooltipProps",
|
|
7702
|
+
"isActive",
|
|
7703
|
+
"htmlTag",
|
|
7704
|
+
"icon",
|
|
7705
|
+
"isDisabled",
|
|
7706
|
+
"onKeyDown",
|
|
7707
|
+
"onClick"
|
|
7708
|
+
]);
|
|
7709
|
+
const { isPilledDesign } = import_react50.default.useContext(TabsContext);
|
|
7710
|
+
const tooltipId = (0, import_react50.useId)();
|
|
7711
|
+
const componentProps = __spreadValues({
|
|
7712
|
+
as: htmlTag,
|
|
7713
|
+
isActive,
|
|
7714
|
+
icon,
|
|
7715
|
+
role: "tab",
|
|
7716
|
+
"aria-selected": isActive,
|
|
7717
|
+
disabled: isDisabled,
|
|
7718
|
+
tabIndex: isActive ? 0 : -1,
|
|
7719
|
+
"aria-describedby": tooltipProps ? tooltipId : void 0,
|
|
7720
|
+
onKeyDown,
|
|
7721
|
+
onClick,
|
|
7722
|
+
ref
|
|
7723
|
+
}, props);
|
|
7724
|
+
return /* @__PURE__ */ import_react50.default.createElement(ConditionalTooltip, { tooltipProps, tooltipId }, isPilledDesign ? /* @__PURE__ */ import_react50.default.createElement(TabWrapperPilled, __spreadValues({}, componentProps), icon ? /* @__PURE__ */ import_react50.default.createElement(container_default, { htmlTag: "span", paddingRight: tabContent && "small" }, /* @__PURE__ */ import_react50.default.createElement(icon_default, { icon, color: "currentColor" })) : null, tabContent) : /* @__PURE__ */ import_react50.default.createElement(TabWrapper, __spreadValues({}, componentProps), icon ? /* @__PURE__ */ import_react50.default.createElement(container_default, { htmlTag: "span", paddingRight: tabContent && "small" }, /* @__PURE__ */ import_react50.default.createElement(icon_default, { icon, color: "currentColor" })) : null, tabContent));
|
|
7725
|
+
}
|
|
7726
|
+
);
|
|
7727
|
+
TabNew.displayName = "TabNew";
|
|
7728
|
+
var TabsNew = (_a) => {
|
|
7729
|
+
var _b = _a, {
|
|
7730
|
+
tabs,
|
|
7731
|
+
scrollOffset,
|
|
7732
|
+
hasFullTabs,
|
|
7733
|
+
isPilledDesign,
|
|
7734
|
+
hasBottomBorder = false
|
|
7735
|
+
} = _b, props = __objRest(_b, [
|
|
7736
|
+
"tabs",
|
|
7737
|
+
"scrollOffset",
|
|
7738
|
+
"hasFullTabs",
|
|
7739
|
+
"isPilledDesign",
|
|
7740
|
+
"hasBottomBorder"
|
|
7741
|
+
]);
|
|
7742
|
+
const tabRefs = (0, import_react50.useRef)({});
|
|
7743
|
+
const handleKeyDown = (0, import_react50.useCallback)(
|
|
7744
|
+
(event, currentTabIndex) => {
|
|
7745
|
+
var _a2;
|
|
7746
|
+
let newIndex = currentTabIndex;
|
|
7747
|
+
switch (event.key) {
|
|
7748
|
+
case "ArrowLeft":
|
|
7749
|
+
event.preventDefault();
|
|
7750
|
+
newIndex = currentTabIndex > 0 ? currentTabIndex - 1 : tabs.length - 1;
|
|
7751
|
+
break;
|
|
7752
|
+
case "ArrowRight":
|
|
7753
|
+
event.preventDefault();
|
|
7754
|
+
newIndex = currentTabIndex < tabs.length - 1 ? currentTabIndex + 1 : 0;
|
|
7755
|
+
break;
|
|
7756
|
+
case "Home":
|
|
7757
|
+
event.preventDefault();
|
|
7758
|
+
newIndex = 0;
|
|
7759
|
+
break;
|
|
7760
|
+
case "End":
|
|
7761
|
+
event.preventDefault();
|
|
7762
|
+
newIndex = tabs.length - 1;
|
|
7763
|
+
break;
|
|
7764
|
+
default:
|
|
7765
|
+
return;
|
|
7766
|
+
}
|
|
7767
|
+
(_a2 = tabRefs.current[newIndex]) == null ? void 0 : _a2.focus();
|
|
7768
|
+
},
|
|
7769
|
+
[tabs.length]
|
|
7770
|
+
);
|
|
7771
|
+
const setTabRef = (0, import_react50.useCallback)(
|
|
7772
|
+
(tabIndex) => (ref) => {
|
|
7773
|
+
tabRefs.current[tabIndex] = ref;
|
|
7774
|
+
},
|
|
7775
|
+
[]
|
|
7776
|
+
);
|
|
7777
|
+
const tabsToRender = (0, import_react50.useMemo)(
|
|
7778
|
+
() => tabs.map((tabProps, index) => /* @__PURE__ */ import_react50.default.createElement(
|
|
7779
|
+
TabNew,
|
|
7780
|
+
__spreadValues({
|
|
7781
|
+
key: index,
|
|
7782
|
+
ref: setTabRef(index),
|
|
7783
|
+
onKeyDown: (e) => handleKeyDown(e, index)
|
|
7784
|
+
}, tabProps)
|
|
7785
|
+
)),
|
|
7786
|
+
[tabs, handleKeyDown, setTabRef]
|
|
7787
|
+
);
|
|
7788
|
+
const tabsContent = (0, import_react50.useMemo)(
|
|
7789
|
+
() => isPilledDesign ? /* @__PURE__ */ import_react50.default.createElement(
|
|
7790
|
+
TabsNavPilled,
|
|
7791
|
+
__spreadValues({
|
|
7792
|
+
hasFullTabs,
|
|
7793
|
+
scrollOffset,
|
|
7794
|
+
role: "tablist"
|
|
7795
|
+
}, props),
|
|
7796
|
+
tabsToRender
|
|
7797
|
+
) : /* @__PURE__ */ import_react50.default.createElement(
|
|
7798
|
+
TabsNav,
|
|
7799
|
+
__spreadValues({
|
|
7800
|
+
hasFullTabs,
|
|
7801
|
+
scrollOffset,
|
|
7802
|
+
hasBottomBorder,
|
|
7803
|
+
role: "tablist"
|
|
7804
|
+
}, props),
|
|
7805
|
+
tabsToRender
|
|
7806
|
+
),
|
|
7807
|
+
[
|
|
7808
|
+
tabsToRender,
|
|
7809
|
+
hasFullTabs,
|
|
7810
|
+
scrollOffset,
|
|
7811
|
+
hasBottomBorder,
|
|
7812
|
+
isPilledDesign,
|
|
7813
|
+
props
|
|
7814
|
+
]
|
|
7815
|
+
);
|
|
7816
|
+
const wrappedContent = /* @__PURE__ */ import_react50.default.createElement(TabsContext.Provider, { value: { isPilledDesign } }, tabsContent);
|
|
7817
|
+
if (scrollOffset) {
|
|
7818
|
+
return /* @__PURE__ */ import_react50.default.createElement(Wrapper, { scrollOffset }, wrappedContent);
|
|
7819
|
+
}
|
|
7820
|
+
return wrappedContent;
|
|
7821
|
+
};
|
|
7822
|
+
var Tabs = (_a) => {
|
|
7823
|
+
var _b = _a, { children, tabs } = _b, props = __objRest(_b, ["children", "tabs"]);
|
|
7824
|
+
if (children && tabs) {
|
|
7825
|
+
console.warn(
|
|
7826
|
+
"Both children and tabs props are provided. Please use only one of them."
|
|
7827
|
+
);
|
|
7828
|
+
}
|
|
7829
|
+
if (!children && !tabs) {
|
|
7830
|
+
console.error("Either children or tabs must be provided.");
|
|
7831
|
+
return null;
|
|
7832
|
+
}
|
|
7833
|
+
if (children) {
|
|
7834
|
+
return /* @__PURE__ */ import_react50.default.createElement(TabsDeprecated, __spreadValues({}, props), children);
|
|
7835
|
+
}
|
|
7836
|
+
return /* @__PURE__ */ import_react50.default.createElement(TabsNew, __spreadValues({ tabs }, props));
|
|
7837
|
+
};
|
|
7630
7838
|
var tabs_default = Tabs;
|
|
7631
7839
|
|
|
7632
7840
|
// src/components/pill/pill.tsx
|