-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move plans UI into a package (#42764)
* Create `@automattic/plans-grid` package. * Use the new package in Gutenboarding to display as modal and as a step. * PlansGrid component get `header` as a prop. Co-authored-by: Razvan Papadopol <razvan.papadopol@automattic.com>
- Loading branch information
Showing
29 changed files
with
452 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...g/components/plans/plans-modal/style.scss → ...oarding/components/plans-modal/style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
rules: { | ||
'import/no-extraneous-dependencies': [ 'error', { packageDir: __dirname } ], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"name": "@automattic/plans-grid", | ||
"version": "1.0.0-alpha.0", | ||
"description": "WordPress.com Plans Grid UI component", | ||
"homepage": "https://github.com/Automattic/wp-calypso", | ||
"license": "GPL-2.0-or-later", | ||
"author": "Automattic Inc.", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/esm/index.js", | ||
"sideEffects": [ | ||
"*.css", | ||
"*.scss" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Automattic/wp-calypso.git", | ||
"directory": "packages/plans-grid" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/Automattic/wp-calypso/issues" | ||
}, | ||
"types": "dist/types", | ||
"scripts": { | ||
"clean": "check-npm-client && npx rimraf dist ../../.tsc-cache/packages__plans-grid*", | ||
"prepare": "check-npm-client && tsc --project ./tsconfig.json && tsc --project ./tsconfig-cjs.json && copy-assets", | ||
"prepublish": "check-npm-client && yarn run clean", | ||
"watch": "check-npm-client && tsc --project ./tsconfig.json --watch" | ||
}, | ||
"dependencies": { | ||
"@automattic/data-stores": "^1.0.0-alpha.1", | ||
"@automattic/react-i18n": "^1.0.0-alpha.0", | ||
"@wordpress/components": "^9.6.0", | ||
"@wordpress/icons": "^2.0.0", | ||
"@wordpress/primitives": "^1.5.0", | ||
"classnames": "^2.2.6", | ||
"lodash": "^4.17.15", | ||
"tslib": "^1.10.0", | ||
"use-debounce": "^3.1.0", | ||
"uuid": "^7.0.2" | ||
}, | ||
"devDependencies": { | ||
"@wordpress/base-styles": "^1.8.0" | ||
}, | ||
"peerDependencies": { | ||
"@wordpress/data": "^4.18.0", | ||
"@wordpress/element": "^2.14.0", | ||
"@wordpress/i18n": "^3.10.0", | ||
"react": "^16.8" | ||
}, | ||
"private": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import * as React from 'react'; | ||
import classNames from 'classnames'; | ||
|
||
/** | ||
* Style dependencies | ||
*/ | ||
import './style.scss'; | ||
|
||
// @TODO: move to '@automattic/components' and reuse in Gutenboarding | ||
|
||
interface Props { | ||
children: React.ReactElement[]; | ||
className?: string; | ||
} | ||
|
||
const Badge: React.FunctionComponent< Props > = ( { children, className, ...props } ) => ( | ||
<span { ...props } className={ classNames( 'badge', className ) }> | ||
{ children } | ||
</span> | ||
); | ||
|
||
export default Badge; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.badge { | ||
display: inline-block; | ||
background: var( --studio-blue-40 ); | ||
border-radius: 2px; | ||
padding: 4px 8px; | ||
color: var( --studio-white ); | ||
margin-left: 8px; | ||
|
||
> * { | ||
vertical-align: middle; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@import '~@wordpress/base-styles/z-index'; | ||
@import '~@wordpress/base-styles/colors'; | ||
@import '~@wordpress/base-styles/variables'; | ||
@import '~@wordpress/base-styles/breakpoints'; | ||
@import '~@wordpress/base-styles/mixins'; | ||
@import '~@wordpress/base-styles/animations'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
export { default } from './plans-grid'; |
Oops, something went wrong.