-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DES-6538 feat(odyssey-react-mui): expose Stack and Grid from MUI feat(odyssey-react-mui): expose Autocomplete getOptionLabel prop fix(odyssey-storybook): fix deprectated storyName warning feat(odyssey-storybook): wrap stack and grid fix(odyssey-storybook): fix palette dark color and intro darker fix(odyssey-storybook): map darker to the correct number feat(odyssey-react-mui): add linkTarget for Callout feat(odyssey-react-mui): use ODS link and add story feat(odyssey-react-mui): add correct prop description feat(odyssey-react-mui): add linkTarget for Banner feat(odyssey-react-mui): use defs from LinkProps chore(odyssey-react-mui): remove disabled tooltip button story chore(odyssey-react-mui): remove grid for now chore(odyssey-react-mui): add Stack stories fix(odyssey-react-mui): fix banner type error feat(odyssey-react-mui): add linkRel prop Banner and Callout
- Loading branch information
1 parent
3bd3bac
commit 84fcef3
Showing
14 changed files
with
369 additions
and
49 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 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/*! | ||
* Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved. | ||
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") | ||
* | ||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* | ||
* See the License for the specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
import { memo } from "react"; | ||
import { Stack as MuiStack, StackProps as MuiStackProps } from "@mui/material"; | ||
|
||
export const stackSpacingValues = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] as const; | ||
export const stackDirectionValues = [ | ||
"row", | ||
"row-reverse", | ||
"column", | ||
"column-reverse", | ||
] as const; | ||
|
||
export type OdysseyStackProps = { | ||
children?: MuiStackProps["children"]; | ||
/** | ||
* The component used for the root node. Either a string to use a HTML element or a component. | ||
*/ | ||
component?: MuiStackProps["component"]; | ||
/** | ||
* Defines the flex-direction style property. It is applied for all screen sizes. | ||
*/ | ||
direction?: (typeof stackDirectionValues)[number]; | ||
/** | ||
* Defines the space between immediate children. | ||
*/ | ||
spacing?: (typeof stackSpacingValues)[number]; | ||
sx?: MuiStackProps["sx"]; | ||
}; | ||
|
||
const Stack = ({ | ||
children, | ||
direction = "column", | ||
spacing = 2, | ||
}: OdysseyStackProps) => { | ||
return ( | ||
<MuiStack direction={direction} spacing={spacing}> | ||
{children} | ||
</MuiStack> | ||
); | ||
}; | ||
|
||
const MemoizedStack = memo(Stack); | ||
MemoizedStack.displayName = "Stack"; | ||
|
||
export { MemoizedStack as Stack }; |
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
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.