diff --git a/packages/pure-input/CHANGELOG.md b/packages/pure-input/CHANGELOG.md deleted file mode 100644 index 4f0c9c8799..0000000000 --- a/packages/pure-input/CHANGELOG.md +++ /dev/null @@ -1,165 +0,0 @@ -# Change Log - -## 5.1.0 - -### Minor Changes - -### [#713](https://github.com/core-ds/core-components/pull/713) - -- Теперь каждый пакет публикуется с исходниками - -## 5.0.7 - -### Patch Changes - -### [#766](https://github.com/core-ds/core-components/pull/766) - -- Удален скрипт отправки статистики (send-stats) - -## 5.0.6 - -### Patch Changes - -### [#676](https://github.com/core-ds/core-components/pull/676) - -- Обновлена зависимость @alfalab/hooks - -## 5.0.5 - -### Patch Changes - -### [#588](https://github.com/core-ds/core-components/pull/588) - -- Добавлен \_\_esModule в cjs экспорт - -## 5.0.4 - -### Patch Changes - -### [#526](https://github.com/core-ds/core-components/pull/526) - -- В зависимости добавлена библиотека tslib - -## 5.0.3 - -### Patch Changes - -### [#418](https://github.com/core-ds/core-components/pull/418) - -- Исправлена проблема с default-импортом в cjs форматах - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [5.0.2](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@5.0.1...@alfalab/core-components-pure-input@5.0.2) (2022-08-31) - -### Bug Fixes - -- fixed missing css vars ([#227](https://github.com/core-ds/core-components/issues/227)) ([42912d3](https://github.com/core-ds/core-components/commit/42912d306657490e8c7f577cb53120767d503fcb)) - -## [5.0.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@5.0.0...@alfalab/core-components-pure-input@5.0.1) (2022-08-19) - -### Bug Fixes - -- omit enterKeyHint prop ([#197](https://github.com/core-ds/core-components/issues/197)) ([72f4946](https://github.com/core-ds/core-components/commit/72f494623c282f61b45539fa1c13d5c45bc5180c)) - -# [5.0.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@4.2.1...@alfalab/core-components-pure-input@5.0.0) (2022-08-17) - -### Features - -- removed dist directory in published packages ([#200](https://github.com/core-ds/core-components/issues/200)) ([8af8fee](https://github.com/core-ds/core-components/commit/8af8fee53ca0bd19fa2d1ca1422e0df23096e2c8)) - -### BREAKING CHANGES - -- Изменена директория расположения индексных файлов в опубликованных пакетах (удалена - директория dist) - -Co-authored-by: Vladimir Gevak - -## [4.2.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@4.2.0...@alfalab/core-components-pure-input@4.2.1) (2022-08-17) - -### Bug Fixes - -- returned dist directory ([#199](https://github.com/core-ds/core-components/issues/199)) ([fabc15e](https://github.com/core-ds/core-components/commit/fabc15effa1457ca65ec7238206f1b1fc2a2a613)) - -# [4.2.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@4.1.3...@alfalab/core-components-pure-input@4.2.0) (2022-08-04) - -### Features - -- react 18 support ([#159](https://github.com/core-ds/core-components/issues/159)) ([2e6693c](https://github.com/core-ds/core-components/commit/2e6693c62f534e333aadb7d3fff4ffd78ac84c63)) - -## [4.1.3](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@4.1.2...@alfalab/core-components-pure-input@4.1.3) (2022-07-18) - -**Note:** Version bump only for package @alfalab/core-components-pure-input - -## [4.1.2](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@4.1.1...@alfalab/core-components-pure-input@4.1.2) (2022-07-15) - -### Bug Fixes - -- bump packages version ([#153](https://github.com/core-ds/core-components/issues/153)) ([fd3e082](https://github.com/core-ds/core-components/commit/fd3e08205672129cdce04e1000c673f2cd9c10da)) - -## [4.1.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@4.1.0...@alfalab/core-components-pure-input@4.1.1) (2022-07-14) - -**Note:** Version bump only for package @alfalab/core-components-pure-input - -# [4.1.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@4.0.5...@alfalab/core-components-pure-input@4.1.0) (2022-06-28) - -### Features - -- circumflexus retrieval ([#57](https://github.com/core-ds/core-components/issues/57)) ([3820da8](https://github.com/core-ds/core-components/commit/3820da818bcdcbee6904c648b3e29c3c828fe202)) - -## [4.0.3](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@4.0.2...@alfalab/core-components-pure-input@4.0.3) (2021-12-08) - -### Bug Fixes - -- актуализируем @alfalab/utils ([#897](https://github.com/core-ds/core-components/issues/897)) ([30fb88e](https://github.com/core-ds/core-components/commit/30fb88eee36f68cabf80069e5125d911fabde4a5)) - -## [4.0.2](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@4.0.1...@alfalab/core-components-pure-input@4.0.2) (2021-08-31) - -### Bug Fixes - -- **textarea:** missing vars ([#817](https://github.com/core-ds/core-components/issues/817)) ([d03231f](https://github.com/core-ds/core-components/commit/d03231f24c826f540ecc8c6ddeb2b3e3fec38b6a)) - -## [4.0.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@4.0.0...@alfalab/core-components-pure-input@4.0.1) (2021-07-09) - -**Note:** Version bump only for package @alfalab/core-components-pure-input - -# [4.0.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@3.0.6...@alfalab/core-components-pure-input@4.0.0) (2021-07-08) - -### Features - -- upgrade storybook ([#696](https://github.com/core-ds/core-components/issues/696)) - -## [3.0.6](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@3.0.5...@alfalab/core-components-pure-input@3.0.6) (2021-04-26) - -**Note:** Version bump only for package @alfalab/core-components-pure-input - -## [3.0.5](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@3.0.3...@alfalab/core-components-pure-input@3.0.5) (2021-03-18) - -### Bug Fixes - -- one more sborka bug ([#579](https://github.com/core-ds/core-components/issues/579)) ([9fbe0be](https://github.com/core-ds/core-components/commit/9fbe0beca56ec5971de78b3f6cda25305b260efc)) - -## [3.0.3](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@3.0.1...@alfalab/core-components-pure-input@3.0.3) (2021-03-16) - -### Bug Fixes - -- border-radius in packages ([781749e](https://github.com/core-ds/core-components/commit/781749ef38aefd5a6707ac56d2e297dce9f3e073)) - -## [3.0.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@3.0.0...@alfalab/core-components-pure-input@3.0.1) (2021-03-14) - -**Note:** Version bump only for package @alfalab/core-components-pure-input - -# [3.0.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@2.0.1...@alfalab/core-components-pure-input@3.0.0) (2021-03-04) - -### Features - -- **pure-input:** changed size L (72 → 64), added size XL (72) ([af4cfb5](https://github.com/core-ds/core-components/commit/af4cfb515a25c6dcae32a7e2a0730fe4f9e6e791)) - -### BREAKING CHANGES - -- **pure-input:** size L changed to size XL - -## [2.0.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-pure-input@2.0.0...@alfalab/core-components-pure-input@2.0.1) (2021-03-03) - -**Note:** Version bump only for package @alfalab/core-components-pure-input diff --git a/packages/pure-input/package.json b/packages/pure-input/package.json deleted file mode 100644 index b99c70498d..0000000000 --- a/packages/pure-input/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@alfalab/core-components-pure-input", - "version": "5.1.0", - "description": "", - "keywords": [], - "license": "MIT", - "main": "index.js", - "module": "./esm/index.js", - "publishConfig": { - "access": "public", - "directory": "dist" - }, - "peerDependencies": { - "react": "^16.9.0 || ^17.0.1 || ^18.0.0" - }, - "dependencies": { - "@alfalab/hooks": "^1.13.0", - "classnames": "^2.3.1", - "react-merge-refs": "^1.1.0", - "tslib": "^2.4.0" - } -} diff --git a/packages/pure-input/src/Component.test.tsx b/packages/pure-input/src/Component.test.tsx deleted file mode 100644 index 0d835a244e..0000000000 --- a/packages/pure-input/src/Component.test.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import React from 'react'; -import { render } from '@testing-library/react'; - -import { PureInput } from './index'; - -describe('PureInput', () => { - describe('Snapshots tests', () => { - it('should match snapshot', () => { - expect(render()).toMatchSnapshot(); - }); - }); - - describe('Attributes tests', () => { - it('should set `data-test-id` atribute', () => { - const dataTestId = 'test-id'; - const { getByTestId } = render(); - - expect(getByTestId(dataTestId).tagName).toBe('INPUT'); - }); - }); - - describe('Classes tests', () => { - it('should set `className` class', () => { - const className = 'test-class'; - const { container } = render(); - - expect(container.firstElementChild).toHaveClass(className); - }); - - it('should set `size` class', () => { - const size = 'm'; - const { container } = render(); - - expect(container.firstElementChild).toHaveClass(size); - }); - - it('should set `block` class', () => { - const { container } = render(); - - expect(container.firstElementChild).toHaveClass('block'); - }); - }); - - it('should unmount without errors', () => { - const { unmount } = render(); - - expect(unmount).not.toThrowError(); - }); -}); diff --git a/packages/pure-input/src/Component.tsx b/packages/pure-input/src/Component.tsx deleted file mode 100644 index 19cf1abe5b..0000000000 --- a/packages/pure-input/src/Component.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import React, { InputHTMLAttributes, useRef } from 'react'; -import mergeRefs from 'react-merge-refs'; -import cn from 'classnames'; - -import { useFocus } from '@alfalab/hooks'; - -import styles from './index.module.css'; - -export type PureInputProps = Omit< - InputHTMLAttributes, - 'size' | 'type' | 'enterKeyHint' -> & { - /** - * Растягивает компонент на ширину контейнера - */ - block?: boolean; - - /** - * Атрибут type - */ - type?: 'number' | 'card' | 'email' | 'hidden' | 'money' | 'password' | 'tel' | 'text'; - - /** - * Размер компонента - */ - size?: 's' | 'm' | 'l' | 'xl'; - - /** - * Дополнительный класс - */ - className?: string; - - /** - * Идентификатор для систем автоматизированного тестирования - */ - dataTestId?: string; -}; - -export const PureInput = React.forwardRef( - ({ size = 's', type = 'text', block = false, className, dataTestId, ...restProps }, ref) => { - const inputRef = useRef(null); - - const [focusVisible] = useFocus(inputRef, 'keyboard'); - - return ( - - ); - }, -); - -/** - * Для отображения в сторибуке - */ -PureInput.defaultProps = { - size: 's', - type: 'text', - block: false, -}; diff --git a/packages/pure-input/src/__snapshots__/Component.test.tsx.snap b/packages/pure-input/src/__snapshots__/Component.test.tsx.snap deleted file mode 100644 index ce253af99d..0000000000 --- a/packages/pure-input/src/__snapshots__/Component.test.tsx.snap +++ /dev/null @@ -1,74 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`PureInput Snapshots tests should match snapshot 1`] = ` -Object { - "asFragment": [Function], - "baseElement": -
- -
- , - "container":
- -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; diff --git a/packages/pure-input/src/docs/Component.stories.mdx b/packages/pure-input/src/docs/Component.stories.mdx deleted file mode 100644 index a35d8dfb30..0000000000 --- a/packages/pure-input/src/docs/Component.stories.mdx +++ /dev/null @@ -1,45 +0,0 @@ -import { Meta, Story, ArgsTable, Markdown } from '@storybook/addon-docs'; -import { text, select, boolean } from '@storybook/addon-knobs'; -import { ComponentHeader, Tabs } from 'storybook/blocks'; -import { PureInput } from '@alfalab/core-components-pure-input'; - -import { PureInput as PureInputTS } from '../Component'; -import packageJson from '../../package.json'; -import Description from './description.mdx'; -import Changelog from '../../CHANGELOG.md?raw'; - - - -{/* Canvas */} - - - - - -{/* Docs */} - - - -```jsx -import { PureInput } from '@alfalab/core-components/pure-input'; -``` - -} - changelog={{Changelog}} - props={} -/> diff --git a/packages/pure-input/src/docs/description.mdx b/packages/pure-input/src/docs/description.mdx deleted file mode 100644 index a242e45f20..0000000000 --- a/packages/pure-input/src/docs/description.mdx +++ /dev/null @@ -1,5 +0,0 @@ -Компонент, представляющий из себя стилизованный нативный `input`. - -```jsx live - -``` diff --git a/packages/pure-input/src/index.module.css b/packages/pure-input/src/index.module.css deleted file mode 100644 index d10f7c2025..0000000000 --- a/packages/pure-input/src/index.module.css +++ /dev/null @@ -1,92 +0,0 @@ -@import '../../themes/src/default.css'; -@import '../../input/src/components/base-input/default.module.css'; -@import '../../form-control/src/vars.css'; - -.component { - @mixin paragraph_component; - - display: inline-flex; - box-sizing: border-box; - color: var(--input-color); - background-color: var(--form-control-bg-color); - border-radius: var(--form-control-border-radius); - transition: background 0.2s ease, box-shadow 0.2s ease, border 0.2s ease, color 0.2s ease; - border: none; - margin: 0; - padding: var(--form-control-paddings); - padding-top: 1px; - border-bottom: var(--form-control-border-bottom); - outline: none; - text-overflow: ellipsis; - -webkit-appearance: none; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -} - -.component::placeholder { - text-overflow: ellipsis; - color: var(--input-placeholder-color); - transition: color 0.2s ease; -} - -.block { - width: 100%; -} - -/* SIZE */ - -.s { - height: var(--form-control-s-min-height); -} - -.m { - height: var(--form-control-m-min-height); -} - -.l { - height: var(--form-control-l-min-height); - padding: var(--form-control-paddings); - padding-top: 1px; -} - -.xl { - height: var(--form-control-xl-min-height); - padding: var(--form-control-xl-paddings); - padding-top: 1px; -} - -/* DISABLED STATE */ - -.component:disabled { - cursor: var(--disabled-cursor); - color: var(--input-disabled-color); - border-bottom: var(--form-control-disabled-border-bottom); - background-color: var(--form-control-disabled-bg-color); -} - -/* FOCUS STATE */ - -.component:not(:disabled):focus { - border-bottom: var(--form-control-focus-border-bottom); - - &::placeholder { - color: var(--input-focus-placeholder-color); - } -} - -.focusVisible { - @mixin focus-outline; -} - -/* HOVER STATE */ - -.component:not(:disabled):hover { - background-color: var(--form-control-hover-bg-color); -} - -/* IE hide clear */ - -.component::-ms-clear { - display: none; - width: 0; - height: 0; -} diff --git a/packages/pure-input/src/index.ts b/packages/pure-input/src/index.ts deleted file mode 100644 index e51a5d2440..0000000000 --- a/packages/pure-input/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Component'; diff --git a/packages/pure-input/tsconfig.json b/packages/pure-input/tsconfig.json deleted file mode 100644 index fee37a72ff..0000000000 --- a/packages/pure-input/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "include": ["src", "../../typings"], - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDirs": ["src"] - } -}