@lifesg/react-design-system 1.0.0-alpha.1 → 1.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/{dist/accordion → accordion}/accordion-context.d.ts +0 -0
- package/{dist/accordion → accordion}/accordion-item.d.ts +0 -0
- package/{dist/accordion → accordion}/accordion-item.style.d.ts +0 -0
- package/{dist/accordion → accordion}/accordion.d.ts +0 -0
- package/{dist/accordion → accordion}/accordion.style.d.ts +0 -0
- package/{dist/accordion → accordion}/index.d.ts +0 -0
- package/{dist/accordion → accordion}/index.js +0 -0
- package/{dist/accordion → accordion}/index.js.map +0 -0
- package/{dist/accordion → accordion}/package.json +0 -0
- package/{dist/accordion → accordion}/types.d.ts +0 -0
- package/{dist/alert → alert}/alert.d.ts +0 -0
- package/{dist/alert → alert}/alert.style.d.ts +0 -0
- package/{dist/alert → alert}/index.d.ts +0 -0
- package/{dist/alert → alert}/index.js +0 -0
- package/{dist/alert → alert}/index.js.map +0 -0
- package/{dist/alert → alert}/package.json +0 -0
- package/{dist/alert → alert}/types.d.ts +0 -0
- package/{dist/animations → animations}/index.d.ts +0 -0
- package/{dist/animations → animations}/index.js +0 -0
- package/{dist/animations → animations}/index.js.map +0 -0
- package/{dist/animations → animations}/loading-dots/loading-dots.d.ts +0 -0
- package/{dist/animations → animations}/loading-dots/lottie-animation.d.ts +0 -0
- package/{dist/animations → animations}/loading-spinner/loading-spinner.d.ts +0 -0
- package/{dist/animations → animations}/loading-spinner/lottie-animation.d.ts +0 -0
- package/{dist/animations → animations}/package.json +0 -0
- package/{dist/box-container → box-container}/box-container.d.ts +0 -0
- package/{dist/box-container → box-container}/box-container.styles.d.ts +0 -0
- package/{dist/box-container → box-container}/index.d.ts +0 -0
- package/{dist/box-container → box-container}/index.js +0 -0
- package/{dist/box-container → box-container}/index.js.map +0 -0
- package/{dist/box-container → box-container}/package.json +0 -0
- package/{dist/box-container → box-container}/types.d.ts +0 -0
- package/{dist/breadcrumb → breadcrumb}/breadcrumb.d.ts +0 -0
- package/{dist/breadcrumb → breadcrumb}/breadcrumb.style.d.ts +0 -0
- package/{dist/breadcrumb → breadcrumb}/index.d.ts +0 -0
- package/{dist/breadcrumb → breadcrumb}/index.js +0 -0
- package/{dist/breadcrumb → breadcrumb}/index.js.map +0 -0
- package/{dist/breadcrumb → breadcrumb}/package.json +0 -0
- package/{dist/breadcrumb → breadcrumb}/types.d.ts +0 -0
- package/{dist/button → button}/button.d.ts +0 -0
- package/{dist/button → button}/button.style.d.ts +0 -0
- package/{dist/button → button}/index.d.ts +0 -0
- package/{dist/button → button}/index.js +0 -0
- package/{dist/button → button}/index.js.map +0 -0
- package/{dist/button → button}/package.json +0 -0
- package/{dist/button → button}/types.d.ts +0 -0
- package/{dist/checkbox → checkbox}/checkbox.d.ts +0 -0
- package/{dist/checkbox → checkbox}/checkbox.style.d.ts +0 -0
- package/{dist/checkbox → checkbox}/index.d.ts +0 -0
- package/{dist/checkbox → checkbox}/index.js +0 -0
- package/{dist/checkbox → checkbox}/index.js.map +0 -0
- package/{dist/checkbox → checkbox}/package.json +0 -0
- package/{dist/checkbox → checkbox}/types.d.ts +0 -0
- package/{dist/cjs → cjs}/index.js +2 -2
- package/cjs/index.js.map +1 -0
- package/{dist/color → color}/color.d.ts +0 -0
- package/{dist/color → color}/index.d.ts +0 -0
- package/{dist/color → color}/index.js +0 -0
- package/{dist/color → color}/index.js.map +0 -0
- package/{dist/color → color}/package.json +0 -0
- package/{dist/color → color}/types.d.ts +0 -0
- package/{dist/date-input → date-input}/date-input.d.ts +0 -0
- package/{dist/date-input → date-input}/date-input.style.d.ts +0 -0
- package/{dist/date-input → date-input}/index.d.ts +0 -0
- package/{dist/date-input → date-input}/index.js +0 -0
- package/{dist/date-input → date-input}/index.js.map +0 -0
- package/{dist/date-input → date-input}/package.json +0 -0
- package/{dist/date-input → date-input}/types.d.ts +0 -0
- package/form/form-custom-field.d.ts +3 -0
- package/{dist/form → form}/form-date-input.d.ts +0 -0
- package/{dist/form → form}/form-input-group.d.ts +0 -0
- package/{dist/form → form}/form-input.d.ts +0 -0
- package/{dist/form → form}/form-label-addon.d.ts +0 -0
- package/{dist/form → form}/form-label-addon.style.d.ts +0 -0
- package/{dist/form → form}/form-label.d.ts +0 -0
- package/{dist/form → form}/form-label.style.d.ts +0 -0
- package/{dist/form → form}/form-multi-select.d.ts +0 -0
- package/{dist/form → form}/form-select.d.ts +0 -0
- package/{dist/form → form}/form-textarea.d.ts +0 -0
- package/{dist/form → form}/form-textarea.style.d.ts +0 -0
- package/{dist/form → form}/form-timepicker.d.ts +0 -0
- package/{dist/form → form}/form-wrapper.d.ts +0 -0
- package/{dist/form → form}/form-wrapper.style.d.ts +0 -0
- package/{dist/form → form}/index.d.ts +1 -0
- package/{dist/form → form}/index.js +424 -424
- package/form/index.js.map +1 -0
- package/{dist/form → form}/package.json +0 -0
- package/{dist/form → form}/types.d.ts +2 -0
- package/{dist/icon → icon}/arrow-right-icon.d.ts +0 -0
- package/{dist/icon → icon}/icon.d.ts +0 -0
- package/{dist/icon → icon}/index.d.ts +0 -0
- package/{dist/icon → icon}/index.js +0 -0
- package/{dist/icon → icon}/index.js.map +0 -0
- package/{dist/icon → icon}/info-icon.d.ts +0 -0
- package/{dist/icon → icon}/package.json +0 -0
- package/{dist/icon → icon}/play-alt-icon.d.ts +0 -0
- package/{dist/icon → icon}/search-icon.d.ts +0 -0
- package/{dist/icon → icon}/shared.style.d.ts +0 -0
- package/{dist/icon → icon}/types.d.ts +0 -0
- package/{dist/icon-button → icon-button}/icon-button.d.ts +0 -0
- package/{dist/icon-button → icon-button}/icon-button.style.d.ts +0 -0
- package/{dist/icon-button → icon-button}/index.d.ts +0 -0
- package/{dist/icon-button → icon-button}/index.js +0 -0
- package/{dist/icon-button → icon-button}/index.js.map +0 -0
- package/{dist/icon-button → icon-button}/package.json +0 -0
- package/{dist/icon-button → icon-button}/types.d.ts +0 -0
- package/{dist/index.d.ts → index.d.ts} +0 -0
- package/{dist/index.js → index.js} +2 -2
- package/index.js.map +1 -0
- package/{dist/input → input}/index.d.ts +0 -0
- package/{dist/input → input}/index.js +0 -0
- package/{dist/input → input}/index.js.map +0 -0
- package/{dist/input → input}/input.d.ts +0 -0
- package/{dist/input → input}/input.style.d.ts +0 -0
- package/{dist/input → input}/package.json +0 -0
- package/{dist/input → input}/types.d.ts +0 -0
- package/{dist/input-group → input-group}/index.d.ts +0 -0
- package/{dist/input-group → input-group}/index.js +0 -0
- package/{dist/input-group → input-group}/index.js.map +0 -0
- package/{dist/input-group → input-group}/input-group-list-addon.d.ts +0 -0
- package/{dist/input-group → input-group}/input-group-list-addon.style.d.ts +0 -0
- package/{dist/input-group → input-group}/input-group.d.ts +0 -0
- package/{dist/input-group → input-group}/input-group.style.d.ts +0 -0
- package/{dist/input-group → input-group}/package.json +0 -0
- package/{dist/input-group → input-group}/types.d.ts +0 -0
- package/{dist/input-select → input-select}/index.d.ts +0 -0
- package/{dist/input-select → input-select}/index.js +0 -0
- package/{dist/input-select → input-select}/index.js.map +0 -0
- package/{dist/input-select → input-select}/input-multi-select.d.ts +0 -0
- package/{dist/input-select → input-select}/input-select-wrapper.d.ts +0 -0
- package/{dist/input-select → input-select}/input-select.d.ts +0 -0
- package/{dist/input-select → input-select}/input-select.styles.d.ts +0 -0
- package/{dist/input-select → input-select}/package.json +0 -0
- package/{dist/input-select → input-select}/types.d.ts +0 -0
- package/{dist/input-textarea → input-textarea}/index.d.ts +0 -0
- package/{dist/input-textarea → input-textarea}/index.js +0 -0
- package/{dist/input-textarea → input-textarea}/index.js.map +0 -0
- package/{dist/input-textarea → input-textarea}/package.json +0 -0
- package/{dist/input-textarea → input-textarea}/textara-counter.style.d.ts +0 -0
- package/{dist/input-textarea → input-textarea}/textarea-counter.d.ts +0 -0
- package/{dist/input-textarea → input-textarea}/textarea.d.ts +0 -0
- package/{dist/input-textarea → input-textarea}/textarea.style.d.ts +0 -0
- package/{dist/input-textarea → input-textarea}/types.d.ts +0 -0
- package/{dist/link-list → link-list}/index.d.ts +0 -0
- package/{dist/link-list → link-list}/index.js +0 -0
- package/{dist/link-list → link-list}/index.js.map +0 -0
- package/{dist/link-list → link-list}/link-list.d.ts +0 -0
- package/{dist/link-list → link-list}/link-list.styles.d.ts +0 -0
- package/{dist/link-list → link-list}/package.json +0 -0
- package/{dist/link-list → link-list}/types.d.ts +0 -0
- package/{dist/masonry → masonry}/index.d.ts +0 -0
- package/{dist/masonry → masonry}/index.js +0 -0
- package/{dist/masonry → masonry}/index.js.map +0 -0
- package/{dist/masonry → masonry}/masonry.d.ts +0 -0
- package/{dist/masonry → masonry}/masonry.style.d.ts +0 -0
- package/{dist/masonry → masonry}/package.json +0 -0
- package/{dist/masonry → masonry}/types.d.ts +0 -0
- package/{dist/media → media}/index.d.ts +0 -0
- package/{dist/media → media}/index.js +0 -0
- package/{dist/media → media}/index.js.map +0 -0
- package/{dist/media → media}/media.d.ts +0 -0
- package/{dist/media → media}/package.json +0 -0
- package/{dist/media → media}/types.d.ts +0 -0
- package/{dist/modal → modal}/index.d.ts +0 -0
- package/{dist/modal → modal}/index.js +0 -0
- package/{dist/modal → modal}/index.js.map +0 -0
- package/{dist/modal → modal}/modal-box.d.ts +0 -0
- package/{dist/modal → modal}/modal-box.styles.d.ts +0 -0
- package/{dist/modal → modal}/modal.d.ts +0 -0
- package/{dist/modal → modal}/modal.styles.d.ts +0 -0
- package/{dist/modal → modal}/package.json +0 -0
- package/{dist/modal → modal}/types.d.ts +0 -0
- package/{dist/overlay → overlay}/index.d.ts +0 -0
- package/{dist/overlay → overlay}/index.js +0 -0
- package/{dist/overlay → overlay}/index.js.map +0 -0
- package/{dist/overlay → overlay}/overlay.d.ts +0 -0
- package/{dist/overlay → overlay}/overlay.styles.d.ts +0 -0
- package/{dist/overlay → overlay}/package.json +0 -0
- package/{dist/overlay → overlay}/types.d.ts +0 -0
- package/package.json +31 -105
- package/{dist/popover → popover}/index.d.ts +0 -0
- package/{dist/popover → popover}/index.js +0 -0
- package/{dist/popover → popover}/index.js.map +0 -0
- package/{dist/popover → popover}/package.json +0 -0
- package/{dist/popover → popover}/popover-hoc.d.ts +0 -0
- package/{dist/popover → popover}/popover.d.ts +0 -0
- package/{dist/popover → popover}/popover.styles.d.ts +0 -0
- package/{dist/popover → popover}/types.d.ts +0 -0
- package/{dist/radio-button → radio-button}/index.d.ts +0 -0
- package/{dist/radio-button → radio-button}/index.js +0 -0
- package/{dist/radio-button → radio-button}/index.js.map +0 -0
- package/{dist/radio-button → radio-button}/package.json +0 -0
- package/{dist/radio-button → radio-button}/radio-button.d.ts +0 -0
- package/{dist/radio-button → radio-button}/radio-button.styles.d.ts +0 -0
- package/{dist/radio-button → radio-button}/types.d.ts +0 -0
- package/{dist/shared → shared}/component-loading-spinner/component-loading-spinner.d.ts +0 -0
- package/{dist/shared → shared}/component-loading-spinner/component-loading-spinner.style.d.ts +0 -0
- package/{dist/shared → shared}/dropdown-list/dropdown-list.d.ts +0 -0
- package/{dist/shared → shared}/dropdown-list/dropdown-list.styles.d.ts +0 -0
- package/{dist/shared → shared}/dropdown-list/dropdown-search.d.ts +0 -0
- package/{dist/shared → shared}/dropdown-list/dropdown-search.styles.d.ts +0 -0
- package/{dist/shared → shared}/dropdown-list/types.d.ts +0 -0
- package/{dist/spec → spec}/color-spec/base-color-set.d.ts +0 -0
- package/{dist/spec → spec}/color-spec/bookingsg-color-set.d.ts +0 -0
- package/{dist/spec → spec}/media-spec.d.ts +0 -0
- package/{dist/spec → spec}/text-spec/base-text-style-set.d.ts +0 -0
- package/{dist/spec → spec}/text-spec/font-spec.d.ts +0 -0
- package/{dist/text → text}/helper.d.ts +0 -0
- package/{dist/text → text}/index.d.ts +0 -0
- package/{dist/text → text}/index.js +0 -0
- package/{dist/text → text}/index.js.map +0 -0
- package/{dist/text → text}/package.json +0 -0
- package/{dist/text → text}/text-style.d.ts +0 -0
- package/{dist/text → text}/text.d.ts +0 -0
- package/{dist/text → text}/types.d.ts +0 -0
- package/{dist/text-list → text-list}/index.d.ts +0 -0
- package/{dist/text-list → text-list}/index.js +0 -0
- package/{dist/text-list → text-list}/index.js.map +0 -0
- package/{dist/text-list → text-list}/ordered-list.d.ts +0 -0
- package/{dist/text-list → text-list}/package.json +0 -0
- package/{dist/text-list → text-list}/text-list.styles.d.ts +0 -0
- package/{dist/text-list → text-list}/types.d.ts +0 -0
- package/{dist/text-list → text-list}/unordered-list.d.ts +0 -0
- package/{dist/theme → theme}/color-theme-helper.d.ts +0 -0
- package/{dist/theme → theme}/helper.d.ts +0 -0
- package/{dist/theme → theme}/index.d.ts +0 -0
- package/{dist/theme → theme}/index.js +0 -0
- package/{dist/theme → theme}/index.js.map +0 -0
- package/{dist/theme → theme}/package.json +0 -0
- package/{dist/theme → theme}/text-theme-helper.d.ts +0 -0
- package/{dist/theme → theme}/types.d.ts +0 -0
- package/{dist/timeline → timeline}/index.d.ts +0 -0
- package/{dist/timeline → timeline}/index.js +0 -0
- package/{dist/timeline → timeline}/index.js.map +0 -0
- package/{dist/timeline → timeline}/package.json +0 -0
- package/{dist/timeline → timeline}/timeline.d.ts +0 -0
- package/{dist/timeline → timeline}/timeline.style.d.ts +0 -0
- package/{dist/timeline → timeline}/types.d.ts +0 -0
- package/{dist/timepicker → timepicker}/helper.d.ts +0 -0
- package/{dist/timepicker → timepicker}/index.d.ts +0 -0
- package/{dist/timepicker → timepicker}/index.js +0 -0
- package/{dist/timepicker → timepicker}/index.js.map +0 -0
- package/{dist/timepicker → timepicker}/package.json +0 -0
- package/{dist/timepicker → timepicker}/timepicker-dropdown.d.ts +0 -0
- package/{dist/timepicker → timepicker}/timepicker-dropdown.styles.d.ts +0 -0
- package/{dist/timepicker → timepicker}/timepicker.d.ts +0 -0
- package/{dist/timepicker → timepicker}/timepicker.styles.d.ts +0 -0
- package/{dist/timepicker → timepicker}/types.d.ts +0 -0
- package/{dist/toggle-button → toggle-button}/index.d.ts +0 -0
- package/{dist/toggle-button → toggle-button}/index.js +0 -0
- package/{dist/toggle-button → toggle-button}/index.js.map +0 -0
- package/{dist/toggle-button → toggle-button}/package.json +0 -0
- package/{dist/toggle-button → toggle-button}/toggle-button.d.ts +0 -0
- package/{dist/toggle-button → toggle-button}/toggle-button.styles.d.ts +0 -0
- package/{dist/toggle-button → toggle-button}/types.d.ts +0 -0
- package/{dist/tooltip → tooltip}/index.d.ts +0 -0
- package/{dist/tooltip → tooltip}/index.js +0 -0
- package/{dist/tooltip → tooltip}/index.js.map +0 -0
- package/{dist/tooltip → tooltip}/package.json +0 -0
- package/{dist/tooltip → tooltip}/tooltip-hoc.d.ts +0 -0
- package/{dist/tooltip → tooltip}/tooltip.d.ts +0 -0
- package/{dist/tooltip → tooltip}/tooltip.styles.d.ts +0 -0
- package/{dist/tooltip → tooltip}/types.d.ts +0 -0
- package/{dist/transition → transition}/index.d.ts +0 -0
- package/{dist/transition → transition}/index.js +0 -0
- package/{dist/transition → transition}/index.js.map +0 -0
- package/{dist/transition → transition}/package.json +0 -0
- package/{dist/util → util}/string-helper.d.ts +0 -0
- package/CONTRIBUTING.md +0 -175
- package/dist/README.md +0 -68
- package/dist/cjs/index.js.map +0 -1
- package/dist/form/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/package.json +0 -35
|
File without changes
|
|
@@ -39,6 +39,8 @@ export interface FormInputGroupProps<T, V> extends InputGroupPartialProps<T, V>,
|
|
|
39
39
|
}
|
|
40
40
|
export interface FormTextareaProps extends TextareaPartialProps, BaseFormElementProps {
|
|
41
41
|
}
|
|
42
|
+
export interface FormCustomFieldProps extends FormWrapperProps, BaseFormElementProps {
|
|
43
|
+
}
|
|
42
44
|
export interface FormInputSelectProps<T, V> extends InputSelectPartialProps<T, V>, BaseFormElementProps {
|
|
43
45
|
}
|
|
44
46
|
export interface FormMultiSelectProps<T, V> extends InputMultiSelectPartialProps<T, V>, BaseFormElementProps {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -941,7 +941,7 @@ var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.pr
|
|
|
941
941
|
&:not(:last-child) {
|
|
942
942
|
margin-bottom: 1rem;
|
|
943
943
|
}
|
|
944
|
-
`,FormWrapper=({label:e,errorMessage:t,id:r,disabled:a,children:i,"data-error-testid":n})=>jsxs(Container$7,{children:[e&&jsx(FormLabel,"string"==typeof e?{htmlFor:`${r}-base`,"data-testid":r?`${r}-label`:"form-label",disabled:a,children:e}:{htmlFor:`${r}-base`,"data-testid":r?`${r}-label`:"form-label",disabled:a,...e}),i,t&&jsx(ErrorMessage,{weight:"semibold","data-testid":n||(r?`${r}-error-message`:"error-message"),children:t})]}),FormDateInput=({label:e,errorMessage:t,id:r="form-date-input","data-error-testid":a,"data-testid":i,...n})=>jsx(FormWrapper,{id:r,label:e,errorMessage:t,"data-error-testid":a,disabled:n.disabled,children:jsx(DateInput,{id:`${r}-base`,"data-testid":i||r,error:!!t,...n})}),InputElement=styled.input`
|
|
944
|
+
`,FormWrapper=({label:e,errorMessage:t,id:r,disabled:a,children:i,"data-error-testid":n})=>jsxs(Container$7,{children:[e&&jsx(FormLabel,"string"==typeof e?{htmlFor:`${r}-base`,"data-testid":r?`${r}-label`:"form-label",disabled:a,children:e}:{htmlFor:`${r}-base`,"data-testid":r?`${r}-label`:"form-label",disabled:a,...e}),i,t&&jsx(ErrorMessage,{weight:"semibold","data-testid":n||(r?`${r}-error-message`:"error-message"),children:t})]}),FormCustomField=({id:e="form-custom-field","data-error-testid":t,children:r,...a})=>jsx(FormWrapper,{id:e,"data-error-testid":t,...a,children:r}),FormDateInput=({label:e,errorMessage:t,id:r="form-date-input","data-error-testid":a,"data-testid":i,...n})=>jsx(FormWrapper,{id:r,label:e,errorMessage:t,"data-error-testid":a,disabled:n.disabled,children:jsx(DateInput,{id:`${r}-base`,"data-testid":i||r,error:!!t,...n})}),InputElement=styled.input`
|
|
945
945
|
${TextStyleHelper.getTextStyle("Body","regular")}
|
|
946
946
|
border: 1px solid ${Color.Neutral[5]};
|
|
947
947
|
border-radius: 4px;
|
|
@@ -1704,7 +1704,7 @@ var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.pr
|
|
|
1704
1704
|
border: 1px solid ${Color.Accent.Light[1]};
|
|
1705
1705
|
box-shadow: inset 0 0 5px 1px rgba(87, 169, 255, 0.5);
|
|
1706
1706
|
`:void 0}
|
|
1707
|
-
`,Timepicker=({id:e,disabled:t=!1,error:r,value:a,defaultValue:i,placeholder:n,format:s="24hr",onChange:o,onBlur:l,onSelectionCancel:h,...p})=>{const[c,d]=useState(!1),u=useRef();useEffect((()=>(document.addEventListener("mousedown",f),document.addEventListener("keyup",y),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keyup",y)})),[c]);const m=useCallback((()=>{t||c||d(!0)}),[c]),f=e=>{t||g(e)},y=e=>{if("Tab"===e.code)g(e)},g=e=>{u&&!u.current.contains(e.target)&&c&&(d(!1),l&&l())},v=useCallback((()=>"12hr"===s?"HH:MMam":"HH:MM"),[s,n]);return jsxs(Wrapper,{ref:u,id:e,...p,children:[jsx(InputSelectorElement,{onFocus:m,focused:c,readOnly:!0,placeholder:n||v(),value:TimepickerHelper.formatValue(a,s),defaultValue:i,disabled:t,error:r,"data-testid":e?`${e}-timepicker-selector`:"timepicker-selector"}),jsx(TimepickerDropdown,{id:e,show:c,value:a||i,format:s,onCancel:()=>{d(!1),h&&h()},onChange:e=>{d(!1),o&&o(e)}})]})},FormTimepicker=({label:e,errorMessage:t,id:r="form-timepicker","data-error-testid":a,"data-testid":i,...n})=>jsx(FormWrapper,{id:r,label:e,errorMessage:t,disabled:n.disabled,"data-error-testid":a,children:jsx(Timepicker,{id:`${r}-base`,"data-testid":i||r,error:!!t,...n})}),Form={DateInput:FormDateInput,Input:FormInput,InputGroup:FormInputGroup,Label:FormLabel,MultiSelect:FormMultiSelect,Select:FormSelect,Textarea:FormTextarea,Timepicker:FormTimepicker},Container$1=styled.div`
|
|
1707
|
+
`,Timepicker=({id:e,disabled:t=!1,error:r,value:a,defaultValue:i,placeholder:n,format:s="24hr",onChange:o,onBlur:l,onSelectionCancel:h,...p})=>{const[c,d]=useState(!1),u=useRef();useEffect((()=>(document.addEventListener("mousedown",f),document.addEventListener("keyup",y),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keyup",y)})),[c]);const m=useCallback((()=>{t||c||d(!0)}),[c]),f=e=>{t||g(e)},y=e=>{if("Tab"===e.code)g(e)},g=e=>{u&&!u.current.contains(e.target)&&c&&(d(!1),l&&l())},v=useCallback((()=>"12hr"===s?"HH:MMam":"HH:MM"),[s,n]);return jsxs(Wrapper,{ref:u,id:e,...p,children:[jsx(InputSelectorElement,{onFocus:m,focused:c,readOnly:!0,placeholder:n||v(),value:TimepickerHelper.formatValue(a,s),defaultValue:i,disabled:t,error:r,"data-testid":e?`${e}-timepicker-selector`:"timepicker-selector"}),jsx(TimepickerDropdown,{id:e,show:c,value:a||i,format:s,onCancel:()=>{d(!1),h&&h()},onChange:e=>{d(!1),o&&o(e)}})]})},FormTimepicker=({label:e,errorMessage:t,id:r="form-timepicker","data-error-testid":a,"data-testid":i,...n})=>jsx(FormWrapper,{id:r,label:e,errorMessage:t,disabled:n.disabled,"data-error-testid":a,children:jsx(Timepicker,{id:`${r}-base`,"data-testid":i||r,error:!!t,...n})}),Form={DateInput:FormDateInput,Input:FormInput,InputGroup:FormInputGroup,Label:FormLabel,MultiSelect:FormMultiSelect,Select:FormSelect,Textarea:FormTextarea,Timepicker:FormTimepicker,CustomField:FormCustomField},Container$1=styled.div`
|
|
1708
1708
|
border-top: 1px solid ${Color.Neutral[5]};
|
|
1709
1709
|
border-bottom: 1px solid ${Color.Neutral[5]};
|
|
1710
1710
|
`,ItemTitleDefault=styled(Text.H3)`
|