Skip to content

Commit

Permalink
Update to include more examples, fix ag grid in
Browse files Browse the repository at this point in the history
kitchen sink
  • Loading branch information
origami-z committed May 3, 2024
1 parent cb3de10 commit f0ba6b0
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$salt-ag-theme-default-params: (
row-hover-color: var(--agGrid-row-color-hover),
row-border-color: var(--agGrid-row-borderColor),
header-background-color: var(--salt-palette-neutral-primary-background),
header-background-color: var(--salt-container-primary-background),
header-column-separator: true,
header-column-separator-width: 1px,
header-column-separator-color: var(--agGrid-header-column-separator-color),
Expand Down
6 changes: 6 additions & 0 deletions packages/ag-grid-theme/css/_salt-ag-theme-mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
border: none;
}

.ag-root-wrapper,
.ag-sticky-top {
background: var(--ag-background-color, var(--agGrid-background));
}

// Because we are using a different border thickness on focus than default
// we have to adjust height on various elements either using the line-height or height
// properties.
Expand Down Expand Up @@ -344,6 +349,7 @@

.ag-row {
color: var(--agGrid-foreground);
background-color: var(--ag-background-color, var(--agGrid-background));
}

.ag-row-hover {
Expand Down
6 changes: 3 additions & 3 deletions packages/ag-grid-theme/stories/examples/HDCompact.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SaltProvider } from "@salt-ds/core";
import { UNSTABLE_SaltProviderNext } from "@salt-ds/core";
import { AgGridReact, AgGridReactProps } from "ag-grid-react";
import { useAgGridThemeSwitcher } from "../dependencies/ThemeSwitcher";
import dataGridExampleColumns from "../dependencies/dataGridExampleColumns";
Expand Down Expand Up @@ -26,7 +26,7 @@ const HDCompact = (props: AgGridReactProps) => {
});

return (
<SaltProvider density="high">
<UNSTABLE_SaltProviderNext density="high">
<div {...containerProps}>
<AgGridReact
columnDefs={dataGridExampleColumns}
Expand All @@ -47,7 +47,7 @@ const HDCompact = (props: AgGridReactProps) => {
}}
/>
</div>
</SaltProvider>
</UNSTABLE_SaltProviderNext>
);
};

Expand Down
17 changes: 12 additions & 5 deletions packages/core/stories/form-field/form-field.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,18 @@ export const MultipleChildren: StoryFn<typeof FormField> = (props) => {

export const Readonly: StoryFn<typeof FormField> = (props) => {
return (
<FormField style={{ width: "366px" }} readOnly {...props}>
<FormLabel>Readonly Form Field</FormLabel>
<Input defaultValue="Primary Input value" />
<FormHelperText>This Form Field is readonly</FormHelperText>
</FormField>
<StackLayout>
<FormField style={{ width: "366px" }} readOnly {...props}>
<FormLabel>Readonly Form Field</FormLabel>
<Input defaultValue="Primary Input value" />
<FormHelperText>This Form Field is readonly</FormHelperText>
</FormField>
<FormField style={{ width: "366px" }} readOnly {...props}>
<FormLabel>Readonly multiline input</FormLabel>
<MultilineInput defaultValue="Input value" />
<FormHelperText>This Form Field is readonly</FormHelperText>
</FormField>
</StackLayout>
);
};

Expand Down
23 changes: 23 additions & 0 deletions packages/lab/stories/kitchen-sink/kitchen-sink.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
SaltShakerIcon,
SaltShakerSolidIcon,
} from "@salt-ds/icons";
import { ListNext, ListItemNext } from "@salt-ds/lab";
import {
DefaultGroup as AccordionDefault,
Status as AccordionStatus,
Expand Down Expand Up @@ -62,17 +63,24 @@ import {
WithValidation as FormFieldValidation,
WithMultilineInputAsQuestion,
HelperText as FormFieldHelperText,
Readonly as FormFieldReadonly,
} from "../../../core/stories/form-field/form-field.stories";
import {
Default as PillDefault,
Disabled as PillDisabled,
Closable as PillClosable,
Icon as PillIcon,
} from "../../../core/stories/pill/pill.stories";
import { Default as ListNextDefault } from "../../../lab/stories/list-next/list.stories";
import { Default as OverlayDefault } from "../../../core/stories/overlay/overlay.stories";
import AgGridThemeDefault from "../../../ag-grid-theme/stories/examples/Default";
import AgGridThemeZebra from "../../../ag-grid-theme/stories/examples/VariantZebra";
import AgGridThemeHDCompact from "../../../ag-grid-theme/stories/examples/HDCompact";

import "ag-grid-community/dist/styles/ag-grid.css";
import "ag-grid-community/dist/styles/ag-theme-material.css";
import "../../../../dist/salt-ds-ag-grid-theme/salt-ag-theme.css";

export default {
title: "Experimental/Kitchen Sink",
};
Expand Down Expand Up @@ -329,6 +337,19 @@ export const Example1 = () => {
<WithMultilineInputAsQuestion />
</FlexItem>
</StackLayout>
<StackLayout>
<FormFieldReadonly />
</StackLayout>
</StackLayout>
<StackLayout>
<ListNext selected="blue">
<ListItemNext value="green">Green</ListItemNext>
<ListItemNext disabled value="red">
Red
</ListItemNext>
<ListItemNext value="blue">Blue</ListItemNext>
<ListItemNext value="purple">Purple</ListItemNext>
</ListNext>
</StackLayout>
<AgGridThemeDefault
columnDefs={[
Expand All @@ -354,6 +375,8 @@ export const Example1 = () => {
},
]}
/>
<H3>Zebra</H3>
<AgGridThemeZebra />
<H3>HD Compact</H3>
<AgGridThemeHDCompact
columnDefs={[
Expand Down

0 comments on commit f0ba6b0

Please sign in to comment.