Skip to content

Commit

Permalink
Merge branch 'main' into stylelint (opensearch-project#119)
Browse files Browse the repository at this point in the history
Signed-off-by: Danila Gulderov <danila@gulderov.me>
  • Loading branch information
gulderov committed Aug 24, 2023
2 parents 870a9db + 309e146 commit 8f0d289
Show file tree
Hide file tree
Showing 48 changed files with 758 additions and 107 deletions.
45 changes: 43 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ on:
- '**/*.md'

jobs:
build-lint-test:
lint-test:
runs-on: ${{ matrix.os }}
name: Build and Verify
name: Lint and Test on ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
Expand All @@ -39,3 +39,44 @@ jobs:

- name: Run unit tests
run: yarn test-unit

build:
runs-on: ubuntu-latest
name: Build on ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Setup Yarn
run: |
npm uninstall -g yarn
npm i -g yarn@1.22.10
yarn install --frozen-lockfile
- name: Build
run: yarn build

- name: Package artifacts
run: yarn pack --filename oui.tgz

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build
path: oui.tgz

- name: Build Docs
run: yarn build-docs

- name: Upload doc artifacts
uses: actions/upload-artifact@v3
with:
name: docs
path: docs/
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.20.0
18.16.0
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,23 @@
### 📈 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))
- Update next light theme primary color to #07827E ([#981](https://github.com/opensearch-project/oui/pull/981))

### 🐛 Bug Fixes

- Fix blurry text in breadcrumbs by avoiding skewing text ([#959](https://github.com/opensearch-project/oui/pull/959))

### 🚞 Infrastructure

- Add release workflows ([#134](https://github.com/opensearch-project/oui/pull/133))
- Change PR template and add changelog workflow ([#642](https://github.com/opensearch-project/oui/pull/642))
- Upgrade the backport workflow ([#862](https://github.com/opensearch-project/oui/pull/862))
- Add build steps to CI workflow ([#665](https://github.com/opensearch-project/oui/pull/665))

### 📝 Documentation

Expand All @@ -29,10 +37,14 @@

- [CVE-2023-26136] Add resolution for tough-cookie to ^4.1.3 ([#889](https://github.com/opensearch-project/oui/pull/889))
- [CVE-2023-26115] Bump word-wrap from 1.2.3 to 1.2.4 ([#891](https://github.com/opensearch-project/oui/pull/891))
- Bump Node version to 18.16.0 ([#900](https://github.com/opensearch-project/oui/pull/900))
- Bump `node-sass` to a patched version based on `libsass@3.6.5` ([#977](https://github.com/opensearch-project/oui/pull/977)); see [patch commit](https://github.com/AMoo-Miki/node-sass/commit/43c74c0966b05c1e21a1e5e20a0c467ec8e669b4) for details.
- Replace `sass-lint` with `stylelint` ([#949](https://github.com/opensearch-project/oui/pull/949))

### 🪛 Refactoring

- Clean up focus background implementation ([#962](https://github.com/opensearch-project/oui/pull/962))

### 🔩 Tests

## [`1.1.1`](https://github.com/opensearch-project/oui/tree/1.1.1)
Expand Down
4 changes: 3 additions & 1 deletion src-docs/src/components/guide_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ $elasticLogoTextDark: #1C1E23;
}
}

@include ouiHeaderAffordForFixed;
body {
@include ouiHeaderAffordForFixed;
}

.ouiBody--headerIsFixed--double {
@include ouiHeaderAffordForFixed($ouiHeaderHeightCompensation * 2);
Expand Down
3 changes: 3 additions & 0 deletions src-docs/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ import { ResizableContainerExample } from './views/resizable_container/resizable

import { ResponsiveExample } from './views/responsive/responsive_example';

import { SchemaExample } from './views/schema/schema_example';

import { SearchBarExample } from './views/search_bar/search_bar_example';

import { SelectableExample } from './views/selectable/selectable_example';
Expand Down Expand Up @@ -399,6 +401,7 @@ const navigation = [
LoadingExample,
NotificationEventExample,
ProgressExample,
SchemaExample,
StatExample,
TextExample,
TitleExample,
Expand Down
7 changes: 5 additions & 2 deletions src-docs/src/theme_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
* GitHub history for details.
*/

@import 'https://fonts.googleapis.com/css?family=Roboto+Mono:400,400i,700,700i';
@import 'https://rsms.me/inter/inter-ui.css';
/* stylelint-disable-next-line import-notation */
@import url('https://fonts.googleapis.com/css?family=Roboto+Mono:400,400i,700,700i');

/* stylelint-disable-next-line import-notation */
@import url('https://rsms.me/inter/inter-ui.css');
@import '../../src/theme_dark';
@import './components/guide_components';
@import './services/playground/index';
Expand Down
7 changes: 5 additions & 2 deletions src-docs/src/theme_light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
* GitHub history for details.
*/

@import 'https://fonts.googleapis.com/css?family=Roboto+Mono:400,400i,700,700i';
@import 'https://rsms.me/inter/inter-ui.css';
/* stylelint-disable-next-line import-notation */
@import url('https://fonts.googleapis.com/css?family=Roboto+Mono:400,400i,700,700i');

/* stylelint-disable-next-line import-notation */
@import url('https://rsms.me/inter/inter-ui.css');
@import '../../src/theme_light';
@import './components/guide_components';
@import './services/playground/index';
Expand Down
3 changes: 2 additions & 1 deletion src-docs/src/theme_next_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* GitHub history for details.
*/

@import 'https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap';
/* stylelint-disable-next-line import-notation */
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap');
@import '../../src/theme_next_dark';
@import './components/guide_components';
@import './services/playground/index';
Expand Down
3 changes: 2 additions & 1 deletion src-docs/src/theme_next_light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* GitHub history for details.
*/

@import 'https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap';
/* stylelint-disable-next-line import-notation */
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap');
@import '../../src/theme_next_light';
@import './components/guide_components';
@import './services/playground/index';
Expand Down
3 changes: 1 addition & 2 deletions src-docs/src/views/guidelines/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,8 @@
background-color: $ouiColorEmptyShade;
}

/* stylelint-disable no-invalid-position-at-import-rule */
/* stylelint-disable-next-line no-invalid-position-at-import-rule */
@import 'colors/color_section';
/* stylelint-enable no-invalid-position-at-import-rule */

@include ouiBreakpoint('xl') {
.guideSass__breakpointExample {
Expand Down
142 changes: 142 additions & 0 deletions src-docs/src/views/schema/schema.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import React from 'react';

import { OuiSchemaItem } from '../../../../src/components/schema';
import { OuiSpacer } from '../../../../src/components/spacer';

export default () => (
<>
<OuiSchemaItem label="Simple" />
<OuiSchemaItem iconType="tokenString" label="Simple with icon" />
<OuiSchemaItem
iconType="tokenShape"
label="Icon and actions"
actions={[
{
iconType: 'trash',
'aria-label': 'Delete',
onClick: () => {},
color: 'danger',
},
{
iconType: 'pencil',
'aria-label': 'Edit',
onClick: () => {},
tooltip: {
content: 'Edit',
position: 'top',
delay: 'long',
},
},
]}
/>
<OuiSchemaItem
iconType="tokenShape"
label="Compressed with icon and actions"
actions={[
{
iconType: 'trash',
'aria-label': 'Delete',
onClick: () => {},
color: 'danger',
},
{
iconType: 'pencil',
'aria-label': 'Edit',
onClick: () => {},
tooltip: {
content: 'Edit',
position: 'top',
delay: 'long',
},
},
]}
compressed
/>
<OuiSpacer />
<OuiSchemaItem
iconType="tokenShape"
label="With a panel"
actions={[
{
iconType: 'trash',
'aria-label': 'Delete',
onClick: () => {},
color: 'danger',
},
{
iconType: 'pencil',
'aria-label': 'Edit',
onClick: () => {},
tooltip: {
content: 'Edit',
position: 'top',
delay: 'long',
},
},
]}
withPanel
/>
<OuiSpacer />
<OuiSchemaItem
iconType="tokenShape"
label="With a panel and compressed"
actions={[
{
iconType: 'trash',
'aria-label': 'Delete',
onClick: () => {},
color: 'danger',
},
{
iconType: 'pencil',
'aria-label': 'Edit',
onClick: () => {},
tooltip: {
content: 'Edit',
position: 'top',
delay: 'long',
},
},
]}
withPanel
compressed
/>
<OuiSpacer />
<div style={{ width: '300px' }}>
<OuiSchemaItem
iconType="tokenShape"
label="A very long label that will wrap with a panel for good measure"
actions={[
{
iconType: 'trash',
'aria-label': 'Delete',
onClick: () => {},
color: 'danger',
},
{
iconType: 'pencil',
'aria-label': 'Edit',
onClick: () => {},
tooltip: {
content: 'Edit',
position: 'top',
delay: 'long',
},
},
]}
withPanel
/>
</div>
</>
);
Loading

0 comments on commit 8f0d289

Please sign in to comment.