-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: updated docs for custom text fields
- Loading branch information
1 parent
617ff81
commit 9a8de6f
Showing
12 changed files
with
235 additions
and
133 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
11 changes: 11 additions & 0 deletions
11
...es/odyssey-storybook/src/components/odyssey-mui/PasswordField/PasswordField.mdx
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 @@ | ||
import { ArgsTable, Canvas, Meta, Story } from "@storybook/addon-docs"; | ||
|
||
<Meta anchor /> | ||
|
||
# Password Field | ||
|
||
Password inputs ensure that sensitive content is safely obscured. | ||
|
||
<Canvas> | ||
<Story id="mui-components-forms-passwordfield--default" /> | ||
</Canvas> |
90 changes: 90 additions & 0 deletions
90
...ages/odyssey-storybook/src/components/odyssey-mui/PasswordField/PasswordField.stories.tsx
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,90 @@ | ||
/*! | ||
* 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 { ComponentMeta, ComponentStory } from "@storybook/react"; | ||
import { PasswordField } from "@okta/odyssey-react-mui"; | ||
|
||
import { MuiThemeDecorator } from "../../../../.storybook/components"; | ||
import PasswordFieldMdx from "./PasswordField.mdx"; | ||
|
||
const storybookMeta: ComponentMeta<typeof PasswordField> = { | ||
title: `MUI Components/Forms/PasswordField`, | ||
component: PasswordField, | ||
parameters: { | ||
docs: { | ||
page: PasswordFieldMdx, | ||
}, | ||
}, | ||
argTypes: { | ||
autoCompleteType: { | ||
control: "text", | ||
defaultValue: "name", | ||
}, | ||
autoFocus: { | ||
control: "boolean", | ||
defaultValue: false, | ||
}, | ||
isDisabled: { | ||
control: "boolean", | ||
defaultValue: false, | ||
}, | ||
errorMessage: { | ||
control: "text", | ||
}, | ||
hint: { | ||
control: "text", | ||
}, | ||
id: { | ||
control: "text", | ||
}, | ||
label: { | ||
control: "text", | ||
defaultValue: "Destination", | ||
}, | ||
onBlur: { | ||
control: "function", | ||
}, | ||
onChange: { | ||
control: "function", | ||
}, | ||
onFocus: { | ||
control: "function", | ||
}, | ||
placeholder: { | ||
control: "text", | ||
}, | ||
isReadOnly: { | ||
control: "boolean", | ||
defaultValue: false, | ||
}, | ||
isRequired: { | ||
control: "boolean", | ||
defaultValue: true, | ||
}, | ||
value: { | ||
control: "text", | ||
}, | ||
}, | ||
decorators: [MuiThemeDecorator], | ||
}; | ||
|
||
export default storybookMeta; | ||
|
||
const Template: ComponentStory<typeof PasswordField> = (args) => { | ||
return <PasswordField {...args} />; | ||
}; | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
autoCompleteType: "current-password", | ||
label: "Password", | ||
}; |
11 changes: 11 additions & 0 deletions
11
packages/odyssey-storybook/src/components/odyssey-mui/SearchField/SearchField.mdx
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 @@ | ||
import { ArgsTable, Canvas, Meta, Story } from "@storybook/addon-docs"; | ||
|
||
<Meta anchor /> | ||
|
||
# Search Field | ||
|
||
Search inputs allow the user to submit queries. This is the only input type where `placeholder` may be used. | ||
|
||
<Canvas> | ||
<Story id="mui-components-forms-searchfield--default" /> | ||
</Canvas> |
82 changes: 82 additions & 0 deletions
82
packages/odyssey-storybook/src/components/odyssey-mui/SearchField/SearchField.stories.tsx
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,82 @@ | ||
/*! | ||
* 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 { ComponentMeta, ComponentStory } from "@storybook/react"; | ||
import { SearchField } from "@okta/odyssey-react-mui"; | ||
|
||
import { MuiThemeDecorator } from "../../../../.storybook/components"; | ||
import SearchFieldMdx from "./SearchField.mdx"; | ||
|
||
const storybookMeta: ComponentMeta<typeof SearchField> = { | ||
title: `MUI Components/Forms/SearchField`, | ||
component: SearchField, | ||
parameters: { | ||
docs: { | ||
page: SearchFieldMdx, | ||
}, | ||
}, | ||
argTypes: { | ||
autoCompleteType: { | ||
control: "text", | ||
defaultValue: "name", | ||
}, | ||
autoFocus: { | ||
control: "boolean", | ||
defaultValue: false, | ||
}, | ||
isDisabled: { | ||
control: "boolean", | ||
defaultValue: false, | ||
}, | ||
errorMessage: { | ||
control: "text", | ||
}, | ||
hint: { | ||
control: "text", | ||
}, | ||
id: { | ||
control: "text", | ||
}, | ||
label: { | ||
control: "text", | ||
defaultValue: "Destination", | ||
}, | ||
onBlur: { | ||
control: "function", | ||
}, | ||
onChange: { | ||
control: "function", | ||
}, | ||
onFocus: { | ||
control: "function", | ||
}, | ||
placeholder: { | ||
control: "text", | ||
}, | ||
value: { | ||
control: "text", | ||
}, | ||
}, | ||
decorators: [MuiThemeDecorator], | ||
}; | ||
|
||
export default storybookMeta; | ||
|
||
const Template: ComponentStory<typeof SearchField> = (args) => { | ||
return <SearchField {...args} />; | ||
}; | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
label: "Search", | ||
placeholder: "Search planets", | ||
}; |
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.