@automattic/jetpack-components 5.0.1 → 6.1.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 +31 -0
- package/build/components/admin-page/index.d.ts +1 -0
- package/build/components/admin-page/index.js +10 -4
- package/build/components/admin-page/page-action-button.d.ts +5 -0
- package/build/components/admin-page/page-action-button.js +44 -0
- package/build/components/admin-page/types.d.ts +4 -0
- package/build/components/automattic-icon-logo/index.d.ts +4 -2
- package/build/components/automattic-icon-logo/index.js +6 -4
- package/build/components/boost-score-bar/index.js +7 -7
- package/build/components/checkbox-card/style.scss +10 -38
- package/build/components/jetpack-footer/index.d.ts +1 -18
- package/build/components/jetpack-footer/index.js +1 -39
- package/build/components/jetpack-footer/jetpack-footer.d.ts +18 -0
- package/build/components/jetpack-footer/jetpack-footer.js +39 -0
- package/build/components/period-selector/index.d.ts +9 -0
- package/build/components/period-selector/index.js +21 -0
- package/build/components/period-selector/types.d.ts +28 -0
- package/build/components/period-selector/types.js +1 -0
- package/build/components/radio-card/index.d.ts +19 -0
- package/build/components/radio-card/index.js +29 -0
- package/build/components/radio-card/style.scss +26 -0
- package/build/components/radio-card/types.d.ts +41 -0
- package/build/components/radio-card/types.js +1 -0
- package/build/components/selectable-card/_selectable-card.scss +57 -0
- package/build/components/terms-of-service/index.js +3 -4
- package/build/components/terms-of-service/styles.scss +5 -2
- package/build/components/terms-of-service/types.d.ts +12 -2
- package/build/index.d.ts +5 -1
- package/build/index.js +3 -1
- package/components/admin-page/index.tsx +11 -3
- package/components/admin-page/page-action-button.tsx +69 -0
- package/components/admin-page/types.ts +5 -0
- package/components/automattic-icon-logo/index.tsx +9 -7
- package/components/boost-score-bar/index.tsx +9 -9
- package/components/checkbox-card/style.scss +10 -38
- package/components/jetpack-footer/README.md +9 -0
- package/components/jetpack-footer/index.tsx +1 -112
- package/components/jetpack-footer/jetpack-footer.tsx +113 -0
- package/components/period-selector/index.tsx +84 -0
- package/components/period-selector/types.ts +29 -0
- package/components/radio-card/index.tsx +72 -0
- package/components/radio-card/style.scss +26 -0
- package/components/radio-card/types.ts +43 -0
- package/components/selectable-card/_selectable-card.scss +57 -0
- package/components/terms-of-service/index.tsx +3 -4
- package/components/terms-of-service/styles.scss +5 -2
- package/components/terms-of-service/types.ts +13 -22
- package/index.ts +5 -1
- package/package.json +23 -14
- package/build/components/number-control/index.d.ts +0 -28
- package/build/components/number-control/index.js +0 -17
- package/components/number-control/index.tsx +0 -45
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { __experimentalNumberControl as ExperimentalNumberControl, // eslint-disable-line @wordpress/no-unsafe-wp-apis
|
|
3
|
-
TextControl, } from '@wordpress/components';
|
|
4
|
-
/**
|
|
5
|
-
* This uses the experimental NumberControl from the block
|
|
6
|
-
* editor where available, otherwise it falls back to a
|
|
7
|
-
* standard TextControl, limited to numbers.
|
|
8
|
-
* @type {ComponentType<NumberControlProps>}
|
|
9
|
-
*
|
|
10
|
-
* @param {NumberControlProps} props - the NumberControl component props
|
|
11
|
-
* @return {ReactNode} - NumberControl component
|
|
12
|
-
*/
|
|
13
|
-
const NumberControl = ExperimentalNumberControl ||
|
|
14
|
-
function CustomNumberControl(props) {
|
|
15
|
-
return (_jsx(TextControl, { type: "number", inputMode: "numeric", ...props, __next40pxDefaultSize: true }));
|
|
16
|
-
};
|
|
17
|
-
export default NumberControl;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__experimentalNumberControl as ExperimentalNumberControl, // eslint-disable-line @wordpress/no-unsafe-wp-apis
|
|
3
|
-
TextControl,
|
|
4
|
-
} from '@wordpress/components';
|
|
5
|
-
import type { ComponentType, InputHTMLAttributes, ReactNode } from 'react';
|
|
6
|
-
|
|
7
|
-
export type NumberControlProps = {
|
|
8
|
-
/**
|
|
9
|
-
* Matches common `@wordpress/components` control props without importing their internal types.
|
|
10
|
-
*/
|
|
11
|
-
label?: ReactNode;
|
|
12
|
-
help?: ReactNode;
|
|
13
|
-
className?: string;
|
|
14
|
-
hideLabelFromVision?: boolean;
|
|
15
|
-
__nextHasNoMarginBottom?: boolean;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* TextControl-style signature. (The experimental NumberControl can accept this too.)
|
|
19
|
-
*/
|
|
20
|
-
onChange: ( value: string ) => void;
|
|
21
|
-
value: string | number;
|
|
22
|
-
__next40pxDefaultSize?: boolean;
|
|
23
|
-
} & Omit<
|
|
24
|
-
InputHTMLAttributes< HTMLInputElement >,
|
|
25
|
-
'onChange' | 'value' | 'className' | 'type' | 'children'
|
|
26
|
-
>;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* This uses the experimental NumberControl from the block
|
|
30
|
-
* editor where available, otherwise it falls back to a
|
|
31
|
-
* standard TextControl, limited to numbers.
|
|
32
|
-
* @type {ComponentType<NumberControlProps>}
|
|
33
|
-
*
|
|
34
|
-
* @param {NumberControlProps} props - the NumberControl component props
|
|
35
|
-
* @return {ReactNode} - NumberControl component
|
|
36
|
-
*/
|
|
37
|
-
const NumberControl: ComponentType< NumberControlProps > =
|
|
38
|
-
( ExperimentalNumberControl as unknown as ComponentType< NumberControlProps > | undefined ) ||
|
|
39
|
-
function CustomNumberControl( props: NumberControlProps ) {
|
|
40
|
-
return (
|
|
41
|
-
<TextControl type="number" inputMode="numeric" { ...props } __next40pxDefaultSize={ true } />
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default NumberControl;
|