@onehat/ui 0.3.381 → 0.4.0
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/package.json +37 -9
- package/src/Components/Accordion/Accordion.js +22 -17
- package/src/Components/Blank.js +1 -3
- package/src/Components/Buttons/BackButton.js +21 -12
- package/src/Components/Buttons/Button.js +65 -13
- package/src/Components/Buttons/CartButtonWithBadge.js +14 -6
- package/src/Components/Buttons/IconButton.js +31 -74
- package/src/Components/Buttons/PlusMinusButton.js +34 -21
- package/src/Components/Buttons/ReloadButton.js +7 -8
- package/src/Components/Buttons/SquareButton.js +41 -55
- package/src/Components/Container/Container.js +55 -16
- package/src/Components/Container/ScreenContainer.js +26 -16
- package/src/Components/Container/Splitter.js +38 -25
- package/src/Components/Editor/Editor.js +3 -2
- package/src/Components/Editor/InlineEditor.js +38 -32
- package/src/Components/Filter/DateRange.js +37 -18
- package/src/Components/Filter/NumberRange.js +87 -83
- package/src/Components/Form/Field/CKEditor/CKEditor.js +4 -4
- package/src/Components/Form/Field/Checkbox/CheckboxGroup.js +9 -6
- package/src/Components/Form/Field/Color.js +95 -86
- package/src/Components/Form/Field/Combo/Combo.js +347 -284
- package/src/Components/Form/Field/Combo/PageSizeCombo.js +4 -7
- package/src/Components/Form/Field/Date.js +276 -312
- package/src/Components/Form/Field/DisplayField.js +11 -5
- package/src/Components/Form/Field/File.js +26 -32
- package/src/Components/Form/Field/FormikForm.js +1018 -0
- package/src/Components/Form/Field/Input.js +91 -41
- package/src/Components/Form/Field/Json.js +25 -21
- package/src/Components/Form/Field/Number.js +70 -51
- package/src/Components/Form/Field/RadioGroup/RadioGroup.js +4 -6
- package/src/Components/Form/Field/Select/PageSizeSelect.js +33 -0
- package/src/Components/Form/Field/Select/Select.js +109 -0
- package/src/Components/Form/Field/Slider.js +38 -30
- package/src/Components/Form/Field/Tag/Tag.js +88 -72
- package/src/Components/Form/Field/Tag/ValueBox.js +25 -20
- package/src/Components/Form/Field/Text.js +21 -12
- package/src/Components/Form/Field/TextArea.js +32 -15
- package/src/Components/Form/Field/Toggle.js +42 -24
- package/src/Components/Form/FieldSet.js +77 -54
- package/src/Components/Form/Form.js +491 -268
- package/src/Components/Form/Label.js +28 -17
- package/src/Components/Gluestack/accordion/index.tsx +394 -0
- package/src/Components/Gluestack/actionsheet/index.tsx +619 -0
- package/src/Components/Gluestack/alert/index.tsx +310 -0
- package/src/Components/Gluestack/alert-dialog/index.tsx +295 -0
- package/src/Components/Gluestack/avatar/index.tsx +190 -0
- package/src/Components/Gluestack/badge/index.tsx +272 -0
- package/src/Components/Gluestack/bottomsheet/index.tsx +294 -0
- package/src/Components/Gluestack/box/index.tsx +19 -0
- package/src/Components/Gluestack/box/index.web.tsx +18 -0
- package/src/Components/Gluestack/box/styles.tsx +10 -0
- package/src/Components/Gluestack/button/index.tsx +494 -0
- package/src/Components/Gluestack/card/index.tsx +23 -0
- package/src/Components/Gluestack/card/index.web.tsx +22 -0
- package/src/Components/Gluestack/card/styles.tsx +20 -0
- package/src/Components/Gluestack/center/index.tsx +22 -0
- package/src/Components/Gluestack/center/index.web.tsx +19 -0
- package/src/Components/Gluestack/center/styles.tsx +8 -0
- package/src/Components/Gluestack/checkbox/index.tsx +305 -0
- package/src/Components/Gluestack/divider/index.tsx +44 -0
- package/src/Components/Gluestack/drawer/index.tsx +354 -0
- package/src/Components/Gluestack/fab/index.tsx +286 -0
- package/src/Components/Gluestack/flat-list/index.tsx +2 -0
- package/src/Components/Gluestack/form-control/index.tsx +527 -0
- package/src/Components/Gluestack/gluestack-ui-provider/config.ts +332 -0
- package/src/Components/Gluestack/gluestack-ui-provider/index.tsx +47 -0
- package/src/Components/Gluestack/gluestack-ui-provider/index.web.tsx +94 -0
- package/src/Components/Gluestack/gluestack-ui-provider/script.ts +19 -0
- package/src/Components/Gluestack/grid/index.tsx +341 -0
- package/src/Components/Gluestack/grid/index.web.tsx +65 -0
- package/src/Components/Gluestack/grid/styles.tsx +15 -0
- package/src/Components/Gluestack/heading/index.tsx +212 -0
- package/src/Components/Gluestack/heading/index.web.tsx +203 -0
- package/src/Components/Gluestack/heading/styles.tsx +43 -0
- package/src/Components/Gluestack/hstack/index.tsx +23 -0
- package/src/Components/Gluestack/hstack/index.web.tsx +22 -0
- package/src/Components/Gluestack/hstack/styles.tsx +25 -0
- package/src/Components/Gluestack/image/index.tsx +52 -0
- package/src/Components/Gluestack/image-background/index.tsx +21 -0
- package/src/Components/Gluestack/index.js +116 -0
- package/src/Components/Gluestack/input/index.tsx +287 -0
- package/src/Components/Gluestack/input-accessory-view/index.tsx +2 -0
- package/src/Components/Gluestack/keyboard-avoiding-view/index.tsx +2 -0
- package/src/Components/Gluestack/link/index.tsx +107 -0
- package/src/Components/Gluestack/menu/index.tsx +210 -0
- package/src/Components/Gluestack/modal/index.tsx +279 -0
- package/src/Components/Gluestack/popover/index.tsx +352 -0
- package/src/Components/Gluestack/portal/index.tsx +13 -0
- package/src/Components/Gluestack/pressable/index.tsx +46 -0
- package/src/Components/Gluestack/progress/index.tsx +164 -0
- package/src/Components/Gluestack/radio/index.tsx +304 -0
- package/src/Components/Gluestack/refresh-control/index.tsx +2 -0
- package/src/Components/Gluestack/safe-area-view/index.tsx +2 -0
- package/src/Components/Gluestack/scroll-view/index.tsx +2 -0
- package/src/Components/Gluestack/section-list/index.tsx +2 -0
- package/src/Components/Gluestack/select/index.tsx +335 -0
- package/src/Components/Gluestack/select/select-actionsheet.tsx +584 -0
- package/src/Components/Gluestack/skeleton/index.tsx +138 -0
- package/src/Components/Gluestack/skeleton/index.web.tsx +103 -0
- package/src/Components/Gluestack/skeleton/styles.tsx +35 -0
- package/src/Components/Gluestack/slider/index.tsx +283 -0
- package/src/Components/Gluestack/spinner/index.tsx +34 -0
- package/src/Components/Gluestack/status-bar/index.tsx +2 -0
- package/src/Components/Gluestack/switch/index.tsx +55 -0
- package/src/Components/Gluestack/table/index.tsx +200 -0
- package/src/Components/Gluestack/table/index.web.tsx +142 -0
- package/src/Components/Gluestack/table/styles.tsx +44 -0
- package/src/Components/Gluestack/text/index.tsx +48 -0
- package/src/Components/Gluestack/text/index.web.tsx +45 -0
- package/src/Components/Gluestack/text/styles.tsx +47 -0
- package/src/Components/Gluestack/textarea/index.tsx +108 -0
- package/src/Components/Gluestack/toast/index.tsx +225 -0
- package/src/Components/Gluestack/tooltip/index.tsx +125 -0
- package/src/Components/Gluestack/utils/use-break-point-value.ts +101 -0
- package/src/Components/Gluestack/view/index.tsx +2 -0
- package/src/Components/Gluestack/virtualized-list/index.tsx +2 -0
- package/src/Components/Gluestack/vstack/index.tsx +24 -0
- package/src/Components/Gluestack/vstack/index.web.tsx +23 -0
- package/src/Components/Gluestack/vstack/styles.tsx +25 -0
- package/src/Components/Grid/Grid.js +192 -135
- package/src/Components/Grid/GridHeaderRow.js +51 -59
- package/src/Components/Grid/GridRow.js +152 -58
- package/src/Components/Grid/HeaderColumnSelectorHandle.js +16 -10
- package/src/Components/Grid/HeaderReorderHandle.js +17 -13
- package/src/Components/Grid/HeaderResizeHandle.js +17 -13
- package/src/Components/Grid/NoRecordsFound.js +15 -18
- package/src/Components/Grid/RowDragHandle.js +9 -13
- package/src/Components/Hoc/Secondary/withSecondaryEditor.js +14 -9
- package/src/Components/Hoc/Secondary/withSecondaryWindowedEditor.js +14 -11
- package/src/Components/Hoc/withAlert.js +150 -200
- package/src/Components/Hoc/withBlank.js +4 -6
- package/src/Components/Hoc/withCollapsible.js +4 -3
- package/src/Components/Hoc/withComponent.js +33 -6
- package/src/Components/Hoc/withContextMenu.js +133 -141
- package/src/Components/Hoc/withData.js +5 -4
- package/src/Components/Hoc/withDnd.js +11 -9
- package/src/Components/Hoc/withDraggable.js +10 -10
- package/src/Components/Hoc/withEditor.js +18 -13
- package/src/Components/Hoc/withEvents.js +4 -6
- package/src/Components/Hoc/withFilters.js +524 -498
- package/src/Components/Hoc/withInlineEditor.js +7 -5
- package/src/Components/Hoc/withModal.js +79 -137
- package/src/Components/Hoc/withMultiSelection.js +4 -2
- package/src/Components/Hoc/withPdfButtons.js +109 -111
- package/src/Components/Hoc/withPresetButtons.js +49 -53
- package/src/Components/Hoc/withSelection.js +6 -5
- package/src/Components/Hoc/withSideEditor.js +12 -6
- package/src/Components/Hoc/withTooltip.js +18 -12
- package/src/Components/Hoc/withValue.js +6 -5
- package/src/Components/Hoc/withWindowedEditor.js +13 -11
- package/src/Components/Icons/AddressBook.js +7 -10
- package/src/Components/Icons/Alt.js +8 -15
- package/src/Components/Icons/AngleLeft.js +7 -14
- package/src/Components/Icons/AngleRight.js +7 -14
- package/src/Components/Icons/AnglesLeft.js +7 -14
- package/src/Components/Icons/AnglesRight.js +7 -14
- package/src/Components/Icons/Asterisk.js +7 -10
- package/src/Components/Icons/Ban.js +9 -14
- package/src/Components/Icons/Bars.js +7 -10
- package/src/Components/Icons/BarsStaggered.js +7 -10
- package/src/Components/Icons/Bell.js +7 -19
- package/src/Components/Icons/BigCircle.js +7 -14
- package/src/Components/Icons/Book.js +7 -10
- package/src/Components/Icons/BookOpen.js +7 -10
- package/src/Components/Icons/Bookmark.js +8 -17
- package/src/Components/Icons/Bug.js +7 -10
- package/src/Components/Icons/Building.js +7 -10
- package/src/Components/Icons/Calendar.js +7 -14
- package/src/Components/Icons/Calendar2.js +7 -14
- package/src/Components/Icons/CalendarDays.js +7 -14
- package/src/Components/Icons/Camera.js +7 -14
- package/src/Components/Icons/CaretDown.js +7 -14
- package/src/Components/Icons/CaretUp.js +7 -14
- package/src/Components/Icons/CartPlus.js +7 -10
- package/src/Components/Icons/CartShopping.js +7 -10
- package/src/Components/Icons/CashRegister.js +7 -10
- package/src/Components/Icons/Certificate.js +7 -10
- package/src/Components/Icons/ChartLine.js +7 -10
- package/src/Components/Icons/ChartPie.js +7 -10
- package/src/Components/Icons/Check.js +7 -10
- package/src/Components/Icons/CheckDouble.js +7 -10
- package/src/Components/Icons/ChevronDown.js +7 -10
- package/src/Components/Icons/ChevronLeft.js +7 -10
- package/src/Components/Icons/ChevronRight.js +7 -10
- package/src/Components/Icons/ChevronUp.js +7 -10
- package/src/Components/Icons/Circle.js +7 -10
- package/src/Components/Icons/CircleArrowRight.js +7 -10
- package/src/Components/Icons/CircleExclamation.js +7 -14
- package/src/Components/Icons/CircleInfo.js +7 -10
- package/src/Components/Icons/CircleQuestion.js +7 -10
- package/src/Components/Icons/CircleXmark.js +7 -10
- package/src/Components/Icons/CircleXmarkRegular.js +7 -10
- package/src/Components/Icons/Clipboard.js +7 -14
- package/src/Components/Icons/ClipboardCheck.js +7 -17
- package/src/Components/Icons/ClipboardList.js +7 -16
- package/src/Components/Icons/Clock.js +7 -10
- package/src/Components/Icons/ClockRegular.js +7 -10
- package/src/Components/Icons/ClockRotateLeft.js +7 -10
- package/src/Components/Icons/Clone.js +7 -10
- package/src/Components/Icons/Collapse.js +7 -14
- package/src/Components/Icons/Comment.js +7 -10
- package/src/Components/Icons/CommentDots.js +7 -10
- package/src/Components/Icons/CommentRegular.js +7 -10
- package/src/Components/Icons/Comments.js +7 -10
- package/src/Components/Icons/CommentsRegular.js +7 -10
- package/src/Components/Icons/Copyright.js +7 -10
- package/src/Components/Icons/Dot.js +10 -15
- package/src/Components/Icons/Download.js +11 -0
- package/src/Components/Icons/Duplicate.js +7 -14
- package/src/Components/Icons/Edit.js +7 -14
- package/src/Components/Icons/EllipsisHorizontal.js +7 -16
- package/src/Components/Icons/EllipsisVertical.js +7 -14
- package/src/Components/Icons/Envelope.js +7 -10
- package/src/Components/Icons/EnvelopeRegular.js +7 -10
- package/src/Components/Icons/Excel.js +7 -10
- package/src/Components/Icons/Exclamation.js +7 -10
- package/src/Components/Icons/Expand.js +7 -10
- package/src/Components/Icons/Eye.js +7 -14
- package/src/Components/Icons/EyeSlash.js +7 -10
- package/src/Components/Icons/File.js +7 -14
- package/src/Components/Icons/FloppyDiskRegular.js +7 -10
- package/src/Components/Icons/Folder.js +7 -10
- package/src/Components/Icons/FolderClosed.js +7 -10
- package/src/Components/Icons/FolderOpen.js +7 -10
- package/src/Components/Icons/FolderTree.js +7 -10
- package/src/Components/Icons/FullWidth.js +10 -25
- package/src/Components/Icons/Gauge.js +7 -17
- package/src/Components/Icons/Gear.js +7 -14
- package/src/Components/Icons/Gears.js +7 -10
- package/src/Components/Icons/Gift.js +7 -10
- package/src/Components/Icons/Grip.js +7 -14
- package/src/Components/Icons/GripLines.js +7 -14
- package/src/Components/Icons/GripLinesVertical.js +7 -14
- package/src/Components/Icons/GripVertical.js +7 -14
- package/src/Components/Icons/Hammer.js +7 -10
- package/src/Components/Icons/Hand.js +7 -10
- package/src/Components/Icons/HighPriority.js +7 -17
- package/src/Components/Icons/House.js +7 -10
- package/src/Components/Icons/Images.js +7 -10
- package/src/Components/Icons/Info.js +7 -10
- package/src/Components/Icons/ItunesNote.js +7 -10
- package/src/Components/Icons/Js.js +7 -16
- package/src/Components/Icons/Leaf.js +7 -10
- package/src/Components/Icons/Link.js +7 -9
- package/src/Components/Icons/List.js +7 -10
- package/src/Components/Icons/ListCheck.js +7 -10
- package/src/Components/Icons/LocationDot.js +7 -10
- package/src/Components/Icons/Loop.js +7 -14
- package/src/Components/Icons/Loop1.js +8 -13
- package/src/Components/Icons/LoopAll.js +8 -13
- package/src/Components/Icons/LowPriority.js +7 -17
- package/src/Components/Icons/MagnifyingGlass.js +7 -10
- package/src/Components/Icons/Maximize.js +7 -10
- package/src/Components/Icons/MedPriority.js +7 -17
- package/src/Components/Icons/Microphone.js +7 -10
- package/src/Components/Icons/Minimize.js +7 -10
- package/src/Components/Icons/Minus.js +7 -14
- package/src/Components/Icons/MobileScreenButton.js +7 -10
- package/src/Components/Icons/MoneyBill.js +7 -10
- package/src/Components/Icons/MoneyBillWave.js +7 -10
- package/src/Components/Icons/Mouth.js +10 -21
- package/src/Components/Icons/Music.js +7 -10
- package/src/Components/Icons/Na.js +7 -14
- package/src/Components/Icons/NoLoop.js +11 -13
- package/src/Components/Icons/NoReorderRows.js +17 -22
- package/src/Components/Icons/ObjectGroupRegular.js +7 -10
- package/src/Components/Icons/Pause.js +7 -10
- package/src/Components/Icons/Pdf.js +7 -10
- package/src/Components/Icons/Pencil.js +7 -14
- package/src/Components/Icons/Phone.js +7 -10
- package/src/Components/Icons/Play.js +7 -10
- package/src/Components/Icons/Plus.js +7 -14
- package/src/Components/Icons/Presentation.js +7 -16
- package/src/Components/Icons/Print.js +7 -14
- package/src/Components/Icons/Question.js +7 -10
- package/src/Components/Icons/Rate-.25x.js +12 -17
- package/src/Components/Icons/Rate-.5x.js +11 -16
- package/src/Components/Icons/Rate-.75x.js +8 -13
- package/src/Components/Icons/Rate-1.25x.js +8 -13
- package/src/Components/Icons/Rate-1.5x.js +8 -13
- package/src/Components/Icons/Rate-1.75x.js +8 -13
- package/src/Components/Icons/Rate-1x.js +11 -16
- package/src/Components/Icons/Rate-2x.js +8 -13
- package/src/Components/Icons/RateIcon-.25x.js +8 -13
- package/src/Components/Icons/RateIcon-.5x.js +11 -16
- package/src/Components/Icons/RateIcon-.75x.js +8 -13
- package/src/Components/Icons/RateIcon-1.25x.js +8 -13
- package/src/Components/Icons/RateIcon-1.5x.js +8 -13
- package/src/Components/Icons/RateIcon-1.75x.js +8 -13
- package/src/Components/Icons/RateIcon-1x.js +8 -13
- package/src/Components/Icons/RateIcon-2x.js +8 -13
- package/src/Components/Icons/RectangleXmark.js +7 -10
- package/src/Components/Icons/RectangleXmarkRegular.js +7 -10
- package/src/Components/Icons/ReorderRows.js +8 -13
- package/src/Components/Icons/RightFromBracket.js +7 -10
- package/src/Components/Icons/RightLeft.js +7 -10
- package/src/Components/Icons/RightToBracket.js +7 -10
- package/src/Components/Icons/Rotate.js +7 -14
- package/src/Components/Icons/RotateLeft.js +7 -10
- package/src/Components/Icons/RotateRight.js +7 -14
- package/src/Components/Icons/ScrewdriverWrench.js +7 -10
- package/src/Components/Icons/Scroll.js +7 -10
- package/src/Components/Icons/Share.js +7 -10
- package/src/Components/Icons/Shop.js +7 -10
- package/src/Components/Icons/SideBySide.js +7 -20
- package/src/Components/Icons/SortDown.js +7 -10
- package/src/Components/Icons/SortDownAlt.js +7 -10
- package/src/Components/Icons/SortUp.js +7 -10
- package/src/Components/Icons/SortUpAlt.js +7 -14
- package/src/Components/Icons/Square.js +7 -10
- package/src/Components/Icons/SquareCheck.js +7 -10
- package/src/Components/Icons/SquareCheckRegular.js +7 -10
- package/src/Components/Icons/SquareMinus.js +7 -14
- package/src/Components/Icons/SquareRegular.js +7 -10
- package/src/Components/Icons/Store.js +7 -10
- package/src/Components/Icons/Table.js +7 -16
- package/src/Components/Icons/ThumbsDown.js +7 -10
- package/src/Components/Icons/ThumbsDownRegular.js +7 -10
- package/src/Components/Icons/ThumbsUp.js +7 -10
- package/src/Components/Icons/ThumbsUpRegular.js +7 -10
- package/src/Components/Icons/Trash.js +7 -14
- package/src/Components/Icons/TrashCan.js +7 -14
- package/src/Components/Icons/TriangleExclamation.js +7 -14
- package/src/Components/Icons/Truck.js +7 -10
- package/src/Components/Icons/TruckFast.js +7 -10
- package/src/Components/Icons/Upload.js +11 -0
- package/src/Components/Icons/UploadDownload.js +11 -11
- package/src/Components/Icons/User.js +7 -10
- package/src/Components/Icons/UserGroup.js +7 -10
- package/src/Components/Icons/UserPlus.js +7 -10
- package/src/Components/Icons/UserSecret.js +7 -10
- package/src/Components/Icons/Video.js +7 -16
- package/src/Components/Icons/X.js +7 -10
- package/src/Components/Icons/Xmark.js +7 -10
- package/src/Components/Layout/CenterBox.js +13 -9
- package/src/Components/Layout/Footer.js +20 -13
- package/src/Components/Messages/ConfirmationMessage.js +30 -13
- package/src/Components/Messages/ErrorMessage.js +29 -23
- package/src/Components/Messages/Loading.js +10 -8
- package/src/Components/Messages/OkMessage.js +30 -13
- package/src/Components/Messages/Unauthorized.js +5 -8
- package/src/Components/Messages/WaitMessage.js +37 -73
- package/src/Components/Panel/AccordionGridPanel.js +6 -6
- package/src/Components/Panel/FormPanel.js +7 -3
- package/src/Components/Panel/Header.js +132 -94
- package/src/Components/Panel/Mask.js +4 -4
- package/src/Components/Panel/Panel.js +55 -72
- package/src/Components/Panel/TabPanel.js +1 -1
- package/src/Components/Picker/Picker.js +10 -9
- package/src/Components/Report/Report.js +17 -14
- package/src/Components/Screens/Manager.js +22 -22
- package/src/Components/Tab/TabBar.js +293 -225
- package/src/Components/Toolbar/FilterToolbar.js +15 -11
- package/src/Components/Toolbar/Pagination.js +51 -46
- package/src/Components/Toolbar/PaginationToolbar.js +25 -19
- package/src/Components/Toolbar/Toolbar.js +26 -13
- package/src/Components/Tooltip/Tooltip.js +35 -0
- package/src/Components/Tree/Tree.js +134 -140
- package/src/Components/Tree/TreeNode.js +75 -36
- package/src/Components/Viewer/Viewer.js +203 -80
- package/src/Components/Window/Editor.js +0 -5
- package/src/Components/Window/UploadsDownloadsWindow.js +40 -22
- package/src/Components/index.js +11 -8
- package/src/Constants/Alert.js +0 -0
- package/src/Constants/AppStates.js +0 -0
- package/src/Constants/Colors.js +13 -0
- package/src/Constants/Commands.js +0 -0
- package/src/Constants/Date.js +0 -0
- package/src/Constants/Dates.js +16 -0
- package/src/Constants/Directions.js +0 -0
- package/src/Constants/Editor.js +0 -0
- package/src/Constants/EditorModes.js +2 -0
- package/src/Constants/File.js +0 -0
- package/src/Constants/Filters.js +0 -0
- package/src/Constants/Grid.js +0 -0
- package/src/Constants/Input.js +1 -0
- package/src/Constants/MimeTypes.js +0 -0
- package/src/Constants/Selection.js +0 -0
- package/src/Constants/Styles.js +119 -108
- package/src/Constants/Tasks.js +3 -0
- package/src/Constants/Tree.js +0 -0
- package/src/Constants/UiModes.js +4 -3
- package/src/Functions/BankersRound.js +0 -0
- package/src/Functions/Cypress/button_functions.js +0 -0
- package/src/Functions/Cypress/crud_functions.js +0 -0
- package/src/Functions/Cypress/dom_functions.js +0 -0
- package/src/Functions/Cypress/grid_functions.js +0 -0
- package/src/Functions/Cypress/navigation_functions.js +0 -0
- package/src/Functions/Cypress/tree_functions.js +0 -0
- package/src/Functions/Cypress/utilities.js +0 -0
- package/src/Functions/PlatformDetector.js +0 -0
- package/src/Functions/Timer.js +0 -0
- package/src/Functions/buildAdditionalButtons.js +5 -5
- package/src/Functions/chunkArray.js +0 -0
- package/src/Functions/colorConversions.js +74 -0
- package/src/Functions/delay.js +0 -0
- package/src/Functions/delayUntil.js +0 -0
- package/src/Functions/deleteSaved.js +0 -0
- package/src/Functions/deleteSecure.js +0 -0
- package/src/Functions/downloadInBackground.js +0 -0
- package/src/Functions/downloadWithFetch.js +0 -0
- package/src/Functions/emptyFn.js +0 -0
- package/src/Functions/getComponentFromType.js +0 -0
- package/src/Functions/getIconButtonFromConfig.js +5 -9
- package/src/Functions/getIsMobile.js +0 -0
- package/src/Functions/getNodeIcon.js +28 -0
- package/src/Functions/getPref.js +0 -0
- package/src/Functions/getSaved.js +0 -0
- package/src/Functions/getSecure.js +0 -0
- package/src/Functions/getTokenHeaders.js +0 -0
- package/src/Functions/gsToHex.js +205 -0
- package/src/Functions/ignoreWanings.js +46 -0
- package/src/Functions/inArray.js +0 -0
- package/src/Functions/isJson.js +0 -0
- package/src/Functions/isSerializable.js +0 -0
- package/src/Functions/isVideo.js +0 -0
- package/src/Functions/jsonValidator.js +0 -0
- package/src/Functions/nbToRgb.js +1 -1
- package/src/Functions/objectToClassName.js +72 -0
- package/src/Functions/parseNotification.js +0 -0
- package/src/Functions/processImage.js +0 -0
- package/src/Functions/registerReactNativeComponents.js +0 -0
- package/src/Functions/registerWebComponents.js +0 -0
- package/src/Functions/setCustomInflector.js +0 -0
- package/src/Functions/setPref.js +0 -0
- package/src/Functions/setProgress.js +0 -0
- package/src/Functions/setSaved.js +0 -0
- package/src/Functions/setSecure.js +0 -0
- package/src/Functions/setThemeOverrides.js +0 -0
- package/src/Functions/setUiSavesRepo.js +0 -0
- package/src/Functions/sleep.js +0 -0
- package/src/Functions/tailwindFunctions.js +384 -0
- package/src/Functions/testProps.js +0 -0
- package/src/Functions/trackEngagementHit.js +0 -0
- package/src/Functions/verifyCompleted.js +0 -0
- package/src/Functions/waitFor.js +2 -2
- package/src/PlatformImports/Web/Attachments.js +32 -38
- package/src/PlatformImports/Web/File.js +38 -31
- package/src/UiGlobals.js +8 -1
- package/src/Components/Grid/ColumnSelectorWindow.js +0 -125
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
useEffect,
|
|
3
|
+
useState,
|
|
4
|
+
createContext,
|
|
5
|
+
useContext,
|
|
6
|
+
useMemo,
|
|
7
|
+
forwardRef,
|
|
8
|
+
} from 'react';
|
|
9
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
10
|
+
import { View, Dimensions, Platform, ViewProps } from 'react-native';
|
|
11
|
+
import { gridStyle, gridItemStyle } from './styles';
|
|
12
|
+
import { cssInterop } from 'nativewind';
|
|
13
|
+
import {
|
|
14
|
+
useBreakpointValue,
|
|
15
|
+
getBreakPointValue,
|
|
16
|
+
} from '../utils/use-break-point-value'; // skote fixed this import
|
|
17
|
+
const { width } = Dimensions.get('window');
|
|
18
|
+
|
|
19
|
+
const GridContext = createContext<any>({});
|
|
20
|
+
|
|
21
|
+
function arrangeChildrenIntoRows({
|
|
22
|
+
childrenArray,
|
|
23
|
+
colSpanArr,
|
|
24
|
+
numColumns,
|
|
25
|
+
}: {
|
|
26
|
+
childrenArray: React.ReactNode[];
|
|
27
|
+
colSpanArr: number[];
|
|
28
|
+
numColumns: number;
|
|
29
|
+
}) {
|
|
30
|
+
let currentRow = 1;
|
|
31
|
+
let currentRowTotalColSpan = 0;
|
|
32
|
+
|
|
33
|
+
// store how many items in each row
|
|
34
|
+
const rowItemsCount: {
|
|
35
|
+
[key: number]: number[];
|
|
36
|
+
} = {};
|
|
37
|
+
|
|
38
|
+
for (let i = 0; i < childrenArray.length; i++) {
|
|
39
|
+
const colSpan = colSpanArr[i];
|
|
40
|
+
|
|
41
|
+
// if current row is full, go to next row
|
|
42
|
+
if (currentRowTotalColSpan + colSpan > numColumns) {
|
|
43
|
+
currentRow++;
|
|
44
|
+
currentRowTotalColSpan = colSpan;
|
|
45
|
+
} else {
|
|
46
|
+
// if current row is not full, add colSpan to current row
|
|
47
|
+
currentRowTotalColSpan += colSpan;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
rowItemsCount[currentRow] = rowItemsCount[currentRow]
|
|
51
|
+
? [...rowItemsCount[currentRow], i]
|
|
52
|
+
: [i];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return rowItemsCount;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function generateResponsiveNumColumns({ gridClass }: { gridClass: string }) {
|
|
59
|
+
const gridClassNamePattern = /\b(?:\w+:)?grid-cols-?\d+\b/g;
|
|
60
|
+
const numColumns = gridClass?.match(gridClassNamePattern);
|
|
61
|
+
|
|
62
|
+
if (!numColumns) {
|
|
63
|
+
return 12;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const regex = /^(?:(\w+):)?grid-cols-?(\d+)$/;
|
|
67
|
+
const result: any = {};
|
|
68
|
+
|
|
69
|
+
numColumns.forEach((classname) => {
|
|
70
|
+
const match = classname.match(regex);
|
|
71
|
+
if (match) {
|
|
72
|
+
const prefix = match[1] || 'default';
|
|
73
|
+
const value = parseInt(match[2], 10);
|
|
74
|
+
result[prefix] = value;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function generateResponsiveColSpans({
|
|
82
|
+
gridItemClassName,
|
|
83
|
+
}: {
|
|
84
|
+
gridItemClassName: string;
|
|
85
|
+
}) {
|
|
86
|
+
const gridClassNamePattern = /\b(?:\w+:)?col-span-?\d+\b/g;
|
|
87
|
+
|
|
88
|
+
const colSpan: any = gridItemClassName?.match(gridClassNamePattern);
|
|
89
|
+
|
|
90
|
+
if (!colSpan) {
|
|
91
|
+
return 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const regex = /^(?:(\w+):)?col-span-?(\d+)$/;
|
|
95
|
+
const result: any = {};
|
|
96
|
+
|
|
97
|
+
colSpan.forEach((classname: any) => {
|
|
98
|
+
const match = classname.match(regex);
|
|
99
|
+
if (match) {
|
|
100
|
+
const prefix = match[1] || 'default';
|
|
101
|
+
const value = parseInt(match[2], 10);
|
|
102
|
+
result[prefix] = value;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
type IGridProps = ViewProps &
|
|
110
|
+
VariantProps<typeof gridStyle> & {
|
|
111
|
+
gap?: number;
|
|
112
|
+
rowGap?: number;
|
|
113
|
+
columnGap?: number;
|
|
114
|
+
flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
115
|
+
padding?: number;
|
|
116
|
+
paddingLeft?: number;
|
|
117
|
+
paddingRight?: number;
|
|
118
|
+
paddingStart?: number;
|
|
119
|
+
paddingEnd?: number;
|
|
120
|
+
borderWidth?: number;
|
|
121
|
+
borderLeftWidth?: number;
|
|
122
|
+
borderRightWidth?: number;
|
|
123
|
+
_extra: {
|
|
124
|
+
className: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const Grid = forwardRef<React.ElementRef<typeof View>, IGridProps>(
|
|
129
|
+
({ className, _extra, children, ...props }, ref) => {
|
|
130
|
+
const [calculatedWidth, setCalculatedWidth] = useState<number | null>(null);
|
|
131
|
+
|
|
132
|
+
const gridClass = _extra?.className;
|
|
133
|
+
const obj = generateResponsiveNumColumns({ gridClass });
|
|
134
|
+
const responsiveNumColumns: any = useBreakpointValue(obj);
|
|
135
|
+
|
|
136
|
+
const itemsPerRow = useMemo(() => {
|
|
137
|
+
// get the colSpan of each child
|
|
138
|
+
const colSpanArr = React.Children.map(children, (child: any) => {
|
|
139
|
+
const gridItemClassName = child?.props?._extra?.className;
|
|
140
|
+
|
|
141
|
+
const colSpan2 = getBreakPointValue(
|
|
142
|
+
generateResponsiveColSpans({ gridItemClassName }),
|
|
143
|
+
width
|
|
144
|
+
);
|
|
145
|
+
const colSpan = colSpan2 ? colSpan2 : 1;
|
|
146
|
+
|
|
147
|
+
if (colSpan > responsiveNumColumns) {
|
|
148
|
+
return responsiveNumColumns;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return colSpan;
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
const childrenArray = React.Children.toArray(children);
|
|
155
|
+
|
|
156
|
+
const rowItemsCount = arrangeChildrenIntoRows({
|
|
157
|
+
childrenArray,
|
|
158
|
+
colSpanArr,
|
|
159
|
+
numColumns: responsiveNumColumns,
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
return rowItemsCount;
|
|
163
|
+
}, [responsiveNumColumns, children]);
|
|
164
|
+
|
|
165
|
+
const childrenWithProps = React.Children.map(children, (child, index) => {
|
|
166
|
+
if (React.isValidElement(child)) {
|
|
167
|
+
return React.cloneElement(child, { index } as any);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return child;
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
const gridClassMerged = `${Platform.select({
|
|
174
|
+
web: gridClass ?? '',
|
|
175
|
+
})}`;
|
|
176
|
+
|
|
177
|
+
const contextValue = useMemo(() => {
|
|
178
|
+
return {
|
|
179
|
+
calculatedWidth,
|
|
180
|
+
numColumns: responsiveNumColumns,
|
|
181
|
+
itemsPerRow,
|
|
182
|
+
flexDirection: props?.flexDirection || 'row',
|
|
183
|
+
gap: props?.gap || 0,
|
|
184
|
+
columnGap: props?.columnGap || 0,
|
|
185
|
+
};
|
|
186
|
+
}, [calculatedWidth, itemsPerRow, responsiveNumColumns, props]);
|
|
187
|
+
|
|
188
|
+
const borderLeftWidth = props?.borderLeftWidth || props?.borderWidth || 0;
|
|
189
|
+
const borderRightWidth = props?.borderRightWidth || props?.borderWidth || 0;
|
|
190
|
+
const borderWidthToSubtract = borderLeftWidth + borderRightWidth;
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
<GridContext.Provider value={contextValue}>
|
|
194
|
+
<View
|
|
195
|
+
ref={ref}
|
|
196
|
+
className={gridStyle({
|
|
197
|
+
class: className + ' ' + gridClassMerged,
|
|
198
|
+
})}
|
|
199
|
+
onLayout={(event: any) => {
|
|
200
|
+
const paddingLeftToSubtract =
|
|
201
|
+
props?.paddingStart || props?.paddingLeft || props?.padding || 0;
|
|
202
|
+
|
|
203
|
+
const paddingRightToSubtract =
|
|
204
|
+
props?.paddingEnd || props?.paddingRight || props?.padding || 0;
|
|
205
|
+
|
|
206
|
+
const gridWidth =
|
|
207
|
+
event.nativeEvent.layout.width -
|
|
208
|
+
paddingLeftToSubtract -
|
|
209
|
+
paddingRightToSubtract -
|
|
210
|
+
borderWidthToSubtract;
|
|
211
|
+
|
|
212
|
+
setCalculatedWidth(gridWidth);
|
|
213
|
+
}}
|
|
214
|
+
{...props}
|
|
215
|
+
>
|
|
216
|
+
{calculatedWidth && childrenWithProps}
|
|
217
|
+
</View>
|
|
218
|
+
</GridContext.Provider>
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
//@ts-ignore
|
|
224
|
+
cssInterop(Grid, {
|
|
225
|
+
className: {
|
|
226
|
+
target: 'style',
|
|
227
|
+
nativeStyleToProp: {
|
|
228
|
+
gap: 'gap',
|
|
229
|
+
rowGap: 'rowGap',
|
|
230
|
+
columnGap: 'columnGap',
|
|
231
|
+
flexDirection: 'flexDirection',
|
|
232
|
+
padding: 'padding',
|
|
233
|
+
paddingLeft: 'paddingLeft',
|
|
234
|
+
paddingRight: 'paddingRight',
|
|
235
|
+
paddingStart: 'paddingStart',
|
|
236
|
+
paddingEnd: 'paddingEnd',
|
|
237
|
+
borderWidth: 'borderWidth',
|
|
238
|
+
borderLeftWidth: 'borderLeftWidth',
|
|
239
|
+
borderRightWidth: 'borderRightWidth',
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
type IGridItemProps = ViewProps &
|
|
245
|
+
VariantProps<typeof gridItemStyle> & {
|
|
246
|
+
index?: number;
|
|
247
|
+
_extra: {
|
|
248
|
+
className: string;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
const GridItem = forwardRef<React.ElementRef<typeof View>, IGridItemProps>(
|
|
253
|
+
({ className, _extra, ...props }, ref) => {
|
|
254
|
+
const [flexBasisValue, setFlexBasisValue] = useState<
|
|
255
|
+
number | string | null
|
|
256
|
+
>('auto');
|
|
257
|
+
|
|
258
|
+
const {
|
|
259
|
+
calculatedWidth,
|
|
260
|
+
numColumns,
|
|
261
|
+
itemsPerRow,
|
|
262
|
+
flexDirection,
|
|
263
|
+
gap,
|
|
264
|
+
columnGap,
|
|
265
|
+
} = useContext(GridContext);
|
|
266
|
+
|
|
267
|
+
const gridItemClass = _extra?.className;
|
|
268
|
+
const responsiveColSpan: number =
|
|
269
|
+
useBreakpointValue(
|
|
270
|
+
generateResponsiveColSpans({ gridItemClassName: gridItemClass })
|
|
271
|
+
) ?? 1;
|
|
272
|
+
|
|
273
|
+
useEffect(() => {
|
|
274
|
+
if (
|
|
275
|
+
!flexDirection?.includes('column') &&
|
|
276
|
+
calculatedWidth &&
|
|
277
|
+
numColumns > 0 &&
|
|
278
|
+
responsiveColSpan > 0
|
|
279
|
+
) {
|
|
280
|
+
// find out in which row of itemsPerRow the current item's index is
|
|
281
|
+
const row = Object.keys(itemsPerRow).find((key) => {
|
|
282
|
+
return itemsPerRow[key].includes(props?.index);
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
const rowColsCount = itemsPerRow[row as string]?.length;
|
|
286
|
+
|
|
287
|
+
const space = columnGap || gap || 0;
|
|
288
|
+
|
|
289
|
+
const gutterOffset =
|
|
290
|
+
space *
|
|
291
|
+
(rowColsCount === 1 && responsiveColSpan < numColumns
|
|
292
|
+
? 2
|
|
293
|
+
: rowColsCount - 1);
|
|
294
|
+
|
|
295
|
+
const flexBasisVal =
|
|
296
|
+
Math.min(
|
|
297
|
+
(((calculatedWidth - gutterOffset) * responsiveColSpan) /
|
|
298
|
+
numColumns /
|
|
299
|
+
calculatedWidth) *
|
|
300
|
+
100,
|
|
301
|
+
100
|
|
302
|
+
) + '%';
|
|
303
|
+
|
|
304
|
+
setFlexBasisValue(flexBasisVal);
|
|
305
|
+
}
|
|
306
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
307
|
+
}, [
|
|
308
|
+
calculatedWidth,
|
|
309
|
+
responsiveColSpan,
|
|
310
|
+
numColumns,
|
|
311
|
+
columnGap,
|
|
312
|
+
gap,
|
|
313
|
+
flexDirection,
|
|
314
|
+
]);
|
|
315
|
+
|
|
316
|
+
return (
|
|
317
|
+
<View
|
|
318
|
+
ref={ref}
|
|
319
|
+
// @ts-expect-error
|
|
320
|
+
gridItemClass={gridItemClass}
|
|
321
|
+
className={gridItemStyle({
|
|
322
|
+
class:
|
|
323
|
+
className + ' ' + Platform.select({ web: gridItemClass ?? '' }) ??
|
|
324
|
+
'',
|
|
325
|
+
})}
|
|
326
|
+
{...props}
|
|
327
|
+
style={[
|
|
328
|
+
{
|
|
329
|
+
flexBasis: flexBasisValue as any,
|
|
330
|
+
},
|
|
331
|
+
props.style,
|
|
332
|
+
]}
|
|
333
|
+
/>
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
);
|
|
337
|
+
|
|
338
|
+
Grid.displayName = 'Grid';
|
|
339
|
+
GridItem.displayName = 'GridItem';
|
|
340
|
+
|
|
341
|
+
export { Grid, GridItem };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { gridStyle, gridItemStyle } from './styles';
|
|
3
|
+
|
|
4
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
5
|
+
|
|
6
|
+
type IGridProps = React.ComponentPropsWithoutRef<'div'> &
|
|
7
|
+
VariantProps<typeof gridStyle> & {
|
|
8
|
+
gap?: number;
|
|
9
|
+
rowGap?: number;
|
|
10
|
+
columnGap?: number;
|
|
11
|
+
flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
12
|
+
padding?: number;
|
|
13
|
+
paddingLeft?: number;
|
|
14
|
+
paddingRight?: number;
|
|
15
|
+
paddingStart?: number;
|
|
16
|
+
paddingEnd?: number;
|
|
17
|
+
_extra: {
|
|
18
|
+
className: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const Grid = React.forwardRef<HTMLDivElement, IGridProps>(
|
|
23
|
+
({ className, _extra, ...props }, ref) => {
|
|
24
|
+
const gridClass = _extra?.className;
|
|
25
|
+
const finalGridClass = gridClass ?? '';
|
|
26
|
+
return (
|
|
27
|
+
<div
|
|
28
|
+
ref={ref}
|
|
29
|
+
className={gridStyle({
|
|
30
|
+
class: className + ' ' + finalGridClass,
|
|
31
|
+
})}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
type IGridItemProps = React.ComponentPropsWithoutRef<'div'> &
|
|
39
|
+
VariantProps<typeof gridItemStyle> & {
|
|
40
|
+
index?: number;
|
|
41
|
+
_extra: {
|
|
42
|
+
className: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const GridItem = React.forwardRef<HTMLDivElement, IGridItemProps>(
|
|
46
|
+
({ className, _extra, ...props }, ref) => {
|
|
47
|
+
const gridItemClass = _extra?.className;
|
|
48
|
+
|
|
49
|
+
const finalGridItemClass = gridItemClass ?? '';
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
ref={ref}
|
|
53
|
+
className={gridItemStyle({
|
|
54
|
+
class: className + ' ' + finalGridItemClass,
|
|
55
|
+
})}
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
Grid.displayName = 'Grid';
|
|
63
|
+
GridItem.displayName = 'GridItem';
|
|
64
|
+
|
|
65
|
+
export { Grid, GridItem };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
2
|
+
import { isWeb } from '@gluestack-ui/nativewind-utils/IsWeb';
|
|
3
|
+
|
|
4
|
+
const gridBaseStyle = isWeb
|
|
5
|
+
? 'grid grid-cols-12'
|
|
6
|
+
: 'box-border flex-row flex-wrap justify-start';
|
|
7
|
+
const gridItemBaseStyle = isWeb ? 'w-auto col-span-1' : '';
|
|
8
|
+
|
|
9
|
+
export const gridStyle = tva({
|
|
10
|
+
base: `w-full ${gridBaseStyle}`,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const gridItemStyle = tva({
|
|
14
|
+
base: `w-full ${gridItemBaseStyle}`,
|
|
15
|
+
});
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import React, { forwardRef, memo } from 'react';
|
|
2
|
+
import { H1, H2, H3, H4, H5, H6 } from '@expo/html-elements';
|
|
3
|
+
import { cssInterop } from 'nativewind';
|
|
4
|
+
import { headingStyle } from './styles';
|
|
5
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
6
|
+
|
|
7
|
+
type IHeadingProps = VariantProps<typeof headingStyle> &
|
|
8
|
+
React.ComponentPropsWithoutRef<typeof H1> & {
|
|
9
|
+
as?: React.ElementType;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
cssInterop(H1, { className: 'style' });
|
|
13
|
+
cssInterop(H2, { className: 'style' });
|
|
14
|
+
cssInterop(H3, { className: 'style' });
|
|
15
|
+
cssInterop(H4, { className: 'style' });
|
|
16
|
+
cssInterop(H5, { className: 'style' });
|
|
17
|
+
cssInterop(H6, { className: 'style' });
|
|
18
|
+
|
|
19
|
+
const MappedHeading = memo(
|
|
20
|
+
forwardRef<React.ElementRef<typeof H1>, IHeadingProps>(
|
|
21
|
+
(
|
|
22
|
+
{
|
|
23
|
+
size,
|
|
24
|
+
className,
|
|
25
|
+
isTruncated,
|
|
26
|
+
bold,
|
|
27
|
+
underline,
|
|
28
|
+
strikeThrough,
|
|
29
|
+
sub,
|
|
30
|
+
italic,
|
|
31
|
+
highlight,
|
|
32
|
+
...props
|
|
33
|
+
},
|
|
34
|
+
ref
|
|
35
|
+
) => {
|
|
36
|
+
switch (size) {
|
|
37
|
+
case '5xl':
|
|
38
|
+
case '4xl':
|
|
39
|
+
case '3xl':
|
|
40
|
+
return (
|
|
41
|
+
<H1
|
|
42
|
+
className={headingStyle({
|
|
43
|
+
size,
|
|
44
|
+
isTruncated,
|
|
45
|
+
bold,
|
|
46
|
+
underline,
|
|
47
|
+
strikeThrough,
|
|
48
|
+
sub,
|
|
49
|
+
italic,
|
|
50
|
+
highlight,
|
|
51
|
+
class: className,
|
|
52
|
+
})}
|
|
53
|
+
{...props}
|
|
54
|
+
ref={ref}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
case '2xl':
|
|
58
|
+
return (
|
|
59
|
+
<H2
|
|
60
|
+
className={headingStyle({
|
|
61
|
+
size,
|
|
62
|
+
isTruncated,
|
|
63
|
+
bold,
|
|
64
|
+
underline,
|
|
65
|
+
strikeThrough,
|
|
66
|
+
sub,
|
|
67
|
+
italic,
|
|
68
|
+
highlight,
|
|
69
|
+
class: className,
|
|
70
|
+
})}
|
|
71
|
+
{...props}
|
|
72
|
+
ref={ref}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
case 'xl':
|
|
76
|
+
return (
|
|
77
|
+
<H3
|
|
78
|
+
className={headingStyle({
|
|
79
|
+
size,
|
|
80
|
+
isTruncated,
|
|
81
|
+
bold,
|
|
82
|
+
underline,
|
|
83
|
+
strikeThrough,
|
|
84
|
+
sub,
|
|
85
|
+
italic,
|
|
86
|
+
highlight,
|
|
87
|
+
class: className,
|
|
88
|
+
})}
|
|
89
|
+
{...props}
|
|
90
|
+
ref={ref}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
case 'lg':
|
|
94
|
+
return (
|
|
95
|
+
<H4
|
|
96
|
+
className={headingStyle({
|
|
97
|
+
size,
|
|
98
|
+
isTruncated,
|
|
99
|
+
bold,
|
|
100
|
+
underline,
|
|
101
|
+
strikeThrough,
|
|
102
|
+
sub,
|
|
103
|
+
italic,
|
|
104
|
+
highlight,
|
|
105
|
+
class: className,
|
|
106
|
+
})}
|
|
107
|
+
{...props}
|
|
108
|
+
ref={ref}
|
|
109
|
+
/>
|
|
110
|
+
);
|
|
111
|
+
case 'md':
|
|
112
|
+
return (
|
|
113
|
+
<H5
|
|
114
|
+
className={headingStyle({
|
|
115
|
+
size,
|
|
116
|
+
isTruncated,
|
|
117
|
+
bold,
|
|
118
|
+
underline,
|
|
119
|
+
strikeThrough,
|
|
120
|
+
sub,
|
|
121
|
+
italic,
|
|
122
|
+
highlight,
|
|
123
|
+
class: className,
|
|
124
|
+
})}
|
|
125
|
+
{...props}
|
|
126
|
+
ref={ref}
|
|
127
|
+
/>
|
|
128
|
+
);
|
|
129
|
+
case 'sm':
|
|
130
|
+
case 'xs':
|
|
131
|
+
return (
|
|
132
|
+
<H6
|
|
133
|
+
className={headingStyle({
|
|
134
|
+
size,
|
|
135
|
+
isTruncated,
|
|
136
|
+
bold,
|
|
137
|
+
underline,
|
|
138
|
+
strikeThrough,
|
|
139
|
+
sub,
|
|
140
|
+
italic,
|
|
141
|
+
highlight,
|
|
142
|
+
class: className,
|
|
143
|
+
})}
|
|
144
|
+
{...props}
|
|
145
|
+
ref={ref}
|
|
146
|
+
/>
|
|
147
|
+
);
|
|
148
|
+
default:
|
|
149
|
+
return (
|
|
150
|
+
<H4
|
|
151
|
+
className={headingStyle({
|
|
152
|
+
size,
|
|
153
|
+
isTruncated,
|
|
154
|
+
bold,
|
|
155
|
+
underline,
|
|
156
|
+
strikeThrough,
|
|
157
|
+
sub,
|
|
158
|
+
italic,
|
|
159
|
+
highlight,
|
|
160
|
+
class: className,
|
|
161
|
+
})}
|
|
162
|
+
{...props}
|
|
163
|
+
ref={ref}
|
|
164
|
+
/>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
const Heading = memo(
|
|
172
|
+
forwardRef<React.ElementRef<typeof H1>, IHeadingProps>(
|
|
173
|
+
({ className, size = 'lg', as: AsComp, ...props }, ref) => {
|
|
174
|
+
const {
|
|
175
|
+
isTruncated,
|
|
176
|
+
bold,
|
|
177
|
+
underline,
|
|
178
|
+
strikeThrough,
|
|
179
|
+
sub,
|
|
180
|
+
italic,
|
|
181
|
+
highlight,
|
|
182
|
+
} = props;
|
|
183
|
+
|
|
184
|
+
if (AsComp) {
|
|
185
|
+
return (
|
|
186
|
+
<AsComp
|
|
187
|
+
className={headingStyle({
|
|
188
|
+
size,
|
|
189
|
+
isTruncated,
|
|
190
|
+
bold,
|
|
191
|
+
underline,
|
|
192
|
+
strikeThrough,
|
|
193
|
+
sub,
|
|
194
|
+
italic,
|
|
195
|
+
highlight,
|
|
196
|
+
class: className,
|
|
197
|
+
})}
|
|
198
|
+
{...props}
|
|
199
|
+
/>
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return (
|
|
204
|
+
<MappedHeading className={className} size={size} ref={ref} {...props} />
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
Heading.displayName = 'Heading';
|
|
211
|
+
|
|
212
|
+
export { Heading };
|