From f0ba6b09af043da1507dc6b8e2e356995f662d62 Mon Sep 17 00:00:00 2001 From: origami-z <5257855+origami-z@users.noreply.github.com> Date: Fri, 3 May 2024 12:38:42 +0100 Subject: [PATCH] Update to include more examples, fix ag grid in kitchen sink --- .../css/_salt-ag-theme-default-params.scss | 2 +- .../css/_salt-ag-theme-mixin.scss | 6 +++++ .../stories/examples/HDCompact.tsx | 6 ++--- .../stories/form-field/form-field.stories.tsx | 17 ++++++++++---- .../kitchen-sink/kitchen-sink.stories.tsx | 23 +++++++++++++++++++ 5 files changed, 45 insertions(+), 9 deletions(-) diff --git a/packages/ag-grid-theme/css/_salt-ag-theme-default-params.scss b/packages/ag-grid-theme/css/_salt-ag-theme-default-params.scss index 26d6151c26e..6687816d947 100644 --- a/packages/ag-grid-theme/css/_salt-ag-theme-default-params.scss +++ b/packages/ag-grid-theme/css/_salt-ag-theme-default-params.scss @@ -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), diff --git a/packages/ag-grid-theme/css/_salt-ag-theme-mixin.scss b/packages/ag-grid-theme/css/_salt-ag-theme-mixin.scss index d83608671bf..9e99002d92a 100644 --- a/packages/ag-grid-theme/css/_salt-ag-theme-mixin.scss +++ b/packages/ag-grid-theme/css/_salt-ag-theme-mixin.scss @@ -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. @@ -344,6 +349,7 @@ .ag-row { color: var(--agGrid-foreground); + background-color: var(--ag-background-color, var(--agGrid-background)); } .ag-row-hover { diff --git a/packages/ag-grid-theme/stories/examples/HDCompact.tsx b/packages/ag-grid-theme/stories/examples/HDCompact.tsx index 65114be3586..ef1f1f47636 100644 --- a/packages/ag-grid-theme/stories/examples/HDCompact.tsx +++ b/packages/ag-grid-theme/stories/examples/HDCompact.tsx @@ -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"; @@ -26,7 +26,7 @@ const HDCompact = (props: AgGridReactProps) => { }); return ( - +
{ }} />
-
+ ); }; diff --git a/packages/core/stories/form-field/form-field.stories.tsx b/packages/core/stories/form-field/form-field.stories.tsx index 044e158bf32..4f6e554453f 100644 --- a/packages/core/stories/form-field/form-field.stories.tsx +++ b/packages/core/stories/form-field/form-field.stories.tsx @@ -376,11 +376,18 @@ export const MultipleChildren: StoryFn = (props) => { export const Readonly: StoryFn = (props) => { return ( - - Readonly Form Field - - This Form Field is readonly - + + + Readonly Form Field + + This Form Field is readonly + + + Readonly multiline input + + This Form Field is readonly + + ); }; diff --git a/packages/lab/stories/kitchen-sink/kitchen-sink.stories.tsx b/packages/lab/stories/kitchen-sink/kitchen-sink.stories.tsx index 3eda6953e70..c7a03043508 100644 --- a/packages/lab/stories/kitchen-sink/kitchen-sink.stories.tsx +++ b/packages/lab/stories/kitchen-sink/kitchen-sink.stories.tsx @@ -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, @@ -62,6 +63,7 @@ import { WithValidation as FormFieldValidation, WithMultilineInputAsQuestion, HelperText as FormFieldHelperText, + Readonly as FormFieldReadonly, } from "../../../core/stories/form-field/form-field.stories"; import { Default as PillDefault, @@ -69,10 +71,16 @@ import { 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", }; @@ -329,6 +337,19 @@ export const Example1 = () => { + + + + + + + Green + + Red + + Blue + Purple + { }, ]} /> +

Zebra

+

HD Compact