Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global Styles v2: Move prototype from G2 #32923

Closed
wants to merge 16 commits into from
Closed
166 changes: 155 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@
"framer-motion": "^4.1.17",
"gradient-parser": "^0.1.5",
"highlight-words-core": "^1.2.2",
"history": "^4.9.0",
"hoist-non-react-statics": "^3.3.2",
"lodash": "^4.17.21",
"memize": "^1.1.0",
"moment": "^2.22.1",
"path-to-regexp": "^0.1.7",
"re-resizable": "^6.4.0",
"react-colorful": "^5.3.0",
"react-dates": "^17.1.1",
Expand Down
13 changes: 11 additions & 2 deletions packages/components/src/color-indicator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@
*/
import classnames from 'classnames';

const ColorIndicator = ( { className, colorValue, ...props } ) => (
const ColorIndicator = ( {
className,
colorValue,
circular = false,
...props
} ) => (
<span
className={ classnames( 'component-color-indicator', className ) }
className={ classnames(
'component-color-indicator',
{ 'is-circular': circular },
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a workaround, which we may want to go with, or not. The ColorCircle component in g2 seemed a bit more capable, but we should reconsider if we need those capabilities here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conversation started in #33820

className
) }
style={ { background: colorValue } }
{ ...props }
/>
Expand Down
5 changes: 5 additions & 0 deletions packages/components/src/color-indicator/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@
& + & {
margin-left: 0.5rem;
}

&.is-circular {
height: 25px;
border-radius: 50%;
}
}
6 changes: 6 additions & 0 deletions packages/components/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export {
CompositeItem as __unstableCompositeItem,
useCompositeState as __unstableUseCompositeState,
} from './composite';
export {
ContextSystemProvider as __experimentalContextSystemProvider,
useContextSystem as __experimentalUseContextSystem,
} from './ui/context';
export { default as CustomSelectControl } from './custom-select-control';
export { default as Dashicon } from './dashicon';
export { default as DateTimePicker, DatePicker, TimePicker } from './date-time';
Expand Down Expand Up @@ -96,6 +100,7 @@ export { default as __experimentalNavigationBackButton } from './navigation/back
export { default as __experimentalNavigationGroup } from './navigation/group';
export { default as __experimentalNavigationItem } from './navigation/item';
export { default as __experimentalNavigationMenu } from './navigation/menu';
export * from './navigator';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the ones we use from here should be __experimental.

export { default as Notice } from './notice';
export { default as __experimentalNumberControl } from './number-control';
export { default as NoticeList } from './notice/list';
Expand Down Expand Up @@ -157,6 +162,7 @@ export {
parseUnit as __experimentalParseUnit,
} from './unit-control';
export { VisuallyHidden } from './visually-hidden';
export { View as __experimentalView } from './view';
export { VStack as __experimentalVStack } from './v-stack';
export { default as IsolatedEventContainer } from './isolated-event-container';
export {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/item-group/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as Item } from './item';
export { default as ItemGroup } from './item-group';
export { default as Item, useItem } from './item';
export { default as ItemGroup, useItemGroup } from './item-group';
Loading