-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Radio button components * Change header to SSO connection * Support adding oidc connection via wrapper * Add missing input change handler * Tweaks to radio component styles * Support friendlyProviderName for OIDC connection * Exclude container component from plugin * Placeholder for empty cell value * Handle fetch failure using EmptyState component * Fetch block with try catch * Fix layout of hint * Add missing spacing * Tweaks to wrapper, container components * Remove empty placeholder * Minor fixes oidc edit * Remove classNames from rest spread * Add missing space * Set missing className * Type fix * Fix toggle connection * Fix styling for confirm div * Remove Card * Type tweak * Header display fixes * Cleanup and fix header display * Type fixes and use id instead of name * Support toggling off info card display * Align header styles * Spinner and checkbox fix
- Loading branch information
Showing
34 changed files
with
626 additions
and
448 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
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,27 @@ | ||
import { useStore } from '@builder.io/mitosis'; | ||
import { RadioProps } from '../types'; | ||
import styles from './index.module.css'; | ||
import Spacer from '../Spacer/index.lite'; | ||
|
||
export default function Radio(props: RadioProps) { | ||
const state = useStore({ | ||
get id() { | ||
return props.value.replace(/ /g, ''); | ||
}, | ||
}); | ||
return ( | ||
<div class={styles.radioDiv}> | ||
<input | ||
type='radio' | ||
value={props.value} | ||
checked={props.checked} | ||
name={props.name} | ||
id={state.id} | ||
class={styles.radio} | ||
onChange={(event) => props.handleInputChange(event)} | ||
/> | ||
<Spacer x={1} /> | ||
<label for={state.id}>{props.children}</label> | ||
</div> | ||
); | ||
} |
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,41 @@ | ||
@import url('../common.module.css'); | ||
|
||
.radioDiv { | ||
display: flex; | ||
align-items: center; | ||
padding: 0.5rem 0.25rem; | ||
} | ||
|
||
.radio { | ||
appearance: none; | ||
/* For iOS < 15 to remove gradient background */ | ||
background-color: #fff; | ||
/* Not removed via appearance */ | ||
margin: 0; | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
border: 1px solid var(--primary-color); | ||
border-radius: 50%; | ||
|
||
display: grid; | ||
place-content: center; | ||
} | ||
|
||
.radio::before { | ||
content: ''; | ||
width: 1rem; | ||
height: 1rem; | ||
border-radius: 50%; | ||
transform: scale(0); | ||
transition: 120ms transform ease-in-out; | ||
box-shadow: inset 1em 1em var(--primary-color); | ||
} | ||
|
||
.radio:checked:before { | ||
transform: scale(1); | ||
} | ||
|
||
.radio:focus-visible { | ||
outline: max(2px, 0.15em) solid var(--primary-color); | ||
outline-offset: max(2px, 0.15em); | ||
} |
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,33 @@ | ||
import { Show, useStore } from '@builder.io/mitosis'; | ||
import styles from './index.module.css'; | ||
import { RadioGroupProps } from '../types'; | ||
import Spacer from '../Spacer/index.lite'; | ||
|
||
export default function RadioGroup(props: RadioGroupProps) { | ||
const state = useStore({ | ||
get id() { | ||
return props.label.replace(/ /g, ''); | ||
}, | ||
get orientationValue() { | ||
return props.orientation || 'horizontal'; | ||
}, | ||
}); | ||
return ( | ||
<div | ||
class={styles.container} | ||
role='radiogroup' | ||
aria-labelledby={state.id} | ||
aria-orientation={state.orientationValue}> | ||
<div class={styles.label} id={state.id}> | ||
{props.label} | ||
</div> | ||
<Show when={state.orientationValue === 'horizontal'}> | ||
<Spacer x={1} /> | ||
</Show> | ||
<Show when={state.orientationValue === 'horizontal'}> | ||
<Spacer y={1} /> | ||
</Show> | ||
<div class={styles.inputs}>{props.children}</div> | ||
</div> | ||
); | ||
} |
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,12 @@ | ||
.container { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.inputs { | ||
display: flex; | ||
} | ||
|
||
[aria-orientation='vertical'] .inputs { | ||
flex-direction: column; | ||
} |
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,23 @@ | ||
export async function fetchData(url: string) { | ||
try { | ||
const response = await fetch(url); | ||
const json = await response.json(); | ||
|
||
if (!response.ok) { | ||
throw new ApiError(response.status, json.error.message); | ||
} | ||
return json; | ||
} catch (error: any) { | ||
const message = error.message || 'Something went wrong'; | ||
return { error: { message } }; | ||
} | ||
} | ||
|
||
class ApiError extends Error { | ||
status: number; | ||
|
||
constructor(status: number, message: string) { | ||
super(message); | ||
this.status = status; | ||
} | ||
} |
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,19 @@ | ||
import { SVGProps } from '../types'; | ||
|
||
export default function ExclamationTriangle(props: { svgAttrs?: SVGProps }) { | ||
return ( | ||
<svg | ||
xmlns='http://www.w3.org/2000/svg' | ||
fill='none' | ||
viewBox='0 0 24 24' | ||
stroke-width='1.5' | ||
stroke='currentColor' | ||
{...props.svgAttrs}> | ||
<path | ||
stroke-linecap='round' | ||
stroke-linejoin='round' | ||
d='M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z' | ||
/> | ||
</svg> | ||
); | ||
} |
Oops, something went wrong.