Skip to content

Commit

Permalink
Sparkle: Add isLoading state to split button (#8994)
Browse files Browse the repository at this point in the history
  • Loading branch information
PopDaph authored Nov 28, 2024
1 parent bae9884 commit fefcffb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface InputBarContainerProps {
isTabIncluded: boolean;
setIncludeTab: (includeTab: boolean) => void;
fileUploaderService: FileUploaderService;
isSubmitting: boolean;
}

export const InputBarContainer = ({
Expand Down
4 changes: 2 additions & 2 deletions sparkle/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sparkle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dust-tt/sparkle",
"version": "0.2.326",
"version": "0.2.327",
"scripts": {
"build": "rm -rf dist && npm run tailwind && npm run build:esm && npm run build:cjs",
"tailwind": "tailwindcss -i ./src/styles/tailwind.css -o dist/sparkle.css",
Expand Down
2 changes: 2 additions & 0 deletions sparkle/src/components/SplitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ interface SplitButtonActionProps {
tooltip?: string;
disabled?: boolean;
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
isLoading?: boolean;
}

export interface SplitButtonProps
Expand Down Expand Up @@ -113,6 +114,7 @@ export const SplitButton = React.forwardRef<
icon={ChevronDownIcon}
disabled={disabled}
className={cn("s-rounded-l-none s-border-l-0", className)}
isLoading={actionToUse.isLoading}
/>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
Expand Down
8 changes: 6 additions & 2 deletions sparkle/src/stories/SplitButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,18 @@ export const ExampleButton: Story = {
{
label: "Second",
icon: RobotIcon,
tooltip: "Second tooltip",
tooltip: "Disabled tooltip",
disabled: true,
},
{
label: "Third",
icon: PlusIcon,
tooltip: "Third tooltip",
},
{
label: "Fourth",
tooltip: "Loading tooltip",
isLoading: true,
},
],
},
};

0 comments on commit fefcffb

Please sign in to comment.