@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,305 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { createCheckbox } from '@gluestack-ui/checkbox';
|
|
4
|
+
import { View, Pressable, Text } from 'react-native';
|
|
5
|
+
import type { TextProps, ViewProps } from 'react-native';
|
|
6
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
7
|
+
import { Svg } from 'react-native-svg';
|
|
8
|
+
import {
|
|
9
|
+
withStyleContext,
|
|
10
|
+
useStyleContext,
|
|
11
|
+
} from '@gluestack-ui/nativewind-utils/withStyleContext';
|
|
12
|
+
import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withStyleContextAndStates';
|
|
13
|
+
import { cssInterop } from 'nativewind';
|
|
14
|
+
import { withStates } from '@gluestack-ui/nativewind-utils/withStates';
|
|
15
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
16
|
+
import { Platform } from 'react-native';
|
|
17
|
+
|
|
18
|
+
const IndicatorWrapper = React.forwardRef<
|
|
19
|
+
React.ElementRef<typeof View>,
|
|
20
|
+
ViewProps
|
|
21
|
+
>(({ ...props }, ref) => {
|
|
22
|
+
return <View {...props} ref={ref} />;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const LabelWrapper = React.forwardRef<React.ElementRef<typeof Text>, TextProps>(
|
|
26
|
+
({ ...props }, ref) => {
|
|
27
|
+
return <Text {...props} ref={ref} />;
|
|
28
|
+
}
|
|
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 IconWrapper = React.forwardRef<
|
|
44
|
+
React.ElementRef<typeof PrimitiveIcon>,
|
|
45
|
+
IPrimitiveIcon
|
|
46
|
+
>(({ ...props }, ref) => {
|
|
47
|
+
return <PrimitiveIcon {...props} ref={ref} />;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const PrimitiveIcon = React.forwardRef<
|
|
51
|
+
React.ElementRef<typeof Svg>,
|
|
52
|
+
IPrimitiveIcon
|
|
53
|
+
>(
|
|
54
|
+
(
|
|
55
|
+
{
|
|
56
|
+
height,
|
|
57
|
+
width,
|
|
58
|
+
fill,
|
|
59
|
+
color,
|
|
60
|
+
classNameColor,
|
|
61
|
+
size,
|
|
62
|
+
stroke = 'currentColor',
|
|
63
|
+
as: AsComp,
|
|
64
|
+
...props
|
|
65
|
+
},
|
|
66
|
+
ref
|
|
67
|
+
) => {
|
|
68
|
+
color = color ?? classNameColor;
|
|
69
|
+
const sizeProps = useMemo(() => {
|
|
70
|
+
if (size) return { size };
|
|
71
|
+
if (height && width) return { height, width };
|
|
72
|
+
if (height) return { height };
|
|
73
|
+
if (width) return { width };
|
|
74
|
+
return {};
|
|
75
|
+
}, [size, height, width]);
|
|
76
|
+
|
|
77
|
+
let colorProps = {};
|
|
78
|
+
if (fill) {
|
|
79
|
+
colorProps = { ...colorProps, fill: fill };
|
|
80
|
+
}
|
|
81
|
+
if (stroke !== 'currentColor') {
|
|
82
|
+
colorProps = { ...colorProps, stroke: stroke };
|
|
83
|
+
} else if (stroke === 'currentColor' && color !== undefined) {
|
|
84
|
+
colorProps = { ...colorProps, stroke: color };
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (AsComp) {
|
|
88
|
+
return <AsComp ref={ref} {...props} {...sizeProps} {...colorProps} />;
|
|
89
|
+
}
|
|
90
|
+
return (
|
|
91
|
+
<Svg ref={ref} height={height} width={width} {...colorProps} {...props} />
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const SCOPE = 'CHECKBOX';
|
|
97
|
+
const UICheckbox = createCheckbox({
|
|
98
|
+
// @ts-ignore
|
|
99
|
+
Root:
|
|
100
|
+
Platform.OS === 'web'
|
|
101
|
+
? withStyleContext(View, SCOPE)
|
|
102
|
+
: withStyleContextAndStates(Pressable, SCOPE),
|
|
103
|
+
Group: Platform.OS === 'web' ? View : withStates(View),
|
|
104
|
+
Icon: Platform.OS === 'web' ? IconWrapper : withStates(IconWrapper),
|
|
105
|
+
Label: Platform.OS === 'web' ? LabelWrapper : withStates(LabelWrapper),
|
|
106
|
+
Indicator:
|
|
107
|
+
Platform.OS === 'web' ? IndicatorWrapper : withStates(IndicatorWrapper),
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
cssInterop(UICheckbox, { className: 'style' });
|
|
111
|
+
cssInterop(UICheckbox.Group, { className: 'style' });
|
|
112
|
+
cssInterop(LabelWrapper, { className: 'style' });
|
|
113
|
+
cssInterop(IndicatorWrapper, { className: 'style' });
|
|
114
|
+
//@ts-ignore
|
|
115
|
+
cssInterop(IconWrapper, {
|
|
116
|
+
className: {
|
|
117
|
+
target: 'style',
|
|
118
|
+
nativeStyleToProp: {
|
|
119
|
+
height: true,
|
|
120
|
+
width: true,
|
|
121
|
+
//@ts-ignore
|
|
122
|
+
fill: true,
|
|
123
|
+
color: 'classNameColor',
|
|
124
|
+
stroke: true,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const checkboxStyle = tva({
|
|
130
|
+
base: 'group/checkbox flex-row items-center justify-start web:cursor-pointer data-[disabled=true]:cursor-not-allowed',
|
|
131
|
+
variants: {
|
|
132
|
+
size: {
|
|
133
|
+
lg: 'gap-2',
|
|
134
|
+
md: 'gap-2',
|
|
135
|
+
sm: 'gap-1.5',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const checkboxIndicatorStyle = tva({
|
|
141
|
+
base: 'justify-center items-center border-outline-400 bg-transparent rounded web:data-[focus-visible=true]:outline-none web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-indicator-primary data-[checked=true]:bg-primary-600 data-[checked=true]:border-primary-600 data-[hover=true]:data-[checked=false]:border-outline-500 data-[hover=true]:bg-transparent data-[hover=true]:data-[invalid=true]:border-error-700 data-[hover=true]:data-[checked=true]:bg-primary-700 data-[hover=true]:data-[checked=true]:border-primary-700 data-[hover=true]:data-[checked=true]:data-[disabled=true]:border-primary-600 data-[hover=true]:data-[checked=true]:data-[disabled=true]:bg-primary-600 data-[hover=true]:data-[checked=true]:data-[disabled=true]:opacity-40 data-[hover=true]:data-[checked=true]:data-[disabled=true]:data-[invalid=true]:border-error-700 data-[hover=true]:data-[disabled=true]:border-outline-400 data-[hover=true]:data-[disabled=true]:data-[invalid=true]:border-error-700 data-[active=true]:data-[checked=true]:bg-primary-800 data-[active=true]:data-[checked=true]:border-primary-800 data-[invalid=true]:border-error-700 data-[disabled=true]:opacity-40',
|
|
142
|
+
parentVariants: {
|
|
143
|
+
size: {
|
|
144
|
+
lg: 'w-6 h-6 border-[3px]',
|
|
145
|
+
md: 'w-5 h-5 border-2',
|
|
146
|
+
sm: 'w-4 h-4 border-2',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
const checkboxLabelStyle = tva({
|
|
152
|
+
base: 'text-typography-600 data-[checked=true]:text-typography-900 data-[hover=true]:text-typography-900 data-[hover=true]:data-[checked=true]:text-typography-900 data-[hover=true]:data-[checked=true]:data-[disabled=true]:text-typography-900 data-[hover=true]:data-[disabled=true]:text-typography-400 data-[active=true]:text-typography-900 data-[active=true]:data-[checked=true]:text-typography-900 data-[disabled=true]:opacity-40 web:select-none',
|
|
153
|
+
parentVariants: {
|
|
154
|
+
size: {
|
|
155
|
+
lg: 'text-lg',
|
|
156
|
+
md: 'text-base',
|
|
157
|
+
sm: 'text-sm',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const checkboxIconStyle = tva({
|
|
163
|
+
base: 'text-typography-50 fill-none',
|
|
164
|
+
|
|
165
|
+
parentVariants: {
|
|
166
|
+
size: {
|
|
167
|
+
sm: 'h-3 w-3',
|
|
168
|
+
md: 'h-4 w-4',
|
|
169
|
+
lg: 'h-5 w-5',
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
const CheckboxGroup = UICheckbox.Group;
|
|
175
|
+
|
|
176
|
+
type ICheckboxProps = React.ComponentPropsWithoutRef<typeof UICheckbox> &
|
|
177
|
+
VariantProps<typeof checkboxStyle>;
|
|
178
|
+
|
|
179
|
+
const Checkbox = React.forwardRef<
|
|
180
|
+
React.ElementRef<typeof UICheckbox>,
|
|
181
|
+
ICheckboxProps
|
|
182
|
+
>(({ className, size = 'md', ...props }, ref) => {
|
|
183
|
+
return (
|
|
184
|
+
<UICheckbox
|
|
185
|
+
className={checkboxStyle({
|
|
186
|
+
class: className,
|
|
187
|
+
size,
|
|
188
|
+
})}
|
|
189
|
+
{...props}
|
|
190
|
+
context={{
|
|
191
|
+
size,
|
|
192
|
+
}}
|
|
193
|
+
ref={ref}
|
|
194
|
+
/>
|
|
195
|
+
);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
type ICheckboxIndicatorProps = React.ComponentPropsWithoutRef<
|
|
199
|
+
typeof UICheckbox.Indicator
|
|
200
|
+
> &
|
|
201
|
+
VariantProps<typeof checkboxIndicatorStyle>;
|
|
202
|
+
|
|
203
|
+
const CheckboxIndicator = React.forwardRef<
|
|
204
|
+
React.ElementRef<typeof UICheckbox.Indicator>,
|
|
205
|
+
ICheckboxIndicatorProps
|
|
206
|
+
>(({ className, ...props }, ref) => {
|
|
207
|
+
const { size: parentSize } = useStyleContext(SCOPE);
|
|
208
|
+
|
|
209
|
+
return (
|
|
210
|
+
<UICheckbox.Indicator
|
|
211
|
+
className={checkboxIndicatorStyle({
|
|
212
|
+
parentVariants: {
|
|
213
|
+
size: parentSize,
|
|
214
|
+
},
|
|
215
|
+
class: className,
|
|
216
|
+
})}
|
|
217
|
+
{...props}
|
|
218
|
+
ref={ref}
|
|
219
|
+
/>
|
|
220
|
+
);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
type ICheckboxLabelProps = React.ComponentPropsWithoutRef<
|
|
224
|
+
typeof UICheckbox.Label
|
|
225
|
+
> &
|
|
226
|
+
VariantProps<typeof checkboxLabelStyle>;
|
|
227
|
+
const CheckboxLabel = React.forwardRef<
|
|
228
|
+
React.ElementRef<typeof UICheckbox.Label>,
|
|
229
|
+
ICheckboxLabelProps
|
|
230
|
+
>(({ className, ...props }, ref) => {
|
|
231
|
+
const { size: parentSize } = useStyleContext(SCOPE);
|
|
232
|
+
return (
|
|
233
|
+
<UICheckbox.Label
|
|
234
|
+
className={checkboxLabelStyle({
|
|
235
|
+
parentVariants: {
|
|
236
|
+
size: parentSize,
|
|
237
|
+
},
|
|
238
|
+
class: className,
|
|
239
|
+
})}
|
|
240
|
+
{...props}
|
|
241
|
+
ref={ref}
|
|
242
|
+
/>
|
|
243
|
+
);
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
type ICheckboxIconProps = React.ComponentPropsWithoutRef<
|
|
247
|
+
typeof UICheckbox.Icon
|
|
248
|
+
> &
|
|
249
|
+
VariantProps<typeof checkboxIconStyle>;
|
|
250
|
+
|
|
251
|
+
const CheckboxIcon = React.forwardRef<
|
|
252
|
+
React.ElementRef<typeof UICheckbox.Icon>,
|
|
253
|
+
ICheckboxIconProps
|
|
254
|
+
>(({ className, size, ...props }, ref) => {
|
|
255
|
+
const { size: parentSize } = useStyleContext(SCOPE);
|
|
256
|
+
|
|
257
|
+
if (typeof size === 'number') {
|
|
258
|
+
return (
|
|
259
|
+
<UICheckbox.Icon
|
|
260
|
+
ref={ref}
|
|
261
|
+
{...props}
|
|
262
|
+
className={checkboxIconStyle({ class: className })}
|
|
263
|
+
size={size}
|
|
264
|
+
/>
|
|
265
|
+
);
|
|
266
|
+
} else if (
|
|
267
|
+
(props.height !== undefined || props.width !== undefined) &&
|
|
268
|
+
size === undefined
|
|
269
|
+
) {
|
|
270
|
+
return (
|
|
271
|
+
<UICheckbox.Icon
|
|
272
|
+
ref={ref}
|
|
273
|
+
{...props}
|
|
274
|
+
className={checkboxIconStyle({ class: className })}
|
|
275
|
+
/>
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
return (
|
|
280
|
+
<UICheckbox.Icon
|
|
281
|
+
className={checkboxIconStyle({
|
|
282
|
+
parentVariants: {
|
|
283
|
+
size: parentSize,
|
|
284
|
+
},
|
|
285
|
+
class: className,
|
|
286
|
+
size,
|
|
287
|
+
})}
|
|
288
|
+
{...props}
|
|
289
|
+
ref={ref}
|
|
290
|
+
/>
|
|
291
|
+
);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
Checkbox.displayName = 'Checkbox';
|
|
295
|
+
CheckboxIndicator.displayName = 'CheckboxIndicator';
|
|
296
|
+
CheckboxLabel.displayName = 'CheckboxLabel';
|
|
297
|
+
CheckboxIcon.displayName = 'CheckboxIcon';
|
|
298
|
+
|
|
299
|
+
export {
|
|
300
|
+
Checkbox,
|
|
301
|
+
CheckboxIndicator,
|
|
302
|
+
CheckboxLabel,
|
|
303
|
+
CheckboxIcon,
|
|
304
|
+
CheckboxGroup,
|
|
305
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { createDivider } from '@gluestack-ui/divider';
|
|
4
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
5
|
+
import { View } from 'react-native';
|
|
6
|
+
import { cssInterop } from 'nativewind';
|
|
7
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
8
|
+
|
|
9
|
+
const dividerStyle = tva({
|
|
10
|
+
base: 'bg-background-200',
|
|
11
|
+
variants: {
|
|
12
|
+
orientation: {
|
|
13
|
+
vertical: 'w-px h-full',
|
|
14
|
+
horizontal: 'h-px w-full',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const UIDivider = createDivider({ Root: View });
|
|
20
|
+
|
|
21
|
+
cssInterop(UIDivider, { className: 'style' });
|
|
22
|
+
|
|
23
|
+
type IUIDividerProps = React.ComponentPropsWithoutRef<typeof UIDivider> &
|
|
24
|
+
VariantProps<typeof dividerStyle>;
|
|
25
|
+
|
|
26
|
+
const Divider = React.forwardRef<
|
|
27
|
+
React.ElementRef<typeof UIDivider>,
|
|
28
|
+
IUIDividerProps
|
|
29
|
+
>(({ className, orientation = 'horizontal', ...props }, ref) => {
|
|
30
|
+
return (
|
|
31
|
+
<UIDivider
|
|
32
|
+
ref={ref}
|
|
33
|
+
{...props}
|
|
34
|
+
className={dividerStyle({
|
|
35
|
+
orientation,
|
|
36
|
+
class: className,
|
|
37
|
+
})}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
Divider.displayName = 'Divider';
|
|
43
|
+
|
|
44
|
+
export { Divider };
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { createModal as createDrawer } from '@gluestack-ui/modal';
|
|
4
|
+
import {
|
|
5
|
+
Pressable,
|
|
6
|
+
View,
|
|
7
|
+
ScrollView,
|
|
8
|
+
Platform,
|
|
9
|
+
Dimensions,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
import {
|
|
12
|
+
Motion,
|
|
13
|
+
AnimatePresence,
|
|
14
|
+
createMotionAnimatedComponent,
|
|
15
|
+
} from '@legendapp/motion';
|
|
16
|
+
import { tva } from '@gluestack-ui/nativewind-utils/tva';
|
|
17
|
+
import {
|
|
18
|
+
withStyleContext,
|
|
19
|
+
useStyleContext,
|
|
20
|
+
} from '@gluestack-ui/nativewind-utils/withStyleContext';
|
|
21
|
+
import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withStyleContextAndStates';
|
|
22
|
+
import { cssInterop } from 'nativewind';
|
|
23
|
+
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
|
|
24
|
+
|
|
25
|
+
const AnimatedPressable = createMotionAnimatedComponent(Pressable);
|
|
26
|
+
const SCOPE = 'MODAL';
|
|
27
|
+
const screenWidth = Dimensions.get('window').width;
|
|
28
|
+
const screenHeight = Dimensions.get('window').height;
|
|
29
|
+
const sizes: { [key: string]: number } = {
|
|
30
|
+
sm: 0.25,
|
|
31
|
+
md: 0.5,
|
|
32
|
+
lg: 0.75,
|
|
33
|
+
full: 1,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const UIDrawer = createDrawer({
|
|
37
|
+
Root:
|
|
38
|
+
Platform.OS === 'web'
|
|
39
|
+
? withStyleContext(View, SCOPE)
|
|
40
|
+
: withStyleContextAndStates(View, SCOPE),
|
|
41
|
+
Backdrop: AnimatedPressable,
|
|
42
|
+
Content: Motion.View,
|
|
43
|
+
Body: ScrollView,
|
|
44
|
+
CloseButton: Pressable,
|
|
45
|
+
Footer: View,
|
|
46
|
+
Header: View,
|
|
47
|
+
AnimatePresence: AnimatePresence,
|
|
48
|
+
});
|
|
49
|
+
cssInterop(UIDrawer, { className: 'style' });
|
|
50
|
+
cssInterop(UIDrawer.Backdrop, { className: 'style' });
|
|
51
|
+
cssInterop(UIDrawer.Content, { className: 'style' });
|
|
52
|
+
cssInterop(UIDrawer.CloseButton, { className: 'style' });
|
|
53
|
+
cssInterop(UIDrawer.Header, { className: 'style' });
|
|
54
|
+
cssInterop(UIDrawer.Body, {
|
|
55
|
+
className: 'style',
|
|
56
|
+
contentContainerClassName: 'contentContainerStyle',
|
|
57
|
+
indicatorClassName: 'indicatorStyle',
|
|
58
|
+
});
|
|
59
|
+
cssInterop(UIDrawer.Footer, { className: 'style' });
|
|
60
|
+
|
|
61
|
+
const drawerStyle = tva({
|
|
62
|
+
base: 'w-full h-full web:pointer-events-none relative',
|
|
63
|
+
variants: {
|
|
64
|
+
size: {
|
|
65
|
+
sm: '',
|
|
66
|
+
md: '',
|
|
67
|
+
lg: '',
|
|
68
|
+
full: '',
|
|
69
|
+
},
|
|
70
|
+
anchor: {
|
|
71
|
+
left: 'items-start',
|
|
72
|
+
right: 'items-end',
|
|
73
|
+
top: 'justify-start',
|
|
74
|
+
bottom: 'justify-end',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const drawerBackdropStyle = tva({
|
|
80
|
+
base: 'absolute left-0 top-0 right-0 bottom-0 bg-background-dark web:cursor-default',
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const drawerContentStyle = tva({
|
|
84
|
+
base: 'bg-background-0 overflow-scroll border-outline-100 p-6 absolute',
|
|
85
|
+
parentVariants: {
|
|
86
|
+
size: {
|
|
87
|
+
sm: 'w-1/4',
|
|
88
|
+
md: 'w-1/2',
|
|
89
|
+
lg: 'w-3/4',
|
|
90
|
+
full: 'w-full',
|
|
91
|
+
},
|
|
92
|
+
anchor: {
|
|
93
|
+
left: 'h-full border-r',
|
|
94
|
+
right: 'h-full border-l',
|
|
95
|
+
top: 'w-full border-b',
|
|
96
|
+
bottom: 'w-full border-t',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
parentCompoundVariants: [
|
|
100
|
+
{
|
|
101
|
+
anchor: 'top',
|
|
102
|
+
size: 'sm',
|
|
103
|
+
class: 'h-1/4',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
anchor: 'top',
|
|
107
|
+
size: 'md',
|
|
108
|
+
class: 'h-1/2',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
anchor: 'top',
|
|
112
|
+
size: 'lg',
|
|
113
|
+
class: 'h-3/4',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
anchor: 'top',
|
|
117
|
+
size: 'full',
|
|
118
|
+
class: 'h-full',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
anchor: 'bottom',
|
|
122
|
+
size: 'sm',
|
|
123
|
+
class: 'h-1/4',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
anchor: 'bottom',
|
|
127
|
+
size: 'md',
|
|
128
|
+
class: 'h-1/2',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
anchor: 'bottom',
|
|
132
|
+
size: 'lg',
|
|
133
|
+
class: 'h-3/4',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
anchor: 'bottom',
|
|
137
|
+
size: 'full',
|
|
138
|
+
class: 'h-full',
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const drawerCloseButtonStyle = tva({
|
|
144
|
+
base: 'z-10 rounded data-[focus-visible=true]:web:bg-background-100 web:outline-0 cursor-pointer',
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
const drawerHeaderStyle = tva({
|
|
148
|
+
base: 'justify-between items-center flex-row',
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
const drawerBodyStyle = tva({
|
|
152
|
+
base: 'mt-4 mb-6 shrink-0',
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
const drawerFooterStyle = tva({
|
|
156
|
+
base: 'flex-row justify-end items-center',
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
type IDrawerProps = React.ComponentProps<typeof UIDrawer> &
|
|
160
|
+
VariantProps<typeof drawerStyle> & { className?: string };
|
|
161
|
+
|
|
162
|
+
type IDrawerBackdropProps = React.ComponentProps<typeof UIDrawer.Backdrop> &
|
|
163
|
+
VariantProps<typeof drawerBackdropStyle> & { className?: string };
|
|
164
|
+
|
|
165
|
+
type IDrawerContentProps = React.ComponentProps<typeof UIDrawer.Content> &
|
|
166
|
+
VariantProps<typeof drawerContentStyle> & { className?: string };
|
|
167
|
+
|
|
168
|
+
type IDrawerHeaderProps = React.ComponentProps<typeof UIDrawer.Header> &
|
|
169
|
+
VariantProps<typeof drawerHeaderStyle> & { className?: string };
|
|
170
|
+
|
|
171
|
+
type IDrawerBodyProps = React.ComponentProps<typeof UIDrawer.Body> &
|
|
172
|
+
VariantProps<typeof drawerBodyStyle> & { className?: string };
|
|
173
|
+
|
|
174
|
+
type IDrawerFooterProps = React.ComponentProps<typeof UIDrawer.Footer> &
|
|
175
|
+
VariantProps<typeof drawerFooterStyle> & { className?: string };
|
|
176
|
+
|
|
177
|
+
type IDrawerCloseButtonProps = React.ComponentProps<
|
|
178
|
+
typeof UIDrawer.CloseButton
|
|
179
|
+
> &
|
|
180
|
+
VariantProps<typeof drawerCloseButtonStyle> & { className?: string };
|
|
181
|
+
|
|
182
|
+
const Drawer = React.forwardRef<
|
|
183
|
+
React.ElementRef<typeof UIDrawer>,
|
|
184
|
+
IDrawerProps
|
|
185
|
+
>(({ className, size = 'sm', anchor = 'left', ...props }, ref) => {
|
|
186
|
+
return (
|
|
187
|
+
<UIDrawer
|
|
188
|
+
ref={ref}
|
|
189
|
+
{...props}
|
|
190
|
+
pointerEvents="box-none"
|
|
191
|
+
className={drawerStyle({ size, anchor, class: className })}
|
|
192
|
+
context={{ size, anchor }}
|
|
193
|
+
/>
|
|
194
|
+
);
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
const DrawerBackdrop = React.forwardRef<
|
|
198
|
+
React.ElementRef<typeof UIDrawer.Backdrop>,
|
|
199
|
+
IDrawerBackdropProps
|
|
200
|
+
>(({ className, ...props }, ref) => {
|
|
201
|
+
return (
|
|
202
|
+
<UIDrawer.Backdrop
|
|
203
|
+
ref={ref}
|
|
204
|
+
initial={{
|
|
205
|
+
opacity: 0,
|
|
206
|
+
}}
|
|
207
|
+
animate={{
|
|
208
|
+
opacity: 0.5,
|
|
209
|
+
}}
|
|
210
|
+
exit={{
|
|
211
|
+
opacity: 0,
|
|
212
|
+
}}
|
|
213
|
+
transition={{
|
|
214
|
+
type: 'spring',
|
|
215
|
+
damping: 18,
|
|
216
|
+
stiffness: 250,
|
|
217
|
+
opacity: {
|
|
218
|
+
type: 'timing',
|
|
219
|
+
duration: 250,
|
|
220
|
+
},
|
|
221
|
+
}}
|
|
222
|
+
{...props}
|
|
223
|
+
className={drawerBackdropStyle({
|
|
224
|
+
class: className,
|
|
225
|
+
})}
|
|
226
|
+
/>
|
|
227
|
+
);
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
const DrawerContent = React.forwardRef<
|
|
231
|
+
React.ElementRef<typeof UIDrawer.Content>,
|
|
232
|
+
IDrawerContentProps
|
|
233
|
+
>(({ className, ...props }, ref) => {
|
|
234
|
+
const { size: parentSize, anchor: parentAnchor } = useStyleContext(SCOPE);
|
|
235
|
+
|
|
236
|
+
const drawerHeight = screenHeight * (sizes[parentSize] || sizes.md);
|
|
237
|
+
const drawerWidth = screenWidth * (sizes[parentSize] || sizes.md);
|
|
238
|
+
|
|
239
|
+
const isHorizontal = parentAnchor === 'left' || parentAnchor === 'right';
|
|
240
|
+
|
|
241
|
+
const initialObj = isHorizontal
|
|
242
|
+
? { x: parentAnchor === 'left' ? -drawerWidth : drawerWidth }
|
|
243
|
+
: { y: parentAnchor === 'top' ? -drawerHeight : drawerHeight };
|
|
244
|
+
|
|
245
|
+
const animateObj = isHorizontal ? { x: 0 } : { y: 0 };
|
|
246
|
+
|
|
247
|
+
const exitObj = isHorizontal
|
|
248
|
+
? { x: parentAnchor === 'left' ? -drawerWidth : drawerWidth }
|
|
249
|
+
: { y: parentAnchor === 'top' ? -drawerHeight : drawerHeight };
|
|
250
|
+
|
|
251
|
+
const customClass = isHorizontal
|
|
252
|
+
? `top-0 ${parentAnchor === 'left' ? 'left-0' : 'right-0'}`
|
|
253
|
+
: `left-0 ${parentAnchor === 'top' ? 'top-0' : 'bottom-0'}`;
|
|
254
|
+
|
|
255
|
+
return (
|
|
256
|
+
<UIDrawer.Content
|
|
257
|
+
ref={ref}
|
|
258
|
+
initial={initialObj}
|
|
259
|
+
animate={animateObj}
|
|
260
|
+
exit={exitObj}
|
|
261
|
+
transition={{
|
|
262
|
+
type: 'timing',
|
|
263
|
+
duration: 300,
|
|
264
|
+
}}
|
|
265
|
+
{...props}
|
|
266
|
+
className={drawerContentStyle({
|
|
267
|
+
parentVariants: {
|
|
268
|
+
size: parentSize,
|
|
269
|
+
anchor: parentAnchor,
|
|
270
|
+
},
|
|
271
|
+
class: `${className} ${customClass}`,
|
|
272
|
+
})}
|
|
273
|
+
pointerEvents="auto"
|
|
274
|
+
/>
|
|
275
|
+
);
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
const DrawerHeader = React.forwardRef<
|
|
279
|
+
React.ElementRef<typeof UIDrawer.Header>,
|
|
280
|
+
IDrawerHeaderProps
|
|
281
|
+
>(({ className, ...props }, ref) => {
|
|
282
|
+
return (
|
|
283
|
+
<UIDrawer.Header
|
|
284
|
+
ref={ref}
|
|
285
|
+
{...props}
|
|
286
|
+
className={drawerHeaderStyle({
|
|
287
|
+
class: className,
|
|
288
|
+
})}
|
|
289
|
+
/>
|
|
290
|
+
);
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
const DrawerBody = React.forwardRef<
|
|
294
|
+
React.ElementRef<typeof UIDrawer.Body>,
|
|
295
|
+
IDrawerBodyProps
|
|
296
|
+
>(({ className, ...props }, ref) => {
|
|
297
|
+
return (
|
|
298
|
+
<UIDrawer.Body
|
|
299
|
+
ref={ref}
|
|
300
|
+
{...props}
|
|
301
|
+
className={drawerBodyStyle({
|
|
302
|
+
class: className,
|
|
303
|
+
})}
|
|
304
|
+
/>
|
|
305
|
+
);
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
const DrawerFooter = React.forwardRef<
|
|
309
|
+
React.ElementRef<typeof UIDrawer.Footer>,
|
|
310
|
+
IDrawerFooterProps
|
|
311
|
+
>(({ className, ...props }, ref) => {
|
|
312
|
+
return (
|
|
313
|
+
<UIDrawer.Footer
|
|
314
|
+
ref={ref}
|
|
315
|
+
{...props}
|
|
316
|
+
className={drawerFooterStyle({
|
|
317
|
+
class: className,
|
|
318
|
+
})}
|
|
319
|
+
/>
|
|
320
|
+
);
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
const DrawerCloseButton = React.forwardRef<
|
|
324
|
+
React.ElementRef<typeof UIDrawer.CloseButton>,
|
|
325
|
+
IDrawerCloseButtonProps
|
|
326
|
+
>(({ className, ...props }, ref) => {
|
|
327
|
+
return (
|
|
328
|
+
<UIDrawer.CloseButton
|
|
329
|
+
ref={ref}
|
|
330
|
+
{...props}
|
|
331
|
+
className={drawerCloseButtonStyle({
|
|
332
|
+
class: className,
|
|
333
|
+
})}
|
|
334
|
+
/>
|
|
335
|
+
);
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
Drawer.displayName = 'Drawer';
|
|
339
|
+
DrawerBackdrop.displayName = 'DrawerBackdrop';
|
|
340
|
+
DrawerContent.displayName = 'DrawerContent';
|
|
341
|
+
DrawerHeader.displayName = 'DrawerHeader';
|
|
342
|
+
DrawerBody.displayName = 'DrawerBody';
|
|
343
|
+
DrawerFooter.displayName = 'DrawerFooter';
|
|
344
|
+
DrawerCloseButton.displayName = 'DrawerCloseButton';
|
|
345
|
+
|
|
346
|
+
export {
|
|
347
|
+
Drawer,
|
|
348
|
+
DrawerBackdrop,
|
|
349
|
+
DrawerContent,
|
|
350
|
+
DrawerCloseButton,
|
|
351
|
+
DrawerHeader,
|
|
352
|
+
DrawerBody,
|
|
353
|
+
DrawerFooter,
|
|
354
|
+
};
|