@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,494 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { createButton } from '@gluestack-ui/button';
|
|
4
|
+
import { Svg } from 'react-native-svg';
|
|
5
|
+
import type { PressableProps } from 'react-native';
|
|
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 {
|
|
15
|
+
ActivityIndicator,
|
|
16
|
+
Pressable,
|
|
17
|
+
Text,
|
|
18
|
+
View,
|
|
19
|
+
Platform,
|
|
20
|
+
} from 'react-native';
|
|
21
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
22
|
+
|
|
23
|
+
const SCOPE = 'BUTTON';
|
|
24
|
+
const ButtonWrapper = React.forwardRef<
|
|
25
|
+
React.ElementRef<typeof Pressable>,
|
|
26
|
+
PressableProps
|
|
27
|
+
>(({ ...props }, ref) => {
|
|
28
|
+
return <Pressable {...props} ref={ref} />;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
type IPrimitiveIcon = React.ComponentPropsWithoutRef<typeof Svg> & {
|
|
32
|
+
height?: number | string;
|
|
33
|
+
width?: number | string;
|
|
34
|
+
fill?: string;
|
|
35
|
+
color?: string;
|
|
36
|
+
size?: number | string;
|
|
37
|
+
stroke?: string;
|
|
38
|
+
as?: React.ElementType;
|
|
39
|
+
className?: string;
|
|
40
|
+
classNameColor?: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const PrimitiveIcon = React.forwardRef<
|
|
44
|
+
React.ElementRef<typeof Svg>,
|
|
45
|
+
IPrimitiveIcon
|
|
46
|
+
>(
|
|
47
|
+
(
|
|
48
|
+
{
|
|
49
|
+
height,
|
|
50
|
+
width,
|
|
51
|
+
fill,
|
|
52
|
+
color,
|
|
53
|
+
classNameColor,
|
|
54
|
+
size,
|
|
55
|
+
stroke = 'currentColor',
|
|
56
|
+
as: AsComp,
|
|
57
|
+
...props
|
|
58
|
+
},
|
|
59
|
+
ref
|
|
60
|
+
) => {
|
|
61
|
+
color = color ?? classNameColor;
|
|
62
|
+
const sizeProps = useMemo(() => {
|
|
63
|
+
if (size) return { size };
|
|
64
|
+
if (height && width) return { height, width };
|
|
65
|
+
if (height) return { height };
|
|
66
|
+
if (width) return { width };
|
|
67
|
+
return {};
|
|
68
|
+
}, [size, height, width]);
|
|
69
|
+
|
|
70
|
+
let colorProps = {};
|
|
71
|
+
if (fill) {
|
|
72
|
+
colorProps = { ...colorProps, fill: fill };
|
|
73
|
+
}
|
|
74
|
+
if (stroke !== 'currentColor') {
|
|
75
|
+
colorProps = { ...colorProps, stroke: stroke };
|
|
76
|
+
} else if (stroke === 'currentColor' && color !== undefined) {
|
|
77
|
+
colorProps = { ...colorProps, stroke: color };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (AsComp) {
|
|
81
|
+
return <AsComp ref={ref} {...props} {...sizeProps} {...colorProps} />;
|
|
82
|
+
}
|
|
83
|
+
return (
|
|
84
|
+
<Svg ref={ref} height={height} width={width} {...colorProps} {...props} />
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
const Root =
|
|
90
|
+
Platform.OS === 'web'
|
|
91
|
+
? withStyleContext(ButtonWrapper, SCOPE)
|
|
92
|
+
: withStyleContextAndStates(ButtonWrapper, SCOPE);
|
|
93
|
+
|
|
94
|
+
const UIButton = createButton({
|
|
95
|
+
Root: Root,
|
|
96
|
+
Text,
|
|
97
|
+
Group: View,
|
|
98
|
+
Spinner: ActivityIndicator,
|
|
99
|
+
Icon: withStates(PrimitiveIcon),
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
cssInterop(Root, { className: 'style' });
|
|
103
|
+
cssInterop(UIButton.Text, { className: 'style' });
|
|
104
|
+
cssInterop(UIButton.Group, { className: 'style' });
|
|
105
|
+
cssInterop(UIButton.Spinner, {
|
|
106
|
+
className: { target: 'style', nativeStyleToProp: { color: true } },
|
|
107
|
+
});
|
|
108
|
+
//@ts-ignore
|
|
109
|
+
cssInterop(PrimitiveIcon, {
|
|
110
|
+
className: {
|
|
111
|
+
target: 'style',
|
|
112
|
+
nativeStyleToProp: {
|
|
113
|
+
height: true,
|
|
114
|
+
width: true,
|
|
115
|
+
//@ts-ignore
|
|
116
|
+
fill: true,
|
|
117
|
+
color: 'classNameColor',
|
|
118
|
+
stroke: true,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const buttonStyle = tva({
|
|
124
|
+
base: 'group/button rounded bg-primary-500 flex-row items-center justify-center data-[focus-visible=true]:web:outline-none data-[focus-visible=true]:web:ring-2 data-[disabled=true]:opacity-40 gap-2',
|
|
125
|
+
variants: {
|
|
126
|
+
action: {
|
|
127
|
+
primary:
|
|
128
|
+
'bg-primary-500 data-[hover=true]:bg-primary-600 data-[active=true]:bg-primary-700 border-primary-300 data-[hover=true]:border-primary-400 data-[active=true]:border-primary-500 data-[focus-visible=true]:web:ring-indicator-info',
|
|
129
|
+
secondary:
|
|
130
|
+
'bg-secondary-500 border-secondary-300 data-[hover=true]:bg-secondary-600 data-[hover=true]:border-secondary-400 data-[active=true]:bg-secondary-700 data-[active=true]:border-secondary-500 data-[focus-visible=true]:web:ring-indicator-info',
|
|
131
|
+
positive:
|
|
132
|
+
'bg-success-500 border-success-300 data-[hover=true]:bg-success-600 data-[hover=true]:border-success-400 data-[active=true]:bg-success-700 data-[active=true]:border-success-500 data-[focus-visible=true]:web:ring-indicator-info',
|
|
133
|
+
negative:
|
|
134
|
+
'bg-error-500 border-error-300 data-[hover=true]:bg-error-600 data-[hover=true]:border-error-400 data-[active=true]:bg-error-700 data-[active=true]:border-error-500 data-[focus-visible=true]:web:ring-indicator-info',
|
|
135
|
+
default:
|
|
136
|
+
'bg-transparent data-[hover=true]:bg-background-50 data-[active=true]:bg-transparent',
|
|
137
|
+
},
|
|
138
|
+
variant: {
|
|
139
|
+
link: 'px-0',
|
|
140
|
+
outline:
|
|
141
|
+
'bg-transparent border data-[hover=true]:bg-background-50 data-[active=true]:bg-transparent',
|
|
142
|
+
solid: '',
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
size: {
|
|
146
|
+
xs: 'px-3.5 h-8',
|
|
147
|
+
sm: 'px-4 h-9',
|
|
148
|
+
md: 'px-5 h-10',
|
|
149
|
+
lg: 'px-6 h-11',
|
|
150
|
+
xl: 'px-7 h-12',
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
compoundVariants: [
|
|
154
|
+
{
|
|
155
|
+
action: 'primary',
|
|
156
|
+
variant: 'link',
|
|
157
|
+
class:
|
|
158
|
+
'px-0 bg-transparent data-[hover=true]:bg-transparent data-[active=true]:bg-transparent',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
action: 'secondary',
|
|
162
|
+
variant: 'link',
|
|
163
|
+
class:
|
|
164
|
+
'px-0 bg-transparent data-[hover=true]:bg-transparent data-[active=true]:bg-transparent',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
action: 'positive',
|
|
168
|
+
variant: 'link',
|
|
169
|
+
class:
|
|
170
|
+
'px-0 bg-transparent data-[hover=true]:bg-transparent data-[active=true]:bg-transparent',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
action: 'negative',
|
|
174
|
+
variant: 'link',
|
|
175
|
+
class:
|
|
176
|
+
'px-0 bg-transparent data-[hover=true]:bg-transparent data-[active=true]:bg-transparent',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
action: 'primary',
|
|
180
|
+
variant: 'outline',
|
|
181
|
+
class:
|
|
182
|
+
'bg-transparent data-[hover=true]:bg-background-50 data-[active=true]:bg-transparent',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
action: 'secondary',
|
|
186
|
+
variant: 'outline',
|
|
187
|
+
class:
|
|
188
|
+
'bg-transparent data-[hover=true]:bg-background-50 data-[active=true]:bg-transparent',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
action: 'positive',
|
|
192
|
+
variant: 'outline',
|
|
193
|
+
class:
|
|
194
|
+
'bg-transparent data-[hover=true]:bg-background-50 data-[active=true]:bg-transparent',
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
action: 'negative',
|
|
198
|
+
variant: 'outline',
|
|
199
|
+
class:
|
|
200
|
+
'bg-transparent data-[hover=true]:bg-background-50 data-[active=true]:bg-transparent',
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
const buttonTextStyle = tva({
|
|
206
|
+
base: 'text-typography-0 font-semibold web:select-none',
|
|
207
|
+
parentVariants: {
|
|
208
|
+
action: {
|
|
209
|
+
primary:
|
|
210
|
+
'text-primary-600 data-[hover=true]:text-primary-600 data-[active=true]:text-primary-700',
|
|
211
|
+
secondary:
|
|
212
|
+
'text-secondary-600 data-[hover=true]:text-secondary-600 data-[active=true]:text-secondary-700',
|
|
213
|
+
positive:
|
|
214
|
+
'text-success-600 data-[hover=true]:text-success-600 data-[active=true]:text-success-700',
|
|
215
|
+
negative:
|
|
216
|
+
'text-error-600 data-[hover=true]:text-error-600 data-[active=true]:text-error-700',
|
|
217
|
+
},
|
|
218
|
+
variant: {
|
|
219
|
+
link: 'data-[hover=true]:underline data-[active=true]:underline',
|
|
220
|
+
outline: '',
|
|
221
|
+
solid:
|
|
222
|
+
'text-typography-0 data-[hover=true]:text-typography-0 data-[active=true]:text-typography-0',
|
|
223
|
+
},
|
|
224
|
+
size: {
|
|
225
|
+
xs: 'text-xs',
|
|
226
|
+
sm: 'text-sm',
|
|
227
|
+
md: 'text-base',
|
|
228
|
+
lg: 'text-lg',
|
|
229
|
+
xl: 'text-xl',
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
parentCompoundVariants: [
|
|
233
|
+
{
|
|
234
|
+
variant: 'solid',
|
|
235
|
+
action: 'primary',
|
|
236
|
+
class:
|
|
237
|
+
'text-typography-0 data-[hover=true]:text-typography-0 data-[active=true]:text-typography-0',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
variant: 'solid',
|
|
241
|
+
action: 'secondary',
|
|
242
|
+
class:
|
|
243
|
+
'text-typography-0 data-[hover=true]:text-typography-0 data-[active=true]:text-typography-0',
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
variant: 'solid',
|
|
247
|
+
action: 'positive',
|
|
248
|
+
class:
|
|
249
|
+
'text-typography-0 data-[hover=true]:text-typography-0 data-[active=true]:text-typography-0',
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
variant: 'solid',
|
|
253
|
+
action: 'negative',
|
|
254
|
+
class:
|
|
255
|
+
'text-typography-0 data-[hover=true]:text-typography-0 data-[active=true]:text-typography-0',
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
variant: 'outline',
|
|
259
|
+
action: 'primary',
|
|
260
|
+
class:
|
|
261
|
+
'text-primary-500 data-[hover=true]:text-primary-500 data-[active=true]:text-primary-500',
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
variant: 'outline',
|
|
265
|
+
action: 'secondary',
|
|
266
|
+
class:
|
|
267
|
+
'text-primary-500 data-[hover=true]:text-primary-500 data-[active=true]:text-primary-500',
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
variant: 'outline',
|
|
271
|
+
action: 'positive',
|
|
272
|
+
class:
|
|
273
|
+
'text-primary-500 data-[hover=true]:text-primary-500 data-[active=true]:text-primary-500',
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
variant: 'outline',
|
|
277
|
+
action: 'negative',
|
|
278
|
+
class:
|
|
279
|
+
'text-primary-500 data-[hover=true]:text-primary-500 data-[active=true]:text-primary-500',
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
const buttonIconStyle = tva({
|
|
285
|
+
base: 'fill-none',
|
|
286
|
+
parentVariants: {
|
|
287
|
+
variant: {
|
|
288
|
+
link: 'data-[hover=true]:underline data-[active=true]:underline',
|
|
289
|
+
outline: '',
|
|
290
|
+
solid:
|
|
291
|
+
'text-typography-0 data-[hover=true]:text-typography-0 data-[active=true]:text-typography-0',
|
|
292
|
+
},
|
|
293
|
+
size: {
|
|
294
|
+
xs: 'h-3.5 w-3.5',
|
|
295
|
+
sm: 'h-4 w-4',
|
|
296
|
+
md: 'h-[18px] w-[18px]',
|
|
297
|
+
lg: 'h-[18px] w-[18px]',
|
|
298
|
+
xl: 'h-5 w-5',
|
|
299
|
+
},
|
|
300
|
+
action: {
|
|
301
|
+
primary:
|
|
302
|
+
'text-primary-600 data-[hover=true]:text-primary-600 data-[active=true]:text-primary-700',
|
|
303
|
+
secondary:
|
|
304
|
+
'text-secondary-600 data-[hover=true]:text-secondary-600 data-[active=true]:text-secondary-700',
|
|
305
|
+
positive:
|
|
306
|
+
'text-success-600 data-[hover=true]:text-success-600 data-[active=true]:text-success-700',
|
|
307
|
+
|
|
308
|
+
negative:
|
|
309
|
+
'text-error-600 data-[hover=true]:text-error-600 data-[active=true]:text-error-700',
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
parentCompoundVariants: [
|
|
313
|
+
{
|
|
314
|
+
variant: 'solid',
|
|
315
|
+
action: 'primary',
|
|
316
|
+
class:
|
|
317
|
+
'text-typography-0 data-[hover=true]:text-typography-0 data-[active=true]:text-typography-0',
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
variant: 'solid',
|
|
321
|
+
action: 'secondary',
|
|
322
|
+
class:
|
|
323
|
+
'text-typography-0 data-[hover=true]:text-typography-0 data-[active=true]:text-typography-0',
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
variant: 'solid',
|
|
327
|
+
action: 'positive',
|
|
328
|
+
class:
|
|
329
|
+
'text-typography-0 data-[hover=true]:text-typography-0 data-[active=true]:text-typography-0',
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
variant: 'solid',
|
|
333
|
+
action: 'negative',
|
|
334
|
+
class:
|
|
335
|
+
'text-typography-0 data-[hover=true]:text-typography-0 data-[active=true]:text-typography-0',
|
|
336
|
+
},
|
|
337
|
+
],
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
const buttonGroupStyle = tva({
|
|
341
|
+
base: '',
|
|
342
|
+
variants: {
|
|
343
|
+
space: {
|
|
344
|
+
'xs': 'gap-1',
|
|
345
|
+
'sm': 'gap-2',
|
|
346
|
+
'md': 'gap-3',
|
|
347
|
+
'lg': 'gap-4',
|
|
348
|
+
'xl': 'gap-5',
|
|
349
|
+
'2xl': 'gap-6',
|
|
350
|
+
'3xl': 'gap-7',
|
|
351
|
+
'4xl': 'gap-8',
|
|
352
|
+
},
|
|
353
|
+
isAttached: {
|
|
354
|
+
true: 'gap-0',
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
type IButtonProps = Omit<
|
|
360
|
+
React.ComponentPropsWithoutRef<typeof UIButton>,
|
|
361
|
+
'context'
|
|
362
|
+
> &
|
|
363
|
+
VariantProps<typeof buttonStyle> & { className?: string };
|
|
364
|
+
|
|
365
|
+
const Button = React.forwardRef<
|
|
366
|
+
React.ElementRef<typeof UIButton>,
|
|
367
|
+
IButtonProps
|
|
368
|
+
>(
|
|
369
|
+
(
|
|
370
|
+
{ className, variant = 'solid', size = 'md', action = 'primary', ...props },
|
|
371
|
+
ref
|
|
372
|
+
) => {
|
|
373
|
+
return (
|
|
374
|
+
<UIButton
|
|
375
|
+
ref={ref}
|
|
376
|
+
{...props}
|
|
377
|
+
className={buttonStyle({ variant, size, action, class: className })}
|
|
378
|
+
context={{ variant, size, action }}
|
|
379
|
+
/>
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
|
|
384
|
+
type IButtonTextProps = React.ComponentPropsWithoutRef<typeof UIButton.Text> &
|
|
385
|
+
VariantProps<typeof buttonTextStyle> & { className?: string };
|
|
386
|
+
|
|
387
|
+
const ButtonText = React.forwardRef<
|
|
388
|
+
React.ElementRef<typeof UIButton.Text>,
|
|
389
|
+
IButtonTextProps
|
|
390
|
+
>(({ className, variant, size, action, ...props }, ref) => {
|
|
391
|
+
const {
|
|
392
|
+
variant: parentVariant,
|
|
393
|
+
size: parentSize,
|
|
394
|
+
action: parentAction,
|
|
395
|
+
} = useStyleContext(SCOPE);
|
|
396
|
+
|
|
397
|
+
return (
|
|
398
|
+
<UIButton.Text
|
|
399
|
+
ref={ref}
|
|
400
|
+
{...props}
|
|
401
|
+
className={buttonTextStyle({
|
|
402
|
+
parentVariants: {
|
|
403
|
+
variant: parentVariant,
|
|
404
|
+
size: parentSize,
|
|
405
|
+
action: parentAction,
|
|
406
|
+
},
|
|
407
|
+
variant,
|
|
408
|
+
size,
|
|
409
|
+
action,
|
|
410
|
+
class: className,
|
|
411
|
+
})}
|
|
412
|
+
/>
|
|
413
|
+
);
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
const ButtonSpinner = UIButton.Spinner;
|
|
417
|
+
|
|
418
|
+
type IButtonIcon = React.ComponentPropsWithoutRef<typeof UIButton.Icon> &
|
|
419
|
+
VariantProps<typeof buttonIconStyle> & {
|
|
420
|
+
className?: string | undefined;
|
|
421
|
+
as?: React.ElementType;
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
const ButtonIcon = React.forwardRef<
|
|
425
|
+
React.ElementRef<typeof UIButton.Icon>,
|
|
426
|
+
IButtonIcon
|
|
427
|
+
>(({ className, size, ...props }, ref) => {
|
|
428
|
+
const {
|
|
429
|
+
variant: parentVariant,
|
|
430
|
+
size: parentSize,
|
|
431
|
+
action: parentAction,
|
|
432
|
+
} = useStyleContext(SCOPE);
|
|
433
|
+
|
|
434
|
+
if (typeof size === 'number') {
|
|
435
|
+
return (
|
|
436
|
+
<UIButton.Icon
|
|
437
|
+
ref={ref}
|
|
438
|
+
{...props}
|
|
439
|
+
className={buttonIconStyle({ class: className })}
|
|
440
|
+
size={size}
|
|
441
|
+
/>
|
|
442
|
+
);
|
|
443
|
+
} else if (
|
|
444
|
+
(props.height !== undefined || props.width !== undefined) &&
|
|
445
|
+
size === undefined
|
|
446
|
+
) {
|
|
447
|
+
return (
|
|
448
|
+
<UIButton.Icon
|
|
449
|
+
ref={ref}
|
|
450
|
+
{...props}
|
|
451
|
+
className={buttonIconStyle({ class: className })}
|
|
452
|
+
/>
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
return (
|
|
456
|
+
<UIButton.Icon
|
|
457
|
+
{...props}
|
|
458
|
+
className={buttonIconStyle({
|
|
459
|
+
parentVariants: {
|
|
460
|
+
size: parentSize,
|
|
461
|
+
variant: parentVariant,
|
|
462
|
+
action: parentAction,
|
|
463
|
+
},
|
|
464
|
+
size,
|
|
465
|
+
class: className,
|
|
466
|
+
})}
|
|
467
|
+
ref={ref}
|
|
468
|
+
/>
|
|
469
|
+
);
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
type IButtonGroupProps = React.ComponentPropsWithoutRef<typeof UIButton.Group> &
|
|
473
|
+
VariantProps<typeof buttonGroupStyle>;
|
|
474
|
+
|
|
475
|
+
const ButtonGroup = React.forwardRef<
|
|
476
|
+
React.ElementRef<typeof UIButton.Group>,
|
|
477
|
+
IButtonGroupProps
|
|
478
|
+
>(({ className, space = 'md', isAttached = false, ...props }, ref) => {
|
|
479
|
+
return (
|
|
480
|
+
<UIButton.Group
|
|
481
|
+
className={buttonGroupStyle({ class: className, space, isAttached })}
|
|
482
|
+
{...props}
|
|
483
|
+
ref={ref}
|
|
484
|
+
/>
|
|
485
|
+
);
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
Button.displayName = 'Button';
|
|
489
|
+
ButtonText.displayName = 'ButtonText';
|
|
490
|
+
ButtonSpinner.displayName = 'ButtonSpinner';
|
|
491
|
+
ButtonIcon.displayName = 'ButtonIcon';
|
|
492
|
+
ButtonGroup.displayName = 'ButtonGroup';
|
|
493
|
+
|
|
494
|
+
export { Button, ButtonText, ButtonSpinner, ButtonIcon, ButtonGroup };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
3
|
+
import { View, ViewProps } from 'react-native';
|
|
4
|
+
import { cardStyle } from './styles';
|
|
5
|
+
|
|
6
|
+
type ICardProps = ViewProps &
|
|
7
|
+
VariantProps<typeof cardStyle> & { className?: string };
|
|
8
|
+
|
|
9
|
+
const Card = React.forwardRef<React.ElementRef<typeof View>, ICardProps>(
|
|
10
|
+
({ className, size = 'md', variant = 'elevated', ...props }, ref) => {
|
|
11
|
+
return (
|
|
12
|
+
<View
|
|
13
|
+
className={cardStyle({ size, variant, class: className })}
|
|
14
|
+
{...props}
|
|
15
|
+
ref={ref}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
Card.displayName = 'Card';
|
|
22
|
+
|
|
23
|
+
export { Card };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { cardStyle } from './styles';
|
|
3
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
4
|
+
|
|
5
|
+
type ICardProps = React.ComponentPropsWithoutRef<'div'> &
|
|
6
|
+
VariantProps<typeof cardStyle>;
|
|
7
|
+
|
|
8
|
+
const Card = React.forwardRef<HTMLDivElement, ICardProps>(
|
|
9
|
+
({ className, size = 'md', variant = 'elevated', ...props }, ref) => {
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
className={cardStyle({ size, variant, class: className })}
|
|
13
|
+
{...props}
|
|
14
|
+
ref={ref}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
Card.displayName = 'Card';
|
|
21
|
+
|
|
22
|
+
export { Card };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
2
|
+
import { isWeb } from '@gluestack-ui/nativewind-utils/IsWeb';
|
|
3
|
+
const baseStyle = isWeb ? 'flex flex-col relative z-0' : '';
|
|
4
|
+
|
|
5
|
+
export const cardStyle = tva({
|
|
6
|
+
base: baseStyle,
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
sm: 'p-3 rounded',
|
|
10
|
+
md: 'p-4 rounded-md',
|
|
11
|
+
lg: 'p-6 rounded-xl',
|
|
12
|
+
},
|
|
13
|
+
variant: {
|
|
14
|
+
elevated: 'bg-background-0',
|
|
15
|
+
outline: 'border border-outline-200 ',
|
|
16
|
+
ghost: 'rounded-none',
|
|
17
|
+
filled: 'bg-background-50',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { View, ViewProps } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { centerStyle } from './styles';
|
|
4
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
5
|
+
|
|
6
|
+
type ICenterProps = ViewProps & VariantProps<typeof centerStyle>;
|
|
7
|
+
|
|
8
|
+
const Center = React.forwardRef<React.ElementRef<typeof View>, ICenterProps>(
|
|
9
|
+
({ className, ...props }, ref) => {
|
|
10
|
+
return (
|
|
11
|
+
<View
|
|
12
|
+
className={centerStyle({ class: className })}
|
|
13
|
+
{...props}
|
|
14
|
+
ref={ref}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
Center.displayName = 'Center';
|
|
21
|
+
|
|
22
|
+
export { Center };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { centerStyle } from './styles';
|
|
3
|
+
|
|
4
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
5
|
+
|
|
6
|
+
type ICenterProps = React.ComponentPropsWithoutRef<'div'> &
|
|
7
|
+
VariantProps<typeof centerStyle>;
|
|
8
|
+
|
|
9
|
+
const Center = React.forwardRef<HTMLDivElement, ICenterProps>(
|
|
10
|
+
({ className, ...props }, ref) => {
|
|
11
|
+
return (
|
|
12
|
+
<div className={centerStyle({ class: className })} {...props} ref={ref} />
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
Center.displayName = 'Center';
|
|
18
|
+
|
|
19
|
+
export { Center };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
2
|
+
import { isWeb } from '@gluestack-ui/nativewind-utils/IsWeb';
|
|
3
|
+
|
|
4
|
+
const baseStyle = isWeb ? 'flex flex-col relative z-0' : '';
|
|
5
|
+
|
|
6
|
+
export const centerStyle = tva({
|
|
7
|
+
base: `justify-center items-center ${baseStyle}`,
|
|
8
|
+
});
|