@skbkontur/icons 1.11.0-support-shadow-dom.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/esm/helpers/forwardRef.d.ts +2 -1
- package/esm/helpers/types.d.ts +12 -0
- package/esm/helpers/types.js +0 -0
- package/esm/internal/Icon.d.ts +8 -3
- package/helpers/forwardRef.d.ts +2 -1
- package/helpers/types.d.ts +12 -0
- package/helpers/types.js +2 -0
- package/internal/Icon.d.ts +8 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.11.0](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/icons@1.10.0...@skbkontur/icons@1.11.0) (2024-08-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **icons:** styles work in widgets ([ddbb157](https://git.skbkontur.ru/ui/ui-parking/commits/ddbb15740c14f43286b72082c7073dd2077ccfda))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [1.10.0](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/icons@1.9.0...@skbkontur/icons@1.10.0) (2024-05-20)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { ForwardRefRenderFunction } from './types';
|
|
2
3
|
export interface ReactUIComponentWithRef<T, P> extends React.NamedExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>, Pick<React.ForwardRefExoticComponent<P>, 'propTypes'> {
|
|
3
4
|
__KONTUR_REACT_UI__: string;
|
|
4
5
|
__KONTUR_ICON__: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare function forwardRef<ElementType, Props>(name: string, render:
|
|
7
|
+
export declare function forwardRef<ElementType, Props>(name: string, render: ForwardRefRenderFunction<ElementType, Props>): ReactUIComponentWithRef<ElementType, Props>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
interface MutableRefObject<T> {
|
|
3
|
+
current: T;
|
|
4
|
+
}
|
|
5
|
+
declare type ForwardedRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null;
|
|
6
|
+
export interface ForwardRefRenderFunction<T, P = {}> {
|
|
7
|
+
(props: P, ref: ForwardedRef<T>): ReactElement | null;
|
|
8
|
+
displayName?: string | undefined;
|
|
9
|
+
defaultProps?: never | undefined;
|
|
10
|
+
propTypes?: never | undefined;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
File without changes
|
package/esm/internal/Icon.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React, { AllHTMLAttributes, AriaAttributes } from 'react';
|
|
2
|
+
import { BaseIconProps as BaseIconPropsWithoutRef, BaseIconRefType } from './BaseIcon';
|
|
3
|
+
import type { ReactUIComponentWithRef } from '../helpers/forwardRef';
|
|
2
4
|
export declare const breakpoints: readonly [16, 20, 24, 32, 64];
|
|
3
5
|
export declare const weights: readonly ["light", "regular", "solid"];
|
|
4
6
|
export declare const MAX_LIGHT_POSITION = 1;
|
|
@@ -8,9 +10,9 @@ export declare type IconName = string;
|
|
|
8
10
|
export declare type IconSize = typeof breakpoints[number];
|
|
9
11
|
export declare type IconWeight = typeof weights[number];
|
|
10
12
|
export declare type IconSizes = Record<number, {
|
|
11
|
-
light?:
|
|
12
|
-
regular:
|
|
13
|
-
solid?:
|
|
13
|
+
light?: ReactUIComponentWithRef<SVGSVGElement, BaseIconProps>;
|
|
14
|
+
regular: ReactUIComponentWithRef<SVGSVGElement, BaseIconProps>;
|
|
15
|
+
solid?: ReactUIComponentWithRef<SVGSVGElement, BaseIconProps>;
|
|
14
16
|
}>;
|
|
15
17
|
interface IconInterface {
|
|
16
18
|
sizes: IconSizes;
|
|
@@ -21,6 +23,9 @@ export interface IconProps extends React.SVGAttributes<SVGElement>, Pick<AllHTML
|
|
|
21
23
|
color?: string;
|
|
22
24
|
align?: 'center' | 'baseline' | 'none';
|
|
23
25
|
}
|
|
26
|
+
interface BaseIconProps extends BaseIconPropsWithoutRef {
|
|
27
|
+
ref: React.Ref<BaseIconRefType>;
|
|
28
|
+
}
|
|
24
29
|
export declare const DEFAULT_ICON_SIZE: IconSize;
|
|
25
30
|
export declare const DEFAULT_ICON_WEIGHT: IconWeight;
|
|
26
31
|
export declare const IconDataTids: {
|
package/helpers/forwardRef.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { ForwardRefRenderFunction } from './types';
|
|
2
3
|
export interface ReactUIComponentWithRef<T, P> extends React.NamedExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>, Pick<React.ForwardRefExoticComponent<P>, 'propTypes'> {
|
|
3
4
|
__KONTUR_REACT_UI__: string;
|
|
4
5
|
__KONTUR_ICON__: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare function forwardRef<ElementType, Props>(name: string, render:
|
|
7
|
+
export declare function forwardRef<ElementType, Props>(name: string, render: ForwardRefRenderFunction<ElementType, Props>): ReactUIComponentWithRef<ElementType, Props>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
interface MutableRefObject<T> {
|
|
3
|
+
current: T;
|
|
4
|
+
}
|
|
5
|
+
declare type ForwardedRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null;
|
|
6
|
+
export interface ForwardRefRenderFunction<T, P = {}> {
|
|
7
|
+
(props: P, ref: ForwardedRef<T>): ReactElement | null;
|
|
8
|
+
displayName?: string | undefined;
|
|
9
|
+
defaultProps?: never | undefined;
|
|
10
|
+
propTypes?: never | undefined;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
package/helpers/types.js
ADDED
package/internal/Icon.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React, { AllHTMLAttributes, AriaAttributes } from 'react';
|
|
2
|
+
import { BaseIconProps as BaseIconPropsWithoutRef, BaseIconRefType } from './BaseIcon';
|
|
3
|
+
import type { ReactUIComponentWithRef } from '../helpers/forwardRef';
|
|
2
4
|
export declare const breakpoints: readonly [16, 20, 24, 32, 64];
|
|
3
5
|
export declare const weights: readonly ["light", "regular", "solid"];
|
|
4
6
|
export declare const MAX_LIGHT_POSITION = 1;
|
|
@@ -8,9 +10,9 @@ export declare type IconName = string;
|
|
|
8
10
|
export declare type IconSize = typeof breakpoints[number];
|
|
9
11
|
export declare type IconWeight = typeof weights[number];
|
|
10
12
|
export declare type IconSizes = Record<number, {
|
|
11
|
-
light?:
|
|
12
|
-
regular:
|
|
13
|
-
solid?:
|
|
13
|
+
light?: ReactUIComponentWithRef<SVGSVGElement, BaseIconProps>;
|
|
14
|
+
regular: ReactUIComponentWithRef<SVGSVGElement, BaseIconProps>;
|
|
15
|
+
solid?: ReactUIComponentWithRef<SVGSVGElement, BaseIconProps>;
|
|
14
16
|
}>;
|
|
15
17
|
interface IconInterface {
|
|
16
18
|
sizes: IconSizes;
|
|
@@ -21,6 +23,9 @@ export interface IconProps extends React.SVGAttributes<SVGElement>, Pick<AllHTML
|
|
|
21
23
|
color?: string;
|
|
22
24
|
align?: 'center' | 'baseline' | 'none';
|
|
23
25
|
}
|
|
26
|
+
interface BaseIconProps extends BaseIconPropsWithoutRef {
|
|
27
|
+
ref: React.Ref<BaseIconRefType>;
|
|
28
|
+
}
|
|
24
29
|
export declare const DEFAULT_ICON_SIZE: IconSize;
|
|
25
30
|
export declare const DEFAULT_ICON_WEIGHT: IconWeight;
|
|
26
31
|
export declare const IconDataTids: {
|