@longline/aqua-ui 1.0.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/README.md +7 -0
- package/Types.d.ts +6 -0
- package/Types.js +5 -0
- package/containers/Anchor/Anchor.d.ts +63 -0
- package/containers/Anchor/Anchor.js +113 -0
- package/containers/Anchor/index.d.ts +1 -0
- package/containers/Anchor/index.js +1 -0
- package/containers/Dock/Dock.d.ts +45 -0
- package/containers/Dock/Dock.js +61 -0
- package/containers/Dock/Dockable.d.ts +60 -0
- package/containers/Dock/Dockable.js +98 -0
- package/containers/Dock/index.d.ts +2 -0
- package/containers/Dock/index.js +2 -0
- package/containers/Form/Field.d.ts +104 -0
- package/containers/Form/Field.js +168 -0
- package/containers/Form/Form.d.ts +51 -0
- package/containers/Form/Form.js +89 -0
- package/containers/Form/Validation.d.ts +212 -0
- package/containers/Form/Validation.js +232 -0
- package/containers/Form/context/FormContext.d.ts +10 -0
- package/containers/Form/context/FormContext.js +3 -0
- package/containers/Form/context/useForm.d.ts +5 -0
- package/containers/Form/context/useForm.js +9 -0
- package/containers/Form/elements/BoxWrapper.d.ts +15 -0
- package/containers/Form/elements/BoxWrapper.js +35 -0
- package/containers/Form/elements/Hint.d.ts +21 -0
- package/containers/Form/elements/Hint.js +15 -0
- package/containers/Form/elements/Label.d.ts +22 -0
- package/containers/Form/elements/Label.js +15 -0
- package/containers/Form/elements/SimpleWrapper.d.ts +15 -0
- package/containers/Form/elements/SimpleWrapper.js +17 -0
- package/containers/GlassPane/GlassPane.d.ts +36 -0
- package/containers/GlassPane/GlassPane.js +66 -0
- package/containers/GlassPane/index.d.ts +1 -0
- package/containers/GlassPane/index.js +1 -0
- package/containers/InfoBox/InfoBox.d.ts +34 -0
- package/containers/InfoBox/InfoBox.js +45 -0
- package/containers/InfoBox/elements/Content.d.ts +23 -0
- package/containers/InfoBox/elements/Content.js +37 -0
- package/containers/InfoBox/elements/Footer.d.ts +9 -0
- package/containers/InfoBox/elements/Footer.js +24 -0
- package/containers/InfoBox/elements/Header.d.ts +9 -0
- package/containers/InfoBox/elements/Header.js +24 -0
- package/containers/List/List.d.ts +45 -0
- package/containers/List/List.js +47 -0
- package/containers/List/ListCell.d.ts +13 -0
- package/containers/List/ListCell.js +24 -0
- package/containers/List/ListRow.d.ts +15 -0
- package/containers/List/ListRow.js +24 -0
- package/containers/List/index.d.ts +3 -0
- package/containers/List/index.js +3 -0
- package/containers/Tabs/Pane.d.ts +29 -0
- package/containers/Tabs/Pane.js +45 -0
- package/containers/Tabs/Tabs.d.ts +66 -0
- package/containers/Tabs/Tabs.js +144 -0
- package/controls/Chip/Chip.d.ts +35 -0
- package/controls/Chip/Chip.js +83 -0
- package/controls/Fab/Fab.d.ts +73 -0
- package/controls/Fab/Fab.js +94 -0
- package/controls/Icon/Icon.d.ts +98 -0
- package/controls/Icon/Icon.js +79 -0
- package/controls/Icon/index.d.ts +1 -0
- package/controls/Icon/index.js +1 -0
- package/controls/Key/Key.d.ts +22 -0
- package/controls/Key/Key.js +74 -0
- package/controls/Key/index.d.ts +1 -0
- package/controls/Key/index.js +1 -0
- package/controls/LinearChart/LinearChart.d.ts +31 -0
- package/controls/LinearChart/LinearChart.js +58 -0
- package/controls/ListView/Body.d.ts +8 -0
- package/controls/ListView/Body.js +24 -0
- package/controls/ListView/Column.d.ts +55 -0
- package/controls/ListView/Column.js +8 -0
- package/controls/ListView/ColumnsManager/ColumnDraggable.d.ts +11 -0
- package/controls/ListView/ColumnsManager/ColumnDraggable.js +83 -0
- package/controls/ListView/ColumnsManager/ColumnsManager.d.ts +12 -0
- package/controls/ListView/ColumnsManager/ColumnsManager.js +63 -0
- package/controls/ListView/ColumnsManager/OrderColumns.d.ts +11 -0
- package/controls/ListView/ColumnsManager/OrderColumns.js +62 -0
- package/controls/ListView/ColumnsManager/SourceColumns.d.ts +10 -0
- package/controls/ListView/ColumnsManager/SourceColumns.js +45 -0
- package/controls/ListView/Ghost.d.ts +9 -0
- package/controls/ListView/Ghost.js +52 -0
- package/controls/ListView/Header.d.ts +12 -0
- package/controls/ListView/Header.js +35 -0
- package/controls/ListView/HeaderButton.d.ts +8 -0
- package/controls/ListView/HeaderButton.js +8 -0
- package/controls/ListView/HeaderCell.d.ts +20 -0
- package/controls/ListView/HeaderCell.js +47 -0
- package/controls/ListView/IListViewProps.d.ts +105 -0
- package/controls/ListView/IListViewProps.js +1 -0
- package/controls/ListView/ListView.d.ts +20 -0
- package/controls/ListView/ListView.js +97 -0
- package/controls/ListView/NoData.d.ts +19 -0
- package/controls/ListView/NoData.js +30 -0
- package/controls/ListView/SortButton.d.ts +16 -0
- package/controls/ListView/SortButton.js +26 -0
- package/controls/ListView/Table.d.ts +18 -0
- package/controls/ListView/Table.js +99 -0
- package/controls/ListView/Total.d.ts +9 -0
- package/controls/ListView/Total.js +28 -0
- package/controls/ListView/sortItems.d.ts +6 -0
- package/controls/ListView/sortItems.js +35 -0
- package/controls/Mouse/Mouse.d.ts +38 -0
- package/controls/Mouse/Mouse.js +51 -0
- package/controls/Mouse/index.d.ts +1 -0
- package/controls/Mouse/index.js +1 -0
- package/controls/PrimaryButton/PrimaryButton.d.ts +63 -0
- package/controls/PrimaryButton/PrimaryButton.js +83 -0
- package/controls/PrimaryButton/index.d.ts +1 -0
- package/controls/PrimaryButton/index.js +1 -0
- package/controls/Progress/Progress.d.ts +35 -0
- package/controls/Progress/Progress.js +49 -0
- package/controls/SecondaryButton/SecondaryButton.d.ts +58 -0
- package/controls/SecondaryButton/SecondaryButton.js +73 -0
- package/controls/SecondaryButton/index.d.ts +1 -0
- package/controls/SecondaryButton/index.js +1 -0
- package/controls/TabBar/Tab.d.ts +21 -0
- package/controls/TabBar/Tab.js +25 -0
- package/controls/TabBar/TabBar.d.ts +34 -0
- package/controls/TabBar/TabBar.js +134 -0
- package/controls/TabBar/Underliner.d.ts +7 -0
- package/controls/TabBar/Underliner.js +27 -0
- package/controls/TabBar/index.d.ts +1 -0
- package/controls/TabBar/index.js +1 -0
- package/controls/TertiaryButton/TertiaryButton.d.ts +28 -0
- package/controls/TertiaryButton/TertiaryButton.js +65 -0
- package/controls/TertiaryButton/index.d.ts +1 -0
- package/controls/TertiaryButton/index.js +1 -0
- package/controls/View/View.d.ts +35 -0
- package/controls/View/View.js +58 -0
- package/formatters/Date/DateTime.d.ts +45 -0
- package/formatters/Date/DateTime.js +64 -0
- package/formatters/Date/elements/Custom.d.ts +18 -0
- package/formatters/Date/elements/Custom.js +22 -0
- package/formatters/Date/elements/Distance.d.ts +24 -0
- package/formatters/Date/elements/Distance.js +45 -0
- package/formatters/Date/elements/LongDate.d.ts +17 -0
- package/formatters/Date/elements/LongDate.js +11 -0
- package/formatters/Date/elements/LongDateTime.d.ts +14 -0
- package/formatters/Date/elements/LongDateTime.js +10 -0
- package/formatters/Date/elements/LongTime.d.ts +14 -0
- package/formatters/Date/elements/LongTime.js +10 -0
- package/formatters/Date/elements/ShortDate.d.ts +14 -0
- package/formatters/Date/elements/ShortDate.js +10 -0
- package/formatters/Date/elements/ShortDateTime.d.ts +14 -0
- package/formatters/Date/elements/ShortDateTime.js +10 -0
- package/formatters/Date/elements/ShortTime.d.ts +18 -0
- package/formatters/Date/elements/ShortTime.js +10 -0
- package/formatters/Date/elements/toDate.d.ts +2 -0
- package/formatters/Date/elements/toDate.js +13 -0
- package/formatters/Filesize/Filesize.d.ts +29 -0
- package/formatters/Filesize/Filesize.js +54 -0
- package/formatters/GIS/Latitude.d.ts +23 -0
- package/formatters/GIS/Latitude.js +13 -0
- package/formatters/GIS/Longitude.d.ts +23 -0
- package/formatters/GIS/Longitude.js +13 -0
- package/formatters/GIS/index.d.ts +2 -0
- package/formatters/GIS/index.js +2 -0
- package/formatters/GIS/toDMS.d.ts +2 -0
- package/formatters/GIS/toDMS.js +16 -0
- package/formatters/Highlight/Highlight.d.ts +22 -0
- package/formatters/Highlight/Highlight.js +32 -0
- package/formatters/Highlight/index.d.ts +1 -0
- package/formatters/Highlight/index.js +1 -0
- package/formatters/Human/Human.d.ts +18 -0
- package/formatters/Human/Human.js +34 -0
- package/formatters/Human/index.d.ts +1 -0
- package/formatters/Human/index.js +1 -0
- package/formatters/Number/Number.d.ts +24 -0
- package/formatters/Number/Number.js +36 -0
- package/formatters/Number/index.d.ts +1 -0
- package/formatters/Number/index.js +1 -0
- package/helper/DMS.d.ts +22 -0
- package/helper/DMS.js +46 -0
- package/helper/HslColor.d.ts +11 -0
- package/helper/HslColor.js +47 -0
- package/helper/RgbColor.d.ts +43 -0
- package/helper/RgbColor.js +162 -0
- package/helper/SizeHelper.d.ts +10 -0
- package/helper/SizeHelper.js +56 -0
- package/helper/darken.d.ts +8 -0
- package/helper/darken.js +18 -0
- package/helper/guard.d.ts +5 -0
- package/helper/guard.js +7 -0
- package/helper/lighten.d.ts +8 -0
- package/helper/lighten.js +11 -0
- package/helper/nameToHex.d.ts +6 -0
- package/helper/nameToHex.js +163 -0
- package/inputs/DateInput/Body.d.ts +34 -0
- package/inputs/DateInput/Body.js +50 -0
- package/inputs/DateInput/Calendar.d.ts +15 -0
- package/inputs/DateInput/Calendar.js +60 -0
- package/inputs/DateInput/DateInput.d.ts +73 -0
- package/inputs/DateInput/DateInput.js +143 -0
- package/inputs/DateInput/Day.d.ts +32 -0
- package/inputs/DateInput/Day.js +33 -0
- package/inputs/DateInput/InfiniteList.d.ts +26 -0
- package/inputs/DateInput/InfiniteList.js +87 -0
- package/inputs/DateInput/Nav.d.ts +11 -0
- package/inputs/DateInput/Nav.js +24 -0
- package/inputs/DateInput/Navbar.d.ts +16 -0
- package/inputs/DateInput/Navbar.js +33 -0
- package/inputs/DateInput/NumericInput.d.ts +14 -0
- package/inputs/DateInput/NumericInput.js +48 -0
- package/inputs/DateInput/Selector.d.ts +47 -0
- package/inputs/DateInput/Selector.js +55 -0
- package/inputs/DateInput/SimpleList.d.ts +19 -0
- package/inputs/DateInput/SimpleList.js +31 -0
- package/inputs/Dropdown/Body.d.ts +25 -0
- package/inputs/Dropdown/Body.js +14 -0
- package/inputs/Dropdown/Column.d.ts +21 -0
- package/inputs/Dropdown/Column.js +6 -0
- package/inputs/Dropdown/Dropdown.d.ts +136 -0
- package/inputs/Dropdown/Dropdown.js +446 -0
- package/inputs/Dropdown/Selection.d.ts +11 -0
- package/inputs/Dropdown/Selection.js +23 -0
- package/inputs/Dropdown/Selector.d.ts +29 -0
- package/inputs/Dropdown/Selector.js +16 -0
- package/inputs/Editor/Editor.d.ts +45 -0
- package/inputs/Editor/Editor.js +60 -0
- package/inputs/Editor/buttons/BoldButton.d.ts +7 -0
- package/inputs/Editor/buttons/BoldButton.js +7 -0
- package/inputs/Editor/buttons/BulletListButton.d.ts +7 -0
- package/inputs/Editor/buttons/BulletListButton.js +7 -0
- package/inputs/Editor/buttons/CodeBlockButton.d.ts +7 -0
- package/inputs/Editor/buttons/CodeBlockButton.js +7 -0
- package/inputs/Editor/buttons/CodeButton.d.ts +7 -0
- package/inputs/Editor/buttons/CodeButton.js +7 -0
- package/inputs/Editor/buttons/ItalicButton.d.ts +7 -0
- package/inputs/Editor/buttons/ItalicButton.js +7 -0
- package/inputs/Editor/buttons/OrderedListButton.d.ts +7 -0
- package/inputs/Editor/buttons/OrderedListButton.js +7 -0
- package/inputs/Editor/buttons/StrikethroughButton.d.ts +7 -0
- package/inputs/Editor/buttons/StrikethroughButton.js +7 -0
- package/inputs/Editor/menu/MenuBar.d.ts +9 -0
- package/inputs/Editor/menu/MenuBar.js +44 -0
- package/inputs/Editor/menu/MenuButton.d.ts +35 -0
- package/inputs/Editor/menu/MenuButton.js +34 -0
- package/inputs/Editor/menu/MenuSeparator.d.ts +7 -0
- package/inputs/Editor/menu/MenuSeparator.js +24 -0
- package/inputs/Input/Clear.d.ts +7 -0
- package/inputs/Input/Clear.js +14 -0
- package/inputs/Input/Input.d.ts +133 -0
- package/inputs/Input/Input.js +64 -0
- package/inputs/Input/InputWrapper.d.ts +23 -0
- package/inputs/Input/InputWrapper.js +57 -0
- package/inputs/Input/index.d.ts +1 -0
- package/inputs/Input/index.js +1 -0
- package/inputs/Selector/ISelectorProps.d.ts +29 -0
- package/inputs/Selector/ISelectorProps.js +1 -0
- package/inputs/Selector/Selector.d.ts +29 -0
- package/inputs/Selector/Selector.js +77 -0
- package/inputs/Selector/index.d.ts +1 -0
- package/inputs/Selector/index.js +1 -0
- package/inputs/Selector/widgets/Checkbox.d.ts +6 -0
- package/inputs/Selector/widgets/Checkbox.js +29 -0
- package/inputs/Selector/widgets/Toggle.d.ts +6 -0
- package/inputs/Selector/widgets/Toggle.js +24 -0
- package/inputs/Slider/Slider.d.ts +63 -0
- package/inputs/Slider/Slider.js +198 -0
- package/inputs/Textarea/Textarea.d.ts +79 -0
- package/inputs/Textarea/Textarea.js +65 -0
- package/main.js +32 -0
- package/map/Map/Map.d.ts +47 -0
- package/map/Map/Map.js +221 -0
- package/map/Map/index.d.ts +1 -0
- package/map/Map/index.js +1 -0
- package/map/PositionsManager/PositionBox.d.ts +14 -0
- package/map/PositionsManager/PositionBox.js +86 -0
- package/map/PositionsManager/PositionsManager.d.ts +27 -0
- package/map/PositionsManager/PositionsManager.js +99 -0
- package/map/controls/CompassButton/CompassButton.d.ts +33 -0
- package/map/controls/CompassButton/CompassButton.js +88 -0
- package/map/controls/FullscreenButton/FullscreenButton.d.ts +21 -0
- package/map/controls/FullscreenButton/FullscreenButton.js +62 -0
- package/map/controls/Geocoder/Geocoder.d.ts +49 -0
- package/map/controls/Geocoder/Geocoder.js +179 -0
- package/map/controls/Geocoder/GeocoderApi.d.ts +59 -0
- package/map/controls/Geocoder/GeocoderApi.js +68 -0
- package/map/controls/Geocoder/GeocoderEntry.d.ts +15 -0
- package/map/controls/Geocoder/GeocoderEntry.js +18 -0
- package/map/controls/Geocoder/GeocoderList.d.ts +10 -0
- package/map/controls/Geocoder/GeocoderList.js +18 -0
- package/map/controls/Geocoder/GeocoderSelector.d.ts +16 -0
- package/map/controls/Geocoder/GeocoderSelector.js +25 -0
- package/map/controls/Graticule/Graticule.d.ts +35 -0
- package/map/controls/Graticule/Graticule.js +142 -0
- package/map/controls/MapLoader/MapLoader.d.ts +33 -0
- package/map/controls/MapLoader/MapLoader.js +73 -0
- package/map/controls/ScaleControl/ScaleControl.d.ts +24 -0
- package/map/controls/ScaleControl/ScaleControl.js +107 -0
- package/map/controls/ZoomInButton/ZoomInButton.d.ts +19 -0
- package/map/controls/ZoomInButton/ZoomInButton.js +56 -0
- package/map/controls/ZoomOutButton/ZoomOutButton.d.ts +19 -0
- package/map/controls/ZoomOutButton/ZoomOutButton.js +56 -0
- package/map/controls/base/MapButton/Hint.d.ts +17 -0
- package/map/controls/base/MapButton/Hint.js +34 -0
- package/map/controls/base/MapButton/MapButton.d.ts +46 -0
- package/map/controls/base/MapButton/MapButton.js +71 -0
- package/map/controls/base/MapButton/index.d.ts +1 -0
- package/map/controls/base/MapButton/index.js +1 -0
- package/map/controls/base/MapButtonGroup/MapButtonGroup.d.ts +17 -0
- package/map/controls/base/MapButtonGroup/MapButtonGroup.js +24 -0
- package/map/controls/base/MapControl/MapControl.d.ts +36 -0
- package/map/controls/base/MapControl/MapControl.js +77 -0
- package/map/controls/base/MapControl/index.d.ts +1 -0
- package/map/controls/base/MapControl/index.js +1 -0
- package/map/layers/ClusterLayer/ClusterLayer.d.ts +79 -0
- package/map/layers/ClusterLayer/ClusterLayer.js +118 -0
- package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer.d.ts +51 -0
- package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer.js +151 -0
- package/map/layers/InterpolationLayer/ContoursFragmentShader.d.ts +2 -0
- package/map/layers/InterpolationLayer/ContoursFragmentShader.js +2 -0
- package/map/layers/InterpolationLayer/ContoursVertexShader.d.ts +2 -0
- package/map/layers/InterpolationLayer/ContoursVertexShader.js +2 -0
- package/map/layers/InterpolationLayer/IGradientStop.d.ts +5 -0
- package/map/layers/InterpolationLayer/IGradientStop.js +1 -0
- package/map/layers/InterpolationLayer/InterpolationLayer.d.ts +35 -0
- package/map/layers/InterpolationLayer/InterpolationLayer.js +256 -0
- package/map/layers/InterpolationLayer/LevelsFragmentShader.d.ts +2 -0
- package/map/layers/InterpolationLayer/LevelsFragmentShader.js +2 -0
- package/map/layers/InterpolationLayer/LevelsVertexShader.d.ts +2 -0
- package/map/layers/InterpolationLayer/LevelsVertexShader.js +2 -0
- package/map/layers/ParticlesLayer/ParticlesFragmentShader.d.ts +2 -0
- package/map/layers/ParticlesLayer/ParticlesFragmentShader.js +2 -0
- package/map/layers/ParticlesLayer/ParticlesLayer.d.ts +40 -0
- package/map/layers/ParticlesLayer/ParticlesLayer.js +337 -0
- package/map/layers/ParticlesLayer/ParticlesVertexShader.d.ts +2 -0
- package/map/layers/ParticlesLayer/ParticlesVertexShader.js +2 -0
- package/map/layers/ParticlesLayer/UVFragmentShader.d.ts +2 -0
- package/map/layers/ParticlesLayer/UVFragmentShader.js +2 -0
- package/map/layers/ParticlesLayer/UVVertexShader.d.ts +2 -0
- package/map/layers/ParticlesLayer/UVVertexShader.js +2 -0
- package/map/markers/ClusterMarker/ClusterMarker.d.ts +36 -0
- package/map/markers/ClusterMarker/ClusterMarker.js +99 -0
- package/map/markers/ClusterMarker/index.d.ts +1 -0
- package/map/markers/ClusterMarker/index.js +1 -0
- package/map/markers/RiskMarker/RiskMarker.d.ts +22 -0
- package/map/markers/RiskMarker/RiskMarker.js +61 -0
- package/modules/MainMenu/Item.d.ts +42 -0
- package/modules/MainMenu/Item.js +94 -0
- package/modules/MainMenu/MainMenu.d.ts +20 -0
- package/modules/MainMenu/MainMenu.js +41 -0
- package/modules/MainMenu/index.d.ts +1 -0
- package/modules/MainMenu/index.js +1 -0
- package/modules/Root/Content.d.ts +16 -0
- package/modules/Root/Content.js +25 -0
- package/modules/Root/Overlay.d.ts +23 -0
- package/modules/Root/Overlay.js +33 -0
- package/modules/Root/Root.d.ts +7 -0
- package/modules/Root/Root.js +45 -0
- package/modules/Root/Shader.d.ts +15 -0
- package/modules/Root/Shader.js +24 -0
- package/modules/Root/Sidebar.d.ts +13 -0
- package/modules/Root/Sidebar.js +24 -0
- package/modules/Root/stories/SampleContent.d.ts +7 -0
- package/modules/Root/stories/SampleContent.js +44 -0
- package/package.json +64 -0
- package/services/Dialog/AlertDialog.d.ts +31 -0
- package/services/Dialog/AlertDialog.js +29 -0
- package/services/Dialog/ConfirmDialog.d.ts +34 -0
- package/services/Dialog/ConfirmDialog.js +30 -0
- package/services/Dialog/Dialog.d.ts +91 -0
- package/services/Dialog/Dialog.js +92 -0
- package/services/Dialog/DialogBackground.d.ts +7 -0
- package/services/Dialog/DialogBackground.js +12 -0
- package/services/Dialog/DialogContent.d.ts +25 -0
- package/services/Dialog/DialogContent.js +38 -0
- package/services/Dialog/DialogFooter.d.ts +24 -0
- package/services/Dialog/DialogFooter.js +50 -0
- package/services/Dialog/DialogHeader.d.ts +18 -0
- package/services/Dialog/DialogHeader.js +36 -0
- package/services/Dialog/DialogWindow.d.ts +13 -0
- package/services/Dialog/DialogWindow.js +12 -0
- package/services/Dialog/XhrDialog.d.ts +34 -0
- package/services/Dialog/XhrDialog.js +321 -0
- package/services/Toast/IToastMessage.d.ts +10 -0
- package/services/Toast/IToastMessage.js +1 -0
- package/services/Toast/IToastProps.d.ts +23 -0
- package/services/Toast/IToastProps.js +1 -0
- package/services/Toast/Toast.d.ts +21 -0
- package/services/Toast/Toast.js +79 -0
- package/services/Toast/ToastContainer.d.ts +40 -0
- package/services/Toast/ToastContainer.js +65 -0
- package/services/Toast/ToastContext.d.ts +22 -0
- package/services/Toast/ToastContext.js +7 -0
- package/services/Toast/ToastProvider.d.ts +19 -0
- package/services/Toast/ToastProvider.js +67 -0
- package/services/Toast/index.d.ts +2 -0
- package/services/Toast/index.js +2 -0
- package/services/Toast/useToast.d.ts +5 -0
- package/services/Toast/useToast.js +9 -0
- package/spritemap.svg +1 -0
- package/styles/NormalTheme.d.ts +3 -0
- package/styles/NormalTheme.js +65 -0
- package/styles/StyleBase.d.ts +2 -0
- package/styles/StyleBase.js +8 -0
- package/styles/StyleReset.d.ts +2 -0
- package/styles/StyleReset.js +8 -0
- package/svg/editor/index.d.ts +10 -0
- package/svg/editor/index.js +11 -0
- package/svg/file/index.d.ts +5 -0
- package/svg/file/index.js +6 -0
- package/svg/icons/index.d.ts +36 -0
- package/svg/icons/index.js +37 -0
- package/svg/index.d.ts +11 -0
- package/svg/index.js +5 -0
- package/svg/menu/index.d.ts +8 -0
- package/svg/menu/index.js +9 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MenuButton } from '../menu/MenuButton';
|
|
3
|
+
import { SVG } from '../../../svg';
|
|
4
|
+
var BulletListButton = function (props) {
|
|
5
|
+
return (React.createElement(MenuButton, { editor: props.editor, hint: "Bullet list", keys: ["Ctrl", "Shift", "8"], onClick: function () { return props.editor.chain().focus().toggleBulletList().run(); }, active: props.editor.isActive('bulletList'), icon: SVG.Editor.BulletList }));
|
|
6
|
+
};
|
|
7
|
+
export { BulletListButton };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MenuButton } from '../menu/MenuButton';
|
|
3
|
+
import { SVG } from '../../../svg';
|
|
4
|
+
var CodeBlockButton = function (props) {
|
|
5
|
+
return (React.createElement(MenuButton, { editor: props.editor, hint: "Code", keys: ["Ctrl", "Alt", "C"], onClick: function () { return props.editor.chain().focus().toggleCodeBlock().run(); }, active: props.editor.isActive('codeBlock'), icon: SVG.Editor.CodeBlock }));
|
|
6
|
+
};
|
|
7
|
+
export { CodeBlockButton };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MenuButton } from '../menu/MenuButton';
|
|
3
|
+
import { SVG } from '../../../svg';
|
|
4
|
+
var CodeButton = function (props) {
|
|
5
|
+
return (React.createElement(MenuButton, { editor: props.editor, hint: "Code", keys: ["Ctrl", "E"], onClick: function () { return props.editor.chain().focus().toggleCode().run(); }, disabled: !props.editor.can().chain().focus().toggleCode().run(), active: props.editor.isActive('code'), icon: SVG.Editor.Code }));
|
|
6
|
+
};
|
|
7
|
+
export { CodeButton };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MenuButton } from '../menu/MenuButton';
|
|
3
|
+
import { SVG } from '../../../svg';
|
|
4
|
+
var ItalicButton = function (props) {
|
|
5
|
+
return (React.createElement(MenuButton, { editor: props.editor, hint: "Italic", keys: ["Ctrl", "I"], onClick: function () { return props.editor.chain().focus().toggleItalic().run(); }, disabled: !props.editor.can().chain().focus().toggleItalic().run(), active: props.editor.isActive('italic'), icon: SVG.Editor.Italic }));
|
|
6
|
+
};
|
|
7
|
+
export { ItalicButton };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MenuButton } from '../menu/MenuButton';
|
|
3
|
+
import { SVG } from '../../../svg';
|
|
4
|
+
var OrderedListButton = function (props) {
|
|
5
|
+
return (React.createElement(MenuButton, { editor: props.editor, hint: "Ordered list", keys: ["Ctrl", "Shift", "7"], onClick: function () { return props.editor.chain().focus().toggleOrderedList().run(); }, active: props.editor.isActive('orderedList'), icon: SVG.Editor.OrderedList }));
|
|
6
|
+
};
|
|
7
|
+
export { OrderedListButton };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MenuButton } from '../menu/MenuButton';
|
|
3
|
+
import { SVG } from '../../../svg';
|
|
4
|
+
var StrikethroughButton = function (props) {
|
|
5
|
+
return (React.createElement(MenuButton, { editor: props.editor, hint: "Strikethrough", keys: ["Ctrl", "Shift", "S"], onClick: function () { return props.editor.chain().focus().toggleStrike().run(); }, disabled: !props.editor.can().chain().focus().toggleStrike().run(), active: props.editor.isActive('strike'), icon: SVG.Editor.Strikethrough }));
|
|
6
|
+
};
|
|
7
|
+
export { StrikethroughButton };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
import styled from 'styled-components';
|
|
18
|
+
import { BoldButton } from '../buttons/BoldButton';
|
|
19
|
+
import { ItalicButton } from '../buttons/ItalicButton';
|
|
20
|
+
import { StrikethroughButton } from '../buttons/StrikethroughButton';
|
|
21
|
+
import { MenuSeparator } from './MenuSeparator';
|
|
22
|
+
import { CodeButton } from '../buttons/CodeButton';
|
|
23
|
+
import { OrderedListButton } from '../buttons/OrderedListButton';
|
|
24
|
+
import { BulletListButton } from '../buttons/BulletListButton';
|
|
25
|
+
import { CodeBlockButton } from '../buttons/CodeBlockButton';
|
|
26
|
+
var MenuBarBase = function (props) {
|
|
27
|
+
if (!props.editor) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return (React.createElement("div", { className: props.className },
|
|
31
|
+
React.createElement(BoldButton, { editor: props.editor }),
|
|
32
|
+
React.createElement(ItalicButton, { editor: props.editor }),
|
|
33
|
+
React.createElement(StrikethroughButton, { editor: props.editor }),
|
|
34
|
+
React.createElement(MenuSeparator, null),
|
|
35
|
+
React.createElement(OrderedListButton, { editor: props.editor }),
|
|
36
|
+
React.createElement(BulletListButton, { editor: props.editor }),
|
|
37
|
+
React.createElement(MenuSeparator, null),
|
|
38
|
+
React.createElement(CodeButton, { editor: props.editor }),
|
|
39
|
+
React.createElement(CodeBlockButton, { editor: props.editor })));
|
|
40
|
+
};
|
|
41
|
+
var MenuBarStyled = styled(MenuBarBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n gap: 4px;\n"], ["\n display: flex;\n flex-direction: row;\n gap: 4px;\n"])));
|
|
42
|
+
var MenuBar = function (props) { return React.createElement(MenuBarStyled, __assign({}, props)); };
|
|
43
|
+
export { MenuBar };
|
|
44
|
+
var templateObject_1;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Editor } from '@tiptap/react';
|
|
3
|
+
interface IProps {
|
|
4
|
+
/** @ignore */
|
|
5
|
+
className?: string;
|
|
6
|
+
editor: Editor;
|
|
7
|
+
/**
|
|
8
|
+
* URL of icon to show.
|
|
9
|
+
*/
|
|
10
|
+
icon: string;
|
|
11
|
+
/**
|
|
12
|
+
* If set, button is disabled.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* If set, button is active.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
active?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Optional hint. Can be JSX.
|
|
23
|
+
*/
|
|
24
|
+
hint?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Optional shortcut keys
|
|
27
|
+
*/
|
|
28
|
+
keys?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Fired when button is clicked.
|
|
31
|
+
*/
|
|
32
|
+
onClick: () => void;
|
|
33
|
+
}
|
|
34
|
+
declare const MenuButton: (props: IProps) => React.JSX.Element;
|
|
35
|
+
export { MenuButton };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
import styled, { css, useTheme } from 'styled-components';
|
|
18
|
+
import { Key } from '../../../controls/Key';
|
|
19
|
+
import { Icon } from '../../../controls/Icon';
|
|
20
|
+
var MenuButtonBase = function (props) {
|
|
21
|
+
var theme = useTheme();
|
|
22
|
+
return (React.createElement("button", { className: props.className, disabled: props.disabled, onClick: props.onClick },
|
|
23
|
+
React.createElement(Icon, { color: props.disabled ? theme.colors.neutral[80] : theme.colors.neutral[50], url: props.icon }),
|
|
24
|
+
props.editor.isFocused && props.hint && React.createElement(Hint, null,
|
|
25
|
+
React.createElement(HintBody, null, props.hint),
|
|
26
|
+
props.keys && React.createElement(HintKeys, null, props.keys.map(function (k, index) { return React.createElement(Key, { key: index, value: k }); })))));
|
|
27
|
+
};
|
|
28
|
+
var HintBody = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n"], ["\n"])));
|
|
29
|
+
var HintKeys = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n white-space: nowrap;\n display: flex;\n gap: 4px;\n"], ["\n white-space: nowrap;\n display: flex;\n gap: 4px;\n"])));
|
|
30
|
+
var Hint = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n z-index: 100;\n left: 50%;\n bottom: calc(100% + 15px);\n translate: -50% 0;\n background-color: ", ";\n color: ", ";\n padding: 8px 8px 8px 8px;\n border-radius: 4px;\n visibility: hidden;\n font: ", ";\n\n // Content:\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 4px;\n\n &:before {\n position: absolute;\n content: '';\n left: 50%;\n translate: -50% 0;\n top: calc(100% - 5px);\n width: 10px;\n height: 10px;\n background-color: ", ";\n clip-path: polygon(0 50%, 100% 50%, 50% 100%);\n }\n"], ["\n position: absolute;\n z-index: 100;\n left: 50%;\n bottom: calc(100% + 15px);\n translate: -50% 0;\n background-color: ", ";\n color: ", ";\n padding: 8px 8px 8px 8px;\n border-radius: 4px;\n visibility: hidden;\n font: ", ";\n\n // Content:\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 4px;\n\n &:before {\n position: absolute;\n content: '';\n left: 50%;\n translate: -50% 0;\n top: calc(100% - 5px);\n width: 10px;\n height: 10px;\n background-color: ", ";\n clip-path: polygon(0 50%, 100% 50%, 50% 100%);\n }\n"])), function (p) { return p.theme.colors.neutral[10]; }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.theme.font.labelSmall; }, function (p) { return p.theme.colors.neutral[10]; });
|
|
31
|
+
var MenuButtonStyled = styled(MenuButtonBase)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n // Size:\n position: relative;\n width: 26px;\n height: 26px;\n\n // Appearance:\n border: none;\n background-color: transparent;\n border-radius: 4px;\n cursor: pointer;\n outline: none;\n user-select: none;\n ", "\n &:active {\n background-color: ", ";\n }\n &:focus {\n outline: solid 2px ", ";\n }\n\n // Content:\n display: flex;\n justify-content: center;\n align-items: center;\n\n ", "\n"], ["\n // Size:\n position: relative;\n width: 26px;\n height: 26px;\n\n // Appearance:\n border: none;\n background-color: transparent;\n border-radius: 4px;\n cursor: pointer;\n outline: none;\n user-select: none;\n ", "\n &:active {\n background-color: ", ";\n }\n &:focus {\n outline: solid 2px ", ";\n }\n\n // Content:\n display: flex;\n justify-content: center;\n align-items: center;\n\n ", "\n"])), function (p) { return p.active && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n "], ["\n background-color: ", ";\n "])), function (p) { return p.theme.colors.neutral[80]; }); }, function (p) { return p.theme.colors.neutral[80]; }, function (p) { return p.theme.colors.primary[1]; }, function (p) { return !p.disabled && css(templateObject_5 || (templateObject_5 = __makeTemplateObject([" \n &:hover {\n ", " {\n visibility: visible;\n }\n }\n "], [" \n &:hover {\n ", " {\n visibility: visible;\n }\n }\n "])), Hint); });
|
|
32
|
+
var MenuButton = function (props) { return React.createElement(MenuButtonStyled, __assign({}, props)); };
|
|
33
|
+
export { MenuButton };
|
|
34
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
import styled from 'styled-components';
|
|
18
|
+
var MenuSeparatorBase = function (props) {
|
|
19
|
+
return (React.createElement("div", { className: props.className }));
|
|
20
|
+
};
|
|
21
|
+
var MenuSeparatorStyled = styled(MenuSeparatorBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 1px;\n border-left: solid 1px ", ";\n margin-left: 2px;\n margin-right: 2px; \n"], ["\n width: 1px;\n border-left: solid 1px ", ";\n margin-left: 2px;\n margin-right: 2px; \n"])), function (p) { return p.theme.colors.neutral[30]; });
|
|
22
|
+
var MenuSeparator = function (props) { return React.createElement(MenuSeparatorStyled, __assign({}, props)); };
|
|
23
|
+
export { MenuSeparator };
|
|
24
|
+
var templateObject_1;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useTheme } from 'styled-components';
|
|
3
|
+
import { SVG } from '../../svg';
|
|
4
|
+
import { Icon } from '../../controls/Icon';
|
|
5
|
+
var Clear = function (props) {
|
|
6
|
+
var theme = useTheme();
|
|
7
|
+
var handleClick = function (e) {
|
|
8
|
+
// Stop propagation, or color/date controls will open on click.
|
|
9
|
+
e.stopPropagation();
|
|
10
|
+
props.onClick();
|
|
11
|
+
};
|
|
12
|
+
return (React.createElement(Icon, { size: 17, url: SVG.Icons.Cross, circle: true, color: theme.colors.primary[3], onClick: handleClick }));
|
|
13
|
+
};
|
|
14
|
+
export { Clear };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IIconProps } from '../../controls/Icon';
|
|
3
|
+
interface IProps {
|
|
4
|
+
/** @ignore */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** @ignore */
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Input name.
|
|
10
|
+
*/
|
|
11
|
+
name?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Current input value.
|
|
14
|
+
*/
|
|
15
|
+
value?: any;
|
|
16
|
+
/**
|
|
17
|
+
* Input type, `text`, `password`, `time` or `color`. Defaults to `text`.
|
|
18
|
+
*/
|
|
19
|
+
type?: 'time' | 'text' | 'password' | 'color';
|
|
20
|
+
/**
|
|
21
|
+
* Placeholder to show when the Input is empty. By default there is no
|
|
22
|
+
* placeholder.
|
|
23
|
+
*/
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Marks input as disabled. Disabled inputs cannot be interacted with.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Removes input border and makes background transparent. This is useful
|
|
32
|
+
* for placing an input in a `Field`.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
transparent?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* A fluid Input takes up all available horizontal space available to it.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
fluid?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* An input can show an error state.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
error?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* An input can be in a ghost state, where content is being loaded.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
ghost?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Icon props (optional).
|
|
53
|
+
*/
|
|
54
|
+
icon?: string | IIconProps;
|
|
55
|
+
/**
|
|
56
|
+
* Icon position.
|
|
57
|
+
* @default left
|
|
58
|
+
*/
|
|
59
|
+
iconPosition?: 'left' | 'right';
|
|
60
|
+
/**
|
|
61
|
+
* If set, Input's value can be cleared.
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
clearable?: boolean;
|
|
65
|
+
/** If set, dates and times (in inputs of type `date` or `time`) are shown in this format
|
|
66
|
+
* (refer to date-fns/format for format options).
|
|
67
|
+
*/
|
|
68
|
+
format?: string;
|
|
69
|
+
/**
|
|
70
|
+
* If set, time pickers have a "seconds" field.
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
hasSeconds?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* If set, time pickers use a 24h clock.
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
is24h?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* If set, time pickers show a clock face.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
clock?: boolean;
|
|
84
|
+
/** Optional input maxlength */
|
|
85
|
+
maxLength?: number;
|
|
86
|
+
/** Optional autocomplete information (see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) */
|
|
87
|
+
autocomplete?: string;
|
|
88
|
+
/**
|
|
89
|
+
* For Input elements with a dropdown, opening direction can be either fixed
|
|
90
|
+
* (`up` or `down`), or depend on the nearest scrolling parent: if the Input
|
|
91
|
+
* is in the top half of the visible section of the parent, then it opens
|
|
92
|
+
* downward, and vice-versa. If this property is not set, then the opening
|
|
93
|
+
* direction is determined from the Input position in the viewport.
|
|
94
|
+
*/
|
|
95
|
+
direction?: 'up' | 'down' | 'parent';
|
|
96
|
+
/**
|
|
97
|
+
* Removes tabIndex from this input.
|
|
98
|
+
*/
|
|
99
|
+
noTabIndex?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* If set, defines socument-wide hotkey to focus this input.
|
|
102
|
+
*/
|
|
103
|
+
hotKey?: string;
|
|
104
|
+
/**
|
|
105
|
+
* If set, hotkey must be pressed in combination with Ctrl.
|
|
106
|
+
* @default false
|
|
107
|
+
*/
|
|
108
|
+
hotKeyCtrl?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* If set, hotkey must be pressed in combination with Alt.
|
|
111
|
+
* @default false
|
|
112
|
+
*/
|
|
113
|
+
hotKeyAlt?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* If set, hotkey must be pressed in combination with Shift.
|
|
116
|
+
* @default false
|
|
117
|
+
*/
|
|
118
|
+
hotKeyShift?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Optional unit to print at end of `Input`.
|
|
121
|
+
*/
|
|
122
|
+
unit?: React.ReactNode;
|
|
123
|
+
/**
|
|
124
|
+
* Listeners are notified whenever the user interacts with the Input.
|
|
125
|
+
*/
|
|
126
|
+
onChange?: (value: any) => void;
|
|
127
|
+
/**
|
|
128
|
+
* Listeners are notified when the Input receives focus.
|
|
129
|
+
*/
|
|
130
|
+
onFocus?: () => void;
|
|
131
|
+
}
|
|
132
|
+
declare const Input: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<IProps, never>> & string & Omit<(props: IProps) => React.JSX.Element, keyof React.Component<any, {}, any>>;
|
|
133
|
+
export { Input, IProps };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
import { InputWrapper } from './InputWrapper';
|
|
8
|
+
var InputBase = function (props) {
|
|
9
|
+
var _a;
|
|
10
|
+
var inputRef = React.useRef(null);
|
|
11
|
+
// Current value:
|
|
12
|
+
var _b = React.useState((_a = props.value) !== null && _a !== void 0 ? _a : ""), value = _b[0], setValue = _b[1];
|
|
13
|
+
// Update value state when value prop changes.
|
|
14
|
+
React.useEffect(function () {
|
|
15
|
+
var _a;
|
|
16
|
+
setValue((_a = props.value) !== null && _a !== void 0 ? _a : "");
|
|
17
|
+
}, [props.value]);
|
|
18
|
+
var handleChange = function (e) {
|
|
19
|
+
var v = e.target.value;
|
|
20
|
+
setValue(v);
|
|
21
|
+
if (props.onChange)
|
|
22
|
+
props.onChange(v);
|
|
23
|
+
};
|
|
24
|
+
// When input is cleared, its value is set to NULL.
|
|
25
|
+
var handleClear = function () {
|
|
26
|
+
setValue("");
|
|
27
|
+
inputRef.current.focus();
|
|
28
|
+
if (props.onChange) {
|
|
29
|
+
props.onChange(null);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
// Place document-wide keydown listener to listen for hotkeys, if required.
|
|
33
|
+
React.useEffect(function () {
|
|
34
|
+
if (props.hotKey) {
|
|
35
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
36
|
+
}
|
|
37
|
+
return function () {
|
|
38
|
+
if (props.hotKey) {
|
|
39
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
43
|
+
// Handle hotkey check.
|
|
44
|
+
var handleKeyDown = function (e) {
|
|
45
|
+
// If not the hotkey, then abort.
|
|
46
|
+
if (e.key.toLowerCase() != props.hotKey.toLowerCase())
|
|
47
|
+
return;
|
|
48
|
+
// Check modifier keys:
|
|
49
|
+
if (props.hotKeyCtrl && !e.ctrlKey)
|
|
50
|
+
return;
|
|
51
|
+
if (props.hotKeyAlt && !e.altKey)
|
|
52
|
+
return;
|
|
53
|
+
if (props.hotKeyShift && !e.shiftKey)
|
|
54
|
+
return;
|
|
55
|
+
// It's our key. Focus the input.
|
|
56
|
+
inputRef.current.focus();
|
|
57
|
+
inputRef.current.select();
|
|
58
|
+
};
|
|
59
|
+
return (React.createElement(InputWrapper, { fluid: props.fluid, ghost: props.ghost, error: props.error, disabled: props.disabled, transparent: props.transparent, icon: props.icon, iconPosition: props.iconPosition, onClear: (props.clearable && props.value) ? handleClear : null, unit: props.unit },
|
|
60
|
+
React.createElement("input", { className: props.className, ref: inputRef, tabIndex: props.noTabIndex ? -1 : 0, value: value, placeholder: props.placeholder, disabled: props.disabled, type: props.type, maxLength: props.maxLength, autoComplete: props.autocomplete, onChange: handleChange, onFocus: props.onFocus })));
|
|
61
|
+
};
|
|
62
|
+
var Input = styled(InputBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Dimensions:\n width: 100%;\n box-sizing: border-box;\n z-index: 0;\n border: none;\n\n outline: solid 3px rebeccapurple;\n background: transparent;\n padding: 0;\n margin: 0;\n outline: none;\n\n // Font\n font: ", ";\n text-align: left;\n color: ", ";\n\n // Define colors for placeholder text.\n &::placeholder {\n color: rgb(from ", " r g b / 50%);\n opacity: 1 !important; /* Firefox applies opacity */\n }\n\n // Focus:\n &:focus {\n &::placeholder {\n color: rgb(from ", " r g b / 30%);\n }\n }\n\n // Make sure HTML5 validation does not show up.\n &:valid {\n box-shadow: none;\n }\n &:invalid {\n box-shadow: none;\n }\n\n // Turn off number spinners.\n &[type=number]::-webkit-inner-spin-button, \n &[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none; /* Webkit (Chrome) */\n margin: 0; \n } \n &[type=number] {\n appearance:textfield;\n -moz-appearance:textfield; /* Firefox */\n } \n"], ["\n // Dimensions:\n width: 100%;\n box-sizing: border-box;\n z-index: 0;\n border: none;\n\n outline: solid 3px rebeccapurple;\n background: transparent;\n padding: 0;\n margin: 0;\n outline: none;\n\n // Font\n font: ", ";\n text-align: left;\n color: ", ";\n\n // Define colors for placeholder text.\n &::placeholder {\n color: rgb(from ", " r g b / 50%);\n opacity: 1 !important; /* Firefox applies opacity */\n }\n\n // Focus:\n &:focus {\n &::placeholder {\n color: rgb(from ", " r g b / 30%);\n }\n }\n\n // Make sure HTML5 validation does not show up.\n &:valid {\n box-shadow: none;\n }\n &:invalid {\n box-shadow: none;\n }\n\n // Turn off number spinners.\n &[type=number]::-webkit-inner-spin-button, \n &[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none; /* Webkit (Chrome) */\n margin: 0; \n } \n &[type=number] {\n appearance:textfield;\n -moz-appearance:textfield; /* Firefox */\n } \n"])), function (p) { return p.theme.font.bodyLarge; }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.colors.primary[3]; });
|
|
63
|
+
export { Input };
|
|
64
|
+
var templateObject_1;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IIconProps } from '../../controls/Icon';
|
|
3
|
+
interface IProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
fluid?: boolean;
|
|
7
|
+
ghost?: boolean;
|
|
8
|
+
error?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
transparent?: boolean;
|
|
11
|
+
/** Icon props (optional). */
|
|
12
|
+
icon?: string | IIconProps;
|
|
13
|
+
/**
|
|
14
|
+
* Icon position.
|
|
15
|
+
* @default left
|
|
16
|
+
*/
|
|
17
|
+
iconPosition?: 'left' | 'right';
|
|
18
|
+
unit?: React.ReactNode;
|
|
19
|
+
onClear?: () => void;
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
}
|
|
22
|
+
declare const InputWrapper: ({ iconPosition, ...props }: IProps) => React.JSX.Element;
|
|
23
|
+
export { InputWrapper };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import * as React from 'react';
|
|
28
|
+
import styled, { css, useTheme } from 'styled-components';
|
|
29
|
+
import { Icon } from '../../controls/Icon';
|
|
30
|
+
import { Clear } from './Clear';
|
|
31
|
+
var InputWrapperBase = function (props) {
|
|
32
|
+
var _a;
|
|
33
|
+
var theme = useTheme();
|
|
34
|
+
var icon = null;
|
|
35
|
+
// An icon can be passed either as a URL...
|
|
36
|
+
if (typeof props.icon === "string") {
|
|
37
|
+
icon = (React.createElement(Icon, { size: 17, url: props.icon, color: theme.colors.primary[3] }));
|
|
38
|
+
}
|
|
39
|
+
// ... or as IIconProps.
|
|
40
|
+
else if (props.icon != null) {
|
|
41
|
+
icon = (React.createElement(Icon, __assign({ size: 17, color: (_a = props.icon.color) !== null && _a !== void 0 ? _a : theme.colors.primary[3] }, props.icon)));
|
|
42
|
+
}
|
|
43
|
+
return (React.createElement("div", { className: props.className, onClick: props.onClick },
|
|
44
|
+
icon && !props.ghost && props.iconPosition == 'left' && icon,
|
|
45
|
+
React.createElement("div", { style: { flex: 1 } }, props.children),
|
|
46
|
+
icon && !props.ghost && props.iconPosition == 'right' && icon,
|
|
47
|
+
props.onClear && React.createElement(Clear, { onClick: props.onClear }),
|
|
48
|
+
React.createElement(Unit, null, props.unit)));
|
|
49
|
+
};
|
|
50
|
+
var Unit = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font: ", ";\n color: ", ";\n sup {\n vertical-align: baseline;\n font-size: xx-small;\n line-height: normal;\n } \n"], ["\n font: ", ";\n color: ", ";\n sup {\n vertical-align: baseline;\n font-size: xx-small;\n line-height: normal;\n } \n"])), function (p) { return p.theme.font.dataLarge; }, function (p) { return p.theme.colors.primary[2]; });
|
|
51
|
+
var InputWrapperStyled = styled(InputWrapperBase)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n // Position and size:\n position: relative;\n width: 250px;\n ", "\n box-sizing: border-box;\n z-index: 0;\n\n // Content: \n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n\n // Appearance:\n transition: border-color ", "ms ease;\n border-radius: ", "px;\n background-color: ", ";\n border: none;\n padding: 7px 11px 7px 11px;\n outline: none;\n cursor: ", ";\n\n // Font\n font: ", ";\n text-align: left;\n color: ", ";\n\n // Hover:\n &:hover {\n outline: solid 2px ", ";\n }\n\n // Focus:\n &:focus-within {\n outline: solid 2px ", ";\n }\n\n // Error\n ", "\n\n // Disabled\n ", "\n\n // Ghost\n ", "\n\n // Transparent (borderless)\n ", "\n"], ["\n // Position and size:\n position: relative;\n width: 250px;\n ", "\n box-sizing: border-box;\n z-index: 0;\n\n // Content: \n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n\n // Appearance:\n transition: border-color ", "ms ease;\n border-radius: ", "px;\n background-color: ", ";\n border: none;\n padding: 7px 11px 7px 11px;\n outline: none;\n cursor: ", ";\n\n // Font\n font: ", ";\n text-align: left;\n color: ", ";\n\n // Hover:\n &:hover {\n outline: solid 2px ", ";\n }\n\n // Focus:\n &:focus-within {\n outline: solid 2px ", ";\n }\n\n // Error\n ", "\n\n // Disabled\n ", "\n\n // Ghost\n ", "\n\n // Transparent (borderless)\n ", "\n"])), function (p) { return p.fluid && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["width: 100%;"], ["width: 100%;"]))); }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.radius.normal; }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.onClick ? 'pointer' : 'auto'; }, function (p) { return p.theme.font.bodyLarge; }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.colors.primary[2]; }, function (p) { return p.theme.colors.primary[1]; }, function (p) { return p.error && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n outline: solid 2px ", ";\n &:focus-within {\n outline: solid 2px ", ";\n }\n &:hover {\n outline: solid 2px ", ";\n } \n box-shadow: none;\n "], ["\n outline: solid 2px ", ";\n &:focus-within {\n outline: solid 2px ", ";\n }\n &:hover {\n outline: solid 2px ", ";\n } \n box-shadow: none;\n "])), p.theme.colors.negative, p.theme.colors.negative, p.theme.colors.negative); }, function (p) { return p.disabled && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n outline: solid 2px ", ";\n background-color: ", ";\n color: ", ";\n pointer-events: none;\n user-select: none;\n "], ["\n outline: solid 2px ", ";\n background-color: ", ";\n color: ", ";\n pointer-events: none;\n user-select: none;\n "])), p.theme.colors.primary[4], p.theme.colors.primary[4], p.theme.colors.neutral[50]); }, function (p) { return p.ghost && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n outline: dashed 1px ", ";\n background-color: transparent;\n color: transparent;\n pointer-events: none;\n "], ["\n outline: dashed 1px ", ";\n background-color: transparent;\n color: transparent;\n pointer-events: none;\n "])), p.theme.colors.primary[2]); }, function (p) { return p.transparent && css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border-width: 0px;\n outline: none !important;\n background-color: transparent;\n "], ["\n border-width: 0px;\n outline: none !important;\n background-color: transparent;\n "]))); });
|
|
52
|
+
var InputWrapper = function (_a) {
|
|
53
|
+
var _b = _a.iconPosition, iconPosition = _b === void 0 ? 'left' : _b, props = __rest(_a, ["iconPosition"]);
|
|
54
|
+
return React.createElement(InputWrapperStyled, __assign({ iconPosition: iconPosition }, props));
|
|
55
|
+
};
|
|
56
|
+
export { InputWrapper };
|
|
57
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Input } from './Input';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Input } from './Input';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface ISelectorProps {
|
|
2
|
+
/**
|
|
3
|
+
* Is the `Selector` currently checked?
|
|
4
|
+
*/
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Is this Selector in an `indeterminate` state?
|
|
8
|
+
*/
|
|
9
|
+
indeterminate?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Is this a radio button?
|
|
12
|
+
*/
|
|
13
|
+
radio?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* A disabled `Selector` cannot be interacted with.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If set, show an error state.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
error?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Listeners are notified whenever the user interacts with the `Selector``.
|
|
26
|
+
*/
|
|
27
|
+
onChange?: (value: any) => void;
|
|
28
|
+
}
|
|
29
|
+
export { ISelectorProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|