@onehat/ui 0.3.380 → 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 +144 -147
- 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,142 @@
|
|
|
1
|
+
import React, { createContext, useMemo, useContext } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
tableStyle,
|
|
4
|
+
tableHeaderStyle,
|
|
5
|
+
tableBodyStyle,
|
|
6
|
+
tableFooterStyle,
|
|
7
|
+
tableHeadStyle,
|
|
8
|
+
tableRowStyleStyle,
|
|
9
|
+
tableDataStyle,
|
|
10
|
+
tableCaptionStyle,
|
|
11
|
+
} from './styles';
|
|
12
|
+
|
|
13
|
+
const TableHeaderContext = createContext<any>({});
|
|
14
|
+
const TableFooterContext = createContext<any>({});
|
|
15
|
+
|
|
16
|
+
const Table = React.forwardRef(({ className, ...props }: any, ref?: any) => {
|
|
17
|
+
return (
|
|
18
|
+
<table ref={ref} className={tableStyle({ class: className })} {...props} />
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const TableHeader = React.forwardRef(
|
|
23
|
+
({ className, ...props }: any, ref?: any) => {
|
|
24
|
+
const contextValue = useMemo(() => {
|
|
25
|
+
return {
|
|
26
|
+
isHeaderRow: true,
|
|
27
|
+
};
|
|
28
|
+
}, []);
|
|
29
|
+
return (
|
|
30
|
+
<TableHeaderContext.Provider value={contextValue}>
|
|
31
|
+
<thead
|
|
32
|
+
ref={ref}
|
|
33
|
+
className={tableHeaderStyle({ class: className })}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
</TableHeaderContext.Provider>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const TableBody = React.forwardRef(
|
|
42
|
+
({ className, ...props }: any, ref?: any) => {
|
|
43
|
+
return (
|
|
44
|
+
<tbody
|
|
45
|
+
ref={ref}
|
|
46
|
+
className={tableBodyStyle({ class: className })}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const TableFooter = React.forwardRef(
|
|
54
|
+
({ className, ...props }: any, ref?: any) => {
|
|
55
|
+
const contextValue = useMemo(() => {
|
|
56
|
+
return {
|
|
57
|
+
isFooterRow: true,
|
|
58
|
+
};
|
|
59
|
+
}, []);
|
|
60
|
+
return (
|
|
61
|
+
<TableFooterContext.Provider value={contextValue}>
|
|
62
|
+
<tfoot
|
|
63
|
+
ref={ref}
|
|
64
|
+
className={tableFooterStyle({ class: className })}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
</TableFooterContext.Provider>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const TableHead = React.forwardRef(
|
|
73
|
+
({ className, ...props }: any, ref?: any) => {
|
|
74
|
+
return (
|
|
75
|
+
<th
|
|
76
|
+
ref={ref}
|
|
77
|
+
className={tableHeadStyle({ class: className })}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const TableRow = React.forwardRef(({ className, ...props }: any, ref?: any) => {
|
|
85
|
+
const { isHeaderRow } = useContext(TableHeaderContext);
|
|
86
|
+
const { isFooterRow } = useContext(TableFooterContext);
|
|
87
|
+
return (
|
|
88
|
+
<tr
|
|
89
|
+
ref={ref}
|
|
90
|
+
className={tableRowStyleStyle({
|
|
91
|
+
isHeaderRow,
|
|
92
|
+
isFooterRow,
|
|
93
|
+
class: className,
|
|
94
|
+
})}
|
|
95
|
+
{...props}
|
|
96
|
+
/>
|
|
97
|
+
);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const TableData = React.forwardRef(
|
|
101
|
+
({ className, ...props }: any, ref?: any) => {
|
|
102
|
+
return (
|
|
103
|
+
<td
|
|
104
|
+
ref={ref}
|
|
105
|
+
className={tableDataStyle({ class: className })}
|
|
106
|
+
{...props}
|
|
107
|
+
/>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
const TableCaption = React.forwardRef(
|
|
113
|
+
({ className, ...props }: any, ref?: any) => {
|
|
114
|
+
return (
|
|
115
|
+
<caption
|
|
116
|
+
ref={ref}
|
|
117
|
+
className={tableCaptionStyle({ class: className })}
|
|
118
|
+
{...props}
|
|
119
|
+
/>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
Table.displayName = 'Table';
|
|
125
|
+
TableHeader.displayName = 'TableHeader';
|
|
126
|
+
TableBody.displayName = 'TableBody';
|
|
127
|
+
TableFooter.displayName = 'TableFooter';
|
|
128
|
+
TableHead.displayName = 'TableHead';
|
|
129
|
+
TableRow.displayName = 'TableRow';
|
|
130
|
+
TableData.displayName = 'TableData';
|
|
131
|
+
TableCaption.displayName = 'TableCaption';
|
|
132
|
+
|
|
133
|
+
export {
|
|
134
|
+
Table,
|
|
135
|
+
TableHeader,
|
|
136
|
+
TableBody,
|
|
137
|
+
TableFooter,
|
|
138
|
+
TableHead,
|
|
139
|
+
TableRow,
|
|
140
|
+
TableData,
|
|
141
|
+
TableCaption,
|
|
142
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
2
|
+
import { isWeb } from '@gluestack-ui/nativewind-utils/IsWeb';
|
|
3
|
+
|
|
4
|
+
const captionTableStyle = isWeb ? 'caption-bottom' : '';
|
|
5
|
+
|
|
6
|
+
export const tableStyle = tva({
|
|
7
|
+
base: `table border-collapse border-collapse w-[800px]`,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const tableHeaderStyle = tva({
|
|
11
|
+
base: '',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const tableBodyStyle = tva({
|
|
15
|
+
base: '',
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const tableFooterStyle = tva({
|
|
19
|
+
base: '',
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const tableHeadStyle = tva({
|
|
23
|
+
base: 'flex-1 px-6 py-[14px] text-left font-bold text-[16px] leading-[22px] text-typography-800 font-roboto',
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const tableRowStyleStyle = tva({
|
|
27
|
+
base: 'border-0 border-b border-solid border-outline-200 bg-background-0',
|
|
28
|
+
variants: {
|
|
29
|
+
isHeaderRow: {
|
|
30
|
+
true: '',
|
|
31
|
+
},
|
|
32
|
+
isFooterRow: {
|
|
33
|
+
true: 'border-b-0 ',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const tableDataStyle = tva({
|
|
39
|
+
base: 'flex-1 px-6 py-[14px] text-left text-[16px] font-medium leading-[22px] text-typography-800 font-roboto',
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const tableCaptionStyle = tva({
|
|
43
|
+
base: `${captionTableStyle} px-6 py-[14px] text-[16px] font-normal leading-[22px] text-typography-800 bg-background-50 font-roboto`,
|
|
44
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
4
|
+
import { Text as RNText } from 'react-native';
|
|
5
|
+
import { textStyle } from './styles';
|
|
6
|
+
|
|
7
|
+
type ITextProps = React.ComponentProps<typeof RNText> &
|
|
8
|
+
VariantProps<typeof textStyle>;
|
|
9
|
+
|
|
10
|
+
const Text = React.forwardRef<React.ElementRef<typeof RNText>, ITextProps>(
|
|
11
|
+
(
|
|
12
|
+
{
|
|
13
|
+
className,
|
|
14
|
+
isTruncated,
|
|
15
|
+
bold,
|
|
16
|
+
underline,
|
|
17
|
+
strikeThrough,
|
|
18
|
+
size = 'md',
|
|
19
|
+
sub,
|
|
20
|
+
italic,
|
|
21
|
+
highlight,
|
|
22
|
+
...props
|
|
23
|
+
},
|
|
24
|
+
ref
|
|
25
|
+
) => {
|
|
26
|
+
return (
|
|
27
|
+
<RNText
|
|
28
|
+
className={textStyle({
|
|
29
|
+
isTruncated,
|
|
30
|
+
bold,
|
|
31
|
+
underline,
|
|
32
|
+
strikeThrough,
|
|
33
|
+
size,
|
|
34
|
+
sub,
|
|
35
|
+
italic,
|
|
36
|
+
highlight,
|
|
37
|
+
class: className,
|
|
38
|
+
})}
|
|
39
|
+
{...props}
|
|
40
|
+
ref={ref}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
Text.displayName = 'Text';
|
|
47
|
+
|
|
48
|
+
export { Text };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
3
|
+
import { textStyle } from './styles';
|
|
4
|
+
|
|
5
|
+
type ITextProps = React.ComponentProps<'span'> & VariantProps<typeof textStyle>;
|
|
6
|
+
|
|
7
|
+
const Text = React.forwardRef<React.ElementRef<'span'>, ITextProps>(
|
|
8
|
+
(
|
|
9
|
+
{
|
|
10
|
+
className,
|
|
11
|
+
isTruncated,
|
|
12
|
+
bold,
|
|
13
|
+
underline,
|
|
14
|
+
strikeThrough,
|
|
15
|
+
size = 'md',
|
|
16
|
+
sub,
|
|
17
|
+
italic,
|
|
18
|
+
highlight,
|
|
19
|
+
...props
|
|
20
|
+
}: { className?: string } & ITextProps,
|
|
21
|
+
ref
|
|
22
|
+
) => {
|
|
23
|
+
return (
|
|
24
|
+
<span
|
|
25
|
+
className={textStyle({
|
|
26
|
+
isTruncated,
|
|
27
|
+
bold,
|
|
28
|
+
underline,
|
|
29
|
+
strikeThrough,
|
|
30
|
+
size,
|
|
31
|
+
sub,
|
|
32
|
+
italic,
|
|
33
|
+
highlight,
|
|
34
|
+
class: className,
|
|
35
|
+
})}
|
|
36
|
+
{...props}
|
|
37
|
+
ref={ref}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
Text.displayName = 'Text';
|
|
44
|
+
|
|
45
|
+
export { Text };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
2
|
+
import { isWeb } from '@gluestack-ui/nativewind-utils/IsWeb';
|
|
3
|
+
|
|
4
|
+
const baseStyle = isWeb
|
|
5
|
+
? 'font-sans tracking-sm my-0 bg-transparent border-0 box-border display-inline list-none margin-0 padding-0 position-relative text-start no-underline whitespace-pre-wrap word-wrap-break-word'
|
|
6
|
+
: '';
|
|
7
|
+
|
|
8
|
+
export const textStyle = tva({
|
|
9
|
+
base: `text-typography-700 font-body ${baseStyle}`,
|
|
10
|
+
|
|
11
|
+
variants: {
|
|
12
|
+
isTruncated: {
|
|
13
|
+
true: 'web:truncate',
|
|
14
|
+
},
|
|
15
|
+
bold: {
|
|
16
|
+
true: 'font-bold',
|
|
17
|
+
},
|
|
18
|
+
underline: {
|
|
19
|
+
true: 'underline',
|
|
20
|
+
},
|
|
21
|
+
strikeThrough: {
|
|
22
|
+
true: 'line-through',
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
'2xs': 'text-2xs',
|
|
26
|
+
'xs': 'text-xs',
|
|
27
|
+
'sm': 'text-sm',
|
|
28
|
+
'md': 'text-base',
|
|
29
|
+
'lg': 'text-lg',
|
|
30
|
+
'xl': 'text-xl',
|
|
31
|
+
'2xl': 'text-2xl',
|
|
32
|
+
'3xl': 'text-3xl',
|
|
33
|
+
'4xl': 'text-4xl',
|
|
34
|
+
'5xl': 'text-5xl',
|
|
35
|
+
'6xl': 'text-6xl',
|
|
36
|
+
},
|
|
37
|
+
sub: {
|
|
38
|
+
true: 'text-xs',
|
|
39
|
+
},
|
|
40
|
+
italic: {
|
|
41
|
+
true: 'italic',
|
|
42
|
+
},
|
|
43
|
+
highlight: {
|
|
44
|
+
true: 'bg-yellow-500',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
});
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { createTextarea } from '@gluestack-ui/textarea';
|
|
4
|
+
import { View, TextInput, Platform } from 'react-native';
|
|
5
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
6
|
+
import {
|
|
7
|
+
withStyleContext,
|
|
8
|
+
useStyleContext,
|
|
9
|
+
} from '@gluestack-ui/nativewind-utils/withStyleContext';
|
|
10
|
+
import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withStyleContextAndStates';
|
|
11
|
+
import { cssInterop } from 'nativewind';
|
|
12
|
+
import { withStates } from '@gluestack-ui/nativewind-utils/withStates';
|
|
13
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
14
|
+
|
|
15
|
+
const TextareaWrapper = React.forwardRef<
|
|
16
|
+
React.ElementRef<typeof View>,
|
|
17
|
+
React.ComponentProps<typeof View>
|
|
18
|
+
>(({ ...props }, ref) => {
|
|
19
|
+
return <View {...props} ref={ref} />;
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const SCOPE = 'TEXTAREA';
|
|
23
|
+
const UITextarea = createTextarea({
|
|
24
|
+
Root:
|
|
25
|
+
Platform.OS === 'web'
|
|
26
|
+
? withStyleContext(TextareaWrapper, SCOPE)
|
|
27
|
+
: withStyleContextAndStates(TextareaWrapper, SCOPE),
|
|
28
|
+
Input: Platform.OS === 'web' ? TextInput : withStates(TextInput),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
cssInterop(TextareaWrapper, { className: 'style' });
|
|
32
|
+
cssInterop(UITextarea.Input, {
|
|
33
|
+
className: { target: 'style', nativeStyleToProp: { textAlign: true } },
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const textareaStyle = tva({
|
|
37
|
+
base: 'w-full h-[100px] border border-background-300 rounded data-[hover=true]:border-outline-400 data-[focus=true]:border-primary-700 data-[focus=true]:data-[hover=true]:border-primary-700 data-[disabled=true]:opacity-40 data-[disabled=true]:bg-background-50 data-[disabled=true]:data-[hover=true]:border-background-300',
|
|
38
|
+
|
|
39
|
+
variants: {
|
|
40
|
+
variant: {
|
|
41
|
+
default:
|
|
42
|
+
'data-[focus=true]:border-primary-700 data-[focus=true]:web:ring-1 data-[focus=true]:web:ring-inset data-[focus=true]:web:ring-indicator-primary data-[invalid=true]:border-error-700 data-[invalid=true]:web:ring-1 data-[invalid=true]:web:ring-inset data-[invalid=true]:web:ring-indicator-error data-[invalid=true]:data-[hover=true]:border-error-700 data-[invalid=true]:data-[focus=true]:data-[hover=true]:border-primary-700 data-[invalid=true]:data-[focus=true]:data-[hover=true]:web:ring-1 data-[invalid=true]:data-[focus=true]:data-[hover=true]:web:ring-inset data-[invalid=true]:data-[focus=true]:data-[hover=true]:web:ring-indicator-primary data-[invalid=true]:data-[disabled=true]:data-[hover=true]:border-error-700 data-[invalid=true]:data-[disabled=true]:data-[hover=true]:web:ring-1 data-[invalid=true]:data-[disabled=true]:data-[hover=true]:web:ring-inset data-[invalid=true]:data-[disabled=true]:data-[hover=true]:web:ring-indicator-error ',
|
|
43
|
+
},
|
|
44
|
+
size: {
|
|
45
|
+
sm: '',
|
|
46
|
+
md: '',
|
|
47
|
+
lg: '',
|
|
48
|
+
xl: '',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const textareaInputStyle = tva({
|
|
54
|
+
base: 'p-2 web:outline-0 web:outline-none flex-1 color-typography-900 align-text-top placeholder:text-typography-500 web:cursor-text web:data-[disabled=true]:cursor-not-allowed',
|
|
55
|
+
parentVariants: {
|
|
56
|
+
size: {
|
|
57
|
+
sm: 'text-sm',
|
|
58
|
+
md: 'text-base',
|
|
59
|
+
lg: 'text-lg',
|
|
60
|
+
xl: 'text-xl',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
type ITextareaProps = React.ComponentProps<typeof UITextarea> &
|
|
66
|
+
VariantProps<typeof textareaStyle>;
|
|
67
|
+
|
|
68
|
+
const Textarea = React.forwardRef<
|
|
69
|
+
React.ElementRef<typeof UITextarea>,
|
|
70
|
+
ITextareaProps
|
|
71
|
+
>(({ className, variant = 'default', size = 'md', ...props }, ref) => {
|
|
72
|
+
return (
|
|
73
|
+
<UITextarea
|
|
74
|
+
ref={ref}
|
|
75
|
+
{...props}
|
|
76
|
+
className={textareaStyle({ variant, class: className })}
|
|
77
|
+
context={{ size }}
|
|
78
|
+
/>
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
type ITextareaInputProps = React.ComponentProps<typeof UITextarea.Input> &
|
|
83
|
+
VariantProps<typeof textareaInputStyle>;
|
|
84
|
+
|
|
85
|
+
const TextareaInput = React.forwardRef<
|
|
86
|
+
React.ElementRef<typeof UITextarea.Input>,
|
|
87
|
+
ITextareaInputProps
|
|
88
|
+
>(({ className, ...props }, ref) => {
|
|
89
|
+
const { size: parentSize } = useStyleContext(SCOPE);
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<UITextarea.Input
|
|
93
|
+
ref={ref}
|
|
94
|
+
{...props}
|
|
95
|
+
className={textareaInputStyle({
|
|
96
|
+
parentVariants: {
|
|
97
|
+
size: parentSize,
|
|
98
|
+
},
|
|
99
|
+
class: className,
|
|
100
|
+
})}
|
|
101
|
+
/>
|
|
102
|
+
);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
Textarea.displayName = 'Textarea';
|
|
106
|
+
TextareaInput.displayName = 'TextareaInput';
|
|
107
|
+
|
|
108
|
+
export { Textarea, TextareaInput };
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { createToast, createToastHook } from '@gluestack-ui/toast';
|
|
4
|
+
import { Text, View, Platform } from 'react-native';
|
|
5
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
6
|
+
import { cssInterop } from 'nativewind';
|
|
7
|
+
import { Motion, AnimatePresence } from '@legendapp/motion';
|
|
8
|
+
import {
|
|
9
|
+
withStyleContext,
|
|
10
|
+
useStyleContext,
|
|
11
|
+
} from '@gluestack-ui/nativewind-utils/withStyleContext';
|
|
12
|
+
import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withStyleContextAndStates';
|
|
13
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
14
|
+
|
|
15
|
+
export const useToast = createToastHook(Motion.View, AnimatePresence);
|
|
16
|
+
const SCOPE = 'TOAST';
|
|
17
|
+
export const UIToast = createToast({
|
|
18
|
+
Root:
|
|
19
|
+
Platform.OS === 'web'
|
|
20
|
+
? withStyleContext(View, SCOPE)
|
|
21
|
+
: withStyleContextAndStates(View, SCOPE),
|
|
22
|
+
Title: Text,
|
|
23
|
+
Description: Text,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
cssInterop(Motion.View, { className: 'style' });
|
|
27
|
+
cssInterop(UIToast, { className: 'style' });
|
|
28
|
+
cssInterop(UIToast.Title, { className: 'style' });
|
|
29
|
+
cssInterop(UIToast.Description, { className: 'style' });
|
|
30
|
+
|
|
31
|
+
const toastStyle = tva({
|
|
32
|
+
base: 'p-4 m-1 rounded-md gap-1 web:pointer-events-auto shadow-hard-5 border-outline-100',
|
|
33
|
+
variants: {
|
|
34
|
+
action: {
|
|
35
|
+
error: 'bg-error-800',
|
|
36
|
+
warning: 'bg-warning-700',
|
|
37
|
+
success: 'bg-success-700',
|
|
38
|
+
info: 'bg-info-700',
|
|
39
|
+
muted: 'bg-secondary-700',
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
variant: {
|
|
43
|
+
solid: '',
|
|
44
|
+
outline: 'border bg-background-0',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const toastTitleStyle = tva({
|
|
50
|
+
base: 'text-typography-0 font-medium font-body tracking-md text-left',
|
|
51
|
+
variants: {
|
|
52
|
+
isTruncated: {
|
|
53
|
+
true: '',
|
|
54
|
+
},
|
|
55
|
+
bold: {
|
|
56
|
+
true: 'font-bold',
|
|
57
|
+
},
|
|
58
|
+
underline: {
|
|
59
|
+
true: 'underline',
|
|
60
|
+
},
|
|
61
|
+
strikeThrough: {
|
|
62
|
+
true: 'line-through',
|
|
63
|
+
},
|
|
64
|
+
size: {
|
|
65
|
+
'2xs': 'text-2xs',
|
|
66
|
+
'xs': 'text-xs',
|
|
67
|
+
'sm': 'text-sm',
|
|
68
|
+
'md': 'text-base',
|
|
69
|
+
'lg': 'text-lg',
|
|
70
|
+
'xl': 'text-xl',
|
|
71
|
+
'2xl': 'text-2xl',
|
|
72
|
+
'3xl': 'text-3xl',
|
|
73
|
+
'4xl': 'text-4xl',
|
|
74
|
+
'5xl': 'text-5xl',
|
|
75
|
+
'6xl': 'text-6xl',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
parentVariants: {
|
|
79
|
+
variant: {
|
|
80
|
+
solid: '',
|
|
81
|
+
outline: '',
|
|
82
|
+
},
|
|
83
|
+
action: {
|
|
84
|
+
error: '',
|
|
85
|
+
warning: '',
|
|
86
|
+
success: '',
|
|
87
|
+
info: '',
|
|
88
|
+
muted: '',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
parentCompoundVariants: [
|
|
92
|
+
{
|
|
93
|
+
variant: 'outline',
|
|
94
|
+
action: 'error',
|
|
95
|
+
class: 'text-error-800',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
variant: 'outline',
|
|
99
|
+
action: 'warning',
|
|
100
|
+
class: 'text-warning-800',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
variant: 'outline',
|
|
104
|
+
action: 'success',
|
|
105
|
+
class: 'text-success-800',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
variant: 'outline',
|
|
109
|
+
action: 'info',
|
|
110
|
+
class: 'text-info-800',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
variant: 'outline',
|
|
114
|
+
action: 'muted',
|
|
115
|
+
class: 'text-background-800',
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const toastDescriptionStyle = tva({
|
|
121
|
+
base: 'font-normal font-body tracking-md text-left',
|
|
122
|
+
variants: {
|
|
123
|
+
isTruncated: {
|
|
124
|
+
true: '',
|
|
125
|
+
},
|
|
126
|
+
bold: {
|
|
127
|
+
true: 'font-bold',
|
|
128
|
+
},
|
|
129
|
+
underline: {
|
|
130
|
+
true: 'underline',
|
|
131
|
+
},
|
|
132
|
+
strikeThrough: {
|
|
133
|
+
true: 'line-through',
|
|
134
|
+
},
|
|
135
|
+
size: {
|
|
136
|
+
'2xs': 'text-2xs',
|
|
137
|
+
'xs': 'text-xs',
|
|
138
|
+
'sm': 'text-sm',
|
|
139
|
+
'md': 'text-base',
|
|
140
|
+
'lg': 'text-lg',
|
|
141
|
+
'xl': 'text-xl',
|
|
142
|
+
'2xl': 'text-2xl',
|
|
143
|
+
'3xl': 'text-3xl',
|
|
144
|
+
'4xl': 'text-4xl',
|
|
145
|
+
'5xl': 'text-5xl',
|
|
146
|
+
'6xl': 'text-6xl',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
parentVariants: {
|
|
150
|
+
variant: {
|
|
151
|
+
solid: 'text-typography-50',
|
|
152
|
+
outline: 'text-typography-900',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
type IToastProps = React.ComponentProps<typeof UIToast> & {
|
|
158
|
+
className?: string;
|
|
159
|
+
} & VariantProps<typeof toastStyle>;
|
|
160
|
+
|
|
161
|
+
export const Toast = React.forwardRef<
|
|
162
|
+
React.ElementRef<typeof UIToast>,
|
|
163
|
+
IToastProps
|
|
164
|
+
>(({ className, variant = 'solid', action = 'muted', ...props }, ref) => {
|
|
165
|
+
return (
|
|
166
|
+
<UIToast
|
|
167
|
+
ref={ref}
|
|
168
|
+
className={toastStyle({ variant, action, class: className })}
|
|
169
|
+
context={{ variant, action }}
|
|
170
|
+
{...props}
|
|
171
|
+
/>
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
type IToastTitleProps = React.ComponentProps<typeof UIToast.Title> & {
|
|
176
|
+
className?: string;
|
|
177
|
+
} & VariantProps<typeof toastTitleStyle>;
|
|
178
|
+
|
|
179
|
+
export const ToastTitle = React.forwardRef<
|
|
180
|
+
React.ElementRef<typeof UIToast.Title>,
|
|
181
|
+
IToastTitleProps
|
|
182
|
+
>(({ className, size = 'md', ...props }, ref) => {
|
|
183
|
+
const { variant: parentVariant, action: parentAction } =
|
|
184
|
+
useStyleContext(SCOPE);
|
|
185
|
+
return (
|
|
186
|
+
<UIToast.Title
|
|
187
|
+
ref={ref}
|
|
188
|
+
{...props}
|
|
189
|
+
className={toastTitleStyle({
|
|
190
|
+
size,
|
|
191
|
+
class: className,
|
|
192
|
+
parentVariants: {
|
|
193
|
+
variant: parentVariant,
|
|
194
|
+
action: parentAction,
|
|
195
|
+
},
|
|
196
|
+
})}
|
|
197
|
+
/>
|
|
198
|
+
);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
type IToastDescriptionProps = React.ComponentProps<
|
|
202
|
+
typeof UIToast.Description
|
|
203
|
+
> & {
|
|
204
|
+
className?: string;
|
|
205
|
+
} & VariantProps<typeof toastDescriptionStyle>;
|
|
206
|
+
|
|
207
|
+
export const ToastDescription = React.forwardRef<
|
|
208
|
+
React.ElementRef<typeof UIToast.Description>,
|
|
209
|
+
IToastDescriptionProps
|
|
210
|
+
>(({ className, size = 'md', ...props }, ref) => {
|
|
211
|
+
const { variant: parentVariant } = useStyleContext(SCOPE);
|
|
212
|
+
return (
|
|
213
|
+
<UIToast.Description
|
|
214
|
+
ref={ref}
|
|
215
|
+
{...props}
|
|
216
|
+
className={toastDescriptionStyle({
|
|
217
|
+
size,
|
|
218
|
+
class: className,
|
|
219
|
+
parentVariants: {
|
|
220
|
+
variant: parentVariant,
|
|
221
|
+
},
|
|
222
|
+
})}
|
|
223
|
+
/>
|
|
224
|
+
);
|
|
225
|
+
});
|