@stoplight/elements-core 7.13.2 → 7.13.4

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.
@@ -4,6 +4,7 @@ export interface ISectionTitle {
4
4
  title: string;
5
5
  id?: string;
6
6
  size?: HeadingProps['size'];
7
+ isCompact?: boolean;
7
8
  }
8
9
  export declare const SectionTitle: React.FC<ISectionTitle>;
9
10
  export declare const SectionSubtitle: React.FC<ISectionTitle>;
package/index.esm.js CHANGED
@@ -1625,43 +1625,43 @@ const runAuthRequestEhancements = (auths, queryParams, headers) => {
1625
1625
  const newQueryParams = [...queryParams];
1626
1626
  const newHeaders = [...headers];
1627
1627
  auths.forEach(auth => {
1628
- var _a, _b, _c, _d, _e;
1628
+ var _a;
1629
1629
  if (isApiKeySecurityScheme(auth.scheme)) {
1630
1630
  if (auth.scheme.in === 'query') {
1631
1631
  newQueryParams.push({
1632
1632
  name: auth.scheme.name,
1633
- value: (_a = auth.authValue) !== null && _a !== void 0 ? _a : '',
1633
+ value: auth.authValue || '123',
1634
1634
  });
1635
1635
  }
1636
1636
  if (auth.scheme.in === 'header') {
1637
1637
  newHeaders.push({
1638
1638
  name: auth.scheme.name,
1639
- value: (_b = auth.authValue) !== null && _b !== void 0 ? _b : '',
1639
+ value: auth.authValue || '123',
1640
1640
  });
1641
1641
  }
1642
1642
  }
1643
1643
  if (isOAuth2SecurityScheme(auth.scheme)) {
1644
1644
  newHeaders.push({
1645
1645
  name: 'Authorization',
1646
- value: (_c = auth.authValue) !== null && _c !== void 0 ? _c : '',
1646
+ value: auth.authValue || 'Bearer 123',
1647
1647
  });
1648
1648
  }
1649
1649
  if (isBearerSecurityScheme(auth.scheme)) {
1650
1650
  newHeaders.push({
1651
1651
  name: 'Authorization',
1652
- value: `Bearer ${auth.authValue}`,
1652
+ value: `Bearer ${auth.authValue || '123'}`,
1653
1653
  });
1654
1654
  }
1655
1655
  if (isDigestSecurityScheme(auth.scheme)) {
1656
1656
  newHeaders.push({
1657
1657
  name: 'Authorization',
1658
- value: (_e = (_d = auth.authValue) === null || _d === void 0 ? void 0 : _d.replace(/\s\s+/g, ' ').trim()) !== null && _e !== void 0 ? _e : '',
1658
+ value: ((_a = auth.authValue) === null || _a === void 0 ? void 0 : _a.replace(/\s\s+/g, ' ').trim()) || '123',
1659
1659
  });
1660
1660
  }
1661
1661
  if (isBasicSecurityScheme(auth.scheme)) {
1662
1662
  newHeaders.push({
1663
1663
  name: 'Authorization',
1664
- value: `Basic ${auth.authValue}`,
1664
+ value: `Basic ${auth.authValue || '123'}`,
1665
1665
  });
1666
1666
  }
1667
1667
  });
@@ -2299,10 +2299,10 @@ const CustomLinkHeading = React.memo(function LinkHeading(_a) {
2299
2299
  return React.createElement(LinkHeading$1, Object.assign({ id: id }, props));
2300
2300
  });
2301
2301
 
2302
- const SectionTitle = ({ title, id, size = 2, children }) => {
2302
+ const SectionTitle = ({ title, id, size = 2, isCompact = false, children }) => {
2303
2303
  return (React.createElement(Flex, { w: "full" },
2304
2304
  React.createElement(Box, { py: 1, pr: 6, as: LinkHeading, size: size, "aria-label": title, id: id || slugify(title) }, title),
2305
- React.createElement(Box, { alignSelf: 'center', py: 1, flexGrow: true, style: { minWidth: 0 } }, children)));
2305
+ React.createElement(Flex, { alignSelf: 'center', py: 1, flexGrow: true, style: { minWidth: 0 }, justify: isCompact ? 'end' : undefined }, children)));
2306
2306
  };
2307
2307
  const SectionSubtitle = props => {
2308
2308
  return React.createElement(SectionTitle, Object.assign({}, props, { size: 3 }));
@@ -2568,7 +2568,7 @@ const Responses = ({ responses: unsortedResponses, onStatusCodeChange, onMediaTy
2568
2568
  const compactResponses = (React.createElement(React.Fragment, null,
2569
2569
  React.createElement(Button, { "aria-label": "response-codes", onPress: open, iconRight: React.createElement(Icon, { icon: "chevron-down", color: "var(--color-border-button)" }), style: {
2570
2570
  color: `var(--color-${codeToIntentVal(activeResponseId)})`,
2571
- } }, activeResponseId),
2571
+ }, appearance: "minimal" }, activeResponseId),
2572
2572
  React.createElement(Modal, { title: "Response Code", isOpen: isOpen, onClose: close, size: "sm", footer: React.createElement(HStack, { justifyContent: "end" },
2573
2573
  React.createElement(Button, { onPress: close, intent: "default", appearance: "primary" }, "Close")) },
2574
2574
  React.createElement(ListBox, { "aria-label": "Response Code", overflowY: "auto", m: -5, items: responses, selectionMode: "single", onSelectionChange: onSelectionChange }, (response) => (React.createElement(ListBoxItem, { key: response.id },
@@ -2578,7 +2578,7 @@ const Responses = ({ responses: unsortedResponses, onStatusCodeChange, onMediaTy
2578
2578
  React.createElement(Text, { ml: 3, fontWeight: "medium" }, response.code)))))))));
2579
2579
  const tabResponses = (React.createElement(TabList, { density: "compact" }, responses.map(({ code }) => (React.createElement(Tab, { key: code, id: code, intent: codeToIntentVal(code) }, code)))));
2580
2580
  return (React.createElement(VStack, { spacing: 8, as: Tabs, selectedId: activeResponseId, onChange: setActiveResponseId, appearance: "pill" },
2581
- React.createElement(SectionTitle, { title: "Responses" }, isCompact ? compactResponses : tabResponses),
2581
+ React.createElement(SectionTitle, { title: "Responses", isCompact: isCompact }, isCompact ? compactResponses : tabResponses),
2582
2582
  isCompact ? (React.createElement(Response, { response: response, onMediaTypeChange: onMediaTypeChange })) : (React.createElement(TabPanels, { p: 0 }, responses.map(response => (React.createElement(TabPanel, { key: response.code, id: response.code },
2583
2583
  React.createElement(Response, { response: response, onMediaTypeChange: onMediaTypeChange }))))))));
2584
2584
  };
package/index.js CHANGED
@@ -1681,43 +1681,43 @@ const runAuthRequestEhancements = (auths, queryParams, headers) => {
1681
1681
  const newQueryParams = [...queryParams];
1682
1682
  const newHeaders = [...headers];
1683
1683
  auths.forEach(auth => {
1684
- var _a, _b, _c, _d, _e;
1684
+ var _a;
1685
1685
  if (isApiKeySecurityScheme(auth.scheme)) {
1686
1686
  if (auth.scheme.in === 'query') {
1687
1687
  newQueryParams.push({
1688
1688
  name: auth.scheme.name,
1689
- value: (_a = auth.authValue) !== null && _a !== void 0 ? _a : '',
1689
+ value: auth.authValue || '123',
1690
1690
  });
1691
1691
  }
1692
1692
  if (auth.scheme.in === 'header') {
1693
1693
  newHeaders.push({
1694
1694
  name: auth.scheme.name,
1695
- value: (_b = auth.authValue) !== null && _b !== void 0 ? _b : '',
1695
+ value: auth.authValue || '123',
1696
1696
  });
1697
1697
  }
1698
1698
  }
1699
1699
  if (isOAuth2SecurityScheme(auth.scheme)) {
1700
1700
  newHeaders.push({
1701
1701
  name: 'Authorization',
1702
- value: (_c = auth.authValue) !== null && _c !== void 0 ? _c : '',
1702
+ value: auth.authValue || 'Bearer 123',
1703
1703
  });
1704
1704
  }
1705
1705
  if (isBearerSecurityScheme(auth.scheme)) {
1706
1706
  newHeaders.push({
1707
1707
  name: 'Authorization',
1708
- value: `Bearer ${auth.authValue}`,
1708
+ value: `Bearer ${auth.authValue || '123'}`,
1709
1709
  });
1710
1710
  }
1711
1711
  if (isDigestSecurityScheme(auth.scheme)) {
1712
1712
  newHeaders.push({
1713
1713
  name: 'Authorization',
1714
- value: (_e = (_d = auth.authValue) === null || _d === void 0 ? void 0 : _d.replace(/\s\s+/g, ' ').trim()) !== null && _e !== void 0 ? _e : '',
1714
+ value: ((_a = auth.authValue) === null || _a === void 0 ? void 0 : _a.replace(/\s\s+/g, ' ').trim()) || '123',
1715
1715
  });
1716
1716
  }
1717
1717
  if (isBasicSecurityScheme(auth.scheme)) {
1718
1718
  newHeaders.push({
1719
1719
  name: 'Authorization',
1720
- value: `Basic ${auth.authValue}`,
1720
+ value: `Basic ${auth.authValue || '123'}`,
1721
1721
  });
1722
1722
  }
1723
1723
  });
@@ -2355,10 +2355,10 @@ const CustomLinkHeading = React__namespace.memo(function LinkHeading(_a) {
2355
2355
  return React__namespace.createElement(mosaic.LinkHeading, Object.assign({ id: id }, props));
2356
2356
  });
2357
2357
 
2358
- const SectionTitle = ({ title, id, size = 2, children }) => {
2358
+ const SectionTitle = ({ title, id, size = 2, isCompact = false, children }) => {
2359
2359
  return (React__namespace.createElement(mosaic.Flex, { w: "full" },
2360
2360
  React__namespace.createElement(mosaic.Box, { py: 1, pr: 6, as: LinkHeading, size: size, "aria-label": title, id: id || slugify(title) }, title),
2361
- React__namespace.createElement(mosaic.Box, { alignSelf: 'center', py: 1, flexGrow: true, style: { minWidth: 0 } }, children)));
2361
+ React__namespace.createElement(mosaic.Flex, { alignSelf: 'center', py: 1, flexGrow: true, style: { minWidth: 0 }, justify: isCompact ? 'end' : undefined }, children)));
2362
2362
  };
2363
2363
  const SectionSubtitle = props => {
2364
2364
  return React__namespace.createElement(SectionTitle, Object.assign({}, props, { size: 3 }));
@@ -2624,7 +2624,7 @@ const Responses = ({ responses: unsortedResponses, onStatusCodeChange, onMediaTy
2624
2624
  const compactResponses = (React__namespace.createElement(React__namespace.Fragment, null,
2625
2625
  React__namespace.createElement(mosaic.Button, { "aria-label": "response-codes", onPress: open, iconRight: React__namespace.createElement(mosaic.Icon, { icon: "chevron-down", color: "var(--color-border-button)" }), style: {
2626
2626
  color: `var(--color-${codeToIntentVal(activeResponseId)})`,
2627
- } }, activeResponseId),
2627
+ }, appearance: "minimal" }, activeResponseId),
2628
2628
  React__namespace.createElement(mosaic.Modal, { title: "Response Code", isOpen: isOpen, onClose: close, size: "sm", footer: React__namespace.createElement(mosaic.HStack, { justifyContent: "end" },
2629
2629
  React__namespace.createElement(mosaic.Button, { onPress: close, intent: "default", appearance: "primary" }, "Close")) },
2630
2630
  React__namespace.createElement(mosaic.ListBox, { "aria-label": "Response Code", overflowY: "auto", m: -5, items: responses, selectionMode: "single", onSelectionChange: onSelectionChange }, (response) => (React__namespace.createElement(mosaic.ListBoxItem, { key: response.id },
@@ -2634,7 +2634,7 @@ const Responses = ({ responses: unsortedResponses, onStatusCodeChange, onMediaTy
2634
2634
  React__namespace.createElement(mosaic.Text, { ml: 3, fontWeight: "medium" }, response.code)))))))));
2635
2635
  const tabResponses = (React__namespace.createElement(mosaic.TabList, { density: "compact" }, responses.map(({ code }) => (React__namespace.createElement(mosaic.Tab, { key: code, id: code, intent: codeToIntentVal(code) }, code)))));
2636
2636
  return (React__namespace.createElement(mosaic.VStack, { spacing: 8, as: mosaic.Tabs, selectedId: activeResponseId, onChange: setActiveResponseId, appearance: "pill" },
2637
- React__namespace.createElement(SectionTitle, { title: "Responses" }, isCompact ? compactResponses : tabResponses),
2637
+ React__namespace.createElement(SectionTitle, { title: "Responses", isCompact: isCompact }, isCompact ? compactResponses : tabResponses),
2638
2638
  isCompact ? (React__namespace.createElement(Response, { response: response, onMediaTypeChange: onMediaTypeChange })) : (React__namespace.createElement(mosaic.TabPanels, { p: 0 }, responses.map(response => (React__namespace.createElement(mosaic.TabPanel, { key: response.code, id: response.code },
2639
2639
  React__namespace.createElement(Response, { response: response, onMediaTypeChange: onMediaTypeChange }))))))));
2640
2640
  };
package/index.mjs CHANGED
@@ -1625,43 +1625,43 @@ const runAuthRequestEhancements = (auths, queryParams, headers) => {
1625
1625
  const newQueryParams = [...queryParams];
1626
1626
  const newHeaders = [...headers];
1627
1627
  auths.forEach(auth => {
1628
- var _a, _b, _c, _d, _e;
1628
+ var _a;
1629
1629
  if (isApiKeySecurityScheme(auth.scheme)) {
1630
1630
  if (auth.scheme.in === 'query') {
1631
1631
  newQueryParams.push({
1632
1632
  name: auth.scheme.name,
1633
- value: (_a = auth.authValue) !== null && _a !== void 0 ? _a : '',
1633
+ value: auth.authValue || '123',
1634
1634
  });
1635
1635
  }
1636
1636
  if (auth.scheme.in === 'header') {
1637
1637
  newHeaders.push({
1638
1638
  name: auth.scheme.name,
1639
- value: (_b = auth.authValue) !== null && _b !== void 0 ? _b : '',
1639
+ value: auth.authValue || '123',
1640
1640
  });
1641
1641
  }
1642
1642
  }
1643
1643
  if (isOAuth2SecurityScheme(auth.scheme)) {
1644
1644
  newHeaders.push({
1645
1645
  name: 'Authorization',
1646
- value: (_c = auth.authValue) !== null && _c !== void 0 ? _c : '',
1646
+ value: auth.authValue || 'Bearer 123',
1647
1647
  });
1648
1648
  }
1649
1649
  if (isBearerSecurityScheme(auth.scheme)) {
1650
1650
  newHeaders.push({
1651
1651
  name: 'Authorization',
1652
- value: `Bearer ${auth.authValue}`,
1652
+ value: `Bearer ${auth.authValue || '123'}`,
1653
1653
  });
1654
1654
  }
1655
1655
  if (isDigestSecurityScheme(auth.scheme)) {
1656
1656
  newHeaders.push({
1657
1657
  name: 'Authorization',
1658
- value: (_e = (_d = auth.authValue) === null || _d === void 0 ? void 0 : _d.replace(/\s\s+/g, ' ').trim()) !== null && _e !== void 0 ? _e : '',
1658
+ value: ((_a = auth.authValue) === null || _a === void 0 ? void 0 : _a.replace(/\s\s+/g, ' ').trim()) || '123',
1659
1659
  });
1660
1660
  }
1661
1661
  if (isBasicSecurityScheme(auth.scheme)) {
1662
1662
  newHeaders.push({
1663
1663
  name: 'Authorization',
1664
- value: `Basic ${auth.authValue}`,
1664
+ value: `Basic ${auth.authValue || '123'}`,
1665
1665
  });
1666
1666
  }
1667
1667
  });
@@ -2299,10 +2299,10 @@ const CustomLinkHeading = React.memo(function LinkHeading(_a) {
2299
2299
  return React.createElement(LinkHeading$1, Object.assign({ id: id }, props));
2300
2300
  });
2301
2301
 
2302
- const SectionTitle = ({ title, id, size = 2, children }) => {
2302
+ const SectionTitle = ({ title, id, size = 2, isCompact = false, children }) => {
2303
2303
  return (React.createElement(Flex, { w: "full" },
2304
2304
  React.createElement(Box, { py: 1, pr: 6, as: LinkHeading, size: size, "aria-label": title, id: id || slugify(title) }, title),
2305
- React.createElement(Box, { alignSelf: 'center', py: 1, flexGrow: true, style: { minWidth: 0 } }, children)));
2305
+ React.createElement(Flex, { alignSelf: 'center', py: 1, flexGrow: true, style: { minWidth: 0 }, justify: isCompact ? 'end' : undefined }, children)));
2306
2306
  };
2307
2307
  const SectionSubtitle = props => {
2308
2308
  return React.createElement(SectionTitle, Object.assign({}, props, { size: 3 }));
@@ -2568,7 +2568,7 @@ const Responses = ({ responses: unsortedResponses, onStatusCodeChange, onMediaTy
2568
2568
  const compactResponses = (React.createElement(React.Fragment, null,
2569
2569
  React.createElement(Button, { "aria-label": "response-codes", onPress: open, iconRight: React.createElement(Icon, { icon: "chevron-down", color: "var(--color-border-button)" }), style: {
2570
2570
  color: `var(--color-${codeToIntentVal(activeResponseId)})`,
2571
- } }, activeResponseId),
2571
+ }, appearance: "minimal" }, activeResponseId),
2572
2572
  React.createElement(Modal, { title: "Response Code", isOpen: isOpen, onClose: close, size: "sm", footer: React.createElement(HStack, { justifyContent: "end" },
2573
2573
  React.createElement(Button, { onPress: close, intent: "default", appearance: "primary" }, "Close")) },
2574
2574
  React.createElement(ListBox, { "aria-label": "Response Code", overflowY: "auto", m: -5, items: responses, selectionMode: "single", onSelectionChange: onSelectionChange }, (response) => (React.createElement(ListBoxItem, { key: response.id },
@@ -2578,7 +2578,7 @@ const Responses = ({ responses: unsortedResponses, onStatusCodeChange, onMediaTy
2578
2578
  React.createElement(Text, { ml: 3, fontWeight: "medium" }, response.code)))))))));
2579
2579
  const tabResponses = (React.createElement(TabList, { density: "compact" }, responses.map(({ code }) => (React.createElement(Tab, { key: code, id: code, intent: codeToIntentVal(code) }, code)))));
2580
2580
  return (React.createElement(VStack, { spacing: 8, as: Tabs, selectedId: activeResponseId, onChange: setActiveResponseId, appearance: "pill" },
2581
- React.createElement(SectionTitle, { title: "Responses" }, isCompact ? compactResponses : tabResponses),
2581
+ React.createElement(SectionTitle, { title: "Responses", isCompact: isCompact }, isCompact ? compactResponses : tabResponses),
2582
2582
  isCompact ? (React.createElement(Response, { response: response, onMediaTypeChange: onMediaTypeChange })) : (React.createElement(TabPanels, { p: 0 }, responses.map(response => (React.createElement(TabPanel, { key: response.code, id: response.code },
2583
2583
  React.createElement(Response, { response: response, onMediaTypeChange: onMediaTypeChange }))))))));
2584
2584
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoplight/elements-core",
3
- "version": "7.13.2",
3
+ "version": "7.13.4",
4
4
  "main": "./index.js",
5
5
  "sideEffects": [
6
6
  "web-components.min.js",