Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Josh <44883293+josh-bagwell@users.noreply.github.com>
  • Loading branch information
mannycarrera4 and josh-bagwell committed Sep 20, 2024
1 parent af922d1 commit a11e36d
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 57 deletions.
3 changes: 0 additions & 3 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ export default defineConfig({
framework: 'react',
bundler: 'webpack',
},
env: {
NODE_ENV: 'development',
},
setupNodeEvents(on, config) {
on('file:preprocessor', webpack());
},
Expand Down
2 changes: 1 addition & 1 deletion cypress/component/ActionBar.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('ActionBar', () => {
cy.wait(150);
});

it.only('should pass axe checks', () => {
it('should pass axe checks', () => {
cy.checkA11y();
});

Expand Down
5 changes: 2 additions & 3 deletions modules/docs/mdx/12.0-UPGRADE-GUIDE.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ A note to the reader:
- [Component Updates](#component-updates)
- [Styling API and CSS Tokens](#styling-api-and-css-tokens)
- [Avatar](#avatar)
- [FormField](#form-field)
- [Select](#select)
- [Form Field](#form-field)
- [Text Area](#text-area)
Expand Down Expand Up @@ -211,7 +210,7 @@ made to provide more flexibility and better explicit components when using input

#### Form Field Group

We've added a new component under FromField to allow users to group inputs without worrying about
We've added a new component under `FromField` to allow users to group inputs without worrying about
setting the `as` prop on the `FormField` component.

Use `FormFieldGroup` when you have a group of inputs that need to be associated to one another, like
Expand All @@ -224,7 +223,7 @@ Use `FormFieldGroup` when you have a group of inputs that need to be associated
label placement.
- `isRequired`: `true` Defines if a group like `RadioGroup` is required.

#### Form Field Field
#### FormField Field

We've added a new sub-component to `FormField` and `FormFieldGroup`, `FormField.Field` and
`FormFieldGroup.Field`. This sub-component is meant to ensure that the label is always aligned with
Expand Down
1 change: 0 additions & 1 deletion modules/preview-react/form-field/lib/FormFieldLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export const FormFieldLabel = createSubcomponent('label')({
modelHook: useFormFieldModel,
elemPropsHook: useFormFieldLabel,
})<FormFieldLabelProps>(({children, typeLevel, variant, ...elemProps}, Element, model) => {
console.log(model.state.orientation);
return (
<Element
{...mergeStyles(
Expand Down
48 changes: 0 additions & 48 deletions modules/react/select/stories/Select.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -318,54 +318,6 @@ Select and its subcomponents support custom styling via the `cs` prop. For more
our
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--page).

## Styling Parts

There are part of select that although they are not surface by the compound component API, can still
be styled via
[data attributes](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes).

We've added `data-part` attributes to dom elements so that you can style them if necessary. The
following data attributes exist:

{' '}

<Table>
<Table.Caption>Data Parts</Table.Caption>
<Table.Head>
<Table.Row>
<Table.Header scope="col">Name</Table.Header>
<Table.Header scope="col">Element</Table.Header>
<Table.Header scope="col">CSS Selector</Table.Header>
</Table.Row>
</Table.Head>
<Table.Body>
<Table.Row>
<Table.Cell>"select-start-icon-container"</Table.Cell>
<Table.Cell>Select.Input</Table.Cell>
<Table.Cell>'[data-part="select-start-icon-container"]'</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>"select-start-icon" </Table.Cell>
<Table.Cell>Select.Input</Table.Cell>
<Table.Cell>'[data-part="select-start-icon"]'</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>"select-hidden-input"</Table.Cell>
<Table.Cell>Select.Input</Table.Cell>
<Table.Cell>'[data-part="select-hidden-input"]'`</Table.Cell>
</Table.Row>
</Table.Body>
</Table>

### How to Style

```tsx
const customSelectInputStyles = createStyles({
'[data-part="select-start-icon-container"]': {
height: system.space.x4,
},
});
```

## Component API

Expand Down
1 change: 0 additions & 1 deletion modules/react/switch/stories/examples/LabelPosition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const LabelPosition = () => {
<FormField.Label>Dark Mode</FormField.Label>
<FormField.Field>
<FormField.Input as={Switch} checked={checked} onChange={handleChange} />
{/* <FormField.Hint>Switch to dark mode</FormField.Hint> */}
</FormField.Field>
</FormField>
);
Expand Down

0 comments on commit a11e36d

Please sign in to comment.