@redocly/theme 0.19.5 → 0.19.6

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.
@@ -48,7 +48,7 @@ function CatalogCard({ item }) {
48
48
  React.createElement(CardFooter, null,
49
49
  hasTags && (React.createElement(CardTags, null,
50
50
  (item.tags || []).map((tag, index) => (React.createElement(CardTag, { key: tag + index, color: (0, utils_1.slug)(tag) },
51
- React.createElement(Highlight_1.Highlight, null, tag)))),
51
+ React.createElement(Highlight_1.Highlight, null, (0, utils_1.capitalize)(tag))))),
52
52
  (item.scorecardLevel && item.scorecardStatus && (React.createElement(CardTag, { color: statusToColor(item.scorecardStatus), className: "tag-variant-scorecard-level" },
53
53
  React.createElement(Highlight_1.Highlight, null, item.scorecardLevel)))) ||
54
54
  null)),
@@ -71,6 +71,7 @@ function statusToColor(status) {
71
71
  const SelectButton = styled_components_1.default.div `
72
72
  border: 1px solid var(--catalog-card-button-border-color);
73
73
  border-radius: 100%;
74
+ min-width: var(--catalog-card-button-width);
74
75
  width: var(--catalog-card-button-width);
75
76
  height: var(--catalog-card-button-height);
76
77
  display: flex;
@@ -147,6 +148,8 @@ const CardTags = styled_components_1.default.div `
147
148
  min-height: var(--spacing-xl);
148
149
  `;
149
150
  const CardTag = (0, styled_components_1.default)(Tag_1.Tag) `
151
+ display: block;
152
+ text-transform: inherit;
150
153
  margin: 0;
151
154
  `;
152
155
  //# sourceMappingURL=CatalogCard.js.map
@@ -10,3 +10,4 @@ export * from './color';
10
10
  export * from './urls';
11
11
  export * from './jsUtils';
12
12
  export * from './tags-parser';
13
+ export * from './text-transform';
@@ -26,4 +26,5 @@ __exportStar(require("./color"), exports);
26
26
  __exportStar(require("./urls"), exports);
27
27
  __exportStar(require("./jsUtils"), exports);
28
28
  __exportStar(require("./tags-parser"), exports);
29
+ __exportStar(require("./text-transform"), exports);
29
30
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ export declare function capitalize(input: string): string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.capitalize = void 0;
4
+ function capitalize(input) {
5
+ return input.charAt(0).toUpperCase() + input.slice(1);
6
+ }
7
+ exports.capitalize = capitalize;
8
+ //# sourceMappingURL=text-transform.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.19.5",
3
+ "version": "0.19.6",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -7,7 +7,7 @@ import { Highlight } from '@theme/ui/Highlight';
7
7
  import { Tag } from '@theme/components/Tag';
8
8
  import { PointingArrowIcon } from '@theme/icons';
9
9
  import { telemetry } from '@portal/telemetry';
10
- import { slug } from '@theme/utils';
10
+ import { slug, capitalize } from '@theme/utils';
11
11
 
12
12
  export function CatalogCard({ item }: { item: CatalogItem }): JSX.Element {
13
13
  const hasTags = item.scorecardStatus || item.tags?.length;
@@ -26,7 +26,7 @@ export function CatalogCard({ item }: { item: CatalogItem }): JSX.Element {
26
26
  <CardTags>
27
27
  {((item.tags as string[]) || []).map((tag, index) => (
28
28
  <CardTag key={tag + index} color={slug(tag)}>
29
- <Highlight>{tag}</Highlight>
29
+ <Highlight>{capitalize(tag)}</Highlight>
30
30
  </CardTag>
31
31
  ))}
32
32
  {(item.scorecardLevel && item.scorecardStatus && (
@@ -66,6 +66,7 @@ function statusToColor(status: string) {
66
66
  const SelectButton = styled.div`
67
67
  border: 1px solid var(--catalog-card-button-border-color);
68
68
  border-radius: 100%;
69
+ min-width: var(--catalog-card-button-width);
69
70
  width: var(--catalog-card-button-width);
70
71
  height: var(--catalog-card-button-height);
71
72
  display: flex;
@@ -149,5 +150,7 @@ const CardTags = styled.div`
149
150
  `;
150
151
 
151
152
  const CardTag = styled(Tag)`
153
+ display: block;
154
+ text-transform: inherit;
152
155
  margin: 0;
153
156
  `;
@@ -10,3 +10,4 @@ export * from './color';
10
10
  export * from './urls';
11
11
  export * from './jsUtils';
12
12
  export * from './tags-parser';
13
+ export * from './text-transform';
@@ -0,0 +1,3 @@
1
+ export function capitalize(input: string): string {
2
+ return input.charAt(0).toUpperCase() + input.slice(1);
3
+ }