-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into overlay-button-overflow
- Loading branch information
Showing
156 changed files
with
3,871 additions
and
820 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@salt-ds/core": patch | ||
--- | ||
|
||
Fixed file drop zone not allowing the same file to be selected via `onChange` of `FileDropZoneTrigger`. | ||
Updated first argument event type of `onChange` to `ChangeEvent`, to better align with underlying event. | ||
|
||
Closes #3591. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@salt-ds/core": minor | ||
--- | ||
|
||
- Added `indicatorSide` to `accordion` to allow right alignment. | ||
- Removed arrow animation in accordion. | ||
- Changed direction of accordion's arrow to be consistent with salt's expandable components. | ||
- Changed direction when `expanded=false` from right to down. | ||
- Changed direction when `expanded=true` from down to up. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@salt-ds/core": patch | ||
--- | ||
|
||
Fixed Menu showing behind Drawer (#3636). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
push: | ||
branches: | ||
- main | ||
- release-ag-grid-theme-v1 | ||
|
||
permissions: | ||
contents: write | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
import { addons } from "@storybook/manager-api"; | ||
import { addons, types } from "@storybook/manager-api"; | ||
import saltTheme from "./SaltTheme"; | ||
import { ThemeNextToolbar } from "./toolbar/ThemeNextToolbar"; | ||
|
||
addons.setConfig({ | ||
theme: saltTheme, | ||
}); | ||
|
||
addons.register("theme-next-addon", () => { | ||
addons.add("theme-next-addon/toolbar", { | ||
title: "Theme next toolbar", | ||
//👇 Sets the type of UI element in Storybook | ||
type: types.TOOL, | ||
render: ThemeNextToolbar, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* Custom Toolbar */ | ||
.theme-next-toolbar-group-wrapper { | ||
cursor: not-allowed; | ||
} | ||
|
||
.theme-next-toolbar-group-wrapper > span > span { | ||
font-weight: bold; | ||
color: darkgray; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
import type { TooltipLinkListLink } from "@storybook/components"; | ||
import { | ||
IconButton, | ||
Separator, | ||
TooltipLinkList, | ||
WithTooltip, | ||
} from "@storybook/components"; | ||
import { BeakerIcon, CheckIcon } from "@storybook/icons"; | ||
import { useGlobals } from "@storybook/manager-api"; | ||
import { clsx } from "clsx"; | ||
import React, { AnchorHTMLAttributes } from "react"; | ||
|
||
import "./ThemeNextToolbar.css"; | ||
|
||
const description = "Theme next controls"; | ||
|
||
const camelCaseToWords = (s: string) => { | ||
const result = s.replace(/([A-Z])/g, " $1"); | ||
return result.charAt(0).toUpperCase() + result.slice(1); | ||
}; | ||
|
||
export const globalOptions: Record< | ||
string, | ||
{ name: string; description: string; defaultValue: string; items: string[] } | ||
> = { | ||
themeNext: { | ||
name: "Experimental theme next", | ||
description: "Turn on/off theme next", | ||
defaultValue: "disable", | ||
items: ["enable", "disable"], | ||
}, | ||
corner: { | ||
name: "Experimental corner", | ||
description: "Switch corner to sharp / rounded", | ||
defaultValue: "sharp", | ||
items: ["sharp", "rounded"], | ||
}, | ||
headingFont: { | ||
name: "Experimental heading font", | ||
description: "Switch heading font to open sans / amplitude", | ||
defaultValue: "Open Sans", | ||
items: ["Open Sans", "Amplitude"], | ||
}, | ||
accent: { | ||
name: "Experimental accent", | ||
description: "Switch accent to blue / teal", | ||
defaultValue: "blue", | ||
items: ["blue", "teal"], | ||
}, | ||
actionFont: { | ||
name: "Experimental action font", | ||
description: "Switch action font to open sans / amplitude", | ||
defaultValue: "Open Sans", | ||
items: ["Open Sans", "Amplitude"], | ||
}, | ||
}; | ||
|
||
const GroupWrapper = ({ | ||
className, | ||
children, | ||
}: AnchorHTMLAttributes<HTMLAnchorElement>) => { | ||
return ( | ||
<div | ||
className={clsx(className, "theme-next-toolbar-group-wrapper")} | ||
children={children} | ||
/> | ||
); | ||
}; | ||
|
||
export const ThemeNextToolbar = ({ active }: { active?: boolean }) => { | ||
const [globals, updateGlobals] = useGlobals(); | ||
|
||
const items: TooltipLinkListLink[] = Object.keys(globalOptions).flatMap( | ||
(globalKey) => { | ||
return [ | ||
{ | ||
id: `theme-next-${globalKey}-header`, | ||
title: camelCaseToWords(globalKey), | ||
LinkWrapper: GroupWrapper, // Custom wrapper to render group | ||
href: "#", // Without href, `LinkWrapper` will not work | ||
}, | ||
...globalOptions[globalKey].items.map((value) => { | ||
const disabled = | ||
globalKey === "themeNext" | ||
? false | ||
: globals["themeNext"] !== "enable"; | ||
const active = globals[globalKey] === value; | ||
|
||
return { | ||
id: `theme-next-${globalKey}-${value}`, | ||
right: active ? ( | ||
<CheckIcon style={{ fill: "inherit" }} /> | ||
) : undefined, | ||
active, | ||
title: camelCaseToWords(value), | ||
onClick: () => { | ||
!disabled && updateGlobals({ [globalKey]: value }); | ||
}, | ||
disabled, | ||
}; | ||
}), | ||
]; | ||
} | ||
); | ||
|
||
return ( | ||
<> | ||
<Separator /> | ||
<WithTooltip | ||
tooltip={() => <TooltipLinkList links={items} />} | ||
trigger="click" | ||
closeOnOutsideClick | ||
> | ||
<IconButton title={description} active={active}> | ||
<BeakerIcon /> Theme Next | ||
</IconButton> | ||
</WithTooltip> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.