@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,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ISelectorProps } from './ISelectorProps';
|
|
3
|
+
type TCheckboxType = 'check' | 'toggle' | 'slider' | 'circle';
|
|
4
|
+
interface IProps extends ISelectorProps {
|
|
5
|
+
/** @ignore */
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Checkbox name.
|
|
9
|
+
*/
|
|
10
|
+
name?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Radio value
|
|
13
|
+
*/
|
|
14
|
+
value?: any;
|
|
15
|
+
/**
|
|
16
|
+
* Checkbox label. Appears to the right of the box. Can be JSX.
|
|
17
|
+
*/
|
|
18
|
+
label?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Checkbox visual style: `check`, `toggle`, `slider` or `circle`. Default is `check`.
|
|
21
|
+
* @default check
|
|
22
|
+
*/
|
|
23
|
+
type?: TCheckboxType;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A Selector can be used to create either a HTML checkbox or a HTML radio button.
|
|
27
|
+
*/
|
|
28
|
+
declare const Selector: (props: IProps) => React.JSX.Element;
|
|
29
|
+
export { Selector, IProps };
|
|
@@ -0,0 +1,77 @@
|
|
|
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 } from 'styled-components';
|
|
29
|
+
import { Checkbox } from './widgets/Checkbox';
|
|
30
|
+
import { Toggle } from './widgets/Toggle';
|
|
31
|
+
var SelectorBase = function (props) {
|
|
32
|
+
var _a = React.useState(props.checked), checked = _a[0], setChecked = _a[1];
|
|
33
|
+
var inputRef = React.useRef(null);
|
|
34
|
+
React.useEffect(function () {
|
|
35
|
+
if (props.indeterminate === true)
|
|
36
|
+
inputRef.current.indeterminate = true;
|
|
37
|
+
if (props.indeterminate === false)
|
|
38
|
+
inputRef.current.indeterminate = false;
|
|
39
|
+
}, [props.indeterminate]);
|
|
40
|
+
React.useEffect(function () {
|
|
41
|
+
setChecked(props.checked);
|
|
42
|
+
}, [props.checked]);
|
|
43
|
+
var handleChange = function (e) {
|
|
44
|
+
// For radios, we use the value attribute.
|
|
45
|
+
// For checkboxes, we use the checked attribute.
|
|
46
|
+
var newValue = props.radio ? e.target.value : e.target.checked;
|
|
47
|
+
setChecked(newValue);
|
|
48
|
+
if (props.onChange) {
|
|
49
|
+
props.onChange(newValue);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var getWidget = function () {
|
|
53
|
+
var _a;
|
|
54
|
+
var className = props.className, otherProps = __rest(props, ["className"]);
|
|
55
|
+
// If type isn't set, then choose a default for radio/not-radio:
|
|
56
|
+
var type = (_a = props.type) !== null && _a !== void 0 ? _a : (props.radio ? 'radio' : 'check');
|
|
57
|
+
switch (type) {
|
|
58
|
+
case 'toggle': return React.createElement(Toggle, __assign({}, otherProps));
|
|
59
|
+
default: return React.createElement(Checkbox, __assign({}, otherProps));
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return (React.createElement("label", { className: props.className },
|
|
63
|
+
React.createElement("input", { ref: inputRef, name: props.name, type: props.radio ? "radio" : "checkbox", value: props.value === null ? undefined : props.value, checked: checked === null ? false : checked, disabled: props.disabled, onChange: handleChange }),
|
|
64
|
+
getWidget(),
|
|
65
|
+
React.createElement("span", null, props.label)));
|
|
66
|
+
};
|
|
67
|
+
var SelectorStyled = styled(SelectorBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n pointer-events: ", ";\n\n // Position and size:\n display: inline-flex;\n align-items: center;\n gap: 12px;\n position: relative;\n\n // Interaction:\n cursor: ", ";\n outline: none;\n\n // The input[type='checkbox'] itself is not visible. display-none will cause \n // it not to be tab-indexable, or keyboard-controllable, so we use\n // \"appearance\". It is also absolutely-positioned, or it will still cause \n // the visible elements to shift right and down. \"outline:none\" removes a \n // little dot that indicates that the input has focus.\n input {\n appearance: none;\n -webkit-appearance: none;\n position: absolute;\n outline: none;\n }\n\n span {\n color: ", ";\n user-select: none;\n ", "\n }\n"], ["\n pointer-events: ", ";\n\n // Position and size:\n display: inline-flex;\n align-items: center;\n gap: 12px;\n position: relative;\n\n // Interaction:\n cursor: ", ";\n outline: none;\n\n // The input[type='checkbox'] itself is not visible. display-none will cause \n // it not to be tab-indexable, or keyboard-controllable, so we use\n // \"appearance\". It is also absolutely-positioned, or it will still cause \n // the visible elements to shift right and down. \"outline:none\" removes a \n // little dot that indicates that the input has focus.\n input {\n appearance: none;\n -webkit-appearance: none;\n position: absolute;\n outline: none;\n }\n\n span {\n color: ", ";\n user-select: none;\n ", "\n }\n"
|
|
68
|
+
/**
|
|
69
|
+
* A Selector can be used to create either a HTML checkbox or a HTML radio button.
|
|
70
|
+
*/
|
|
71
|
+
])), function (p) { return p.disabled ? 'none' : 'all'; }, function (p) { return p.disabled ? 'auto' : 'pointer'; }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.disabled && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: #aaa;\n "], ["\n color: #aaa;\n "]))); });
|
|
72
|
+
/**
|
|
73
|
+
* A Selector can be used to create either a HTML checkbox or a HTML radio button.
|
|
74
|
+
*/
|
|
75
|
+
var Selector = function (props) { return React.createElement(SelectorStyled, __assign({}, props)); };
|
|
76
|
+
export { Selector };
|
|
77
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Selector';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Selector';
|
|
@@ -0,0 +1,29 @@
|
|
|
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 } from 'styled-components';
|
|
18
|
+
import { SVG } from '../../../svg';
|
|
19
|
+
var CheckboxBase = function (props) {
|
|
20
|
+
return React.createElement("div", { className: props.className },
|
|
21
|
+
React.createElement("svg", { className: "checked" },
|
|
22
|
+
React.createElement("use", { xlinkHref: SVG.Icons.Check })),
|
|
23
|
+
React.createElement("svg", { className: "indeterminate" },
|
|
24
|
+
React.createElement("use", { xlinkHref: SVG.Icons.Minus })));
|
|
25
|
+
};
|
|
26
|
+
var CheckboxStyled = styled(CheckboxBase)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n\n // Dimensions:\n width: 18px;\n height: 18px;\n\n // Appearance:\n box-sizing: border-box;\n border-radius: 2px;\n\n ", "\n\n ", " \n\n // SVG position:\n svg {\n position: absolute;\n left: calc(50% - 6px);\n top: calc(50% - 6px);\n width: 12px;\n height: 12px;\n fill: ", ";\n display: none;\n } \n // SVG selection:\n input:checked + & {\n svg.checked {\n display: block;\n }\n svg.indeterminate {\n display: none;\n }\n } \n input:indeterminate + & {\n svg.checked {\n display: none;\n }\n svg.indeterminate {\n display: block;\n }\n } \n\n // Circle behind hovered/focused/active checkbox.\n // The circle is always present, although transparent when in default\n // unfocused state. This is so that a background color transition may work.\n &:before {\n content: '';\n position: absolute;\n left: calc(50% - 20px);\n top: calc(50% - 20px);\n border-radius: 50%;\n width: 40px;\n height: 40px;\n z-index: -1;\n background-color: transparent;\n transition: background-color ease-in-out ", "ms; \n }\n &:hover:before, input:focus + &:before {\n // Normal highlight = primary1 (10% opacity)\n // Error highlight = error (8% opacity)\n background-color: ", ";\n }\n &:active:before {\n // Normal highlight = primary2 \n // Error highlight = error (16% opacity)\n background-color: ", ";\n }\n"], ["\n position: relative;\n\n // Dimensions:\n width: 18px;\n height: 18px;\n\n // Appearance:\n box-sizing: border-box;\n border-radius: 2px;\n\n ", "\n\n ", " \n\n // SVG position:\n svg {\n position: absolute;\n left: calc(50% - 6px);\n top: calc(50% - 6px);\n width: 12px;\n height: 12px;\n fill: ", ";\n display: none;\n } \n // SVG selection:\n input:checked + & {\n svg.checked {\n display: block;\n }\n svg.indeterminate {\n display: none;\n }\n } \n input:indeterminate + & {\n svg.checked {\n display: none;\n }\n svg.indeterminate {\n display: block;\n }\n } \n\n // Circle behind hovered/focused/active checkbox.\n // The circle is always present, although transparent when in default\n // unfocused state. This is so that a background color transition may work.\n &:before {\n content: '';\n position: absolute;\n left: calc(50% - 20px);\n top: calc(50% - 20px);\n border-radius: 50%;\n width: 40px;\n height: 40px;\n z-index: -1;\n background-color: transparent;\n transition: background-color ease-in-out ", "ms; \n }\n &:hover:before, input:focus + &:before {\n // Normal highlight = primary1 (10% opacity)\n // Error highlight = error (8% opacity)\n background-color: ", ";\n }\n &:active:before {\n // Normal highlight = primary2 \n // Error highlight = error (16% opacity)\n background-color: ", ";\n }\n"])), function (p) { return p.disabled && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: none;\n border: solid 2px ", ";\n input:checked + &, input:indeterminate + & { \n background-color: ", ";\n border: none;\n }\n "], ["\n background: none;\n border: solid 2px ", ";\n input:checked + &, input:indeterminate + & { \n background-color: ", ";\n border: none;\n }\n "])), function (p) { return p.theme.colors.neutral[50]; }, p.theme.colors.primary[5]); }, function (p) { return !p.disabled && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: none;\n border: solid 2px ", ";\n input:checked + &, input:indeterminate + & { \n background-color: ", ";\n border: none; \n }\n "], ["\n background: none;\n border: solid 2px ", ";\n input:checked + &, input:indeterminate + & { \n background-color: ", ";\n border: none; \n }\n "])), p.error ? p.theme.colors.negative : p.theme.colors.neutral[80], p.error ? p.theme.colors.negative : p.theme.colors.primary[1]); }, function (p) { return p.disabled ? "rgb(from ".concat(p.theme.colors.neutral[95], " r g b / 38%)") : p.theme.colors.neutral[100]; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.error ? "rgb(from ".concat(p.theme.colors.negative, " r g b / 8%)") : "rgb(from ".concat(p.theme.colors.primary[1], " r g b / 10%)"); }, function (p) { return p.error ? "rgb(from ".concat(p.theme.colors.negative, " r g b / 16%)") : p.theme.colors.primary[2]; });
|
|
27
|
+
var Checkbox = function (props) { return React.createElement(CheckboxStyled, __assign({}, props)); };
|
|
28
|
+
export { Checkbox };
|
|
29
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -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, { css } from 'styled-components';
|
|
18
|
+
var ToggleBase = function (props) {
|
|
19
|
+
return React.createElement("div", { className: props.className });
|
|
20
|
+
};
|
|
21
|
+
var ToggleStyled = styled(ToggleBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n\n width: 40px;\n height: 18px;\n border-radius: 9px;\n background-color: ", ";\n\n // Default circle:\n &:after {\n content: '';\n position: absolute;\n left: 0px;\n top: -1px;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n box-sizing: border-box;\n background-color: transparent;\n border: solid 2px ", ";\n transition: \n left ease-in-out ", "ms, \n background-color ease-in-out ", "ms, \n border-color ease-in-out ", "ms;\n }\n\n // Checked circle:\n input:checked + &:after {\n background-color: ", ";\n left: 20px;\n }\n\n // Disabled circle:\n ", "\n"], ["\n position: relative;\n\n width: 40px;\n height: 18px;\n border-radius: 9px;\n background-color: ", ";\n\n // Default circle:\n &:after {\n content: '';\n position: absolute;\n left: 0px;\n top: -1px;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n box-sizing: border-box;\n background-color: transparent;\n border: solid 2px ", ";\n transition: \n left ease-in-out ", "ms, \n background-color ease-in-out ", "ms, \n border-color ease-in-out ", "ms;\n }\n\n // Checked circle:\n input:checked + &:after {\n background-color: ", ";\n left: 20px;\n }\n\n // Disabled circle:\n ", "\n"])), function (p) { return p.disabled ? p.theme.colors.neutral[30] : p.theme.colors.primary[5]; }, function (p) { return p.theme.colors.primary[1]; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.colors.primary[1]; }, function (p) { return p.disabled && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:after {\n background-color: ", " !important;\n border-color: ", ";\n }\n "], ["\n &:after {\n background-color: ", " !important;\n border-color: ", ";\n }\n "])), p.theme.colors.primary[5], p.theme.colors.primary[5]); });
|
|
22
|
+
var Toggle = function (props) { return React.createElement(ToggleStyled, __assign({}, props)); };
|
|
23
|
+
export { Toggle };
|
|
24
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/** @ignore */
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Current value.
|
|
7
|
+
*/
|
|
8
|
+
value?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Minimum value.
|
|
11
|
+
* @default 0
|
|
12
|
+
*/
|
|
13
|
+
min?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Maximum value.
|
|
16
|
+
* @default 100
|
|
17
|
+
*/
|
|
18
|
+
max?: number;
|
|
19
|
+
/**
|
|
20
|
+
* If set, `onChange` is called continuously while the slide is being moved.
|
|
21
|
+
* If not, `onChange` is called only when the slider is released.
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
immediate?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Sets the value change when an arrow key is pressed. If omitted,
|
|
27
|
+
* `delta` will be 10% of the value range.
|
|
28
|
+
*/
|
|
29
|
+
delta?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Event is triggered when slider's value changes.
|
|
32
|
+
*/
|
|
33
|
+
onChange?: (value: number) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Should ticks be displayed? If so, how many?
|
|
36
|
+
* @default 0
|
|
37
|
+
*/
|
|
38
|
+
ticks?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Should the control snap to ticks (if present)?
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
snapToTicks?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* A disabled `Slider` cannot be interacted with.
|
|
46
|
+
*/
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Adds left and right padding.
|
|
50
|
+
*/
|
|
51
|
+
padded?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* A `Slider` can be in an `error` state.
|
|
54
|
+
*/
|
|
55
|
+
error?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Sliders allow users to view and select a value (or range) along a track.
|
|
59
|
+
* They’re ideal for adjusting settings such as volume and brightness, or for
|
|
60
|
+
* applying image filters.
|
|
61
|
+
*/
|
|
62
|
+
declare const Slider: ({ min, max, ...props }: IProps) => React.JSX.Element;
|
|
63
|
+
export { Slider, IProps };
|
|
@@ -0,0 +1,198 @@
|
|
|
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, keyframes } from 'styled-components';
|
|
29
|
+
var SliderBase = function (props) {
|
|
30
|
+
// Current value. This is not the same as props.value: it is the value
|
|
31
|
+
// while the knob is being dragged. Upon release, this value is called back
|
|
32
|
+
// with onChange. Or continuously, if `immediate` is set.
|
|
33
|
+
var value = React.useRef(props.value);
|
|
34
|
+
// Reference: slider body
|
|
35
|
+
var sliderRef = React.useRef(null);
|
|
36
|
+
// Reference: track fill.
|
|
37
|
+
var trackFillRef = React.useRef(null);
|
|
38
|
+
// Reference: knob
|
|
39
|
+
var knobRef = React.useRef(null);
|
|
40
|
+
// Reference: tear value
|
|
41
|
+
var tearValueRef = React.useRef(null);
|
|
42
|
+
// Currently dragging? This is set when mouse is down, unset when mouse
|
|
43
|
+
// is released.
|
|
44
|
+
var dragging = React.useRef(false);
|
|
45
|
+
// Clamp value in range min..max (inclusive)
|
|
46
|
+
var clamp = function (value, min, max) {
|
|
47
|
+
return Math.max(min, Math.min(max, value));
|
|
48
|
+
};
|
|
49
|
+
// Snap value to ticks (if there are ticks).
|
|
50
|
+
var snapToTicks = function (value) {
|
|
51
|
+
// Do nothing if there are no ticks, or if snapToTicks not specified:
|
|
52
|
+
if (!props.snapToTicks)
|
|
53
|
+
return value;
|
|
54
|
+
if (!props.ticks || props.ticks <= 1)
|
|
55
|
+
return value;
|
|
56
|
+
// If ticks are present, then clamp x-position to ticks:
|
|
57
|
+
var section = (props.max - props.min) / (props.ticks - 1);
|
|
58
|
+
return Math.round((value - props.min) / section) * section + props.min;
|
|
59
|
+
};
|
|
60
|
+
//
|
|
61
|
+
// Change current value. If notify is set, also call onChange.
|
|
62
|
+
//
|
|
63
|
+
var setValue = function (v, notify) {
|
|
64
|
+
value.current = Math.round(snapToTicks(clamp(v, props.min, props.max)));
|
|
65
|
+
// Calculate position in 0..1 range:
|
|
66
|
+
var pos = (value.current - props.min) / (props.max - props.min);
|
|
67
|
+
// Set knob position as a percentage:
|
|
68
|
+
knobRef.current.style.left = "".concat(pos * 100, "%");
|
|
69
|
+
trackFillRef.current.style.width = "".concat(pos * 100, "%");
|
|
70
|
+
tearValueRef.current.textContent = value.current.toString();
|
|
71
|
+
if (notify && props.onChange)
|
|
72
|
+
props.onChange(value.current);
|
|
73
|
+
};
|
|
74
|
+
// Calculate value change for a single arrow key press:
|
|
75
|
+
var getDelta = function () {
|
|
76
|
+
// If ticks are present and snapToTicks is on, then snap to ticks:
|
|
77
|
+
if (props.snapToTicks && props.ticks && props.ticks > 1) {
|
|
78
|
+
return (props.max - props.min) / (props.ticks - 1);
|
|
79
|
+
}
|
|
80
|
+
// If a custom delta was specified, use it:
|
|
81
|
+
if (props.delta)
|
|
82
|
+
return props.delta;
|
|
83
|
+
// If no custom delta was specified, then use 10% of value range:
|
|
84
|
+
return (props.max - props.min) / 10;
|
|
85
|
+
};
|
|
86
|
+
// When the value or the range changes, reposition the knob.
|
|
87
|
+
React.useEffect(function () {
|
|
88
|
+
setValue(props.value);
|
|
89
|
+
}, [props.value, props.min, props.max, props.ticks, props.snapToTicks]);
|
|
90
|
+
// Mouseup and mousemove and document-wide events. They are only relevant
|
|
91
|
+
// when dragging is on.
|
|
92
|
+
React.useEffect(function () {
|
|
93
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
94
|
+
document.addEventListener('mousemove', handleMouseMove);
|
|
95
|
+
return function () {
|
|
96
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
97
|
+
document.removeEventListener('mousemove', handleMouseMove);
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
var handleMouseEvent = function (clientX) {
|
|
101
|
+
var rect = sliderRef.current.getBoundingClientRect();
|
|
102
|
+
// Calculate x-position in range 0..1:
|
|
103
|
+
var x = clamp((clientX - rect.left) / sliderRef.current.offsetWidth, 0, 1);
|
|
104
|
+
// Derive value from x-position:
|
|
105
|
+
var v = Math.round((props.max - props.min) * x + props.min);
|
|
106
|
+
// Set new value. If props.immediate, then call onChange immediately.
|
|
107
|
+
setValue(v, props.immediate);
|
|
108
|
+
};
|
|
109
|
+
var handleMouseDown = function (e) {
|
|
110
|
+
dragging.current = true;
|
|
111
|
+
handleMouseEvent(e.clientX);
|
|
112
|
+
};
|
|
113
|
+
// When the mouse moves (while dragging is on), calculate the new position
|
|
114
|
+
// of the knob. Derive a value, and call it back if `immediate` is set.
|
|
115
|
+
var handleMouseMove = function (e) {
|
|
116
|
+
if (!dragging.current)
|
|
117
|
+
return;
|
|
118
|
+
handleMouseEvent(e.clientX);
|
|
119
|
+
};
|
|
120
|
+
// When mouse is released, call back value.
|
|
121
|
+
var handleMouseUp = function () {
|
|
122
|
+
if (dragging.current) {
|
|
123
|
+
dragging.current = false;
|
|
124
|
+
if (props.onChange)
|
|
125
|
+
props.onChange(value.current);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
var handleKeyDown = function (e) {
|
|
129
|
+
switch (e.key) {
|
|
130
|
+
case 'ArrowLeft':
|
|
131
|
+
setValue(value.current - getDelta(), true);
|
|
132
|
+
break;
|
|
133
|
+
case 'ArrowRight':
|
|
134
|
+
setValue(value.current + getDelta(), true);
|
|
135
|
+
break;
|
|
136
|
+
// Home moves to minimum:
|
|
137
|
+
case "Home":
|
|
138
|
+
setValue(props.min, true);
|
|
139
|
+
break;
|
|
140
|
+
// End moves to maximum.
|
|
141
|
+
case "End":
|
|
142
|
+
setValue(props.max, true);
|
|
143
|
+
break;
|
|
144
|
+
// PageUp/PageDown take 3x size steps:
|
|
145
|
+
case "PageUp":
|
|
146
|
+
setValue(value.current - getDelta() * 3, true);
|
|
147
|
+
break;
|
|
148
|
+
case "PageDown":
|
|
149
|
+
setValue(value.current + getDelta() * 3, true);
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
var renderTicks = function () {
|
|
154
|
+
// Create a number of ticks and return them.
|
|
155
|
+
return Array(props.ticks).fill(0).map(function (t, idx) { return React.createElement(Tick, { key: idx }); });
|
|
156
|
+
};
|
|
157
|
+
var className = props.className, restProps = __rest(props, ["className"]);
|
|
158
|
+
return (React.createElement("div", { className: props.className, ref: sliderRef, onMouseDown: handleMouseDown, onKeyDown: handleKeyDown, tabIndex: 0 },
|
|
159
|
+
React.createElement(Track, null,
|
|
160
|
+
React.createElement(TrackFill, { "$disabled": props.disabled, "$error": props.error, ref: trackFillRef }),
|
|
161
|
+
props.ticks && renderTicks(),
|
|
162
|
+
React.createElement(KnobPosition, { ref: knobRef },
|
|
163
|
+
React.createElement(Knob, { "$disabled": props.disabled, "$error": props.error },
|
|
164
|
+
React.createElement(Teardrop, { "$disabled": props.disabled, "$error": props.error },
|
|
165
|
+
React.createElement("path", { d: "M14.293 34L4.39347 24.0416C-1.07387 18.5418 -1.07387 9.62475 4.39347 4.12489C9.86081 -1.37496 18.7251 -1.37496 24.1925 4.12489C29.6598 9.62475 29.6598 18.5418 24.1925 24.0416L14.293 34Z" })),
|
|
166
|
+
React.createElement(TearValue, { "$disabled": props.disabled, "$error": props.error, ref: tearValueRef }))))));
|
|
167
|
+
};
|
|
168
|
+
var Tick = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 2px;\n height: 2px;\n background-color: ", ";\n border-radius: 1px;\n"], ["\n width: 2px;\n height: 2px;\n background-color: ", ";\n border-radius: 1px;\n"])), function (p) { return p.theme.colors.accent; });
|
|
169
|
+
var Teardrop = styled.svg(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n top: -38px;\n left: -3.5px;\n width: 28px;\n height: 34px; \n fill: ", ";\n ", "\n ", "\n"], ["\n position: absolute;\n top: -38px;\n left: -3.5px;\n width: 28px;\n height: 34px; \n fill: ", ";\n ", "\n ", "\n"])), function (p) { return p.theme.colors.primary[1]; }, function (p) { return p.$error && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["fill: ", ";"], ["fill: ", ";"])), p.theme.colors.negative); }, function (p) { return p.$disabled && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["fill: ", ";"], ["fill: ", ";"])), p.theme.colors.neutral[30]); });
|
|
170
|
+
var TearValue = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: absolute;\n top: -32px;\n left: -5px;\n width: 30px;\n text-align: center;\n font: ", ";\n white-space: nowrap;\n color: ", ";\n ", "\n ", " \n"], ["\n position: absolute;\n top: -32px;\n left: -5px;\n width: 30px;\n text-align: center;\n font: ", ";\n white-space: nowrap;\n color: ", ";\n ", "\n ", " \n"])), function (p) { return p.theme.font.labelSmall; }, function (p) { return p.theme.colors.primary[2]; }, function (p) { return p.$error && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["color: ", ";"], ["color: ", ";"])), p.theme.colors.neutral[100]); }, function (p) { return p.$disabled && css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["color: ", ";"], ["color: ", ";"])), p.theme.colors.neutral[50]); });
|
|
171
|
+
var Pulse = keyframes(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n 0% {\n opacity: 0.3;\n }\n 50% {\n opacity: 0.6;\n }\n 100% {\n opacity: 0.3;\n }\n"], ["\n 0% {\n opacity: 0.3;\n }\n 50% {\n opacity: 0.6;\n }\n 100% {\n opacity: 0.3;\n }\n"])));
|
|
172
|
+
var Knob = styled.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n position: absolute;\n left: -10px;\n top: -8px;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background-color: ", ";\n ", "\n ", " \n box-shadow: ", ";\n\n // Disabled control has no focus ring at all.\n ", "\n"], ["\n position: absolute;\n left: -10px;\n top: -8px;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background-color: ", ";\n ", "\n ", " \n box-shadow: ", ";\n\n // Disabled control has no focus ring at all.\n ", "\n"
|
|
173
|
+
// This is a 0x0 <div> used to mark where the knob is. The Knob will paint
|
|
174
|
+
// itself with the right offsets from this.
|
|
175
|
+
])), function (p) { return p.theme.colors.primary[1]; }, function (p) { return p.$error && css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["background-color: ", ";"], ["background-color: ", ";"])), p.theme.colors.negative); }, function (p) { return p.$disabled && css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["background-color: ", ";"], ["background-color: ", ";"])), p.theme.colors.neutral[30]); }, function (p) { return p.theme.shadows.small; }, function (p) { return !p.$disabled && css(templateObject_11 || (templateObject_11 = __makeTemplateObject([" \n &:before {\n content: '';\n position: absolute;\n left: -10px;\n right: -10px;\n top: -10px;\n bottom: -10px; \n border-radius: 50%;\n background-color: rgba(255, 255, 255, 0.1);\n z-index: -1;\n transition: opacity ease ", "ms;\n opacity: 0;\n }\n "], [" \n &:before {\n content: '';\n position: absolute;\n left: -10px;\n right: -10px;\n top: -10px;\n bottom: -10px; \n border-radius: 50%;\n background-color: rgba(255, 255, 255, 0.1);\n z-index: -1;\n transition: opacity ease ", "ms;\n opacity: 0;\n }\n "])), function (p) { return p.theme.animation.duration; }); });
|
|
176
|
+
// This is a 0x0 <div> used to mark where the knob is. The Knob will paint
|
|
177
|
+
// itself with the right offsets from this.
|
|
178
|
+
var KnobPosition = styled.div(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0px;\n z-index: 0; // Required z-offset for Knob::before\n"], ["\n position: absolute;\n left: 0;\n top: 0px;\n z-index: 0; // Required z-offset for Knob::before\n"])));
|
|
179
|
+
var TrackFill = styled.div(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 50%;\n background-color: ", ";\n ", "\n ", " \n border-radius: 2px;\n"], ["\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 50%;\n background-color: ", ";\n ", "\n ", " \n border-radius: 2px;\n"])), function (p) { return p.theme.colors.primary[1]; }, function (p) { return p.$error && css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["background-color: ", ";"], ["background-color: ", ";"])), p.theme.colors.negative); }, function (p) { return p.$disabled && css(templateObject_15 || (templateObject_15 = __makeTemplateObject(["background-color: ", ";"], ["background-color: ", ";"])), p.theme.colors.neutral[30]); });
|
|
180
|
+
var Track = styled.div(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n position: relative;\n height: 4px;\n border-radius: 2px;\n box-sizing: border-box;\n background-color: ", ";\n\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding-top: 1px;\n padding-left: 2px;\n padding-right: 2px;\n"], ["\n position: relative;\n height: 4px;\n border-radius: 2px;\n box-sizing: border-box;\n background-color: ", ";\n\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding-top: 1px;\n padding-left: 2px;\n padding-right: 2px;\n"])), function (p) { return p.theme.colors.primary[5]; });
|
|
181
|
+
var SliderStyled = styled(SliderBase)(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n position: relative;\n min-width: 200px;\n margin-top: 44px;\n padding-top: 8px; // Padding above and below to capture mouse-down\n padding-bottom: 8px;\n ", "\n cursor: ", ";\n user-select: none;\n outline: none;\n ", "\n\n ", "\n"], ["\n position: relative;\n min-width: 200px;\n margin-top: 44px;\n padding-top: 8px; // Padding above and below to capture mouse-down\n padding-bottom: 8px;\n ", "\n cursor: ", ";\n user-select: none;\n outline: none;\n ", "\n\n ", "\n"
|
|
182
|
+
/**
|
|
183
|
+
* Sliders allow users to view and select a value (or range) along a track.
|
|
184
|
+
* They’re ideal for adjusting settings such as volume and brightness, or for
|
|
185
|
+
* applying image filters.
|
|
186
|
+
*/
|
|
187
|
+
])), function (p) { return p.padded && css(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n padding-left: 12px;\n padding-right: 12px;\n "], ["\n padding-left: 12px;\n padding-right: 12px;\n "]))); }, function (p) { return p.disabled ? 'auto' : 'pointer'; }, function (p) { return p.disabled && css(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n pointer-events: none;\n "], ["\n pointer-events: none;\n "]))); }, function (p) { return !p.disabled && css(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n // Focus ring:\n &:focus ", ":before {\n animation: ", " 2s linear infinite;\n }\n\n &:hover ", ":before {\n animation: none;\n opacity: 0.7;\n } \n\n // Active focus ring:\n &:active ", ":before {\n animation: none;\n opacity: 1;\n }\n "], ["\n // Focus ring:\n &:focus ", ":before {\n animation: ", " 2s linear infinite;\n }\n\n &:hover ", ":before {\n animation: none;\n opacity: 0.7;\n } \n\n // Active focus ring:\n &:active ", ":before {\n animation: none;\n opacity: 1;\n }\n "])), Knob, Pulse, Knob, Knob); });
|
|
188
|
+
/**
|
|
189
|
+
* Sliders allow users to view and select a value (or range) along a track.
|
|
190
|
+
* They’re ideal for adjusting settings such as volume and brightness, or for
|
|
191
|
+
* applying image filters.
|
|
192
|
+
*/
|
|
193
|
+
var Slider = function (_a) {
|
|
194
|
+
var _b = _a.min, min = _b === void 0 ? 0 : _b, _c = _a.max, max = _c === void 0 ? 100 : _c, props = __rest(_a, ["min", "max"]);
|
|
195
|
+
return React.createElement(SliderStyled, __assign({ min: min, max: max }, props));
|
|
196
|
+
};
|
|
197
|
+
export { Slider };
|
|
198
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Textarea validates itself using the HTML validation API whenever its
|
|
4
|
+
* content changes. Listeners can use onValidate to obtain the resulting
|
|
5
|
+
* ValidityState.
|
|
6
|
+
*/
|
|
7
|
+
interface IProps {
|
|
8
|
+
/** @ignore */
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Textarea name.
|
|
12
|
+
*/
|
|
13
|
+
name?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Textarea value.
|
|
16
|
+
*/
|
|
17
|
+
value?: any;
|
|
18
|
+
/**
|
|
19
|
+
* Placeholder to show when the Textarea is empty.
|
|
20
|
+
*/
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Mark Textarea as disabled. A disabled Textarea cannot be interacted with.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Removes Textarea border and background.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
transparent?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* A Textarea can be in a ghost state, where content is being loaded.
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
ghost?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Textarea takes up all available horizontal space.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
fluid?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Height in rows.
|
|
44
|
+
*/
|
|
45
|
+
rows?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Minimum height in pixels.
|
|
48
|
+
*/
|
|
49
|
+
minHeight?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Is the Textarea in an error state?
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
error?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* If set, Textarea will use a monospaced font.
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
monospaced?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* If set, `Textarea` can be resized vertically.
|
|
62
|
+
*/
|
|
63
|
+
resizable?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* If set, `Textarea` can be made fullscreen (by the user).
|
|
66
|
+
*/
|
|
67
|
+
fullscreen?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Listeners are notified whenever the user interacts with the Textarea.
|
|
70
|
+
*/
|
|
71
|
+
onChange?: (value: any) => void;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* `Textarea` encapsulated and styles the `<textarea>` element. Like `Input`,
|
|
75
|
+
* it can be contained in a `Form.Field`. A (vertical) resizer can be added
|
|
76
|
+
* using `resizable`, and a fullscreen toggle is added using `fullscreen`.
|
|
77
|
+
*/
|
|
78
|
+
declare const Textarea: (props: IProps) => React.JSX.Element;
|
|
79
|
+
export { Textarea, IProps };
|
|
@@ -0,0 +1,65 @@
|
|
|
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 } from 'styled-components';
|
|
18
|
+
// Helpers
|
|
19
|
+
import { SVG } from '../../svg';
|
|
20
|
+
import { InputWrapper } from '../Input/InputWrapper';
|
|
21
|
+
var TextareaBase = function (props) {
|
|
22
|
+
// Ref to <textarea>: used to set fullscreen.
|
|
23
|
+
var textareaRef = React.useRef(null);
|
|
24
|
+
// Current value:
|
|
25
|
+
var _a = React.useState(props.value), value = _a[0], setValue = _a[1];
|
|
26
|
+
// Update value state when value prop changes.
|
|
27
|
+
React.useEffect(function () {
|
|
28
|
+
setValue(props.value);
|
|
29
|
+
}, [props.value]);
|
|
30
|
+
var handleChange = function (e) {
|
|
31
|
+
setValue(e.target.value);
|
|
32
|
+
if (props.onChange) {
|
|
33
|
+
props.onChange(e.target.value);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var toggleFullscreen = function () {
|
|
37
|
+
if (document.fullscreenElement) {
|
|
38
|
+
document.exitFullscreen();
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
textareaRef.current.requestFullscreen();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return (React.createElement(InputWrapper, { fluid: props.fluid, ghost: props.ghost, error: props.error, disabled: props.disabled, transparent: props.transparent },
|
|
45
|
+
React.createElement("textarea", { className: props.className, ref: textareaRef, name: props.name, value: value == null ? '' : value, placeholder: props.placeholder, disabled: props.disabled, rows: props.rows, tabIndex: 0, onChange: handleChange }),
|
|
46
|
+
props.fullscreen &&
|
|
47
|
+
React.createElement(FullscreenToggle, { onClick: toggleFullscreen },
|
|
48
|
+
React.createElement("use", { xlinkHref: SVG.Icons.Fullscreen }))));
|
|
49
|
+
};
|
|
50
|
+
var FullscreenToggle = styled.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n right: 12px;\n top: 12px;\n width: 16px;\n height: 16px;\n cursor: pointer;\n fill: ", ";\n"], ["\n position: absolute;\n right: 12px;\n top: 12px;\n width: 16px;\n height: 16px;\n cursor: pointer;\n fill: ", ";\n"])), function (p) { return p.theme.colors.primary[3]; });
|
|
51
|
+
var TextareaStyled = styled(TextareaBase)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: relative;\n // No resize grip\n resize: ", "; \n\n // Height\n ", "\n ", "\n \n width: 100%;\n box-sizing: border-box;\n z-index: 0;\n color: ", ";\n border: none;\n outline: none;\n background: ", ";\n\n // Font:\n font: ", ";\n ", "\n text-align: left;\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 // Define colors for selected text.\n &::selection {\n background-color: ", ";\n color: ", ";\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 position: relative;\n // No resize grip\n resize: ", "; \n\n // Height\n ", "\n ", "\n \n width: 100%;\n box-sizing: border-box;\n z-index: 0;\n color: ", ";\n border: none;\n outline: none;\n background: ", ";\n\n // Font:\n font: ", ";\n ", "\n text-align: left;\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 // Define colors for selected text.\n &::selection {\n background-color: ", ";\n color: ", ";\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"
|
|
52
|
+
/**
|
|
53
|
+
* `Textarea` encapsulated and styles the `<textarea>` element. Like `Input`,
|
|
54
|
+
* it can be contained in a `Form.Field`. A (vertical) resizer can be added
|
|
55
|
+
* using `resizable`, and a fullscreen toggle is added using `fullscreen`.
|
|
56
|
+
*/
|
|
57
|
+
])), function (p) { return p.resizable ? 'vertical' : 'none'; }, function (p) { return !p.minHeight && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["min-height: 80px;"], ["min-height: 80px;"]))); }, function (p) { return p.minHeight && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["min-height: ", "px;"], ["min-height: ", "px;"])), p.minHeight); }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return (p.disabled || p.transparent || p.ghost) ? 'transparent' : p.theme.colors.neutral[100]; }, function (p) { return p.theme.font.bodyLarge; }, function (p) { return p.monospaced && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["font: ", ";"], ["font: ", ";"])), p.theme.font.dataLarge); }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.colors.primary[2]; }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.theme.colors.primary[3]; });
|
|
58
|
+
/**
|
|
59
|
+
* `Textarea` encapsulated and styles the `<textarea>` element. Like `Input`,
|
|
60
|
+
* it can be contained in a `Form.Field`. A (vertical) resizer can be added
|
|
61
|
+
* using `resizable`, and a fullscreen toggle is added using `fullscreen`.
|
|
62
|
+
*/
|
|
63
|
+
var Textarea = function (props) { return React.createElement(TextareaStyled, __assign({}, props)); };
|
|
64
|
+
export { Textarea };
|
|
65
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|