repo stringclasses 4
values | file_path stringlengths 6 193 | extension stringclasses 23
values | content stringlengths 0 1.73M | token_count int64 0 724k | __index_level_0__ int64 0 10.8k |
|---|---|---|---|---|---|
hyperswitch-control-center | src/components/MobileView.res | .res | @react.component
let make = (~children) => {
let isMobileView = MatchMedia.useMobileChecker()
<RenderIf condition=isMobileView> children </RenderIf>
}
| 39 | 10,021 |
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 | 10,022 |
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 | 10,023 |
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 | 10,024 |
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 | 10,025 |
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 | 10,026 |
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 | 10,027 |
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 | 10,028 |
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 | 10,029 |
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 | 10,030 |
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 | 10,031 |
hyperswitch-control-center | src/components/CopyFieldValue.res | .res | @react.component
let make = (~fieldkey) => {
let data = ReactFinalForm.useField(fieldkey).input.value
<Clipboard.Copy data />
}
| 35 | 10,032 |
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 | 10,033 |
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 | 10,034 |
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 | 10,035 |
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 | 10,036 |
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 | 10,037 |
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 | 10,038 |
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 | 10,039 |
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 | 10,040 |
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 | 10,041 |
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 | 10,042 |
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 | 10,043 |
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 | 10,044 |
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 | 10,045 |
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 | 10,046 |
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 | 10,047 |
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 | 10,048 |
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 | 10,049 |
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 | 10,050 |
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 | 10,051 |
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 | 10,052 |
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 | 10,053 |
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 | 10,054 |
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 | 10,055 |
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 | 10,056 |
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 | 10,057 |
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 | 10,058 |
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 | 10,059 |
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 | 10,060 |
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 | 10,061 |
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 | 10,062 |
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 | 10,063 |
hyperswitch-control-center | src/components/LegacySwitch.res | .res | 1 | 10,064 | |
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 | 10,065 |
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 | 10,066 |
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 | 10,067 |
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 | 10,068 |
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 | 10,069 |
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 | 10,070 |
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 | 10,071 |
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 | 10,072 |
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 | 10,073 |
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 | 10,074 |
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 | 10,075 |
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 | 10,076 |
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 | 10,077 |
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 | 10,078 |
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 | 10,079 |
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 | 10,080 |
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 | 10,081 |
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 | 10,082 |
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 | 10,083 |
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 | 10,084 |
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 | 10,085 |
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 | 10,086 |
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 | 10,087 |
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 | 10,088 |
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 | 10,089 |
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 | 10,090 |
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 | 10,091 |
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 | 10,092 |
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 | 10,093 |
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 | 10,094 |
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 | 10,095 |
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 | 10,096 |
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 | 10,097 |
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 | 10,098 |
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 | 10,099 |
hyperswitch-control-center | src/components/form/MultipleTextInput.res | .res | module Tag = {
@react.component
let make = (~text, ~remove, ~customButtonStyle=?, ~disabled=false) => {
let handleOnRemove = e => {
e->ReactEvent.Mouse.stopPropagation
remove(text)
}
let buttonStyle = switch customButtonStyle {
| Some(buttonStyle) => buttonStyle
| None => ""
}
... | 1,279 | 10,100 |
hyperswitch-control-center | src/components/form/PasswordStrengthInput.res | .res | type regexTest = {
regex: Js.Re.t,
weight: float,
}
type warningColor = Red | Yellow | Green
type warningMessage = {
message: string,
color: warningColor,
}
@react.component
let make = (
~input: ReactFinalForm.fieldRenderPropsInput,
~placeholder,
~displayStatus=true,
~leftIcon=?,
(),
) => {
let tes... | 677 | 10,101 |
hyperswitch-control-center | src/components/form/BoolInput.res | .res | external ffInputToBoolInput: ReactFinalForm.fieldRenderPropsInput => ReactFinalForm.fieldRenderPropsCustomInput<
bool,
> = "%identity"
module BaseComponent = {
@react.component
let make = (
~isSelected,
~setIsSelected,
~size: CheckBoxIcon.size=Small,
~isDisabled=false,
~boolCustomClass="",
... | 986 | 10,102 |
hyperswitch-control-center | src/components/form/PasswordStrengthInputAsChips.res | .res | type passwordCheck = {
number: bool,
lowercase: bool,
uppercase: bool,
specialChar: bool,
minEightChars: bool,
}
type chipType = Number | Lowercase | Uppercase | SpecialChar | MinEightChars
module PasswordChip = {
@react.component
let make = (~passwordChecks: passwordCheck, ~chipType: chipType, ~customT... | 1,153 | 10,103 |
hyperswitch-control-center | src/components/portal/PortalCapture.res | .res | @react.component
let make = React.memo((~name: string, ~customStyle="") => {
let setPortalNodes = Recoil.useSetRecoilState(PortalState.portalNodes)
let setDiv = React.useCallback2((elem: Nullable.t<Dom.element>) => {
setPortalNodes(
prevDict => {
let clonedDict =
prevDict
->Dic... | 188 | 10,104 |
hyperswitch-control-center | src/components/portal/Portal.res | .res | @react.component
let make = (~to, ~children) => {
let portalNodes = Recoil.useRecoilValueFromAtom(PortalState.portalNodes)
let portalNode = Dict.get(portalNodes, to)
switch portalNode {
| Some(domNode) => ReactDOM.createPortal(children, domNode)
| None => children
}
}
| 76 | 10,105 |
hyperswitch-control-center | src/components/portal/PortalState.res | .res | let defaultDict: Dict.t<Dom.element> = Dict.make()
let portalNodes = Recoil.atom("portalNodes", defaultDict)
| 28 | 10,106 |
hyperswitch-control-center | src/components/Graphs/LineAndColumn/LineAndColumnGraph.res | .res | external lineColumnGraphOptionsToJson: LineAndColumnGraphTypes.lineColumnGraphOptions => JSON.t =
"%identity"
@react.component
let make = (~options: LineAndColumnGraphTypes.lineColumnGraphOptions, ~className="") => {
<div className>
<Highcharts.Chart
options={options->lineColumnGraphOptionsToJson} highch... | 87 | 10,107 |
hyperswitch-control-center | src/components/Graphs/LineAndColumn/LineAndColumnGraphUtils.res | .res | open LineAndColumnGraphTypes
let darkGray = "#525866"
let lightGray = "#999999"
let gridLineColor = "#e6e6e6"
let fontFamily = "InterDisplay"
let labelFormatter = (
@this
this => {
`<div style="display: flex; align-items: center;">
<div style="width: 13px; height: 13px; background-color:${this.color};... | 1,638 | 10,108 |
hyperswitch-control-center | src/components/Graphs/LineAndColumn/LineAndColumnGraphTypes.res | .res | type \"type" = string
type zoomType = string
type spacingLeft = int
type spacingRight = int
type info = {index: int}
type series = {name: string}
type point = {color: string, x: string, y: float, point: info, key: string, series: series}
type pointFormatter = {points: array<point>}
type yAxisFormatter = {value: int}
... | 1,002 | 10,109 |
hyperswitch-control-center | src/components/Graphs/LineGraph/LineGraphTypes.res | .res | type \"type" = string
type spacingLeft = int
type spacingRight = int
type info = {index: int}
type pointSeries = {name: string}
type point = {color: string, x: string, y: float, point: info, series: pointSeries}
type pointFormatter = {points: array<point>}
type yAxisFormatter = {value: int}
external asTooltipPointFor... | 973 | 10,110 |
hyperswitch-control-center | src/components/Graphs/LineGraph/LineGraph.res | .res | external lineGraphOptionsToJson: LineGraphTypes.lineGraphOptions => JSON.t = "%identity"
@react.component
let make = (~options: LineGraphTypes.lineGraphOptions, ~className="") => {
<div className>
<Highcharts.Chart
options={options->lineGraphOptionsToJson} highcharts={Highcharts.highcharts}
/>
</div>... | 78 | 10,111 |
hyperswitch-control-center | src/components/Graphs/LineGraph/LineGraphUtils.res | .res | open LineGraphTypes
// colors
let darkGray = "#525866"
let lightGray = "#999999"
let gridLineColor = "#e6e6e6"
let fontFamily = "InterDisplay"
let valueFormatter = (
@this
this => {
`<div style="display: flex; align-items: center;">
<div style="width: 13px; height: 13px; background-color:${this.color}... | 1,051 | 10,112 |
hyperswitch-control-center | src/components/Graphs/SankyGraph/SankeyGraph.res | .res | external sankeyGraphOptionsToJson: SankeyGraphTypes.sankeyGraphOptions => JSON.t = "%identity"
@react.component
let make = (~options: SankeyGraphTypes.sankeyGraphOptions, ~className="") => {
Highcharts.sankeyChartModule(Highcharts.highchartsModule)
<div className>
<Highcharts.Chart
options={options->san... | 101 | 10,113 |
hyperswitch-control-center | src/components/Graphs/SankyGraph/SankeyGraphTypes.res | .res | type temp = {name: int}
type options = {dataLabels: temp}
type point = {sum: string, id: string, options: options}
type nodeFormatter = {point: point}
type tooltipType = Node | Link
type fromNode = {options: options}
type toNode = {options: options}
type pointFormat = {
sum: string,
id: string,
options: optio... | 623 | 10,114 |
hyperswitch-control-center | src/components/Graphs/SankyGraph/SankeyGraphUtils.res | .res | open SankeyGraphTypes
// contants
let textColor = "#333333"
let fontFamily = "Arial, sans-serif"
let valueFormatter = (
@this
(this: nodeFormatter) => {
let weight = this.point.options.dataLabels.name
let sum = weight->Int.toFloat->LogicUtils.valueFormatter(Volume)
let label = `<span style="font-size:... | 938 | 10,115 |
hyperswitch-control-center | src/components/Graphs/ColumnGraph/ColumnGraph.res | .res | external barGraphOptionsToJson: ColumnGraphTypes.columnGraphOptions => JSON.t = "%identity"
@react.component
let make = (~options: ColumnGraphTypes.columnGraphOptions, ~className="") => {
<div className>
<Highcharts.Chart options={options->barGraphOptionsToJson} highcharts={Highcharts.highcharts} />
</div>
}
| 75 | 10,116 |
hyperswitch-control-center | src/components/Graphs/ColumnGraph/ColumnGraphTypes.res | .res | type \"type" = string
type spacingLeft = int
type spacingRight = int
type categories = array<string>
type align = string
type color = string
type gridLineWidth = int
type gridLineColor = string
type gridLineDashStyle = string
type tickmarkPlacement = string
type endOnTick = bool
type startOnTick = bool
type tickInterv... | 747 | 10,117 |
hyperswitch-control-center | src/components/Graphs/ColumnGraph/ColumnGraphUtils.res | .res | // constants
let fontFamily = "InterDisplay"
let darkGray = "#525866"
open ColumnGraphTypes
let labelFormatter = (
@this
(this: legendPoint) => {
`<div style="display: flex; align-items: center;">
<div style="width: 13px; height: 13px; background-color:${this.color}; border-radius:3px;"></div>
... | 1,286 | 10,118 |
hyperswitch-control-center | src/components/Graphs/BarGraph/BarGraph.res | .res | external barGraphOptionsToJson: BarGraphTypes.barGraphOptions => JSON.t = "%identity"
@react.component
let make = (~options: BarGraphTypes.barGraphOptions, ~className="") => {
<div className>
<Highcharts.Chart options={options->barGraphOptionsToJson} highcharts={Highcharts.highcharts} />
</div>
}
| 75 | 10,119 |
hyperswitch-control-center | src/components/Graphs/BarGraph/BarGraphTypes.res | .res | type \"type" = string
type spacingLeft = int
type spacingRight = int
type categories = array<string>
type align = string
type color = string
type gridLineWidth = int
type gridLineColor = string
type gridLineDashStyle = string
type tickmarkPlacement = string
type endOnTick = bool
type startOnTick = bool
type tickInterv... | 630 | 10,120 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.