@apify/ui-library 1.127.8 → 1.127.10

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.127.8",
3
+ "version": "1.127.10",
4
4
  "description": "React UI library used by apify.com",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -68,5 +68,5 @@
68
68
  "src",
69
69
  "style"
70
70
  ],
71
- "gitHead": "106d8b4d4f6c9005254f2b5f4e096270ac246c0c"
71
+ "gitHead": "0bec6b696f986df3fa2f677f3b2a11023b02077d"
72
72
  }
@@ -44,6 +44,11 @@ const getIndeterminateLabel = (value: boolean | null) => {
44
44
  return value ? 'Checked' : 'Unchecked';
45
45
  };
46
46
 
47
+ const SectionLabel = styled.div`
48
+ font-weight: bold;
49
+ margin-top: 1rem;
50
+ `;
51
+
47
52
  export const Indeterminate = () => {
48
53
  const [value, setValue] = useState<boolean | null>(null);
49
54
  return (
@@ -52,6 +57,21 @@ export const Indeterminate = () => {
52
57
  <IndeterminateCheckbox value={value} setValue={setValue} />
53
58
  {getIndeterminateLabel(value)} (click to toggle)
54
59
  </Row>
60
+
61
+ <SectionLabel>Indeterminate</SectionLabel>
62
+ <Row><IndeterminateCheckbox value={null} setValue={() => {}} /> Default</Row>
63
+ <Row><IndeterminateCheckbox value={null} setValue={() => {}} disabled /> Disabled</Row>
64
+ <Row><IndeterminateCheckbox value={null} setValue={() => {}} error="Some error" /> Error</Row>
65
+
66
+ <SectionLabel>Checked</SectionLabel>
67
+ <Row><IndeterminateCheckbox value={true} setValue={() => {}} /> Default</Row>
68
+ <Row><IndeterminateCheckbox value={true} setValue={() => {}} disabled /> Disabled</Row>
69
+ <Row><IndeterminateCheckbox value={true} setValue={() => {}} error="Some error" /> Error</Row>
70
+
71
+ <SectionLabel>Unchecked</SectionLabel>
72
+ <Row><IndeterminateCheckbox value={false} setValue={() => {}} /> Default</Row>
73
+ <Row><IndeterminateCheckbox value={false} setValue={() => {}} disabled /> Disabled</Row>
74
+ <Row><IndeterminateCheckbox value={false} setValue={() => {}} error="Some error" /> Error</Row>
55
75
  </Grid>
56
76
  );
57
77
  };
@@ -30,11 +30,7 @@ export const checkboxStyle = css`
30
30
  border-color: ${theme.color.danger.text};
31
31
  }
32
32
 
33
- &.indeterminate {
34
- background-color: ${theme.color.primary.action};
35
- border-color: ${theme.color.primary.action};
36
- }
37
-
33
+ &[data-state="indeterminate"],
38
34
  &[data-state="checked"] {
39
35
  background-color: ${theme.color.primary.action};
40
36
  border-color: ${theme.color.primary.action};
@@ -75,7 +75,7 @@ export const CheckboxPrimitive: FC<CheckboxPrimitiveProps> = (props) => (
75
75
  );
76
76
 
77
77
  export const IndeterminateCheckbox: FC<IndeterminateCheckboxProps> = (props) => (
78
- <InternalCheckbox {...props} className="indeterminate">
78
+ <InternalCheckbox {...props}>
79
79
  {props.value == null ? (
80
80
  <IndeterminateIndicator>
81
81
  <MinusIcon size="12" />
@@ -32,11 +32,8 @@ export type CollapsibleCardProps = {
32
32
  topSection?: ReactNode;
33
33
  isClosedHeaderGrey?: boolean;
34
34
  isHeaderGreyOnHover?: boolean;
35
- className?: string;
36
- style?: React.CSSProperties;
37
35
  as?: React.ElementType;
38
- id?: string;
39
- } & TransientWrapperProps;
36
+ } & TransientWrapperProps & Omit<React.HTMLAttributes<HTMLElement>, 'children'>;
40
37
 
41
38
  export const collapsibleCardClassNames = {
42
39
  TOP_SECTION: 'CollapsibleCard-TopSection',
@@ -115,6 +112,11 @@ export const CollapsibleCard: FC<CollapsibleCardProps> = ({
115
112
  onIsExpandedChanged,
116
113
  noChevron,
117
114
  topSection,
115
+ hideOuterBorder,
116
+ hasShadow,
117
+ isClosedHeaderGrey,
118
+ isHeaderGreyOnHover,
119
+ as: Element,
118
120
  ...rest
119
121
  }) => {
120
122
  const isUncontrolled = isExpanded === undefined;
@@ -126,20 +128,18 @@ export const CollapsibleCard: FC<CollapsibleCardProps> = ({
126
128
 
127
129
  return (
128
130
  <StyledCardWrapper
129
- forwardedAs={rest.as || 'section'}
130
- $hideOuterBorder={rest.hideOuterBorder}
131
- $hasShadow={rest.hasShadow}
132
- className={rest.className}
133
- style={rest.style}
134
- id={rest.id}
131
+ forwardedAs={Element || 'section'}
132
+ $hideOuterBorder={hideOuterBorder}
133
+ $hasShadow={hasShadow}
134
+ {...rest}
135
135
  >
136
136
  {topSection && <StyledTopSection className={collapsibleCardClassNames.TOP_SECTION} data-test='collapsible-card-top-section'>
137
137
  {topSection}
138
138
  </StyledTopSection>}
139
139
  <StyledHeader
140
- $hideOuterBorder={rest.hideOuterBorder}
141
- $isHeaderGrey={rest.isClosedHeaderGrey && !isOpen && !isExpanded}
142
- $isHeaderGreyOnHover={rest.isHeaderGreyOnHover}
140
+ $hideOuterBorder={hideOuterBorder}
141
+ $isHeaderGrey={isClosedHeaderGrey && !isOpen && !isExpanded}
142
+ $isHeaderGreyOnHover={isHeaderGreyOnHover}
143
143
  onClick={onHeaderClick}
144
144
  >
145
145
  {!noChevron && <ChevronDownIcon size="16" className={clsx('chevron', (isExpanded ?? isOpen) ? 'chevron-open' : 'chevron-closed')} />}