@apify/ui-library 1.164.10 → 1.165.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/ui-library",
3
- "version": "1.164.10",
3
+ "version": "1.165.1",
4
4
  "description": "React UI library used by apify.com",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -75,7 +75,7 @@
75
75
  "styled-components": "^6.1.19"
76
76
  },
77
77
  "devDependencies": {
78
- "@apify-packages/types": "^3.431.0",
78
+ "@apify-packages/types": "^3.431.2",
79
79
  "@storybook/react-vite": "^10.3.5",
80
80
  "@testing-library/react": "^16.3.2",
81
81
  "@types/hast": "^3.0.4",
@@ -95,5 +95,5 @@
95
95
  "src",
96
96
  "style"
97
97
  ],
98
- "gitHead": "e8516708c2ab2b928a92fa36ec6c10fb79212243"
98
+ "gitHead": "d0f82825558dfdb4c756c807fbfdf3dc68b28249"
99
99
  }
@@ -29,7 +29,7 @@ const StyledBreadcrumbLink = styled(Link)`
29
29
  /* Reserve the bolder hover width via a hidden ::after copy of the label on the same span, so it
30
30
  inherits identical font-size/line-height and (with height: 0) adds no height — hovering changes
31
31
  the weight without widening the label or shifting the rest of the row. */
32
- > span {
32
+ > span[data-label] {
33
33
  display: inline-block;
34
34
  /* Center the label within its reserved (bold) width so it grows symmetrically on hover. */
35
35
  text-align: center;
@@ -46,7 +46,7 @@ const StyledBreadcrumbLink = styled(Link)`
46
46
 
47
47
  &:hover {
48
48
  color: ${theme.color.neutral.textMuted};
49
- span {
49
+ > span[data-label] {
50
50
  /* TODO: (typography-partial) font-weight override without paired font-size/line-height — revisit to confirm intended typography token. */
51
51
  font-weight: 500;
52
52
  }
@@ -56,10 +56,16 @@ const StyledBreadcrumbLink = styled(Link)`
56
56
  const StyledBreadcrumbItemText = styled(Text)`
57
57
  padding: ${theme.space.space2} ${theme.space.space4};
58
58
  white-space: nowrap;
59
+
60
+ > span {
61
+ margin-left: ${theme.space.space4};
62
+ }
59
63
  `;
60
64
 
61
65
  export type BreadcrumbItem = {
62
66
  label: string;
67
+ /** Rendered after the label in muted, normal weight - e.g. a "+2" disclosing what the label omits. */
68
+ labelSuffix?: string;
63
69
  url?: string;
64
70
  /** Fires a `Clicked` event with this `element` when the crumb is a link. Ignored on the active crumb. */
65
71
  trackingId?: string;
@@ -98,6 +104,13 @@ export const Breadcrumbs: React.FC<BreadcrumbsProps> = ({ items, className }) =>
98
104
  <Text as="span" size="small" weight="normal" data-label={item.label}>
99
105
  {item.label}
100
106
  </Text>
107
+ {/* Its own `data-label` earns it the same width reservation as the label, so it
108
+ takes the hover colour and weight without widening the row. */}
109
+ {item.labelSuffix && (
110
+ <Text as="span" size="small" weight="normal" data-label={item.labelSuffix}>
111
+ {item.labelSuffix}
112
+ </Text>
113
+ )}
101
114
  </StyledBreadcrumbLink>
102
115
  ) : (
103
116
  <StyledBreadcrumbItemText
@@ -106,6 +119,11 @@ export const Breadcrumbs: React.FC<BreadcrumbsProps> = ({ items, className }) =>
106
119
  color={isActive ? theme.color.neutral.text : theme.color.neutral.textSubtle}
107
120
  >
108
121
  {item.label}
122
+ {item.labelSuffix && (
123
+ <Text as="span" size="small" weight="normal" color={theme.color.neutral.textSubtle}>
124
+ {item.labelSuffix}
125
+ </Text>
126
+ )}
109
127
  </StyledBreadcrumbItemText>
110
128
  )}
111
129
  </span>