-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Replaced the internal use of the deprecated `go.mozilla.org/pkcs7` package with the maintained fork `github.com/smallstep/pkcs7`. |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Display Windows MDM WSTEP flags in `fleet --help`. |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* eslint-disable no-alert */ | ||
import React from "react"; | ||
import { Meta, Story } from "@storybook/react"; | ||
|
||
import Button from "components/buttons/Button"; | ||
import Icon from "components/Icon"; | ||
import ActionsDropdown from "components/ActionsDropdown"; | ||
import ModalFooter from "./ModalFooter"; | ||
|
||
export default { | ||
title: "Components/ModalFooter", | ||
component: ModalFooter, | ||
} as Meta; | ||
|
||
const Template: Story = (args) => ( | ||
<ModalFooter primaryButtons={<></>} {...args} /> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
primaryButtons: ( | ||
<> | ||
<ActionsDropdown | ||
className="modal-footer__manage-automations-dropdown" | ||
onChange={(value) => alert(`Selected action: ${value}`)} | ||
placeholder="More actions" | ||
isSearchable={false} | ||
options={[ | ||
{ value: "action1", label: "Action 1" }, | ||
{ value: "action2", label: "Action 2" }, | ||
]} | ||
menuPlacement="top" | ||
/> | ||
<Button onClick={() => alert("Done clicked")} variant="brand"> | ||
Done | ||
</Button> | ||
</> | ||
), | ||
secondaryButtons: ( | ||
<> | ||
<Button variant="icon" onClick={() => alert("Download clicked")}> | ||
<Icon name="download" /> | ||
</Button> | ||
<Button variant="icon" onClick={() => alert("Delete clicked")}> | ||
<Icon name="trash" color="ui-fleet-black-75" /> | ||
</Button> | ||
</> | ||
), | ||
isTopScrolling: false, | ||
}; | ||
|
||
export const WithTopScrolling = Template.bind({}); | ||
WithTopScrolling.args = { | ||
...Default.args, | ||
isTopScrolling: true, | ||
}; | ||
|
||
export const WithoutSecondaryButtons = Template.bind({}); | ||
WithoutSecondaryButtons.args = { | ||
primaryButtons: Default.args.primaryButtons, | ||
secondaryButtons: undefined, | ||
isTopScrolling: false, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from "react"; | ||
import classnames from "classnames"; | ||
import { COLORS } from "styles/var/colors"; | ||
|
||
const baseClass = "modal-footer"; | ||
|
||
interface IModalFooterProps { | ||
primaryButtons: JSX.Element; | ||
secondaryButtons?: JSX.Element; | ||
className?: string; | ||
/** Renders a line above action buttons to indicate scrollability */ | ||
isTopScrolling?: boolean; | ||
} | ||
|
||
const ModalFooter = ({ | ||
primaryButtons, | ||
secondaryButtons, | ||
className, | ||
isTopScrolling = false, | ||
}: IModalFooterProps): JSX.Element => { | ||
const classes = classnames(className, `${baseClass}__content-wrapper`); | ||
|
||
return ( | ||
<div | ||
className={classes} | ||
style={{ | ||
borderTop: isTopScrolling | ||
? `1px solid ${COLORS["ui-fleet-black-50"]}` | ||
: "none", | ||
}} | ||
> | ||
<div className={`${baseClass}__primary-buttons-wrapper`}> | ||
{primaryButtons} | ||
</div> | ||
{secondaryButtons && ( | ||
<div className={`${baseClass}__secondary-buttons-wrapper`}> | ||
{secondaryButtons} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ModalFooter; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.modal-footer { | ||
&__content-wrapper { | ||
align-self: flex-end; | ||
display: flex; | ||
flex-direction: row-reverse; | ||
padding-top: $pad-medium; | ||
justify-content: space-between; | ||
} | ||
|
||
// Styles both primary-actions and secondary-actions | ||
&__primary-buttons-wrapper, | ||
&__secondary-buttons_wrapper { | ||
display: flex; | ||
justify-content: space-between; | ||
gap: $pad-medium; | ||
align-items: center; | ||
} | ||
|
||
// Align primary actions right if no secondary actions | ||
> :last-child { | ||
margin-left: auto; | ||
} | ||
|
||
.button__text-icon { | ||
padding: 11px; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from "./ModalFooter"; |