-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8de151
commit 816ac31
Showing
385 changed files
with
11,998 additions
and
4,663 deletions.
There are no files selected for viewing
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 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,9 @@ | ||
--- | ||
"@salt-ds/core": minor | ||
--- | ||
|
||
Added support for multiple themes to be passed to `SaltProvider`, e.g., | ||
|
||
``` | ||
<SaltProvider theme="theme-1 theme-2"> | ||
``` |
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,11 @@ | ||
--- | ||
"@salt-ds/lab": minor | ||
--- | ||
|
||
Updated styling of date picker and calendar | ||
|
||
- Corner radius support for date picker panel in theme next | ||
- Corner radius support for calendar selected days in theme next | ||
- Use accent color for today indicator and highlight color in calendar | ||
|
||
Closes #3530. |
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 `Tooltip` not having correct height. |
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
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
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> | ||
</> | ||
); | ||
}; |
Oops, something went wrong.