Skip to content

Commit

Permalink
Et 683 extend modal and input components (#163)
Browse files Browse the repository at this point in the history
* extent input type
* extent modal
* v0.12.19
  • Loading branch information
sharlotta93 authored Dec 19, 2024
1 parent 61c7b31 commit d5eb92c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@awell-health/design-system",
"version": "0.12.18",
"version": "0.12.19",
"type": "module",
"files": [
"dist"
Expand Down
4 changes: 3 additions & 1 deletion src/components/ui/form/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
onChange?: React.ChangeEventHandler<HTMLInputElement>;
className?: string;
type?: string;
labelClassName?: string;
}
const Input = React.forwardRef<HTMLInputElement, InputProps>(
(
Expand All @@ -23,6 +24,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
hasError,
onChange,
type = 'text',
labelClassName,
...props
},
ref
Expand All @@ -47,7 +49,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
return (
<div className=''>
{label && (
<div className='label'>
<div className={cn('label', labelClassName)}>
<span className=' label-text text-slate-600 text-sm font-medium'>{label}</span>
</div>
)}
Expand Down
28 changes: 14 additions & 14 deletions src/components/ui/form/select/__snapshots__/select.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`Select > match multi snapshot 1`] = `
class="relative"
>
<div
class=" css-b62m3t-container"
class="css-b62m3t-container"
>
<span
class="css-1f43avz-a11yText-A11yText"
Expand All @@ -26,10 +26,10 @@ exports[`Select > match multi snapshot 1`] = `
class="!rounded-lg !shadow border !border-slate-300 text-slate-500 text-sm font-normal css-13cymwt-control"
>
<div
class=" css-hlgwow"
class="css-hlgwow"
>
<div
class=" css-1jqq78o-placeholder"
class="css-1jqq78o-placeholder"
id="react-select-3-placeholder"
>
Select...
Expand All @@ -41,7 +41,7 @@ exports[`Select > match multi snapshot 1`] = `
aria-expanded="false"
aria-haspopup="true"
aria-readonly="true"
class="css-mohuvp-dummyInput-DummyInput"
class="css-1s80ejz-dummyInput-DummyInput"
id="react-select-3-input"
inputmode="none"
role="combobox"
Expand All @@ -50,14 +50,14 @@ exports[`Select > match multi snapshot 1`] = `
/>
</div>
<div
class=" css-1wy0on6"
class="css-1wy0on6"
>
<span
class=" css-1u9des2-indicatorSeparator"
class="css-1u9des2-indicatorSeparator"
/>
<div
aria-hidden="true"
class=" css-1xc3v61-indicatorContainer"
class="css-1xc3v61-indicatorContainer"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -89,7 +89,7 @@ exports[`Select > match snapshot 1`] = `
class="relative"
>
<div
class=" css-b62m3t-container"
class="css-b62m3t-container"
>
<span
class="css-1f43avz-a11yText-A11yText"
Expand All @@ -106,10 +106,10 @@ exports[`Select > match snapshot 1`] = `
class="!rounded-lg !shadow border !border-slate-300 text-slate-500 text-sm font-normal css-13cymwt-control"
>
<div
class=" css-hlgwow"
class="css-hlgwow"
>
<div
class=" css-1jqq78o-placeholder"
class="css-1jqq78o-placeholder"
id="react-select-2-placeholder"
>
Select...
Expand All @@ -121,7 +121,7 @@ exports[`Select > match snapshot 1`] = `
aria-expanded="false"
aria-haspopup="true"
aria-readonly="true"
class="css-mohuvp-dummyInput-DummyInput"
class="css-1s80ejz-dummyInput-DummyInput"
id="react-select-2-input"
inputmode="none"
role="combobox"
Expand All @@ -130,14 +130,14 @@ exports[`Select > match snapshot 1`] = `
/>
</div>
<div
class=" css-1wy0on6"
class="css-1wy0on6"
>
<span
class=" css-1u9des2-indicatorSeparator"
class="css-1u9des2-indicatorSeparator"
/>
<div
aria-hidden="true"
class=" css-1xc3v61-indicatorContainer"
class="css-1xc3v61-indicatorContainer"
>
<svg
aria-hidden="true"
Expand Down
12 changes: 10 additions & 2 deletions src/components/ui/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ interface Props {
closeOnEscape?: boolean;
children: JSX.Element | ReactNode | string;
className?: string;
marginTop?: string;
}

const Modal: FC<Props> = (props) => {
const { children, onClose, clickOutside = false, closeOnEscape = false, className = '' } = props;
const {
children,
onClose,
clickOutside = false,
closeOnEscape = false,
className = '',
marginTop = 'mt-[100px]'
} = props;
const modalRef: RefObject<HTMLDivElement> = React.useRef<HTMLDivElement>(null);

if (clickOutside) {
Expand All @@ -31,7 +39,7 @@ const Modal: FC<Props> = (props) => {
>
<div className='fixed inset-0 bg-slate-700 bg-opacity-30 transition-opacity z-[9999]'></div>
<div className='fixed inset-0 z-[9999] w-screen overflow-y-auto'>
<div className='flex mt-[100px] justify-center p-4'>
<div className={cn('flex justify-center p-4', marginTop)}>
<div className='relative transform overflow-hidden transition-all bg-white rounded-lg shadow border border-slate-200'>
<div ref={modalRef} className={cn('w-[1024px] h-[500px]', className)}>
{children}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/modal/__snapshots__/Modal.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`Modal > match snapshot 1`] = `
class="fixed inset-0 z-[9999] w-screen overflow-y-auto"
>
<div
class="flex mt-[100px] justify-center p-4"
class="flex justify-center p-4 mt-[100px]"
>
<div
class="relative transform overflow-hidden transition-all bg-white rounded-lg shadow border border-slate-200"
Expand Down

0 comments on commit d5eb92c

Please sign in to comment.