Skip to content

Commit

Permalink
feat: added example of Table custom cell renderer and usage of separa…
Browse files Browse the repository at this point in the history
…tors between SelectControl options.
  • Loading branch information
soslayando committed Nov 20, 2024
1 parent f9e8cc6 commit a31e4cd
Show file tree
Hide file tree
Showing 22 changed files with 668 additions and 153 deletions.
7 changes: 7 additions & 0 deletions packages/color/src/components/ColorPicker/ColorPicker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ import { ColorPicker } from '@devoinc/genesys-ui-color';

<Canvas of={Stories.Base} />

## Related components

- [Field](/?path=/docs/components-form-field--docs)
- [Label](?path=/docs/components-form-label--docs)
- [Helper](?path=/docs/components-feedback-helper--docs)
- [FloatingHelper](?path=/docs/components-feedback-floatinghelper--docs)

## Props

<ArgTypes of={Stories} />
12 changes: 8 additions & 4 deletions packages/core/src/components/Checkbox/Checkbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ messages, and validation.

<Canvas of={Stories.Base} />

## Props
## Related components

<ArgTypes of={Stories} />
- [CheckboxControl](?path=/docs/components-core-form-checkboxcontrol--docs)
- [Field](/?path=/docs/components-form-field--docs)
- [Label](?path=/docs/components-form-label--docs)
- [Helper](?path=/docs/components-feedback-helper--docs)
- [FloatingHelper](?path=/docs/components-feedback-floatinghelper--docs)

## Related components
## Props

- [Checkbox](?path=/docs/components-core-form-checkboxcontrol--docs)
<ArgTypes of={Stories} />
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export const Banner: Story = {
<InlineMessage.Banner
actions={[
<Button
colorScheme="blend-base"
key="BannerAction-1"
onClick={() => {
// eslint-disable-next-line no-alert
Expand All @@ -181,6 +182,7 @@ export const Banner: Story = {
<InlineMessage.Banner
actions={[
<Button
colorScheme="blend-base"
key="BannerAction-1"
onClick={() => {
// eslint-disable-next-line no-alert
Expand Down
18 changes: 12 additions & 6 deletions packages/core/src/components/Input/Input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ validation.

## How to import

<Source code={`
<Source
code={`
import { Input } from '@devoinc/genesys-ui';
`} />
`}
/>

## Basic usage

Expand All @@ -36,10 +38,14 @@ import { Input } from '@devoinc/genesys-ui';

<Canvas of={Stories.SimpleValidation} />

## Props

<ArgTypes of={Stories} />

## Related components

- [InputControl](?path=/docs/components-core-form-inputcontrol--docs)
- [Field](/?path=/docs/components-form-field--docs)
- [Label](?path=/docs/components-form-label--docs)
- [Helper](?path=/docs/components-feedback-helper--docs)
- [FloatingHelper](?path=/docs/components-feedback-floatinghelper--docs)

## Props

<ArgTypes of={Stories} />
1 change: 1 addition & 0 deletions packages/core/src/components/KeyValue/KeyValue.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const Formats: Story = {
keyContent="Key content"
valueContent="Value content"
supportingVisual={<GIWeatherSunSummer />}
supportingVisualAlign="flex-start"
/>
<KeyValue
{...args}
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/components/KeyValue/KeyValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const InternalKeyValue: React.FC<KeyValueProps> = ({
role,
size = 'md',
supportingVisual,
supportingVisualAlign,
tooltip,
unit,
valueContent,
Expand All @@ -39,7 +40,10 @@ export const InternalKeyValue: React.FC<KeyValueProps> = ({
tooltip={tooltip}
>
{supportingVisual && (
<KeyValueSupportingVisual format={format}>
<KeyValueSupportingVisual
supportingVisualAlign={supportingVisualAlign}
format={format}
>
{supportingVisual}
</KeyValueSupportingVisual>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ import { KeyValueContext } from '../../context';
import { Flex } from '../../../Flex';

export interface KeyValueSupportingVisualProps
extends Pick<IKeyValue, 'format' | 'children' | 'iconSize'> {}
extends Pick<
IKeyValue,
'format' | 'children' | 'iconSize' | 'supportingVisualAlign'
> {}

export const KeyValueSupportingVisual: React.FC<
KeyValueSupportingVisualProps
> = ({ children, iconSize }) => {
> = ({ children, iconSize, supportingVisualAlign }) => {
const cmpTokens = useTheme().cmp.keyValue.visual;
const context = React.useContext(KeyValueContext);
const evalIconSize = iconSize || context.iconSize;

return (
<Flex.Item flex="0 0 auto" display="flex">
<Flex.Item flex="0 0 auto" display="flex" alignSelf={supportingVisualAlign}>
<IconContext.Provider
value={{
color: cmpTokens.color.text,
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/components/KeyValue/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ export interface IKeyValue {
* component (if it's React Icon component from genesys-icons library it will
* inherit the perfect size from context). */
supportingVisual?: React.ReactNode;
/** The supporting visual alignment relative to the text block: center, flex-end... etc. */
supportingVisualAlign?: React.CSSProperties['alignItems'];
}
11 changes: 8 additions & 3 deletions packages/core/src/components/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ import * as React from 'react';

import type { IPaginationCommonInterface } from './declarations';

import { PaginationNav, PaginationRange, PaginationLabel, PaginationContainer } from './components';
import {type HFlexProps } from '../HFlex';
import {
PaginationNav,
PaginationRange,
PaginationLabel,
PaginationContainer,
} from './components';
import { type HFlexProps } from '../HFlex';

export interface PaginationProps
extends IPaginationCommonInterface,
HFlexProps {}
Omit<HFlexProps, 'onChange'> {}

export const InternalPagination: React.FC<PaginationProps> = ({
as = 'nav',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ import * as React from 'react';
import { HFlex, type HFlexProps } from '../../../HFlex';
import { TBaseSize } from 'src/declarations';

export interface PaginationContainerProps
extends HFlexProps {
size: TBaseSize,
}
export interface PaginationContainerProps extends HFlexProps {
size: TBaseSize;
}

export const PaginationContainer: React.FC<PaginationContainerProps> = ({
as = 'nav',
justifyContent = 'flex-end',
size = 'md',
spacing,
children,
...restHFlexProps
}) => {
return (
<HFlex
{...restHFlexProps}
as={as}
justifyContent={justifyContent}
spacing={spacing || `cmp-${size}`}
Expand Down
12 changes: 8 additions & 4 deletions packages/core/src/components/Radio/Radio.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ messages, and validation.

<Canvas of={Stories.Base} />

## Props

<ArgTypes of={Stories} />

## Related components

- [RadioControl](?path=/docs/components-core-form-radiocontrol--docs)
- [Field](/?path=/docs/components-form-field--docs)
- [Label](?path=/docs/components-form-label--docs)
- [Helper](?path=/docs/components-feedback-helper--docs)
- [FloatingHelper](?path=/docs/components-feedback-floatinghelper--docs)

## Props

<ArgTypes of={Stories} />
12 changes: 8 additions & 4 deletions packages/core/src/components/Select/Select.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ messages, and validation.

<Canvas of={Stories.Base} />

## Props

<ArgTypes of={Stories} />

## Related components

- [SelectControl](?path=/docs/components-core-form-selectcontrol--docs)
- [Field](/?path=/docs/components-form-field--docs)
- [Label](?path=/docs/components-form-label--docs)
- [Helper](?path=/docs/components-feedback-helper--docs)
- [FloatingHelper](?path=/docs/components-feedback-floatinghelper--docs)

## Props

<ArgTypes of={Stories} />
Loading

0 comments on commit a31e4cd

Please sign in to comment.