@onehat/ui 0.3.381 → 0.4.1
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 +41 -23
- 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 +151 -57
- 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 +3 -2
- 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,103 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { skeletonStyle, skeletonTextStyle } from './styles';
|
|
3
|
+
|
|
4
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
5
|
+
|
|
6
|
+
type ISkeletonProps = React.ComponentPropsWithoutRef<'div'> &
|
|
7
|
+
VariantProps<typeof skeletonStyle> & {
|
|
8
|
+
startColor?: string;
|
|
9
|
+
isLoaded?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const Skeleton = React.forwardRef<HTMLDivElement, ISkeletonProps>(
|
|
13
|
+
(
|
|
14
|
+
{
|
|
15
|
+
className,
|
|
16
|
+
variant = 'rounded',
|
|
17
|
+
children,
|
|
18
|
+
speed = 2,
|
|
19
|
+
startColor = 'bg-background-200',
|
|
20
|
+
isLoaded = false,
|
|
21
|
+
...props
|
|
22
|
+
},
|
|
23
|
+
ref
|
|
24
|
+
) => {
|
|
25
|
+
if (!isLoaded) {
|
|
26
|
+
return (
|
|
27
|
+
<div
|
|
28
|
+
ref={ref}
|
|
29
|
+
className={`animate-pulse ${startColor} ${skeletonStyle({
|
|
30
|
+
variant,
|
|
31
|
+
speed,
|
|
32
|
+
class: className,
|
|
33
|
+
})}`}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
} else {
|
|
38
|
+
return children;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
type ISkeletonTextProps = React.ComponentPropsWithoutRef<'div'> &
|
|
44
|
+
VariantProps<typeof skeletonTextStyle> & {
|
|
45
|
+
_lines?: number;
|
|
46
|
+
isLoaded?: boolean;
|
|
47
|
+
startColor?: string;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const SkeletonText = React.forwardRef<HTMLDivElement, ISkeletonTextProps>(
|
|
51
|
+
(
|
|
52
|
+
{
|
|
53
|
+
className,
|
|
54
|
+
_lines,
|
|
55
|
+
isLoaded = false,
|
|
56
|
+
startColor = 'bg-background-200',
|
|
57
|
+
gap = 2,
|
|
58
|
+
children,
|
|
59
|
+
...props
|
|
60
|
+
},
|
|
61
|
+
ref
|
|
62
|
+
) => {
|
|
63
|
+
if (!isLoaded) {
|
|
64
|
+
if (_lines) {
|
|
65
|
+
return (
|
|
66
|
+
<div
|
|
67
|
+
ref={ref}
|
|
68
|
+
className={`flex flex-col ${skeletonTextStyle({
|
|
69
|
+
gap,
|
|
70
|
+
})}`}
|
|
71
|
+
>
|
|
72
|
+
{Array.from({ length: _lines }).map((_, index) => (
|
|
73
|
+
<div
|
|
74
|
+
key={index}
|
|
75
|
+
className={`animate-pulse ${startColor} ${skeletonTextStyle({
|
|
76
|
+
class: className,
|
|
77
|
+
})}`}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
))}
|
|
81
|
+
</div>
|
|
82
|
+
);
|
|
83
|
+
} else {
|
|
84
|
+
return (
|
|
85
|
+
<div
|
|
86
|
+
ref={ref}
|
|
87
|
+
className={`animate-pulse ${startColor} ${skeletonTextStyle({
|
|
88
|
+
class: className,
|
|
89
|
+
})}`}
|
|
90
|
+
{...props}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
return children;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
Skeleton.displayName = 'Skeleton';
|
|
101
|
+
SkeletonText.displayName = 'SkeletonText';
|
|
102
|
+
|
|
103
|
+
export { Skeleton, SkeletonText };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
2
|
+
|
|
3
|
+
export const skeletonStyle = tva({
|
|
4
|
+
base: 'w-full h-full',
|
|
5
|
+
variants: {
|
|
6
|
+
variant: {
|
|
7
|
+
sharp: 'rounded-none',
|
|
8
|
+
circular: 'rounded-full',
|
|
9
|
+
rounded: 'rounded-md',
|
|
10
|
+
},
|
|
11
|
+
speed: {
|
|
12
|
+
1: 'duration-75',
|
|
13
|
+
2: 'duration-100',
|
|
14
|
+
3: 'duration-150',
|
|
15
|
+
4: 'duration-200',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export const skeletonTextStyle = tva({
|
|
20
|
+
base: 'rounded-sm w-full',
|
|
21
|
+
variants: {
|
|
22
|
+
speed: {
|
|
23
|
+
1: 'duration-75',
|
|
24
|
+
2: 'duration-100',
|
|
25
|
+
3: 'duration-150',
|
|
26
|
+
4: 'duration-200',
|
|
27
|
+
},
|
|
28
|
+
gap: {
|
|
29
|
+
1: 'gap-1',
|
|
30
|
+
2: 'gap-2',
|
|
31
|
+
3: 'gap-3',
|
|
32
|
+
4: 'gap-4',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
});
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createSlider } from '@gluestack-ui/slider';
|
|
3
|
+
import { Pressable } from 'react-native';
|
|
4
|
+
import { View, Platform } from 'react-native';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
7
|
+
import {
|
|
8
|
+
withStyleContext,
|
|
9
|
+
useStyleContext,
|
|
10
|
+
} from '@gluestack-ui/nativewind-utils/withStyleContext';
|
|
11
|
+
import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withStyleContextAndStates';
|
|
12
|
+
import { cssInterop } from 'nativewind';
|
|
13
|
+
import { withStates } from '@gluestack-ui/nativewind-utils/withStates';
|
|
14
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
15
|
+
|
|
16
|
+
const ThumbWrapper = React.forwardRef<
|
|
17
|
+
React.ElementRef<typeof View>,
|
|
18
|
+
React.ComponentProps<typeof View>
|
|
19
|
+
>((props, ref) => <View ref={ref} {...props} />);
|
|
20
|
+
|
|
21
|
+
const FilledTrackWrapper = React.forwardRef<
|
|
22
|
+
React.ElementRef<typeof View>,
|
|
23
|
+
React.ComponentProps<typeof View>
|
|
24
|
+
>((props, ref) => <View ref={ref} {...props} />);
|
|
25
|
+
|
|
26
|
+
const SCOPE = 'SLIDER';
|
|
27
|
+
export const UISlider = createSlider({
|
|
28
|
+
Root:
|
|
29
|
+
Platform.OS === 'web'
|
|
30
|
+
? withStyleContext(View, SCOPE)
|
|
31
|
+
: withStyleContextAndStates(View, SCOPE),
|
|
32
|
+
Thumb: Platform.OS === 'web' ? ThumbWrapper : withStates(View),
|
|
33
|
+
Track: Pressable,
|
|
34
|
+
FilledTrack: Platform.OS === 'web' ? FilledTrackWrapper : withStates(View),
|
|
35
|
+
ThumbInteraction: View,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
cssInterop(UISlider, { className: 'style' });
|
|
39
|
+
cssInterop(ThumbWrapper, { className: 'style' });
|
|
40
|
+
cssInterop(UISlider.Track, { className: 'style' });
|
|
41
|
+
cssInterop(FilledTrackWrapper, { className: 'style' });
|
|
42
|
+
|
|
43
|
+
const sliderStyle = tva({
|
|
44
|
+
base: 'justify-center items-center data-[disabled=true]:web:opacity-40 data-[disabled=true]:web:pointer-events-none',
|
|
45
|
+
variants: {
|
|
46
|
+
orientation: {
|
|
47
|
+
horizontal: 'w-full',
|
|
48
|
+
vertical: 'h-full',
|
|
49
|
+
},
|
|
50
|
+
size: {
|
|
51
|
+
sm: '',
|
|
52
|
+
md: '',
|
|
53
|
+
lg: '',
|
|
54
|
+
},
|
|
55
|
+
isReversed: {
|
|
56
|
+
true: '',
|
|
57
|
+
false: '',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const sliderThumbStyle = tva({
|
|
63
|
+
base: 'bg-primary-500 absolute rounded-full data-[focus=true]:bg-primary-600 data-[active=true]:bg-primary-600 data-[hover=true]:bg-primary-600 data-[disabled=true]:bg-primary-500 web:cursor-pointer web:data-[active=true]:outline web:data-[active=true]:outline-4 web:data-[active=true]:outline-primary-400 shadow-hard-1',
|
|
64
|
+
|
|
65
|
+
parentVariants: {
|
|
66
|
+
size: {
|
|
67
|
+
sm: 'h-4 w-4',
|
|
68
|
+
md: 'h-5 w-5',
|
|
69
|
+
lg: 'h-6 w-6',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const sliderTrackStyle = tva({
|
|
75
|
+
base: 'bg-background-300 rounded-lg overflow-hidden',
|
|
76
|
+
parentVariants: {
|
|
77
|
+
orientation: {
|
|
78
|
+
horizontal: 'w-full',
|
|
79
|
+
vertical: 'h-full',
|
|
80
|
+
},
|
|
81
|
+
isReversed: {
|
|
82
|
+
true: '',
|
|
83
|
+
false: '',
|
|
84
|
+
},
|
|
85
|
+
size: {
|
|
86
|
+
sm: '',
|
|
87
|
+
md: '',
|
|
88
|
+
lg: '',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
parentCompoundVariants: [
|
|
92
|
+
{
|
|
93
|
+
orientation: 'horizontal',
|
|
94
|
+
size: 'sm',
|
|
95
|
+
class: 'h-1 flex-row',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
orientation: 'horizontal',
|
|
99
|
+
size: 'sm',
|
|
100
|
+
isReversed: true,
|
|
101
|
+
class: 'h-1 flex-row-reverse',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
orientation: 'horizontal',
|
|
105
|
+
size: 'md',
|
|
106
|
+
class: 'h-1 flex-row',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
orientation: 'horizontal',
|
|
110
|
+
size: 'md',
|
|
111
|
+
isReversed: true,
|
|
112
|
+
class: 'h-[5px] flex-row-reverse',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
orientation: 'horizontal',
|
|
116
|
+
size: 'lg',
|
|
117
|
+
class: 'h-1.5 flex-row',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
orientation: 'horizontal',
|
|
121
|
+
size: 'lg',
|
|
122
|
+
isReversed: true,
|
|
123
|
+
class: 'h-1.5 flex-row-reverse',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
orientation: 'vertical',
|
|
127
|
+
size: 'sm',
|
|
128
|
+
class: 'w-1 flex-col-reverse',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
orientation: 'vertical',
|
|
132
|
+
size: 'sm',
|
|
133
|
+
isReversed: true,
|
|
134
|
+
class: 'w-1 flex-col',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
orientation: 'vertical',
|
|
138
|
+
size: 'md',
|
|
139
|
+
class: 'w-[5px] flex-col-reverse',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
orientation: 'vertical',
|
|
143
|
+
size: 'md',
|
|
144
|
+
isReversed: true,
|
|
145
|
+
class: 'w-[5px] flex-col',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
orientation: 'vertical',
|
|
149
|
+
size: 'lg',
|
|
150
|
+
class: 'w-1.5 flex-col-reverse',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
orientation: 'vertical',
|
|
154
|
+
size: 'lg',
|
|
155
|
+
isReversed: true,
|
|
156
|
+
class: 'w-1.5 flex-col',
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
const sliderFilledTrackStyle = tva({
|
|
162
|
+
base: 'bg-primary-500 data-[focus=true]:bg-primary-600 data-[active=true]:bg-primary-600 data-[hover=true]:bg-primary-600',
|
|
163
|
+
parentVariants: {
|
|
164
|
+
orientation: {
|
|
165
|
+
horizontal: 'h-full',
|
|
166
|
+
vertical: 'w-full',
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
type ISliderProps = React.ComponentProps<typeof UISlider> &
|
|
172
|
+
VariantProps<typeof sliderStyle>;
|
|
173
|
+
|
|
174
|
+
export const Slider = React.forwardRef<
|
|
175
|
+
React.ElementRef<typeof UISlider>,
|
|
176
|
+
ISliderProps
|
|
177
|
+
>(
|
|
178
|
+
(
|
|
179
|
+
{
|
|
180
|
+
className,
|
|
181
|
+
size = 'md',
|
|
182
|
+
orientation = 'horizontal',
|
|
183
|
+
isReversed = false,
|
|
184
|
+
...props
|
|
185
|
+
},
|
|
186
|
+
ref
|
|
187
|
+
) => {
|
|
188
|
+
return (
|
|
189
|
+
<UISlider
|
|
190
|
+
ref={ref}
|
|
191
|
+
isReversed={isReversed}
|
|
192
|
+
orientation={orientation}
|
|
193
|
+
{...props}
|
|
194
|
+
className={sliderStyle({
|
|
195
|
+
orientation,
|
|
196
|
+
isReversed,
|
|
197
|
+
class: className,
|
|
198
|
+
})}
|
|
199
|
+
context={{ size, orientation, isReversed }}
|
|
200
|
+
/>
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
type ISliderThumbProps = React.ComponentProps<typeof UISlider.Thumb> &
|
|
206
|
+
VariantProps<typeof sliderThumbStyle>;
|
|
207
|
+
|
|
208
|
+
export const SliderThumb = React.forwardRef<
|
|
209
|
+
React.ElementRef<typeof UISlider.Thumb>,
|
|
210
|
+
ISliderThumbProps
|
|
211
|
+
>(({ className, size, ...props }, ref) => {
|
|
212
|
+
const { size: parentSize } = useStyleContext(SCOPE);
|
|
213
|
+
|
|
214
|
+
return (
|
|
215
|
+
<UISlider.Thumb
|
|
216
|
+
//@ts-ignore
|
|
217
|
+
ref={ref}
|
|
218
|
+
{...props}
|
|
219
|
+
className={sliderThumbStyle({
|
|
220
|
+
parentVariants: {
|
|
221
|
+
size: parentSize,
|
|
222
|
+
},
|
|
223
|
+
size,
|
|
224
|
+
class: className,
|
|
225
|
+
})}
|
|
226
|
+
/>
|
|
227
|
+
);
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
type ISliderTrackProps = React.ComponentProps<typeof UISlider.Track> &
|
|
231
|
+
VariantProps<typeof sliderTrackStyle>;
|
|
232
|
+
|
|
233
|
+
export const SliderTrack = React.forwardRef<
|
|
234
|
+
React.ElementRef<typeof UISlider.Track>,
|
|
235
|
+
ISliderTrackProps
|
|
236
|
+
>(({ className, ...props }, ref) => {
|
|
237
|
+
const {
|
|
238
|
+
orientation: parentOrientation,
|
|
239
|
+
size: parentSize,
|
|
240
|
+
isReversed,
|
|
241
|
+
} = useStyleContext(SCOPE);
|
|
242
|
+
|
|
243
|
+
return (
|
|
244
|
+
<UISlider.Track
|
|
245
|
+
ref={ref}
|
|
246
|
+
{...props}
|
|
247
|
+
className={sliderTrackStyle({
|
|
248
|
+
parentVariants: {
|
|
249
|
+
orientation: parentOrientation,
|
|
250
|
+
size: parentSize,
|
|
251
|
+
isReversed,
|
|
252
|
+
},
|
|
253
|
+
class: className,
|
|
254
|
+
})}
|
|
255
|
+
/>
|
|
256
|
+
);
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
type ISliderFilledTrackProps = React.ComponentProps<
|
|
260
|
+
typeof UISlider.FilledTrack
|
|
261
|
+
> &
|
|
262
|
+
VariantProps<typeof sliderFilledTrackStyle>;
|
|
263
|
+
|
|
264
|
+
export const SliderFilledTrack = React.forwardRef<
|
|
265
|
+
React.ElementRef<typeof UISlider.FilledTrack>,
|
|
266
|
+
ISliderFilledTrackProps
|
|
267
|
+
>(({ className, ...props }, ref) => {
|
|
268
|
+
const { orientation: parentOrientation } = useStyleContext(SCOPE);
|
|
269
|
+
|
|
270
|
+
return (
|
|
271
|
+
<UISlider.FilledTrack
|
|
272
|
+
//@ts-ignore
|
|
273
|
+
ref={ref}
|
|
274
|
+
{...props}
|
|
275
|
+
className={sliderFilledTrackStyle({
|
|
276
|
+
parentVariants: {
|
|
277
|
+
orientation: parentOrientation,
|
|
278
|
+
},
|
|
279
|
+
class: className,
|
|
280
|
+
})}
|
|
281
|
+
/>
|
|
282
|
+
);
|
|
283
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { ActivityIndicator } from 'react-native';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { createSpinner } from '@gluestack-ui/spinner';
|
|
5
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
6
|
+
import { cssInterop } from 'nativewind';
|
|
7
|
+
|
|
8
|
+
const UISpinner = createSpinner({ Root: ActivityIndicator });
|
|
9
|
+
|
|
10
|
+
cssInterop(UISpinner, {
|
|
11
|
+
className: { target: 'style', nativeStyleToProp: { color: true } },
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const spinnerStyle = tva({});
|
|
15
|
+
|
|
16
|
+
type ISpinnerProps = React.ComponentProps<typeof UISpinner>;
|
|
17
|
+
|
|
18
|
+
const Spinner = React.forwardRef<
|
|
19
|
+
React.ElementRef<typeof UISpinner>,
|
|
20
|
+
ISpinnerProps
|
|
21
|
+
>(({ className, color, ...props }, ref) => {
|
|
22
|
+
return (
|
|
23
|
+
<UISpinner
|
|
24
|
+
ref={ref}
|
|
25
|
+
{...props}
|
|
26
|
+
color={color}
|
|
27
|
+
className={spinnerStyle({ class: className })}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
Spinner.displayName = 'Spinner';
|
|
33
|
+
|
|
34
|
+
export { Spinner };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Switch as RNSwitch, Platform } from 'react-native';
|
|
4
|
+
import { createSwitch } from '@gluestack-ui/switch';
|
|
5
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
6
|
+
import { withStyleContext } from '@gluestack-ui/nativewind-utils/withStyleContext';
|
|
7
|
+
import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withStyleContextAndStates';
|
|
8
|
+
import { cssInterop } from 'nativewind';
|
|
9
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
10
|
+
|
|
11
|
+
const SwitchWrapper = React.forwardRef<
|
|
12
|
+
React.ElementRef<typeof RNSwitch>,
|
|
13
|
+
React.ComponentProps<typeof RNSwitch>
|
|
14
|
+
>(({ ...props }, ref) => {
|
|
15
|
+
return <RNSwitch {...props} ref={ref} />;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const UISwitch = createSwitch({
|
|
19
|
+
Root:
|
|
20
|
+
Platform.OS === 'web'
|
|
21
|
+
? withStyleContext(SwitchWrapper)
|
|
22
|
+
: withStyleContextAndStates(SwitchWrapper),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
cssInterop(SwitchWrapper, { className: 'style' });
|
|
26
|
+
|
|
27
|
+
const switchStyle = tva({
|
|
28
|
+
base: 'data-[focus=true]:outline-0 data-[focus=true]:ring-2 data-[focus=true]:ring-indicator-primary web:cursor-pointer disabled:cursor-not-allowed data-[disabled=true]:opacity-40 data-[invalid=true]:border-error-700 data-[invalid=true]:rounded-xl data-[invalid=true]:border-2',
|
|
29
|
+
|
|
30
|
+
variants: {
|
|
31
|
+
size: {
|
|
32
|
+
sm: 'scale-75',
|
|
33
|
+
md: '',
|
|
34
|
+
lg: 'scale-125',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
type ISwitchProps = React.ComponentProps<typeof UISwitch> &
|
|
40
|
+
VariantProps<typeof switchStyle>;
|
|
41
|
+
const Switch = React.forwardRef<
|
|
42
|
+
React.ElementRef<typeof UISwitch>,
|
|
43
|
+
ISwitchProps
|
|
44
|
+
>(({ className, size = 'md', ...props }, ref) => {
|
|
45
|
+
return (
|
|
46
|
+
<UISwitch
|
|
47
|
+
ref={ref}
|
|
48
|
+
{...props}
|
|
49
|
+
className={switchStyle({ size, class: className })}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
Switch.displayName = 'Switch';
|
|
55
|
+
export { Switch };
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import React, { createContext, useMemo, useContext } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Table as ExpoTable,
|
|
4
|
+
THead as ExpoTHead,
|
|
5
|
+
TBody as ExpoTBody,
|
|
6
|
+
TFoot as ExpoTFoot,
|
|
7
|
+
TR as ExpoTR,
|
|
8
|
+
Caption as ExpoTCaption,
|
|
9
|
+
} from '@expo/html-elements';
|
|
10
|
+
import {
|
|
11
|
+
tableStyle,
|
|
12
|
+
tableHeaderStyle,
|
|
13
|
+
tableBodyStyle,
|
|
14
|
+
tableFooterStyle,
|
|
15
|
+
tableHeadStyle,
|
|
16
|
+
tableRowStyleStyle,
|
|
17
|
+
tableDataStyle,
|
|
18
|
+
tableCaptionStyle,
|
|
19
|
+
} from './styles';
|
|
20
|
+
import { Text, View } from 'react-native';
|
|
21
|
+
|
|
22
|
+
const TableHeaderContext = createContext<any>({});
|
|
23
|
+
const TableFooterContext = createContext<any>({});
|
|
24
|
+
|
|
25
|
+
type ITableProps = React.ComponentProps<typeof ExpoTable>;
|
|
26
|
+
type ITableHeaderProps = React.ComponentProps<typeof ExpoTHead>;
|
|
27
|
+
type ITableBodyProps = React.ComponentProps<typeof ExpoTBody>;
|
|
28
|
+
type ITableFooterProps = React.ComponentProps<typeof ExpoTFoot>;
|
|
29
|
+
type ITableHeadProps = React.ComponentProps<typeof View | typeof Text> & {
|
|
30
|
+
useRNView?: boolean;
|
|
31
|
+
};
|
|
32
|
+
type ITableRowProps = React.ComponentProps<typeof ExpoTR>;
|
|
33
|
+
type ITableDataProps = React.ComponentProps<typeof View | typeof Text> & {
|
|
34
|
+
useRNView?: boolean;
|
|
35
|
+
};
|
|
36
|
+
type ITableCaptionProps = React.ComponentProps<typeof ExpoTCaption>;
|
|
37
|
+
|
|
38
|
+
const Table = React.forwardRef<React.ElementRef<typeof ExpoTable>, ITableProps>(
|
|
39
|
+
({ className, ...props }, ref) => {
|
|
40
|
+
return (
|
|
41
|
+
<ExpoTable
|
|
42
|
+
ref={ref}
|
|
43
|
+
className={tableStyle({ class: className })}
|
|
44
|
+
{...props}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const TableHeader = React.forwardRef<
|
|
51
|
+
React.ElementRef<typeof ExpoTHead>,
|
|
52
|
+
ITableHeaderProps
|
|
53
|
+
>(({ className, ...props }, ref) => {
|
|
54
|
+
const contextValue = useMemo(() => {
|
|
55
|
+
return {
|
|
56
|
+
isHeaderRow: true,
|
|
57
|
+
};
|
|
58
|
+
}, []);
|
|
59
|
+
return (
|
|
60
|
+
<TableHeaderContext.Provider value={contextValue}>
|
|
61
|
+
<ExpoTHead
|
|
62
|
+
ref={ref}
|
|
63
|
+
className={tableHeaderStyle({ class: className })}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
</TableHeaderContext.Provider>
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const TableBody = React.forwardRef<
|
|
71
|
+
React.ElementRef<typeof ExpoTBody>,
|
|
72
|
+
ITableBodyProps
|
|
73
|
+
>(({ className, ...props }, ref) => {
|
|
74
|
+
return (
|
|
75
|
+
<ExpoTBody
|
|
76
|
+
ref={ref}
|
|
77
|
+
className={tableBodyStyle({ class: className })}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const TableFooter = React.forwardRef<
|
|
84
|
+
React.ElementRef<typeof ExpoTFoot>,
|
|
85
|
+
ITableFooterProps
|
|
86
|
+
>(({ className, ...props }, ref) => {
|
|
87
|
+
const contextValue = useMemo(() => {
|
|
88
|
+
return {
|
|
89
|
+
isFooterRow: true,
|
|
90
|
+
};
|
|
91
|
+
}, []);
|
|
92
|
+
return (
|
|
93
|
+
<TableFooterContext.Provider value={contextValue}>
|
|
94
|
+
<ExpoTFoot
|
|
95
|
+
ref={ref}
|
|
96
|
+
className={tableFooterStyle({ class: className })}
|
|
97
|
+
{...props}
|
|
98
|
+
/>
|
|
99
|
+
</TableFooterContext.Provider>
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const TableHead = React.forwardRef<
|
|
104
|
+
React.ElementRef<typeof View | typeof Text>,
|
|
105
|
+
ITableHeadProps
|
|
106
|
+
>(({ useRNView = false, className, ...props }, ref) => {
|
|
107
|
+
if (useRNView) {
|
|
108
|
+
return (
|
|
109
|
+
<View
|
|
110
|
+
ref={ref}
|
|
111
|
+
className={tableHeadStyle({ class: className })}
|
|
112
|
+
{...props}
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
115
|
+
} else {
|
|
116
|
+
return (
|
|
117
|
+
<Text
|
|
118
|
+
ref={ref}
|
|
119
|
+
className={tableHeadStyle({ class: className })}
|
|
120
|
+
{...props}
|
|
121
|
+
/>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const TableRow = React.forwardRef<
|
|
127
|
+
React.ElementRef<typeof ExpoTR>,
|
|
128
|
+
ITableRowProps
|
|
129
|
+
>(({ className, ...props }, ref) => {
|
|
130
|
+
const { isHeaderRow } = useContext(TableHeaderContext);
|
|
131
|
+
const { isFooterRow } = useContext(TableFooterContext);
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
<ExpoTR
|
|
135
|
+
ref={ref}
|
|
136
|
+
className={tableRowStyleStyle({
|
|
137
|
+
isHeaderRow,
|
|
138
|
+
isFooterRow,
|
|
139
|
+
class: className,
|
|
140
|
+
})}
|
|
141
|
+
{...props}
|
|
142
|
+
/>
|
|
143
|
+
);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const TableData = React.forwardRef<
|
|
147
|
+
React.ElementRef<typeof View | typeof Text>,
|
|
148
|
+
ITableDataProps
|
|
149
|
+
>(({ useRNView = false, className, ...props }, ref) => {
|
|
150
|
+
if (useRNView) {
|
|
151
|
+
return (
|
|
152
|
+
<View
|
|
153
|
+
ref={ref}
|
|
154
|
+
className={tableDataStyle({ class: className })}
|
|
155
|
+
{...props}
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
158
|
+
} else {
|
|
159
|
+
return (
|
|
160
|
+
<Text
|
|
161
|
+
ref={ref}
|
|
162
|
+
className={tableDataStyle({ class: className })}
|
|
163
|
+
{...props}
|
|
164
|
+
/>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
const TableCaption = React.forwardRef<
|
|
170
|
+
React.ElementRef<typeof ExpoTCaption>,
|
|
171
|
+
ITableCaptionProps
|
|
172
|
+
>(({ className, ...props }, ref) => {
|
|
173
|
+
return (
|
|
174
|
+
<ExpoTCaption
|
|
175
|
+
ref={ref}
|
|
176
|
+
className={tableCaptionStyle({ class: className })}
|
|
177
|
+
{...props}
|
|
178
|
+
/>
|
|
179
|
+
);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
Table.displayName = 'Table';
|
|
183
|
+
TableHeader.displayName = 'TableHeader';
|
|
184
|
+
TableBody.displayName = 'TableBody';
|
|
185
|
+
TableFooter.displayName = 'TableFooter';
|
|
186
|
+
TableHead.displayName = 'TableHead';
|
|
187
|
+
TableRow.displayName = 'TableRow';
|
|
188
|
+
TableData.displayName = 'TableData';
|
|
189
|
+
TableCaption.displayName = 'TableCaption';
|
|
190
|
+
|
|
191
|
+
export {
|
|
192
|
+
Table,
|
|
193
|
+
TableHeader,
|
|
194
|
+
TableBody,
|
|
195
|
+
TableFooter,
|
|
196
|
+
TableHead,
|
|
197
|
+
TableRow,
|
|
198
|
+
TableData,
|
|
199
|
+
TableCaption,
|
|
200
|
+
};
|