Skip to content

Commit

Permalink
Merge branch 'main' into TextArea_Invalid_icon_bug
Browse files Browse the repository at this point in the history
  • Loading branch information
riddhybansal authored Jun 9, 2024
2 parents aa294b8 + db7b78d commit 74bc3bc
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
uses: github/codeql-action/init@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
with:
languages: javascript

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
uses: github/codeql-action/analyze@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
4 changes: 4 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"settingsInheritedFrom": "ibm-mend-config/mend-config@main",
"minSeverityLevel": "NONE"
}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,35 @@
*/

import PropTypes from 'prop-types';
import React from 'react';
import React, { ReactNode } from 'react';
import cx from 'classnames';
import { usePrefix } from '../../internal/usePrefix';
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
import setupGetInstanceId from '../../tools/setupGetInstanceId';

const getInstanceId = setupGetInstanceId();

function CheckboxGroup({
export interface CheckboxGroupProps {
children?: ReactNode;
className?: string;
helperText?: ReactNode;
invalid?: boolean;
invalidText?: ReactNode;
legendId?: ReactNode;
orientation?: 'horizontal' | 'vertical';
legendText: ReactNode;
readOnly?: boolean;
slug?: ReactNode;
warn?: boolean;
warnText?: ReactNode;
}

export interface CustomType {
size: string;
kind: string;
}

const CheckboxGroup: React.FC<CheckboxGroupProps> = ({
children,
className,
helperText,
Expand All @@ -28,7 +48,7 @@ function CheckboxGroup({
slug,
orientation = 'vertical',
...rest
}) {
}) => {
const prefix = usePrefix();

const showWarning = !readOnly && !invalid && warn;
Expand Down Expand Up @@ -56,20 +76,21 @@ function CheckboxGroup({

// Slug is always size `mini`
let normalizedSlug;
if (slug && slug['type']?.displayName === 'Slug') {
if (
React.isValidElement(slug) &&
(slug['type'] as any)?.displayName === 'Slug'
) {
normalizedSlug = React.cloneElement(slug, {
size: 'mini',
kind: 'default',
});
} as CustomType);
}

return (
<fieldset
className={fieldsetClasses}
data-invalid={invalid ? true : undefined}
aria-labelledby={rest['aria-labelledby'] || legendId}
aria-readonly={readOnly}
orientation="vertical"
aria-describedby={!invalid && !warn && helper ? helperId : undefined}
{...rest}>
<legend
Expand Down Expand Up @@ -98,7 +119,7 @@ function CheckboxGroup({
{showHelper && helper}
</fieldset>
);
}
};

CheckboxGroup.propTypes = {
/**
Expand Down Expand Up @@ -141,7 +162,6 @@ CheckboxGroup.propTypes = {
* Provide the orientation for how the checkbox should be displayed
*/
orientation: PropTypes.oneOf(['horizontal', 'vertical']),

/**
* Whether the CheckboxGroup should be read-only
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/ComboBox/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,9 @@ const ComboBox = forwardRef(
type="text"
tabIndex={0}
aria-haspopup="listbox"
aria-owns={getMenuProps().id}
title={textInput?.current?.value}
{...getInputProps({
'aria-controls': isOpen ? undefined : getMenuProps().id,
placeholder,
ref: { ...mergeRefs(textInput, ref) },
onKeyDown: (
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/DatePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export type CalRef = {
plugins: [];
clickOpens: any;
};
interface DatePickerProps {
export interface DatePickerProps {
/**
* Flatpickr prop passthrough enables direct date input, and when set to false,
* we must clear dates manually by resetting the value prop to empty string making it a controlled input.
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/DatePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* LICENSE file in the root directory of this source tree.
*/

import DatePicker from './DatePicker';
import DatePicker, { type DatePickerProps } from './DatePicker';

export {
default as DatePickerSkeleton,
type DatePickerSkeletonProps,
} from './DatePicker.Skeleton';
export default DatePicker;
export { DatePicker };
export { DatePicker, type DatePickerProps };
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type ReactNodeLike =

export type func = (...args: any[]) => any;

interface DatePickerInputProps
export interface DatePickerInputProps
extends Omit<ReactAttr<HTMLInputElement>, ExcludedAttributes> {
/**
* The type of the date picker:
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/DatePickerInput/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/

import DatePickerInput from './DatePickerInput';
import DatePickerInput, { type DatePickerInputProps } from './DatePickerInput';
export default DatePickerInput;
export { DatePickerInput };
export { DatePickerInput, type DatePickerInputProps };
6 changes: 0 additions & 6 deletions packages/react/src/components/Dropdown/Dropdown.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,22 @@ export default {

const items = [
{
id: 'option-0',
text: 'Lorem, ipsum dolor sit amet consectetur adipisicing elit.',
},
{
id: 'option-1',
text: 'Option 1',
},
{
id: 'option-2',
text: 'Option 2',
},
{
id: 'option-3',
text: 'Option 3 - a disabled item',
disabled: true,
},
{
id: 'option-4',
text: 'Option 4',
},
{
id: 'option-5',
text: 'Option 5',
},
];
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12453,13 +12453,13 @@ __metadata:
linkType: hard

"ejs@npm:^3.1.7, ejs@npm:^3.1.8":
version: 3.1.9
resolution: "ejs@npm:3.1.9"
version: 3.1.10
resolution: "ejs@npm:3.1.10"
dependencies:
jake: "npm:^10.8.5"
bin:
ejs: bin/cli.js
checksum: 10/71f56d37540d2c2d71701f0116710c676f75314a3e997ef8b83515d5d4d2b111c5a72725377caeecb928671bacb84a0d38135f345904812e989847057d59f21a
checksum: 10/a9cb7d7cd13b7b1cd0be5c4788e44dd10d92f7285d2f65b942f33e127230c054f99a42db4d99f766d8dbc6c57e94799593ee66a14efd7c8dd70c4812bf6aa384
languageName: node
linkType: hard

Expand Down

0 comments on commit 74bc3bc

Please sign in to comment.