Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/gravity-ui/uikit into timof…
Browse files Browse the repository at this point in the history
…eyevvv/readme_corrections_from_loc_team
  • Loading branch information
vvtimofeev committed Dec 5, 2024
2 parents bad9304 + d6cb1cf commit 0286477
Show file tree
Hide file tree
Showing 86 changed files with 3,620 additions and 102 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"import/no-extraneous-dependencies": "off",
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"@typescript-eslint/prefer-ts-expect-error": "error",
"@typescript-eslint/consistent-type-imports": ["error", {"prefer": "type-imports", "fixStyle": "separate-type-imports"}]
"@typescript-eslint/consistent-type-imports": ["error", {"prefer": "type-imports", "fixStyle": "separate-type-imports"}],
"complexity": "off"
},
"overrides": [
{
Expand Down
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
# Changelog

## [6.37.0](https://github.com/gravity-ui/uikit/compare/v6.36.0...v6.37.0) (2024-11-27)


### Features

* **Breadcrunbs:** allow items to be disabled independently ([#1962](https://github.com/gravity-ui/uikit/issues/1962)) ([301e4ab](https://github.com/gravity-ui/uikit/commit/301e4ab365639188e010390d5b19da1df13d75fa))
* **Select:** new label and value resize behaviour ([#1896](https://github.com/gravity-ui/uikit/issues/1896)) ([2be5eb8](https://github.com/gravity-ui/uikit/commit/2be5eb8dc21679154bbb924af5e1e1eefa8a7a58))

## [6.36.0](https://github.com/gravity-ui/uikit/compare/v6.35.2...v6.36.0) (2024-11-25)


### Features

* **PasswordInput:** add component ([#1745](https://github.com/gravity-ui/uikit/issues/1745)) ([2e7f2c7](https://github.com/gravity-ui/uikit/commit/2e7f2c731c8cb2fd08993fc30ffed8b06a5f0ea2))


### Bug Fixes

* **Select:** do not reserve space for clear if empty ([#1956](https://github.com/gravity-ui/uikit/issues/1956)) ([11dd537](https://github.com/gravity-ui/uikit/commit/11dd537feaa230133f8051fd6c370e6e3ec7d54f))
* **Toc:** correctly display content of no items.length and add event forward ([#1939](https://github.com/gravity-ui/uikit/issues/1939)) ([8d456c3](https://github.com/gravity-ui/uikit/commit/8d456c3d77d63674f20ebac82913d8a26c14f997))

## [6.35.2](https://github.com/gravity-ui/uikit/compare/v6.35.1...v6.35.2) (2024-11-14)


### Bug Fixes

* **PlaceholderContainer:** remove href attribute fallback in actions ([#1947](https://github.com/gravity-ui/uikit/issues/1947)) ([60a8b92](https://github.com/gravity-ui/uikit/commit/60a8b9240b51d78f0aa5e711a6bed8e30e049814))
* **useBodyScrollLock:** correctly restore styles ([#1950](https://github.com/gravity-ui/uikit/issues/1950)) ([b41a53a](https://github.com/gravity-ui/uikit/commit/b41a53a477d479b925331bbc227862942da04d00))

## [6.35.1](https://github.com/gravity-ui/uikit/compare/v6.35.0...v6.35.1) (2024-11-13)


### Bug Fixes

* fix incorrect scss "use" ([#1943](https://github.com/gravity-ui/uikit/issues/1943)) ([c9506dd](https://github.com/gravity-ui/uikit/commit/c9506dd5cfb78f155ea4e38f09e060233c4f691b))

## [6.35.0](https://github.com/gravity-ui/uikit/compare/v6.34.0...v6.35.0) (2024-11-11)


### Features

* **FilePreview:** add component ([#1880](https://github.com/gravity-ui/uikit/issues/1880)) ([b5de671](https://github.com/gravity-ui/uikit/commit/b5de67126a76467853957df6d8e5436cc460886e))
* **NumberInput:** add new component ([#1826](https://github.com/gravity-ui/uikit/issues/1826)) ([75be05e](https://github.com/gravity-ui/uikit/commit/75be05e42c95226592cdd2139894e9ff791280af))
* **PlaceholderContainer:** add qa prop ([#1925](https://github.com/gravity-ui/uikit/issues/1925)) ([77ad28d](https://github.com/gravity-ui/uikit/commit/77ad28d8aa0af910999e0ed54fce806767241946))


### Bug Fixes

* **PlaceholderContainer:** add component to index file ([#1924](https://github.com/gravity-ui/uikit/issues/1924)) ([cdce171](https://github.com/gravity-ui/uikit/commit/cdce1715a6fe5ceebff7b43c9146c3c1bef9f093))
* **Popover:** use visible title for popup a11y label ([#1941](https://github.com/gravity-ui/uikit/issues/1941)) ([f9d75e8](https://github.com/gravity-ui/uikit/commit/f9d75e8b1d902fd526b4a089d7bf6675299f2584))
* **Toaster:** reveal animation lag ([#1927](https://github.com/gravity-ui/uikit/issues/1927)) ([e16fa1c](https://github.com/gravity-ui/uikit/commit/e16fa1ccc7e1f053f4ff696d24ee6d4bbfd35a6a))

## [6.34.0](https://github.com/gravity-ui/uikit/compare/v6.33.0...v6.34.0) (2024-10-25)


Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/src/components/Disclosure @Raubzeug
/src/components/Divider @v4dyar4
/src/components/DropdownMenu @axtk
/src/components/FilePreview @mournfulCoroner
/src/components/HelpMark @Raubzeug
/src/components/Hotkey @d3m1d0v
/src/components/Icon @amje
Expand Down
14 changes: 12 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,23 @@ task('copy-i18n', () => {

task('styles-global', () => {
return src(['styles/styles.scss', 'styles/fonts.scss'])
.pipe(sass().on('error', sass.logError))
.pipe(
sass().on('error', function (error) {
sass.logError.call(this, error);
process.exit(1);
}),
)
.pipe(dest('styles'));
});

task('styles-components', () => {
return src(['src/components/**/*.scss', '!src/components/**/__stories__/**/*'])
.pipe(sass().on('error', sass.logError))
.pipe(
sass().on('error', function (error) {
sass.logError.call(this, error);
process.exit(1);
}),
)
.pipe(dest(path.resolve(BUILD_DIR, 'esm', 'components')))
.pipe(dest(path.resolve(BUILD_DIR, 'cjs', 'components')));
});
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gravity-ui/uikit",
"version": "6.34.0",
"version": "6.37.0",
"description": "Gravity UI base styling and components",
"keywords": [
"component",
Expand Down
30 changes: 15 additions & 15 deletions src/components/Alert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,18 @@ LANDING_BLOCK-->

## Properties

| Name | Description | Type | Default |
| :-------- | :------------------------------------------------------------------------------ | :----------------------------------------------------------------: | :----------: |
| theme | Alert appearance | `"normal"` `"info"` `"success"` `"warning"` `"danger"` `"utility"` | `"normal"` |
| view | Enables or disables the background color of the alert | `"filled"` `"outlined"` | `"filled"` |
| layout | Used to direct users to content if there is an `actions` property with buttons. | `"vertical"` `"horizontal"` | `"vertical"` |
| corners | Used for rounded or square corners of the alert window | `"rounded"` `"square"` | `"rounded"` |
| title | Alert title | `string` | |
| message | Alert message | `string` | |
| onClose | Callback function called when a user clicks the alert's close button | `Function` | |
| actions | Array of buttons or full custom components | `React.ReactNode` `"AlertAction"` | |
| align | Determines how the content inside the `Alert` component is vertically aligned | `"center"` `"baseline"` | `"baseline"` |
| style | HTML style attribute | `React.CSSProperties` | |
| className | Name of the alert class | `string` | |
| icon | Overrides default icon | `React.ReactNode` | |
| qa | `data-qa` HTML attribute, used for testing | `string` | |
| Name | Description | Type | Default |
| :-------- | :-------------------------------------------------------------------------- | :----------------------------------------------------------------: | :----------: |
| theme | Alert appearance | `"normal"` `"info"` `"success"` `"warning"` `"danger"` `"utility"` | `"normal"` |
| view | Enable/disable background color of the alert | `"filled"` `"outlined"` | `"filled"` |
| layout | Used to direct users to content if there is property `actions` with buttons | `"vertical"` `"horizontal"` | `"vertical"` |
| corners | Used for round/square corners of the alert window | `"rounded"` `"square"` | `"rounded"` |
| title | Title of the alert | `string` | |
| message | Message of the alert | `React.ReactNode` | |
| onClose | A callback function called when the user clicks the alert's close button | `Function` | |
| actions | Array of buttons or full custom components | `React.ReactNode` `"AlertAction"` | |
| align | Determines how content inside the Alert component is vertically aligned | `"center"` `"baseline"` | `"baseline"` |
| style | HTML style attribute | `React.CSSProperties` | |
| className | Name of alert class | `string` | |
| icon | Override default icon | `React.ReactNode` | |
| qa | HTML `data-qa` attribute, used in tests. | `string` | |
1 change: 0 additions & 1 deletion src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ const isButtonIconComponent = isOfType(ButtonIcon);
const isSpan = isOfType<{className?: string}>('span');
const buttonIconClassRe = RegExp(`^${b('icon')}($|\\s+\\w)`);

// eslint-disable-next-line complexity
function prepareChildren(children: React.ReactNode) {
const items = React.Children.toArray(children);

Expand Down
148 changes: 148 additions & 0 deletions src/components/FilePreview/FilePreview.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
@use 'sass:math';
@use '../variables';

$block: '.#{variables.$ns}file-preview';

$smallRoundedButtonSize: 24px;

#{$block} {
--_-box-shadow: none;
--_-border-radius: 4px;
--_-color-base-background: transparent;

position: relative;

width: 120px;

&:hover,
&:focus-within {
#{$block}__actions:not(#{$block}__actions_hide) {
opacity: 1;
}

--_-color-base-background: var(--g-color-base-simple-hover, rgba(0, 0, 0, 0.05));
}

&__actions {
position: absolute;
inset-block-start: -1 * math.div($smallRoundedButtonSize, 2);
inset-inline-end: -1 * math.div($smallRoundedButtonSize, 2);
z-index: 1;

display: flex;
gap: 4px;

opacity: 0;
}

&:hover {
--_-color-base-background: var(--g-color-base-simple-hover);
}

&__card {
display: flex;
flex-direction: column;
align-items: center;

position: relative;
outline: none;

box-shadow: var(--gc-card-box-shadow);
border-radius: var(--_-border-radius);
padding: 4px 10px;

&_clickable {
cursor: pointer;
}

&_hoverable {
background-color: var(--_-color-base-background);
}

&::after {
position: absolute;
inset: 0;
border-radius: var(--_-border-radius);
pointer-events: none;
}

&:hover {
--_-box-shadow: 0px 3px 10px var(--g-color-sfx-shadow);
}

&:focus::after {
content: '';
box-shadow: 0 0 0 2px var(--g-color-line-misc);
}

&:focus:not(:focus-visible)::after {
box-shadow: none;
}
}

&__icon {
display: flex;
justify-content: center;
align-items: center;

border-radius: 4px;
background-color: var(--g-color-base-generic-medium);

height: 40px;
width: 40px;

&-svg {
color: var(--g-color-base-background);
}

&_type {
&_image,
&_video,
&_code,
&_archive,
&_music {
background-color: var(--g-color-base-misc-heavy);
}
&_text {
background-color: var(--g-color-base-info-heavy);
}
&_pdf {
background-color: var(--g-color-base-danger-medium);
}
&_table {
background-color: var(--g-color-base-positive-medium);
}
}
}

&__name {
margin-block-start: 4px;
}

&__name,
&__description {
text-align: center;
width: 100%;
}

&__image-container {
position: relative;

border-radius: 4px;
overflow: hidden;

height: 64px;
width: 96px;
}

&-image {
position: absolute;
inset-block-start: 0;
inset-inline-start: 0;

object-fit: cover;

height: 100%;
width: 100%;
}
}
Loading

0 comments on commit 0286477

Please sign in to comment.