Skip to content

Commit

Permalink
Merge branch 'main' into stylelint
Browse files Browse the repository at this point in the history
Signed-off-by: Danila Gulderov <[email protected]>
  • Loading branch information
gulderov authored Sep 6, 2023
2 parents ec4765c + 8531d2a commit 0904cb9
Show file tree
Hide file tree
Showing 40 changed files with 712 additions and 19 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,26 @@
### 🛡 Security

### 📈 Features/Enhancements

- Rename the aliased theme files ([#863](https://github.com/opensearch-project/oui/pull/863))
- Fix `autofill` text color in dark themes ([#871](https://github.com/opensearch-project/oui/pull/871))
- [Header] Update background color in next theme ([#936](https://github.com/opensearch-project/oui/pull/936))
- Set link to use semi bold font weight ([#961](https://github.com/opensearch-project/oui/pull/961))
- Update ouiTextSubduedColor in `next` dark theme ([#973](https://github.com/opensearch-project/oui/pull/973))
- Adds `SchemaItem` as an experimental component ([#974](https://github.com/opensearch-project/oui/pull/974))
- Make `CollapsibleNavGroup` background colors theme-able ([#968](https://github.com/opensearch-project/oui/pull/968))
- Make `CollapsibleNav` and `CollapsibleNavGroup` background colors theme-able ([#968](https://github.com/opensearch-project/oui/pull/968), [#1016](https://github.com/opensearch-project/oui/pull/1016))
- Update next light theme primary color to #07827E ([#981](https://github.com/opensearch-project/oui/pull/981))
- Add dismissible prop to OuiCallOut ([#985](https://github.com/opensearch-project/oui/pull/985))
- Adjust $ouiFormInputGroupLabelBackground color in dark `next` theme ([#1005](https://github.com/opensearch-project/oui/pull/1005))
- Adjust background color of OuiToolTip in `next` theme ([#1004](https://github.com/opensearch-project/oui/pull/1004))
- Add new `middle-out` order prop option to `OuiPaletteColorBlind` ([#856](https://github.com/opensearch-project/oui/pull/856))
- Add new icons for OpenSearch Dashboards v2.10.0 ([#1014](https://github.com/opensearch-project/oui/pull/1014))

### 🐛 Bug Fixes

- Fix blurry text in breadcrumbs by avoiding skewing text ([#959](https://github.com/opensearch-project/oui/pull/959))
- Remove `calc` usage from SchemaItem styles ([#990](https://github.com/opensearch-project/oui/pull/990))
- Add support for null types when deriving JSON from Sass variables ([#1019](https://github.com/opensearch-project/oui/pull/1019))

### 🚞 Infrastructure

Expand All @@ -33,6 +39,7 @@

### 📝 Documentation

- Replace Avatar in favor of Icon in OuiFacetButtons example ([#987](https://github.com/opensearch-project/oui/pull/987))
- Add dark prop toggles ([#910](https://github.com/opensearch-project/oui/pull/910))
- Remove language from the form validation documentation that doesn't align with the updated guidelines ([#986](https://github.com/opensearch-project/oui/pull/986))

Expand Down
4 changes: 4 additions & 0 deletions scripts/derive-sass-variable-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ async function deriveSassVariableTypes(
function deriveValueType(extractedValue) {
switch (typeof extractedValue) {
case 'object':
if (extractedValue === null) {
return ts.createKeywordTypeNode(ts.SyntaxKind.NullKeyword);
}

return ts.createTypeLiteralNode(
Object.keys(extractedValue).map(key =>
ts.createPropertySignature(
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/call_out/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default () => {
title="Callouts can be dismissed when dismissible is set to true unless the color is danger or warning. "
iconType="wrench"
dismissible
onDismissible={closeCallOut}
onDismiss={closeCallOut}
/>
);
}
Expand Down
10 changes: 10 additions & 0 deletions src-docs/src/views/color_palette/color_palette.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ const customPalettes = [
palette: ouiPaletteColorBlind({ rotations: 2 }),
code: 'ouiPaletteColorBlind({rotations: 2})',
},
{
title: 'Lots of colors, with the extremes last',
palette: ouiPaletteColorBlind({
rotations: 9,
direction: 'both',
order: 'middle-out',
}),
code:
"ouiPaletteColorBlind({ rotations: 9, direction: 'both', order: 'middle-out' })",
},
{
title:
'Series may have multiple metrics and so the colors must coordinate but be distinguishable',
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/color_palette/props_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export const qualitativePropsInfo = {
},
order: {
description:
'Order similar colors as `group`s or just `append` each variation',
'Order similar colors as `group`s, just `append` each variation (from dark to light), or append from the `middle-out`',
required: false,
type: { name: "'append' | 'group'" },
type: { name: "'append' | 'group' | 'middle-out'" },
defaultValue: { value: "'append'" },
},
direction: {
Expand Down
8 changes: 3 additions & 5 deletions src-docs/src/views/facet/facet.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import React from 'react';

import { OuiFacetButton, OuiIcon, OuiAvatar } from '../../../../src/components';
import { OuiFacetButton, OuiIcon } from '../../../../src/components';

export default () => (
<div>
Expand All @@ -29,10 +29,8 @@ export default () => (
Disabled
</OuiFacetButton>
<br />
<OuiFacetButton
quantity={6}
icon={<OuiAvatar size="s" name="Avatar Jones" />}>
Avatar as icon
<OuiFacetButton quantity={6} icon={<OuiIcon type="tokenObject" />}>
Facet with Icon example
</OuiFacetButton>
<br />
<OuiFacetButton quantity={6} isLoading>
Expand Down
11 changes: 11 additions & 0 deletions src-docs/src/views/icon/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ export const iconTypes = [
'bug',
'bullseye',
'calendar',
'chatLeft',
'chatRight',
'check',
'checkInCircleEmpty',
'checkInCircleFilled',
'cheer',
'clock',
Expand Down Expand Up @@ -124,6 +127,10 @@ export const iconTypes = [
'indexSettings',
'inputOutput',
'inspect',
'integrationGeneral',
'integrationObservability',
'integrationSearch',
'integrationSecurity',
'invert',
'ip',
'keyboardShortcut',
Expand Down Expand Up @@ -186,6 +193,7 @@ export const iconTypes = [
'questionInCircle',
'quote',
'radius',
'redeploy',
'refresh',
'reporter',
'returnKey',
Expand Down Expand Up @@ -226,10 +234,13 @@ export const iconTypes = [
'tag',
'tear',
'temperature',
'thumbsDown',
'thumbsUp',
'timeline',
'timeslider',
'training',
'trash',
'undeploy',
'unfold',
'unlink',
'user',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ exports[`OuiCallOut props color warning is rendered 1`] = `
exports[`OuiCallOut props dismissible close callout after click 1`] = `
<OuiCallOut
dismissible={true}
onDismissible={[MockFunction]}
onDismiss={[MockFunction]}
title="This is a callout"
>
<div
Expand Down
6 changes: 3 additions & 3 deletions src/components/call_out/call_out.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ describe('OuiCallOut', () => {
});

it('close callout after click', () => {
const onDismissible = jest.fn();
const onDismiss = jest.fn();
const component = mount(
<OuiCallOut
dismissible={true}
onDismissible={onDismissible}
onDismiss={onDismiss}
title="This is a callout"
/>
);
expect(component).toMatchSnapshot();
findTestSubject(component, 'closeCallOutButton').simulate('click');
expect(onDismissible).toBeCalled();
expect(onDismiss).toBeCalled();
});
});
});
Expand Down
6 changes: 3 additions & 3 deletions src/components/call_out/call_out.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export type OuiCallOutProps = CommonProps &
size?: Size;
heading?: Heading;
dismissible?: boolean;
onDismissible?: (
onDismiss?: (
event?:
| React.KeyboardEvent<HTMLDivElement>
| React.MouseEvent<HTMLButtonElement>
Expand Down Expand Up @@ -83,7 +83,7 @@ export const OuiCallOut = forwardRef<HTMLDivElement, OuiCallOutProps>(
className,
heading,
dismissible = false,
onDismissible = () => {},
onDismiss = () => {},
...rest
},
ref: Ref<HTMLDivElement>
Expand Down Expand Up @@ -114,7 +114,7 @@ export const OuiCallOut = forwardRef<HTMLDivElement, OuiCallOutProps>(
dismissibleIcon = (
<OuiButtonIcon
iconType="cross"
onClick={onDismissible}
onClick={onDismiss}
className="ouiCallOut__closeIcon"
aria-label="dismissible_icon"
data-test-subj="closeCallOutButton"
Expand Down
4 changes: 4 additions & 0 deletions src/components/collapsible_nav/_collapsible_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@
.ouiCollapsibleNav:not([class*='push']) {
z-index: $ouiZNavigation !important;
}

.ouiCollapsibleNav.ouiFlyout {
background-color: $ouiCollapsibleNavBackgroundColor;
}
Loading

0 comments on commit 0904cb9

Please sign in to comment.