-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace AsProps by react-polymorphed (#49)
- Loading branch information
Showing
76 changed files
with
1,089 additions
and
1,657 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
{ | ||
"extends": "@elevenlabs/eslint-config" | ||
"env": { | ||
"jest": true | ||
}, | ||
"extends": [ | ||
"@eleven-labs/eslint-config/typescript", | ||
"@eleven-labs/eslint-config/react" | ||
], | ||
"rules": { | ||
"react/no-unescaped-entities": ["error", {"forbid": [">", "}"]}] | ||
} | ||
} |
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
6 changes: 3 additions & 3 deletions
6
bin/build-design-tokens/formats/scss/map-deep-with-css-variables.ts
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 |
---|---|---|
@@ -1,18 +1,13 @@ | ||
{ | ||
"name": "@eleven-labs/design-system", | ||
"description": "Design System for Eleven Labs", | ||
"version": "0.6.3", | ||
"version": "0.10.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/eleven-labs/design-system.git" | ||
}, | ||
"author": "Eleven Labs <[email protected]>", | ||
"license": "MIT", | ||
"keywords": [ | ||
"eslint", | ||
"lint", | ||
"prettier" | ||
], | ||
"type": "module", | ||
"main": "./dist/index.umd.cjs", | ||
"module": "./dist/index.es.js", | ||
|
@@ -39,7 +34,7 @@ | |
"start:storybook": "storybook dev -p 6009", | ||
"build:storybook": "yarn build && yarn storybook build", | ||
"lint:style": "stylelint 'src/**/*.scss'", | ||
"lint:es": "eslint --ext .ts,.tsx src bin .storybook", | ||
"lint:es": "eslint --ext .ts,.tsx src", | ||
"lint": "yarn lint:style && yarn lint:es", | ||
"test": "jest" | ||
}, | ||
|
@@ -56,9 +51,11 @@ | |
"yarn": ">= 1.2.0", | ||
"node": ">= 14.0" | ||
}, | ||
"prettier": "@eleven-labs/prettier-config", | ||
"dependencies": { | ||
"autosuggest-highlight": "^3.3.4", | ||
"classnames": "^2.3.2", | ||
"react-polymorphed": "^2.2.1", | ||
"react-syntax-highlighter": "^15.5.0" | ||
}, | ||
"peerDependencies": { | ||
|
@@ -68,7 +65,8 @@ | |
"devDependencies": { | ||
"@commitlint/cli": "^17.6.5", | ||
"@commitlint/config-conventional": "^17.6.5", | ||
"@elevenlabs/eslint-config": "^0.0.1", | ||
"@eleven-labs/eslint-config": "^1.0.0", | ||
"@eleven-labs/prettier-config": "^1.0.0", | ||
"@storybook/addon-actions": "^7.0.22", | ||
"@storybook/addon-essentials": "^7.0.22", | ||
"@storybook/addon-interactions": "^7.0.22", | ||
|
@@ -84,15 +82,15 @@ | |
"@types/react-syntax-highlighter": "^15.5.7", | ||
"@vitejs/plugin-react": "^4.0.1", | ||
"autoprefixer": "^10.4.14", | ||
"eslint": "^8.26.0", | ||
"eslint": "^8.52.0", | ||
"husky": "^8.0.3", | ||
"jest": "^29.5.0", | ||
"lint-staged": "^13.2.2", | ||
"node-sass": "^9.0.0", | ||
"postcss": "^8.4.24", | ||
"postcss-normalize": "^10.0.1", | ||
"postcss-scss": "^4.0.6", | ||
"prettier": "^2.8.8", | ||
"prettier": "^3.0.3", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"rollup-plugin-peer-deps-external": "^2.2.4", | ||
|
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 |
---|---|---|
@@ -1,13 +1,18 @@ | ||
import './Blockquote.scss'; | ||
|
||
import classNames from 'classnames'; | ||
import React from 'react'; | ||
|
||
import type { BoxProps } from '@/components'; | ||
import { Box } from '@/components'; | ||
import { AsProps, ColorSystemProps, MarginSystemProps } from '@/types'; | ||
import { polyRef } from '@/helpers/polyRef'; | ||
|
||
import './Blockquote.scss'; | ||
|
||
export type BlockquoteProps = AsProps<'blockquote'> & MarginSystemProps & Pick<ColorSystemProps, 'bg'>; | ||
export interface BlockquoteProps extends BoxProps {} | ||
|
||
export const Blockquote: React.FC<BlockquoteProps> = (props) => ( | ||
<Box {...(props as AsProps)} as="blockquote" className={classNames('blockquote', props.className)} /> | ||
export const Blockquote = polyRef<'blockquote', BlockquoteProps>( | ||
({ as = 'blockquote', children, className, ...props }, ref) => ( | ||
<Box {...props} as={as} ref={ref} className={classNames('blockquote', className)}> | ||
{children} | ||
</Box> | ||
) | ||
); |
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
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 |
---|---|---|
@@ -1,13 +1,26 @@ | ||
import classNames from 'classnames'; | ||
import * as React from 'react'; | ||
|
||
import { Box, BoxProps } from '@/components'; | ||
import { forwardRef } from '@/helpers/systemPropsHelper'; | ||
import { As, DisplayType, TypeWithMediaQueriesType } from '@/types'; | ||
import type { BoxProps } from '@/components'; | ||
import { Box } from '@/components'; | ||
import { polyRef } from '@/helpers/polyRef'; | ||
import { flexBoxSystemClassName } from '@/helpers/systemPropsHelper'; | ||
import type { DisplayType, FlexBoxSystemProps, TypeWithMediaQueriesType } from '@/types'; | ||
|
||
export type FlexProps<T extends As = 'div'> = Omit<BoxProps<T>, 'display'> & { | ||
export interface FlexProps extends Omit<BoxProps, 'display'>, FlexBoxSystemProps { | ||
display?: TypeWithMediaQueriesType<Extract<DisplayType, 'flex' | 'inline-flex'>>; | ||
}; | ||
} | ||
|
||
export const Flex = forwardRef<FlexProps, 'div'>(({ as = 'div', display = 'flex', ...props }, ref) => ( | ||
<Box {...props} ref={ref} as={as} display={display} /> | ||
)); | ||
export const Flex = polyRef<'div', FlexProps>( | ||
({ as = 'div', display = 'flex', className, children, ...props }, ref) => ( | ||
<Box | ||
{...props} | ||
ref={ref} | ||
as={as} | ||
display={display} | ||
className={classNames(flexBoxSystemClassName(props), className)} | ||
> | ||
{children} | ||
</Box> | ||
) | ||
); |
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
Oops, something went wrong.