repo stringclasses 4
values | file_path stringlengths 6 193 | extension stringclasses 30
values | content stringlengths 0 5.21M | token_count int64 0 3.8M |
|---|---|---|---|---|
hyperswitch-control-center | src/components/NewCalendar.res | .res | open DateTimeUtils
type highlighter = {
highlightSelf: bool,
highlightLeft: bool,
highlightRight: bool,
}
module TableRow = {
let defaultCellHighlighter = _ => {
highlightSelf: false,
highlightLeft: false,
highlightRight: false,
}
let defaultCellRenderer = obj => {
switch obj {
| Some(a... | 4,696 |
hyperswitch-control-center | src/components/NewThemeUtils.resi | .resi | type headingSize = XSmall | Small | Medium | Large
module NewThemeHeading: {
@react.component
let make: (
~heading: string,
~description: string=?,
~headingColor: string=?,
~descriptionColor: string=?,
~headingSize: headingSize=?,
~rightActions: React.element=?,
~headingRightElemnt: Reac... | 147 |
hyperswitch-control-center | src/components/AddDataAttributes.res | .res | let spreadProps = React.cloneElement
@react.component
let make = (~attributes: array<(string, string)>, ~children) => {
let attributesDict = attributes->Dict.fromArray
let ignoreAttributes = React.useContext(AddAttributesContext.ignoreAttributesContext)
if !ignoreAttributes {
children->spreadProps(attribute... | 81 |
hyperswitch-control-center | src/components/Loader.res | .res | @react.component
let make = (
~loadingText="Loading...",
~children=React.null,
~slow=false,
~customSpinnerIconColor: string="",
~loadingTextColor="",
) => {
let animationType = if slow {
"animate-spin-slow"
} else {
"animate-spin"
}
let size = if slow {
60
} else {
20
}
let loa... | 242 |
hyperswitch-control-center | src/components/CollapsableTableRow.res | .res | @react.component
let make = (
~item: array<Table.cell>,
~rowIndex,
~offset as _,
~highlightEnabledFieldsArray,
~expandedRowIndexArray,
~onExpandIconClick,
~getRowDetails,
~heading,
~title,
) => {
let isCurrentRowExpanded = expandedRowIndexArray->Array.includes(rowIndex)
let headingArray = []
he... | 907 |
hyperswitch-control-center | src/components/DragDrop.res | .res | type draggableDefaultDestination = {index: int, droppableId: string}
type draggableItem = React.element
let defaultDraggableDest = {
index: 0,
droppableId: "",
}
@react.component
let make = (
~isHorizontal=true,
~listItems: array<JSON.t>,
~setListItems: (array<JSON.t> => array<JSON.t>) => unit,
~keyExtrac... | 930 |
hyperswitch-control-center | src/components/SelectBox.res | .res | type retType = CheckBox(array<string>) | Radiobox(string)
external toDict: 'a => Dict.t<'t> = "%identity"
@send external getClientRects: Dom.element => Dom.domRect = "getClientRects"
@send external focus: Dom.element => unit = "focus"
external ffInputToSelectInput: ReactFinalForm.fieldRenderPropsInput => ReactFinalFo... | 18,139 |
hyperswitch-control-center | src/components/ButtonGroupIp.res | .res | open SelectBox
@react.component
let make = (
~input: ReactFinalForm.fieldRenderPropsInput,
~options: array<dropdownOption>,
~buttonClass="",
~isDisabled=false,
~isSeparate=false,
~buttonSize=?,
) => {
let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext)
let onChange =... | 389 |
hyperswitch-control-center | src/components/NewCalendarTimeInput.res | .res | open DateTimeUtils
let textBoxClass = " font-inter-style text-fs-14 leading-5 font-normal text-jp-2-light-gray-2000"
module CustomInputBox = {
@react.component
let make = (
~input: ReactFinalForm.fieldRenderPropsInput,
~placeholder,
~isDisabled=false,
~type_="text",
~inputMode="text",
~autoF... | 1,947 |
hyperswitch-control-center | src/components/TabularInput.res | .res | external ffInputToTableInput: ReactFinalForm.fieldRenderPropsInput => ReactFinalForm.fieldRenderPropsCustomInput<
array<array<string>>,
> = "%identity"
module FieldInputRenderer = {
@react.component
let make = (~item, ~input: ReactFinalForm.fieldRenderPropsInput) => {
<td> {item(input)} </td>
}
}
module T... | 1,164 |
hyperswitch-control-center | src/components/DragNDropDemoLazy.res | .res | open LazyUtils
type props = {
isHorizontal: option<bool>,
keyExtractor: JSON.t => option<string>,
listItems: array<JSON.t>,
setListItems: (array<JSON.t> => array<JSON.t>) => unit,
}
let make: props => React.element = reactLazy(() => import_("./DragNDropDemo.res.js"))
| 77 |
hyperswitch-control-center | src/components/LoadedTableWithCustomColumns.res | .res | @react.component
let make = (
~defaultSort=?,
~title,
~description=?,
~tableActions=?,
~rightTitleElement=React.null,
~bottomActions=?,
~showSerialNumber=false,
~actualData,
~totalResults,
~resultsPerPage,
~offset,
~setOffset,
~handleRefetch=() => (),
~entity: EntityType.entityType<'colType,... | 1,000 |
hyperswitch-control-center | src/components/NewCalendarList.res | .res | open DateTimeUtils
external ffInputToSelectInput: ReactFinalForm.fieldRenderPropsInput => ReactFinalForm.fieldRenderPropsCustomInput<
array<string>,
> = "%identity"
open NewCalendar
@react.component
let make = (
~forwardRef as _=?,
~changeHighlightCellStyle="",
~calendarContaierStyle="",
~month: option<month... | 1,751 |
hyperswitch-control-center | src/components/ACLDiv.resi | .resi | @react.component
let make: (
~authorization: CommonAuthTypes.authorization,
~onClick: JsxEvent.Mouse.t => unit,
~children: React.element,
~className: string=?,
~noAccessDescription: string=?,
~description: string=?,
~tooltipWidthClass: string=?,
~isRelative: bool=?,
~showTooltip: bool=?,
~contentAli... | 134 |
hyperswitch-control-center | src/components/TableLocalFilters.res | .res | external formEventToJsonArr: ReactEvent.Form.t => array<JSON.t> = "%identity"
module RangeSliderLocalFilter = {
@react.component
let make = (
~filterKey,
~minVal: float,
~maxVal: float,
~maxSlide: ReactFinalForm.fieldRenderPropsInput,
~minSlide: ReactFinalForm.fieldRenderPropsInput,
) => {
... | 2,700 |
hyperswitch-control-center | src/components/MultipleFileUpload.res | .res | type dataTransfer
@get external dataTransfer: ReactEvent.Mouse.t => 'a = "dataTransfer"
@get external files: dataTransfer => 'a = "files"
open LogicUtils
@val external atob: string => string = "atob"
@send external focus: Dom.element => unit = "focus"
@react.component
let make = (
~input: ReactFinalForm.fieldRenderP... | 2,252 |
hyperswitch-control-center | src/components/Filter.res | .res | module ClearFilters = {
@react.component
let make = (
~defaultFilterKeys=[],
~clearFilters=?,
~isCountRequired=true,
~outsidefilter=false,
) => {
let {updateExistingKeys} = React.useContext(FilterContext.filterContext)
let textStyle = "text-red-900"
let leftIcon: Button.iconType = Cust... | 2,973 |
hyperswitch-control-center | src/components/ButtonGroup.res | .res | module ButtonWrapper = {
let makeInfoRecord = (~isFirst, ~isLast): ButtonGroupContext.buttonInfo => {
{isFirst, isLast}
}
@react.component
let make = (~element, ~count, ~index) => {
let isFirst = index === 0
let isLast = index === count - 1
let value = React.useMemo(() => makeInfoRecord(~isFirs... | 191 |
hyperswitch-control-center | src/components/PopUpContainer.res | .res | open PopUpState
@react.component
let make = (~children) => {
let (openPopUps, setOpenPopUp) = Recoil.useRecoilState(PopUpState.openPopUp)
let activePopUp = openPopUps->Array.get(0)
let popUp = switch activePopUp {
| Some(popUp) => {
let handleConfirm = ev => {
setOpenPopUp(prevArr => prevArr->Arr... | 615 |
hyperswitch-control-center | src/components/RatingOptions.res | .res | @react.component
let make = (~icons, ~size) => {
let (isActive, setIsActive) = React.useState(_ => false)
let ratingInput = ReactFinalForm.useField("rating").input
let rating = ratingInput.value->LogicUtils.getIntFromJson(1)
let handleClick = ratingNumber => {
ratingInput.onChange(ratingNumber->Identity.an... | 218 |
hyperswitch-control-center | src/components/DynamicTable.res | .res | let useRemoteFilter = (~searchParams, ~remoteFilters, ~remoteOptions, ~mandatoryRemoteKeys) => {
let (remoteFiltersFromUrl, setRemoteFiltersFromUrl) = React.useState(() =>
JSON.Encode.object(Dict.make())
)
let remoteFiltersFromUrlTemp = React.useMemo(() => {
RemoteFiltersUtils.getInitialValuesFromUrl(
... | 4,177 |
hyperswitch-control-center | src/components/MobileView.res | .res | @react.component
let make = (~children) => {
let isMobileView = MatchMedia.useMobileChecker()
<RenderIf condition=isMobileView> children </RenderIf>
}
| 39 |
hyperswitch-control-center | src/components/InputFields.res | .res | type customInputFn = (
~input: ReactFinalForm.fieldRenderPropsInput,
~placeholder: string,
) => React.element
type comboCustomInputFn = array<ReactFinalForm.fieldRenderProps> => React.element
type comboCustomInputRecord = {
fn: comboCustomInputFn,
names: array<string>,
}
let selectInput = (
~options: array<... | 4,287 |
hyperswitch-control-center | src/components/NewThemeUtils.res | .res | type headingSize = XSmall | Small | Medium | Large
module NewThemeHeading = {
@react.component
let make = (
~heading,
~description=?,
~headingColor="",
~descriptionColor="",
~headingSize=Large,
~rightActions=?,
~headingRightElemnt=?,
~alignItems="items-end",
~outerMargin="deskto... | 663 |
hyperswitch-control-center | src/components/highcharts.css | .css | .highchart-sankey .highcharts-link {
fill: rgba(109, 115, 127, 0.2);
}
.highchart-sankey .highcharts-link:hover,
.highchart-sankey .highcharts-link.highcharts-point-hover {
fill: rgba(109, 115, 127, 0.6);
}
.highchart-sankey .highcharts-label-box.highcharts-tooltip-box {
stroke: none;
}
.highchart-sankey .high... | 173 |
hyperswitch-control-center | src/components/DragDropComponent.res | .res | type draggableDefaultDestination = {index: int, droppableId: string}
type draggableItem = React.element
let reorder = (currentState, startIndex, endIndex) => {
if startIndex !== endIndex {
let oldStateArray = Array.copy(currentState)
let removed = Js.Array.removeCountInPlace(~pos=startIndex, ~count=1, oldSta... | 577 |
hyperswitch-control-center | src/components/ReactDebounce.res | .res | let useDebounced = (~wait=?, fn) => {
let ref = React.useRef(Debounce.make(~wait?, fn))
ref.current
}
let useControlled = (~wait=?, fn) => {
let ref = React.useRef(Debounce.makeControlled(~wait?, fn))
ref.current
}
| 69 |
hyperswitch-control-center | src/components/ErrorBoundary.res | .res | /*
? Reference - https://github.com/rescript-lang/rescript-react/blob/master/src/RescriptReactErrorBoundary.res
*/
let defaultFallback = _ =>
<div className="text-red-600 font-bold text-center flex flex-col items-center">
{"An error occured"->React.string}
<Button text="reset" buttonType=Primary onClick={_... | 131 |
hyperswitch-control-center | src/components/AdvancedSearchModal.res | .res | module SearchActions = {
@react.component
let make = (~detailsKeyList, ~dictData, ~entity: EntityType.entityType<'colType, 't>) => {
<ShowDetails.EntityData dictData detailsKeyList entity />
}
}
module AdvanceSearch = {
@react.component
let make = (
~searchFields,
~url,
~entity: EntityType.en... | 1,137 |
hyperswitch-control-center | src/components/DynamicChart.res | .res | open LogicUtils
type cardinality = Top_5 | Top_10
type granularity =
| G_THIRTYSEC
| G_ONEMIN
| G_FIVEMIN
| G_FIFTEENMIN
| G_THIRTYMIN
| G_ONEHOUR
| G_ONEDAY
let getGranularityString = granularity => {
switch granularity {
| G_THIRTYSEC => "G_THIRTYSEC"
| G_ONEMIN => "G_ONEMIN"
| G_FIVEMIN => "G... | 7,055 |
hyperswitch-control-center | src/components/HyperSwitchLogo.res | .res | type theme = Light | Dark
@react.component
let make = (
~logoClass="",
~handleClick=?,
~logoVariant=CommonAuthTypes.IconWithText,
~logoHeight="h-6",
~theme=Dark,
~iconUrl=None,
) => {
let iconFolder = switch theme {
| Dark => "Dark"
| Light => "Light"
}
let handleClickEvent = ev => {
switch ... | 232 |
hyperswitch-control-center | src/components/Pagination.res | .res | external formEventToInt: ReactEvent.Form.t => int = "%identity"
@react.component
let make = (~resultsPerPage, ~totalResults, ~currentPage, ~paginate, ~btnCount=4) => {
let pageNumbers = []
let isMobileView = MatchMedia.useMobileChecker()
let (dropDownVal, setDropDownVal) = React.useState(_ => "1-10")
let tota... | 1,012 |
hyperswitch-control-center | src/components/CopyFieldValue.res | .res | @react.component
let make = (~fieldkey) => {
let data = ReactFinalForm.useField(fieldkey).input.value
<Clipboard.Copy data />
}
| 35 |
hyperswitch-control-center | src/components/LoadedTable.res | .res | open DynamicTableUtils
open NewThemeUtils
type sortTyp = ASC | DSC
type sortOb = {
sortKey: string,
sortType: sortTyp,
}
type checkBoxProps = {
showCheckBox: bool,
selectedData: array<JSON.t>,
setSelectedData: (array<JSON.t> => array<JSON.t>) => unit,
}
let checkBoxPropDefaultVal: checkBoxProps = {
showCh... | 7,254 |
hyperswitch-control-center | src/components/RippleEffectBackground.res | .res | type styleObj
type event
type domObj = {
clientWidth: int,
clientHeight: int,
}
@get external style: Dom.element => styleObj = "style"
@send external setAttribute: (Dom.element, string, string) => unit = "setAttribute"
@val external document: 'a = "document"
@set external setWidth: (styleObj, string) => unit = "wid... | 886 |
hyperswitch-control-center | src/components/ToastContainer.res | .res | module ToastHeading = {
@react.component
let make = (~toastProps: ToastState.toastProps, ~hideToast, ~toastDuration=0) => {
React.useEffect(() => {
let duration = if toastDuration == 0 {
3000
} else {
toastDuration
}
let timeout = {
setTimeout(() => {
hi... | 917 |
hyperswitch-control-center | src/components/HSwitchSingleStatWidget.res | .res | type statChartColor = [#blue | #grey]
open ApexCharts
@react.component
let make = (
~title,
~tooltipText,
~deltaTooltipComponent=React.null,
~value: float,
~data,
~statType="",
~borderRounded="rounded-lg",
~singleStatLoading=false,
~showPercentage=true,
~loaderType: AnalyticsUtils.loaderType=Shimmer... | 1,229 |
hyperswitch-control-center | src/components/UnauthorizedPage.res | .res | @react.component
let make = (
~message="You don't have access to this module. Contact admin for access",
~url="unauthorized",
) => {
let {setDashboardPageState} = React.useContext(GlobalProvider.defaultContext)
<NoDataFound message renderType={Locked}>
<Button
text={"Go to Home"}
buttonType=Pri... | 139 |
hyperswitch-control-center | src/components/RemoteFiltersUtils.res | .res | open LogicUtils
type urlKEyType = Boolean | Float | Int
let getFinalDict = (
~filterJson,
~filtersFromUrl,
~options: array<EntityType.optionType<'t>>,
~isEulerOrderEntity,
~dropdownSearchKeyValueNames,
~searchkeysDict,
~isSearchKeyArray,
~defaultKeysAllowed=["offset", "order", "orderType", "merchantId... | 3,177 |
hyperswitch-control-center | src/components/Tabs.resi | .resi | type tabView = Compress | Expand
type tab = {
title: string,
tabElement?: React.element,
renderContent: unit => React.element,
onTabSelection?: unit => unit,
}
type activeButton = {left: bool, right: bool}
type boundingClient = {x: int, right: int}
type scrollIntoViewParams = {behavior: string, block: string, i... | 726 |
hyperswitch-control-center | src/components/Table.resi | .resi | let regex: string => RescriptCore.RegExp.t
let highlightedText: (Js.String.t, string) => React.element
type labelColor = TableUtils.labelColor =
| LabelGreen
| LabelRed
| LabelBlue
| LabelGray
| LabelOrange
| LabelYellow
| LabelLightGray
type filterDataType = TableUtils.filterDataType = Float(float, float... | 2,753 |
hyperswitch-control-center | src/components/InlineEditInput.res | .res | module HoverInline = {
@react.component
let make = (
~customStyle="",
~leftIcon,
~value,
~subText,
~showEditIconOnHover,
~leftActionButtons,
~labelTextCustomStyle,
~customWidth,
) => {
<div
className={`group/inlineHover relative font-medium flex flex-row items-center p-2 ... | 1,456 |
hyperswitch-control-center | src/components/SelectModal.res | .res | @react.component
let make = (
~modalHeading="Select Options",
~modalHeadingDescription="",
~showModal,
~setShowModal,
~isModalView=true,
~onSubmit,
~initialValues,
~options,
~revealFrom=Reveal.Right,
~closeOnOutsideClick=true,
~title="Columns",
~submitButtonText=?,
~disableSelect=false,
~sho... | 1,249 |
hyperswitch-control-center | src/components/HeadlessUISelectBox.res | .res | open HeadlessUI
type updatedOptionWithIcons = {
label: string,
value: string,
isDisabled: bool,
leftIcon: Button.iconType,
customTextStyle: option<string>,
customIconStyle: option<string>,
rightIcon: Button.iconType,
description: option<string>,
}
@react.component
let make = (
~value: value=String("... | 1,671 |
hyperswitch-control-center | src/components/SnackBarContainer.res | .res | module Snackbar = {
@react.component
let make = (~snackbarProps: SnackBarState.snackbarProps, ~hideSnackbar) => {
let borderCss = snackbarProps.snackbarType != General ? "border-l-4" : ""
let borderColor = switch snackbarProps.snackbarType {
| General
| Information => "border-jp-2-primary-300"
... | 772 |
hyperswitch-control-center | src/components/Chip.res | .res | @react.component
let make = (~values=[], ~showButton=false, ~onButtonClick=_ => (), ~converterFn=str => str) => {
<RenderIf condition={values->Array.length !== 0}>
<div className="flex flex-wrap flex-row">
{values
->Array.map(value => {
let onClick = _ => {
onButtonClick(value)
... | 281 |
hyperswitch-control-center | src/components/Debounce.res | .res | type debounced<'a> = {
invoke: 'a => unit,
schedule: 'a => unit,
scheduled: unit => bool,
cancel: unit => unit,
}
let makeControlled = (~wait=100, fn: 'a => unit): debounced<'a> => {
let timerId = ref(None)
let lastArg = ref(None)
let lastCallTime = ref(None)
let shouldCall = time =>
switch lastCa... | 518 |
hyperswitch-control-center | src/components/CardTable.res | .res | module TextCard = {
@react.component
let make = (~text) => {
if text->LogicUtils.isNonEmptyString {
<p className="break-words font-semibold">
<HelperComponents.EllipsisText
endValue=10 displayValue={text->LogicUtils.isNonEmptyString ? text : "N/A"} showCopy=false
/>
</p>
... | 1,098 |
hyperswitch-control-center | src/components/Navbar.res | .res | let bgClass = "bg-white hover:bg-jp-gray-100"
module MenuOption = {
@react.component
let make = (~text=?, ~children=?, ~onClick=?) => {
<AddDataAttributes attributes=[("data-testid", text->Option.getOr("")->String.toLowerCase)]>
<button
className={`px-4 py-3 flex text-sm w-full text-gray-700 curs... | 1,056 |
hyperswitch-control-center | src/components/PopUpConfirm.res | .res | open PopUpState
open PopUpConfirmUtils
external toMouseEvent: JsxEvent.synthetic<ReactEvent.Keyboard.tag> => JsxEvent.synthetic<
JsxEvent.Mouse.tag,
> = "%identity"
module Close = {
@react.component
let make = (~onClick) => {
<AddDataAttributes attributes=[("data-component", `popUpConfirmClose`)]>
{on... | 1,554 |
hyperswitch-control-center | src/components/HandlingEvents.res | .res | type jsonData = {data: JSON.t}
external convertToCustomEvent: Webapi.Dom.Event.t => jsonData = "%identity"
type cookieData = {changed: array<JSON.t>}
external convertToCookieCustomEvent: Webapi.Dom.Event.t => cookieData = "%identity"
let getEventDict = (ev: Dom.event) => {
let objData = ev->convertToCustomEvent
t... | 136 |
hyperswitch-control-center | src/components/Tabs.res | .res | type tabView = Compress | Expand
type tab = {
title: string,
tabElement?: React.element,
renderContent: unit => React.element,
onTabSelection?: unit => unit,
}
type activeButton = {
left: bool,
right: bool,
}
type boundingClient = {x: int, right: int}
type scrollIntoViewParams = {behavior: string, block: s... | 2,510 |
hyperswitch-control-center | src/components/CustomInputSelectBox.res | .res | @react.component
let make = (
~onChange,
~value,
~buttonText,
~showBorder=?,
~options,
~allowMultiSelect=false,
~isDropDown=true,
~hideMultiSelectButtons=false,
~isHorizontal=false,
~deselectDisable=false,
~buttonType=Button.SecondaryFilled,
~customButtonStyle="",
~customStyle="",
~textStyle... | 283 |
hyperswitch-control-center | src/components/SelectBox.resi | .resi | type retType = CheckBox(array<string>) | Radiobox(string)
external toDict: 'a => RescriptCore.Dict.t<'t> = "%identity"
@send external getClientRects: Dom.element => Dom.domRect = "getClientRects"
@send external focus: Dom.element => unit = "focus"
external ffInputToSelectInput: ReactFinalForm.fieldRenderPropsInput => R... | 3,976 |
hyperswitch-control-center | src/components/LocalFilters.res | .res | module CheckLocalFilters = {
@react.component
let make = (
~options: array<EntityType.optionType<'t>>,
~checkedFilters,
~removeFilters,
~addFilters,
~applyFilters,
~selectedFiltersList,
~addFilterStyle,
~showSelectFiltersSearch,
) => {
let isMobileView = MatchMedia.useMobileChe... | 1,700 |
hyperswitch-control-center | src/components/RangeSlider.res | .res | @react.component
let make = (
~max="5000",
~min="1200",
~width="200px",
~maxSlide: ReactFinalForm.fieldRenderPropsInput,
~minSlide: ReactFinalForm.fieldRenderPropsInput,
) => {
let max = Math.ceil(max->Js.Float.fromString)
let min = Math.floor(min->Js.Float.fromString)
let (minSlideVal, setMinSlideVal) ... | 2,027 |
hyperswitch-control-center | src/components/TableUtils.res | .res | let regex = searchString => {
RegExp.fromStringWithFlags(`` ++ searchString ++ ``, ~flags="gi")
}
let highlightedText = (str, searchedText) => {
let shouldHighlight =
searchedText->LogicUtils.isNonEmptyString &&
String.includes(str->String.toLowerCase, searchedText->String.toLowerCase)
if shouldHighligh... | 7,017 |
hyperswitch-control-center | src/components/InlineEditInput.resi | .resi | module HoverInline: {
@react.component
let make: (
~customStyle: string=?,
~leftIcon: option<React.element>,
~value: string,
~subText: string,
~showEditIconOnHover: bool,
~leftActionButtons: React.element,
~labelTextCustomStyle: string,
~customWidth: string,
) => React.element
}
@r... | 274 |
hyperswitch-control-center | src/components/PopUpConfirmUtils.res | .res | let containerBorderRadius = "rounded-xl"
let overlayStyle = "bg-grey-700 bg-opacity-70 backdrop-blur-sm"
let headerStyle = "text-2xl font-semibold"
let subHeaderStyle = "text-md font-medium leading-7 opacity-50 mt-2 w-full"
let modalWidth = "md:w-4/12 md:left-1/3"
let imageStyle = "w-12 h-12 my-auto border-gray-100"... | 181 |
hyperswitch-control-center | src/components/ShowDetails.res | .res | open LogicUtils
type loadDataType = Loading | Loaded(Dict.t<JSON.t>, Dict.t<JSON.t>) | LoadError(string)
type errorType = {
error: bool,
errorMessage: string,
userMessage: string,
}
module EntityData = {
@react.component
let make = (
~dictData: Dict.t<JSON.t>,
~syncData=Dict.make(),
~detailsKeyL... | 772 |
hyperswitch-control-center | src/components/CustomizeTableColumns.res | .res | @react.component
let make = (
~allHeadersArray=[],
~visibleColumns=[],
~setColumns,
~getHeading: 'colType => Table.header,
~defaultColumns,
~showModal,
~setShowModal,
~isModalView=true,
~orderdColumnBasedOnDefaultCol: bool=false,
~sortingBasedOnDisabled=true,
~showSerialNumber=true,
) => {
let h... | 502 |
hyperswitch-control-center | src/components/HSwitchFeedBackModalUtils.res | .res | type modalType = FeedBackModal | RequestConnectorModal
let makeFieldInfo = FormRenderer.makeFieldInfo
let feedbackTextBox = makeFieldInfo(
~label="",
~name="feedbacks",
~placeholder="Tell us in words...",
~customInput=InputFields.multiLineTextInput(~isDisabled=false, ~rows=Some(6), ~cols=Some(4)),
)
type fee... | 530 |
hyperswitch-control-center | src/components/FilterSelectBox.res | .res | type retType = CheckBox(array<string>) | Radiobox(string)
external toDict: 'a => Dict.t<'t> = "%identity"
@send external getClientRects: Dom.element => Dom.domRect = "getClientRects"
@send external focus: Dom.element => unit = "focus"
external ffInputToSelectInput: ReactFinalForm.fieldRenderPropsInput => ReactFinalFo... | 16,692 |
hyperswitch-control-center | src/components/EntityScaffold.res | .res | @react.component
let make = (
~entityName="",
~remainingPath,
~isAdminAccount=false,
~access: CommonAuthTypes.authorization=Access,
~renderList,
~renderNewForm=_ => React.null,
~renderShow=(_, _) => React.null,
~renderCustomWithOMP: (string, option<string>, option<string>, option<string>) => React.eleme... | 221 |
hyperswitch-control-center | src/components/LegacySwitch.res | .res | 1 | |
hyperswitch-control-center | src/components/LoadedTable.resi | .resi | type sortTyp = ASC | DSC
type sortOb = {sortKey: string, sortType: sortTyp}
type checkBoxProps = {
showCheckBox: bool,
selectedData: array<JSON.t>,
setSelectedData: (array<JSON.t> => array<JSON.t>) => unit,
}
let checkBoxPropDefaultVal: checkBoxProps
let sortAtom: Recoil.recoilAtom<RescriptCore.Dict.t<sortOb>>
le... | 1,211 |
hyperswitch-control-center | src/components/MultiLineTextInput.res | .res | @react.component
let make = (
~input: ReactFinalForm.fieldRenderPropsInput,
~placeholder,
~isDisabled,
~rows=?,
~cols=?,
~customClass="",
~leftIcon=?,
~readOnly=?,
~maxLength=?,
~autoFocus=?,
) => {
let showPopUp = PopUpState.useShowPopUp()
let cursorClass = if isDisabled {
"cursor-not-allow... | 624 |
hyperswitch-control-center | src/components/OrderUtils.res | .res | module Section = {
@react.component
let make = (
~children,
~customCssClass="border border-jp-gray-500 dark:border-jp-gray-960 bg-white dark:bg-jp-gray-950 rounded-md p-0 m-3",
) => {
<div className=customCssClass> children </div>
}
}
module DisplayKeyValueParams = {
@react.component
let make =... | 1,666 |
hyperswitch-control-center | src/components/Icon.res | .res | @react.component
let make = (
~name,
~size=20,
~className=?,
~themeBased=false,
~onClick=?,
~parentClass=?,
~customIconColor="",
~customWidth=?,
~customHeight=?,
) => {
let urlPrefix = ""
let useUrl =
<use
className={`fill-current ${customIconColor}`}
xlinkHref={`${urlPrefix}/icon... | 305 |
hyperswitch-control-center | src/components/ACLButton.res | .res | open Button
@react.component
let make = (
~text=?,
~buttonState: buttonState=Normal,
~buttonType: buttonType=SecondaryFilled,
~buttonVariant: buttonVariant=Fit,
~buttonSize: option<buttonSize>=?,
~leftIcon: iconType=NoIcon,
~rightIcon: iconType=NoIcon,
~showBorder=true,
~type_="button",
~onClick=?,... | 424 |
hyperswitch-control-center | src/components/NewPagination.res | .res | @react.component
let make = (~resultsPerPage, ~totalResults, ~currentPage, ~paginate, ~btnCount=4) => {
let pageNumbers = []
let total = Math.ceil(Int.toFloat(totalResults) /. Int.toFloat(resultsPerPage))->Float.toInt
for x in 1 to total {
Array.push(pageNumbers, x)->ignore
}
let pageToLeft =
btnCou... | 467 |
hyperswitch-control-center | src/components/Calendar.res | .res | type month = Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec
type highlighter = {
highlightSelf: bool,
highlightLeft: bool,
highlightRight: bool,
}
type dateObj = {
startDate: string,
endDate: string,
}
module TableRow = {
let defaultCellHighlighter = _ => {
highlightSelf: false... | 3,441 |
hyperswitch-control-center | src/components/Accordion.res | .res | type accordion = {
title: string,
renderContent: unit => React.element,
renderContentOnTop: option<unit => React.element>,
}
type arrowPosition = Left | Right
type mobileRenderType = Modal | Accordion
module SectionAccordion = {
@react.component
let make = (
~title="",
~subtext="",
~children,
... | 1,619 |
hyperswitch-control-center | src/components/CustomizeNotificationsModal.res | .res | @react.component
let make = (
~modalHeading="Select Options",
~showModal,
~setShowModal,
~headerTextClass="text-2xl font-extrabold tracking-tight ml-3.5",
~element,
~revealFrom=Reveal.Right,
~closeOnOutsideClick=true,
~submitButtonText="Update",
~onSubmitModal,
~showLoderButton=false,
~totalNotifi... | 1,121 |
hyperswitch-control-center | src/components/Paginator.res | .res | @react.component
let make = (
~totalResults,
~offset,
~resultsPerPage,
~setOffset,
~handleRefetch=?,
~currrentFetchCount,
~downloadCsv=?,
~isNewPaginator=false,
~actualData,
~tableDataLoading=false,
~setResultsPerPage=_ => (),
~paginationClass="",
~showResultsPerPageSelector=true,
) => {
let... | 1,133 |
hyperswitch-control-center | src/components/AuthWrapperUtils.res | .res | let getValidToken = oStr => {
if oStr !== Some("__failed") && oStr !== Some("") {
oStr
} else {
None
}
}
type tokenType = Default | Original | SwitchOnly
let useLocalStorageToken = tokenType => {
let lcToken = LocalStorage.useStorageValue("login")->getValidToken
let switchToken = LocalStorage.useSto... | 181 |
hyperswitch-control-center | src/components/CustomCharts/LineChartUtils.res | .res | external legendItemAsBool: Highcharts.legendItem => Highcharts.element = "%identity"
open LogicUtils
open Highcharts
open Identity
let defaultColor = "#7cb5ec"
let legendColor = [
defaultColor,
"#90ed7d",
"#f7a35c",
"#8085e9",
"#f15c80",
"#e4d354",
"#2b908f",
"#f45b5b",
"#91e8e1",
]
let defaultLegen... | 6,476 |
hyperswitch-control-center | src/components/CustomCharts/HighchartHorizontalBarChart.res | .res | module RawHBarChart = {
@react.component
let make = (~options: JSON.t) => {
<HighchartsHorizontalBarChart.HBarChart
highcharts={HighchartsHorizontalBarChart.highchartsModule} options
/>
}
}
open HighchartsHorizontalBarChart
let valueFormatter = (
@this
(this: tooltipRecord) => {
`<div class... | 1,192 |
hyperswitch-control-center | src/components/CustomCharts/HighchartPieChart.res | .res | %%raw(`require("./highcharts.css")`)
module RawPieChart = {
@react.component
let make = (~options: JSON.t) => {
<HighchartsPieChart.PieChart highcharts={HighchartsPieChart.highchartsModule} options />
}
}
open HighchartsPieChart
let valueFormatter = (
@this
(this: tooltipRecord) => {
`<div class='tex... | 878 |
hyperswitch-control-center | src/components/CustomCharts/highcharts.css | .css | .highcharts-data-label-connector {
stroke-dasharray: 2, 2;
stroke: #151a1f;
opacity: 0.3;
stroke-width: 2px;
}
| 47 |
hyperswitch-control-center | src/components/CustomCharts/HighchartBarChart.res | .res | module RawBarChart = {
@react.component
let make = (~options: JSON.t) => {
<Highcharts.BarChart highcharts={Highcharts.highchartsModule} options />
}
}
module HighBarChart1D = {
@react.component
let make = (
~rawData: array<JSON.t>,
~groupKey,
~isHrizonatalBar: bool=true,
~selectedMetrics... | 474 |
hyperswitch-control-center | src/components/CustomCharts/HighchartTimeSeriesChart.res | .res | open Highcharts
open LogicUtils
open DictionaryUtils
module TooltipString = {
@react.component
let make = (~text, ~showTableBelow) => {
let isMobileView = MatchMedia.useMobileChecker()
let class = showTableBelow ? "w-fit" : "w-20"
if text->String.length > 15 && !showTableBelow {
<ToolTip
... | 7,111 |
hyperswitch-control-center | src/components/CustomCharts/FunnelChart.res | .res | type funnelMetric = Volume | Rate
@react.component
let make = (
~data,
~metrics: array<LineChartUtils.metricsConfig>,
~size: float=0.24, // to scale
~moduleName,
~description,
) => {
let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext)
let isMobileView = MatchMedia.use... | 1,774 |
hyperswitch-control-center | src/components/custom-icons/RadioIcon.res | .res | @react.component
let make = (~isSelected, ~size: CheckBoxIcon.size=Small, ~fill="#0EB025", ~isDisabled=false) => {
<AddDataAttributes attributes=[("data-radio", LogicUtils.getStringFromBool(isSelected))]>
{if isSelected {
<svg
width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.... | 495 |
hyperswitch-control-center | src/components/custom-icons/CheckBoxIcon.resi | .resi | type size = Small | Large
@react.component
let make: (
~isSelected: bool,
~isDisabled: bool=?,
~setIsSelected: bool => unit=?,
~size: size=?,
~isSelectedStateMinus: bool=?,
~checkboxDimension: string=?,
~isCheckboxSelectedClass: bool=?,
~stopPropagationNeeded: bool=?,
) => React.element
| 88 |
hyperswitch-control-center | src/components/custom-icons/Tick.res | .res | open LottieFiles
@react.component
let make = (~isSelected) => {
/* let selectedTickJson = useSelectedTickJson()
let deselectTickJson = useDeselectTickJson() */
let selectedTickJson = useLottieJson(selectedTick)
let deselectTickJson = useLottieJson(deselectTick)
let (defaultState, autoplay) = LottieIcons.use... | 169 |
hyperswitch-control-center | src/components/custom-icons/LottieFiles.res | .res | open Promise
type lottieFileJson = Loading(Promise.t<JSON.t>) | Loaded(JSON.t)
let selectedTick = "selectedTick.json"
let deselectTick = "deselectTick.json"
let enterCheckBox = "checkbox.json"
let exitCheckBox = "uncheckbox.json"
let enterSearchCross = "enterCross.json"
let exitSearchCross = "exitCross.json"
let lott... | 402 |
hyperswitch-control-center | src/components/custom-icons/GatewayIcon.res | .res | @react.component
let make = (~gateway, ~className="w-14 h-14") => {
let imagePath = `/Gateway`
<img alt={`${gateway}`} className src={`${imagePath}/${gateway}.svg`} />
}
| 50 |
hyperswitch-control-center | src/components/custom-icons/FormErrorIcon.res | .res | @react.component
let make = (~size=10) => {
<AddDataAttributes attributes=[("data-icon", "formErrorIcon")]>
<svg
className={`fill-red-500 mr-1.5`}
width={Int.toString(size) ++ "px"}
height={Int.toString(size) ++ "px"}
viewBox="0 0 8 9"
xmlns="http://www.w3.org/2000/svg">
<path
... | 870 |
hyperswitch-control-center | src/components/custom-icons/Loadericon.res | .res | @react.component
let make = (~iconColor=?, ~size=16) => {
let theme = ThemeProvider.useTheme()
let svgColor = switch iconColor {
| Some(color) => color
| None =>
switch theme {
| Light => "text-jp-gray-900"
| Dark => "text-white"
}
}
<svg
width={Int.toString(size)}
height={Int.toSt... | 2,687 |
hyperswitch-control-center | src/components/custom-icons/LottieIcons.res | .res | let useLottieIcon = (isSelected, selectedLottieJson, deselectLottieJson) => {
let hasRendered = React.useRef(false)
let (defaultState, setDefaultState) = React.useState(() =>
isSelected ? deselectLottieJson : selectedLottieJson
)
let (autoplay, setAutoplay) = React.useState(() => false)
React.useEffect(... | 200 |
hyperswitch-control-center | src/components/custom-icons/CheckBoxIcon.res | .res | type size = Small | Large
open LottieFiles
@react.component
let make = (
~isSelected,
~isDisabled=false,
~setIsSelected=?,
~size: size=Small,
~isSelectedStateMinus=false,
~checkboxDimension="w-4 h-4",
~isCheckboxSelectedClass=false,
~stopPropagationNeeded=false,
) => {
let onClick = ev => {
if st... | 1,135 |
hyperswitch-control-center | src/components/router/Link.res | .res | @react.component
let make = (~to_, ~children, ~openInNewTab=false, ~className=?, ~onClick=?) => {
let handleClick = React.useCallback(ev => {
ReactEvent.Mouse.stopPropagation(ev)
ReactEvent.Mouse.preventDefault(ev)
switch onClick {
| Some(fn) => fn(to_)
| None => ()
}
to_->RescriptReactRo... | 173 |
hyperswitch-control-center | src/components/form/YesNoRadioInput.res | .res | @react.component
let make = (~input: ReactFinalForm.fieldRenderPropsInput) => {
<div className="flex items-center gap-5">
<div className="flex items-center gap-2">
<input
name={input.name}
label="Yes"
value="yes"
type_="radio"
checked={input.value == "yes"->JSON.Encod... | 215 |
hyperswitch-control-center | src/components/form/TextInput.res | .res | @send external focus: Dom.element => unit = "focus"
@send @return(nullable) external closest: (Dom.element, string) => option<Dom.element> = "closest"
@react.component
let make = (
~focusOnKeyPress=?,
~input: ReactFinalForm.fieldRenderPropsInput,
~placeholder,
~description="",
~isDisabled=false,
~type_="te... | 2,478 |
hyperswitch-control-center | src/components/form/FormRenderer.res | .res | open InputFields
type inputFieldType = {
name: string,
placeholder: string,
format: option<(~value: JSON.t, ~name: string) => JSON.t>,
parse: option<(~value: JSON.t, ~name: string) => JSON.t>,
disabled: bool,
isRequired: bool,
@as("type") type_: string,
customInput: customInputFn,
validate: option<(op... | 5,294 |
hyperswitch-control-center | src/components/form/LabelVisibilityContext.res | .res | let formLabelRenderContext = React.createContext(true)
module Provider = {
let make = React.Context.provider(formLabelRenderContext)
}
@react.component
let make = (~children, ~showLabel) => {
<Provider value=showLabel>
<div> children </div>
</Provider>
}
| 65 |
hyperswitch-control-center | src/components/form/NumericTextInput.res | .res | let getFloat = strJson => strJson->JSON.Decode.string->Option.flatMap(val => val->Float.fromString)
@react.component
let make = (
~input: ReactFinalForm.fieldRenderPropsInput,
~placeholder,
~isDisabled=false,
~type_="text",
~inputMode="number",
~customStyle="",
~pattern=?,
~autoComplete=?,
~min=?,
... | 934 |
hyperswitch-control-center | src/components/form/FormValuesSpy.res | .res | module JsonBox = {
@react.component
let make = (~json) => {
<div
className="flex-1 border border-purple-500 m-2 overflow-scroll whitespace-pre font-fira-code">
{json->JSON.stringifyWithIndent(2)->React.string}
</div>
}
}
@react.component
let make = (~wrapperClass="", ~jsonModifier=?, ~restri... | 260 |
hyperswitch-control-center | src/components/form/PillInput.res | .res | @send external focus: Dom.element => unit = "focus"
@react.component
let make = (~name, ~initialItems: array<string>=[], ~placeholder, ~duplicateCheck=true) => {
let form = ReactFinalForm.useForm()
let (items, setItems) = React.useState(_ => initialItems)
let (inputValue, setInputValue) = React.useState(_ => "")
... | 1,560 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.